Explorar el Código

Merge remote-tracking branch 'ulm/master'

Joeri Exelmans hace 2 años
padre
commit
39ec01f1ce

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 280 - 278
package-lock.json


+ 13 - 13
package.json

@@ -1,32 +1,32 @@
 {
 	"devDependencies": {
-		"@emotion/react": "^11.10.5",
-		"@mantine/core": "^5.10.0",
-		"@mantine/hooks": "^5.10.0",
+		"@emotion/react": "^11.10.6",
+		"@mantine/core": "^5.10.5",
+		"@mantine/hooks": "^5.10.5",
 		"@tabler/icons": "^1.119.0",
 		"@types/d3": "^7.4.0",
 		"@types/d3-drag": "^3.0.2",
 		"@types/d3-force": "^3.0.4",
 		"@types/d3-selection": "^3.0.4",
 		"@types/mocha": "^10.0.1",
-		"@types/node": "^18.11.18",
-		"@types/react": "^18.0.26",
-		"@types/react-dom": "^18.0.10",
+		"@types/node": "^18.14.6",
+		"@types/react": "^18.0.28",
+		"@types/react-dom": "^18.0.11",
 		"mocha": "^10.2.0",
 		"nyc": "^15.1.0",
 		"ts-loader": "^9.4.2",
 		"url-loader": "^4.1.1",
-		"webpack": "^5.75.0",
-		"webpack-cli": "^4.10.0",
+		"webpack": "^5.76.0",
+		"webpack-cli": "^5.0.1",
 		"webpack-dev-server": "^4.11.1",
-		"fork-ts-checker-webpack-plugin": "^7.2.14 "
+		"fork-ts-checker-webpack-plugin": "^7.3.0"
 	},
 	"dependencies": {
-		"allotment": "^1.17.1",
+		"allotment": "^1.18.1",
 		"buffer": "^6.0.3",
 		"crypto-browserify": "^3.12.0",
 		"css-loader": "^6.7.3",
-		"d3": "^7.8.0",
+		"d3": "^7.8.2",
 		"d3-drag": "^3.0.0",
 		"d3-force": "^3.0.0",
 		"d3-scale": "^4.0.2",
@@ -34,11 +34,11 @@
 		"lodash": "^4.17.21",
 		"react": "^18.2.0",
 		"react-dom": "^18.2.0",
-		"react-icons": "^4.7.1",
+		"react-icons": "^4.8.0",
 		"stream-browserify": "^3.0.0",
 		"style-loader": "^3.3.1",
 		"ts-node": "^10.9.1",
-		"typescript": "^4.9.4",
+		"typescript": "^4.9.5",
 		"uuid": "^9.0.0"
 	},
 	"scripts": {

+ 1 - 1
src/frontend/app.tsx

@@ -32,7 +32,7 @@ export function getApp() {
                                 <Title order={4} style={{paddingLeft: '5px'}}>Pick a demo:</Title>
                                 <Tabs.List>
                                     <Tabs.Tab style={{width: '100%', border: 0}} value="welcome">Welcome</Tabs.Tab>
-                                    <Tabs.Tab style={{width: '100%', border: 0}} value="pd">Primitive Delta</Tabs.Tab>
+                                    <Tabs.Tab style={{width: '100%', border: 0}} value="pd">Primitive Deltas</Tabs.Tab>
                                     <Tabs.Tab style={{width: '100%', border: 0}} value="editor">Rountangle
                                         Editor</Tabs.Tab>
                                     <Tabs.Tab style={{width: '100%', border: 0}} value="corr">Correspondence</Tabs.Tab>

+ 30 - 46
src/frontend/demo_bm.tsx

@@ -1,32 +1,13 @@
-import * as React from "react";
-import {
-    SimpleGrid,
-    Text,
-    Title,
-    Group,
-    Stack,
-    Button,
-    Space,
-    Textarea,
-    Tabs,
-    HoverCard,
-    ActionIcon,
-    Center,
-    Switch,
-    Grid,
-    Modal, Image
-} from "@mantine/core";
+import * as React from 'react';
+import {Center, Grid, Group, Space, Stack, Text, Title} from '@mantine/core';
 
-import {PrimitiveRegistry} from "../onion/primitive_delta";
-import {mockUuid} from "../onion/test_helpers";
-import {makeInfoHoverCardIcon} from "./help_icons";
-import {newVersionedModel, VersionedModelState, undoButtonHelpText} from "./versioned_model";
-import {newCorrespondence, undoButtonHelpTextCorr} from "./correspondence";
-import {newManualRenderer, ManualRendererProps} from "./manual_renderer";
-import corr_csImage from "./assets/corr_cs.svg";
-import corr_asImage from "./assets/corr_as.svg";
-import corr_corrImage from "./assets/corr_corr.svg";
-import {Actionblock, Resultblock} from "./blocks";
+import {PrimitiveRegistry} from '../onion/primitive_delta';
+import {mockUuid} from '../onion/test_helpers';
+import {makeInfoHoverCardIcon} from './help_icons';
+import {newVersionedModel, undoButtonHelpText, VersionedModelState} from './versioned_model';
+import {newCorrespondence, undoButtonHelpTextCorr} from './correspondence';
+import {ManualRendererProps, newManualRenderer} from './manual_renderer';
+import {Actionblock, Resultblock} from './blocks';
 
 export const demo_BM_description =
     <>
@@ -34,42 +15,46 @@ export const demo_BM_description =
             Blended Modeling
         </Title>
         <Text>
-            This demo now introduces a second concrete syntax which is for sake of simplicity the same as the first one:
+            This demo introduces a second concrete syntax which is for sake of simplicity the same as the first one:
             a rountangle editor.
-            The difference to the Correspondence demo is that the AS can not be edited directly anymore, but only
+            The difference to the previous Correspondence demo is that the AS can not be edited directly anymore, but only
             indirectly via one of the two concrete syntaxes.
         </Text>
         <Text>
-            The connection between the different canvas on the right side is as follows:<br/>
-            CS1 &harr; Corr1 &harr; AS &harr; Corr2 &harr; CS2<br/>
-            Thus, we have now two Correspondence models that both creates correspondences between elements of the
+            The connection between the different canvas on the right side is as follows:
+        </Text>
+        <Text>
+            CS1 &harr; Corr1 &harr; AS &harr; Corr2 &harr; CS2
+        </Text>
+        <Text>
+            Thus, we have now two Correspondence models which both creates correspondences between elements of the
             central AS and their linked CS.
         </Text>
         <Text>
-            In consequence, now we also have two independent parsing and rendering functions for each CS that can be
+            In consequence, we also have two independent parsing and rendering functions for each CS which can be
             triggered automatically or manually.
         </Text>
         <Text>
-            With this scenario we simulate a blended modeling environment: One can create rountangles in the first CS.
+            With this scenario, we simulate a blended modeling environment: One can create rountangles in the first CS.
             All changes are reflected immediately in the AS. At some point, the user switches over to the other CS. At
             this point, the rendering from the AS to the second CS has to be triggered and, if necessary, missing
-            information (e. g., layout information) has to be entered.
+            information, such as layout information, has to be entered.
         </Text>
         <Text>
             Note, that the layout in the second CS can (and most likely will) differ from the layout of the first CS.
             Nevertheless, both models are parsed into the same AS model and are thus semantically equivalent.
         </Text>
         <Text>
-            From now on, the user can edit the rountangles in the second CS and - if the auto parsing is switched on -
+            From now on, the user can edit the rountangles in the second CS and – if the auto parsing is switched on –
             all changes are reflected in the AS.
             At some point, the user can switch back to CS 1, likely involving another rendering step to enter missing
             information.
         </Text>
         <Text>
-            Since all models are built upon our versioning approach, all changes are kept in Deltas and thus, each step
-            can be undone/redone, one can jump to any previous version on any side and all conflicts on any level are
-            detected and properly handled. This includes simultaneous changes on both sides! That means, collaborative
-            blended modeling is directly supported!
+            Since all models are built upon our versioning approach, all changes are kept in Deltas and, thus, each step
+            can be undone or redone: One can navigate to any previous version on any side and all conflicts on any level are
+            detected and properly handled. This includes simultaneous changes on both sides. That means, collaborative
+            blended modeling is directly supported.
         </Text>
         <Text>
             Switching off the "auto parsing" simulates asynchronous collaboration where several changes are accumulated
@@ -79,18 +64,18 @@ export const demo_BM_description =
             One possible walk-through of this demo is very similar to the steps of the Correspondence demo:
         </Text>
         <Actionblock>
-            1. Create a Rountangle!
+            1. Create a rountangle!
         </Actionblock>
         <Resultblock>
             Automatic parsing recognizes this rountangle as a state in the AS with ID = 2 and connects both via the
             Correspondence model by introducing a "connection node" with ID = 1.
         </Resultblock>
         <Resultblock>
-            As visualized in the above picture, the Correspondence model contains the complete CS and AS model plus some
+            As visualized in the picture above, the Correspondence model contains the complete CS and AS model plus some
             more information.
         </Resultblock>
         <Actionblock>
-            2. Draw a second Rountangle and move and resize it such that the new rountangle completely surrounds the
+            2. Draw a second rountangle and move and resize it such that the new rountangle completely surrounds the
             first one!
         </Actionblock>
         <Resultblock>
@@ -105,7 +90,7 @@ export const demo_BM_description =
             The rendering process detects missing information while it tries to create a model for the second CS.
         </Resultblock>
         <Resultblock>
-            A new dialog appears where one can position/size the rectangles in the second CS.
+            A new dialog appears where one can position and resize the rectangles in the second CS.
         </Resultblock>
         <Actionblock>
             4. Position the new state according to the given constraints!
@@ -124,7 +109,6 @@ export const demo_BM_description =
             Any conflicting Deltas are identified and the user has to choose, which of the non-conflicting version he/she wants to apply.
             A merging view that allows to combine changes (merge action) is in preparation.
         </Resultblock>
-        <Space h="20px"/>
     </>;
 
 export function getDemoBM() {

+ 14 - 18
src/frontend/demo_corr.tsx

@@ -21,41 +21,38 @@ export const demo_Corr_description =
         </Title>
         <Text>
             The different parts we have seen in the previous demos, are now in combined in different tabs in one column.
-            The second row is just a copy of the upper one to enable the simultaneous observation of changes in the
+            The second row is just a copy of the upper one and shows exactly the same model(s). This allows the simultaneous observation of changes in the
             different models.
         </Text>
         <Text>
-            The following picture shows the connection of the different models combined in the "Concrete Syntax" (CS)
+            The following figure shows the connection of the different models combined in the "Concrete Syntax" (CS)
             column.
-            The two abstraction levels of Deltas L1 and L0 are combined as "Delta(s)" and the History is ommitted in the
-            picture.
+            The two abstraction levels of Deltas L1 and L0 are combined as "CS Delta(s)" and the History is omitted in the
+            figure.
         </Text>
         <Image src={corr_csImage}/>
-        <Space h="10px"/>
         <Text>
             Analogously, the third column combines the different models shown in the first demo "Primitive Delta" into
-            one view, representing the "Abstract Syntax model" (AS).
+            a single view, representing the "Abstract Syntax model" (AS).
             The difference to the Concrete Syntax in the first column is, that there is no additional "user-friendly"
-            editor for editing the state. Instead, the state graph can be manipulated directly as reflected in the
-            following picture:
+            editor for editing the state. Instead, the state graph can be manipulated directly as already introduced in the first
+            demo "Primitive Deltas". This way of manipulation is also illustrated in the following picture.
         </Text>
         <Image src={corr_asImage}/>
-        <Space h="10px"/>
         <Text>
-            Inbetween the CS and AS the "Correspondence model" (Corr) encapsulates and connects the Deltas of the CS and
+            Between the CS and AS the "Correspondence model" (Corr) encapsulates and connects the Deltas of the CS and
             AS models as visualized in the following picture.
         </Text>
         <Image src={corr_corrImage}/>
-        <Space h="10px"/>
         <Text>
             The creation of Deltas of the Correspondence model and AS Deltas is triggered by the "Parsing" process.
             Parsing can either be automatically started after each user interaction or interactively at specific points
             in time, simulated by pressing the "Parse &gt;&gt;" button in the upper right corner of the first column.
         </Text>
         <Text>
-            In turn, changes to the AS model are taken into account in the rendering process. As some user interaction
-            may be required due to missing information such as layout information, this process is not automatically
-            triggered by default.
+            In turn, changes to the AS model are taken into account in the rendering process. Since the CS can contain
+            information the AS does not contain, such as layout information, some user interaction
+            may be required to add this missing information. This process is not automatically triggered by default.
         </Text>
         <Text>
             Common to all these three models (CS, Corr, AS) is the central foundation in Deltas encoding any change of
@@ -64,7 +61,7 @@ export const demo_Corr_description =
             the models.
         </Text>
         <Text>
-            The interesting part is now the parsing (CS &rarr; AS) and rendering (AS &rarr; CS).
+            This demo focuses on the parsing (CS &rarr; AS) and rendering (AS &rarr; CS).
         </Text>
         <Actionblock>
             1. Create a Rountangle!
@@ -78,7 +75,7 @@ export const demo_Corr_description =
         </Resultblock>
         <Resultblock>
             As visualized in the above picture, the Correspondence model contains the complete CS and AS model plus some
-            more information.
+            more information relevant to maintain the relations between elements contained in the AS and the CS.
         </Resultblock>
         <Actionblock>
             2. Draw a second Rountangle and move and resize it such that the new rountangle completely surrounds the
@@ -99,7 +96,7 @@ export const demo_Corr_description =
             The rendering process detects missing information while it tries to create a CS model for the new state.
         </Resultblock>
         <Resultblock>
-            A new dialog appears where one can position/size the new rectangle.
+            A new dialog appears where one can position and resize the new rectangle.
         </Resultblock>
         <Resultblock>
             The system does not allow any position/size whose parsing would result in a different AS (e.g., additional or missing "hasParent" relation).
@@ -110,7 +107,6 @@ export const demo_Corr_description =
         <Resultblock>
             Your CS model is updated and the rountangles are visualized accordingly.
         </Resultblock>
-        <Space h="20px"/>
         {/* TODO: remove z-index!
             TODO: deleted nodes/Rountangles are still considered in the "Missing information"-dialog
             TODO: everywhere: Arrows with directions!

+ 5 - 6
src/frontend/demo_editor.tsx

@@ -19,26 +19,25 @@ export const demo_Editor_description =
             Next to this text you can see three columns <strong>Rountangle Editor</strong>, <strong>Deltas</strong>,
             and <strong>State Graph</strong>. In the Rountangle Editor, you can create (unnamed) rountangles by
             left-clicking on the grey area with the alt-key pressed (see also the small info in the upper right corner
-            of each canvas). You can move these rountangle and resize them.
+            of each canvas). You can move these rountangle around and resize them.
         </Text>
         <Text>
             In this demo, the editable state graph of the "Primitive Delta"-demo is replaced by a Rountangle Editor.
-            Again, any action in the Rountangle Editor results in a set of primitive deltas (shown in the center) that are applied to the (empty) state graph (on the right).
+            Again, any action in the Rountangle Editor results in a set of deltas (shown at the center) that are applied to the (empty) state graph (on the right).
             Note that this state graph is no longer (directly) editable. The current model state is visualized in the Rountangle Editor from which the user interaction originated.
         </Text>
         <Text>
             In technical terms, the Rountangle Editor is a <em>projectional editor</em> for the state graph (on the right).
         </Text>
         <Image src={editor}/>
-        <Space h="10px"/>
         <Actionblock>
             1. Create a rountangle!
         </Actionblock>
         <Resultblock>
-            In the second column, one composite delta "createRountangle" was created.
+            In the center column, one composite delta (or L1 delta) "createRountangle" was created.
         </Resultblock>
         <Resultblock>
-            In the second tab "Deltas (L0)" of the second column you can see the primitive deltas a "createRountangle" consists of.
+            In the second tab "Deltas (L0)" of the center column, you can see the primitive deltas a "createRountangle" composite delta consists of.
         </Resultblock>
         <Resultblock>
             The result of an application of all primitive deltas to an empty initial state is shown in the third column "State Graph".
@@ -67,10 +66,10 @@ export const demo_Editor_description =
         <Resultblock>
             In the "Delta (L1)" and "Delta (L0)" tabs, the deltas corresponding to the current version are also highlighted.
         </Resultblock>
+        <Space h="5px"/>
         <Text>
             Feel free to play around with the editor and watch the changes in the other views.
         </Text>
-        <Space h="20px"/>
     </>;
 
 export function getDemoEditor() {

+ 20 - 39
src/frontend/demo_pd.tsx

@@ -1,45 +1,32 @@
-import * as React from "react";
-import * as Icons from "@tabler/icons";
-import {
-    Title,
-    Text,
-    Grid,
-    Button,
-    SimpleGrid,
-    Group,
-    Center,
-    ScrollArea,
-    Card,
-    CloseButton,
-    Divider,
-    Space, Image,
-} from "@mantine/core";
-
-import {PrimitiveRegistry} from "../onion/primitive_delta";
-import {PrimitiveValue} from "../onion/types";
-import {mockUuid} from "../onion/test_helpers";
-import {GrContactInfo} from "react-icons/all";
-import {Actionblock, Resultblock} from "./blocks";
+import * as React from 'react';
+import * as Icons from '@tabler/icons';
+import {Button, Divider, Group, Image, SimpleGrid, Space, Text, Title,} from '@mantine/core';
+
+import {PrimitiveRegistry} from '../onion/primitive_delta';
+import {PrimitiveValue} from '../onion/types';
+import {mockUuid} from '../onion/test_helpers';
+import {Actionblock, Resultblock} from './blocks';
 import pdImage from './assets/pd.svg';
+import {newVersionedModel, undoButtonHelpText, VersionedModelState,} from './versioned_model';
+import {makeInfoHoverCardIcon} from './help_icons';
 
 export const demo_PD_description =
     <>
         <Title order={4}>
-            Primitive deltas
+            Primitive Deltas
         </Title>
         { /*
             TODO: elaborate more on the structure of the state graph.
         */ }
         <Text>
-            On the right side you will see three canvases "State", "History", and "Deltas(L0)".
+            On the right side, you see three canvases "State", "History", and "Deltas(L0)".
         </Text>
         <Text>
-            "State" shows the state graph, which represents the state of our model. If you now e.g. click with the right
-            mouse button on a free area in the canvas, then this action is converted into a "Delta". The set of deltas
+            "State" shows the state graph, which represents the state of our model. If you click with the right
+            mouse button on a free area in the canvas, this action is converted into a "Delta". The set of one or many Deltas
             is then in turn applied to the state graph, resulting in the visualization of a new node. The following image visualizes this.
         </Text>
         <Image src={pdImage}/>
-        <Space h="10px"/>
         <Actionblock>
             1. Click with your right mouse button into the "State" canvas!
         </Actionblock>
@@ -56,7 +43,7 @@ export const demo_PD_description =
             2. Hover with your mouse over the circle with an (i) inside the "State" canvas!
         </Actionblock>
         <Resultblock>
-            A tooltip with information about possible interactions of this canvas is shown.
+            A tooltip with information about possible interactions with this canvas is shown.
         </Resultblock>
         <Actionblock>
             3. Create an edge to a value by right-dragging from the created node into the canvas!
@@ -64,8 +51,10 @@ export const demo_PD_description =
         <Resultblock>
             The generated delta "EDG(..)" depends on the creation (NEW(0)) of the node from which the edge originates.
         </Resultblock>
-        This detailed recording of each action allows to easily detect conflicts between two versions or to merge
-        conflict-free versions.
+        <Space h="10px"/>
+        <Text>This detailed recording of each action allows to easily detect conflicts between two versions or to merge
+            conflict-free versions.</Text>
+        <Space h="10px"/>
         <Actionblock>
             4. Press the button "Undo" once!
         </Actionblock>
@@ -73,7 +62,7 @@ export const demo_PD_description =
             The version before creating the edge is selected in the "History" canvas.
         </Resultblock>
         <Resultblock>
-            In the "Delta"-view the set of Deltas that are associated with the currently selected version is drawn with
+            In the "Delta"-view, the set of Deltas that are associated with the currently selected version are drawn with
             a bold border.
         </Resultblock>
         <Actionblock>
@@ -96,17 +85,9 @@ export const demo_PD_description =
         <Resultblock>
             In the History, you can now choose between two "Restore" actions, but they cannot be applied simultaneously due to the conflict.
         </Resultblock>
-        <Space h="20px"/>
     </>;
 
 
-import {
-    newVersionedModel,
-    VersionedModelState,
-    undoButtonHelpText,
-} from "./versioned_model";
-import {makeInfoHoverCardIcon} from "./help_icons";
-
 export function getDemoPD() {
     const primitiveRegistry = new PrimitiveRegistry();
     const generateUUID = mockUuid();

+ 12 - 34
src/frontend/demo_welcome.tsx

@@ -1,23 +1,6 @@
-import * as React from "react";
-import * as Icons from "@tabler/icons";
-import {
-    Title,
-    Text,
-    Grid,
-    Button,
-    SimpleGrid,
-    Group,
-    Center,
-    ScrollArea,
-    Card,
-    CloseButton,
-    Divider,
-    Space, List
-} from "@mantine/core";
-
-import {PrimitiveRegistry} from "../onion/primitive_delta";
-import {mockUuid} from "../onion/test_helpers";
-import {Actionblock, Resultblock} from "./blocks";
+import * as React from 'react';
+import {List, Space, Text, Title} from '@mantine/core';
+import {Actionblock, Resultblock} from './blocks';
 
 export const demo_Welcome_description =
     <>
@@ -28,17 +11,17 @@ export const demo_Welcome_description =
             This demo site performs two tasks:
         </Text>
         <List type="ordered">
-            <List.Item>Presenting the possibilites of our approach.</List.Item>
+            <List.Item>Presenting the possibilities of our approach.</List.Item>
             <List.Item>Improving the understandability by example walk-throughs.</List.Item>
         </List>
         <Text>
-            In our explanations of the different views we use the following blocks:
-            Every block with an <Text span c='darkorange'>orange</Text> mark on the left side contains an action
-            that
-            you should do. Each block with a <Text span c="royalblue">blue</Text> border describes what you can
-            observe,
-            once the action has been executed.
+            In our explanations of the different views we use the following styled text-boxes:
+            <List type="unordered">
+                <List.Item>Every block with an <Text span c='darkorange'><strong>orange</strong></Text> mark on the left side contains an <strong>action</strong> that <strong>you should do.</strong></List.Item>
+                <List.Item>Each block with a <Text span c="royalblue"><strong>blue</strong></Text> border describes what <strong>you can observe</strong>, once the action has been executed.</List.Item>
+            </List>
         </Text>
+        <Space h='15px'/>
         <Text fw={700}>
             Example:
         </Text>
@@ -46,21 +29,16 @@ export const demo_Welcome_description =
             1. Perform this action!
         </Actionblock>
         <Resultblock>
-            This block describes the generated output.
+            This block describes the generated output you can observe.
         </Resultblock>
         <Space h='5px'/>
         <Text>
-            Please select one of the demos above. We recommend that you complete the demos in the order listed.
+            Please select one of the demos above. We recommend that you complete the demos in the listed order.
         </Text>
         <Space h="20px"/>
     </>;
 
 
-import {
-    newVersionedModel,
-    VersionedModelState,
-} from "./versioned_model";
-
 export function getWelcome() {
     return function () {
         return <></>

+ 12 - 1
src/frontend/index.css

@@ -62,5 +62,16 @@ html,body, #root {
 }
 
 .mantine-ScrollArea-scrollbar {
-    padding: 0px;
+    padding: 0;
 }
+
+.mantine-Tabs-panel {
+    user-select: text;
+    padding-left: 5px;
+    padding-bottom: 10px;
+}
+
+.mantine-Tabs-panel img {
+    margin: 20px auto;
+    max-width: 400px;
+}