@hpcc-js/graph 3.6.3 → 3.6.5

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.
Files changed (77) hide show
  1. package/LICENSE +43 -43
  2. package/README.md +256 -256
  3. package/dist/assets/dagre-B-z4SP0u.js.map +1 -1
  4. package/dist/assets/{graphviz-CjmNyQgU.js.map → graphviz-DQ0E8zfY.js.map} +1 -1
  5. package/dist/index.js +2 -2
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.umd.cjs +2 -2
  8. package/dist/index.umd.cjs.map +1 -1
  9. package/package.json +8 -8
  10. package/src/AdjacencyGraph.ts +224 -224
  11. package/src/Edge.css +23 -23
  12. package/src/Edge.ts +257 -257
  13. package/src/Graph.css +18 -18
  14. package/src/Graph.ts +1077 -1077
  15. package/src/GraphData.ts +187 -187
  16. package/src/GraphLayouts.ts +214 -214
  17. package/src/Sankey.css +46 -46
  18. package/src/Sankey.ts +304 -304
  19. package/src/Subgraph.css +10 -10
  20. package/src/Subgraph.ts +165 -165
  21. package/src/Vertex.css +3 -3
  22. package/src/Vertex.ts +282 -282
  23. package/src/__package__.ts +3 -3
  24. package/src/__tests__/data.ts +444 -444
  25. package/src/__tests__/index.ts +1 -1
  26. package/src/__tests__/test1.ts +18 -18
  27. package/src/__tests__/test2.ts +80 -80
  28. package/src/__tests__/test3.ts +46 -46
  29. package/src/__tests__/test4.ts +66 -66
  30. package/src/__tests__/test5.ts +85 -85
  31. package/src/common/graphT.css +38 -38
  32. package/src/common/graphT.ts +1363 -1363
  33. package/src/common/index.ts +3 -3
  34. package/src/common/layouts/circle.ts +37 -37
  35. package/src/common/layouts/dagre.ts +145 -145
  36. package/src/common/layouts/dagreWorker.ts +24 -24
  37. package/src/common/layouts/forceDirected.ts +117 -117
  38. package/src/common/layouts/forceDirectedWorker.ts +22 -22
  39. package/src/common/layouts/geoForceDirected.ts +112 -112
  40. package/src/common/layouts/graphviz.ts +137 -137
  41. package/src/common/layouts/graphvizWorker.ts +27 -27
  42. package/src/common/layouts/index.ts +7 -7
  43. package/src/common/layouts/layout.ts +147 -147
  44. package/src/common/layouts/null.ts +39 -39
  45. package/src/common/layouts/placeholders.ts +113 -113
  46. package/src/common/layouts/tree.ts +326 -326
  47. package/src/common/layouts/workers/dagre.ts +46 -46
  48. package/src/common/layouts/workers/dagreOptions.ts +35 -35
  49. package/src/common/layouts/workers/forceDirected.ts +38 -38
  50. package/src/common/layouts/workers/forceDirectedOptions.ts +30 -30
  51. package/src/common/layouts/workers/graphviz.ts +225 -225
  52. package/src/common/layouts/workers/graphvizOptions.ts +70 -70
  53. package/src/common/liteMap.ts +72 -72
  54. package/src/common/liteSVGZooom.ts +61 -61
  55. package/src/common/sankeyGraph.css +45 -45
  56. package/src/common/sankeyGraph.ts +345 -345
  57. package/src/html/annotation.ts +71 -71
  58. package/src/html/component.ts +18 -18
  59. package/src/html/edge.ts +15 -15
  60. package/src/html/graphHtml.ts +11 -11
  61. package/src/html/graphHtmlT.ts +117 -117
  62. package/src/html/icon.ts +64 -64
  63. package/src/html/image.ts +26 -26
  64. package/src/html/imageChar.ts +18 -18
  65. package/src/html/index.ts +8 -8
  66. package/src/html/intersection.ts +110 -110
  67. package/src/html/shape.ts +141 -141
  68. package/src/html/text.ts +59 -59
  69. package/src/html/textBox.ts +45 -45
  70. package/src/html/vertex.ts +67 -67
  71. package/src/index.ts +10 -10
  72. package/src/react/dataGraph.ts +345 -345
  73. package/src/react/graphReact.ts +177 -177
  74. package/src/react/graphReactT.ts +44 -44
  75. package/src/react/index.ts +4 -4
  76. package/src/react/subgraph.tsx +30 -30
  77. package/src/react/vertex.tsx +31 -31
package/LICENSE CHANGED
@@ -1,43 +1,43 @@
1
- HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
14
-
15
-
16
- Intersection Algorithms Provided by Kevin Lindsey
17
- Copyright (c) 2000-2011, Kevin Lindsey
18
- All rights reserved.
19
-
20
- Redistribution and use in source and binary forms, with or without
21
- modification, are permitted provided that the following conditions are met:
22
-
23
- - Redistributions of source code must retain the above copyright notice,
24
- this list of conditions and the following disclaimer.
25
-
26
- - Redistributions in binary form must reproduce the above copyright
27
- notice, this list of conditions and the following disclaimer in the
28
- documentation and/or other materials provided with the distribution.
29
-
30
- - Neither the name of this software nor the names of its contributors
31
- may be used to endorse or promote products derived from this software
32
- without specific prior written permission.
33
-
34
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
35
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
36
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
37
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
38
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
39
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
40
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
41
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
42
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
43
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1
+ HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
14
+
15
+
16
+ Intersection Algorithms Provided by Kevin Lindsey
17
+ Copyright (c) 2000-2011, Kevin Lindsey
18
+ All rights reserved.
19
+
20
+ Redistribution and use in source and binary forms, with or without
21
+ modification, are permitted provided that the following conditions are met:
22
+
23
+ - Redistributions of source code must retain the above copyright notice,
24
+ this list of conditions and the following disclaimer.
25
+
26
+ - Redistributions in binary form must reproduce the above copyright
27
+ notice, this list of conditions and the following disclaimer in the
28
+ documentation and/or other materials provided with the distribution.
29
+
30
+ - Neither the name of this software nor the names of its contributors
31
+ may be used to endorse or promote products derived from this software
32
+ without specific prior written permission.
33
+
34
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
35
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
36
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
37
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
38
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
39
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
40
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
41
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
42
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
43
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md CHANGED
@@ -1,257 +1,257 @@
1
- # @hpcc-js/graph
2
- This package is part of the mono repository "@hpcc-js" (aka Visualization Framework), for more information including [Quick Start](https://github.com/hpcc-systems/Visualization/wiki/Quick-Start), [Gallery](https://raw.githack.com/hpcc-systems/Visualization/trunk/demos/gallery/gallery.html) and [Tutorials](https://github.com/hpcc-systems/Visualization/wiki/Tutorials), please visit the main page on GitHub: [hpcc-systems/Visualization](https://github.com/hpcc-systems/Visualization).
3
-
4
- ## Exported Widgets
5
- * [Sankey](https://rawgit.com/hpcc-systems/Visualization/trunk/demos/gallery/playground.html?./samples/graph/Sankey.js)
6
- * [Graph](https://rawgit.com/hpcc-systems/Visualization/trunk/demos/gallery/playground.html?./samples/graph/Les%20Miserables.js) / [Graph (Example 2)](https://rawgit.com/hpcc-systems/Visualization/trunk/demos/gallery/playground.html?./samples/graph/Different%20Nodes.js)
7
- * [Subgraph](https://rawgit.com/hpcc-systems/Visualization/trunk/demos/gallery/playground.html?./samples/graph/Custom%20Colors.js)
8
-
9
- ## Stand-alone HTML Example
10
- ```html
11
- <html>
12
- <head>
13
- <title>Simple Graph</title>
14
- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"/>
15
- <script src="https://unpkg.com/@hpcc-js/util"></script>
16
- <script src="https://unpkg.com/@hpcc-js/common"></script>
17
- <script src="https://unpkg.com/@hpcc-js/api"></script>
18
- <script src="https://unpkg.com/@hpcc-js/graph"></script>
19
- </head>
20
- <body>
21
- <div id="placeholder" style="width:400px;height:400px;"></div>
22
- <script>
23
- var verts = [
24
- { "name": "John Doe", "icon": "" },
25
- { "name": "Jane Doe", "icon": "" },
26
- { "name": "123 Main Street", "icon": "", "centroid": true }
27
- ].map(node=>{
28
- return new window["@hpcc-js/graph"].Vertex()
29
- .text(node.name)
30
- .faChar(node.icon)
31
- ;
32
- });
33
- var chart = new window["@hpcc-js/graph"].Graph()
34
- .target("placeholder")
35
- .layout("Circle")
36
- .data({
37
- vertices: verts,
38
- edges: [
39
- new window["@hpcc-js/graph"].Edge().sourceVertex(verts[2]).targetVertex(verts[0]),
40
- new window["@hpcc-js/graph"].Edge().sourceVertex(verts[2]).targetVertex(verts[1]),
41
- ]
42
- })
43
- .render();
44
- console.log("Other layout options:",chart.__meta_layout.set);
45
- </script>
46
- </body>
47
- </html>
48
- ```
49
-
50
- <ClientOnly>
51
- <hpcc-vitepress style="width:100%;height:600px">
52
- <div id="target" style="height:600px">
53
- </div>
54
- <script type="module">
55
- import { Graph2 } from "@hpcc-js/graph";
56
- import { CentroidVertex3, Vertex3 } from "@hpcc-js/react";
57
-
58
- const vertices = [
59
- {
60
- id: 0,
61
- text: "JAKE MCKEE",
62
- centroid: true,
63
- icon: {
64
- imageChar: ""
65
- },
66
- subText: {
67
- text: "03/26/2020",
68
- textFill: "#555555"
69
- },
70
- annotationMeta: [
71
- greyAnno(10, 15, -5),
72
- dAnno(15, -4),
73
- exclamationAnno(15, -4),
74
- ]
75
-
76
- },
77
- {
78
- id: 1,
79
- text: "123 Main St",
80
- icon: {
81
- imageChar: "",
82
- },
83
- subText: {
84
- text: "03/26/2020",
85
- textFill: "#555555"
86
- },
87
- annotationMeta: [
88
- greyAnno(13,5,-1),
89
- exclamationAnno(),
90
- ]
91
- },
92
- {
93
- id: 2,
94
- text: "555-55-5555",
95
- icon: {
96
- imageChar: "",
97
- },
98
- subText: {
99
- text: "03/26/2020",
100
- textFill: "#555555"
101
- },
102
- annotationMeta: [
103
- greyAnno(8,5,-1),
104
- exclamationAnno(),
105
- ]
106
- },
107
- {
108
- id: 3,
109
- text: "Jmckee@gmail.com",
110
- icon: {
111
- imageChar: ""
112
- },
113
- subText: {
114
- text: "03/26/2020",
115
- textFill: "#555555"
116
- },
117
- annotationMeta: [
118
- greyAnno(5,5,-1),
119
- exclamationAnno(),
120
- ]
121
- },
122
- {
123
- id: 4,
124
- text: "303-123-1234",
125
- icon: {
126
- imageChar: ""
127
- },
128
- subText: {
129
- text: "03/26/2020",
130
- textFill: "#555555"
131
- },
132
- annotationMeta: [
133
- greyAnno(5,5,-1),
134
- checkmarkAnno(),
135
- ]
136
- },
137
- {
138
- id: 5,
139
- text: "123039923",
140
- icon: {
141
- imageChar: "",
142
- },
143
- subText: {
144
- text: "03/26/2020",
145
- textFill: "#555555"
146
- },
147
- annotationMeta: [
148
- greyAnno(5,5,-1),
149
- checkmarkAnno()
150
- ]
151
- },
152
- {
153
- id: 6,
154
- text: "FL-2372-3982-9292-2929",
155
- icon: {
156
- imageChar: "",
157
- },
158
- subText: {
159
- text: "03/26/2020",
160
- textFill: "#555555"
161
- },
162
- annotationMeta: [
163
- greyAnno(5,5,-1),
164
- checkmarkAnno(),
165
- ]
166
- },
167
- {
168
- id: 7,
169
- text: "11.12.3.301.31",
170
- icon: {
171
- imageChar: ""
172
- },
173
- subText: {
174
- text: "03/26/2020",
175
- },
176
- annotationMeta: [
177
- greyAnno(8,5,-1),
178
- exclamationAnno(),
179
- ]
180
- },
181
- ];
182
-
183
- function greyAnno(text, padding = 5, yOffset = -1){
184
- return {
185
- text: text+"",
186
- fill: "#555555",
187
- stroke: "#555555",
188
- textFill: "#ffffff",
189
- padding: padding,
190
- yOffset: yOffset
191
- }
192
- }
193
- function dAnno(){
194
- return {
195
- text: "D",
196
- fill: "#ED1C24",
197
- stroke: "#ED1C24",
198
- textFill: "#ffffff",
199
- fontFamily: "Arial",
200
- padding: 15,
201
- yOffset: -4
202
- };
203
- }
204
- function exclamationAnno(padding, yOffset){
205
- return {
206
- text: "",
207
- fill: "#ED1C24",
208
- stroke: "#ED1C24",
209
- textFill: "#ffffff",
210
- fontFamily: "Arial",
211
- padding: padding,
212
- yOffset: yOffset,
213
- fontFamily: "'Font Awesome 5 Free'",
214
- };
215
- }
216
- function checkmarkAnno(padding, yOffset){
217
- return {
218
- text: "",
219
- fill: "#00802B",
220
- stroke: "#00802B",
221
- textFill: "#ffffff",
222
- fontFamily: "'Font Awesome 5 Free'",
223
- padding: padding,
224
- yOffset: yOffset,
225
- };
226
- }
227
- const graphData = { vertices };
228
- graphData.edges = vertices.slice(1).map((n,i)=>{
229
- return {
230
- id: i,
231
- source: graphData.vertices[0],
232
- target: graphData.vertices[i+1],
233
- }
234
- })
235
-
236
- new Graph2()
237
- .target("target")
238
- .centroidRenderer(CentroidVertex3)
239
- .vertexRenderer(Vertex3)
240
- .edgeColor("#287EC4")
241
- .edgeStrokeWidth(2)
242
- .edgeArcDepth(0)
243
- .data(graphData)
244
- .centroidColor("#777777")
245
- .on("vertex_click", (row, col, sel) => console.log("click", row, col, sel))
246
- .on("vertex_dblclick", (row, col, sel) => console.log("dblclick", row, col, sel))
247
- .on("vertex_mousein", (row, col, sel) => console.log("mousein", row, col, sel))
248
- .on("vertex_mouseover", (row, col, sel) => console.log("mouseover", row, col, sel))
249
- .on("vertex_mouseout", (row, col, sel) => console.log("mouseout", row, col, sel))
250
- .forceDirectedAlphaDecay(0.003)
251
- .layout("ForceDirected")
252
- .transitionDuration(0)
253
- .render()
254
- ;
255
- </script>
256
- </hpcc-vitepress>
1
+ # @hpcc-js/graph
2
+ This package is part of the mono repository "@hpcc-js" (aka Visualization Framework), for more information including [Quick Start](https://github.com/hpcc-systems/Visualization/wiki/Quick-Start), [Gallery](https://raw.githack.com/hpcc-systems/Visualization/trunk/demos/gallery/gallery.html) and [Tutorials](https://github.com/hpcc-systems/Visualization/wiki/Tutorials), please visit the main page on GitHub: [hpcc-systems/Visualization](https://github.com/hpcc-systems/Visualization).
3
+
4
+ ## Exported Widgets
5
+ * [Sankey](https://rawgit.com/hpcc-systems/Visualization/trunk/demos/gallery/playground.html?./samples/graph/Sankey.js)
6
+ * [Graph](https://rawgit.com/hpcc-systems/Visualization/trunk/demos/gallery/playground.html?./samples/graph/Les%20Miserables.js) / [Graph (Example 2)](https://rawgit.com/hpcc-systems/Visualization/trunk/demos/gallery/playground.html?./samples/graph/Different%20Nodes.js)
7
+ * [Subgraph](https://rawgit.com/hpcc-systems/Visualization/trunk/demos/gallery/playground.html?./samples/graph/Custom%20Colors.js)
8
+
9
+ ## Stand-alone HTML Example
10
+ ```html
11
+ <html>
12
+ <head>
13
+ <title>Simple Graph</title>
14
+ <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"/>
15
+ <script src="https://unpkg.com/@hpcc-js/util"></script>
16
+ <script src="https://unpkg.com/@hpcc-js/common"></script>
17
+ <script src="https://unpkg.com/@hpcc-js/api"></script>
18
+ <script src="https://unpkg.com/@hpcc-js/graph"></script>
19
+ </head>
20
+ <body>
21
+ <div id="placeholder" style="width:400px;height:400px;"></div>
22
+ <script>
23
+ var verts = [
24
+ { "name": "John Doe", "icon": "" },
25
+ { "name": "Jane Doe", "icon": "" },
26
+ { "name": "123 Main Street", "icon": "", "centroid": true }
27
+ ].map(node=>{
28
+ return new window["@hpcc-js/graph"].Vertex()
29
+ .text(node.name)
30
+ .faChar(node.icon)
31
+ ;
32
+ });
33
+ var chart = new window["@hpcc-js/graph"].Graph()
34
+ .target("placeholder")
35
+ .layout("Circle")
36
+ .data({
37
+ vertices: verts,
38
+ edges: [
39
+ new window["@hpcc-js/graph"].Edge().sourceVertex(verts[2]).targetVertex(verts[0]),
40
+ new window["@hpcc-js/graph"].Edge().sourceVertex(verts[2]).targetVertex(verts[1]),
41
+ ]
42
+ })
43
+ .render();
44
+ console.log("Other layout options:",chart.__meta_layout.set);
45
+ </script>
46
+ </body>
47
+ </html>
48
+ ```
49
+
50
+ <ClientOnly>
51
+ <hpcc-vitepress style="width:100%;height:600px">
52
+ <div id="target" style="height:600px">
53
+ </div>
54
+ <script type="module">
55
+ import { Graph2 } from "@hpcc-js/graph";
56
+ import { CentroidVertex3, Vertex3 } from "@hpcc-js/react";
57
+
58
+ const vertices = [
59
+ {
60
+ id: 0,
61
+ text: "JAKE MCKEE",
62
+ centroid: true,
63
+ icon: {
64
+ imageChar: ""
65
+ },
66
+ subText: {
67
+ text: "03/26/2020",
68
+ textFill: "#555555"
69
+ },
70
+ annotationMeta: [
71
+ greyAnno(10, 15, -5),
72
+ dAnno(15, -4),
73
+ exclamationAnno(15, -4),
74
+ ]
75
+
76
+ },
77
+ {
78
+ id: 1,
79
+ text: "123 Main St",
80
+ icon: {
81
+ imageChar: "",
82
+ },
83
+ subText: {
84
+ text: "03/26/2020",
85
+ textFill: "#555555"
86
+ },
87
+ annotationMeta: [
88
+ greyAnno(13,5,-1),
89
+ exclamationAnno(),
90
+ ]
91
+ },
92
+ {
93
+ id: 2,
94
+ text: "555-55-5555",
95
+ icon: {
96
+ imageChar: "",
97
+ },
98
+ subText: {
99
+ text: "03/26/2020",
100
+ textFill: "#555555"
101
+ },
102
+ annotationMeta: [
103
+ greyAnno(8,5,-1),
104
+ exclamationAnno(),
105
+ ]
106
+ },
107
+ {
108
+ id: 3,
109
+ text: "Jmckee@gmail.com",
110
+ icon: {
111
+ imageChar: ""
112
+ },
113
+ subText: {
114
+ text: "03/26/2020",
115
+ textFill: "#555555"
116
+ },
117
+ annotationMeta: [
118
+ greyAnno(5,5,-1),
119
+ exclamationAnno(),
120
+ ]
121
+ },
122
+ {
123
+ id: 4,
124
+ text: "303-123-1234",
125
+ icon: {
126
+ imageChar: ""
127
+ },
128
+ subText: {
129
+ text: "03/26/2020",
130
+ textFill: "#555555"
131
+ },
132
+ annotationMeta: [
133
+ greyAnno(5,5,-1),
134
+ checkmarkAnno(),
135
+ ]
136
+ },
137
+ {
138
+ id: 5,
139
+ text: "123039923",
140
+ icon: {
141
+ imageChar: "",
142
+ },
143
+ subText: {
144
+ text: "03/26/2020",
145
+ textFill: "#555555"
146
+ },
147
+ annotationMeta: [
148
+ greyAnno(5,5,-1),
149
+ checkmarkAnno()
150
+ ]
151
+ },
152
+ {
153
+ id: 6,
154
+ text: "FL-2372-3982-9292-2929",
155
+ icon: {
156
+ imageChar: "",
157
+ },
158
+ subText: {
159
+ text: "03/26/2020",
160
+ textFill: "#555555"
161
+ },
162
+ annotationMeta: [
163
+ greyAnno(5,5,-1),
164
+ checkmarkAnno(),
165
+ ]
166
+ },
167
+ {
168
+ id: 7,
169
+ text: "11.12.3.301.31",
170
+ icon: {
171
+ imageChar: ""
172
+ },
173
+ subText: {
174
+ text: "03/26/2020",
175
+ },
176
+ annotationMeta: [
177
+ greyAnno(8,5,-1),
178
+ exclamationAnno(),
179
+ ]
180
+ },
181
+ ];
182
+
183
+ function greyAnno(text, padding = 5, yOffset = -1){
184
+ return {
185
+ text: text+"",
186
+ fill: "#555555",
187
+ stroke: "#555555",
188
+ textFill: "#ffffff",
189
+ padding: padding,
190
+ yOffset: yOffset
191
+ }
192
+ }
193
+ function dAnno(){
194
+ return {
195
+ text: "D",
196
+ fill: "#ED1C24",
197
+ stroke: "#ED1C24",
198
+ textFill: "#ffffff",
199
+ fontFamily: "Arial",
200
+ padding: 15,
201
+ yOffset: -4
202
+ };
203
+ }
204
+ function exclamationAnno(padding, yOffset){
205
+ return {
206
+ text: "",
207
+ fill: "#ED1C24",
208
+ stroke: "#ED1C24",
209
+ textFill: "#ffffff",
210
+ fontFamily: "Arial",
211
+ padding: padding,
212
+ yOffset: yOffset,
213
+ fontFamily: "'Font Awesome 5 Free'",
214
+ };
215
+ }
216
+ function checkmarkAnno(padding, yOffset){
217
+ return {
218
+ text: "",
219
+ fill: "#00802B",
220
+ stroke: "#00802B",
221
+ textFill: "#ffffff",
222
+ fontFamily: "'Font Awesome 5 Free'",
223
+ padding: padding,
224
+ yOffset: yOffset,
225
+ };
226
+ }
227
+ const graphData = { vertices };
228
+ graphData.edges = vertices.slice(1).map((n,i)=>{
229
+ return {
230
+ id: i,
231
+ source: graphData.vertices[0],
232
+ target: graphData.vertices[i+1],
233
+ }
234
+ })
235
+
236
+ new Graph2()
237
+ .target("target")
238
+ .centroidRenderer(CentroidVertex3)
239
+ .vertexRenderer(Vertex3)
240
+ .edgeColor("#287EC4")
241
+ .edgeStrokeWidth(2)
242
+ .edgeArcDepth(0)
243
+ .data(graphData)
244
+ .centroidColor("#777777")
245
+ .on("vertex_click", (row, col, sel) => console.log("click", row, col, sel))
246
+ .on("vertex_dblclick", (row, col, sel) => console.log("dblclick", row, col, sel))
247
+ .on("vertex_mousein", (row, col, sel) => console.log("mousein", row, col, sel))
248
+ .on("vertex_mouseover", (row, col, sel) => console.log("mouseover", row, col, sel))
249
+ .on("vertex_mouseout", (row, col, sel) => console.log("mouseout", row, col, sel))
250
+ .forceDirectedAlphaDecay(0.003)
251
+ .layout("ForceDirected")
252
+ .transitionDuration(0)
253
+ .render()
254
+ ;
255
+ </script>
256
+ </hpcc-vitepress>
257
257
  </ClientOnly>