@hpcc-js/graph 2.84.0 → 2.84.2

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 (46) hide show
  1. package/dist/index.es6.js +12 -2
  2. package/dist/index.es6.js.map +1 -1
  3. package/dist/index.js +12 -2
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.js +1 -1
  6. package/dist/index.min.js.map +1 -1
  7. package/package.json +7 -7
  8. package/src/__package__.ts +2 -2
  9. package/src/__tests__/data.ts +444 -0
  10. package/src/__tests__/index.ts +1 -0
  11. package/src/__tests__/test1.ts +18 -0
  12. package/src/__tests__/test2.ts +79 -0
  13. package/src/__tests__/test3.ts +46 -0
  14. package/src/__tests__/test4.ts +66 -0
  15. package/src/__tests__/test5.ts +82 -0
  16. package/src/graph2/graphReactT.ts +1 -0
  17. package/src/graph2/graphT.ts +7 -2
  18. package/src/graph2/layouts/placeholders.ts +4 -0
  19. package/types/__package__.d.ts +2 -2
  20. package/types/__package__.d.ts.map +1 -1
  21. package/types/__tests__/data.d.ts +9 -0
  22. package/types/__tests__/data.d.ts.map +1 -0
  23. package/types/__tests__/index.d.ts +2 -0
  24. package/types/__tests__/index.d.ts.map +1 -0
  25. package/types/__tests__/test1.d.ts +5 -0
  26. package/types/__tests__/test1.d.ts.map +1 -0
  27. package/types/__tests__/test2.d.ts +5 -0
  28. package/types/__tests__/test2.d.ts.map +1 -0
  29. package/types/__tests__/test3.d.ts +5 -0
  30. package/types/__tests__/test3.d.ts.map +1 -0
  31. package/types/__tests__/test4.d.ts +5 -0
  32. package/types/__tests__/test4.d.ts.map +1 -0
  33. package/types/__tests__/test5.d.ts +5 -0
  34. package/types/__tests__/test5.d.ts.map +1 -0
  35. package/types/graph2/graphT.d.ts.map +1 -1
  36. package/types/graph2/layouts/placeholders.d.ts +1 -0
  37. package/types/graph2/layouts/placeholders.d.ts.map +1 -1
  38. package/types-3.4/__package__.d.ts +2 -2
  39. package/types-3.4/__tests__/data.d.ts +9 -0
  40. package/types-3.4/__tests__/index.d.ts +2 -0
  41. package/types-3.4/__tests__/test1.d.ts +5 -0
  42. package/types-3.4/__tests__/test2.d.ts +5 -0
  43. package/types-3.4/__tests__/test3.d.ts +5 -0
  44. package/types-3.4/__tests__/test4.d.ts +5 -0
  45. package/types-3.4/__tests__/test5.d.ts +5 -0
  46. package/types-3.4/graph2/layouts/placeholders.d.ts +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hpcc-js/graph",
3
- "version": "2.84.0",
3
+ "version": "2.84.2",
4
4
  "description": "hpcc-js - Viz Graph",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es6",
@@ -52,11 +52,11 @@
52
52
  "update": "npx --yes npm-check-updates -u -t minor"
53
53
  },
54
54
  "dependencies": {
55
- "@hpcc-js/api": "^2.12.4",
56
- "@hpcc-js/common": "^2.71.4",
57
- "@hpcc-js/html": "^2.42.5",
58
- "@hpcc-js/react": "^2.53.0",
59
- "@hpcc-js/util": "^2.50.0"
55
+ "@hpcc-js/api": "^2.12.5",
56
+ "@hpcc-js/common": "^2.71.5",
57
+ "@hpcc-js/html": "^2.42.6",
58
+ "@hpcc-js/react": "^2.53.1",
59
+ "@hpcc-js/util": "^2.50.1"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@hpcc-js/bundle": "^2.11.3",
@@ -89,5 +89,5 @@
89
89
  "url": "https://github.com/hpcc-systems/Visualization/issues"
90
90
  },
91
91
  "homepage": "https://github.com/hpcc-systems/Visualization",
92
- "gitHead": "113e49eefde98196062fbf4150b20e833c4c8c19"
92
+ "gitHead": "f44f2fba05bc3ac886f1169e43c884773e97d8fc"
93
93
  }
@@ -1,3 +1,3 @@
1
1
  export const PKG_NAME = "@hpcc-js/graph";
2
- export const PKG_VERSION = "2.84.0";
3
- export const BUILD_VERSION = "2.104.8";
2
+ export const PKG_VERSION = "2.84.2";
3
+ export const BUILD_VERSION = "2.104.11";
@@ -0,0 +1,444 @@
1
+ import { Palette } from "@hpcc-js/common";
2
+ import { Vertex } from "../Vertex";
3
+ import { Edge } from "../Edge";
4
+
5
+ export function genData2() {
6
+ return {
7
+ vertices: [
8
+ ["a", "myriel@gmail.com", "fa-at", false, false, false, "fa-plus"],
9
+ [1, "Napoleon", "fa-user-o", true, true, true, "fa-plus"],
10
+ [2, "Mlle.Baptistine", "fa-user-o"],
11
+ [3, "Mme.Magloire", "fa-user-o"],
12
+ [4, "CountessdeLo", "fa-user-o"],
13
+ [5, "Geborand", "fa-user-o"],
14
+ [6, "Champtercier", "fa-user-o"],
15
+ [7, "Cravatte", "fa-user-o"],
16
+ [8, "(561)888-8888", "fa-phone"],
17
+ [9, "123-12-1234", "fa-address-card-o"],
18
+ [10, "192.168.0.100", "fa-globe"],
19
+ [11, "28 Mean Street, FL 33487", "fa-map-o"],
20
+ [12, "(561)999-9999", "fa-phone"],
21
+ [13, "123-45-6789", "fa-address-card-o"],
22
+ [14, "123-23-2345", "fa-address-card-o"],
23
+ [15, "(561)777-9999", "fa-phone"],
24
+ [16, "123-45-0000", "fa-address-card-o"],
25
+ [17, "192.168.0.22", "fa-globe"],
26
+ [18, "11 Arcia Ave, FL 33487", "fa-map-o"],
27
+ [19, "123-45-1111", "fa-address-card-o"],
28
+ [20, "123-45-1111", "fa-address-card-o"],
29
+ [21, "192.168.0.22", "fa-globe"],
30
+ [22, "(561)777-9999", "fa-phone"],
31
+ [23, "111-11-1111", "fa-address-card-o"],
32
+ [24, "192.168.0.33", "fa-globe"],
33
+ // [25, "XXX.XXX.XXX.XXX", "fa-globe"],
34
+ ],
35
+ edges: [
36
+ [1, "a", "XXX", 1],
37
+ [2, "a", "", 8],
38
+ [3, "a", "", 10],
39
+ [4, "a", "", 6],
40
+ [5, "a", "", 1],
41
+ [6, "a", "", 1],
42
+ [7, "a", "", 1],
43
+ [1, 8, "", 1],
44
+ [1, 9, "", 1],
45
+ [1, 10, "", 1],
46
+ [1, 11, "", 1],
47
+ [2, 12, "", 1],
48
+ [2, 13, "", 1],
49
+ [2, 10, "", 1],
50
+ [2, 11, "", 1],
51
+ [3, 12, "", 1],
52
+ [3, 14, "", 1],
53
+ [3, 10, "", 1],
54
+ [3, 11, "", 1],
55
+ [4, 15, "", 1],
56
+ [4, 16, "", 1],
57
+ [4, 17, "", 1],
58
+ [17, 11, "", 1],
59
+ [5, 17, "", 1],
60
+ [5, 18, "", 1],
61
+ [5, 19, "", 1],
62
+ [6, 18, "", 1],
63
+ [6, 20, "", 1],
64
+ [6, 21, "", 1],
65
+ [6, 22, "", 1],
66
+ [7, 22, "", 1],
67
+ [7, 23, "", 1],
68
+ [7, 24, "", 1],
69
+ [24, 24, "", 1],
70
+ ]
71
+ };
72
+ }
73
+
74
+ export function createData() {
75
+ const vertices = [];
76
+ const edges = [];
77
+ const palette = Palette.ordinal("dark2");
78
+ const rawData = {
79
+ nodes: [
80
+ { "name": "Myriel", "group": 1 },
81
+ { "name": "Napoleon", "group": 1 },
82
+ { "name": "Mlle.Baptistine", "group": 1 },
83
+ { "name": "Mme.Magloire", "group": 1 },
84
+ { "name": "CountessdeLo", "group": 1 },
85
+ { "name": "Geborand", "group": 1 },
86
+ { "name": "Champtercier", "group": 1 },
87
+ { "name": "Cravatte", "group": 1 },
88
+ { "name": "Count", "group": 1 },
89
+ { "name": "OldMan", "group": 1 },
90
+ { "name": "Labarre", "group": 2 },
91
+ { "name": "Valjean", "group": 2 },
92
+ { "name": "Marguerite", "group": 3 },
93
+ { "name": "Mme.deR", "group": 2 },
94
+ { "name": "Isabeau", "group": 2 },
95
+ { "name": "Gervais", "group": 2 },
96
+ { "name": "Tholomyes", "group": 3 },
97
+ { "name": "Listolier", "group": 3 },
98
+ { "name": "Fameuil", "group": 3 },
99
+ { "name": "Blacheville", "group": 3 },
100
+ { "name": "Favourite", "group": 3 },
101
+ { "name": "Dahlia", "group": 3 },
102
+ { "name": "Zephine", "group": 3 },
103
+ { "name": "Fantine", "group": 3 },
104
+ { "name": "Mme.Thenardier", "group": 4 },
105
+ { "name": "Thenardier", "group": 4 },
106
+ { "name": "Cosette", "group": 5 },
107
+ { "name": "Javert", "group": 4 },
108
+ { "name": "Fauchelevent", "group": 0 },
109
+ { "name": "Bamatabois", "group": 2 },
110
+ { "name": "Perpetue", "group": 3 },
111
+ { "name": "Simplice", "group": 2 },
112
+ { "name": "Scaufflaire", "group": 2 },
113
+ { "name": "Woman1", "group": 2 },
114
+ { "name": "Judge", "group": 2 },
115
+ { "name": "Champmathieu", "group": 2 },
116
+ { "name": "Brevet", "group": 2 },
117
+ { "name": "Chenildieu", "group": 2 },
118
+ { "name": "Cochepaille", "group": 2 },
119
+ { "name": "Pontmercy", "group": 4 },
120
+ { "name": "Boulatruelle", "group": 6 },
121
+ { "name": "Eponine", "group": 4 },
122
+ { "name": "Anzelma", "group": 4 },
123
+ { "name": "Woman2", "group": 5 },
124
+ { "name": "MotherInnocent", "group": 0 },
125
+ { "name": "Gribier", "group": 0 },
126
+ { "name": "Jondrette", "group": 7 },
127
+ { "name": "Mme.Burgon", "group": 7 },
128
+ { "name": "Gavroche", "group": 8 },
129
+ { "name": "Gillenormand", "group": 5 },
130
+ { "name": "Magnon", "group": 5 },
131
+ { "name": "Mlle.Gillenormand", "group": 5 },
132
+ { "name": "Mme.Pontmercy", "group": 5 },
133
+ { "name": "Mlle.Vaubois", "group": 5 },
134
+ { "name": "Lt.Gillenormand", "group": 5 },
135
+ { "name": "Marius", "group": 8 },
136
+ { "name": "BaronessT", "group": 5 },
137
+ { "name": "Mabeuf", "group": 8 },
138
+ { "name": "Enjolras", "group": 8 },
139
+ { "name": "Combeferre", "group": 8 },
140
+ { "name": "Prouvaire", "group": 8 },
141
+ { "name": "Feuilly", "group": 8 },
142
+ { "name": "Courfeyrac", "group": 8 },
143
+ { "name": "Bahorel", "group": 8 },
144
+ { "name": "Bossuet", "group": 8 },
145
+ { "name": "Joly", "group": 8 },
146
+ { "name": "Grantaire", "group": 8 },
147
+ { "name": "MotherPlutarch", "group": 9 },
148
+ { "name": "Gueulemer", "group": 4 },
149
+ { "name": "Babet", "group": 4 },
150
+ { "name": "Claquesous", "group": 4 },
151
+ { "name": "Montparnasse", "group": 4 },
152
+ { "name": "Toussaint", "group": 5 },
153
+ { "name": "Child1", "group": 10 },
154
+ { "name": "Child2", "group": 10 },
155
+ { "name": "Brujon", "group": 4 },
156
+ { "name": "Mme.Hucheloup", "group": 8 }
157
+ ],
158
+ "links": [
159
+ { "source": 1, "target": 0, "value": 1 },
160
+ { "source": 2, "target": 0, "value": 8 },
161
+ { "source": 2, "target": 0, "value": 8 },
162
+ { "source": 3, "target": 0, "value": 10 },
163
+ { "source": 3, "target": 2, "value": 6 },
164
+ { "source": 4, "target": 0, "value": 1 },
165
+ { "source": 5, "target": 0, "value": 1 },
166
+ { "source": 6, "target": 0, "value": 1 },
167
+ { "source": 7, "target": 0, "value": 1 },
168
+ { "source": 8, "target": 0, "value": 2 },
169
+ { "source": 9, "target": 0, "value": 1 },
170
+ { "source": 11, "target": 10, "value": 1 },
171
+ { "source": 11, "target": 3, "value": 3 },
172
+ { "source": 11, "target": 2, "value": 3 },
173
+ { "source": 11, "target": 0, "value": 5 },
174
+ { "source": 12, "target": 11, "value": 1 },
175
+ { "source": 13, "target": 11, "value": 1 },
176
+ { "source": 14, "target": 11, "value": 1 },
177
+ { "source": 15, "target": 11, "value": 1 },
178
+ { "source": 17, "target": 16, "value": 4 },
179
+ { "source": 18, "target": 16, "value": 4 },
180
+ { "source": 18, "target": 17, "value": 4 },
181
+ { "source": 19, "target": 16, "value": 4 },
182
+ { "source": 19, "target": 17, "value": 4 },
183
+ { "source": 19, "target": 18, "value": 4 },
184
+ { "source": 20, "target": 16, "value": 3 },
185
+ { "source": 20, "target": 17, "value": 3 },
186
+ { "source": 20, "target": 18, "value": 3 },
187
+ { "source": 20, "target": 19, "value": 4 },
188
+ { "source": 21, "target": 16, "value": 3 },
189
+ { "source": 21, "target": 17, "value": 3 },
190
+ { "source": 21, "target": 18, "value": 3 },
191
+ { "source": 21, "target": 19, "value": 3 },
192
+ { "source": 21, "target": 20, "value": 5 },
193
+ { "source": 22, "target": 16, "value": 3 },
194
+ { "source": 22, "target": 17, "value": 3 },
195
+ { "source": 22, "target": 18, "value": 3 },
196
+ { "source": 22, "target": 19, "value": 3 },
197
+ { "source": 22, "target": 20, "value": 4 },
198
+ { "source": 22, "target": 21, "value": 4 },
199
+ { "source": 23, "target": 16, "value": 3 },
200
+ { "source": 23, "target": 17, "value": 3 },
201
+ { "source": 23, "target": 18, "value": 3 },
202
+ { "source": 23, "target": 19, "value": 3 },
203
+ { "source": 23, "target": 20, "value": 4 },
204
+ { "source": 23, "target": 21, "value": 4 },
205
+ { "source": 23, "target": 22, "value": 4 },
206
+ { "source": 23, "target": 12, "value": 2 },
207
+ { "source": 23, "target": 11, "value": 9 },
208
+ { "source": 24, "target": 23, "value": 2 },
209
+ { "source": 24, "target": 11, "value": 7 },
210
+ { "source": 25, "target": 24, "value": 13 },
211
+ { "source": 25, "target": 23, "value": 1 },
212
+ { "source": 25, "target": 11, "value": 12 },
213
+ { "source": 26, "target": 24, "value": 4 },
214
+ { "source": 26, "target": 11, "value": 31 },
215
+ { "source": 26, "target": 16, "value": 1 },
216
+ { "source": 26, "target": 25, "value": 1 },
217
+ { "source": 27, "target": 11, "value": 17 },
218
+ { "source": 27, "target": 23, "value": 5 },
219
+ { "source": 27, "target": 25, "value": 5 },
220
+ { "source": 27, "target": 24, "value": 1 },
221
+ { "source": 27, "target": 26, "value": 1 },
222
+ { "source": 28, "target": 11, "value": 8 },
223
+ { "source": 28, "target": 27, "value": 1 },
224
+ { "source": 29, "target": 23, "value": 1 },
225
+ { "source": 29, "target": 27, "value": 1 },
226
+ { "source": 29, "target": 11, "value": 2 },
227
+ { "source": 30, "target": 23, "value": 1 },
228
+ { "source": 31, "target": 30, "value": 2 },
229
+ { "source": 31, "target": 11, "value": 3 },
230
+ { "source": 31, "target": 23, "value": 2 },
231
+ { "source": 31, "target": 27, "value": 1 },
232
+ { "source": 32, "target": 11, "value": 1 },
233
+ { "source": 33, "target": 11, "value": 2 },
234
+ { "source": 33, "target": 27, "value": 1 },
235
+ { "source": 34, "target": 11, "value": 3 },
236
+ { "source": 34, "target": 29, "value": 2 },
237
+ { "source": 35, "target": 11, "value": 3 },
238
+ { "source": 35, "target": 34, "value": 3 },
239
+ { "source": 35, "target": 29, "value": 2 },
240
+ { "source": 36, "target": 34, "value": 2 },
241
+ { "source": 36, "target": 35, "value": 2 },
242
+ { "source": 36, "target": 11, "value": 2 },
243
+ { "source": 36, "target": 29, "value": 1 },
244
+ { "source": 37, "target": 34, "value": 2 },
245
+ { "source": 37, "target": 35, "value": 2 },
246
+ { "source": 37, "target": 36, "value": 2 },
247
+ { "source": 37, "target": 11, "value": 2 },
248
+ { "source": 37, "target": 29, "value": 1 },
249
+ { "source": 38, "target": 34, "value": 2 },
250
+ { "source": 38, "target": 35, "value": 2 },
251
+ { "source": 38, "target": 36, "value": 2 },
252
+ { "source": 38, "target": 37, "value": 2 },
253
+ { "source": 38, "target": 11, "value": 2 },
254
+ { "source": 38, "target": 29, "value": 1 },
255
+ { "source": 39, "target": 25, "value": 1 },
256
+ { "source": 40, "target": 25, "value": 1 },
257
+ { "source": 41, "target": 24, "value": 2 },
258
+ { "source": 41, "target": 25, "value": 3 },
259
+ { "source": 42, "target": 41, "value": 2 },
260
+ { "source": 42, "target": 25, "value": 2 },
261
+ { "source": 42, "target": 24, "value": 1 },
262
+ { "source": 43, "target": 11, "value": 3 },
263
+ { "source": 43, "target": 26, "value": 1 },
264
+ { "source": 43, "target": 27, "value": 1 },
265
+ { "source": 44, "target": 28, "value": 3 },
266
+ { "source": 44, "target": 11, "value": 1 },
267
+ { "source": 45, "target": 28, "value": 2 },
268
+ { "source": 47, "target": 46, "value": 1 },
269
+ { "source": 48, "target": 47, "value": 2 },
270
+ { "source": 48, "target": 25, "value": 1 },
271
+ { "source": 48, "target": 27, "value": 1 },
272
+ { "source": 48, "target": 11, "value": 1 },
273
+ { "source": 49, "target": 26, "value": 3 },
274
+ { "source": 49, "target": 11, "value": 2 },
275
+ { "source": 50, "target": 49, "value": 1 },
276
+ { "source": 50, "target": 24, "value": 1 },
277
+ { "source": 51, "target": 49, "value": 9 },
278
+ { "source": 51, "target": 26, "value": 2 },
279
+ { "source": 51, "target": 11, "value": 2 },
280
+ { "source": 52, "target": 51, "value": 1 },
281
+ { "source": 52, "target": 39, "value": 1 },
282
+ { "source": 53, "target": 51, "value": 1 },
283
+ { "source": 54, "target": 51, "value": 2 },
284
+ { "source": 54, "target": 49, "value": 1 },
285
+ { "source": 54, "target": 26, "value": 1 },
286
+ { "source": 55, "target": 51, "value": 6 },
287
+ { "source": 55, "target": 49, "value": 12 },
288
+ { "source": 55, "target": 39, "value": 1 },
289
+ { "source": 55, "target": 54, "value": 1 },
290
+ { "source": 55, "target": 26, "value": 21 },
291
+ { "source": 55, "target": 11, "value": 19 },
292
+ { "source": 55, "target": 16, "value": 1 },
293
+ { "source": 55, "target": 25, "value": 2 },
294
+ { "source": 55, "target": 41, "value": 5 },
295
+ { "source": 55, "target": 48, "value": 4 },
296
+ { "source": 56, "target": 49, "value": 1 },
297
+ { "source": 56, "target": 55, "value": 1 },
298
+ { "source": 57, "target": 55, "value": 1 },
299
+ { "source": 57, "target": 41, "value": 1 },
300
+ { "source": 57, "target": 48, "value": 1 },
301
+ { "source": 58, "target": 55, "value": 7 },
302
+ { "source": 58, "target": 48, "value": 7 },
303
+ { "source": 58, "target": 27, "value": 6 },
304
+ { "source": 58, "target": 57, "value": 1 },
305
+ { "source": 58, "target": 11, "value": 4 },
306
+ { "source": 59, "target": 58, "value": 15 },
307
+ { "source": 59, "target": 55, "value": 5 },
308
+ { "source": 59, "target": 48, "value": 6 },
309
+ { "source": 59, "target": 57, "value": 2 },
310
+ { "source": 60, "target": 48, "value": 1 },
311
+ { "source": 60, "target": 58, "value": 4 },
312
+ { "source": 60, "target": 59, "value": 2 },
313
+ { "source": 61, "target": 48, "value": 2 },
314
+ { "source": 61, "target": 58, "value": 6 },
315
+ { "source": 61, "target": 60, "value": 2 },
316
+ { "source": 61, "target": 59, "value": 5 },
317
+ { "source": 61, "target": 57, "value": 1 },
318
+ { "source": 61, "target": 55, "value": 1 },
319
+ { "source": 62, "target": 55, "value": 9 },
320
+ { "source": 62, "target": 58, "value": 17 },
321
+ { "source": 62, "target": 59, "value": 13 },
322
+ { "source": 62, "target": 48, "value": 7 },
323
+ { "source": 62, "target": 57, "value": 2 },
324
+ { "source": 62, "target": 41, "value": 1 },
325
+ { "source": 62, "target": 61, "value": 6 },
326
+ { "source": 62, "target": 60, "value": 3 },
327
+ { "source": 63, "target": 59, "value": 5 },
328
+ { "source": 63, "target": 48, "value": 5 },
329
+ { "source": 63, "target": 62, "value": 6 },
330
+ { "source": 63, "target": 57, "value": 2 },
331
+ { "source": 63, "target": 58, "value": 4 },
332
+ { "source": 63, "target": 61, "value": 3 },
333
+ { "source": 63, "target": 60, "value": 2 },
334
+ { "source": 63, "target": 55, "value": 1 },
335
+ { "source": 64, "target": 55, "value": 5 },
336
+ { "source": 64, "target": 62, "value": 12 },
337
+ { "source": 64, "target": 48, "value": 5 },
338
+ { "source": 64, "target": 63, "value": 4 },
339
+ { "source": 64, "target": 58, "value": 10 },
340
+ { "source": 64, "target": 61, "value": 6 },
341
+ { "source": 64, "target": 60, "value": 2 },
342
+ { "source": 64, "target": 59, "value": 9 },
343
+ { "source": 64, "target": 57, "value": 1 },
344
+ { "source": 64, "target": 11, "value": 1 },
345
+ { "source": 65, "target": 63, "value": 5 },
346
+ { "source": 65, "target": 64, "value": 7 },
347
+ { "source": 65, "target": 48, "value": 3 },
348
+ { "source": 65, "target": 62, "value": 5 },
349
+ { "source": 65, "target": 58, "value": 5 },
350
+ { "source": 65, "target": 61, "value": 5 },
351
+ { "source": 65, "target": 60, "value": 2 },
352
+ { "source": 65, "target": 59, "value": 5 },
353
+ { "source": 65, "target": 57, "value": 1 },
354
+ { "source": 65, "target": 55, "value": 2 },
355
+ { "source": 66, "target": 64, "value": 3 },
356
+ { "source": 66, "target": 58, "value": 3 },
357
+ { "source": 66, "target": 59, "value": 1 },
358
+ { "source": 66, "target": 62, "value": 2 },
359
+ { "source": 66, "target": 65, "value": 2 },
360
+ { "source": 66, "target": 48, "value": 1 },
361
+ { "source": 66, "target": 63, "value": 1 },
362
+ { "source": 66, "target": 61, "value": 1 },
363
+ { "source": 66, "target": 60, "value": 1 },
364
+ { "source": 67, "target": 57, "value": 3 },
365
+ { "source": 68, "target": 25, "value": 5 },
366
+ { "source": 68, "target": 11, "value": 1 },
367
+ { "source": 68, "target": 24, "value": 1 },
368
+ { "source": 68, "target": 27, "value": 1 },
369
+ { "source": 68, "target": 48, "value": 1 },
370
+ { "source": 68, "target": 41, "value": 1 },
371
+ { "source": 69, "target": 25, "value": 6 },
372
+ { "source": 69, "target": 68, "value": 6 },
373
+ { "source": 69, "target": 11, "value": 1 },
374
+ { "source": 69, "target": 24, "value": 1 },
375
+ { "source": 69, "target": 27, "value": 2 },
376
+ { "source": 69, "target": 48, "value": 1 },
377
+ { "source": 69, "target": 41, "value": 1 },
378
+ { "source": 70, "target": 25, "value": 4 },
379
+ { "source": 70, "target": 69, "value": 4 },
380
+ { "source": 70, "target": 68, "value": 4 },
381
+ { "source": 70, "target": 11, "value": 1 },
382
+ { "source": 70, "target": 24, "value": 1 },
383
+ { "source": 70, "target": 27, "value": 1 },
384
+ { "source": 70, "target": 41, "value": 1 },
385
+ { "source": 70, "target": 58, "value": 1 },
386
+ { "source": 71, "target": 27, "value": 1 },
387
+ { "source": 71, "target": 69, "value": 2 },
388
+ { "source": 71, "target": 68, "value": 2 },
389
+ { "source": 71, "target": 70, "value": 2 },
390
+ { "source": 71, "target": 11, "value": 1 },
391
+ { "source": 71, "target": 48, "value": 1 },
392
+ { "source": 71, "target": 41, "value": 1 },
393
+ { "source": 71, "target": 25, "value": 1 },
394
+ { "source": 72, "target": 26, "value": 2 },
395
+ { "source": 72, "target": 27, "value": 1 },
396
+ { "source": 72, "target": 11, "value": 1 },
397
+ { "source": 73, "target": 48, "value": 2 },
398
+ { "source": 74, "target": 48, "value": 2 },
399
+ { "source": 74, "target": 73, "value": 3 },
400
+ { "source": 75, "target": 69, "value": 3 },
401
+ { "source": 75, "target": 68, "value": 3 },
402
+ { "source": 75, "target": 25, "value": 3 },
403
+ { "source": 75, "target": 48, "value": 1 },
404
+ { "source": 75, "target": 41, "value": 1 },
405
+ { "source": 75, "target": 70, "value": 1 },
406
+ { "source": 75, "target": 71, "value": 1 },
407
+ { "source": 76, "target": 64, "value": 1 },
408
+ { "source": 76, "target": 65, "value": 1 },
409
+ { "source": 76, "target": 66, "value": 1 },
410
+ { "source": 76, "target": 63, "value": 1 },
411
+ { "source": 76, "target": 62, "value": 1 },
412
+ { "source": 76, "target": 48, "value": 1 },
413
+ { "source": 76, "target": 58, "value": 1 }
414
+ ]
415
+ };
416
+ rawData.nodes.forEach(function (node: any) {
417
+ vertices.push(
418
+ new Vertex()
419
+ .centroid(node.name === "Valjean")
420
+ .text(node.name)
421
+ .textbox_shape_colorStroke(palette(node.group))
422
+ .textbox_shape_colorFill("whitesmoke")
423
+ .icon_shape_colorStroke(palette(node.group))
424
+ .icon_shape_colorFill(palette(node.group))
425
+ .faChar(node.name[0])
426
+ )
427
+ ;
428
+ });
429
+
430
+ rawData.links.forEach(function (link, idx) {
431
+ edges.push(
432
+ new Edge()
433
+ .sourceVertex(vertices[link.source])
434
+ .targetVertex(vertices[link.target])
435
+ .sourceMarker("circle")
436
+ .targetMarker("arrow")
437
+ .text("")
438
+ .weight(link.value)
439
+ )
440
+ ;
441
+ });
442
+
443
+ return { vertices: vertices, edges: edges };
444
+ }
@@ -0,0 +1 @@
1
+ export { Test5 as Test } from "./test5";
@@ -0,0 +1,18 @@
1
+ import { Graph } from "../Graph";
2
+ import { createData } from "./data";
3
+
4
+ export class Test extends Graph {
5
+
6
+ constructor() {
7
+ super();
8
+ this
9
+ .data(createData())
10
+ .layout("ForceDirected")
11
+ .applyScaleOnLayout(true)
12
+ .centroidColor("darkgreen")
13
+ .dragSingleNeighbors(true)
14
+ .highlightSelectedPathToCentroid(true)
15
+ ;
16
+ }
17
+ }
18
+
@@ -0,0 +1,79 @@
1
+ import { DataGraph } from "../graph2/dataGraph";
2
+ import { genData2 } from "./data";
3
+
4
+ export class Test2 extends DataGraph {
5
+
6
+ constructor() {
7
+ super();
8
+ const g = genData2();
9
+ this
10
+ .layout("ForceDirected")
11
+ .forceDirectedRepulsionStrength(-3500)
12
+ .forceDirectedLinkDistance(150)
13
+ .forceDirectedLinkStrength(1.5)
14
+ .forceDirectedPinCentroid(true)
15
+ .hierarchyDigraph(false)
16
+
17
+ .centroidColor("#777777")
18
+
19
+ .selectionGlowColor("#555555")
20
+ .highlightOnMouseOverEdge(true)
21
+ .highlightOnMouseOverVertex(true)
22
+ .showVertexLabels(true)
23
+
24
+ .applyScaleOnLayout(true)
25
+ .zoomToFitLimit(1)
26
+
27
+ .edgeArcDepth(8)
28
+ .edgeStrokeWidth(2)
29
+ .edgeColor("#287EC4")
30
+
31
+ .allowDragging(true)
32
+
33
+ .annotations([{
34
+ id: "0",
35
+ imageChar: "fa-plus",
36
+ fill: "white",
37
+ stroke: "whitesmoke",
38
+ imageCharFill: "red"
39
+ }, {
40
+ id: "1",
41
+ imageChar: "fa-star",
42
+ fill: "navy",
43
+ imageCharFill: "white"
44
+ }])
45
+
46
+ .vertexColumns(["id", "label", "fachar", "centroid", "ann1", "ann2", "expandedFAChar"])
47
+ .vertexCentroidColumn("centroid")
48
+ .vertexFACharColumn("fachar")
49
+ .vertexIDColumn("id")
50
+ .vertexLabelColumn("label")
51
+ .vertexAnnotationColumns([
52
+ { columnID: "ann1", annotationID: "0" } as any,
53
+ { columnID: "ann2", annotationID: "1" } as any
54
+ ])
55
+ .vertexExpansionFACharColumn("expandedFAChar")
56
+ .vertices(g.vertices)
57
+
58
+ .edgeColumns(["source", "target", "label", "weightXXX"])
59
+ // .edgeIDColumn("id")
60
+ .edgeSourceColumn("source")
61
+ .edgeTargetColumn("target")
62
+ .edgeLabelColumn("label")
63
+ // .edgeWeightColumn("weight")
64
+ .edges(g.edges)
65
+
66
+ // Events ---
67
+ .on("vertex_mousein", (vertex, col, sel, anno) => console.info("vertex_mousein", vertex, anno))
68
+ .on("vertex_mouseout", (vertex, col, sel, anno) => console.info("vertex_mouseout", vertex, anno))
69
+ .on("vertex_mouseover", (vertex, col, sel, anno) => console.info("vertex_mouseover", vertex, anno))
70
+ .on("vertex_click", (vertex, col, sel, anno) => console.info("vertex_click", vertex, anno))
71
+ .on("vertex_dblclick", (vertex, col, sel, anno) => console.info("vertex_dblclick", vertex, anno))
72
+ ;
73
+
74
+ setTimeout(() => {
75
+ // this.downloadPNG();
76
+ }, 3000);
77
+ }
78
+ }
79
+
@@ -0,0 +1,46 @@
1
+ import { SankeyGraph } from "../graph2/sankeyGraph";
2
+
3
+ export class Test3 extends SankeyGraph {
4
+
5
+ constructor() {
6
+ super();
7
+ this
8
+ .vertexColumns(["category", "id", "label"])
9
+ .vertices([
10
+ [0, 0, "A"],
11
+ [0, 1, "B"],
12
+ [0, 2, "C"],
13
+ [0, 3, "D"],
14
+ [0, 4, "F"],
15
+ [1, 5, "Math"],
16
+ [2, 6, "English"],
17
+ [3, 7, "Geometry"],
18
+ [4, 8, "Science"],
19
+ ])
20
+ .edgeColumns(["source", "target", "weight"])
21
+ .edges([
22
+ [0, 5, 48],
23
+ [0, 6, 28],
24
+ [0, 7, 26],
25
+ [0, 8, 38],
26
+ [1, 5, 63],
27
+ [1, 6, 39],
28
+ [1, 7, 36],
29
+ [1, 8, 58],
30
+ [2, 5, 42],
31
+ [2, 6, 36],
32
+ [2, 7, 27],
33
+ [2, 8, 68],
34
+ [3, 5, 90],
35
+ [3, 6, 59],
36
+ [3, 7, 15],
37
+ [3, 8, 35],
38
+ [4, 5, 10],
39
+ [4, 6, 3],
40
+ [4, 7, 6],
41
+ [4, 8, 4],
42
+ ])
43
+ ;
44
+ }
45
+ }
46
+