@visactor/vgrammar-core 0.14.0-alpha.1 → 0.14.0-alpha.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.
- package/cjs/component/axis.d.ts +0 -2
- package/cjs/component/axis.js +1 -15
- package/cjs/component/axis.js.map +1 -1
- package/cjs/component/grid.d.ts +0 -2
- package/cjs/component/grid.js +1 -15
- package/cjs/component/grid.js.map +1 -1
- package/cjs/component/index.d.ts +2 -2
- package/cjs/component/index.js +1 -21
- package/cjs/component/index.js.map +1 -1
- package/cjs/core/factory.d.ts +1 -8
- package/cjs/core/factory.js +1 -8
- package/cjs/core/factory.js.map +1 -1
- package/cjs/glyph/boxplot.js +5 -5
- package/cjs/glyph/boxplot.js.map +1 -1
- package/cjs/glyph/link-path.js +2 -2
- package/cjs/glyph/link-path.js.map +1 -1
- package/cjs/glyph/ripple.js +2 -3
- package/cjs/glyph/ripple.js.map +1 -1
- package/cjs/glyph/tree-path.js +2 -2
- package/cjs/glyph/tree-path.js.map +1 -1
- package/cjs/glyph/violin.js +4 -4
- package/cjs/glyph/violin.js.map +1 -1
- package/cjs/glyph/wave.js +2 -3
- package/cjs/glyph/wave.js.map +1 -1
- package/cjs/graph/animation/animation/fade.js +4 -4
- package/cjs/graph/animation/animation/fade.js.map +1 -1
- package/cjs/graph/animation/animation/grow-cartesian.js +14 -14
- package/cjs/graph/animation/animation/grow-cartesian.js.map +1 -1
- package/cjs/graph/animation/animation/grow-interval.js +9 -9
- package/cjs/graph/animation/animation/grow-interval.js.map +1 -1
- package/cjs/graph/animation/animation/grow-points.js +9 -9
- package/cjs/graph/animation/animation/grow-points.js.map +1 -1
- package/cjs/graph/animation/animation/grow-polar.js +24 -24
- package/cjs/graph/animation/animation/grow-polar.js.map +1 -1
- package/cjs/graph/animation/animation/move.js +6 -6
- package/cjs/graph/animation/animation/move.js.map +1 -1
- package/cjs/graph/animation/animation/rotate.js +5 -5
- package/cjs/graph/animation/animation/rotate.js.map +1 -1
- package/cjs/graph/animation/animation/scale.js +5 -5
- package/cjs/graph/animation/animation/scale.js.map +1 -1
- package/cjs/graph/animation/animation/update.js +2 -2
- package/cjs/graph/animation/animation/update.js.map +1 -1
- package/cjs/graph/animation/animator.js +6 -1
- package/cjs/graph/animation/animator.js.map +1 -1
- package/cjs/graph/animation/morph.d.ts +12 -2
- package/cjs/graph/animation/morph.js +163 -76
- package/cjs/graph/animation/morph.js.map +1 -1
- package/cjs/graph/attributes/line.js.map +1 -1
- package/cjs/graph/canvas-renderer.d.ts +1 -1
- package/cjs/graph/canvas-renderer.js +4 -4
- package/cjs/graph/canvas-renderer.js.map +1 -1
- package/cjs/graph/element.d.ts +2 -1
- package/cjs/graph/element.js +20 -19
- package/cjs/graph/element.js.map +1 -1
- package/cjs/graph/glyph-element.js +3 -4
- package/cjs/graph/glyph-element.js.map +1 -1
- package/cjs/graph/layout/layout.d.ts +0 -1
- package/cjs/graph/layout/layout.js +2 -8
- package/cjs/graph/layout/layout.js.map +1 -1
- package/cjs/graph/mark/graphic.js +8 -14
- package/cjs/graph/mark/graphic.js.map +1 -1
- package/cjs/graph/util/element.d.ts +2 -0
- package/cjs/graph/util/element.js +10 -0
- package/cjs/graph/util/element.js.map +1 -0
- package/cjs/graph/util/point.js +26 -10
- package/cjs/graph/util/point.js.map +1 -1
- package/cjs/index.d.ts +1 -8
- package/cjs/index.js +2 -66
- package/cjs/index.js.map +1 -1
- package/cjs/interactions/brush-base.js +2 -1
- package/cjs/interactions/brush-filter.js +1 -2
- package/cjs/interactions/fish-eye.js +2 -1
- package/cjs/interactions/index.js +1 -2
- package/cjs/interactions/tooltip.js +1 -1
- package/cjs/parse/event.d.ts +2 -0
- package/cjs/parse/event.js +10 -4
- package/cjs/parse/event.js.map +1 -1
- package/cjs/parse/util.js.map +1 -1
- package/cjs/types/animate.d.ts +1 -0
- package/cjs/types/animate.js.map +1 -1
- package/cjs/types/element.d.ts +5 -1
- package/cjs/types/element.js.map +1 -1
- package/cjs/types/morph.d.ts +2 -1
- package/cjs/types/morph.js.map +1 -1
- package/cjs/types/renderer.d.ts +1 -6
- package/cjs/types/renderer.js.map +1 -1
- package/cjs/view/View.d.ts +6 -3
- package/cjs/view/View.js +105 -52
- package/cjs/view/View.js.map +1 -1
- package/cjs/view/animate.js +1 -2
- package/cjs/view/animate.js.map +1 -1
- package/cjs/view/constants.d.ts +0 -2
- package/cjs/view/constants.js +2 -3
- package/cjs/view/constants.js.map +1 -1
- package/cjs/view/events.d.ts +1 -0
- package/cjs/view/events.js +17 -3
- package/cjs/view/events.js.map +1 -1
- package/cjs/view/glyph.d.ts +0 -4
- package/cjs/view/glyph.js +3 -12
- package/cjs/view/glyph.js.map +1 -1
- package/cjs/view/grammar-record.js +2 -3
- package/cjs/view/grammar-record.js.map +1 -1
- package/cjs/view/group.js +3 -3
- package/cjs/view/group.js.map +1 -1
- package/cjs/view/mark.d.ts +0 -2
- package/cjs/view/mark.js +28 -31
- package/cjs/view/mark.js.map +1 -1
- package/es/component/axis.d.ts +0 -2
- package/es/component/axis.js +0 -10
- package/es/component/axis.js.map +1 -1
- package/es/component/grid.d.ts +0 -2
- package/es/component/grid.js +0 -10
- package/es/component/grid.js.map +1 -1
- package/es/component/index.d.ts +2 -2
- package/es/component/index.js +2 -2
- package/es/component/index.js.map +1 -1
- package/es/core/factory.d.ts +1 -8
- package/es/core/factory.js +1 -8
- package/es/core/factory.js.map +1 -1
- package/es/glyph/boxplot.js +2 -4
- package/es/glyph/boxplot.js.map +1 -1
- package/es/glyph/link-path.js +2 -4
- package/es/glyph/link-path.js.map +1 -1
- package/es/glyph/ripple.js +1 -3
- package/es/glyph/ripple.js.map +1 -1
- package/es/glyph/tree-path.js +2 -4
- package/es/glyph/tree-path.js.map +1 -1
- package/es/glyph/violin.js +2 -4
- package/es/glyph/violin.js.map +1 -1
- package/es/glyph/wave.js +1 -3
- package/es/glyph/wave.js.map +1 -1
- package/es/graph/animation/animation/fade.js +4 -4
- package/es/graph/animation/animation/fade.js.map +1 -1
- package/es/graph/animation/animation/grow-cartesian.js +14 -14
- package/es/graph/animation/animation/grow-cartesian.js.map +1 -1
- package/es/graph/animation/animation/grow-interval.js +9 -9
- package/es/graph/animation/animation/grow-interval.js.map +1 -1
- package/es/graph/animation/animation/grow-points.js +9 -9
- package/es/graph/animation/animation/grow-points.js.map +1 -1
- package/es/graph/animation/animation/grow-polar.js +24 -24
- package/es/graph/animation/animation/grow-polar.js.map +1 -1
- package/es/graph/animation/animation/move.js +6 -6
- package/es/graph/animation/animation/move.js.map +1 -1
- package/es/graph/animation/animation/rotate.js +4 -4
- package/es/graph/animation/animation/rotate.js.map +1 -1
- package/es/graph/animation/animation/scale.js +5 -5
- package/es/graph/animation/animation/scale.js.map +1 -1
- package/es/graph/animation/animation/update.js +3 -1
- package/es/graph/animation/animation/update.js.map +1 -1
- package/es/graph/animation/animator.js +6 -1
- package/es/graph/animation/animator.js.map +1 -1
- package/es/graph/animation/morph.d.ts +12 -2
- package/es/graph/animation/morph.js +159 -72
- package/es/graph/animation/morph.js.map +1 -1
- package/es/graph/attributes/line.js.map +1 -1
- package/es/graph/canvas-renderer.d.ts +1 -1
- package/es/graph/canvas-renderer.js +5 -5
- package/es/graph/canvas-renderer.js.map +1 -1
- package/es/graph/element.d.ts +2 -1
- package/es/graph/element.js +20 -17
- package/es/graph/element.js.map +1 -1
- package/es/graph/glyph-element.js +5 -3
- package/es/graph/glyph-element.js.map +1 -1
- package/es/graph/layout/layout.d.ts +0 -1
- package/es/graph/layout/layout.js +0 -6
- package/es/graph/layout/layout.js.map +1 -1
- package/es/graph/mark/graphic.js +7 -13
- package/es/graph/mark/graphic.js.map +1 -1
- package/es/graph/util/element.d.ts +2 -0
- package/es/graph/util/element.js +8 -0
- package/es/graph/util/element.js.map +1 -0
- package/es/graph/util/point.js +26 -10
- package/es/graph/util/point.js.map +1 -1
- package/es/index.d.ts +1 -8
- package/es/index.js +1 -29
- package/es/index.js.map +1 -1
- package/es/interactions/element-active.js +2 -1
- package/es/interactions/element-highlight-by-group.js +1 -2
- package/es/interactions/fish-eye.js +1 -1
- package/es/parse/event.d.ts +2 -0
- package/es/parse/event.js +7 -3
- package/es/parse/event.js.map +1 -1
- package/es/parse/option.js +2 -1
- package/es/parse/scale.js +1 -2
- package/es/parse/util.js.map +1 -1
- package/es/types/animate.d.ts +1 -0
- package/es/types/animate.js.map +1 -1
- package/es/types/element.d.ts +5 -1
- package/es/types/element.js.map +1 -1
- package/es/types/morph.d.ts +2 -1
- package/es/types/morph.js.map +1 -1
- package/es/types/renderer.d.ts +1 -6
- package/es/types/renderer.js.map +1 -1
- package/es/view/View.d.ts +6 -3
- package/es/view/View.js +114 -53
- package/es/view/View.js.map +1 -1
- package/es/view/animate.js +1 -2
- package/es/view/animate.js.map +1 -1
- package/es/view/constants.d.ts +0 -2
- package/es/view/constants.js +0 -4
- package/es/view/constants.js.map +1 -1
- package/es/view/events.d.ts +1 -0
- package/es/view/events.js +15 -1
- package/es/view/events.js.map +1 -1
- package/es/view/glyph.d.ts +0 -4
- package/es/view/glyph.js +0 -11
- package/es/view/glyph.js.map +1 -1
- package/es/view/grammar-record.js +2 -3
- package/es/view/grammar-record.js.map +1 -1
- package/es/view/group.js +4 -2
- package/es/view/group.js.map +1 -1
- package/es/view/mark.d.ts +0 -2
- package/es/view/mark.js +30 -32
- package/es/view/mark.js.map +1 -1
- package/package.json +12 -12
- package/cjs/graph/view-diff.d.ts +0 -8
- package/cjs/graph/view-diff.js +0 -93
- package/cjs/graph/view-diff.js.map +0 -1
- package/cjs/view/mark-animate-mixin.d.ts +0 -1
- package/cjs/view/mark-animate-mixin.js +0 -29
- package/cjs/view/mark-animate-mixin.js.map +0 -1
- package/cjs/view/view-animate-mixin.d.ts +0 -1
- package/cjs/view/view-animate-mixin.js +0 -26
- package/cjs/view/view-animate-mixin.js.map +0 -1
- package/cjs/view/view-event-mixin.d.ts +0 -1
- package/cjs/view/view-event-mixin.js +0 -92
- package/cjs/view/view-event-mixin.js.map +0 -1
- package/cjs/view/view-morph-mixin.d.ts +0 -1
- package/cjs/view/view-morph-mixin.js +0 -32
- package/cjs/view/view-morph-mixin.js.map +0 -1
- package/es/graph/view-diff.d.ts +0 -8
- package/es/graph/view-diff.js +0 -89
- package/es/graph/view-diff.js.map +0 -1
- package/es/view/mark-animate-mixin.d.ts +0 -1
- package/es/view/mark-animate-mixin.js +0 -25
- package/es/view/mark-animate-mixin.js.map +0 -1
- package/es/view/view-animate-mixin.d.ts +0 -1
- package/es/view/view-animate-mixin.js +0 -16
- package/es/view/view-animate-mixin.js.map +0 -1
- package/es/view/view-event-mixin.d.ts +0 -1
- package/es/view/view-event-mixin.js +0 -90
- package/es/view/view-event-mixin.js.map +0 -1
- package/es/view/view-morph-mixin.d.ts +0 -1
- package/es/view/view-morph-mixin.js +0 -22
- package/es/view/view-morph-mixin.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/graph/util/element.ts"],"names":[],"mappings":";;;AACA,oCAA2C;AAC3C,wCAAqC;AACrC,oDAAgD;AAEzC,MAAM,aAAa,GAAG,CAAC,IAAW,EAAY,EAAE;IACrD,IAAI,IAAI,CAAC,QAAQ,KAAK,uBAAe,CAAC,KAAK,EAAE;QAC3C,OAAO,IAAI,4BAAY,CAAC,IAAkB,CAAC,CAAC;KAC7C;IACD,OAAO,IAAI,iBAAO,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC,CAAC;AALW,QAAA,aAAa,iBAKxB","file":"element.js","sourcesContent":["import type { IElement, IGlyphMark, IMark } from '../../types';\nimport { GrammarMarkType } from '../enums';\nimport { Element } from '../element';\nimport { GlyphElement } from '../glyph-element';\n\nexport const createElement = (mark: IMark): IElement => {\n if (mark.markType === GrammarMarkType.glyph) {\n return new GlyphElement(mark as IGlyphMark);\n }\n return new Element(mark);\n};\n"]}
|
package/cjs/graph/util/point.js
CHANGED
|
@@ -30,6 +30,17 @@ function getOffsetPos(e) {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
function getBoundingClientRectPos(e, el) {
|
|
34
|
+
const result = {
|
|
35
|
+
canvasX: 0,
|
|
36
|
+
canvasY: 0
|
|
37
|
+
}, rect = el.getBoundingClientRect(), currentWidth = rect.width, widthRatio = currentWidth / (el.offsetWidth || currentWidth), currentHeight = rect.height, heightRatio = currentHeight / (el.offsetHeight || currentHeight);
|
|
38
|
+
return [ "touchstart", "touchmove", "touchend" ].includes(e.type) && e.changedTouches && e.changedTouches.length ? (result.canvasX = (e.changedTouches[0].clientX - rect.left - (el.clientLeft || 0)) / widthRatio,
|
|
39
|
+
result.canvasY = (e.changedTouches[0].clientY - rect.top - (el.clientTop || 0)) / heightRatio,
|
|
40
|
+
result.clientX = e.changedTouches[0].clientX, result.clientY = e.changedTouches[0].clientY) : (result.canvasX = (e.clientX - rect.left - (el.clientLeft || 0)) / widthRatio,
|
|
41
|
+
result.canvasY = (e.clientY - rect.top - (el.clientTop || 0)) / heightRatio), result;
|
|
42
|
+
}
|
|
43
|
+
|
|
33
44
|
function getXYPos(e) {
|
|
34
45
|
return {
|
|
35
46
|
canvasX: e.x,
|
|
@@ -38,21 +49,26 @@ function getXYPos(e) {
|
|
|
38
49
|
}
|
|
39
50
|
|
|
40
51
|
function getChangedTouchesPos(e) {
|
|
41
|
-
const pos = e.changedTouches[0];
|
|
42
52
|
return {
|
|
43
|
-
canvasX:
|
|
44
|
-
canvasY:
|
|
53
|
+
canvasX: e.changedTouches[0].x,
|
|
54
|
+
canvasY: e.changedTouches[0].y
|
|
45
55
|
};
|
|
46
56
|
}
|
|
47
57
|
|
|
48
58
|
function defineSrPosition(event, pos, client = !0) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
})
|
|
59
|
+
return (0, vutils_1.isValidNumber)(pos.canvasX) && Object.defineProperty(event, "canvasX", {
|
|
60
|
+
value: pos.canvasX,
|
|
61
|
+
writable: !0
|
|
62
|
+
}), (0, vutils_1.isValidNumber)(pos.canvasY) && Object.defineProperty(event, "canvasY", {
|
|
63
|
+
value: pos.canvasY,
|
|
64
|
+
writable: !0
|
|
65
|
+
}), client && (0, vutils_1.isValidNumber)(pos.clientX) && Object.defineProperty(event, "clientX", {
|
|
66
|
+
value: pos.clientX,
|
|
67
|
+
writable: !0
|
|
68
|
+
}), client && (0, vutils_1.isValidNumber)(pos.clientY) && Object.defineProperty(event, "clientY", {
|
|
69
|
+
value: pos.clientY,
|
|
70
|
+
writable: !0
|
|
71
|
+
}), [ pos.canvasX, pos.canvasY ];
|
|
56
72
|
}
|
|
57
73
|
|
|
58
74
|
exports.point = point;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graph/util/point.ts"],"names":[],"mappings":";;;AAAA,6CAAwD;AASxD,SAAgB,KAAK,CAAC,KAAY;IAChC,CAAC,SAAS,EAAE,gBAAgB,EAAE,eAAe,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAChE,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE;YAC7C,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBAC1C,MAAM,aAAa,GAAG,aAAa,CAAC,KAAc,CAAC,CAAC;gBACpD,gBAAgB,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;YAChD,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,GAAG,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACjC,OAAO,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACtC,CAAC;AAZD,sBAYC;AAED,SAAS,aAAa,CAAC,CAAQ;IAE7B,IAAI,CAAC,IAAA,cAAK,EAAE,CAAS,CAAC,OAAO,CAAC,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a,EAAC,GAAG,CAAC,OAAO,CAAC;QAC1B,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE;YACtC,KAAK,EAAE,GAAG,CAAC,OAAO;YAClB,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;IACL,MAAM;QACJ,IAAA,sBAAa,EAAC,GAAG,CAAC,OAAO,CAAC;QAC1B,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE;YACtC,KAAK,EAAE,GAAG,CAAC,OAAO;YAClB,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;IACL,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC","file":"point.js","sourcesContent":["import { isValidNumber, isNil } from '@visactor/vutils';\n\ninterface EventPosition {\n canvasX: number;\n canvasY: number;\n clientX?: number;\n clientY?: number;\n}\n\nexport function point(event: Event) {\n ['touches', 'changedTouches', 'targetTouches'].forEach(touchKey => {\n if (event[touchKey] && event[touchKey].length) {\n Array.from(event[touchKey]).forEach(touch => {\n const touchPosition = clientToLocal(touch as Event);\n defineSrPosition(touch, touchPosition, false);\n });\n }\n });\n\n const pos = clientToLocal(event);\n return defineSrPosition(event, pos);\n}\n\nfunction clientToLocal(e: Event): EventPosition {\n // For IE6+, chrome, safari, opera. (When will ff support offsetX?)\n if (!isNil((e as any).offsetX)) {\n return getOffsetPos(e);\n }\n\n // if (el && el.getBoundingClientRect) {\n // return getBoundingClientRectPos(e, el);\n // }\n\n // for miniApp\n if (!isNil((e as any).x)) {\n return getXYPos(e);\n }\n\n // for miniApp\n if ((e as any).changedTouches && (e as any).changedTouches.length) {\n return getChangedTouchesPos(e);\n }\n\n // For some other device, e.g., IOS safari.\n return {\n canvasX: 0,\n canvasY: 0\n };\n}\n\nfunction getOffsetPos(e: any) {\n return {\n canvasX: e.offsetX,\n canvasY: e.offsetY\n };\n}\n\nfunction getBoundingClientRectPos(e: any, el: HTMLElement) {\n const result: EventPosition = { canvasX: 0, canvasY: 0 };\n const rect = el.getBoundingClientRect();\n const currentWidth = rect.width;\n const originWidth = el.offsetWidth || currentWidth;\n const widthRatio = currentWidth / originWidth;\n const currentHeight = rect.height;\n const originHeight = el.offsetHeight || currentHeight;\n const heightRatio = currentHeight / originHeight;\n if (['touchstart', 'touchmove', 'touchend'].includes(e.type) && e.changedTouches && e.changedTouches.length) {\n result.canvasX = (e.changedTouches[0].clientX - rect.left - (el.clientLeft || 0)) / widthRatio;\n result.canvasY = (e.changedTouches[0].clientY - rect.top - (el.clientTop || 0)) / heightRatio;\n result.clientX = e.changedTouches[0].clientX;\n result.clientY = e.changedTouches[0].clientY;\n } else {\n result.canvasX = (e.clientX - rect.left - (el.clientLeft || 0)) / widthRatio;\n result.canvasY = (e.clientY - rect.top - (el.clientTop || 0)) / heightRatio;\n }\n return result;\n}\n\nfunction getXYPos(e: any) {\n return { canvasX: e.x, canvasY: e.y };\n}\n\nfunction getChangedTouchesPos(e: any) {\n return { canvasX: e.changedTouches[0].x, canvasY: e.changedTouches[0].y };\n}\n\nfunction defineSrPosition(event: any, pos: EventPosition, client = true) {\n isValidNumber(pos.canvasX) &&\n Object.defineProperty(event, 'canvasX', {\n value: pos.canvasX,\n writable: true\n });\n isValidNumber(pos.canvasY) &&\n Object.defineProperty(event, 'canvasY', {\n value: pos.canvasY,\n writable: true\n });\n client &&\n isValidNumber(pos.clientX) &&\n Object.defineProperty(event, 'clientX', {\n value: pos.clientX,\n writable: true\n });\n client &&\n isValidNumber(pos.clientY) &&\n Object.defineProperty(event, 'clientY', {\n value: pos.clientY,\n writable: true\n });\n return [pos.canvasX, pos.canvasY];\n}\n"]}
|
package/cjs/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const version = "0.14.0-alpha.
|
|
1
|
+
export declare const version = "0.14.0-alpha.2";
|
|
2
2
|
export * from './graph';
|
|
3
3
|
export * from './interactions';
|
|
4
4
|
export { View } from './view';
|
|
@@ -10,8 +10,6 @@ export * from './util/text';
|
|
|
10
10
|
export * from './types';
|
|
11
11
|
export { Factory } from './core/factory';
|
|
12
12
|
export { SIGNAL_AUTOFIT, SIGNAL_HEIGHT, SIGNAL_PADDING, SIGNAL_VIEW_HEIGHT, SIGNAL_VIEW_WIDTH, SIGNAL_WIDTH, SIGNAL_VIEW_BOX } from './view/constants';
|
|
13
|
-
export { registerViewEventsAPI } from './view/view-event-mixin';
|
|
14
|
-
export { registerViewMorphAPI } from './view/view-morph-mixin';
|
|
15
13
|
export { ThemeManager } from './theme/theme-manager';
|
|
16
14
|
export * from './glyph';
|
|
17
15
|
export * from './component';
|
|
@@ -23,8 +21,3 @@ export * from './interactions';
|
|
|
23
21
|
export * from './semantic-marks/cell';
|
|
24
22
|
export * from './semantic-marks/interval';
|
|
25
23
|
export * from './graph/mark/graphic';
|
|
26
|
-
export { registerDefaultLayout, defaultDoLayout } from './graph/layout/layout';
|
|
27
|
-
export { registerGlyphMark, GlyphMark } from './view/glyph';
|
|
28
|
-
export declare const registerDragPlugin: () => void;
|
|
29
|
-
export declare const registerGesturePlugin: () => void;
|
|
30
|
-
export declare const registerAnimate: () => void;
|
package/cjs/index.js
CHANGED
|
@@ -17,8 +17,8 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
|
|
|
17
17
|
|
|
18
18
|
Object.defineProperty(exports, "__esModule", {
|
|
19
19
|
value: !0
|
|
20
|
-
}), exports.
|
|
21
|
-
exports.version = "0.14.0-alpha.
|
|
20
|
+
}), exports.vglobal = exports.ThemeManager = exports.SIGNAL_VIEW_BOX = exports.SIGNAL_WIDTH = exports.SIGNAL_VIEW_WIDTH = exports.SIGNAL_VIEW_HEIGHT = exports.SIGNAL_PADDING = exports.SIGNAL_HEIGHT = exports.SIGNAL_AUTOFIT = exports.Factory = exports.GrammarBase = exports.invokeFunctionType = exports.parseFunctionType = exports.registerCoordinate = exports.Coordinate = exports.registerScale = exports.Scale = exports.View = exports.version = void 0,
|
|
21
|
+
exports.version = "0.14.0-alpha.2", __exportStar(require("./graph"), exports), __exportStar(require("./interactions"), exports);
|
|
22
22
|
|
|
23
23
|
var view_1 = require("./view");
|
|
24
24
|
|
|
@@ -128,24 +128,6 @@ Object.defineProperty(exports, "SIGNAL_AUTOFIT", {
|
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
|
|
131
|
-
var view_event_mixin_1 = require("./view/view-event-mixin");
|
|
132
|
-
|
|
133
|
-
Object.defineProperty(exports, "registerViewEventsAPI", {
|
|
134
|
-
enumerable: !0,
|
|
135
|
-
get: function() {
|
|
136
|
-
return view_event_mixin_1.registerViewEventsAPI;
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
var view_morph_mixin_1 = require("./view/view-morph-mixin");
|
|
141
|
-
|
|
142
|
-
Object.defineProperty(exports, "registerViewMorphAPI", {
|
|
143
|
-
enumerable: !0,
|
|
144
|
-
get: function() {
|
|
145
|
-
return view_morph_mixin_1.registerViewMorphAPI;
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
|
|
149
131
|
var theme_manager_1 = require("./theme/theme-manager");
|
|
150
132
|
|
|
151
133
|
Object.defineProperty(exports, "ThemeManager", {
|
|
@@ -166,50 +148,4 @@ Object.defineProperty(exports, "vglobal", {
|
|
|
166
148
|
}), __exportStar(require("./env"), exports), __exportStar(require("./interactions"), exports),
|
|
167
149
|
__exportStar(require("./semantic-marks/cell"), exports), __exportStar(require("./semantic-marks/interval"), exports),
|
|
168
150
|
__exportStar(require("./graph/mark/graphic"), exports);
|
|
169
|
-
|
|
170
|
-
var layout_1 = require("./graph/layout/layout");
|
|
171
|
-
|
|
172
|
-
Object.defineProperty(exports, "registerDefaultLayout", {
|
|
173
|
-
enumerable: !0,
|
|
174
|
-
get: function() {
|
|
175
|
-
return layout_1.registerDefaultLayout;
|
|
176
|
-
}
|
|
177
|
-
}), Object.defineProperty(exports, "defaultDoLayout", {
|
|
178
|
-
enumerable: !0,
|
|
179
|
-
get: function() {
|
|
180
|
-
return layout_1.defaultDoLayout;
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
var glyph_1 = require("./view/glyph");
|
|
185
|
-
|
|
186
|
-
Object.defineProperty(exports, "registerGlyphMark", {
|
|
187
|
-
enumerable: !0,
|
|
188
|
-
get: function() {
|
|
189
|
-
return glyph_1.registerGlyphMark;
|
|
190
|
-
}
|
|
191
|
-
}), Object.defineProperty(exports, "GlyphMark", {
|
|
192
|
-
enumerable: !0,
|
|
193
|
-
get: function() {
|
|
194
|
-
return glyph_1.GlyphMark;
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
const vrender_kits_1 = require("@visactor/vrender-kits"), factory_2 = require("./core/factory"), registerDragPlugin = () => {
|
|
199
|
-
factory_2.Factory.registerStageEventPlugin("drag", vrender_kits_1.DragNDrop);
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
exports.registerDragPlugin = registerDragPlugin;
|
|
203
|
-
|
|
204
|
-
const registerGesturePlugin = () => {
|
|
205
|
-
factory_2.Factory.registerStageEventPlugin("gesture", vrender_kits_1.Gesture);
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
exports.registerGesturePlugin = registerGesturePlugin;
|
|
209
|
-
|
|
210
|
-
const view_animate_mixin_1 = require("./view/view-animate-mixin"), mark_animate_mixin_1 = require("./view/mark-animate-mixin"), registerAnimate = () => {
|
|
211
|
-
(0, view_animate_mixin_1.registerViewAnimateAPI)(), (0, mark_animate_mixin_1.registerMarkAnimateAPI)();
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
exports.registerAnimate = registerAnimate;
|
|
215
151
|
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,0CAAwB;AAExB,iD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4GAAA,eAAe,OAAA;AAGjB,uDAAqD;AAA5C,6GAAA,YAAY,OAAA;AAErB,0CAAwB;AACxB,8CAA4B;AAC5B,+CAA6B;AAC7B,8DAA4C;AAE5C,uDAAiD;AAAxC,uGAAA,OAAO,OAAA;AAChB,wCAAsB;AACtB,iDAA+B;AAC/B,wDAAsC;AACtC,4DAA0C;AAC1C,uDAAqC","file":"index.js","sourcesContent":["// -- Exports -----\nexport const version = \"0.14.0-alpha.2\";\n\nexport * from './graph';\n\nexport * from './interactions';\n\nexport { View } from './view';\nexport { Scale, registerScale } from './view/scale';\nexport { Coordinate, registerCoordinate } from './view/coordinate';\nexport { parseFunctionType, invokeFunctionType } from './parse/util';\nexport { GrammarBase } from './view/grammar-base';\nexport * from './util/text';\nexport * from './types';\nexport { Factory } from './core/factory';\nexport {\n SIGNAL_AUTOFIT,\n SIGNAL_HEIGHT,\n SIGNAL_PADDING,\n SIGNAL_VIEW_HEIGHT,\n SIGNAL_VIEW_WIDTH,\n SIGNAL_WIDTH,\n SIGNAL_VIEW_BOX\n} from './view/constants';\n\nexport { ThemeManager } from './theme/theme-manager';\n\nexport * from './glyph';\nexport * from './component';\nexport * from './transforms';\nexport * from './graph/animation/animation';\n\nexport { vglobal } from '@visactor/vrender-core';\nexport * from './env';\nexport * from './interactions';\nexport * from './semantic-marks/cell';\nexport * from './semantic-marks/interval';\nexport * from './graph/mark/graphic';\n"]}
|
|
@@ -31,5 +31,4 @@ class BrushFilter extends brush_base_1.BrushBase {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
exports.BrushFilter = BrushFilter, BrushFilter.type = "brush-filter", BrushFilter.defaultOptions = {};
|
|
35
|
-
//# sourceMappingURL=brush-filter.js.map
|
|
34
|
+
exports.BrushFilter = BrushFilter, BrushFilter.type = "brush-filter", BrushFilter.defaultOptions = {};
|
|
@@ -387,5 +387,4 @@ const registerFishEye = () => {
|
|
|
387
387
|
factory_1.Factory.registerInteraction(fish_eye_1.FishEye.type, fish_eye_1.FishEye);
|
|
388
388
|
};
|
|
389
389
|
|
|
390
|
-
exports.registerFishEye = registerFishEye;
|
|
391
|
-
//# sourceMappingURL=index.js.map
|
|
390
|
+
exports.registerFishEye = registerFishEye;
|
package/cjs/parse/event.d.ts
CHANGED
|
@@ -5,4 +5,6 @@ export declare const parseHandler: (callback: EventCallback, config: {
|
|
|
5
5
|
debounce?: number;
|
|
6
6
|
throttle?: number;
|
|
7
7
|
}) => (...args: any[]) => any;
|
|
8
|
+
export declare const NAME_PREFIX = "@";
|
|
9
|
+
export declare const ID_PREFIX = "#";
|
|
8
10
|
export declare const parseEventSelector: (selector: string, source?: EventSourceType) => Partial<ParsedViewEventSpec | ParsedWindowEventSpec>;
|
package/cjs/parse/event.js
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: !0
|
|
5
|
-
}), exports.parseEventSelector = exports.parseHandler = exports.generateFilterByMark = void 0;
|
|
5
|
+
}), exports.parseEventSelector = exports.ID_PREFIX = exports.NAME_PREFIX = exports.parseHandler = exports.generateFilterByMark = void 0;
|
|
6
6
|
|
|
7
7
|
const vutils_1 = require("@visactor/vutils"), graphic_1 = require("../graph/util/graphic"), constants_1 = require("../view/constants"), generateFilterByMark = evtSpec => (0,
|
|
8
|
-
vutils_1.isNil)(evtSpec.markId) ?
|
|
8
|
+
vutils_1.isNil)(evtSpec.markId) ? el => el && el.mark.id() === evtSpec.markId : (0,
|
|
9
|
+
vutils_1.isNil)(evtSpec.markName) ? el => el && el.mark.name() === evtSpec.markName : (0,
|
|
10
|
+
vutils_1.isNil)(evtSpec.type) ? el => el && el.mark.markType === evtSpec.type : () => !0;
|
|
9
11
|
|
|
10
12
|
exports.generateFilterByMark = generateFilterByMark;
|
|
11
13
|
|
|
@@ -14,11 +16,15 @@ vutils_1.throttle)(callback, config.throttle) : callback;
|
|
|
14
16
|
|
|
15
17
|
exports.parseHandler = parseHandler;
|
|
16
18
|
|
|
17
|
-
const JOIN_SYMBOL = ":"
|
|
19
|
+
const JOIN_SYMBOL = ":";
|
|
20
|
+
|
|
21
|
+
exports.NAME_PREFIX = "@", exports.ID_PREFIX = "#";
|
|
22
|
+
|
|
23
|
+
const parseEventSelector = (selector, source = constants_1.EVENT_SOURCE_VIEW) => {
|
|
18
24
|
const spec = {}, splitArr = selector.split(":");
|
|
19
25
|
if (2 === splitArr.length) {
|
|
20
26
|
const [space, eventType] = splitArr;
|
|
21
|
-
space[0] ===
|
|
27
|
+
space[0] === exports.ID_PREFIX ? (spec.markId = space.slice(1), spec.source = source) : space[0] === exports.NAME_PREFIX ? (spec.markName = space.slice(1),
|
|
22
28
|
spec.source = source) : (0, graphic_1.isMarkType)(space) ? (spec.markType = space,
|
|
23
29
|
spec.source = source) : space === constants_1.EVENT_SOURCE_WINDOW ? spec.source = constants_1.EVENT_SOURCE_WINDOW : spec.source = source,
|
|
24
30
|
spec.type = eventType;
|
package/cjs/parse/event.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/parse/event.ts"],"names":[],"mappings":";;;AAAA,6CAA6D;AAS7D,mDAAmD;AACnD,
|
|
1
|
+
{"version":3,"sources":["../src/parse/event.ts"],"names":[],"mappings":";;;AAAA,6CAA6D;AAS7D,mDAAmD;AACnD,iDAA2E;AAEpE,MAAM,oBAAoB,GAAG,CAAC,OAA6D,EAAE,EAAE;IACpG,IAAI,IAAA,cAAK,EAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACzB,OAAO,CAAC,EAAY,EAAE,EAAE;YACtB,OAAO,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC;QAC/C,CAAC,CAAC;KACH;IAED,IAAI,IAAA,cAAK,EAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAC3B,OAAO,CAAC,EAAY,EAAE,EAAE;YACtB,OAAO,EAAE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iBAAS,EAAE;YAE1B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;SACtB;aAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,mBAAW,EAAE;YAEnC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;SACtB;aAAM,IAAI,IAAA,oBAAU,EAAC,KAAK,CAAC,EAAE;YAC5B,IAAI,CAAC,QAAQ,GAAG,KAAiB,CAAC;YAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;SACtB;aAAM,IAAI,KAAK,KAAK,+BAAmB,EAAE;YACxC,IAAI,CAAC,MAAM,GAAG,+BAAmB,CAAC;SACnC;aAAM;YACL,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;SACtB;QAED,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;KACvB;SAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QAChC,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;KACtB;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAnCW,QAAA,kBAAkB,sBAmC7B","file":"event.js","sourcesContent":["import { debounce, isNil, throttle } from '@visactor/vutils';\nimport type {\n EventSourceType,\n ParsedViewEventSpec,\n ParsedWindowEventSpec,\n EventCallback,\n MarkType,\n IElement\n} from '../types';\nimport { isMarkType } from '../graph/util/graphic';\nimport { EVENT_SOURCE_VIEW, EVENT_SOURCE_WINDOW } from '../view/constants';\n\nexport const generateFilterByMark = (evtSpec: Partial<ParsedViewEventSpec | ParsedWindowEventSpec>) => {\n if (isNil(evtSpec.markId)) {\n return (el: IElement) => {\n return el && el.mark.id() === evtSpec.markId;\n };\n }\n\n if (isNil(evtSpec.markName)) {\n return (el: IElement) => {\n return el && el.mark.name() === evtSpec.markName;\n };\n }\n\n if (isNil(evtSpec.type)) {\n return (el: IElement) => {\n return el && el.mark.markType === evtSpec.type;\n };\n }\n\n return () => true;\n};\n\nexport const parseHandler = (callback: EventCallback, config: { debounce?: number; throttle?: number }) => {\n if (config && config.debounce) {\n return debounce(callback, config.debounce);\n }\n\n if (config && config.throttle) {\n return throttle(callback, config.throttle);\n }\n\n return callback;\n};\n\nconst JOIN_SYMBOL = ':';\nexport const NAME_PREFIX = '@';\nexport const ID_PREFIX = '#';\n\n/**\n * Parse an event selector string.\n * Supported rules:\n * 1. mousedown\n * 2. rect:mousedown\n * 3. window:mousemove\n * 4. @foo:mousedown\n * Returns an event stream definitions.\n */\nexport const parseEventSelector = (\n selector: string,\n source: EventSourceType = EVENT_SOURCE_VIEW\n): Partial<ParsedViewEventSpec | ParsedWindowEventSpec> => {\n const spec: Partial<ParsedViewEventSpec | ParsedWindowEventSpec> = {};\n\n const splitArr = selector.split(JOIN_SYMBOL);\n\n if (splitArr.length === 2) {\n const [space, eventType] = splitArr;\n\n if (space[0] === ID_PREFIX) {\n // events on marks id\n spec.markId = space.slice(1);\n spec.source = source;\n } else if (space[0] === NAME_PREFIX) {\n // events on marks name\n spec.markName = space.slice(1);\n spec.source = source;\n } else if (isMarkType(space)) {\n spec.markType = space as MarkType;\n spec.source = source;\n } else if (space === EVENT_SOURCE_WINDOW) {\n spec.source = EVENT_SOURCE_WINDOW;\n } else {\n spec.source = source;\n }\n\n spec.type = eventType;\n } else if (splitArr.length === 1) {\n spec.type = selector;\n spec.source = source;\n }\n\n return spec;\n};\n"]}
|
package/cjs/parse/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/parse/util.ts"],"names":[],"mappings":";;;AAAA,6CAA6E;AAe7E,SAAgB,cAAc,CAAC,UAAiD,EAAE,IAAW;IAC3F,MAAM,YAAY,GAAuB,IAAA,cAAK,EAAC,UAAU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AAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;KAC1F;IACD,OAAO,IAAS,CAAC;AACnB,CAAC;AAjBD,kEAiBC;AAED,SAAgB,gBAAgB,CAAC,OAA8B,EAAE,UAAe;IAC9E,OAAO,IAAA,iBAAS,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACrE,CAAC;AAFD,4CAEC;AAKD,SAAgB,QAAQ,CAAC,GAAQ;IAC/B,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAFD,4BAEC;AAEM,MAAM,SAAS,GAAG,CAAC,EAAO,EAAsB,EAAE;IACvD,OAAO,EAAE,IAAI,CAAC,IAAA,cAAK,EAAC,EAAE,CAAC,WAAW,CAAC,CAAC;AACtC,CAAC,CAAC;AAFW,QAAA,SAAS,aAEpB;AAEK,MAAM,UAAU,GAAG,CAAI,KAAwD,EAAE,EAAE;IACxF,IAAI,IAAA,mBAAU,EAAC,KAAK,CAAC,EAAE;QACrB,OAAO,KAAK,CAAC;KACd;IACD,OAAO,CAAC,KAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC,CAAC;AALW,QAAA,UAAU,cAKrB;AAEK,MAAM,UAAU,GAAG,CAAC,KAAU,EAAiB,EAAE;IACtD,IAAI,IAAA,iBAAQ,EAAC,KAAK,CAAC,IAAI,cAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE;QACpD,OAAO,KAAK,CAAC;KACd;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AALW,QAAA,UAAU,cAKrB","file":"util.js","sourcesContent":["import { isString, isFunction, isNil, array, Color } from '@visactor/vutils';\nimport type { IElement } from '../types/element';\nimport type {\n FunctionCallback,\n SignalDependency,\n SignalReference,\n IView,\n GenericFunctionType,\n SignalFunction,\n ParameterFunctionType,\n ParameterCallback,\n Nil\n} from '../types';\nimport type { IGrammarBase } from '../types/grammar';\n\nexport function parseReference(dependency: SignalDependency | SignalDependency[], view: IView): IGrammarBase[] {\n const dependencies: SignalDependency[] = array(dependency);\n return dependencies.reduce((refs: IGrammarBase[], dep: string | IGrammarBase) => {\n const ref = (isString(dep) ? view.getGrammarById(dep as string) : dep) as IGrammarBase;\n\n if (ref) {\n refs.push(ref);\n }\n return refs;\n }, []);\n}\n\nfunction isSignalReferenceType(signal: any): signal is SignalReference {\n return !isFunction(signal) && !!(signal as SignalReference)?.signal;\n}\n\nfunction isSignalFunctionType<Callback extends FunctionCallback<T>, T>(\n signal: any\n): signal is SignalFunction<Callback, T> {\n return !isFunction(signal) && !!(signal as SignalFunction<Callback, T>)?.callback;\n}\n\nexport function parseFunctionType<Callback extends FunctionCallback<T>, T>(\n spec: GenericFunctionType<Callback, T> | Nil,\n view: IView\n): IGrammarBase[] {\n if (isNil(spec)) {\n return [];\n }\n if (isSignalReferenceType(spec)) {\n const signal = spec.signal;\n if (isString(signal)) {\n return array<IGrammarBase>(view.getGrammarById(signal as string) as IGrammarBase);\n } else if ((signal as IGrammarBase)?.grammarType === 'signal') {\n return [signal as IGrammarBase];\n }\n } else if (isSignalFunctionType(spec)) {\n return parseReference((spec as SignalFunction<Callback, T>).dependency, view);\n }\n return [];\n}\n\nexport function isFunctionType<Callback extends FunctionCallback<T>, T>(\n spec: any\n): spec is Callback | SignalReference | SignalFunction<Callback, T> {\n return isFunction(spec) || spec?.signal || !!(spec as SignalFunction<Callback, T>)?.callback;\n}\n\nexport function invokeFunctionType<Callback extends FunctionCallback<T>, T>(\n spec: GenericFunctionType<Callback, T> | Nil,\n parameters: any,\n datumOrGrammarInstance?: any | IGrammarBase,\n element?: IElement | any\n): T {\n if (isNil(spec)) {\n return spec as T;\n }\n\n if (isFunction(spec)) {\n if (element) {\n return (spec as Callback).call(null, datumOrGrammarInstance, element, parameters);\n }\n return (spec as Callback).call(null, datumOrGrammarInstance, parameters);\n } else if ((spec as SignalReference).signal) {\n const signal = (spec as SignalReference).signal;\n if (isString(signal)) {\n return parameters?.[signal as string];\n }\n return (signal as IGrammarBase).output();\n } else if ((spec as SignalFunction<Callback, T>).callback) {\n if (element) {\n return (spec as SignalFunction<Callback, T>).callback.call(null, datumOrGrammarInstance, element, parameters);\n }\n return (spec as SignalFunction<Callback, T>).callback.call(null, datumOrGrammarInstance, parameters);\n }\n return spec as T;\n}\n\nexport function invokeParameterFunctionType<T>(spec: ParameterFunctionType<T>, parameters: any): T {\n if (isNil(spec)) {\n return spec as T;\n }\n\n if (isFunction(spec)) {\n return spec.call(null, parameters);\n } else if ((spec as SignalReference).signal) {\n const signal = (spec as SignalReference).signal;\n if (isString(signal)) {\n return parameters?.[signal as string];\n }\n return (signal as IGrammarBase).output();\n } else if ((spec as SignalFunction<ParameterCallback<T>, T>).callback) {\n return (spec as SignalFunction<ParameterCallback<T>, T>).callback.call(null, parameters);\n }\n return spec as T;\n}\n\nexport function getGrammarOutput(grammar: IGrammarBase | string, parameters: any) {\n return isGrammar(grammar) ? grammar.output() : parameters[grammar];\n}\n\n/**\n * 判断是否是依赖signal\n */\nexport function isSignal(obj: any) {\n return obj && (obj.signal || obj.callback);\n}\n\nexport const isGrammar = (el: any): el is IGrammarBase => {\n return el && !isNil(el.grammarType);\n};\n\nexport const parseField = <T>(field: ((datum: T) => symbol | string) | string | symbol) => {\n if (isFunction(field)) {\n return field;\n }\n return (datum: T) => datum[field];\n};\n\nexport const parseColor = (color: any): string | null => {\n if (isString(color) && Color.parseColorString(color)) {\n return color;\n }\n return null;\n};\n"]}
|
package/cjs/types/animate.d.ts
CHANGED
package/cjs/types/animate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/animate.ts"],"names":[],"mappings":"","file":"animate.js","sourcesContent":["import type { IGraphic, ACustomAnimate, EasingType } from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { MarkFunctionCallback, MarkFunctionType } from './mark';\nimport type { IMark } from './grammar';\nimport type { IElement } from './element';\nimport type { FunctionCallback } from './signal';\n\nexport type TypeAnimation<T extends IElement> = (\n element: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nexport interface IClipAnimationOptions {\n clipDimension?: 'x' | 'y' | 'auto' | 'default';\n}\n\nexport interface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IGrowAngleAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n overall?: boolean | number;\n}\n\nexport interface IGrowRadiusAnimationOptions {\n orient?: 'inside' | 'outside';\n overall?: boolean | number;\n}\n\nexport interface IGrowPointsAnimationOptions {\n orient?: 'positive' | 'negative';\n}\n\nexport interface IGrowPointsOverallAnimationOptions extends IGrowPointsAnimationOptions {\n center?: IPointLike;\n}\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IMoveAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n orient?: 'positive' | 'negative';\n offset?: number;\n point?: { x?: number; y?: number } | FunctionCallback<{ x?: number; y?: number }>;\n}\n\nexport interface IRotateAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n angle?: number;\n}\n\n/** VGrammar 层提供的图元text上的图形属性,现在暂时会和VRender不一致 */\nexport interface TextItemAttributes {\n fontSize?: number;\n lineHeight?: number;\n font?: string;\n fontStyle?: string;\n fontVariant?: string;\n fontWeight?: string | number;\n lineBreak?: string;\n text?: string | string[];\n limit?: number;\n align?: string;\n baseline?: string;\n ellipsis?: string | boolean;\n dir?: string;\n}\n\n/** animation */\nexport type MarkFunctionValueType<T> = MarkFunctionCallback<T> | T;\n\nexport type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;\n\n/**\n * state动画,暂时只支持简单配置\n */\nexport interface IStateAnimationConfig {\n duration?: number;\n easing?: EasingType;\n}\n\n/**\n * 动画 config 简化配置\n */\nexport interface IAnimationTypeConfig {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n delay?: MarkFunctionValueType<number>;\n delayAfter?: MarkFunctionValueType<number>;\n duration?: MarkFunctionValueType<number>;\n oneByOne?: MarkFunctionValueType<boolean | number>;\n startTime?: MarkFunctionValueType<number>;\n totalTime?: MarkFunctionValueType<number>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: boolean | number;\n /** 动画 effect 配置项 */\n options?: MarkFunctionValueType<any>;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\n/**\n * 动画 timeline 完整配置,一条时间线内的动画单元只能串行\n * 多个timeline是可以并行的\n * 考虑到同一图元不能在多个timeline上,所以timeline不应该提供数组配置的能力\n */\nexport interface IAnimationTimeline {\n /** 为了方便动画编排,用户可以设置 id 用于识别时间线 */\n id?: string;\n /** 时间切片 */\n timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];\n /** 动画开始的相对时间,可以为负数 */\n startTime?: MarkFunctionValueType<number>;\n /** 动画时长 */\n totalTime?: MarkFunctionValueType<number>;\n /** 动画依次执行的延迟 */\n oneByOne?: MarkFunctionValueType<number | boolean>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: MarkFunctionValueType<number | boolean>;\n /** 对图元元素进行划分,和过滤类似,但是不同时间线不能同时作用在相同的元素上 */\n partitioner?: MarkFunctionCallback<boolean>;\n /** 对同一时间线上的元素进行排序 */\n sort?: (datumA: any, datumB: any, elementA: IElement, elementB: IElement, parameters: any) => number;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\nexport interface IAnimationTimeSlice {\n effects: IAnimationEffect | IAnimationEffect[];\n duration?: MarkFunctionValueType<number>;\n delay?: MarkFunctionValueType<number>;\n delayAfter?: MarkFunctionValueType<number>;\n}\n\nexport type IAnimationChannelFunction = (datum: any, element: IElement, parameters: IAnimationParameters) => any;\nexport type IAnimationChannelAttrs = Record<\n string,\n {\n from?: any | IAnimationChannelFunction;\n to?: any | IAnimationChannelFunction;\n }\n>;\nexport type IAnimationChannelAttributes = string[];\nexport type IAnimationChannelInterpolator = (\n ratio: number,\n from: any,\n to: any,\n nextAttributes: any,\n datum: any,\n element: IElement,\n parameters: IAnimationParameters\n) => boolean | void;\n\n// TODO: fix ACustomAnimate<any>\nexport interface IAnimationCustomConstructor {\n new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;\n}\n\nexport interface IAnimationEffect {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n /** options暂时没有处理 */\n options?: MarkFunctionValueType<any>;\n}\n\nexport interface IAnimationControlOptions {\n /** 当动画状态变更时清空动画 */\n stopWhenStateChange?: boolean;\n /** 是否立即应用动画初始状态 */\n immediatelyApply?: boolean;\n}\n\n/**\n * Animation timeline should be parsed into animation units,\n * which record all necessary configs for animator to execute animation.\n *\n * animation unit time:\n * |<--initialDelay-->| |<--loopDelay--><--Slices--><--looDelayAfter-->| |<--loopDuration-->|\n * |<-----------------loopDuration--------------->|\n */\nexport interface IAnimationUnit {\n /**\n * initial delay time before any animation loop\n */\n initialDelay: number;\n /**\n * total time for one animation loop\n */\n loopDuration: number;\n /**\n * delay time before time slices\n */\n loopDelay: number;\n /**\n * delay time after time slices\n */\n loopDelayAfter: number;\n /**\n * animating time in one animation loop\n */\n loopAnimateDuration: number;\n loopCount: number;\n totalTime: number;\n timeSlices: IAnimationTimeSlice[];\n}\n\nexport interface IAnimationRecord {\n start: IGraphic;\n end: IGraphic;\n changes: any[];\n}\n\nexport interface IAnimationParameters {\n width: number;\n height: number;\n mark: IMark;\n group: IMark | null;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\nexport interface IParsedAnimationConfig {\n state: string;\n timeline: IAnimationTimeline;\n originConfig: IAnimationConfig;\n id: string;\n}\n\nexport interface IParsedAnimationAttrs {\n from?: any;\n to?: any;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: any;\n}\n\n// animate structure\n\nexport interface IAnimatorOptions {\n state: string;\n timeline: IAnimationTimeline;\n id: string;\n}\n\nexport interface IAnimator {\n id: number;\n element: IElement;\n animationOptions: IAnimatorOptions;\n isAnimating: boolean;\n\n /** execute animation */\n animate: (animationParameters: IAnimationParameters, parameters: any) => this;\n /** set animation callback */\n callback: (callbackFunction: (...args: any[]) => void) => this;\n\n // animation control\n stop: (stopState?: 'start' | 'end', invokeCallback?: boolean) => this;\n pause: () => this;\n resume: () => this;\n\n /** set additional initial animation delay */\n startAt: (startTime: number) => this;\n /** get total animation execution time */\n getTotalAnimationTime: () => number;\n\n getEndAttributes: () => Record<string, any>;\n}\n\nexport interface IAnimateArranger {\n // animation control api\n parallel: (arranger: IAnimateArranger) => this;\n after: (arranger: IAnimateArranger) => this;\n\n // internal properties\n afterArranger: IAnimateArranger;\n parallelArrangers: IAnimateArranger[];\n animators: IAnimator[];\n totalTime: number;\n startTime: number;\n endTime: number;\n arrangeTime: () => void;\n}\n\nexport interface IBaseAnimate {\n // animation control\n stop: () => this;\n pause: () => this;\n resume: () => this;\n\n // internal animation process api\n animate: () => this;\n enable: () => this;\n disable: () => this;\n enableAnimationState: (state: string | string[]) => this;\n disableAnimationState: (state: string | string[]) => this;\n isAnimating: () => boolean;\n\n release: () => void;\n}\n\nexport interface IViewAnimate extends IBaseAnimate {\n animateAddition: (mark: IMark) => this;\n}\n\nexport interface IAnimate extends IBaseAnimate {\n mark: IMark;\n\n // additional animation control\n run: (config: IAnimationConfig | IAnimationConfig[]) => IAnimateArranger;\n runAnimationByState: (animationState: string) => IAnimateArranger;\n stopAnimationByState: (animationState: string) => this;\n pauseAnimationByState: (animationState: string) => this;\n resumeAnimationByState: (animationState: string) => this;\n reverse: () => this;\n restart: () => this;\n record: () => this;\n recordEnd: () => this;\n\n // internal animation process api\n getAnimationConfigs: (animationState: string) => IParsedAnimationConfig[];\n updateConfig: (config: Record<string, IAnimationConfig | IAnimationConfig[]>) => void;\n updateState: (state: MarkFunctionType<string> | null) => void;\n isElementAnimating: (element: IElement) => boolean;\n getAnimatorCount: () => number;\n getElementAnimators: (element: IElement | IElement[], animationState?: string) => IAnimator[];\n release: () => void;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/types/animate.ts"],"names":[],"mappings":"","file":"animate.js","sourcesContent":["import type { IGraphic, ACustomAnimate, EasingType } from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { MarkFunctionCallback, MarkFunctionType } from './mark';\nimport type { IMark } from './grammar';\nimport type { IElement } from './element';\nimport type { FunctionCallback } from './signal';\n\nexport type TypeAnimation<T extends IElement> = (\n element: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nexport interface IClipAnimationOptions {\n clipDimension?: 'x' | 'y' | 'auto' | 'default';\n}\n\nexport interface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IGrowAngleAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n overall?: boolean | number;\n}\n\nexport interface IGrowRadiusAnimationOptions {\n orient?: 'inside' | 'outside';\n overall?: boolean | number;\n}\n\nexport interface IGrowPointsAnimationOptions {\n orient?: 'positive' | 'negative';\n}\n\nexport interface IGrowPointsOverallAnimationOptions extends IGrowPointsAnimationOptions {\n center?: IPointLike;\n}\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IMoveAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n orient?: 'positive' | 'negative';\n offset?: number;\n point?: { x?: number; y?: number } | FunctionCallback<{ x?: number; y?: number }>;\n excludeChannels?: string[];\n}\n\nexport interface IRotateAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n angle?: number;\n}\n\n/** VGrammar 层提供的图元text上的图形属性,现在暂时会和VRender不一致 */\nexport interface TextItemAttributes {\n fontSize?: number;\n lineHeight?: number;\n font?: string;\n fontStyle?: string;\n fontVariant?: string;\n fontWeight?: string | number;\n lineBreak?: string;\n text?: string | string[];\n limit?: number;\n align?: string;\n baseline?: string;\n ellipsis?: string | boolean;\n dir?: string;\n}\n\n/** animation */\nexport type MarkFunctionValueType<T> = MarkFunctionCallback<T> | T;\n\nexport type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;\n\n/**\n * state动画,暂时只支持简单配置\n */\nexport interface IStateAnimationConfig {\n duration?: number;\n easing?: EasingType;\n}\n\n/**\n * 动画 config 简化配置\n */\nexport interface IAnimationTypeConfig {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n delay?: MarkFunctionValueType<number>;\n delayAfter?: MarkFunctionValueType<number>;\n duration?: MarkFunctionValueType<number>;\n oneByOne?: MarkFunctionValueType<boolean | number>;\n startTime?: MarkFunctionValueType<number>;\n totalTime?: MarkFunctionValueType<number>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: boolean | number;\n /** 动画 effect 配置项 */\n options?: MarkFunctionValueType<any>;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\n/**\n * 动画 timeline 完整配置,一条时间线内的动画单元只能串行\n * 多个timeline是可以并行的\n * 考虑到同一图元不能在多个timeline上,所以timeline不应该提供数组配置的能力\n */\nexport interface IAnimationTimeline {\n /** 为了方便动画编排,用户可以设置 id 用于识别时间线 */\n id?: string;\n /** 时间切片 */\n timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];\n /** 动画开始的相对时间,可以为负数 */\n startTime?: MarkFunctionValueType<number>;\n /** 动画时长 */\n totalTime?: MarkFunctionValueType<number>;\n /** 动画依次执行的延迟 */\n oneByOne?: MarkFunctionValueType<number | boolean>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: MarkFunctionValueType<number | boolean>;\n /** 对图元元素进行划分,和过滤类似,但是不同时间线不能同时作用在相同的元素上 */\n partitioner?: MarkFunctionCallback<boolean>;\n /** 对同一时间线上的元素进行排序 */\n sort?: (datumA: any, datumB: any, elementA: IElement, elementB: IElement, parameters: any) => number;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\nexport interface IAnimationTimeSlice {\n effects: IAnimationEffect | IAnimationEffect[];\n duration?: MarkFunctionValueType<number>;\n delay?: MarkFunctionValueType<number>;\n delayAfter?: MarkFunctionValueType<number>;\n}\n\nexport type IAnimationChannelFunction = (datum: any, element: IElement, parameters: IAnimationParameters) => any;\nexport type IAnimationChannelAttrs = Record<\n string,\n {\n from?: any | IAnimationChannelFunction;\n to?: any | IAnimationChannelFunction;\n }\n>;\nexport type IAnimationChannelAttributes = string[];\nexport type IAnimationChannelInterpolator = (\n ratio: number,\n from: any,\n to: any,\n nextAttributes: any,\n datum: any,\n element: IElement,\n parameters: IAnimationParameters\n) => boolean | void;\n\n// TODO: fix ACustomAnimate<any>\nexport interface IAnimationCustomConstructor {\n new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;\n}\n\nexport interface IAnimationEffect {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n /** options暂时没有处理 */\n options?: MarkFunctionValueType<any>;\n}\n\nexport interface IAnimationControlOptions {\n /** 当动画状态变更时清空动画 */\n stopWhenStateChange?: boolean;\n /** 是否立即应用动画初始状态 */\n immediatelyApply?: boolean;\n}\n\n/**\n * Animation timeline should be parsed into animation units,\n * which record all necessary configs for animator to execute animation.\n *\n * animation unit time:\n * |<--initialDelay-->| |<--loopDelay--><--Slices--><--looDelayAfter-->| |<--loopDuration-->|\n * |<-----------------loopDuration--------------->|\n */\nexport interface IAnimationUnit {\n /**\n * initial delay time before any animation loop\n */\n initialDelay: number;\n /**\n * total time for one animation loop\n */\n loopDuration: number;\n /**\n * delay time before time slices\n */\n loopDelay: number;\n /**\n * delay time after time slices\n */\n loopDelayAfter: number;\n /**\n * animating time in one animation loop\n */\n loopAnimateDuration: number;\n loopCount: number;\n totalTime: number;\n timeSlices: IAnimationTimeSlice[];\n}\n\nexport interface IAnimationRecord {\n start: IGraphic;\n end: IGraphic;\n changes: any[];\n}\n\nexport interface IAnimationParameters {\n width: number;\n height: number;\n mark: IMark;\n group: IMark | null;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\nexport interface IParsedAnimationConfig {\n state: string;\n timeline: IAnimationTimeline;\n originConfig: IAnimationConfig;\n id: string;\n}\n\nexport interface IParsedAnimationAttrs {\n from?: any;\n to?: any;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: any;\n}\n\n// animate structure\n\nexport interface IAnimatorOptions {\n state: string;\n timeline: IAnimationTimeline;\n id: string;\n}\n\nexport interface IAnimator {\n id: number;\n element: IElement;\n animationOptions: IAnimatorOptions;\n isAnimating: boolean;\n\n /** execute animation */\n animate: (animationParameters: IAnimationParameters, parameters: any) => this;\n /** set animation callback */\n callback: (callbackFunction: (...args: any[]) => void) => this;\n\n // animation control\n stop: (stopState?: 'start' | 'end', invokeCallback?: boolean) => this;\n pause: () => this;\n resume: () => this;\n\n /** set additional initial animation delay */\n startAt: (startTime: number) => this;\n /** get total animation execution time */\n getTotalAnimationTime: () => number;\n\n getEndAttributes: () => Record<string, any>;\n}\n\nexport interface IAnimateArranger {\n // animation control api\n parallel: (arranger: IAnimateArranger) => this;\n after: (arranger: IAnimateArranger) => this;\n\n // internal properties\n afterArranger: IAnimateArranger;\n parallelArrangers: IAnimateArranger[];\n animators: IAnimator[];\n totalTime: number;\n startTime: number;\n endTime: number;\n arrangeTime: () => void;\n}\n\nexport interface IBaseAnimate {\n // animation control\n stop: () => this;\n pause: () => this;\n resume: () => this;\n\n // internal animation process api\n animate: () => this;\n enable: () => this;\n disable: () => this;\n enableAnimationState: (state: string | string[]) => this;\n disableAnimationState: (state: string | string[]) => this;\n isAnimating: () => boolean;\n\n release: () => void;\n}\n\nexport interface IViewAnimate extends IBaseAnimate {\n animateAddition: (mark: IMark) => this;\n}\n\nexport interface IAnimate extends IBaseAnimate {\n mark: IMark;\n\n // additional animation control\n run: (config: IAnimationConfig | IAnimationConfig[]) => IAnimateArranger;\n runAnimationByState: (animationState: string) => IAnimateArranger;\n stopAnimationByState: (animationState: string) => this;\n pauseAnimationByState: (animationState: string) => this;\n resumeAnimationByState: (animationState: string) => this;\n reverse: () => this;\n restart: () => this;\n record: () => this;\n recordEnd: () => this;\n\n // internal animation process api\n getAnimationConfigs: (animationState: string) => IParsedAnimationConfig[];\n updateConfig: (config: Record<string, IAnimationConfig | IAnimationConfig[]>) => void;\n updateState: (state: MarkFunctionType<string> | null) => void;\n isElementAnimating: (element: IElement) => boolean;\n getAnimatorCount: () => number;\n getElementAnimators: (element: IElement | IElement[], animationState?: string) => IAnimator[];\n release: () => void;\n}\n"]}
|
package/cjs/types/element.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export interface IElement {
|
|
|
69
69
|
setItemAttributes: (attributes: {
|
|
70
70
|
[channel: string]: any;
|
|
71
71
|
} | any[]) => void;
|
|
72
|
-
updateData: (groupKey: string, data: any[], keyGenerator: MarkKeySpec) => void;
|
|
72
|
+
updateData: (groupKey: string, data: any[], keyGenerator: MarkKeySpec, view: any) => void;
|
|
73
73
|
state: (markState: MarkFunctionType<string | string[]>, parameters?: any) => void;
|
|
74
74
|
encodeItems: (items: MarkElementItem[], encoders: BaseEncodeSpec, isReentered?: boolean, parameters?: any) => void;
|
|
75
75
|
encodeGraphic: (attributes?: any) => void;
|
|
@@ -85,6 +85,10 @@ export interface IElement {
|
|
|
85
85
|
getNextGraphicAttributes: () => {
|
|
86
86
|
[key: string]: any;
|
|
87
87
|
};
|
|
88
|
+
getFinalAnimationAttribute: (channel: string) => any;
|
|
89
|
+
getFinalAnimationAttributes: () => {
|
|
90
|
+
[key: string]: any;
|
|
91
|
+
};
|
|
88
92
|
clearChangedGraphicAttributes: () => void;
|
|
89
93
|
clearGraphicAttributes: () => void;
|
|
90
94
|
getStates: () => string[];
|
package/cjs/types/element.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/element.ts"],"names":[],"mappings":"","file":"element.js","sourcesContent":["import type {\n IArc,\n IArc3d,\n IArea,\n ICircle,\n IGlyph,\n IGraphic,\n IGroup,\n IImage,\n ILine,\n IPath,\n IPolygon,\n IPyramid3d,\n IRect,\n IRect3d,\n IRichText,\n ISymbol,\n IText\n} from '@visactor/vrender-core';\nimport type { DiffState } from '../graph/enums';\nimport type { IMark, IGlyphMark } from './grammar';\nimport type {\n BaseEncodeSpec,\n BaseSingleEncodeSpec,\n IMarkConfig,\n MarkFunctionType,\n MarkKeySpec,\n MarkType\n} from './mark';\n\nexport interface ElementGraphicMap {\n circle: ICircle;\n arc: IArc;\n area: IArea;\n image: IImage;\n line: ILine;\n path: IPath;\n rule: ILine;\n shape: IPath;\n symbol: ISymbol;\n text: IText;\n richtext: IRichText;\n polygon: IPolygon;\n cell: ISymbol;\n interval: IGraphic;\n rect: IRect;\n rect3d: IRect3d;\n arc3d: IArc3d;\n pyramid3d: IPyramid3d;\n group: IGroup;\n glyph: IGlyph;\n linkPath: IGlyph;\n treePath: IGlyph;\n wave: IGlyph;\n ripplePoint: IGlyph;\n barBoxplot: IGlyph;\n boxPlot: IGlyph;\n component: IGroup;\n axis: IGroup;\n legend: IGroup;\n corsshair: IGroup;\n slider: IGroup;\n datazoom: IGroup;\n label: IGroup;\n player: IGroup;\n}\n\nexport type GetGraphicByType<T> = T extends keyof ElementGraphicMap ? ElementGraphicMap[T] : IGraphic;\n\n/**\n * 保存graphicItem状态\n */\nexport interface MarkElementItem {\n /** 唯一key */\n key: string;\n /** 原始数据 */\n datum: any;\n /** VGrammar view */\n view: any;\n /** 当前渲染帧下graphicItem对应的最新属性 */\n nextAttrs?: any;\n /** 是否初始化过,用于解决collection mark对应的item,可能跳过enter状态的问题 */\n // hasEntered: boolean;\n}\nexport interface IElement {\n mark: IMark;\n isReserved: boolean;\n diffState: DiffState;\n key: string;\n groupKey?: string;\n data?: any[];\n /**\n * 不推荐使用,但是collection图元暂时可能回涉及到相关修改\n */\n items: MarkElementItem[];\n\n initGraphicItem: (attrs?: any) => void;\n updateGraphicItem: () => void;\n\n getDatum: () => any;\n getBounds: () => any;\n getGraphicItem: () => IGraphic;\n removeGraphicItem: () => void;\n resetGraphicItem: () => void;\n\n /**\n * 获取 graphic 视觉通道属性\n * @param channel 视觉通道\n * @param prev 是否从之前的 graphic 属性上获取,默认为 false\n * @returns 视觉通道值\n */\n getGraphicAttribute: (channel: string, prev?: boolean) => any;\n /**\n * 设置 graphic 视觉通道属性\n * @param channel 视觉通道\n * @param value 视觉通道属性\n * @param final 是否更新 graphic 最终变更的视觉通道结果,默认为 false\n */\n setGraphicAttribute: (channel: string, value: any, final?: boolean) => void;\n /**\n * 设置一系列 graphic 视觉通道属性\n * @param attributes 视觉通道键值对\n * @param final 是否更新 graphic 最终变更的视觉通道结果,默认为 false\n */\n setGraphicAttributes: (attributes: { [channel: string]: any }, final?: boolean) => void;\n\n /**\n * 【慎重使用】获取 VGrammar 自身的视觉通道属性\n * 只有在 'afterEncodeItems' 时机的mark transform中才能调用\n */\n getItemAttribute: (channel?: string) => any;\n /**\n * 【慎重使用】设置 VGrammar 自身的视觉通道\n * 只有在 'afterEncodeItems' 时机的mark transform中才能调用\n * @param attributes\n * @returns\n */\n setItemAttributes: (attributes: { [channel: string]: any } | any[]) => void;\n\n // element 执行流程相关接口\n updateData: (groupKey: string, data: any[], keyGenerator: MarkKeySpec) => void;\n state: (markState: MarkFunctionType<string | string[]>, parameters?: any) => void;\n encodeItems: (items: MarkElementItem[], encoders: BaseEncodeSpec, isReentered?: boolean, parameters?: any) => void;\n encodeGraphic: (attributes?: any) => void;\n transformElementItems: (items: MarkElementItem[], markType: MarkType, computePoints?: boolean) => Record<string, any>;\n remove: () => void;\n release: () => void;\n\n // 动画相关接口\n\n getFinalGraphicAttributes: () => { [key: string]: any };\n getPrevGraphicAttributes: () => { [key: string]: any };\n getNextGraphicAttributes: () => { [key: string]: any };\n clearChangedGraphicAttributes: () => void;\n clearGraphicAttributes: () => void;\n\n // state相关接口\n getStates: () => string[];\n hasState: (state: string) => boolean;\n clearStates: (noAnimation?: boolean) => void;\n addState: (state: string | string[], attrs?: any) => boolean;\n removeState: (state: string | string[]) => boolean;\n useStates: (states: string[], noAnimation?: boolean) => boolean;\n updateStates: (states: Record<string, boolean | BaseSingleEncodeSpec>) => any;\n}\n\nexport interface IGlyphElement<P = any> extends IElement {\n mark: IGlyphMark;\n\n getGlyphGraphicItems: () => { [markName: string]: any };\n\n getGraphicAttribute: (channel: string, prev?: boolean, markName?: any) => any;\n setGraphicAttribute: (channel: string, value: any, final?: boolean, markName?: any) => void;\n setGraphicAttributes: (attributes: { [channel: string]: any }, final?: boolean, markName?: any) => void;\n\n getFinalGraphicAttributes: (markName?: string) => { [key: string]: any };\n getPrevGraphicAttributes: (markName?: string) => { [key: string]: any };\n getNextGraphicAttributes: (markName?: string) => { [key: string]: any };\n\n encodeCustom: (nextAttrs?: any) => { [markName: string]: any };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/types/element.ts"],"names":[],"mappings":"","file":"element.js","sourcesContent":["import type {\n IArc,\n IArc3d,\n IArea,\n ICircle,\n IGlyph,\n IGraphic,\n IGroup,\n IImage,\n ILine,\n IPath,\n IPolygon,\n IPyramid3d,\n IRect,\n IRect3d,\n IRichText,\n ISymbol,\n IText\n} from '@visactor/vrender-core';\nimport type { DiffState } from '../graph/enums';\nimport type { IMark, IGlyphMark } from './grammar';\nimport type {\n BaseEncodeSpec,\n BaseSingleEncodeSpec,\n IMarkConfig,\n MarkFunctionType,\n MarkKeySpec,\n MarkType\n} from './mark';\n\nexport interface ElementGraphicMap {\n circle: ICircle;\n arc: IArc;\n area: IArea;\n image: IImage;\n line: ILine;\n path: IPath;\n rule: ILine;\n shape: IPath;\n symbol: ISymbol;\n text: IText;\n richtext: IRichText;\n polygon: IPolygon;\n cell: ISymbol;\n interval: IGraphic;\n rect: IRect;\n rect3d: IRect3d;\n arc3d: IArc3d;\n pyramid3d: IPyramid3d;\n group: IGroup;\n glyph: IGlyph;\n linkPath: IGlyph;\n treePath: IGlyph;\n wave: IGlyph;\n ripplePoint: IGlyph;\n barBoxplot: IGlyph;\n boxPlot: IGlyph;\n component: IGroup;\n axis: IGroup;\n legend: IGroup;\n corsshair: IGroup;\n slider: IGroup;\n datazoom: IGroup;\n label: IGroup;\n player: IGroup;\n}\n\nexport type GetGraphicByType<T> = T extends keyof ElementGraphicMap ? ElementGraphicMap[T] : IGraphic;\n\n/**\n * 保存graphicItem状态\n */\nexport interface MarkElementItem {\n /** 唯一key */\n key: string;\n /** 原始数据 */\n datum: any;\n /** VGrammar view */\n view: any;\n /** 当前渲染帧下graphicItem对应的最新属性 */\n nextAttrs?: any;\n /** 是否初始化过,用于解决collection mark对应的item,可能跳过enter状态的问题 */\n // hasEntered: boolean;\n}\nexport interface IElement {\n mark: IMark;\n isReserved: boolean;\n diffState: DiffState;\n key: string;\n groupKey?: string;\n data?: any[];\n /**\n * 不推荐使用,但是collection图元暂时可能回涉及到相关修改\n */\n items: MarkElementItem[];\n\n initGraphicItem: (attrs?: any) => void;\n updateGraphicItem: () => void;\n\n getDatum: () => any;\n getBounds: () => any;\n getGraphicItem: () => IGraphic;\n removeGraphicItem: () => void;\n resetGraphicItem: () => void;\n\n /**\n * 获取 graphic 视觉通道属性\n * @param channel 视觉通道\n * @param prev 是否从之前的 graphic 属性上获取,默认为 false\n * @returns 视觉通道值\n */\n getGraphicAttribute: (channel: string, prev?: boolean) => any;\n /**\n * 设置 graphic 视觉通道属性\n * @param channel 视觉通道\n * @param value 视觉通道属性\n * @param final 是否更新 graphic 最终变更的视觉通道结果,默认为 false\n */\n setGraphicAttribute: (channel: string, value: any, final?: boolean) => void;\n /**\n * 设置一系列 graphic 视觉通道属性\n * @param attributes 视觉通道键值对\n * @param final 是否更新 graphic 最终变更的视觉通道结果,默认为 false\n */\n setGraphicAttributes: (attributes: { [channel: string]: any }, final?: boolean) => void;\n\n /**\n * 【慎重使用】获取 VGrammar 自身的视觉通道属性\n * 只有在 'afterEncodeItems' 时机的mark transform中才能调用\n */\n getItemAttribute: (channel?: string) => any;\n /**\n * 【慎重使用】设置 VGrammar 自身的视觉通道\n * 只有在 'afterEncodeItems' 时机的mark transform中才能调用\n * @param attributes\n * @returns\n */\n setItemAttributes: (attributes: { [channel: string]: any } | any[]) => void;\n\n // element 执行流程相关接口\n updateData: (groupKey: string, data: any[], keyGenerator: MarkKeySpec, view: any) => void;\n state: (markState: MarkFunctionType<string | string[]>, parameters?: any) => void;\n encodeItems: (items: MarkElementItem[], encoders: BaseEncodeSpec, isReentered?: boolean, parameters?: any) => void;\n encodeGraphic: (attributes?: any) => void;\n transformElementItems: (items: MarkElementItem[], markType: MarkType, computePoints?: boolean) => Record<string, any>;\n remove: () => void;\n release: () => void;\n\n // 动画相关接口\n\n getFinalGraphicAttributes: () => { [key: string]: any };\n getPrevGraphicAttributes: () => { [key: string]: any };\n getNextGraphicAttributes: () => { [key: string]: any };\n getFinalAnimationAttribute: (channel: string) => any;\n getFinalAnimationAttributes: () => { [key: string]: any };\n clearChangedGraphicAttributes: () => void;\n clearGraphicAttributes: () => void;\n\n // state相关接口\n getStates: () => string[];\n hasState: (state: string) => boolean;\n clearStates: (noAnimation?: boolean) => void;\n addState: (state: string | string[], attrs?: any) => boolean;\n removeState: (state: string | string[]) => boolean;\n useStates: (states: string[], noAnimation?: boolean) => boolean;\n updateStates: (states: Record<string, boolean | BaseSingleEncodeSpec>) => any;\n}\n\nexport interface IGlyphElement<P = any> extends IElement {\n mark: IGlyphMark;\n\n getGlyphGraphicItems: () => { [markName: string]: any };\n\n getGraphicAttribute: (channel: string, prev?: boolean, markName?: any) => any;\n setGraphicAttribute: (channel: string, value: any, final?: boolean, markName?: any) => void;\n setGraphicAttributes: (attributes: { [channel: string]: any }, final?: boolean, markName?: any) => void;\n\n getFinalGraphicAttributes: (markName?: string) => { [key: string]: any };\n getPrevGraphicAttributes: (markName?: string) => { [key: string]: any };\n getNextGraphicAttributes: (markName?: string) => { [key: string]: any };\n\n encodeCustom: (nextAttrs?: any) => { [markName: string]: any };\n}\n"]}
|
package/cjs/types/morph.d.ts
CHANGED
|
@@ -22,7 +22,8 @@ export interface IMorphAnimationConfig {
|
|
|
22
22
|
oneByOne?: MorphFunctionValueType<boolean | number>;
|
|
23
23
|
splitPath?: MorphFunctionValueType<'clone' | Nil>;
|
|
24
24
|
}
|
|
25
|
-
export interface
|
|
25
|
+
export interface IMorph {
|
|
26
26
|
diffGrammar: <U extends IGrammarBase>(prevGrammars: U[], nextGrammars: U[]) => DiffResult<U, U>;
|
|
27
27
|
diffMark: (prevMarks: IMark[], nextMarks: IMark[], runningConfig: IRunningConfig) => DiffResult<IMark[], IMark[]>;
|
|
28
|
+
morph: (prevMarks: IMark[], nextMarks: IMark[], runningConfig: IRunningConfig) => void;
|
|
28
29
|
}
|
package/cjs/types/morph.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/morph.ts"],"names":[],"mappings":"","file":"morph.js","sourcesContent":["import type { EasingType } from '@visactor/vrender-core';\nimport type { DiffResult, Nil } from './base';\nimport type { IElement } from './element';\nimport type { IGrammarBase, IMark } from './grammar';\nimport type { GenericFunctionType } from './signal';\nimport type { IRunningConfig } from './view';\n\nexport type MorphData = { prev: any[]; next: any[] };\nexport type MorphElements = { prev: IElement[]; next: IElement[] };\n\nexport type MorphFunctionCallback<T> = (datum: MorphData, element: MorphElements, parameters: any) => T;\n\nexport type MorphFunctionType<T> = GenericFunctionType<MorphFunctionCallback<T>, T>;\n\nexport type MorphFunctionValueType<T> = MorphFunctionType<T> | T;\n\nexport interface IMorphAnimationConfig {\n easing?: EasingType;\n delay?: MorphFunctionValueType<number>;\n duration?: MorphFunctionValueType<number>;\n oneByOne?: MorphFunctionValueType<boolean | number>;\n splitPath?: MorphFunctionValueType<'clone' | Nil>;\n}\n\nexport interface
|
|
1
|
+
{"version":3,"sources":["../src/types/morph.ts"],"names":[],"mappings":"","file":"morph.js","sourcesContent":["import type { EasingType } from '@visactor/vrender-core';\nimport type { DiffResult, Nil } from './base';\nimport type { IElement } from './element';\nimport type { IGrammarBase, IMark } from './grammar';\nimport type { GenericFunctionType } from './signal';\nimport type { IRunningConfig } from './view';\n\nexport type MorphData = { prev: any[]; next: any[] };\nexport type MorphElements = { prev: IElement[]; next: IElement[] };\n\nexport type MorphFunctionCallback<T> = (datum: MorphData, element: MorphElements, parameters: any) => T;\n\nexport type MorphFunctionType<T> = GenericFunctionType<MorphFunctionCallback<T>, T>;\n\nexport type MorphFunctionValueType<T> = MorphFunctionType<T> | T;\n\nexport interface IMorphAnimationConfig {\n easing?: EasingType;\n delay?: MorphFunctionValueType<number>;\n duration?: MorphFunctionValueType<number>;\n oneByOne?: MorphFunctionValueType<boolean | number>;\n splitPath?: MorphFunctionValueType<'clone' | Nil>;\n}\n\nexport interface IMorph {\n diffGrammar: <U extends IGrammarBase>(prevGrammars: U[], nextGrammars: U[]) => DiffResult<U, U>;\n diffMark: (prevMarks: IMark[], nextMarks: IMark[], runningConfig: IRunningConfig) => DiffResult<IMark[], IMark[]>;\n\n morph: (prevMarks: IMark[], nextMarks: IMark[], runningConfig: IRunningConfig) => void;\n}\n"]}
|
package/cjs/types/renderer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IBoundsLike } from '@visactor/vutils';
|
|
2
|
-
import type { IColor,
|
|
2
|
+
import type { IColor, Stage } from '@visactor/vrender-core';
|
|
3
3
|
import type { IViewEventConfig, IViewOptions } from './view';
|
|
4
4
|
export interface IRenderer {
|
|
5
5
|
initialize: (width: number, height: number, options: IViewOptions, eventConfig: IViewEventConfig) => this;
|
|
@@ -18,8 +18,3 @@ export interface IRenderer {
|
|
|
18
18
|
toCanvas: () => HTMLCanvasElement;
|
|
19
19
|
release: () => void;
|
|
20
20
|
}
|
|
21
|
-
export interface IStageEventPlugin<T> {
|
|
22
|
-
new (taget: IEventTarget, cfg?: T): {
|
|
23
|
-
release: () => void;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/renderer.ts"],"names":[],"mappings":"","file":"renderer.js","sourcesContent":["import type { IBoundsLike } from '@visactor/vutils';\nimport type { IColor,
|
|
1
|
+
{"version":3,"sources":["../src/types/renderer.ts"],"names":[],"mappings":"","file":"renderer.js","sourcesContent":["import type { IBoundsLike } from '@visactor/vutils';\nimport type { IColor, Stage } from '@visactor/vrender-core';\nimport type { IViewEventConfig, IViewOptions } from './view';\n\nexport interface IRenderer {\n initialize: (width: number, height: number, options: IViewOptions, eventConfig: IViewEventConfig) => this;\n\n render: (immediately?: boolean) => this;\n renderNextFrame: () => this;\n resize: (width: number, height: number) => this;\n shouldResize: (width: number, height: number) => boolean;\n combineIncrementalLayers: () => this;\n preventRender: (tag: boolean) => void;\n\n setDpr: (resolution: number, redraw: boolean) => this;\n background: (color: IColor) => this;\n setViewBox: (viewBox: IBoundsLike, rerender: boolean) => this;\n\n stage: () => Stage;\n canvas: () => HTMLCanvasElement;\n context: () => CanvasRenderingContext2D;\n\n toCanvas: () => HTMLCanvasElement;\n // toImageData: () => Promise<ImageData | undefined>;\n\n release: () => void;\n}\n"]}
|
package/cjs/view/View.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { IBounds, ILogger } from '@visactor/vutils';
|
|
|
2
2
|
import { EventEmitter } from '@visactor/vutils';
|
|
3
3
|
import type { IColor } from '@visactor/vrender-core';
|
|
4
4
|
import type { CoordinateType } from '@visactor/vgrammar-coordinate';
|
|
5
|
-
import type { IData, ISignal, ViewSpec, IView, IViewOptions, IViewThemeConfig, Hooks, IMark, MarkType, GrammarScaleType, SignalFunctionType, IScale, IGrammarBase, IGroupMark, IGlyphMark, ICoordinate, BaseEventHandler, IRecordedGrammars, IComponent, IRunningConfig, IViewAnimate, ITheme, InteractionSpec, IInteraction } from '../types/';
|
|
5
|
+
import type { IData, ISignal, ViewSpec, IView, IViewOptions, IViewThemeConfig, Hooks, IMark, EventSpec, MarkType, GrammarScaleType, SignalFunctionType, IScale, IGrammarBase, IGroupMark, IGlyphMark, ICoordinate, BaseEventHandler, IRecordedGrammars, IComponent, IRunningConfig, IViewAnimate, ITheme, InteractionSpec, IInteraction } from '../types/';
|
|
6
6
|
import type { IRenderer } from '../types/renderer';
|
|
7
7
|
import { LayoutState } from '../graph/enums';
|
|
8
8
|
import type { IAxis, IDatazoom, IGrid, ILabel, ILegend, IPlayer, IScrollbar, ISlider, ITitle } from '../types/component';
|
|
@@ -18,7 +18,8 @@ export default class View extends EventEmitter implements IView {
|
|
|
18
18
|
private _config;
|
|
19
19
|
private _options;
|
|
20
20
|
private _cachedGrammars;
|
|
21
|
-
private
|
|
21
|
+
private _willMorphMarks;
|
|
22
|
+
private _morph;
|
|
22
23
|
private _eventConfig;
|
|
23
24
|
private _eventListeners;
|
|
24
25
|
private _theme;
|
|
@@ -27,6 +28,7 @@ export default class View extends EventEmitter implements IView {
|
|
|
27
28
|
private _layoutState?;
|
|
28
29
|
private _layoutMarks?;
|
|
29
30
|
private _background?;
|
|
31
|
+
private _eventCache;
|
|
30
32
|
private _progressiveMarks?;
|
|
31
33
|
private _progressiveRafId?;
|
|
32
34
|
private _observer;
|
|
@@ -120,10 +122,11 @@ export default class View extends EventEmitter implements IView {
|
|
|
120
122
|
private _onResize;
|
|
121
123
|
resize(width: number, height: number, render?: boolean): this;
|
|
122
124
|
private _resizeRenderer;
|
|
125
|
+
private bindEvents;
|
|
126
|
+
event(eventSpec: EventSpec): void;
|
|
123
127
|
interaction(type: string, spec: Partial<InteractionSpec>): IInteraction<any>;
|
|
124
128
|
removeInteraction(type: string | IInteraction, id?: string): this;
|
|
125
129
|
removeAllInteractions(): this;
|
|
126
|
-
initializeEventConfig(config: any): any;
|
|
127
130
|
private initEvent;
|
|
128
131
|
private releaseStageEvent;
|
|
129
132
|
private delegateEvent;
|