@api-client/ui 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -2
- package/test/env.ts +15 -0
- package/test/tsconfig.json +1 -7
- package/web-test-runner.config.js +5 -1
- package/build/src/visualization/elements/VizAssociationElement.d.ts +0 -4
- package/build/src/visualization/elements/VizAssociationElement.d.ts.map +0 -1
- package/build/src/visualization/elements/VizAssociationElement.js +0 -4
- package/build/src/visualization/elements/VizAssociationElement.js.map +0 -1
- package/build/src/visualization/elements/VizWorkspaceElement.d.ts +0 -110
- package/build/src/visualization/elements/VizWorkspaceElement.d.ts.map +0 -1
- package/build/src/visualization/elements/VizWorkspaceElement.js +0 -321
- package/build/src/visualization/elements/VizWorkspaceElement.js.map +0 -1
- package/build/src/visualization/elements/WorkspaceStyles.d.ts +0 -3
- package/build/src/visualization/elements/WorkspaceStyles.d.ts.map +0 -1
- package/build/src/visualization/elements/WorkspaceStyles.js +0 -168
- package/build/src/visualization/elements/WorkspaceStyles.js.map +0 -1
- package/build/src/visualization/lib/AnchorFinder.d.ts +0 -64
- package/build/src/visualization/lib/AnchorFinder.d.ts.map +0 -1
- package/build/src/visualization/lib/AnchorFinder.js +0 -107
- package/build/src/visualization/lib/AnchorFinder.js.map +0 -1
- package/build/src/visualization/lib/AnchorUtils.d.ts +0 -10
- package/build/src/visualization/lib/AnchorUtils.d.ts.map +0 -1
- package/build/src/visualization/lib/AnchorUtils.js +0 -44
- package/build/src/visualization/lib/AnchorUtils.js.map +0 -1
- package/build/src/visualization/lib/AssociationAnchors.d.ts +0 -134
- package/build/src/visualization/lib/AssociationAnchors.d.ts.map +0 -1
- package/build/src/visualization/lib/AssociationAnchors.js +0 -351
- package/build/src/visualization/lib/AssociationAnchors.js.map +0 -1
- package/build/src/visualization/lib/LabelSketch.d.ts +0 -16
- package/build/src/visualization/lib/LabelSketch.d.ts.map +0 -1
- package/build/src/visualization/lib/LabelSketch.js +0 -53
- package/build/src/visualization/lib/LabelSketch.js.map +0 -1
- package/build/src/visualization/lib/LineSketch.d.ts +0 -26
- package/build/src/visualization/lib/LineSketch.d.ts.map +0 -1
- package/build/src/visualization/lib/LineSketch.js +0 -55
- package/build/src/visualization/lib/LineSketch.js.map +0 -1
- package/build/src/visualization/lib/Point.d.ts +0 -74
- package/build/src/visualization/lib/Point.d.ts.map +0 -1
- package/build/src/visualization/lib/Point.js +0 -121
- package/build/src/visualization/lib/Point.js.map +0 -1
- package/build/src/visualization/lib/PositionUtils.d.ts +0 -65
- package/build/src/visualization/lib/PositionUtils.d.ts.map +0 -1
- package/build/src/visualization/lib/PositionUtils.js +0 -205
- package/build/src/visualization/lib/PositionUtils.js.map +0 -1
- package/build/src/visualization/lib/SelectionManager.d.ts +0 -183
- package/build/src/visualization/lib/SelectionManager.d.ts.map +0 -1
- package/build/src/visualization/lib/SelectionManager.js +0 -481
- package/build/src/visualization/lib/SelectionManager.js.map +0 -1
- package/build/src/visualization/lib/ShapeArtist.d.ts +0 -45
- package/build/src/visualization/lib/ShapeArtist.d.ts.map +0 -1
- package/build/src/visualization/lib/ShapeArtist.js +0 -209
- package/build/src/visualization/lib/ShapeArtist.js.map +0 -1
- package/build/src/visualization/lib/SvgMarkers.d.ts +0 -14
- package/build/src/visualization/lib/SvgMarkers.d.ts.map +0 -1
- package/build/src/visualization/lib/SvgMarkers.js +0 -77
- package/build/src/visualization/lib/SvgMarkers.js.map +0 -1
- package/build/src/visualization/lib/TipSketch.d.ts +0 -26
- package/build/src/visualization/lib/TipSketch.d.ts.map +0 -1
- package/build/src/visualization/lib/TipSketch.js +0 -77
- package/build/src/visualization/lib/TipSketch.js.map +0 -1
- package/build/src/visualization/lib/TouchSupport.d.ts +0 -14
- package/build/src/visualization/lib/TouchSupport.d.ts.map +0 -1
- package/build/src/visualization/lib/TouchSupport.js +0 -55
- package/build/src/visualization/lib/TouchSupport.js.map +0 -1
- package/build/src/visualization/lib/Utils.d.ts +0 -25
- package/build/src/visualization/lib/Utils.d.ts.map +0 -1
- package/build/src/visualization/lib/Utils.js +0 -59
- package/build/src/visualization/lib/Utils.js.map +0 -1
- package/build/src/visualization/lib/VisualizationTypes.d.ts +0 -216
- package/build/src/visualization/lib/VisualizationTypes.d.ts.map +0 -1
- package/build/src/visualization/lib/VisualizationTypes.js +0 -3
- package/build/src/visualization/lib/VisualizationTypes.js.map +0 -1
- package/build/src/visualization/lib/WorkspaceAlignment.d.ts +0 -51
- package/build/src/visualization/lib/WorkspaceAlignment.d.ts.map +0 -1
- package/build/src/visualization/lib/WorkspaceAlignment.js +0 -243
- package/build/src/visualization/lib/WorkspaceAlignment.js.map +0 -1
- package/build/src/visualization/lib/WorkspaceDebugging.d.ts +0 -104
- package/build/src/visualization/lib/WorkspaceDebugging.d.ts.map +0 -1
- package/build/src/visualization/lib/WorkspaceDebugging.js +0 -286
- package/build/src/visualization/lib/WorkspaceDebugging.js.map +0 -1
- package/build/src/visualization/lib/WorkspaceEdges.d.ts +0 -293
- package/build/src/visualization/lib/WorkspaceEdges.d.ts.map +0 -1
- package/build/src/visualization/lib/WorkspaceEdges.js +0 -1073
- package/build/src/visualization/lib/WorkspaceEdges.js.map +0 -1
- package/build/src/visualization/lib/WorkspaceGestures.d.ts +0 -119
- package/build/src/visualization/lib/WorkspaceGestures.d.ts.map +0 -1
- package/build/src/visualization/lib/WorkspaceGestures.js +0 -376
- package/build/src/visualization/lib/WorkspaceGestures.js.map +0 -1
- package/build/src/visualization/lib/WorkspaceSizing.d.ts +0 -66
- package/build/src/visualization/lib/WorkspaceSizing.d.ts.map +0 -1
- package/build/src/visualization/lib/WorkspaceSizing.js +0 -168
- package/build/src/visualization/lib/WorkspaceSizing.js.map +0 -1
- package/build/src/visualization/lib/lines/RectilinearLine.d.ts +0 -114
- package/build/src/visualization/lib/lines/RectilinearLine.d.ts.map +0 -1
- package/build/src/visualization/lib/lines/RectilinearLine.js +0 -605
- package/build/src/visualization/lib/lines/RectilinearLine.js.map +0 -1
- package/build/src/visualization/lib/tips/RectilinearTip.d.ts +0 -26
- package/build/src/visualization/lib/tips/RectilinearTip.d.ts.map +0 -1
- package/build/src/visualization/lib/tips/RectilinearTip.js +0 -149
- package/build/src/visualization/lib/tips/RectilinearTip.js.map +0 -1
- package/build/src/visualization/lib/tips/TipArtist.d.ts +0 -22
- package/build/src/visualization/lib/tips/TipArtist.d.ts.map +0 -1
- package/build/src/visualization/lib/tips/TipArtist.js +0 -31
- package/build/src/visualization/lib/tips/TipArtist.js.map +0 -1
- package/build/src/visualization/lib/types.d.ts +0 -164
- package/build/src/visualization/lib/types.d.ts.map +0 -1
- package/build/src/visualization/lib/types.js +0 -2
- package/build/src/visualization/lib/types.js.map +0 -1
- package/build/src/visualization/plugin/dnd/DragAndDropPlugin.d.ts +0 -126
- package/build/src/visualization/plugin/dnd/DragAndDropPlugin.d.ts.map +0 -1
- package/build/src/visualization/plugin/dnd/DragAndDropPlugin.js +0 -260
- package/build/src/visualization/plugin/dnd/DragAndDropPlugin.js.map +0 -1
- package/build/src/visualization/plugin/group-selection/GroupSelection.d.ts +0 -93
- package/build/src/visualization/plugin/group-selection/GroupSelection.d.ts.map +0 -1
- package/build/src/visualization/plugin/group-selection/GroupSelection.js +0 -250
- package/build/src/visualization/plugin/group-selection/GroupSelection.js.map +0 -1
- package/build/src/visualization/plugin/positioning/DataModelLayout.d.ts +0 -10
- package/build/src/visualization/plugin/positioning/DataModelLayout.d.ts.map +0 -1
- package/build/src/visualization/plugin/positioning/DataModelLayout.js +0 -105
- package/build/src/visualization/plugin/positioning/DataModelLayout.js.map +0 -1
- package/build/src/visualization/plugin/positioning/WorkspaceLayout.d.ts +0 -93
- package/build/src/visualization/plugin/positioning/WorkspaceLayout.d.ts.map +0 -1
- package/build/src/visualization/plugin/positioning/WorkspaceLayout.js +0 -96
- package/build/src/visualization/plugin/positioning/WorkspaceLayout.js.map +0 -1
- package/build/src/visualization/viz-association.d.ts +0 -7
- package/build/src/visualization/viz-association.d.ts.map +0 -1
- package/build/src/visualization/viz-association.js +0 -3
- package/build/src/visualization/viz-association.js.map +0 -1
- package/build/src/visualization/viz-workspace.d.ts +0 -7
- package/build/src/visualization/viz-workspace.d.ts.map +0 -1
- package/build/src/visualization/viz-workspace.js +0 -3
- package/build/src/visualization/viz-workspace.js.map +0 -1
- package/src/visualization/elements/VizAssociationElement.ts +0 -3
- package/src/visualization/elements/VizWorkspaceElement.ts +0 -302
- package/src/visualization/elements/WorkspaceStyles.ts +0 -168
- package/src/visualization/lib/AnchorFinder.ts +0 -112
- package/src/visualization/lib/AnchorUtils.ts +0 -53
- package/src/visualization/lib/AssociationAnchors.ts +0 -418
- package/src/visualization/lib/LabelSketch.ts +0 -67
- package/src/visualization/lib/LineSketch.ts +0 -62
- package/src/visualization/lib/Point.ts +0 -134
- package/src/visualization/lib/PositionUtils.ts +0 -218
- package/src/visualization/lib/SelectionManager.ts +0 -513
- package/src/visualization/lib/ShapeArtist.ts +0 -222
- package/src/visualization/lib/SvgMarkers.ts +0 -80
- package/src/visualization/lib/TipSketch.ts +0 -91
- package/src/visualization/lib/TouchSupport.ts +0 -72
- package/src/visualization/lib/Utils.ts +0 -63
- package/src/visualization/lib/VisualizationTypes.ts +0 -232
- package/src/visualization/lib/WorkspaceAlignment.ts +0 -261
- package/src/visualization/lib/WorkspaceDebugging.ts +0 -313
- package/src/visualization/lib/WorkspaceEdges.ts +0 -1153
- package/src/visualization/lib/WorkspaceGestures.ts +0 -400
- package/src/visualization/lib/WorkspaceSizing.ts +0 -181
- package/src/visualization/lib/lines/RectilinearLine.ts +0 -589
- package/src/visualization/lib/tips/RectilinearTip.ts +0 -156
- package/src/visualization/lib/tips/TipArtist.ts +0 -34
- package/src/visualization/lib/types.ts +0 -173
- package/src/visualization/plugin/dnd/DragAndDropPlugin.ts +0 -294
- package/src/visualization/plugin/group-selection/GroupSelection.ts +0 -271
- package/src/visualization/plugin/positioning/DataModelLayout.ts +0 -114
- package/src/visualization/plugin/positioning/WorkspaceLayout.ts +0 -149
- package/src/visualization/viz-association.ts +0 -9
- package/src/visualization/viz-workspace.ts +0 -9
- package/test/env.d.ts +0 -9
- package/test/env.js +0 -7
- package/test/visualization/lib/AnchorFinder.test.ts +0 -313
- package/test/visualization/lib/AnchorUtils.test.ts +0 -178
- package/test/visualization/lib/PositionUtils.test.ts +0 -406
- package/test/visualization/lib/test-styles.css +0 -80
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
2
|
-
export default css `
|
|
3
|
-
:host {
|
|
4
|
-
display: block;
|
|
5
|
-
position: relative;
|
|
6
|
-
overflow: hidden;
|
|
7
|
-
background-color: var(--workspace-background-color, #e5e5e5);
|
|
8
|
-
|
|
9
|
-
--edge-line-color: var(--workspace-association-line-color, var(--md-ref-palette-neutral70));
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
:host ::slotted(*) {
|
|
13
|
-
position: absolute;
|
|
14
|
-
z-index: 2;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/* this chess board background was removed after a team meeting, May 2021. */
|
|
18
|
-
/* :host {
|
|
19
|
-
background-image:
|
|
20
|
-
linear-gradient(to right, rgba(226, 226, 226, 0.85), rgba(226, 226, 226, 0.85)),
|
|
21
|
-
linear-gradient(to right, black 50%, white 50%),
|
|
22
|
-
linear-gradient(to bottom, black 50%, white 50%);
|
|
23
|
-
background-blend-mode: normal, difference, normal;
|
|
24
|
-
background-size: 1.5em 1.5em;
|
|
25
|
-
} */
|
|
26
|
-
|
|
27
|
-
.hidden {
|
|
28
|
-
display: none;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.content {
|
|
32
|
-
position: absolute;
|
|
33
|
-
top: 0;
|
|
34
|
-
left: 0;
|
|
35
|
-
right: 0;
|
|
36
|
-
bottom: 0;
|
|
37
|
-
background-color: var(--workspace-content-background-color, #e5e5e5);
|
|
38
|
-
/* background-color: transparent; */
|
|
39
|
-
transform: scale(1) translate(0px, 0px);
|
|
40
|
-
transform-origin: top left;
|
|
41
|
-
border-radius: var(--workspace-content-border-radius, 12px);
|
|
42
|
-
border: 1px var(--workspace-border-color, #c0c0c0) solid;
|
|
43
|
-
box-shadow: var(--workspace-content-box-shadow, none);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.content ::slotted(.selected) {
|
|
47
|
-
border: 1px var(--selection-color) solid;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.association {
|
|
51
|
-
position: absolute;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.association polyline {
|
|
55
|
-
stroke-width: 2px;
|
|
56
|
-
fill: none;
|
|
57
|
-
outline: none;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.association .association-line {
|
|
61
|
-
fill: none;
|
|
62
|
-
stroke: var(--edge-line-color);
|
|
63
|
-
stroke-width: var(--workspace-association-line-width, 4px);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.association .association-line-area {
|
|
67
|
-
fill: none;
|
|
68
|
-
stroke: transparent;
|
|
69
|
-
stroke-width: 28px;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.association-group.hovered .edge-tip.association,
|
|
73
|
-
.association .association-line:hover,
|
|
74
|
-
.association-group.hovered .association-line {
|
|
75
|
-
--edge-line-color: var(--workspace-association-line-hover-color, var(--md-ref-palette-neutral60));
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.association-group.selected .edge-tip.association,
|
|
79
|
-
.association-group.selected .association-line {
|
|
80
|
-
--edge-line-color: var(--workspace-association-line-selection-color, var(--md-ref-palette-primary60));
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.selectedSecondary .edge-tip.association,
|
|
84
|
-
.selectedSecondary .association-line {
|
|
85
|
-
--edge-line-color: var(--workspace-association-line-secondary-selection-color, var(--md-ref-palette-primary70));
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/* Edge tips */
|
|
89
|
-
.edge-tip {
|
|
90
|
-
fill: #607d8b;
|
|
91
|
-
stroke: none;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.edge-tip.parent {
|
|
95
|
-
fill: var(--md-ref-palette-tertiary60);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.edge-tip.parameter-in {
|
|
99
|
-
fill: #ff9e91;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.edge-tip.parameter-out {
|
|
103
|
-
fill: #fbc02d;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.edge-tip.association {
|
|
107
|
-
stroke: var(--edge-line-color);
|
|
108
|
-
stroke-width: 3px;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.parameter-in path {
|
|
112
|
-
stroke: #ff9e91;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.parameter-out path {
|
|
116
|
-
stroke: #fbc02d;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.edge-vertex {
|
|
120
|
-
stroke: transparent;
|
|
121
|
-
fill: transparent;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.selected .edge-vertex,
|
|
125
|
-
.selectedSecondary .edge-vertex {
|
|
126
|
-
stroke: var(--selection-color);
|
|
127
|
-
stroke-width: 3px;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/* Edge label */
|
|
131
|
-
.association-label {
|
|
132
|
-
fill: var(--workspace-edge-label-color, #212121);
|
|
133
|
-
font-size: 0.9rem;
|
|
134
|
-
user-select: none;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.edge-name-input {
|
|
138
|
-
border: 1px #757575 solid;
|
|
139
|
-
padding: 4px 6px;
|
|
140
|
-
font-size: 1rem;
|
|
141
|
-
outline: none;
|
|
142
|
-
background-color: var(--workspace-edge-input-background-color, #fff);
|
|
143
|
-
color: var(--workspace-edge-input-color, initial);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.edge-name-input:focus {
|
|
147
|
-
border-color: var(--primary-color);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.selection-zone {
|
|
151
|
-
z-index: 100;
|
|
152
|
-
position: absolute;
|
|
153
|
-
width: 4px;
|
|
154
|
-
height: 4px;
|
|
155
|
-
border: 1px solid #2196f3;
|
|
156
|
-
background-color: var(--workspace-selection-zone-background-color, rgb(3 169 244 / 0.54));
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/* edges selection zones */
|
|
160
|
-
|
|
161
|
-
.association-draggable {
|
|
162
|
-
fill: white;
|
|
163
|
-
stroke: #424242;
|
|
164
|
-
stroke-width: 2;
|
|
165
|
-
cursor: pointer;
|
|
166
|
-
}
|
|
167
|
-
`;
|
|
168
|
-
//# sourceMappingURL=WorkspaceStyles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceStyles.js","sourceRoot":"","sources":["../../../../src/visualization/elements/WorkspaceStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqKjB,CAAA","sourcesContent":["import { css } from 'lit'\n\nexport default css`\n :host {\n display: block;\n position: relative;\n overflow: hidden;\n background-color: var(--workspace-background-color, #e5e5e5);\n\n --edge-line-color: var(--workspace-association-line-color, var(--md-ref-palette-neutral70));\n }\n\n :host ::slotted(*) {\n position: absolute;\n z-index: 2;\n }\n\n /* this chess board background was removed after a team meeting, May 2021. */\n /* :host {\n background-image:\n linear-gradient(to right, rgba(226, 226, 226, 0.85), rgba(226, 226, 226, 0.85)),\n linear-gradient(to right, black 50%, white 50%),\n linear-gradient(to bottom, black 50%, white 50%);\n background-blend-mode: normal, difference, normal;\n background-size: 1.5em 1.5em;\n} */\n\n .hidden {\n display: none;\n }\n\n .content {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: var(--workspace-content-background-color, #e5e5e5);\n /* background-color: transparent; */\n transform: scale(1) translate(0px, 0px);\n transform-origin: top left;\n border-radius: var(--workspace-content-border-radius, 12px);\n border: 1px var(--workspace-border-color, #c0c0c0) solid;\n box-shadow: var(--workspace-content-box-shadow, none);\n }\n\n .content ::slotted(.selected) {\n border: 1px var(--selection-color) solid;\n }\n\n .association {\n position: absolute;\n }\n\n .association polyline {\n stroke-width: 2px;\n fill: none;\n outline: none;\n }\n\n .association .association-line {\n fill: none;\n stroke: var(--edge-line-color);\n stroke-width: var(--workspace-association-line-width, 4px);\n }\n\n .association .association-line-area {\n fill: none;\n stroke: transparent;\n stroke-width: 28px;\n }\n\n .association-group.hovered .edge-tip.association,\n .association .association-line:hover,\n .association-group.hovered .association-line {\n --edge-line-color: var(--workspace-association-line-hover-color, var(--md-ref-palette-neutral60));\n }\n\n .association-group.selected .edge-tip.association,\n .association-group.selected .association-line {\n --edge-line-color: var(--workspace-association-line-selection-color, var(--md-ref-palette-primary60));\n }\n\n .selectedSecondary .edge-tip.association,\n .selectedSecondary .association-line {\n --edge-line-color: var(--workspace-association-line-secondary-selection-color, var(--md-ref-palette-primary70));\n }\n\n /* Edge tips */\n .edge-tip {\n fill: #607d8b;\n stroke: none;\n }\n\n .edge-tip.parent {\n fill: var(--md-ref-palette-tertiary60);\n }\n\n .edge-tip.parameter-in {\n fill: #ff9e91;\n }\n\n .edge-tip.parameter-out {\n fill: #fbc02d;\n }\n\n .edge-tip.association {\n stroke: var(--edge-line-color);\n stroke-width: 3px;\n }\n\n .parameter-in path {\n stroke: #ff9e91;\n }\n\n .parameter-out path {\n stroke: #fbc02d;\n }\n\n .edge-vertex {\n stroke: transparent;\n fill: transparent;\n }\n\n .selected .edge-vertex,\n .selectedSecondary .edge-vertex {\n stroke: var(--selection-color);\n stroke-width: 3px;\n }\n\n /* Edge label */\n .association-label {\n fill: var(--workspace-edge-label-color, #212121);\n font-size: 0.9rem;\n user-select: none;\n }\n\n .edge-name-input {\n border: 1px #757575 solid;\n padding: 4px 6px;\n font-size: 1rem;\n outline: none;\n background-color: var(--workspace-edge-input-background-color, #fff);\n color: var(--workspace-edge-input-color, initial);\n }\n\n .edge-name-input:focus {\n border-color: var(--primary-color);\n }\n\n .selection-zone {\n z-index: 100;\n position: absolute;\n width: 4px;\n height: 4px;\n border: 1px solid #2196f3;\n background-color: var(--workspace-selection-zone-background-color, rgb(3 169 244 / 0.54));\n }\n\n /* edges selection zones */\n\n .association-draggable {\n fill: white;\n stroke: #424242;\n stroke-width: 2;\n cursor: pointer;\n }\n`\n"]}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { Point } from './Point.js';
|
|
2
|
-
export declare const anchorPadding = 40;
|
|
3
|
-
/**
|
|
4
|
-
* Creates an array of pots that can be placed on the East side of a rectangular object.
|
|
5
|
-
*
|
|
6
|
-
* | ------ | o
|
|
7
|
-
* | |
|
|
8
|
-
* | | o
|
|
9
|
-
* | |
|
|
10
|
-
* | ------ | o
|
|
11
|
-
*
|
|
12
|
-
* @param rect The object DOMRect
|
|
13
|
-
* @param padding The padding from the top/bottom
|
|
14
|
-
*/
|
|
15
|
-
export declare function readEastAnchorPoints(rect: DOMRect, padding: number): Point[];
|
|
16
|
-
/**
|
|
17
|
-
* Creates an array of pots that can be placed on the West side of a rectangular object.
|
|
18
|
-
*
|
|
19
|
-
* o | ------ |
|
|
20
|
-
* | |
|
|
21
|
-
* o | |
|
|
22
|
-
* | |
|
|
23
|
-
* o | ------ |
|
|
24
|
-
*
|
|
25
|
-
* @param {DOMRect} rect The object DOMRect
|
|
26
|
-
* @param {number} padding The padding from the top/bottom
|
|
27
|
-
* @returns {Point[]}
|
|
28
|
-
*/
|
|
29
|
-
export declare function readWestAnchorPoints(rect: DOMRect, padding: number): Point[];
|
|
30
|
-
/**
|
|
31
|
-
* Creates an array of pots that can be placed on the North side of a rectangular object.
|
|
32
|
-
*
|
|
33
|
-
* o o o
|
|
34
|
-
* | ------- |
|
|
35
|
-
* | |
|
|
36
|
-
* | |
|
|
37
|
-
* | |
|
|
38
|
-
* | ------- |
|
|
39
|
-
*
|
|
40
|
-
* @param rect The object DOMRect
|
|
41
|
-
* @param padding The padding from the left/right
|
|
42
|
-
*/
|
|
43
|
-
export declare function readNorthAnchorPoints(rect: DOMRect, padding: number): Point[];
|
|
44
|
-
/**
|
|
45
|
-
* Creates an array of pots that can be placed on the South side of a rectangular object.
|
|
46
|
-
*
|
|
47
|
-
* | ------- |
|
|
48
|
-
* | |
|
|
49
|
-
* | |
|
|
50
|
-
* | |
|
|
51
|
-
* | ------- |
|
|
52
|
-
* o o o
|
|
53
|
-
*
|
|
54
|
-
* @param rect The object DOMRect
|
|
55
|
-
* @param padding The padding from the left/right
|
|
56
|
-
*/
|
|
57
|
-
export declare function readSouthAnchorPoints(rect: DOMRect, padding: number): Point[];
|
|
58
|
-
/**
|
|
59
|
-
* Finds a pair of virtual (created on the shape based on the size) anchor points.
|
|
60
|
-
*
|
|
61
|
-
* @param padding The padding from the left/right/top/bottom
|
|
62
|
-
*/
|
|
63
|
-
export declare function findClosestAnchors(source: DOMRect, target: DOMRect, padding: number): Point[];
|
|
64
|
-
//# sourceMappingURL=AnchorFinder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AnchorFinder.d.ts","sourceRoot":"","sources":["../../../../src/visualization/lib/AnchorFinder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAGlC,eAAO,MAAM,aAAa,KAAK,CAAA;AAE/B;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,EAAE,CAO5E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,EAAE,CAO5E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,EAAE,CAO7E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,EAAE,CAO7E;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,EAAE,CAc7F"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { Point } from './Point.js';
|
|
2
|
-
import { closetsPair } from './PositionUtils.js';
|
|
3
|
-
export const anchorPadding = 40;
|
|
4
|
-
/**
|
|
5
|
-
* Creates an array of pots that can be placed on the East side of a rectangular object.
|
|
6
|
-
*
|
|
7
|
-
* | ------ | o
|
|
8
|
-
* | |
|
|
9
|
-
* | | o
|
|
10
|
-
* | |
|
|
11
|
-
* | ------ | o
|
|
12
|
-
*
|
|
13
|
-
* @param rect The object DOMRect
|
|
14
|
-
* @param padding The padding from the top/bottom
|
|
15
|
-
*/
|
|
16
|
-
export function readEastAnchorPoints(rect, padding) {
|
|
17
|
-
const { right, top, bottom, height } = rect;
|
|
18
|
-
const middle = height / 2;
|
|
19
|
-
const p1 = new Point(right, top + padding);
|
|
20
|
-
const p2 = new Point(right, top + middle);
|
|
21
|
-
const p3 = new Point(right, bottom - padding);
|
|
22
|
-
return [p1, p2, p3];
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Creates an array of pots that can be placed on the West side of a rectangular object.
|
|
26
|
-
*
|
|
27
|
-
* o | ------ |
|
|
28
|
-
* | |
|
|
29
|
-
* o | |
|
|
30
|
-
* | |
|
|
31
|
-
* o | ------ |
|
|
32
|
-
*
|
|
33
|
-
* @param {DOMRect} rect The object DOMRect
|
|
34
|
-
* @param {number} padding The padding from the top/bottom
|
|
35
|
-
* @returns {Point[]}
|
|
36
|
-
*/
|
|
37
|
-
export function readWestAnchorPoints(rect, padding) {
|
|
38
|
-
const { left, top, bottom, height } = rect;
|
|
39
|
-
const middle = height / 2;
|
|
40
|
-
const p1 = new Point(left, top + padding);
|
|
41
|
-
const p2 = new Point(left, top + middle);
|
|
42
|
-
const p3 = new Point(left, bottom - padding);
|
|
43
|
-
return [p1, p2, p3];
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Creates an array of pots that can be placed on the North side of a rectangular object.
|
|
47
|
-
*
|
|
48
|
-
* o o o
|
|
49
|
-
* | ------- |
|
|
50
|
-
* | |
|
|
51
|
-
* | |
|
|
52
|
-
* | |
|
|
53
|
-
* | ------- |
|
|
54
|
-
*
|
|
55
|
-
* @param rect The object DOMRect
|
|
56
|
-
* @param padding The padding from the left/right
|
|
57
|
-
*/
|
|
58
|
-
export function readNorthAnchorPoints(rect, padding) {
|
|
59
|
-
const { left, top, width, right } = rect;
|
|
60
|
-
const middle = width / 2;
|
|
61
|
-
const p1 = new Point(left + padding, top);
|
|
62
|
-
const p2 = new Point(left + middle, top);
|
|
63
|
-
const p3 = new Point(right - padding, top);
|
|
64
|
-
return [p1, p2, p3];
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Creates an array of pots that can be placed on the South side of a rectangular object.
|
|
68
|
-
*
|
|
69
|
-
* | ------- |
|
|
70
|
-
* | |
|
|
71
|
-
* | |
|
|
72
|
-
* | |
|
|
73
|
-
* | ------- |
|
|
74
|
-
* o o o
|
|
75
|
-
*
|
|
76
|
-
* @param rect The object DOMRect
|
|
77
|
-
* @param padding The padding from the left/right
|
|
78
|
-
*/
|
|
79
|
-
export function readSouthAnchorPoints(rect, padding) {
|
|
80
|
-
const { left, bottom, width, right } = rect;
|
|
81
|
-
const middle = width / 2;
|
|
82
|
-
const p1 = new Point(left + padding, bottom);
|
|
83
|
-
const p2 = new Point(left + middle, bottom);
|
|
84
|
-
const p3 = new Point(right - padding, bottom);
|
|
85
|
-
return [p1, p2, p3];
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Finds a pair of virtual (created on the shape based on the size) anchor points.
|
|
89
|
-
*
|
|
90
|
-
* @param padding The padding from the left/right/top/bottom
|
|
91
|
-
*/
|
|
92
|
-
export function findClosestAnchors(source, target, padding) {
|
|
93
|
-
const sources = [
|
|
94
|
-
...readEastAnchorPoints(source, padding),
|
|
95
|
-
...readWestAnchorPoints(source, padding),
|
|
96
|
-
...readNorthAnchorPoints(source, padding),
|
|
97
|
-
...readSouthAnchorPoints(source, padding),
|
|
98
|
-
];
|
|
99
|
-
const targets = [
|
|
100
|
-
...readEastAnchorPoints(target, padding),
|
|
101
|
-
...readWestAnchorPoints(target, padding),
|
|
102
|
-
...readNorthAnchorPoints(target, padding),
|
|
103
|
-
...readSouthAnchorPoints(target, padding),
|
|
104
|
-
];
|
|
105
|
-
return closetsPair(sources, targets);
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=AnchorFinder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AnchorFinder.js","sourceRoot":"","sources":["../../../../src/visualization/lib/AnchorFinder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAA;AAE/B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAa,EAAE,OAAe;IACjE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAC3C,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,CAAA;IACzB,MAAM,EAAE,GAAG,IA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AAW,CAAC,OAAO,EAAE,OAAO,CAAY,CAAA;AACjD,CAAC","sourcesContent":["import { Point } from './Point.js'\nimport { closetsPair } from './PositionUtils.js'\n\nexport const anchorPadding = 40\n\n/**\n * Creates an array of pots that can be placed on the East side of a rectangular object.\n *\n * | ------ | o\n * | |\n * | | o\n * | |\n * | ------ | o\n *\n * @param rect The object DOMRect\n * @param padding The padding from the top/bottom\n */\nexport function readEastAnchorPoints(rect: DOMRect, padding: number): Point[] {\n const { right, top, bottom, height } = rect\n const middle = height / 2\n const p1 = new Point(right, top + padding)\n const p2 = new Point(right, top + middle)\n const p3 = new Point(right, bottom - padding)\n return [p1, p2, p3]\n}\n\n/**\n * Creates an array of pots that can be placed on the West side of a rectangular object.\n *\n * o | ------ |\n * | |\n * o | |\n * | |\n * o | ------ |\n *\n * @param {DOMRect} rect The object DOMRect\n * @param {number} padding The padding from the top/bottom\n * @returns {Point[]}\n */\nexport function readWestAnchorPoints(rect: DOMRect, padding: number): Point[] {\n const { left, top, bottom, height } = rect\n const middle = height / 2\n const p1 = new Point(left, top + padding)\n const p2 = new Point(left, top + middle)\n const p3 = new Point(left, bottom - padding)\n return [p1, p2, p3]\n}\n\n/**\n * Creates an array of pots that can be placed on the North side of a rectangular object.\n *\n * o o o\n * | ------- |\n * | |\n * | |\n * | |\n * | ------- |\n *\n * @param rect The object DOMRect\n * @param padding The padding from the left/right\n */\nexport function readNorthAnchorPoints(rect: DOMRect, padding: number): Point[] {\n const { left, top, width, right } = rect\n const middle = width / 2\n const p1 = new Point(left + padding, top)\n const p2 = new Point(left + middle, top)\n const p3 = new Point(right - padding, top)\n return [p1, p2, p3]\n}\n\n/**\n * Creates an array of pots that can be placed on the South side of a rectangular object.\n *\n * | ------- |\n * | |\n * | |\n * | |\n * | ------- |\n * o o o\n *\n * @param rect The object DOMRect\n * @param padding The padding from the left/right\n */\nexport function readSouthAnchorPoints(rect: DOMRect, padding: number): Point[] {\n const { left, bottom, width, right } = rect\n const middle = width / 2\n const p1 = new Point(left + padding, bottom)\n const p2 = new Point(left + middle, bottom)\n const p3 = new Point(right - padding, bottom)\n return [p1, p2, p3]\n}\n\n/**\n * Finds a pair of virtual (created on the shape based on the size) anchor points.\n *\n * @param padding The padding from the left/right/top/bottom\n */\nexport function findClosestAnchors(source: DOMRect, target: DOMRect, padding: number): Point[] {\n const sources = [\n ...readEastAnchorPoints(source, padding),\n ...readWestAnchorPoints(source, padding),\n ...readNorthAnchorPoints(source, padding),\n ...readSouthAnchorPoints(source, padding),\n ]\n const targets = [\n ...readEastAnchorPoints(target, padding),\n ...readWestAnchorPoints(target, padding),\n ...readNorthAnchorPoints(target, padding),\n ...readSouthAnchorPoints(target, padding),\n ]\n return closetsPair(sources, targets) as Point[]\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import VizWorkspaceElement from '../elements/VizWorkspaceElement.js';
|
|
2
|
-
import { Point } from './Point.js';
|
|
3
|
-
import { IWorkspaceEdge } from './types.js';
|
|
4
|
-
/**
|
|
5
|
-
* @param element The association anchor object
|
|
6
|
-
* @returns The x,y position of the anchor.
|
|
7
|
-
*/
|
|
8
|
-
export declare function anchorToPoint(element: HTMLElement, workspace: VizWorkspaceElement): Point;
|
|
9
|
-
export declare function closestAnchors(elm1: HTMLElement, elm2: HTMLElement, workspace: VizWorkspaceElement, others?: IWorkspaceEdge[]): Point[] | null;
|
|
10
|
-
//# sourceMappingURL=AnchorUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AnchorUtils.d.ts","sourceRoot":"","sources":["../../../../src/visualization/lib/AnchorUtils.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,oCAAoC,CAAA;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,GAAG,KAAK,CAiBzF;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,mBAAmB,EAC9B,MAAM,GAAE,cAAc,EAAO,GAC5B,KAAK,EAAE,GAAG,IAAI,CAmBhB"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { closetsPair, getRelativeClickPoint } from './PositionUtils.js';
|
|
2
|
-
/**
|
|
3
|
-
* @param element The association anchor object
|
|
4
|
-
* @returns The x,y position of the anchor.
|
|
5
|
-
*/
|
|
6
|
-
export function anchorToPoint(element, workspace) {
|
|
7
|
-
const box = element.getBoundingClientRect();
|
|
8
|
-
let { x, y } = box;
|
|
9
|
-
const { dataset } = element;
|
|
10
|
-
if (dataset.verticalOffset) {
|
|
11
|
-
const vo = Number(dataset.verticalOffset);
|
|
12
|
-
if (!Number.isNaN(vo)) {
|
|
13
|
-
y += vo;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
if (dataset.horizontalOffset) {
|
|
17
|
-
const ho = Number(dataset.horizontalOffset);
|
|
18
|
-
if (!Number.isNaN(ho)) {
|
|
19
|
-
x += ho;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return getRelativeClickPoint(x, y, workspace);
|
|
23
|
-
}
|
|
24
|
-
export function closestAnchors(elm1, elm2, workspace, others = []) {
|
|
25
|
-
const dom1 = elm1.shadowRoot || elm1;
|
|
26
|
-
const dom2 = elm2.shadowRoot || elm2;
|
|
27
|
-
const anchors1 = Array.from(dom1.querySelectorAll('[data-association-slot]'));
|
|
28
|
-
const anchors2 = Array.from(dom2.querySelectorAll('[data-association-slot]'));
|
|
29
|
-
if (!anchors1.length || !anchors2.length) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
const points1 = anchors1.map((item) => anchorToPoint(item, workspace));
|
|
33
|
-
const points2 = anchors2.map((item) => anchorToPoint(item, workspace));
|
|
34
|
-
const avoid1 = [];
|
|
35
|
-
const avoid2 = [];
|
|
36
|
-
others.forEach((i) => {
|
|
37
|
-
avoid1.push(i.shape.line.startPoint);
|
|
38
|
-
avoid2.push(i.shape.line.startPoint);
|
|
39
|
-
avoid1.push(i.shape.line.endPoint);
|
|
40
|
-
avoid2.push(i.shape.line.endPoint);
|
|
41
|
-
});
|
|
42
|
-
return closetsPair(points1, points2, avoid1, avoid2);
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=AnchorUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AnchorUtils.js","sourceRoot":"","sources":["../../../../src/visualization/lib/AnchorUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAGvE;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,OAAoB,EAAE,SAA8B;IAChF,MAAM,GAAG,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAA;IAC3C,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,GAAG,CAAA;IAClB,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;IAC3B,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;QAC3B,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;QACzC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;YACtB,CAAC,IAAI,EAAE,CAAA;QACT,CAAC;IACH,CAAC;IACD,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC7B,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;QAC3C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;YACtB,CAAC,IAAI,EAAE,CAAA;QACT,CAAC;IACH,CAAC;IACD,OAAO,qBAAqB,CAAC,CAAC,EAAE,CAAC,EA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CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACpC,CAAC,CAAC,CAAA;IACF,OAAO,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AACtD,CAAC","sourcesContent":["import VizWorkspaceElement from '../elements/VizWorkspaceElement.js'\nimport { Point } from './Point.js'\nimport { closetsPair, getRelativeClickPoint } from './PositionUtils.js'\nimport { IWorkspaceEdge } from './types.js'\n\n/**\n * @param element The association anchor object\n * @returns The x,y position of the anchor.\n */\nexport function anchorToPoint(element: HTMLElement, workspace: VizWorkspaceElement): Point {\n const box = element.getBoundingClientRect()\n let { x, y } = box\n const { dataset } = element\n if (dataset.verticalOffset) {\n const vo = Number(dataset.verticalOffset)\n if (!Number.isNaN(vo)) {\n y += vo\n }\n }\n if (dataset.horizontalOffset) {\n const ho = Number(dataset.horizontalOffset)\n if (!Number.isNaN(ho)) {\n x += ho\n }\n }\n return getRelativeClickPoint(x, y, workspace)\n}\n\nexport function closestAnchors(\n elm1: HTMLElement,\n elm2: HTMLElement,\n workspace: VizWorkspaceElement,\n others: IWorkspaceEdge[] = []\n): Point[] | null {\n const dom1 = elm1.shadowRoot || elm1\n const dom2 = elm2.shadowRoot || elm2\n const anchors1 = Array.from(dom1.querySelectorAll('[data-association-slot]')) as HTMLElement[]\n const anchors2 = Array.from(dom2.querySelectorAll('[data-association-slot]')) as HTMLElement[]\n if (!anchors1.length || !anchors2.length) {\n return null\n }\n const points1 = anchors1.map((item) => anchorToPoint(item, workspace))\n const points2 = anchors2.map((item) => anchorToPoint(item, workspace))\n const avoid1: Point[] = []\n const avoid2: Point[] = []\n others.forEach((i) => {\n avoid1.push(i.shape.line.startPoint)\n avoid2.push(i.shape.line.startPoint)\n avoid1.push(i.shape.line.endPoint)\n avoid2.push(i.shape.line.endPoint)\n })\n return closetsPair(points1, points2, avoid1, avoid2)\n}\n"]}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { LineSketch } from './LineSketch.js';
|
|
2
|
-
import VizWorkspaceElement from '../elements/VizWorkspaceElement.js';
|
|
3
|
-
import { Point } from './Point.js';
|
|
4
|
-
export declare const connectedValue: unique symbol;
|
|
5
|
-
export declare const mouseDownHandler: unique symbol;
|
|
6
|
-
export declare const mouseMoveHandler: unique symbol;
|
|
7
|
-
export declare const mouseUpHandler: unique symbol;
|
|
8
|
-
export declare const keydownHandler: unique symbol;
|
|
9
|
-
export interface EdgeCreateInfo {
|
|
10
|
-
/**
|
|
11
|
-
* The slot name of the source object.
|
|
12
|
-
*/
|
|
13
|
-
slot: string;
|
|
14
|
-
/**
|
|
15
|
-
* The workspace coordinates of the staring point
|
|
16
|
-
*/
|
|
17
|
-
point: Point;
|
|
18
|
-
/**
|
|
19
|
-
* The domain element that is the source of the association.
|
|
20
|
-
*/
|
|
21
|
-
source: HTMLElement;
|
|
22
|
-
}
|
|
23
|
-
export interface IEdgeUpdateInfo {
|
|
24
|
-
/**
|
|
25
|
-
* The name of the tip that is being dragged.
|
|
26
|
-
* It's either `start` or `end`.
|
|
27
|
-
*/
|
|
28
|
-
direction: string;
|
|
29
|
-
/**
|
|
30
|
-
* The association domain id.
|
|
31
|
-
*/
|
|
32
|
-
id: string;
|
|
33
|
-
/**
|
|
34
|
-
* The start point of the line
|
|
35
|
-
*/
|
|
36
|
-
sp: Point;
|
|
37
|
-
/**
|
|
38
|
-
* The end point of the line
|
|
39
|
-
*/
|
|
40
|
-
ep: Point;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* A helper that allows to manually draw a line from one visualization object to another.
|
|
44
|
-
* The visualization object has to have the `data-association-slots` attribute set on the element
|
|
45
|
-
* and the mouse event target having the `data-association-slot` attribute with the index of the slot.
|
|
46
|
-
*
|
|
47
|
-
* The association line can be drawn to another object that has both attributes.
|
|
48
|
-
*
|
|
49
|
-
* After the user finish a DOM event is dispatched from the visualization workspace.
|
|
50
|
-
*/
|
|
51
|
-
export declare class AssociationAnchors {
|
|
52
|
-
workspace: VizWorkspaceElement;
|
|
53
|
-
[connectedValue]: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Whether a line is being constructed.
|
|
56
|
-
*/
|
|
57
|
-
drawing: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* A reference to the currently injected SVG element.
|
|
60
|
-
*/
|
|
61
|
-
lineElement?: SVGElement;
|
|
62
|
-
/**
|
|
63
|
-
* Whether an association position is being updated.
|
|
64
|
-
* In such case it dispatches different event at the end.
|
|
65
|
-
*/
|
|
66
|
-
updating: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* The processor used to draw lines
|
|
69
|
-
*/
|
|
70
|
-
lineProcessor: LineSketch;
|
|
71
|
-
/**
|
|
72
|
-
* Set when a new association is being created
|
|
73
|
-
*/
|
|
74
|
-
createInfo?: EdgeCreateInfo;
|
|
75
|
-
/**
|
|
76
|
-
* Set when an association update is performed
|
|
77
|
-
*/
|
|
78
|
-
updateInfo?: IEdgeUpdateInfo;
|
|
79
|
-
constructor(workspace: VizWorkspaceElement);
|
|
80
|
-
/**
|
|
81
|
-
* Starts listening for the user events
|
|
82
|
-
*/
|
|
83
|
-
connect(): void;
|
|
84
|
-
/**
|
|
85
|
-
* Stops listening for the user events
|
|
86
|
-
*/
|
|
87
|
-
disconnect(): void;
|
|
88
|
-
findSlotParent(path: Node[]): Element;
|
|
89
|
-
[mouseDownHandler](e: MouseEvent): void;
|
|
90
|
-
[mouseMoveHandler](e: MouseEvent): void;
|
|
91
|
-
[mouseUpHandler](e: MouseEvent): void;
|
|
92
|
-
[keydownHandler](e: KeyboardEvent): void;
|
|
93
|
-
/**
|
|
94
|
-
* Cancels the operation.
|
|
95
|
-
*/
|
|
96
|
-
cancel(): void;
|
|
97
|
-
/**
|
|
98
|
-
* Clears variables set in the `start()` function.
|
|
99
|
-
*/
|
|
100
|
-
cleanup(): void;
|
|
101
|
-
start(domainObject: HTMLElement, slot: string, startPoint: Point): void;
|
|
102
|
-
/**
|
|
103
|
-
* @param key The domain id of the association being updated
|
|
104
|
-
* @param dir The name of the tip that is being dragged.
|
|
105
|
-
*/
|
|
106
|
-
startUpdate(key: string, dir: string): void;
|
|
107
|
-
end(id: string, slot: string, endPoint: Point): void;
|
|
108
|
-
endUpdate(id: string, slot: string, endPoint: Point): void;
|
|
109
|
-
/**
|
|
110
|
-
* Insets a child with a line definition into the workspace's SVG element.
|
|
111
|
-
* @param start The starting point of the line
|
|
112
|
-
* @param end The ending point of the line
|
|
113
|
-
*/
|
|
114
|
-
addLine(start: Point, end: Point): void;
|
|
115
|
-
/**
|
|
116
|
-
* Removes the previously added line from the SVG
|
|
117
|
-
*/
|
|
118
|
-
removeLine(): void;
|
|
119
|
-
/**
|
|
120
|
-
* Updates the end position of the line.
|
|
121
|
-
* @param {Point} point
|
|
122
|
-
*/
|
|
123
|
-
updateLinePosition(point: Point): void;
|
|
124
|
-
/**
|
|
125
|
-
* Listens for the mouse move and mouse up events to draw the line and finish the operation.
|
|
126
|
-
* This is only initialized when starting drawing a line.
|
|
127
|
-
*/
|
|
128
|
-
listenDargEvents(): void;
|
|
129
|
-
/**
|
|
130
|
-
* Removes previously registered events.
|
|
131
|
-
*/
|
|
132
|
-
unlistenDargEvents(): void;
|
|
133
|
-
}
|
|
134
|
-
//# sourceMappingURL=AssociationAnchors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AssociationAnchors.d.ts","sourceRoot":"","sources":["../../../../src/visualization/lib/AssociationAnchors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,mBAAmB,MAAM,oCAAoC,CAAA;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAIlC,eAAO,MAAM,cAAc,eAA2B,CAAA;AACtD,eAAO,MAAM,gBAAgB,eAA6B,CAAA;AAC1D,eAAO,MAAM,gBAAgB,eAA6B,CAAA;AAC1D,eAAO,MAAM,cAAc,e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