@antv/g6 5.0.0-alpha.8 → 5.0.0-alpha.9
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/dist/g6.min.js +6 -19
- package/esm/index.d.ts +26 -6
- package/esm/item/combo.d.ts +72 -2
- package/esm/item/combo.js +122 -2
- package/esm/item/combo.js.map +1 -1
- package/esm/item/edge.d.ts +3 -3
- package/esm/item/edge.js +4 -5
- package/esm/item/edge.js.map +1 -1
- package/esm/item/item.d.ts +4 -4
- package/esm/item/item.js +38 -9
- package/esm/item/item.js.map +1 -1
- package/esm/item/node.d.ts +20 -16
- package/esm/item/node.js +14 -8
- package/esm/item/node.js.map +1 -1
- package/esm/runtime/controller/data.d.ts +12 -4
- package/esm/runtime/controller/data.js +354 -62
- package/esm/runtime/controller/data.js.map +1 -1
- package/esm/runtime/controller/interaction.js +16 -4
- package/esm/runtime/controller/interaction.js.map +1 -1
- package/esm/runtime/controller/item.d.ts +11 -2
- package/esm/runtime/controller/item.js +344 -52
- package/esm/runtime/controller/item.js.map +1 -1
- package/esm/runtime/controller/layout.js +19 -5
- package/esm/runtime/controller/layout.js.map +1 -1
- package/esm/runtime/graph.d.ts +54 -17
- package/esm/runtime/graph.js +165 -34
- package/esm/runtime/graph.js.map +1 -1
- package/esm/stdlib/behavior/click-select.d.ts +3 -0
- package/esm/stdlib/behavior/click-select.js +13 -1
- package/esm/stdlib/behavior/click-select.js.map +1 -1
- package/esm/stdlib/behavior/collapse-expand-combo.d.ts +29 -0
- package/esm/stdlib/behavior/collapse-expand-combo.js +35 -0
- package/esm/stdlib/behavior/collapse-expand-combo.js.map +1 -0
- package/esm/stdlib/behavior/drag-combo.d.ts +99 -0
- package/esm/stdlib/behavior/drag-combo.js +341 -0
- package/esm/stdlib/behavior/drag-combo.js.map +1 -0
- package/esm/stdlib/behavior/drag-node.d.ts +14 -10
- package/esm/stdlib/behavior/drag-node.js +134 -37
- package/esm/stdlib/behavior/drag-node.js.map +1 -1
- package/esm/stdlib/behavior/hover-activate.d.ts +3 -1
- package/esm/stdlib/behavior/hover-activate.js +3 -1
- package/esm/stdlib/behavior/hover-activate.js.map +1 -1
- package/esm/stdlib/behavior/orbit-canvas-3d.js +1 -1
- package/esm/stdlib/behavior/orbit-canvas-3d.js.map +1 -1
- package/esm/stdlib/behavior/track-canvas-3d.js +1 -1
- package/esm/stdlib/behavior/track-canvas-3d.js.map +1 -1
- package/esm/stdlib/index.d.ts +25 -3
- package/esm/stdlib/index.js +25 -3
- package/esm/stdlib/index.js.map +1 -1
- package/esm/stdlib/item/combo/circle.d.ts +29 -0
- package/esm/stdlib/item/combo/circle.js +56 -0
- package/esm/stdlib/item/combo/circle.js.map +1 -0
- package/esm/stdlib/item/edge/base.d.ts +2 -2
- package/esm/stdlib/item/edge/base.js +3 -0
- package/esm/stdlib/item/edge/base.js.map +1 -1
- package/esm/stdlib/item/edge/cubic-horizon.d.ts +37 -0
- package/esm/stdlib/item/edge/cubic-horizon.js +71 -0
- package/esm/stdlib/item/edge/cubic-horizon.js.map +1 -0
- package/esm/stdlib/item/edge/cubic-vertical.d.ts +37 -0
- package/esm/stdlib/item/edge/cubic-vertical.js +71 -0
- package/esm/stdlib/item/edge/cubic-vertical.js.map +1 -0
- package/esm/stdlib/item/edge/cubic.d.ts +60 -0
- package/esm/stdlib/item/edge/cubic.js +99 -0
- package/esm/stdlib/item/edge/cubic.js.map +1 -0
- package/esm/stdlib/item/edge/index.d.ts +1 -0
- package/esm/stdlib/item/edge/index.js +1 -0
- package/esm/stdlib/item/edge/index.js.map +1 -1
- package/esm/stdlib/item/edge/line.d.ts +1 -1
- package/esm/stdlib/item/edge/quadratic.d.ts +41 -0
- package/esm/stdlib/item/edge/quadratic.js +66 -0
- package/esm/stdlib/item/edge/quadratic.js.map +1 -0
- package/esm/stdlib/item/node/base.d.ts +38 -37
- package/esm/stdlib/item/node/base.js +4 -4
- package/esm/stdlib/item/node/base.js.map +1 -1
- package/esm/stdlib/item/node/index.d.ts +1 -0
- package/esm/stdlib/item/node/index.js +1 -0
- package/esm/stdlib/item/node/index.js.map +1 -1
- package/esm/stdlib/item/node/rect.d.ts +31 -0
- package/esm/stdlib/item/node/rect.js +59 -0
- package/esm/stdlib/item/node/rect.js.map +1 -0
- package/esm/stdlib/plugin/fisheye/index.d.ts +102 -0
- package/esm/stdlib/plugin/fisheye/index.js +487 -0
- package/esm/stdlib/plugin/fisheye/index.js.map +1 -0
- package/esm/stdlib/plugin/menu/index.d.ts +42 -0
- package/esm/stdlib/plugin/menu/index.js +236 -0
- package/esm/stdlib/plugin/menu/index.js.map +1 -0
- package/esm/stdlib/plugin/tooltip/index.d.ts +75 -0
- package/esm/stdlib/plugin/tooltip/index.js +377 -0
- package/esm/stdlib/plugin/tooltip/index.js.map +1 -0
- package/esm/stdlib/theme/dark.js +4 -0
- package/esm/stdlib/theme/dark.js.map +1 -1
- package/esm/stdlib/theme/light.js +54 -9
- package/esm/stdlib/theme/light.js.map +1 -1
- package/esm/types/combo.d.ts +52 -3
- package/esm/types/data.d.ts +4 -4
- package/esm/types/edge.d.ts +2 -3
- package/esm/types/event.d.ts +9 -1
- package/esm/types/event.js +8 -8
- package/esm/types/event.js.map +1 -1
- package/esm/types/graph.d.ts +49 -13
- package/esm/types/hook.d.ts +8 -1
- package/esm/types/item.d.ts +4 -4
- package/esm/types/node.d.ts +4 -5
- package/esm/types/theme.d.ts +1 -1
- package/esm/util/animate.js.map +1 -1
- package/esm/util/canvas.js +8 -0
- package/esm/util/canvas.js.map +1 -1
- package/esm/util/data.d.ts +65 -0
- package/esm/util/data.js +150 -0
- package/esm/util/data.js.map +1 -0
- package/esm/util/event.d.ts +8 -0
- package/esm/util/event.js +16 -0
- package/esm/util/event.js.map +1 -1
- package/esm/util/item.d.ts +2 -1
- package/esm/util/item.js +36 -13
- package/esm/util/item.js.map +1 -1
- package/esm/util/shape.d.ts +39 -4
- package/esm/util/shape.js +101 -1
- package/esm/util/shape.js.map +1 -1
- package/esm/util/zoom.d.ts +2 -2
- package/lib/index.d.ts +26 -6
- package/lib/item/combo.d.ts +72 -2
- package/lib/item/combo.js +122 -2
- package/lib/item/combo.js.map +1 -1
- package/lib/item/edge.d.ts +3 -3
- package/lib/item/edge.js +4 -5
- package/lib/item/edge.js.map +1 -1
- package/lib/item/item.d.ts +4 -4
- package/lib/item/item.js +37 -8
- package/lib/item/item.js.map +1 -1
- package/lib/item/node.d.ts +20 -16
- package/lib/item/node.js +14 -8
- package/lib/item/node.js.map +1 -1
- package/lib/runtime/controller/data.d.ts +12 -4
- package/lib/runtime/controller/data.js +353 -61
- package/lib/runtime/controller/data.js.map +1 -1
- package/lib/runtime/controller/interaction.js +15 -3
- package/lib/runtime/controller/interaction.js.map +1 -1
- package/lib/runtime/controller/item.d.ts +11 -2
- package/lib/runtime/controller/item.js +342 -50
- package/lib/runtime/controller/item.js.map +1 -1
- package/lib/runtime/controller/layout.js +19 -5
- package/lib/runtime/controller/layout.js.map +1 -1
- package/lib/runtime/graph.d.ts +54 -17
- package/lib/runtime/graph.js +165 -34
- package/lib/runtime/graph.js.map +1 -1
- package/lib/stdlib/behavior/click-select.d.ts +3 -0
- package/lib/stdlib/behavior/click-select.js +13 -1
- package/lib/stdlib/behavior/click-select.js.map +1 -1
- package/lib/stdlib/behavior/collapse-expand-combo.d.ts +29 -0
- package/lib/stdlib/behavior/collapse-expand-combo.js +38 -0
- package/lib/stdlib/behavior/collapse-expand-combo.js.map +1 -0
- package/lib/stdlib/behavior/drag-combo.d.ts +99 -0
- package/lib/stdlib/behavior/drag-combo.js +344 -0
- package/lib/stdlib/behavior/drag-combo.js.map +1 -0
- package/lib/stdlib/behavior/drag-node.d.ts +14 -10
- package/lib/stdlib/behavior/drag-node.js +134 -37
- package/lib/stdlib/behavior/drag-node.js.map +1 -1
- package/lib/stdlib/behavior/hover-activate.d.ts +3 -1
- package/lib/stdlib/behavior/hover-activate.js +3 -2
- package/lib/stdlib/behavior/hover-activate.js.map +1 -1
- package/lib/stdlib/behavior/orbit-canvas-3d.js +1 -1
- package/lib/stdlib/behavior/orbit-canvas-3d.js.map +1 -1
- package/lib/stdlib/behavior/track-canvas-3d.js +1 -1
- package/lib/stdlib/behavior/track-canvas-3d.js.map +1 -1
- package/lib/stdlib/index.d.ts +25 -3
- package/lib/stdlib/index.js +25 -3
- package/lib/stdlib/index.js.map +1 -1
- package/lib/stdlib/item/combo/circle.d.ts +29 -0
- package/lib/stdlib/item/combo/circle.js +60 -0
- package/lib/stdlib/item/combo/circle.js.map +1 -0
- package/lib/stdlib/item/edge/base.d.ts +2 -2
- package/lib/stdlib/item/edge/base.js +3 -0
- package/lib/stdlib/item/edge/base.js.map +1 -1
- package/lib/stdlib/item/edge/cubic-horizon.d.ts +37 -0
- package/lib/stdlib/item/edge/cubic-horizon.js +75 -0
- package/lib/stdlib/item/edge/cubic-horizon.js.map +1 -0
- package/lib/stdlib/item/edge/cubic-vertical.d.ts +37 -0
- package/lib/stdlib/item/edge/cubic-vertical.js +75 -0
- package/lib/stdlib/item/edge/cubic-vertical.js.map +1 -0
- package/lib/stdlib/item/edge/cubic.d.ts +60 -0
- package/lib/stdlib/item/edge/cubic.js +103 -0
- package/lib/stdlib/item/edge/cubic.js.map +1 -0
- package/lib/stdlib/item/edge/index.d.ts +1 -0
- package/lib/stdlib/item/edge/index.js +1 -0
- package/lib/stdlib/item/edge/index.js.map +1 -1
- package/lib/stdlib/item/edge/line.d.ts +1 -1
- package/lib/stdlib/item/edge/quadratic.d.ts +41 -0
- package/lib/stdlib/item/edge/quadratic.js +70 -0
- package/lib/stdlib/item/edge/quadratic.js.map +1 -0
- package/lib/stdlib/item/node/base.d.ts +38 -37
- package/lib/stdlib/item/node/base.js +4 -4
- package/lib/stdlib/item/node/base.js.map +1 -1
- package/lib/stdlib/item/node/index.d.ts +1 -0
- package/lib/stdlib/item/node/index.js +1 -0
- package/lib/stdlib/item/node/index.js.map +1 -1
- package/lib/stdlib/item/node/rect.d.ts +31 -0
- package/lib/stdlib/item/node/rect.js +63 -0
- package/lib/stdlib/item/node/rect.js.map +1 -0
- package/lib/stdlib/plugin/fisheye/index.d.ts +102 -0
- package/lib/stdlib/plugin/fisheye/index.js +490 -0
- package/lib/stdlib/plugin/fisheye/index.js.map +1 -0
- package/lib/stdlib/plugin/menu/index.d.ts +42 -0
- package/lib/stdlib/plugin/menu/index.js +242 -0
- package/lib/stdlib/plugin/menu/index.js.map +1 -0
- package/lib/stdlib/plugin/tooltip/index.d.ts +75 -0
- package/lib/stdlib/plugin/tooltip/index.js +383 -0
- package/lib/stdlib/plugin/tooltip/index.js.map +1 -0
- package/lib/stdlib/theme/dark.js +4 -0
- package/lib/stdlib/theme/dark.js.map +1 -1
- package/lib/stdlib/theme/light.js +54 -9
- package/lib/stdlib/theme/light.js.map +1 -1
- package/lib/types/combo.d.ts +52 -3
- package/lib/types/data.d.ts +4 -4
- package/lib/types/edge.d.ts +2 -3
- package/lib/types/event.d.ts +9 -1
- package/lib/types/event.js +10 -10
- package/lib/types/event.js.map +1 -1
- package/lib/types/graph.d.ts +49 -13
- package/lib/types/hook.d.ts +8 -1
- package/lib/types/item.d.ts +4 -4
- package/lib/types/item.js +1 -1
- package/lib/types/item.js.map +1 -1
- package/lib/types/node.d.ts +4 -5
- package/lib/types/theme.d.ts +1 -1
- package/lib/util/animate.js.map +1 -1
- package/lib/util/canvas.js +8 -0
- package/lib/util/canvas.js.map +1 -1
- package/lib/util/data.d.ts +65 -0
- package/lib/util/data.js +161 -0
- package/lib/util/data.js.map +1 -0
- package/lib/util/event.d.ts +8 -0
- package/lib/util/event.js +18 -1
- package/lib/util/event.js.map +1 -1
- package/lib/util/item.d.ts +2 -1
- package/lib/util/item.js +36 -13
- package/lib/util/item.js.map +1 -1
- package/lib/util/shape.d.ts +39 -4
- package/lib/util/shape.js +105 -2
- package/lib/util/shape.js.map +1 -1
- package/lib/util/zoom.d.ts +2 -2
- package/package.json +13 -13
- package/src/item/combo.ts +220 -2
- package/src/item/edge.ts +7 -8
- package/src/item/item.ts +58 -15
- package/src/item/node.ts +47 -24
- package/src/runtime/controller/data.ts +390 -68
- package/src/runtime/controller/interaction.ts +23 -3
- package/src/runtime/controller/item.ts +444 -64
- package/src/runtime/controller/layout.ts +24 -5
- package/src/runtime/graph.ts +225 -38
- package/src/stdlib/behavior/click-select.ts +15 -2
- package/src/stdlib/behavior/collapse-expand-combo.ts +59 -0
- package/src/stdlib/behavior/drag-combo.ts +533 -0
- package/src/stdlib/behavior/drag-node.ts +195 -62
- package/src/stdlib/behavior/hover-activate.ts +4 -5
- package/src/stdlib/behavior/orbit-canvas-3d.ts +1 -1
- package/src/stdlib/behavior/track-canvas-3d.ts +1 -1
- package/src/stdlib/index.ts +25 -3
- package/src/stdlib/item/combo/circle.ts +113 -0
- package/src/stdlib/item/edge/base.ts +5 -2
- package/src/stdlib/item/edge/cubic-horizon.ts +114 -0
- package/src/stdlib/item/edge/cubic-vertical.ts +116 -0
- package/src/stdlib/item/edge/cubic.ts +198 -0
- package/src/stdlib/item/edge/index.ts +1 -0
- package/src/stdlib/item/edge/quadratic.ts +136 -0
- package/src/stdlib/item/node/base.ts +79 -41
- package/src/stdlib/item/node/index.ts +1 -0
- package/src/stdlib/item/node/rect.ts +124 -0
- package/src/stdlib/plugin/fisheye/index.ts +578 -0
- package/src/stdlib/plugin/menu/index.ts +260 -0
- package/src/stdlib/plugin/tooltip/index.ts +424 -0
- package/src/stdlib/theme/dark.ts +4 -0
- package/src/stdlib/theme/light.ts +77 -9
- package/src/types/combo.ts +61 -3
- package/src/types/data.ts +6 -4
- package/src/types/edge.ts +2 -2
- package/src/types/event.ts +8 -8
- package/src/types/graph.ts +73 -16
- package/src/types/hook.ts +8 -1
- package/src/types/item.ts +10 -9
- package/src/types/node.ts +4 -4
- package/src/types/theme.ts +1 -1
- package/src/util/animate.ts +2 -3
- package/src/util/canvas.ts +10 -0
- package/src/util/data.ts +178 -0
- package/src/util/event.ts +29 -0
- package/src/util/item.ts +75 -12
- package/src/util/shape.ts +142 -5
- package/src/util/zoom.ts +2 -2
|
@@ -14,6 +14,9 @@ const edgeDisableStroke = 'rgb(217, 217, 217)';
|
|
|
14
14
|
const edgeInactiveStroke = 'rgb(210, 218, 233)';
|
|
15
15
|
|
|
16
16
|
const nodeStroke = 'rgba(0,0,0,0.85)';
|
|
17
|
+
const comboStroke = 'rgba(153,173,209,1)';
|
|
18
|
+
const comboSelectedStroke = 'rgba(27,50,79,1)';
|
|
19
|
+
const disabledStroke = 'rgba(153,173,209,1)';
|
|
17
20
|
|
|
18
21
|
export default {
|
|
19
22
|
node: {
|
|
@@ -105,6 +108,7 @@ export default {
|
|
|
105
108
|
haloShape: {
|
|
106
109
|
opacity: 0.25,
|
|
107
110
|
lineWidth: 20,
|
|
111
|
+
pointerEvents: 'none',
|
|
108
112
|
zIndex: -1,
|
|
109
113
|
visible: true,
|
|
110
114
|
},
|
|
@@ -116,6 +120,7 @@ export default {
|
|
|
116
120
|
haloShape: {
|
|
117
121
|
opacity: 0.25,
|
|
118
122
|
lineWidth: 20,
|
|
123
|
+
pointerEvents: 'none',
|
|
119
124
|
zIndex: -1,
|
|
120
125
|
visible: true,
|
|
121
126
|
},
|
|
@@ -234,6 +239,7 @@ export default {
|
|
|
234
239
|
opacity: 0.25,
|
|
235
240
|
lineWidth: 12,
|
|
236
241
|
zIndex: -1,
|
|
242
|
+
pointerEvents: 'none',
|
|
237
243
|
visible: true,
|
|
238
244
|
},
|
|
239
245
|
},
|
|
@@ -245,6 +251,7 @@ export default {
|
|
|
245
251
|
opacity: 0.25,
|
|
246
252
|
lineWidth: 12,
|
|
247
253
|
zIndex: -1,
|
|
254
|
+
pointerEvents: 'none',
|
|
248
255
|
visible: true,
|
|
249
256
|
},
|
|
250
257
|
},
|
|
@@ -271,7 +278,6 @@ export default {
|
|
|
271
278
|
},
|
|
272
279
|
],
|
|
273
280
|
},
|
|
274
|
-
// TODO
|
|
275
281
|
combo: {
|
|
276
282
|
styles: [
|
|
277
283
|
{
|
|
@@ -280,34 +286,65 @@ export default {
|
|
|
280
286
|
...DEFAULT_SHAPE_STYLE,
|
|
281
287
|
fill: comboFill,
|
|
282
288
|
lineWidth: 1,
|
|
283
|
-
stroke:
|
|
289
|
+
stroke: comboStroke,
|
|
284
290
|
r: 5,
|
|
285
291
|
width: 20,
|
|
286
292
|
height: 10,
|
|
287
293
|
padding: [25, 20, 15, 20],
|
|
288
294
|
},
|
|
295
|
+
labelShape: {
|
|
296
|
+
...DEFAULT_TEXT_STYLE,
|
|
297
|
+
fill: '#000',
|
|
298
|
+
position: 'bottom',
|
|
299
|
+
zIndex: 2,
|
|
300
|
+
lod: 0,
|
|
301
|
+
maxLines: 1,
|
|
302
|
+
},
|
|
303
|
+
labelBackgroundShape: {
|
|
304
|
+
padding: [2, 4, 2, 4],
|
|
305
|
+
lineWidth: 0,
|
|
306
|
+
fill: '#fff',
|
|
307
|
+
opacity: 0.75,
|
|
308
|
+
zIndex: 1,
|
|
309
|
+
lod: 0,
|
|
310
|
+
},
|
|
289
311
|
},
|
|
290
312
|
selected: {
|
|
291
313
|
keyShape: {
|
|
292
|
-
stroke:
|
|
314
|
+
stroke: comboSelectedStroke,
|
|
293
315
|
fill: comboFill,
|
|
294
|
-
lineWidth:
|
|
316
|
+
lineWidth: 4,
|
|
295
317
|
},
|
|
296
318
|
labelShape: {
|
|
297
319
|
fontWeight: 700,
|
|
298
320
|
},
|
|
321
|
+
haloShape: {
|
|
322
|
+
opacity: 0.25,
|
|
323
|
+
lineWidth: 20,
|
|
324
|
+
pointerEvents: 'none',
|
|
325
|
+
zIndex: -1,
|
|
326
|
+
visible: true,
|
|
327
|
+
stroke: 'rgba(153,173,209,1)',
|
|
328
|
+
},
|
|
299
329
|
},
|
|
300
330
|
active: {
|
|
301
331
|
keyShape: {
|
|
302
|
-
stroke:
|
|
332
|
+
stroke: comboStroke,
|
|
303
333
|
lineWidth: 1,
|
|
304
334
|
},
|
|
335
|
+
haloShape: {
|
|
336
|
+
opacity: 0.25,
|
|
337
|
+
lineWidth: 20,
|
|
338
|
+
pointerEvents: 'none',
|
|
339
|
+
zIndex: -1,
|
|
340
|
+
visible: true,
|
|
341
|
+
stroke: 'rgba(153,173,209,1)',
|
|
342
|
+
},
|
|
305
343
|
},
|
|
306
344
|
highlight: {
|
|
307
345
|
keyShape: {
|
|
308
|
-
stroke:
|
|
309
|
-
|
|
310
|
-
lineWidth: 2,
|
|
346
|
+
stroke: comboStroke,
|
|
347
|
+
lineWidth: 4,
|
|
311
348
|
},
|
|
312
349
|
labelShape: {
|
|
313
350
|
fontWeight: 700,
|
|
@@ -315,16 +352,47 @@ export default {
|
|
|
315
352
|
},
|
|
316
353
|
inactive: {
|
|
317
354
|
keyShape: {
|
|
318
|
-
stroke:
|
|
355
|
+
stroke: comboStroke,
|
|
319
356
|
fill: comboFill,
|
|
320
357
|
lineWidth: 1,
|
|
358
|
+
opacity: 0.65,
|
|
359
|
+
},
|
|
360
|
+
labelShape: {
|
|
361
|
+
opacity: 0.65,
|
|
321
362
|
},
|
|
322
363
|
},
|
|
323
364
|
disable: {
|
|
324
365
|
keyShape: {
|
|
325
366
|
fill: disabledFill,
|
|
367
|
+
stroke: disabledStroke,
|
|
368
|
+
opacity: 0.25,
|
|
326
369
|
lineWidth: 1,
|
|
327
370
|
},
|
|
371
|
+
labelShape: {
|
|
372
|
+
opacity: 0.25,
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
collapsed: {
|
|
376
|
+
keyShape: {
|
|
377
|
+
...DEFAULT_SHAPE_STYLE,
|
|
378
|
+
fill: comboFill,
|
|
379
|
+
lineWidth: 1,
|
|
380
|
+
stroke: comboStroke,
|
|
381
|
+
// the collapsed size
|
|
382
|
+
r: 16,
|
|
383
|
+
width: 20,
|
|
384
|
+
height: 10,
|
|
385
|
+
padding: [25, 20, 15, 20],
|
|
386
|
+
},
|
|
387
|
+
iconShape: {
|
|
388
|
+
...DEFAULT_TEXT_STYLE,
|
|
389
|
+
fill: comboStroke,
|
|
390
|
+
fontSize: 12,
|
|
391
|
+
zIndex: 1,
|
|
392
|
+
lod: -1,
|
|
393
|
+
contentType: 'childCount',
|
|
394
|
+
visible: true,
|
|
395
|
+
},
|
|
328
396
|
},
|
|
329
397
|
},
|
|
330
398
|
],
|
package/src/types/combo.ts
CHANGED
|
@@ -12,9 +12,13 @@ import {
|
|
|
12
12
|
ShapeStyle,
|
|
13
13
|
LodStrategy,
|
|
14
14
|
} from './item';
|
|
15
|
+
import { NodeShapeMap, NodeUserModelData } from './node';
|
|
16
|
+
import { DisplayObject } from '@antv/g';
|
|
17
|
+
import { ImageStyleProps, TextStyleProps } from '@antv/gui/lib/shapes';
|
|
15
18
|
|
|
16
19
|
export type ComboLabelPosition =
|
|
17
20
|
| 'bottom'
|
|
21
|
+
| 'center'
|
|
18
22
|
| 'top'
|
|
19
23
|
| 'left'
|
|
20
24
|
| 'left-top'
|
|
@@ -24,10 +28,44 @@ export type ComboLabelPosition =
|
|
|
24
28
|
| 'outside-right'
|
|
25
29
|
| 'outside-bottom';
|
|
26
30
|
|
|
27
|
-
/** User input data. */
|
|
31
|
+
/** User input data. Combo data has no position info, which is always depends on children's combined bounds. */
|
|
28
32
|
export interface ComboUserModelData extends PlainObject {
|
|
29
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Combo type, e.g. 'circle-combo'.
|
|
35
|
+
*/
|
|
36
|
+
type?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Subject color for the keyShape and anchor points.
|
|
39
|
+
* More styles should be configured in node mapper.
|
|
40
|
+
*/
|
|
41
|
+
color?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The text to show on the combo.
|
|
44
|
+
* More styles should be configured in combo mapper.
|
|
45
|
+
*/
|
|
46
|
+
label?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Whether show the combo by default.
|
|
49
|
+
*/
|
|
50
|
+
visible?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Reserved for combo.
|
|
53
|
+
*/
|
|
30
54
|
parentId?: string;
|
|
55
|
+
/**
|
|
56
|
+
* The icon to show on the combo.
|
|
57
|
+
* More styles should be configured in combo mapper.
|
|
58
|
+
*/
|
|
59
|
+
icon?: {
|
|
60
|
+
type: 'icon' | 'text';
|
|
61
|
+
text?: string;
|
|
62
|
+
img?: string;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* The ratio position of the keyShape for related edges linking into.
|
|
66
|
+
* More styles should be configured in combo mapper.
|
|
67
|
+
*/
|
|
68
|
+
anchorPoints?: number[][];
|
|
31
69
|
}
|
|
32
70
|
|
|
33
71
|
/** Inner combo data, clone and transform from user data. */
|
|
@@ -48,6 +86,8 @@ export interface ComboShapeStyles extends ItemShapeStyles {
|
|
|
48
86
|
offsetX?: number;
|
|
49
87
|
offsetY?: number;
|
|
50
88
|
offsetZ?: number;
|
|
89
|
+
// string means the percentage of the keyShape, number means pixel
|
|
90
|
+
maxWidth?: string | number;
|
|
51
91
|
};
|
|
52
92
|
labelBackgroundShape?: ShapeStyle & {
|
|
53
93
|
padding?: number | number[];
|
|
@@ -56,6 +96,7 @@ export interface ComboShapeStyles extends ItemShapeStyles {
|
|
|
56
96
|
badgeShapes?: ShapeStyle & {
|
|
57
97
|
color?: string;
|
|
58
98
|
textColor?: string;
|
|
99
|
+
palette?: string[];
|
|
59
100
|
// individual styles and their position
|
|
60
101
|
[key: number]: ShapeStyle & {
|
|
61
102
|
position?: BadgePosition;
|
|
@@ -82,11 +123,26 @@ export interface ComboShapeStyles extends ItemShapeStyles {
|
|
|
82
123
|
offsetZ?: number;
|
|
83
124
|
};
|
|
84
125
|
};
|
|
126
|
+
iconShape?: Partial<
|
|
127
|
+
TextStyleProps &
|
|
128
|
+
ImageStyleProps &
|
|
129
|
+
ShapeStyle & {
|
|
130
|
+
offsetX?: number;
|
|
131
|
+
offsetY?: number;
|
|
132
|
+
lod?: number;
|
|
133
|
+
contentType?: 'auto' | 'childCount';
|
|
134
|
+
}
|
|
135
|
+
>;
|
|
85
136
|
}
|
|
86
137
|
|
|
87
138
|
/** Displayed data, only for drawing and not received by users. */
|
|
88
139
|
export type ComboDisplayModelData = ComboModelData &
|
|
89
|
-
ComboShapeStyles & {
|
|
140
|
+
ComboShapeStyles & {
|
|
141
|
+
lodStrategy?: LodStrategy;
|
|
142
|
+
x?: number;
|
|
143
|
+
y?: number;
|
|
144
|
+
z?: number;
|
|
145
|
+
};
|
|
90
146
|
|
|
91
147
|
/** User input model. */
|
|
92
148
|
export type ComboUserModel = GNode<ComboUserModelData>;
|
|
@@ -116,5 +172,7 @@ export interface ComboEncode extends ComboShapesEncode {
|
|
|
116
172
|
animates?: IAnimates;
|
|
117
173
|
}
|
|
118
174
|
|
|
175
|
+
export interface ComboShapeMap extends NodeShapeMap {}
|
|
176
|
+
|
|
119
177
|
// TODO
|
|
120
178
|
export type ICombo = IItem;
|
package/src/types/data.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Graph as
|
|
1
|
+
import { Graph as GraphLib } from '@antv/graphlib';
|
|
2
2
|
import { ComboUserModel } from './combo';
|
|
3
3
|
import { NodeDisplayModelData, NodeModelData, NodeUserModel } from './node';
|
|
4
4
|
import { EdgeDisplayModelData, EdgeModelData, EdgeUserModel } from './edge';
|
|
@@ -19,8 +19,8 @@ export interface FetchDataConfig {
|
|
|
19
19
|
value: string;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export type GraphCore =
|
|
23
|
-
export type DisplayGraphCore =
|
|
22
|
+
export type GraphCore = GraphLib<NodeModelData, EdgeModelData>;
|
|
23
|
+
export type DisplayGraphCore = GraphLib<
|
|
24
24
|
NodeDisplayModelData,
|
|
25
25
|
EdgeDisplayModelData
|
|
26
26
|
>;
|
|
@@ -32,4 +32,6 @@ export type DataChangeType =
|
|
|
32
32
|
| 'mergeReplace'
|
|
33
33
|
| 'union'
|
|
34
34
|
| 'remove'
|
|
35
|
-
| 'update'
|
|
35
|
+
| 'update'
|
|
36
|
+
| 'moveCombo'
|
|
37
|
+
| 'addCombo';
|
package/src/types/edge.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface EdgeUserModelData extends PlainObject {
|
|
|
20
20
|
sourceAnchor?: number;
|
|
21
21
|
targetAnchor?: number;
|
|
22
22
|
/**
|
|
23
|
-
* Edge type, e.g. 'line'.
|
|
23
|
+
* Edge type, e.g. 'line-edge'.
|
|
24
24
|
*/
|
|
25
25
|
type?: string;
|
|
26
26
|
/**
|
|
@@ -55,7 +55,7 @@ export interface EdgeUserModelData extends PlainObject {
|
|
|
55
55
|
text: string;
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
export
|
|
58
|
+
export type EdgeModelData = EdgeUserModelData;
|
|
59
59
|
|
|
60
60
|
export interface EdgeShapeStyles extends ItemShapeStyles {
|
|
61
61
|
labelShape?: ShapeStyle & {
|
package/src/types/event.ts
CHANGED
|
@@ -16,14 +16,14 @@ export enum CANVAS_EVENT_TYPE {
|
|
|
16
16
|
'click' = 'click',
|
|
17
17
|
'wheel' = 'wheel',
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
'dragstart' = 'dragstart',
|
|
20
|
+
'drag' = 'drag',
|
|
21
|
+
'dragend' = 'dragend',
|
|
22
|
+
'dragenter' = 'dragenter',
|
|
23
|
+
'dragleave' = 'dragleave',
|
|
24
|
+
'dragover' = 'dragover',
|
|
25
|
+
'dragout' = 'dragout',
|
|
26
|
+
'drop' = 'drop',
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export enum DOM_EVENT_TYPE {
|
package/src/types/graph.ts
CHANGED
|
@@ -20,6 +20,7 @@ export interface IGraph<
|
|
|
20
20
|
B extends BehaviorRegistry = BehaviorRegistry,
|
|
21
21
|
T extends ThemeRegistry = ThemeRegistry,
|
|
22
22
|
> extends EventEmitter {
|
|
23
|
+
[x: string]: any;
|
|
23
24
|
hooks: Hooks;
|
|
24
25
|
canvas: Canvas;
|
|
25
26
|
transientCanvas: Canvas;
|
|
@@ -114,7 +115,13 @@ export interface IGraph<
|
|
|
114
115
|
nodeId: ID,
|
|
115
116
|
direction?: 'in' | 'out' | 'both',
|
|
116
117
|
) => NodeModel[];
|
|
117
|
-
|
|
118
|
+
/**
|
|
119
|
+
* Get the children's data of a combo.
|
|
120
|
+
* @param comboId combo id
|
|
121
|
+
* @returns children's data array
|
|
122
|
+
* @group Data
|
|
123
|
+
*/
|
|
124
|
+
getComboChildrenData: (comboId: ID) => (ComboModel | NodeModel)[];
|
|
118
125
|
/**
|
|
119
126
|
* Input data and render the graph.
|
|
120
127
|
* If there is old data, diffs and changes it.
|
|
@@ -224,9 +231,43 @@ export interface IGraph<
|
|
|
224
231
|
| Partial<
|
|
225
232
|
ComboUserModel | Partial<NodeUserModel>[] | Partial<ComboUserModel>[]
|
|
226
233
|
>,
|
|
234
|
+
upsertAncestors?: boolean,
|
|
235
|
+
stack?: boolean,
|
|
236
|
+
) => NodeModel | ComboModel | NodeModel[] | ComboModel[];
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Update one or more combos' positions, it is achieved by move the succeed nodes.
|
|
240
|
+
* Do not update other styles which leads to better performance than updating positions by updateData.
|
|
241
|
+
* @param models new configurations with x and y for every combo, which has id field to indicate the specific item
|
|
242
|
+
* @param {boolean} stack whether push this operation into graph's stack, true by default
|
|
243
|
+
* @group Data
|
|
244
|
+
*/
|
|
245
|
+
updateComboPosition: (
|
|
246
|
+
models:
|
|
247
|
+
| Partial<ComboUserModel>
|
|
248
|
+
| Partial<
|
|
249
|
+
ComboUserModel | Partial<NodeUserModel>[] | Partial<ComboUserModel>[]
|
|
250
|
+
>,
|
|
251
|
+
upsertAncestors?: boolean,
|
|
227
252
|
stack?: boolean,
|
|
228
253
|
) => NodeModel | ComboModel | NodeModel[] | ComboModel[];
|
|
229
254
|
|
|
255
|
+
/**
|
|
256
|
+
* Move one or more combos a distance (dx, dy) relatively,
|
|
257
|
+
* do not update other styles which leads to better performance than updating positions by updateData.
|
|
258
|
+
* In fact, it changes the succeed nodes positions to affect the combo's position, but not modify the combo's position directly.
|
|
259
|
+
* @param models new configurations with x and y for every combo, which has id field to indicate the specific item
|
|
260
|
+
* @param {boolean} stack whether push this operation into graph's stack, true by default
|
|
261
|
+
* @group Data
|
|
262
|
+
*/
|
|
263
|
+
moveCombo: (
|
|
264
|
+
ids: ID[],
|
|
265
|
+
dx: number,
|
|
266
|
+
dy: number,
|
|
267
|
+
upsertAncestors?: boolean,
|
|
268
|
+
stack?: boolean,
|
|
269
|
+
) => ComboModel[];
|
|
270
|
+
|
|
230
271
|
// ===== view operations =====
|
|
231
272
|
|
|
232
273
|
/**
|
|
@@ -411,6 +452,20 @@ export interface IGraph<
|
|
|
411
452
|
* @group Item
|
|
412
453
|
*/
|
|
413
454
|
hideItem: (ids: ID | ID[], disableAniamte?: boolean) => void;
|
|
455
|
+
/**
|
|
456
|
+
* Make the item(s) to the front.
|
|
457
|
+
* @param ids the item id(s) to front
|
|
458
|
+
* @returns
|
|
459
|
+
* @group Item
|
|
460
|
+
*/
|
|
461
|
+
frontItem: (ids: ID | ID[]) => void;
|
|
462
|
+
/**
|
|
463
|
+
* Make the item(s) to the back.
|
|
464
|
+
* @param ids the item id(s) to back
|
|
465
|
+
* @returns
|
|
466
|
+
* @group Item
|
|
467
|
+
*/
|
|
468
|
+
backItem: (ids: ID | ID[]) => void;
|
|
414
469
|
/**
|
|
415
470
|
* Set state for the item(s).
|
|
416
471
|
* @param ids the id(s) for the item(s) to be set
|
|
@@ -442,7 +497,11 @@ export interface IGraph<
|
|
|
442
497
|
* @param id the id for the node / edge / combo, undefined for the whole graph
|
|
443
498
|
* @returns rendering bounding box. returns false if the item is not exist
|
|
444
499
|
*/
|
|
445
|
-
getRenderBBox: (
|
|
500
|
+
getRenderBBox: (
|
|
501
|
+
id: ID | undefined,
|
|
502
|
+
onlyKeyShape?: boolean,
|
|
503
|
+
isTransient?: boolean,
|
|
504
|
+
) => AABB | false;
|
|
446
505
|
|
|
447
506
|
/**
|
|
448
507
|
* Get the visibility for a node / edge / combo.
|
|
@@ -452,35 +511,33 @@ export interface IGraph<
|
|
|
452
511
|
getItemVisible: (id: ID) => boolean;
|
|
453
512
|
|
|
454
513
|
// ===== combo operations =====
|
|
514
|
+
|
|
455
515
|
/**
|
|
456
|
-
*
|
|
457
|
-
*
|
|
458
|
-
* @param
|
|
516
|
+
* Add a new combo to the graph, and update the structure of the existed child in childrenIds to be the children of the new combo.
|
|
517
|
+
* Different from addData with combo type, this API update the succeeds' combo tree strucutres in the same time.
|
|
518
|
+
* @param model combo user data
|
|
519
|
+
* @param stack whether push this operation to stack
|
|
520
|
+
* @returns whether success
|
|
459
521
|
* @group Combo
|
|
460
522
|
*/
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
childrenIds:
|
|
523
|
+
addCombo: (
|
|
524
|
+
model: ComboUserModel,
|
|
525
|
+
childrenIds: ID[],
|
|
464
526
|
stack?: boolean,
|
|
465
|
-
) =>
|
|
466
|
-
/**
|
|
467
|
-
* dissolve combo
|
|
468
|
-
* @param {String | ICombo} item combo item or id to be dissolve
|
|
469
|
-
*/
|
|
470
|
-
uncombo: (comboId: ID, stack?: boolean) => void;
|
|
527
|
+
) => ComboModel;
|
|
471
528
|
/**
|
|
472
529
|
* Collapse a combo.
|
|
473
530
|
* @param comboId combo id or item
|
|
474
531
|
* @group Combo
|
|
475
532
|
*/
|
|
476
|
-
collapseCombo: (
|
|
533
|
+
collapseCombo: (comboIds: ID | ID[], stack?: boolean) => void;
|
|
477
534
|
/**
|
|
478
535
|
* Expand a combo.
|
|
479
536
|
* @group Combo
|
|
480
537
|
* @param combo combo ID 或 combo 实例
|
|
481
538
|
* @group Combo
|
|
482
539
|
*/
|
|
483
|
-
expandCombo: (
|
|
540
|
+
expandCombo: (comboIds: ID | ID[], stack?: boolean) => void;
|
|
484
541
|
|
|
485
542
|
// ===== layout =====
|
|
486
543
|
/**
|
package/src/types/hook.ts
CHANGED
|
@@ -42,7 +42,8 @@ export interface Hooks {
|
|
|
42
42
|
changes: GraphChange<NodeModelData, EdgeModelData>[];
|
|
43
43
|
graphCore: GraphCore;
|
|
44
44
|
theme: ThemeSpecification;
|
|
45
|
-
|
|
45
|
+
upsertAncestors?: boolean;
|
|
46
|
+
action?: 'updatePosition';
|
|
46
47
|
}>;
|
|
47
48
|
render: IHook<{
|
|
48
49
|
graphCore: GraphCore;
|
|
@@ -64,9 +65,14 @@ export interface Hooks {
|
|
|
64
65
|
}>;
|
|
65
66
|
itemvisibilitychange: IHook<{
|
|
66
67
|
ids: ID[];
|
|
68
|
+
graphCore?: GraphCore;
|
|
67
69
|
value?: boolean;
|
|
68
70
|
animate?: boolean;
|
|
69
71
|
}>;
|
|
72
|
+
itemzindexchange: IHook<{
|
|
73
|
+
ids: ID[];
|
|
74
|
+
action: 'front' | 'back';
|
|
75
|
+
}>;
|
|
70
76
|
transientupdate: IHook<{
|
|
71
77
|
type: ITEM_TYPE | SHAPE_TYPE;
|
|
72
78
|
id: ID;
|
|
@@ -75,6 +81,7 @@ export interface Hooks {
|
|
|
75
81
|
style: ShapeStyle;
|
|
76
82
|
action: 'remove' | 'add' | 'update' | undefined;
|
|
77
83
|
};
|
|
84
|
+
graphCore: GraphCore;
|
|
78
85
|
}>;
|
|
79
86
|
// TODO: define param template
|
|
80
87
|
viewportchange: IHook<ViewportChangeHookParams>;
|
package/src/types/item.ts
CHANGED
|
@@ -14,6 +14,12 @@ import {
|
|
|
14
14
|
DisplayObject,
|
|
15
15
|
IAnimation,
|
|
16
16
|
} from '@antv/g';
|
|
17
|
+
import {
|
|
18
|
+
CubeGeometryProps,
|
|
19
|
+
PlaneGeometryProps,
|
|
20
|
+
SphereGeometryProps,
|
|
21
|
+
TorusGeometryProps,
|
|
22
|
+
} from '@antv/g-plugin-3d';
|
|
17
23
|
import { AnimateCfg, IAnimates } from './animate';
|
|
18
24
|
import {
|
|
19
25
|
ComboDisplayModel,
|
|
@@ -38,12 +44,6 @@ import {
|
|
|
38
44
|
NodeShapeMap,
|
|
39
45
|
NodeUserModel,
|
|
40
46
|
} from './node';
|
|
41
|
-
import {
|
|
42
|
-
CubeGeometryProps,
|
|
43
|
-
PlaneGeometryProps,
|
|
44
|
-
SphereGeometryProps,
|
|
45
|
-
TorusGeometryProps,
|
|
46
|
-
} from '@antv/g-plugin-3d';
|
|
47
47
|
|
|
48
48
|
export type GShapeStyle = CircleStyleProps &
|
|
49
49
|
RectStyleProps &
|
|
@@ -151,7 +151,8 @@ export type ItemShapeStyles = {
|
|
|
151
151
|
keyShape?: ShapeStyle;
|
|
152
152
|
iconShape?: Partial<
|
|
153
153
|
TextStyleProps &
|
|
154
|
-
ImageStyleProps &
|
|
154
|
+
ImageStyleProps &
|
|
155
|
+
ShapeStyle & {
|
|
155
156
|
offsetX?: number;
|
|
156
157
|
offsetY?: number;
|
|
157
158
|
lod?: number;
|
|
@@ -173,7 +174,7 @@ export interface LodStrategy {
|
|
|
173
174
|
animateCfg: AnimateCfg;
|
|
174
175
|
}
|
|
175
176
|
|
|
176
|
-
export interface
|
|
177
|
+
export interface LodStrategyObj {
|
|
177
178
|
levels: {
|
|
178
179
|
[levelIdx: number]: [number, number];
|
|
179
180
|
};
|
|
@@ -223,7 +224,7 @@ export interface IItem {
|
|
|
223
224
|
[stateName: string]: ItemShapeStyles;
|
|
224
225
|
};
|
|
225
226
|
/** The zoom strategy to show and hide shapes according to their lod. */
|
|
226
|
-
lodStrategy:
|
|
227
|
+
lodStrategy: LodStrategyObj;
|
|
227
228
|
/** Last zoom ratio. */
|
|
228
229
|
zoom: number;
|
|
229
230
|
/** Cache the chaging states which are not consomed by draw */
|
package/src/types/node.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DisplayObject, Point } from '@antv/g';
|
|
2
|
-
import { Node as GNode, PlainObject } from '@antv/graphlib';
|
|
2
|
+
import { Node as GNode, ID, PlainObject } from '@antv/graphlib';
|
|
3
3
|
import { IAnimates } from './animate';
|
|
4
4
|
import {
|
|
5
5
|
BadgePosition,
|
|
@@ -24,7 +24,7 @@ export interface NodeUserModelData extends PlainObject {
|
|
|
24
24
|
y?: number;
|
|
25
25
|
z?: number;
|
|
26
26
|
/**
|
|
27
|
-
* Node type, e.g. 'circle'.
|
|
27
|
+
* Node type, e.g. 'circle-node'.
|
|
28
28
|
*/
|
|
29
29
|
type?: string;
|
|
30
30
|
/**
|
|
@@ -44,7 +44,7 @@ export interface NodeUserModelData extends PlainObject {
|
|
|
44
44
|
/**
|
|
45
45
|
* Reserved for combo.
|
|
46
46
|
*/
|
|
47
|
-
parentId?:
|
|
47
|
+
parentId?: ID;
|
|
48
48
|
/**
|
|
49
49
|
* The icon to show on the node.
|
|
50
50
|
* More styles should be configured in node mapper.
|
|
@@ -71,7 +71,7 @@ export interface NodeUserModelData extends PlainObject {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
/** Data in inner model. Same format to the user data. */
|
|
74
|
-
export
|
|
74
|
+
export type NodeModelData = NodeUserModelData;
|
|
75
75
|
|
|
76
76
|
export interface NodeShapeStyles extends ItemShapeStyles {
|
|
77
77
|
// keyShape, iconShape, haloShape are defined in ItemShapeStyles
|
package/src/types/theme.ts
CHANGED
package/src/util/animate.ts
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
IAnimates,
|
|
13
13
|
IStateAnimate,
|
|
14
14
|
} from '../types/animate';
|
|
15
|
-
import { ItemShapeStyles, ShapeStyle } from '../types/item';
|
|
15
|
+
import { ItemDisplayModel, ItemShapeStyles, ShapeStyle } from '../types/item';
|
|
16
16
|
import { isArrayOverlap, replaceElements } from './array';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -164,7 +164,7 @@ const runAnimateGroupOnShapes = (
|
|
|
164
164
|
timing: AnimateTiming,
|
|
165
165
|
onfinish: Function,
|
|
166
166
|
cancelAnimations: Function,
|
|
167
|
-
canceled:
|
|
167
|
+
canceled: boolean,
|
|
168
168
|
) => {
|
|
169
169
|
let maxDuration = -Infinity;
|
|
170
170
|
let maxDurationIdx = -1;
|
|
@@ -397,7 +397,6 @@ export const getAnimatesExcludePosition = (animates) => {
|
|
|
397
397
|
excludedAnimates.push(animate);
|
|
398
398
|
}
|
|
399
399
|
});
|
|
400
|
-
|
|
401
400
|
return {
|
|
402
401
|
...animates,
|
|
403
402
|
update: excludedAnimates,
|
package/src/util/canvas.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Renderer as CanvasRenderer } from '@antv/g-canvas';
|
|
|
3
3
|
import { Renderer as SVGRenderer } from '@antv/g-svg';
|
|
4
4
|
import { Renderer as WebGLRenderer } from '@antv/g-webgl';
|
|
5
5
|
import { Plugin as Plugin3D } from '@antv/g-plugin-3d';
|
|
6
|
+
import { Plugin as DragNDropPlugin } from '@antv/g-plugin-dragndrop';
|
|
6
7
|
import { RendererName } from '../types/render';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -38,6 +39,14 @@ export const createCanvas = (
|
|
|
38
39
|
renderer = new CanvasRenderer();
|
|
39
40
|
break;
|
|
40
41
|
}
|
|
42
|
+
renderer.registerPlugin(
|
|
43
|
+
new DragNDropPlugin({
|
|
44
|
+
isDocumentDraggable: true,
|
|
45
|
+
isDocumentDroppable: true,
|
|
46
|
+
dragstartDistanceThreshold: 10,
|
|
47
|
+
dragstartTimeThreshold: 100,
|
|
48
|
+
}),
|
|
49
|
+
);
|
|
41
50
|
|
|
42
51
|
if (typeof document !== 'undefined' && customCanvasTag) {
|
|
43
52
|
const canvasTag = document.createElement('canvas');
|
|
@@ -90,6 +99,7 @@ export const changeRenderer = (
|
|
|
90
99
|
renderer = new CanvasRenderer();
|
|
91
100
|
break;
|
|
92
101
|
}
|
|
102
|
+
renderer.registerPlugin(new DragNDropPlugin());
|
|
93
103
|
canvas.setRenderer(renderer);
|
|
94
104
|
return canvas;
|
|
95
105
|
};
|