@visactor/vgrammar-core 0.9.3 → 0.9.5-alpha.0
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/label.js +1 -0
- package/cjs/component/label.js.map +1 -1
- package/cjs/core/factory.d.ts +1 -1
- package/cjs/graph/animation/animate.js +12 -11
- package/cjs/graph/animation/animate.js.map +1 -1
- package/cjs/graph/animation/animation/grow-cartesian.js +20 -20
- package/cjs/graph/animation/animation/grow-cartesian.js.map +1 -1
- package/cjs/graph/animation/animation/grow-interval.js +18 -20
- package/cjs/graph/animation/animation/grow-interval.js.map +1 -1
- package/cjs/graph/animation/animation/grow-points.js +8 -4
- package/cjs/graph/animation/animation/grow-points.js.map +1 -1
- package/cjs/graph/animation/animation/move.js +7 -2
- package/cjs/graph/animation/animation/move.js.map +1 -1
- package/cjs/graph/element.d.ts +3 -3
- package/cjs/graph/element.js +20 -14
- package/cjs/graph/element.js.map +1 -1
- package/cjs/graph/glyph-element.d.ts +1 -1
- package/cjs/graph/glyph-element.js +3 -3
- package/cjs/graph/glyph-element.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/interactions/base.d.ts +1 -1
- package/cjs/interactions/base.js +6 -2
- package/cjs/interactions/base.js.map +1 -1
- package/cjs/interactions/element-active-by-legend.js +5 -3
- package/cjs/interactions/element-active-by-legend.js.map +1 -1
- package/cjs/interactions/element-active.d.ts +1 -1
- package/cjs/interactions/element-highlight-by-legend.js +5 -4
- package/cjs/interactions/element-highlight-by-legend.js.map +1 -1
- package/cjs/interactions/element-highlight-by-name.js +4 -4
- package/cjs/interactions/element-highlight-by-name.js.map +1 -1
- package/cjs/interactions/element-highlight.d.ts +3 -1
- package/cjs/interactions/element-highlight.js +19 -9
- package/cjs/interactions/element-highlight.js.map +1 -1
- package/cjs/interactions/element-select.d.ts +4 -3
- package/cjs/interactions/element-select.js +28 -17
- package/cjs/interactions/element-select.js.map +1 -1
- package/cjs/interactions/utils.d.ts +2 -0
- package/cjs/interactions/utils.js +13 -0
- package/cjs/interactions/utils.js.map +1 -0
- package/cjs/interactions/view-drag-mixin.js +1 -1
- package/cjs/types/element.d.ts +3 -3
- package/cjs/types/element.js.map +1 -1
- package/cjs/types/grammar.d.ts +2 -2
- package/cjs/types/grammar.js.map +1 -1
- package/cjs/types/interaction.d.ts +21 -13
- package/cjs/types/interaction.js.map +1 -1
- package/cjs/view/View.d.ts +2 -2
- package/cjs/view/View.js +5 -2
- package/cjs/view/View.js.map +1 -1
- package/cjs/view/mark.d.ts +2 -2
- package/cjs/view/mark.js +12 -8
- package/cjs/view/mark.js.map +1 -1
- package/es/component/label.js +1 -0
- package/es/component/label.js.map +1 -1
- package/es/core/factory.d.ts +1 -1
- package/es/graph/animation/animate.js +12 -11
- package/es/graph/animation/animate.js.map +1 -1
- package/es/graph/animation/animation/grow-cartesian.js +16 -20
- package/es/graph/animation/animation/grow-cartesian.js.map +1 -1
- package/es/graph/animation/animation/grow-interval.js +14 -20
- package/es/graph/animation/animation/grow-interval.js.map +1 -1
- package/es/graph/animation/animation/grow-points.js +8 -4
- package/es/graph/animation/animation/grow-points.js.map +1 -1
- package/es/graph/animation/animation/move.js +7 -1
- package/es/graph/animation/animation/move.js.map +1 -1
- package/es/graph/element.d.ts +3 -3
- package/es/graph/element.js +20 -13
- package/es/graph/element.js.map +1 -1
- package/es/graph/glyph-element.d.ts +1 -1
- package/es/graph/glyph-element.js +3 -3
- package/es/graph/glyph-element.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/interactions/base.d.ts +1 -1
- package/es/interactions/base.js +7 -3
- package/es/interactions/base.js.map +1 -1
- package/es/interactions/element-active-by-legend.js +6 -2
- package/es/interactions/element-active-by-legend.js.map +1 -1
- package/es/interactions/element-active.d.ts +1 -1
- package/es/interactions/element-highlight-by-legend.js +6 -3
- package/es/interactions/element-highlight-by-legend.js.map +1 -1
- package/es/interactions/element-highlight-by-name.js +5 -3
- package/es/interactions/element-highlight-by-name.js.map +1 -1
- package/es/interactions/element-highlight.d.ts +3 -1
- package/es/interactions/element-highlight.js +19 -9
- package/es/interactions/element-highlight.js.map +1 -1
- package/es/interactions/element-select.d.ts +4 -3
- package/es/interactions/element-select.js +27 -16
- package/es/interactions/element-select.js.map +1 -1
- package/es/interactions/utils.d.ts +2 -0
- package/es/interactions/utils.js +5 -0
- package/es/interactions/utils.js.map +1 -0
- package/es/types/element.d.ts +3 -3
- package/es/types/element.js.map +1 -1
- package/es/types/grammar.d.ts +2 -2
- package/es/types/grammar.js.map +1 -1
- package/es/types/interaction.d.ts +21 -13
- package/es/types/interaction.js.map +1 -1
- package/es/view/View.d.ts +2 -2
- package/es/view/View.js +6 -3
- package/es/view/View.js.map +1 -1
- package/es/view/mark.d.ts +2 -2
- package/es/view/mark.js +12 -7
- package/es/view/mark.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graph/animation/animation/grow-interval.ts"],"names":[],"mappings":";;;AAIA,6CAA4C;AAE5C,SAAS,wBAAwB,CAC/B,OAAiB,EACjB,OAAuC,EACvC,mBAAyC;IAEzC,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,MAAK,GAAG,EAAE;QAC9B,MAAM,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAClD,MAAM,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACpD,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,MAAK,UAAU,EAAE;YAClC,OAAO;gBACL,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;gBACvB,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,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OAAiB,EACjB,OAAwD,EACxD,mBAAyC,EACzC,EAAE;;IACF,MAAM,KAAK,GAAG,MAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,KAAK,0CAAE,MAAM,EAAE,CAAC;IAC5C,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;IAC1C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC;IACvC,MAAM,UAAU,GAAmC;QACjD,MAAM,EAAE,UAAU;QAClB,SAAS,EAAE,YAAY,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;KAChD,CAAC;IAEF,OAAO,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,MAAK,IAAI;QAC9B,CAAC,CAAC,yBAAyB,CAAC,OAAO,EAAE,UAAU,EAAE,mBAAmB,CAAC;QACrE,CAAC,CAAC,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,mBAAmB,CAAC,CAAC;AACvE,CAAC,CAAC;AAhBW,QAAA,eAAe,mBAgB1B","file":"grow-interval.js","sourcesContent":["/**\n * this animtion is only used for interval mark\n */\nimport type { IGrowCartesianAnimationOptions, IAnimationParameters, IElement, TypeAnimation } from '../../../types';\nimport { isNumber } from '@visactor/vutils';\n\nfunction growIntervalInIndividual(\n element: IElement,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n if (options?.direction === 'x') {\n const x = element.getGraphicAttribute('x', false);\n const x1 = element.getGraphicAttribute('x1', false);\n if (options?.orient === 'negative') {\n return {\n from: { x: x1, x1: x1 },\n to: { x: x, x1: x1 }\n };\n }\n return {\n from: { x: x, x1: x },\n to: { x: x, y1: x1 }\n };\n }\n const y = element.getGraphicAttribute('y', false);\n const y1 = element.getGraphicAttribute('y1', false);\n if (options?.orient === 'negative') {\n return {\n from: { y: y1, y1: y1 },\n to: { y: y, y1: y1 }\n };\n }\n return {\n from: { y: y, y1: y },\n to: { y: y, y1: y1 }\n };\n}\n\nfunction growIntervalInOverall(\n element: IElement,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n if (options?.direction === 'x') {\n const x = element.getGraphicAttribute('x', false);\n const x1 = element.getGraphicAttribute('x1', false);\n let overallValue: number;\n if (options?.orient === 'negative') {\n const groupRight = animationParameters.group\n ? animationParameters.group.getBounds().width()\n : animationParameters.width;\n overallValue = isNumber(options?.overall) ? options?.overall : groupRight;\n } else {\n overallValue = isNumber(options?.overall) ? options?.overall : 0;\n }\n return {\n from: { x: overallValue, x1: overallValue },\n to: { x: x, y1: x1 }\n };\n }\n\n const y = element.getGraphicAttribute('y', false);\n const y1 = element.getGraphicAttribute('y1', false);\n let overallValue: number;\n if (options?.orient === 'negative') {\n const groupBottom = animationParameters.group\n ? animationParameters.group.getBounds().height()\n : animationParameters.height;\n overallValue = isNumber(options?.overall) ? options?.overall : groupBottom;\n } else {\n overallValue = isNumber(options?.overall) ? options?.overall : 0;\n }\n return {\n from: { y: overallValue, y1: overallValue },\n to: { y: y, y1: y1 }\n };\n}\n\nexport const growIntervalIn: TypeAnimation<IElement> = (\n element: IElement,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const coord = element.mark?.coord?.output();\n const isTransposed = coord.isTransposed();\n const isPolar = coord.type === 'polar';\n const newOptions: IGrowCartesianAnimationOptions = {\n orient: 'negative',\n direction: isTransposed && !isPolar ? 'x' : 'y'\n };\n\n return options?.overall !== true\n ? growIntervalInIndividual(element, newOptions, animationParameters)\n : growIntervalInOverall(element, newOptions, animationParameters);\n};\n\nfunction growIntervalOutIndividual(\n element: IElement,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n if (options.direction === 'x') {\n const x = element.getGraphicAttribute('x', false);\n const x1 = element.getGraphicAttribute('x1', false);\n const prevX = element.getGraphicAttribute('x', true);\n const prevX1 = element.getGraphicAttribute('x1', true);\n if (options?.orient === 'negative') {\n return {\n from: { x: prevX, x1: prevX1 },\n to: { x: x1, x1: x1 }\n };\n }\n return {\n from: { x: prevX, x1: prevX1 },\n to: { x: x, x1: x }\n };\n }\n\n const y = element.getGraphicAttribute('y', false);\n const y1 = element.getGraphicAttribute('y1', false);\n const prevY = element.getGraphicAttribute('y', true);\n const prevY1 = element.getGraphicAttribute('y1', true);\n if (options?.orient === 'negative') {\n return {\n from: { y: prevY, y1: prevY1 },\n to: { y: y1, y1: y1 }\n };\n }\n return {\n from: { y: prevY, y1: prevY1 },\n to: { y: y, y1: y }\n };\n}\n\nfunction growIntervalOutOverall(\n element: IElement,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n if (options?.direction === 'x') {\n const prevX = element.getGraphicAttribute('x', true);\n const prevX1 = element.getGraphicAttribute('x1', true);\n let overallValue: number;\n if (options?.orient === 'negative') {\n const groupRight = animationParameters.group\n ? animationParameters.group.getBounds().width()\n : animationParameters.height;\n overallValue = isNumber(options?.overall) ? options?.overall : groupRight;\n } else {\n overallValue = isNumber(options?.overall) ? options?.overall : 0;\n }\n return {\n from: { x: prevX, x1: prevX1 },\n to: { x: overallValue, x1: overallValue }\n };\n }\n\n const prevY = element.getGraphicAttribute('y', true);\n const prevY1 = element.getGraphicAttribute('y1', true);\n let overallValue: number;\n if (options?.orient === 'negative') {\n const groupBottom = animationParameters.group\n ? animationParameters.group.getBounds().height()\n : animationParameters.height;\n overallValue = isNumber(options?.overall) ? options?.overall : groupBottom;\n } else {\n overallValue = isNumber(options?.overall) ? options?.overall : 0;\n }\n return {\n from: { y: prevY, y1: prevY1 },\n to: { y: overallValue, y1: overallValue }\n };\n}\n\nexport const growIntervalOut: TypeAnimation<IElement> = (\n element: IElement,\n options: Pick<IGrowCartesianAnimationOptions, 'overall'>,\n animationParameters: IAnimationParameters\n) => {\n const coord = element.mark?.coord?.output();\n const isTransposed = coord.isTransposed();\n const isPolar = coord.type === 'polar';\n const newOptions: IGrowCartesianAnimationOptions = {\n orient: 'negative',\n direction: isTransposed && !isPolar ? 'x' : 'y'\n };\n\n return options?.overall !== true\n ? growIntervalOutIndividual(element, newOptions, animationParameters)\n : growIntervalOutOverall(element, newOptions, animationParameters);\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/graph/animation/animation/grow-interval.ts"],"names":[],"mappings":";;;AAIA,6CAA4C;AAE5C,SAAS,wBAAwB,CAC/B,OAAiB,EACjB,OAAuC,EACvC,mBAAyC;IAEzC,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,MAAK,GAAG,EAAE;QAC9B,MAAM,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAClD,MAAM,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACpD,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,MAAK,UAAU,EAAE;YAClC,OAAO;gBACL,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;gBACvB,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;aACrB,CAAC;SACH;QACD,OAAO;YACL,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE;YACrB,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACrB,CAAC;KACH;IACD,MAAM,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAClD,MAAM,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACpD,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,MAAK,UAAU,EAAE;QAClC,OAAO;YACL,IAAI,EAAE,EAAE,CAAC,EA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KAAK,OAAO,CAAC;IACvC,MAAM,UAAU,GAAmC;QACjD,MAAM,EAAE,UAAU;QAClB,SAAS,EAAE,YAAY,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;KAChD,CAAC;IAEF,OAAO,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,MAAK,IAAI;QAC9B,CAAC,CAAC,yBAAyB,CAAC,OAAO,EAAE,UAAU,EAAE,mBAAmB,CAAC;QACrE,CAAC,CAAC,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,mBAAmB,CAAC,CAAC;AACvE,CAAC,CAAC;AAhBW,QAAA,eAAe,mBAgB1B","file":"grow-interval.js","sourcesContent":["/**\n * this animtion is only used for interval mark\n */\nimport type { IGrowCartesianAnimationOptions, IAnimationParameters, IElement, TypeAnimation } from '../../../types';\nimport { isNumber } from '@visactor/vutils';\n\nfunction growIntervalInIndividual(\n element: IElement,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n if (options?.direction === 'x') {\n const x = element.getGraphicAttribute('x', false);\n const x1 = element.getGraphicAttribute('x1', false);\n if (options?.orient === 'negative') {\n return {\n from: { x: x1, x1: x1 },\n to: { x: x, x1: x1 }\n };\n }\n return {\n from: { x: x, x1: x },\n to: { x: x, y1: x1 }\n };\n }\n const y = element.getGraphicAttribute('y', false);\n const y1 = element.getGraphicAttribute('y1', false);\n if (options?.orient === 'negative') {\n return {\n from: { y: y1, y1: y1 },\n to: { y: y, y1: y1 }\n };\n }\n return {\n from: { y: y, y1: y },\n to: { y: y, y1: y1 }\n };\n}\n\nfunction growIntervalInOverall(\n element: IElement,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n if (options?.direction === 'x') {\n const x = element.getGraphicAttribute('x', false);\n const x1 = element.getGraphicAttribute('x1', false);\n let overallValue: number;\n if (options?.orient === 'negative') {\n if (isNumber(options?.overall)) {\n overallValue = options.overall;\n } else if (animationParameters.group) {\n overallValue = (animationParameters as any).groupWidth ?? animationParameters.group.getBounds().width();\n\n (animationParameters as any).groupWidth = overallValue;\n } else {\n overallValue = animationParameters.width;\n }\n } else {\n overallValue = isNumber(options?.overall) ? options?.overall : 0;\n }\n return {\n from: { x: overallValue, x1: overallValue },\n to: { x: x, y1: x1 }\n };\n }\n\n const y = element.getGraphicAttribute('y', false);\n const y1 = element.getGraphicAttribute('y1', false);\n let overallValue: number;\n if (options?.orient === 'negative') {\n if (isNumber(options?.overall)) {\n overallValue = options?.overall;\n } else if (animationParameters.group) {\n overallValue = (animationParameters as any).groupHeight ?? animationParameters.group.getBounds().height();\n\n (animationParameters as any).groupHeight = overallValue;\n } else {\n overallValue = animationParameters.height;\n }\n } else {\n overallValue = isNumber(options?.overall) ? options?.overall : 0;\n }\n return {\n from: { y: overallValue, y1: overallValue },\n to: { y: y, y1: y1 }\n };\n}\n\nexport const growIntervalIn: TypeAnimation<IElement> = (\n element: IElement,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const coord = element.mark?.coord?.output();\n const isTransposed = coord.isTransposed();\n const isPolar = coord.type === 'polar';\n const newOptions: IGrowCartesianAnimationOptions = {\n orient: 'negative',\n direction: isTransposed && !isPolar ? 'x' : 'y'\n };\n\n return options?.overall !== true\n ? growIntervalInIndividual(element, newOptions, animationParameters)\n : growIntervalInOverall(element, newOptions, animationParameters);\n};\n\nfunction growIntervalOutIndividual(\n element: IElement,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n if (options.direction === 'x') {\n const x = element.getGraphicAttribute('x', false);\n const x1 = element.getGraphicAttribute('x1', false);\n const prevX = element.getGraphicAttribute('x', true);\n const prevX1 = element.getGraphicAttribute('x1', true);\n if (options?.orient === 'negative') {\n return {\n from: { x: prevX, x1: prevX1 },\n to: { x: x1, x1: x1 }\n };\n }\n return {\n from: { x: prevX, x1: prevX1 },\n to: { x: x, x1: x }\n };\n }\n\n const y = element.getGraphicAttribute('y', false);\n const y1 = element.getGraphicAttribute('y1', false);\n const prevY = element.getGraphicAttribute('y', true);\n const prevY1 = element.getGraphicAttribute('y1', true);\n if (options?.orient === 'negative') {\n return {\n from: { y: prevY, y1: prevY1 },\n to: { y: y1, y1: y1 }\n };\n }\n return {\n from: { y: prevY, y1: prevY1 },\n to: { y: y, y1: y }\n };\n}\n\nfunction growIntervalOutOverall(\n element: IElement,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n if (options?.direction === 'x') {\n const prevX = element.getGraphicAttribute('x', true);\n const prevX1 = element.getGraphicAttribute('x1', true);\n let overallValue: number;\n if (options?.orient === 'negative') {\n if (isNumber(options?.overall)) {\n overallValue = options.overall;\n } else if (animationParameters.group) {\n overallValue = (animationParameters as any).groupWidth ?? animationParameters.group.getBounds().width();\n\n (animationParameters as any).groupWidth = overallValue;\n } else {\n overallValue = animationParameters.width;\n }\n } else {\n overallValue = isNumber(options?.overall) ? options?.overall : 0;\n }\n return {\n from: { x: prevX, x1: prevX1 },\n to: { x: overallValue, x1: overallValue }\n };\n }\n\n const prevY = element.getGraphicAttribute('y', true);\n const prevY1 = element.getGraphicAttribute('y1', true);\n let overallValue: number;\n if (options?.orient === 'negative') {\n if (isNumber(options?.overall)) {\n overallValue = options?.overall;\n } else if (animationParameters.group) {\n overallValue = (animationParameters as any).groupHeight ?? animationParameters.group.getBounds().height();\n\n (animationParameters as any).groupHeight = overallValue;\n } else {\n overallValue = animationParameters.height;\n }\n } else {\n overallValue = isNumber(options?.overall) ? options?.overall : 0;\n }\n return {\n from: { y: prevY, y1: prevY1 },\n to: { y: overallValue, y1: overallValue }\n };\n}\n\nexport const growIntervalOut: TypeAnimation<IElement> = (\n element: IElement,\n options: Pick<IGrowCartesianAnimationOptions, 'overall'>,\n animationParameters: IAnimationParameters\n) => {\n const coord = element.mark?.coord?.output();\n const isTransposed = coord.isTransposed();\n const isPolar = coord.type === 'polar';\n const newOptions: IGrowCartesianAnimationOptions = {\n orient: 'negative',\n direction: isTransposed && !isPolar ? 'x' : 'y'\n };\n\n return options?.overall !== true\n ? growIntervalOutIndividual(element, newOptions, animationParameters)\n : growIntervalOutOverall(element, newOptions, animationParameters);\n};\n"]}
|
|
@@ -37,9 +37,11 @@ const growPointsOut = (element, options, animationParameters) => ({
|
|
|
37
37
|
exports.growPointsOut = growPointsOut;
|
|
38
38
|
|
|
39
39
|
const changePointsX = (element, options, animationParameters) => element.getGraphicAttribute("points", !1).map((point => {
|
|
40
|
+
var _a;
|
|
40
41
|
if ("negative" === (null == options ? void 0 : options.orient)) {
|
|
41
|
-
|
|
42
|
-
return
|
|
42
|
+
let groupRight = animationParameters.width;
|
|
43
|
+
return animationParameters.group && (groupRight = null !== (_a = animationParameters.groupWidth) && void 0 !== _a ? _a : animationParameters.group.getBounds().width(),
|
|
44
|
+
animationParameters.groupWidth = groupRight), {
|
|
43
45
|
x: groupRight,
|
|
44
46
|
y: point.y,
|
|
45
47
|
x1: groupRight,
|
|
@@ -77,9 +79,11 @@ const growPointsXOut = (element, options, animationParameters) => ({
|
|
|
77
79
|
exports.growPointsXOut = growPointsXOut;
|
|
78
80
|
|
|
79
81
|
const changePointsY = (element, options, animationParameters) => element.getGraphicAttribute("points", !1).map((point => {
|
|
82
|
+
var _a;
|
|
80
83
|
if ("negative" === (null == options ? void 0 : options.orient)) {
|
|
81
|
-
|
|
82
|
-
return
|
|
84
|
+
let groupBottom = animationParameters.height;
|
|
85
|
+
return animationParameters.group && (groupBottom = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : animationParameters.group.getBounds().height(),
|
|
86
|
+
animationParameters.groupHeight = groupBottom), {
|
|
83
87
|
x: point.x,
|
|
84
88
|
y: groupBottom,
|
|
85
89
|
x1: point.x1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graph/animation/animation/grow-points.ts"],"names":[],"mappings":";;;AAEA,6CAAiD;AASjD,MAAM,eAAe,GAAG,C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YACL,OAAO,EAAE,KAAK,CAAC,OAAO,KAAK,KAAK;SACnB,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEK,MAAM,aAAa,GAA4B,CACpD,OAAiB,EACjB,OAAoC,EACpC,mBAAyC,EACzC,EAAE;IACF,OAAO;QACL,IAAI,EAAE,EAAE,MAAM,EAAE,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,mBAAmB,CAAC,EAAE;QACtE,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE;KAC7D,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,aAAa,iBASxB;AAEK,MAAM,cAAc,GAA4B,CACrD,OAAiB,EACjB,OAAoC,EACpC,mBAAyC,EACzC,EAAE;IACF,OAAO;QACL,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE;QAC7D,EAAE,EAAE,EAAE,MAAM,EAAE,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,mBAAmB,CAAC,EAAE;KACrE,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,cAAc,kBASzB","file":"grow-points.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { isValidNumber } from '@visactor/vutils';\nimport type {\n IElement,\n IGrowPointsOverallAnimationOptions,\n IAnimationParameters,\n IGrowPointsAnimationOptions,\n TypeAnimation\n} from '../../../types';\n\nconst getCenterPoints = (\n element: IElement,\n options: IGrowPointsOverallAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const points: IPointLike[] = element.getGraphicAttribute('points', false);\n const center: IPointLike = { x: 0, y: 0 };\n points.forEach(point => {\n center.x += point.x;\n center.y += point.y;\n });\n center.x /= points.length;\n center.y /= points.length;\n\n if (options?.center) {\n if (isValidNumber(options.center.x)) {\n center.x = options.center.x;\n }\n if (isValidNumber(options.center.y)) {\n center.y = options.center.y;\n }\n }\n\n return points.map(() => Object.assign(center));\n};\n\nexport const growPointsIn: TypeAnimation<IElement> = (\n element: IElement,\n options: IGrowPointsOverallAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n return {\n from: { points: getCenterPoints(element, options, animationParameters) },\n to: { points: element.getGraphicAttribute('points', false) }\n };\n};\n\nexport const growPointsOut: TypeAnimation<IElement> = (\n element: IElement,\n options: IGrowPointsOverallAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n return {\n from: { points: element.getGraphicAttribute('points', true) },\n to: { points: getCenterPoints(element, options, animationParameters) }\n };\n};\n\n// grow points x\n\nconst changePointsX = (\n element: IElement,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const points = element.getGraphicAttribute('points', false);\n return points.map((point: IPointLike) => {\n if (options?.orient === 'negative') {\n let groupRight = animationParameters.width;\n\n if (animationParameters.group) {\n groupRight = (animationParameters as any).groupWidth ?? animationParameters.group.getBounds().width();\n\n (animationParameters as any).groupWidth = groupRight;\n }\n\n return {\n x: groupRight,\n y: point.y,\n x1: groupRight,\n y1: point.y1,\n defined: point.defined !== false\n } as IPointLike;\n }\n return {\n x: 0,\n y: point.y,\n x1: 0,\n y1: point.y1,\n defined: point.defined !== false\n } as IPointLike;\n });\n};\n\nexport const growPointsXIn: TypeAnimation<IElement> = (\n element: IElement,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n return {\n from: { points: changePointsX(element, options, animationParameters) },\n to: { points: element.getGraphicAttribute('points', false) }\n };\n};\n\nexport const growPointsXOut: TypeAnimation<IElement> = (\n element: IElement,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n return {\n from: { points: element.getGraphicAttribute('points', true) },\n to: { points: changePointsX(element, options, animationParameters) }\n };\n};\n\n// grow points y\n\nconst changePointsY = (\n element: IElement,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const points = element.getGraphicAttribute('points', false);\n return points.map((point: IPointLike) => {\n if (options?.orient === 'negative') {\n let groupBottom = animationParameters.height;\n\n if (animationParameters.group) {\n groupBottom = (animationParameters as any).groupHeight ?? animationParameters.group.getBounds().height();\n\n (animationParameters as any).groupHeight = groupBottom;\n }\n\n return {\n x: point.x,\n y: groupBottom,\n x1: point.x1,\n y1: groupBottom,\n defined: point.defined !== false\n } as IPointLike;\n }\n return {\n x: point.x,\n y: 0,\n x1: point.x1,\n y1: 0,\n defined: point.defined !== false\n } as IPointLike;\n });\n};\n\nexport const growPointsYIn: TypeAnimation<IElement> = (\n element: IElement,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n return {\n from: { points: changePointsY(element, options, animationParameters) },\n to: { points: element.getGraphicAttribute('points', false) }\n };\n};\n\nexport const growPointsYOut: TypeAnimation<IElement> = (\n element: IElement,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n return {\n from: { points: element.getGraphicAttribute('points', true) },\n to: { points: changePointsY(element, options, animationParameters) }\n };\n};\n"]}
|
|
@@ -6,8 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
|
|
7
7
|
const vutils_1 = require("@visactor/vutils"), moveIn = (element, options, animationParameters) => {
|
|
8
8
|
var _a, _b, _c;
|
|
9
|
-
const offset = null !== (_a = null == options ? void 0 : options.offset) && void 0 !== _a ? _a : 0
|
|
10
|
-
|
|
9
|
+
const offset = null !== (_a = null == options ? void 0 : options.offset) && void 0 !== _a ? _a : 0;
|
|
10
|
+
let changedX = 0, changedY = 0;
|
|
11
|
+
"negative" === (null == options ? void 0 : options.orient) && (animationParameters.group ? (changedX = null !== (_b = animationParameters.groupWidth) && void 0 !== _b ? _b : animationParameters.group.getBounds().width(),
|
|
12
|
+
changedY = null !== (_c = animationParameters.groupHeight) && void 0 !== _c ? _c : animationParameters.group.getBounds().height(),
|
|
13
|
+
animationParameters.groupWidth = changedX, animationParameters.groupHeight = changedY) : (changedX = animationParameters.width,
|
|
14
|
+
changedY = animationParameters.height)), changedX += offset, changedY += offset;
|
|
15
|
+
const point = (0, vutils_1.isFunction)(null == options ? void 0 : options.point) ? options.point.call(null, element.getDatum(), element, animationParameters) : null == options ? void 0 : options.point, fromX = (0,
|
|
11
16
|
vutils_1.isValidNumber)(null == point ? void 0 : point.x) ? point.x : changedX, fromY = (0,
|
|
12
17
|
vutils_1.isValidNumber)(null == point ? void 0 : point.y) ? point.y : changedY;
|
|
13
18
|
switch (null == options ? void 0 : options.direction) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graph/animation/animation/move.ts"],"names":[],"mappings":";;;AAAA,6CAA6D;AAMtD,MAAM,MAAM,GAA4B,CAC7C,OAAiB,EACjB,OAA8B,EAC9B,mBAAyC,EACzC,EAAE;;IACF,MAAM,MAAM,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,mCAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"sources":["../src/graph/animation/animation/move.ts"],"names":[],"mappings":";;;AAAA,6CAA6D;AAMtD,MAAM,MAAM,GAA4B,CAC7C,OAAiB,EACjB,OAA8B,EAC9B,mBAAyC,EACzC,EAAE;;IACF,MAAM,MAAM,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,mCAAI,CAAC,CAAC;IACpC,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,QAAQ,GAAG,CAAC,CAAC;IAEjB,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,MAAK,UAAU,EAAE;QAElC,IAAI,mBAAmB,CAAC,KAAK,EAAE;YAC7B,QAAQ,GAAG,MAAC,mBAA2B,CAAC,UAAU,mCAAI,mBAAmB,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC;YACpG,QAAQ,GAAG,MAAC,mBAA2B,CAAC,WAAW,mCAAI,m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mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC;oBACzC,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC;iBAC1C;gBACD,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;aAC3B,CAAC;KACL;AACH,CAAC,CAAC;AAvCW,QAAA,OAAO,WAuClB","file":"move.js","sourcesContent":["import { isFunction, isValidNumber } from '@visactor/vutils';\nimport type { IElement, IMoveAnimationOptions, IAnimationParameters, TypeAnimation } from '../../../types';\n\n// When user did not provide proper x/y value, move animation will never work properly,\n// due to that, default x/y value won't be set.\n\nexport const moveIn: TypeAnimation<IElement> = (\n element: IElement,\n options: IMoveAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const offset = options?.offset ?? 0;\n let changedX = 0;\n let changedY = 0;\n\n if (options?.orient === 'negative') {\n // consider the offset of group\n if (animationParameters.group) {\n changedX = (animationParameters as any).groupWidth ?? animationParameters.group.getBounds().width();\n changedY = (animationParameters as any).groupHeight ?? animationParameters.group.getBounds().height();\n\n (animationParameters as any).groupWidth = changedX;\n (animationParameters as any).groupHeight = changedY;\n } else {\n changedX = animationParameters.width;\n changedY = animationParameters.height;\n }\n }\n\n changedX += offset;\n changedY += offset;\n const point = isFunction(options?.point)\n ? options.point.call(null, element.getDatum(), element, animationParameters)\n : options?.point;\n const fromX = isValidNumber(point?.x) ? point.x : changedX;\n const fromY = isValidNumber(point?.y) ? point.y : changedY;\n switch (options?.direction) {\n case 'x':\n return {\n from: { x: fromX },\n to: { x: element.getGraphicAttribute('x', false) }\n };\n case 'y':\n return {\n from: { y: fromY },\n to: { y: element.getGraphicAttribute('y', false) }\n };\n case 'xy':\n default:\n return {\n from: { x: fromX, y: fromY },\n to: {\n x: element.getGraphicAttribute('x', false),\n y: element.getGraphicAttribute('y', false)\n }\n };\n }\n};\n\nexport const moveOut: TypeAnimation<IElement> = (\n element: IElement,\n options: IMoveAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const offset = options?.offset ?? 0;\n // consider the offset of group\n const groupBounds = animationParameters.group ? animationParameters.group.getBounds() : null;\n const groupWidth = groupBounds?.width() ?? animationParameters.width;\n const groupHeight = groupBounds?.height() ?? animationParameters.height;\n const changedX = (options?.orient === 'negative' ? groupWidth : 0) + offset;\n const changedY = (options?.orient === 'negative' ? groupHeight : 0) + offset;\n const point = isFunction(options?.point)\n ? options.point.call(null, element.getDatum(), element, animationParameters)\n : options?.point;\n const fromX = isValidNumber(point?.x) ? point.x : changedX;\n const fromY = isValidNumber(point?.y) ? point.y : changedY;\n\n switch (options?.direction) {\n case 'x':\n return {\n from: { x: element.getGraphicAttribute('x', true) },\n to: { x: fromX }\n };\n case 'y':\n return {\n from: { y: element.getGraphicAttribute('y', true) },\n to: { y: fromY }\n };\n case 'xy':\n default:\n return {\n from: {\n x: element.getGraphicAttribute('x', true),\n y: element.getGraphicAttribute('y', true)\n },\n to: { x: fromX, y: fromY }\n };\n }\n};\n"]}
|
package/cjs/graph/element.d.ts
CHANGED
|
@@ -29,10 +29,10 @@ export declare class Element implements IElement {
|
|
|
29
29
|
clearStates(hasAnimation?: boolean): void;
|
|
30
30
|
private _updateRuntimeStates;
|
|
31
31
|
hasState(state: string): boolean;
|
|
32
|
-
addState(state: string | string[], attrs?: BaseSignleEncodeSpec):
|
|
33
|
-
removeState(state: string | string[]):
|
|
32
|
+
addState(state: string | string[], attrs?: BaseSignleEncodeSpec): boolean;
|
|
33
|
+
removeState(state: string | string[]): boolean;
|
|
34
34
|
protected getStateAttrs: (stateName: string, nextStates: string[]) => any;
|
|
35
|
-
useStates(states: string[], hasAnimation?: boolean):
|
|
35
|
+
useStates(states: string[], hasAnimation?: boolean): boolean;
|
|
36
36
|
protected diffAttributes(graphicAttributes: {
|
|
37
37
|
[channel: string]: any;
|
|
38
38
|
}): {};
|
package/cjs/graph/element.js
CHANGED
|
@@ -61,7 +61,7 @@ class Element {
|
|
|
61
61
|
return null === (_a = this.graphicItem) || void 0 === _a ? void 0 : _a.AABBBounds;
|
|
62
62
|
}
|
|
63
63
|
getStates() {
|
|
64
|
-
return this.states
|
|
64
|
+
return this.states;
|
|
65
65
|
}
|
|
66
66
|
updateData(groupKey, data, key) {
|
|
67
67
|
var _a;
|
|
@@ -134,35 +134,41 @@ class Element {
|
|
|
134
134
|
this.runtimeStatesEncoder || (this.runtimeStatesEncoder = {}), this.runtimeStatesEncoder[state] = attrs;
|
|
135
135
|
}
|
|
136
136
|
hasState(state) {
|
|
137
|
-
return this.states && this.states.includes(state);
|
|
137
|
+
return this.states && state && this.states.includes(state);
|
|
138
138
|
}
|
|
139
139
|
addState(state, attrs) {
|
|
140
140
|
var _a;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
if (!this.graphicItem) return !1;
|
|
142
|
+
if (attrs && (0, vutils_1.isString)(state) && !(0, vutils_1.isEqual)(attrs, null === (_a = this.runtimeStatesEncoder) || void 0 === _a ? void 0 : _a[state])) {
|
|
143
|
+
const nextStates = this.states.slice();
|
|
144
|
+
return nextStates.includes(state) ? this.graphicItem.clearStates() : nextStates.push(state),
|
|
145
|
+
this._updateRuntimeStates(state, attrs), this.useStates(nextStates), !0;
|
|
146
|
+
}
|
|
147
|
+
const encode = this.mark.getSpec().encode, nextStates = (0, vutils_1.array)(state).reduce(((nextStates, stateName) => (stateName && !nextStates.includes(stateName) && (null == encode ? void 0 : encode[stateName]) && nextStates.push(stateName),
|
|
148
|
+
nextStates)), this.states.slice());
|
|
149
|
+
return nextStates.length !== this.states.length && (this.useStates(nextStates),
|
|
150
|
+
!0);
|
|
146
151
|
}
|
|
147
152
|
removeState(state) {
|
|
153
|
+
if (!this.graphicItem) return !1;
|
|
148
154
|
const states = (0, vutils_1.array)(state), nextStates = this.states.filter((state => !states.includes(state)));
|
|
149
|
-
nextStates.length !== this.states.length && (this.runtimeStatesEncoder && states.forEach((state => {
|
|
155
|
+
return nextStates.length !== this.states.length && (this.runtimeStatesEncoder && states.forEach((state => {
|
|
150
156
|
this.runtimeStatesEncoder[state] = null;
|
|
151
|
-
})), this.useStates(nextStates));
|
|
157
|
+
})), this.useStates(nextStates), !0);
|
|
152
158
|
}
|
|
153
159
|
useStates(states, hasAnimation) {
|
|
154
160
|
var _a;
|
|
155
|
-
if (!this.graphicItem) return;
|
|
161
|
+
if (!this.graphicItem) return !1;
|
|
156
162
|
this.mark.emit(enums_1.HOOK_EVENT.BEFORE_ELEMENT_STATE, {
|
|
157
163
|
states: states
|
|
158
|
-
}, this)
|
|
164
|
+
}, this);
|
|
159
165
|
const stateSort = null === (_a = this.mark.getSpec()) || void 0 === _a ? void 0 : _a.stateSort;
|
|
160
|
-
stateSort &&
|
|
166
|
+
stateSort && states.sort(stateSort), this.states = states;
|
|
161
167
|
const stateAnimationEnable = (0, vutils_1.isBoolean)(hasAnimation) ? hasAnimation : 0 !== this.mark.animate.getAnimationConfigs("state").length;
|
|
162
|
-
this.graphicItem.stateProxy = this.getStateAttrs, this.graphicItem.useStates(this.states, stateAnimationEnable),
|
|
168
|
+
return this.graphicItem.stateProxy = this.getStateAttrs, this.graphicItem.useStates(this.states, stateAnimationEnable),
|
|
163
169
|
this.mark.emit(enums_1.HOOK_EVENT.AFTER_ELEMENT_STATE, {
|
|
164
170
|
states: states
|
|
165
|
-
}, this);
|
|
171
|
+
}, this), !0;
|
|
166
172
|
}
|
|
167
173
|
diffAttributes(graphicAttributes) {
|
|
168
174
|
const diffResult = {}, finalGraphicAttributes = this.getFinalGraphicAttributes();
|
package/cjs/graph/element.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graph/element.ts"],"names":[],"mappings":";;;AAEA,6CAW0B;AAC1B,2DAAkD;AAElD,2CAA+C;AAC/C,mCAAqF;AACrF,0CAAqD;AACrD,4CAAmD;AACnD,sDAA6D;AAC7D,kDAM8B;AAC9B,4CAAoH;AAgBpH,yDAAsD;AACt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AAC,CAAC;gBACnD,CAAC,CAAC,CAAC;aACJ;SACF;aAAM;YACL,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;SACpD;IACH,CAAC;IAID,OAAO;;QACL,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,KAAK,mCAAI,EAAE,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,KAAK,0CAAG,CAAC,CAAC,CAAC;IAC3E,CAAC;IACD,QAAQ;;QACN,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,IAAI,mCAAI,EAAE,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,IAAI,0CAAG,CAAC,CAAC,CAAC;IACzE,CAAC;CACF;AAtpBD,0BAspBC","file":"element.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport {\n array,\n has,\n isBoolean,\n isNil,\n isFunction,\n isString,\n isArray,\n get,\n isEmpty,\n isEqual as isObjEqual\n} from '@visactor/vutils';\nimport { isEqual } from '@visactor/vgrammar-util';\nimport type { IBaseCoordinate } from '@visactor/vgrammar-coordinate';\nimport { BridgeElementKey } from './constants';\nimport { DiffState, HOOK_EVENT, GrammarMarkType, BuiltInEncodeNames } from './enums';\nimport { invokeEncoderToItems } from './mark/encode';\nimport { removeGraphicItem } from './util/graphic';\nimport { transformAttributes } from './attributes/transform';\nimport {\n getLargeRectsPoints,\n getLargeSymbolsPoints,\n getLinePoints,\n isValidPointsChannel,\n isPointsMarkType\n} from './attributes/helpers';\nimport { getLineSegmentConfigs, getLinePointsFromSegments, parseCollectionMarkAttributes } from './attributes/line';\nimport type {\n BaseEncodeSpec,\n BaseSignleEncodeSpec,\n IElement,\n IMark,\n IMarkConfig,\n MarkElementItem,\n MarkFunctionType,\n MarkKeySpec,\n MarkSpec,\n MarkType,\n StateProxyEncodeSpec\n} from '../types';\nimport type { IGraphic, ILine, IGraphicAttribute } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { CustomPath2D } from '@visactor/vrender-core';\nimport { invokeFunctionType, parseField } from '../parse/util';\n\nexport class Element implements IElement {\n mark: IMark;\n\n key: string;\n groupKey?: string;\n data: any[] = null;\n\n states: string[] = [];\n\n diffState: DiffState = DiffState.enter;\n // Element should be reserved as long as it need to animate\n isReserved: boolean = false;\n\n runtimeStatesEncoder: BaseEncodeSpec = null;\n\n protected graphicItem: IGraphic;\n\n // hack before vRender refactoring\n items: MarkElementItem[] = [];\n\n constructor(mark: IMark) {\n this.mark = mark;\n }\n\n initGraphicItem(attributes: any = {}) {\n if (this.graphicItem) {\n return;\n }\n // 统一读取mark中是否可交互的配置\n const attrTransforms = this.mark.getAttributeTransforms();\n\n this.graphicItem = this.mark.addGraphicItem(attrTransforms ? {} : attributes, this.groupKey);\n\n if (!this.graphicItem) {\n return;\n }\n // 统一读取mark中是否可交互的配置\n this.graphicItem[BridgeElementKey] = this;\n\n if (attrTransforms) {\n this.graphicItem.onBeforeAttributeUpdate = (attributes: any) => {\n // mark might be released\n if (!this.mark) {\n return attributes;\n }\n const graphicAttributes = transformAttributes(attrTransforms, attributes, this);\n return graphicAttributes;\n };\n this.graphicItem.setAttributes(attributes);\n }\n\n // transform initial attributes\n\n this.clearGraphicAttributes();\n if (this.mark.needAnimate()) {\n this.setPrevGraphicAttributes({});\n this.setNextGraphicAttributes(attributes);\n this.setFinalGraphicAttributes(attributes);\n }\n }\n\n updateGraphicItem(config: IMarkConfig) {\n if (!this.graphicItem) {\n return;\n }\n\n if (!isNil(config.clip)) {\n this.graphicItem.setAttribute('clip', config.clip);\n }\n if (!isNil(config.interactive)) {\n this.graphicItem.setAttribute('pickable', config.interactive);\n }\n if (!isNil(config.zIndex)) {\n this.graphicItem.setAttribute('zIndex', config.zIndex);\n }\n if (this.diffState === DiffState.exit) {\n (this.graphicItem as any).releaseStatus = 'willRelease';\n } else {\n (this.graphicItem as any).releaseStatus = undefined;\n }\n\n const stateAnimation = this.mark.animate.getAnimationConfigs('state');\n if (stateAnimation.length !== 0) {\n (this.graphicItem as any).stateAnimateConfig = stateAnimation[0].originConfig;\n }\n }\n\n getGraphicItem() {\n return this.graphicItem;\n }\n\n removeGraphicItem() {\n // stop all animation when releasing including normal animation & morphing animation\n if (this.graphicItem) {\n this.graphicItem.animates?.forEach?.(animate => animate.stop());\n }\n\n if (this.graphicItem) {\n removeGraphicItem(this.graphicItem);\n this.graphicItem[BridgeElementKey] = null;\n this.graphicItem = null;\n }\n }\n\n resetGraphicItem() {\n if (this.graphicItem) {\n this.graphicItem = null;\n }\n }\n\n getBounds() {\n // FIXME: 没有更新 bounds 时拿到的 bound 可能为 null\n return this.graphicItem?.AABBBounds;\n }\n\n getStates() {\n return this.states.slice();\n }\n\n updateData(groupKey: string | null, data: any[], key: MarkKeySpec) {\n this.mark.emit(HOOK_EVENT.BEFORE_ELEMENT_UPDATE_DATA, { groupKey, data, key }, this);\n this.data = data;\n const keyGetter = parseField(key);\n this.items = data.map(datum => {\n const key = keyGetter(datum);\n const item = {\n datum,\n key,\n view: this.mark.view,\n nextAttrs: {}\n };\n\n return item;\n });\n\n this.groupKey = groupKey;\n this.key = this.mark.isCollectionMark() ? groupKey : this.items?.[0].key;\n\n this.mark.emit(HOOK_EVENT.AFTER_ELEMENT_UPDATE_DATA, { groupKey, data, key }, this);\n return this.items;\n }\n\n state(markState: MarkFunctionType<string | string[]>, parameters?: any) {\n const isCollectionMark = this.mark.isCollectionMark();\n\n const prevStateValues = this.states;\n const newStateValues = array(invokeFunctionType(markState, parameters, this.getDatum(), this));\n const stateSort = this.mark.getSpec()?.stateSort;\n\n if (stateSort) {\n stateSort.sort(stateSort);\n }\n\n const isStateChanged =\n newStateValues.length !== prevStateValues.length ||\n newStateValues.some((newState: string, index: number) => newState !== prevStateValues[index]);\n this.states = newStateValues;\n\n // early logic didn't handle collection mark, only update signal mark state for now\n if (!isCollectionMark && isStateChanged && this.diffState === DiffState.unChange) {\n this.diffState = DiffState.update;\n }\n }\n\n encodeGraphic(attrs?: any) {\n this.coordinateTransformEncode(this.items);\n\n const graphicAttributes = this.transformElementItems(this.items, this.mark.markType);\n\n if (attrs) {\n Object.assign(graphicAttributes, attrs);\n }\n\n if (!this.graphicItem) {\n this.initGraphicItem(graphicAttributes);\n } else {\n this.graphicItem.clearStates();\n // 更新数据流后,states计算不缓存\n this.graphicItem.states = {};\n this.graphicItem.stateProxy = null;\n\n this.applyGraphicAttributes(graphicAttributes);\n }\n\n if ((this.diffState === DiffState.enter || this.diffState === DiffState.update) && this.states.length) {\n this.useStates(this.states);\n }\n\n if (this.mark.markType === GrammarMarkType.shape) {\n // FIXME: shape需要拿到原始数据进行编码,暂时把数据绑定到graphicItem上,看后续graphicItem是否需要支持数据绑定\n (this.graphicItem as any).datum = this.items[0].datum;\n }\n\n // clear item attributes\n this.items.forEach(item => {\n item.nextAttrs = {};\n });\n this._setCustomizedShape();\n }\n\n private _setCustomizedShape() {\n if (!this.graphicItem) {\n return;\n }\n const setCustomizedShape = this.mark.getSpec()?.setCustomizedShape;\n\n if (!setCustomizedShape) {\n return;\n }\n\n this.graphicItem.pathProxy = (attrs: Partial<IGraphicAttribute>) => {\n return setCustomizedShape(this.data, attrs, new CustomPath2D());\n };\n }\n\n encodeItems(items: MarkElementItem[], encoders: BaseEncodeSpec, isReentered: boolean = false, parameters?: any) {\n const isCollectionMark = this.mark.isCollectionMark();\n // marshall encoder functions\n const updateEncoder = encoders[BuiltInEncodeNames.update];\n const enterEncoder = encoders[BuiltInEncodeNames.enter];\n const exitEncoder = encoders[BuiltInEncodeNames.exit];\n const onlyFullEncodeFirst = this.mark.isLargeMode() || (isCollectionMark && !this.mark.getSpec().enableSegments);\n\n if (this.diffState === DiffState.enter) {\n if (enterEncoder) {\n invokeEncoderToItems(this, items, enterEncoder, parameters, onlyFullEncodeFirst);\n }\n if (updateEncoder) {\n invokeEncoderToItems(this, items, updateEncoder, parameters, onlyFullEncodeFirst);\n }\n } else if (this.diffState === DiffState.update) {\n // if mark is reentered or mark is collection type, evaluate enter encode\n if ((isCollectionMark && enterEncoder) || isReentered) {\n invokeEncoderToItems(this, items, enterEncoder, parameters, onlyFullEncodeFirst);\n }\n if (updateEncoder) {\n invokeEncoderToItems(this, items, updateEncoder, parameters, onlyFullEncodeFirst);\n }\n } else if (this.diffState === DiffState.exit && exitEncoder) {\n // if mark is reentered, evaluate enter encode\n if (isReentered) {\n invokeEncoderToItems(this, items, enterEncoder, parameters, onlyFullEncodeFirst);\n }\n invokeEncoderToItems(this, items, exitEncoder, parameters, onlyFullEncodeFirst);\n }\n }\n\n protected coordinateTransformEncode(items: MarkElementItem[]) {\n if (!this.mark.coord || this.mark.markType === 'arc' || this.mark.disableCoordinateTransform === true) {\n return;\n }\n const coord = this.mark.coord.output() as IBaseCoordinate;\n\n items.forEach(item => {\n const nextAttrs = item.nextAttrs;\n const convertedPoint: IPointLike = coord.convert(nextAttrs);\n Object.assign(nextAttrs, convertedPoint);\n });\n }\n\n clearStates(hasAnimation?: boolean) {\n const stateAnimationEnable = isBoolean(hasAnimation)\n ? hasAnimation\n : this.mark.animate.getAnimationConfigs('state').length !== 0;\n\n this.states = [];\n\n if (this.graphicItem) {\n this.graphicItem.clearStates(stateAnimationEnable);\n }\n\n if (this.runtimeStatesEncoder) {\n this.runtimeStatesEncoder = {};\n }\n }\n\n private _updateRuntimeStates(state: string, attrs: any) {\n if (!this.runtimeStatesEncoder) {\n this.runtimeStatesEncoder = {};\n }\n\n this.runtimeStatesEncoder[state] = attrs;\n }\n\n hasState(state: string) {\n return this.states && this.states.includes(state);\n }\n\n addState(state: string | string[], attrs?: BaseSignleEncodeSpec) {\n const states = array(state);\n const nextStates = states.reduce((nextStates: string[], state: string) => {\n if (!nextStates.includes(state)) {\n nextStates.push(state);\n }\n return nextStates;\n }, this.states.slice());\n\n const isRuntimeStateUpdate = attrs && isString(state) && !isObjEqual(attrs, this.runtimeStatesEncoder?.[state]);\n if (isRuntimeStateUpdate) {\n this._updateRuntimeStates(state, attrs);\n }\n\n if (nextStates.length === this.states.length) {\n if (isRuntimeStateUpdate && this.graphicItem) {\n this.graphicItem.clearStates();\n this.useStates(nextStates);\n }\n\n return;\n }\n\n this.useStates(nextStates);\n }\n\n removeState(state: string | string[]) {\n const states = array(state);\n const nextStates = this.states.filter(state => !states.includes(state));\n if (nextStates.length === this.states.length) {\n return;\n }\n\n if (this.runtimeStatesEncoder) {\n states.forEach(state => {\n this.runtimeStatesEncoder[state] = null;\n });\n }\n this.useStates(nextStates);\n }\n\n protected getStateAttrs = (stateName: string, nextStates: string[]) => {\n const isRuntimeState = !isNil(this.runtimeStatesEncoder?.[stateName]);\n const encoder = isRuntimeState\n ? this.runtimeStatesEncoder[stateName]\n : (this.mark.getSpec() as MarkSpec).encode?.[stateName];\n\n if (!encoder) {\n return {};\n }\n\n if (isFunction(encoder)) {\n return (encoder as StateProxyEncodeSpec)(this.getDatum(), this, stateName, nextStates);\n }\n\n if (!isRuntimeState && this.graphicItem.states?.[stateName]) {\n return this.graphicItem.states[stateName];\n }\n\n const stateItems = this.items.map(item => Object.assign({}, item, { nextAttrs: {} }));\n // collection图元,暂时不支持在state更新中,支持更新points更新\n invokeEncoderToItems(this, stateItems, encoder, (this.mark as any).parameters());\n\n const graphicAttributes = this.transformElementItems(stateItems, this.mark.markType);\n\n if (!this.graphicItem.states) {\n this.graphicItem.states = { [stateName]: graphicAttributes };\n } else if (!this.graphicItem.states[stateName]) {\n this.graphicItem.states[stateName] = graphicAttributes;\n }\n\n return graphicAttributes;\n };\n\n useStates(states: string[], hasAnimation?: boolean) {\n if (!this.graphicItem) {\n return;\n }\n this.mark.emit(HOOK_EVENT.BEFORE_ELEMENT_STATE, { states }, this);\n\n this.states = states.slice();\n const stateSort = this.mark.getSpec()?.stateSort;\n\n if (stateSort) {\n this.states.sort(stateSort);\n }\n\n const stateAnimationEnable = isBoolean(hasAnimation)\n ? hasAnimation\n : this.mark.animate.getAnimationConfigs('state').length !== 0;\n\n this.graphicItem.stateProxy = this.getStateAttrs;\n this.graphicItem.useStates(this.states, stateAnimationEnable);\n\n this.mark.emit(HOOK_EVENT.AFTER_ELEMENT_STATE, { states }, this);\n }\n\n protected diffAttributes(graphicAttributes: { [channel: string]: any }) {\n const diffResult = {};\n const finalGraphicAttributes = this.getFinalGraphicAttributes();\n for (const key in graphicAttributes) {\n if (!isEqual(key, finalGraphicAttributes, graphicAttributes) || !has(finalGraphicAttributes, key)) {\n diffResult[key] = graphicAttributes[key];\n }\n }\n return diffResult;\n }\n\n /**\n * tranform the attribute to graphic attribute\n * @param items\n * @param markType In ordinary, markType is equal to mark.markType, but in glyph, markType is different from mark.markType\n * @param markName\n * @param computePoints\n * @returns\n */\n transformElementItems(items: MarkElementItem[], markType: MarkType, computePoints?: boolean): Record<string, any> {\n const item = items[0];\n\n if (!item.nextAttrs || Object.keys(item.nextAttrs).length === 0) {\n return {};\n }\n\n let nextAttrs = item?.nextAttrs;\n\n if (\n items &&\n items.length &&\n isNil(item.nextAttrs?.points) &&\n (computePoints === true || isValidPointsChannel(Object.keys(item.nextAttrs), this.mark.markType)) &&\n isPointsMarkType(markType)\n ) {\n const lastPoints = this.getGraphicAttribute('points', false);\n const lastSegments = this.getGraphicAttribute('segments', false);\n const enableSegments = this.mark.getSpec().enableSegments;\n const itemNextAttrs = items.map(item => item.nextAttrs);\n const isProgressive = this.mark.isProgressive();\n nextAttrs = parseCollectionMarkAttributes(nextAttrs);\n\n if (markType === GrammarMarkType.line || markType === GrammarMarkType.area) {\n const linePoints = getLinePoints(items, true, lastPoints, markType === GrammarMarkType.area);\n\n // chartspace新增了配置,用于开启线段解析;渐进渲染状态不支持线段样式\n if (enableSegments && !isProgressive) {\n const points = !linePoints || linePoints.length === 0 ? getLinePointsFromSegments(lastSegments) : linePoints;\n const segments = getLineSegmentConfigs(itemNextAttrs, points, this);\n\n if (segments) {\n nextAttrs.segments = segments;\n nextAttrs.points = null;\n } else {\n nextAttrs.segments = null;\n nextAttrs.points = points;\n }\n } else if (isProgressive) {\n nextAttrs.segments = ((this.graphicItem as ILine)?.attribute?.segments ?? []).concat([\n { points: linePoints }\n ]);\n } else {\n nextAttrs.points = linePoints;\n nextAttrs.segments = null;\n }\n } else if (markType === GrammarMarkType.largeRects) {\n nextAttrs.points = getLargeRectsPoints(items, true, lastPoints);\n } else if (markType === GrammarMarkType.largeSymbols) {\n nextAttrs.points = getLargeSymbolsPoints(items, true, lastPoints);\n }\n }\n\n return nextAttrs;\n }\n\n protected applyGraphicAttributes(graphicAttributes: any) {\n if (isEmpty(graphicAttributes)) {\n return;\n }\n\n if (this.mark.needAnimate()) {\n // If mark need animate, diff attributes.\n const nextGraphicAttributes = this.diffAttributes(graphicAttributes);\n const prevGraphicAttributes = this.getPrevGraphicAttributes();\n\n const finalGraphicAttributes = this.getFinalGraphicAttributes();\n Object.keys(nextGraphicAttributes).forEach(channel => {\n prevGraphicAttributes[channel] = this.getGraphicAttribute(channel);\n finalGraphicAttributes[channel] = nextGraphicAttributes[channel];\n });\n this.setNextGraphicAttributes(nextGraphicAttributes);\n this.setPrevGraphicAttributes(prevGraphicAttributes);\n this.setFinalGraphicAttributes(finalGraphicAttributes);\n\n const currentAnimators = this.mark.animate.getElementAnimators(this);\n const animateGraphicAttributes = currentAnimators.reduce((attributes, animator) => {\n return Object.assign(attributes, animator.getEndAttributes());\n }, {});\n const currentGraphicAttributes = Object.assign({}, animateGraphicAttributes, finalGraphicAttributes);\n\n // Apply next attributes to current graphic item immediately.\n // Scene graph tree should be handled like no animation exists in dataflow procedure.\n this.graphicItem.setAttributes(currentGraphicAttributes);\n } else {\n // Otherwise, directly apply all attributes.\n this.graphicItem.setAttributes(graphicAttributes);\n }\n }\n\n getGraphicAttribute(channel: string, prev: boolean = false) {\n if (!this.graphicItem) {\n return undefined;\n }\n\n if (prev) {\n let value: any;\n const prevGraphicAttributes = this.getPrevGraphicAttributes();\n if (!isNil((value = get(prevGraphicAttributes, channel)))) {\n return value;\n }\n }\n\n // get attribute before transformed\n const trans = this.mark.getAttributeTransforms();\n let getKey: string[] = [channel];\n if (trans && trans.length) {\n const channelTransform = trans.find(entry => {\n return entry.storedAttrs && entry.channels.includes(channel);\n });\n\n if (channelTransform) {\n getKey = [channelTransform.storedAttrs, channel];\n }\n }\n return get(this.graphicItem?.attribute, getKey);\n }\n\n setGraphicAttribute(channel: string, value: any, final: boolean = true) {\n if (!this.graphicItem) {\n return;\n }\n const finalGraphicAttributes = this.getFinalGraphicAttributes();\n const prevGraphicAttributes = this.getPrevGraphicAttributes();\n\n if (final && finalGraphicAttributes) {\n finalGraphicAttributes[channel] = value;\n }\n if (prevGraphicAttributes && !has(prevGraphicAttributes, channel)) {\n prevGraphicAttributes[channel] = this.graphicItem.attribute[channel];\n }\n\n this.graphicItem.setAttribute(channel, value);\n }\n\n setGraphicAttributes(attributes: { [channel: string]: any }, final: boolean = true) {\n if (!this.graphicItem) {\n return;\n }\n const finalGraphicAttributes = this.getFinalGraphicAttributes();\n const prevGraphicAttributes = this.getPrevGraphicAttributes();\n\n Object.keys(attributes).forEach(key => {\n if (finalGraphicAttributes && final) {\n finalGraphicAttributes[key] = attributes[key];\n }\n if (prevGraphicAttributes && !has(prevGraphicAttributes, key)) {\n prevGraphicAttributes[key] = this.graphicItem.attribute[key];\n }\n });\n\n this.graphicItem.setAttributes(attributes);\n }\n\n /**\n * 获取 vRender 已变更的视觉通道属性,只应当由 VGrammar 中 调用\n * @returns 视觉通道键值对\n */\n getFinalGraphicAttributes() {\n return (this.graphicItem as any).finalAttrs;\n }\n\n protected setFinalGraphicAttributes(attributes: { [channel: string]: any }) {\n (this.graphicItem as any).finalAttrs = attributes;\n }\n\n /**\n * 获取 vRender 变更前的视觉通道属性,只应当由 VGrammar 调用\n * @returns 视觉通道键值对\n */\n getPrevGraphicAttributes() {\n return (this.graphicItem as any).prevAttrs;\n }\n\n protected setPrevGraphicAttributes(attributes: { [channel: string]: any }) {\n (this.graphicItem as any).prevAttrs = attributes;\n }\n\n /**\n * 获取 vRender 在单次 dataflow 中变更的视觉通道属性,只应当由 VGrammar 调用\n * @returns 视觉通道键值对\n */\n getNextGraphicAttributes() {\n return (this.graphicItem as any).nextAttrs;\n }\n\n protected setNextGraphicAttributes(attributes: { [channel: string]: any }) {\n (this.graphicItem as any).nextAttrs = attributes;\n }\n\n clearChangedGraphicAttributes() {\n if (this.graphicItem) {\n this.setPrevGraphicAttributes({});\n this.setNextGraphicAttributes({});\n }\n }\n\n clearGraphicAttributes() {\n if (this.graphicItem) {\n this.setPrevGraphicAttributes({});\n this.setNextGraphicAttributes({});\n this.setFinalGraphicAttributes({});\n }\n }\n\n remove() {\n if (this.graphicItem) {\n removeGraphicItem(this.graphicItem);\n this.graphicItem = null;\n }\n }\n\n release() {\n this.removeGraphicItem();\n this.mark = null;\n this.data = null;\n this.items = null;\n }\n /**\n * hack support for transform & encode logic. DO NOT USE.\n */\n getItemAttribute(channel?: string) {\n if (!this.items?.length) {\n return;\n }\n\n if (this.mark.isCollectionMark()) {\n return isNil(channel)\n ? this.items.map(item => item.nextAttrs)\n : this.items.map(item => item.nextAttrs?.[channel]);\n }\n\n return isNil(channel) ? this.items[0].nextAttrs : this.items[0].nextAttrs?.[channel];\n }\n setItemAttributes(attributes: { [channel: string]: any } | any[]) {\n if (!this.items?.length) {\n return;\n }\n\n if (this.mark.isCollectionMark()) {\n if (isArray(attributes)) {\n this.items.forEach((item, index) => {\n Object.assign(item.nextAttrs, attributes[index]);\n });\n }\n } else {\n Object.assign(this.items[0].nextAttrs, attributes);\n }\n }\n /**\n * hack support for transform & encode logic. DO NOT USE.\n */\n getItem() {\n return this.mark.isCollectionMark() ? this.items ?? [] : this.items?.[0];\n }\n getDatum() {\n return this.mark.isCollectionMark() ? this.data ?? [] : this.data?.[0];\n }\n}\n"]}
|
|
1
|
+
{"version":3,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IAAI,0CAAG,CAAC,CAAC,CAAC;IACzE,CAAC;CACF;AAzqBD,0BAyqBC","file":"element.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport {\n array,\n has,\n isBoolean,\n isNil,\n isFunction,\n isString,\n isArray,\n get,\n isEmpty,\n isEqual as isObjEqual\n} from '@visactor/vutils';\nimport { isEqual } from '@visactor/vgrammar-util';\nimport type { IBaseCoordinate } from '@visactor/vgrammar-coordinate';\nimport { BridgeElementKey } from './constants';\nimport { DiffState, HOOK_EVENT, GrammarMarkType, BuiltInEncodeNames } from './enums';\nimport { invokeEncoderToItems } from './mark/encode';\nimport { removeGraphicItem } from './util/graphic';\nimport { transformAttributes } from './attributes/transform';\nimport {\n getLargeRectsPoints,\n getLargeSymbolsPoints,\n getLinePoints,\n isValidPointsChannel,\n isPointsMarkType\n} from './attributes/helpers';\nimport { getLineSegmentConfigs, getLinePointsFromSegments, parseCollectionMarkAttributes } from './attributes/line';\nimport type {\n BaseEncodeSpec,\n BaseSignleEncodeSpec,\n IElement,\n IMark,\n IMarkConfig,\n MarkElementItem,\n MarkFunctionType,\n MarkKeySpec,\n MarkSpec,\n MarkType,\n StateProxyEncodeSpec\n} from '../types';\nimport type { IGraphic, ILine, IGraphicAttribute } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { CustomPath2D } from '@visactor/vrender-core';\nimport { invokeFunctionType, parseField } from '../parse/util';\n\nexport class Element implements IElement {\n mark: IMark;\n\n key: string;\n groupKey?: string;\n data: any[] = null;\n\n states: string[] = [];\n\n diffState: DiffState = DiffState.enter;\n // Element should be reserved as long as it need to animate\n isReserved: boolean = false;\n\n runtimeStatesEncoder: BaseEncodeSpec = null;\n\n protected graphicItem: IGraphic;\n\n // hack before vRender refactoring\n items: MarkElementItem[] = [];\n\n constructor(mark: IMark) {\n this.mark = mark;\n }\n\n initGraphicItem(attributes: any = {}) {\n if (this.graphicItem) {\n return;\n }\n // 统一读取mark中是否可交互的配置\n const attrTransforms = this.mark.getAttributeTransforms();\n\n this.graphicItem = this.mark.addGraphicItem(attrTransforms ? {} : attributes, this.groupKey);\n\n if (!this.graphicItem) {\n return;\n }\n // 统一读取mark中是否可交互的配置\n this.graphicItem[BridgeElementKey] = this;\n\n if (attrTransforms) {\n this.graphicItem.onBeforeAttributeUpdate = (attributes: any) => {\n // mark might be released\n if (!this.mark) {\n return attributes;\n }\n const graphicAttributes = transformAttributes(attrTransforms, attributes, this);\n return graphicAttributes;\n };\n this.graphicItem.setAttributes(attributes);\n }\n\n // transform initial attributes\n\n this.clearGraphicAttributes();\n if (this.mark.needAnimate()) {\n this.setPrevGraphicAttributes({});\n this.setNextGraphicAttributes(attributes);\n this.setFinalGraphicAttributes(attributes);\n }\n }\n\n updateGraphicItem(config: IMarkConfig) {\n if (!this.graphicItem) {\n return;\n }\n\n if (!isNil(config.clip)) {\n this.graphicItem.setAttribute('clip', config.clip);\n }\n if (!isNil(config.interactive)) {\n this.graphicItem.setAttribute('pickable', config.interactive);\n }\n if (!isNil(config.zIndex)) {\n this.graphicItem.setAttribute('zIndex', config.zIndex);\n }\n if (this.diffState === DiffState.exit) {\n (this.graphicItem as any).releaseStatus = 'willRelease';\n } else {\n (this.graphicItem as any).releaseStatus = undefined;\n }\n\n const stateAnimation = this.mark.animate.getAnimationConfigs('state');\n if (stateAnimation.length !== 0) {\n (this.graphicItem as any).stateAnimateConfig = stateAnimation[0].originConfig;\n }\n }\n\n getGraphicItem() {\n return this.graphicItem;\n }\n\n removeGraphicItem() {\n // stop all animation when releasing including normal animation & morphing animation\n if (this.graphicItem) {\n this.graphicItem.animates?.forEach?.(animate => animate.stop());\n }\n\n if (this.graphicItem) {\n removeGraphicItem(this.graphicItem);\n this.graphicItem[BridgeElementKey] = null;\n this.graphicItem = null;\n }\n }\n\n resetGraphicItem() {\n if (this.graphicItem) {\n this.graphicItem = null;\n }\n }\n\n getBounds() {\n // FIXME: 没有更新 bounds 时拿到的 bound 可能为 null\n return this.graphicItem?.AABBBounds;\n }\n\n getStates() {\n return this.states;\n }\n\n updateData(groupKey: string | null, data: any[], key: MarkKeySpec) {\n this.mark.emit(HOOK_EVENT.BEFORE_ELEMENT_UPDATE_DATA, { groupKey, data, key }, this);\n this.data = data;\n const keyGetter = parseField(key);\n this.items = data.map(datum => {\n const key = keyGetter(datum);\n const item = {\n datum,\n key,\n view: this.mark.view,\n nextAttrs: {}\n };\n\n return item;\n });\n\n this.groupKey = groupKey;\n this.key = this.mark.isCollectionMark() ? groupKey : this.items?.[0].key;\n\n this.mark.emit(HOOK_EVENT.AFTER_ELEMENT_UPDATE_DATA, { groupKey, data, key }, this);\n return this.items;\n }\n\n state(markState: MarkFunctionType<string | string[]>, parameters?: any) {\n const isCollectionMark = this.mark.isCollectionMark();\n\n const prevStateValues = this.states;\n const newStateValues = array(invokeFunctionType(markState, parameters, this.getDatum(), this));\n const stateSort = this.mark.getSpec()?.stateSort;\n\n if (stateSort) {\n stateSort.sort(stateSort);\n }\n\n const isStateChanged =\n newStateValues.length !== prevStateValues.length ||\n newStateValues.some((newState: string, index: number) => newState !== prevStateValues[index]);\n this.states = newStateValues;\n\n // early logic didn't handle collection mark, only update signal mark state for now\n if (!isCollectionMark && isStateChanged && this.diffState === DiffState.unChange) {\n this.diffState = DiffState.update;\n }\n }\n\n encodeGraphic(attrs?: any) {\n this.coordinateTransformEncode(this.items);\n\n const graphicAttributes = this.transformElementItems(this.items, this.mark.markType);\n\n if (attrs) {\n Object.assign(graphicAttributes, attrs);\n }\n\n if (!this.graphicItem) {\n this.initGraphicItem(graphicAttributes);\n } else {\n this.graphicItem.clearStates();\n // 更新数据流后,states计算不缓存\n this.graphicItem.states = {};\n this.graphicItem.stateProxy = null;\n\n this.applyGraphicAttributes(graphicAttributes);\n }\n\n if ((this.diffState === DiffState.enter || this.diffState === DiffState.update) && this.states.length) {\n this.useStates(this.states);\n }\n\n if (this.mark.markType === GrammarMarkType.shape) {\n // FIXME: shape需要拿到原始数据进行编码,暂时把数据绑定到graphicItem上,看后续graphicItem是否需要支持数据绑定\n (this.graphicItem as any).datum = this.items[0].datum;\n }\n\n // clear item attributes\n this.items.forEach(item => {\n item.nextAttrs = {};\n });\n this._setCustomizedShape();\n }\n\n private _setCustomizedShape() {\n if (!this.graphicItem) {\n return;\n }\n const setCustomizedShape = this.mark.getSpec()?.setCustomizedShape;\n\n if (!setCustomizedShape) {\n return;\n }\n\n this.graphicItem.pathProxy = (attrs: Partial<IGraphicAttribute>) => {\n return setCustomizedShape(this.data, attrs, new CustomPath2D());\n };\n }\n\n encodeItems(items: MarkElementItem[], encoders: BaseEncodeSpec, isReentered: boolean = false, parameters?: any) {\n const isCollectionMark = this.mark.isCollectionMark();\n // marshall encoder functions\n const updateEncoder = encoders[BuiltInEncodeNames.update];\n const enterEncoder = encoders[BuiltInEncodeNames.enter];\n const exitEncoder = encoders[BuiltInEncodeNames.exit];\n const onlyFullEncodeFirst = this.mark.isLargeMode() || (isCollectionMark && !this.mark.getSpec().enableSegments);\n\n if (this.diffState === DiffState.enter) {\n if (enterEncoder) {\n invokeEncoderToItems(this, items, enterEncoder, parameters, onlyFullEncodeFirst);\n }\n if (updateEncoder) {\n invokeEncoderToItems(this, items, updateEncoder, parameters, onlyFullEncodeFirst);\n }\n } else if (this.diffState === DiffState.update) {\n // if mark is reentered or mark is collection type, evaluate enter encode\n if ((isCollectionMark && enterEncoder) || isReentered) {\n invokeEncoderToItems(this, items, enterEncoder, parameters, onlyFullEncodeFirst);\n }\n if (updateEncoder) {\n invokeEncoderToItems(this, items, updateEncoder, parameters, onlyFullEncodeFirst);\n }\n } else if (this.diffState === DiffState.exit && exitEncoder) {\n // if mark is reentered, evaluate enter encode\n if (isReentered) {\n invokeEncoderToItems(this, items, enterEncoder, parameters, onlyFullEncodeFirst);\n }\n invokeEncoderToItems(this, items, exitEncoder, parameters, onlyFullEncodeFirst);\n }\n }\n\n protected coordinateTransformEncode(items: MarkElementItem[]) {\n if (!this.mark.coord || this.mark.markType === 'arc' || this.mark.disableCoordinateTransform === true) {\n return;\n }\n const coord = this.mark.coord.output() as IBaseCoordinate;\n\n items.forEach(item => {\n const nextAttrs = item.nextAttrs;\n const convertedPoint: IPointLike = coord.convert(nextAttrs);\n Object.assign(nextAttrs, convertedPoint);\n });\n }\n\n clearStates(hasAnimation?: boolean) {\n const stateAnimationEnable = isBoolean(hasAnimation)\n ? hasAnimation\n : this.mark.animate.getAnimationConfigs('state').length !== 0;\n\n this.states = [];\n\n if (this.graphicItem) {\n this.graphicItem.clearStates(stateAnimationEnable);\n }\n\n if (this.runtimeStatesEncoder) {\n this.runtimeStatesEncoder = {};\n }\n }\n\n private _updateRuntimeStates(state: string, attrs: any) {\n if (!this.runtimeStatesEncoder) {\n this.runtimeStatesEncoder = {};\n }\n\n this.runtimeStatesEncoder[state] = attrs;\n }\n\n hasState(state: string) {\n return this.states && state && this.states.includes(state);\n }\n\n addState(state: string | string[], attrs?: BaseSignleEncodeSpec) {\n if (!this.graphicItem) {\n return false;\n }\n\n const isRuntimeStateUpdate = attrs && isString(state) && !isObjEqual(attrs, this.runtimeStatesEncoder?.[state]);\n if (isRuntimeStateUpdate) {\n const nextStates = this.states.slice();\n if (!nextStates.includes(state)) {\n nextStates.push(state);\n } else {\n this.graphicItem.clearStates();\n }\n this._updateRuntimeStates(state, attrs);\n\n this.useStates(nextStates);\n return true;\n }\n\n const encode = (this.mark.getSpec() as MarkSpec).encode;\n const states = array(state);\n const nextStates = states.reduce((nextStates: string[], stateName: string) => {\n if (stateName && !nextStates.includes(stateName) && encode?.[stateName]) {\n nextStates.push(stateName);\n }\n return nextStates;\n }, this.states.slice());\n\n if (nextStates.length !== this.states.length) {\n this.useStates(nextStates);\n\n return true;\n }\n\n return false;\n }\n\n removeState(state: string | string[]) {\n if (!this.graphicItem) {\n return false;\n }\n\n const states = array(state);\n const nextStates = this.states.filter(state => !states.includes(state));\n if (nextStates.length === this.states.length) {\n return false;\n }\n\n if (this.runtimeStatesEncoder) {\n states.forEach(state => {\n this.runtimeStatesEncoder[state] = null;\n });\n }\n this.useStates(nextStates);\n\n return true;\n }\n\n protected getStateAttrs = (stateName: string, nextStates: string[]) => {\n const isRuntimeState = !isNil(this.runtimeStatesEncoder?.[stateName]);\n const encoder = isRuntimeState\n ? this.runtimeStatesEncoder[stateName]\n : (this.mark.getSpec() as MarkSpec).encode?.[stateName];\n\n if (!encoder) {\n return {};\n }\n\n if (isFunction(encoder)) {\n return (encoder as StateProxyEncodeSpec)(this.getDatum(), this, stateName, nextStates);\n }\n\n if (!isRuntimeState && this.graphicItem.states?.[stateName]) {\n return this.graphicItem.states[stateName];\n }\n\n const stateItems = this.items.map(item => Object.assign({}, item, { nextAttrs: {} }));\n // collection图元,暂时不支持在state更新中,支持更新points更新\n invokeEncoderToItems(this, stateItems, encoder, (this.mark as any).parameters());\n\n const graphicAttributes = this.transformElementItems(stateItems, this.mark.markType);\n\n if (!this.graphicItem.states) {\n this.graphicItem.states = { [stateName]: graphicAttributes };\n } else if (!this.graphicItem.states[stateName]) {\n this.graphicItem.states[stateName] = graphicAttributes;\n }\n\n return graphicAttributes;\n };\n\n useStates(states: string[], hasAnimation?: boolean) {\n if (!this.graphicItem) {\n return false;\n }\n this.mark.emit(HOOK_EVENT.BEFORE_ELEMENT_STATE, { states }, this);\n\n const stateSort = this.mark.getSpec()?.stateSort;\n\n if (stateSort) {\n states.sort(stateSort);\n }\n this.states = states;\n\n const stateAnimationEnable = isBoolean(hasAnimation)\n ? hasAnimation\n : this.mark.animate.getAnimationConfigs('state').length !== 0;\n\n this.graphicItem.stateProxy = this.getStateAttrs;\n this.graphicItem.useStates(this.states, stateAnimationEnable);\n\n this.mark.emit(HOOK_EVENT.AFTER_ELEMENT_STATE, { states }, this);\n\n return true;\n }\n\n protected diffAttributes(graphicAttributes: { [channel: string]: any }) {\n const diffResult = {};\n const finalGraphicAttributes = this.getFinalGraphicAttributes();\n for (const key in graphicAttributes) {\n if (!isEqual(key, finalGraphicAttributes, graphicAttributes) || !has(finalGraphicAttributes, key)) {\n diffResult[key] = graphicAttributes[key];\n }\n }\n return diffResult;\n }\n\n /**\n * tranform the attribute to graphic attribute\n * @param items\n * @param markType In ordinary, markType is equal to mark.markType, but in glyph, markType is different from mark.markType\n * @param markName\n * @param computePoints\n * @returns\n */\n transformElementItems(items: MarkElementItem[], markType: MarkType, computePoints?: boolean): Record<string, any> {\n const item = items[0];\n\n if (!item.nextAttrs || Object.keys(item.nextAttrs).length === 0) {\n return {};\n }\n\n let nextAttrs = item?.nextAttrs;\n\n if (\n items &&\n items.length &&\n isNil(item.nextAttrs?.points) &&\n (computePoints === true || isValidPointsChannel(Object.keys(item.nextAttrs), this.mark.markType)) &&\n isPointsMarkType(markType)\n ) {\n const lastPoints = this.getGraphicAttribute('points', false);\n const lastSegments = this.getGraphicAttribute('segments', false);\n const enableSegments = this.mark.getSpec().enableSegments;\n const itemNextAttrs = items.map(item => item.nextAttrs);\n const isProgressive = this.mark.isProgressive();\n nextAttrs = parseCollectionMarkAttributes(nextAttrs);\n\n if (markType === GrammarMarkType.line || markType === GrammarMarkType.area) {\n const linePoints = getLinePoints(items, true, lastPoints, markType === GrammarMarkType.area);\n\n // chartspace新增了配置,用于开启线段解析;渐进渲染状态不支持线段样式\n if (enableSegments && !isProgressive) {\n const points = !linePoints || linePoints.length === 0 ? getLinePointsFromSegments(lastSegments) : linePoints;\n const segments = getLineSegmentConfigs(itemNextAttrs, points, this);\n\n if (segments) {\n nextAttrs.segments = segments;\n nextAttrs.points = null;\n } else {\n nextAttrs.segments = null;\n nextAttrs.points = points;\n }\n } else if (isProgressive) {\n nextAttrs.segments = ((this.graphicItem as ILine)?.attribute?.segments ?? []).concat([\n { points: linePoints }\n ]);\n } else {\n nextAttrs.points = linePoints;\n nextAttrs.segments = null;\n }\n } else if (markType === GrammarMarkType.largeRects) {\n nextAttrs.points = getLargeRectsPoints(items, true, lastPoints);\n } else if (markType === GrammarMarkType.largeSymbols) {\n nextAttrs.points = getLargeSymbolsPoints(items, true, lastPoints);\n }\n }\n\n return nextAttrs;\n }\n\n protected applyGraphicAttributes(graphicAttributes: any) {\n if (isEmpty(graphicAttributes)) {\n return;\n }\n\n if (this.mark.needAnimate()) {\n // If mark need animate, diff attributes.\n const nextGraphicAttributes = this.diffAttributes(graphicAttributes);\n const prevGraphicAttributes = this.getPrevGraphicAttributes();\n\n const finalGraphicAttributes = this.getFinalGraphicAttributes();\n Object.keys(nextGraphicAttributes).forEach(channel => {\n prevGraphicAttributes[channel] = this.getGraphicAttribute(channel);\n finalGraphicAttributes[channel] = nextGraphicAttributes[channel];\n });\n this.setNextGraphicAttributes(nextGraphicAttributes);\n this.setPrevGraphicAttributes(prevGraphicAttributes);\n this.setFinalGraphicAttributes(finalGraphicAttributes);\n\n const currentAnimators = this.mark.animate.getElementAnimators(this);\n const animateGraphicAttributes = currentAnimators.reduce((attributes, animator) => {\n return Object.assign(attributes, animator.getEndAttributes());\n }, {});\n const currentGraphicAttributes = Object.assign({}, animateGraphicAttributes, finalGraphicAttributes);\n\n // Apply next attributes to current graphic item immediately.\n // Scene graph tree should be handled like no animation exists in dataflow procedure.\n this.graphicItem.setAttributes(currentGraphicAttributes);\n } else {\n // Otherwise, directly apply all attributes.\n this.graphicItem.setAttributes(graphicAttributes);\n }\n }\n\n getGraphicAttribute(channel: string, prev: boolean = false) {\n if (!this.graphicItem) {\n return undefined;\n }\n\n if (prev) {\n let value: any;\n const prevGraphicAttributes = this.getPrevGraphicAttributes();\n if (!isNil((value = get(prevGraphicAttributes, channel)))) {\n return value;\n }\n }\n\n // get attribute before transformed\n const trans = this.mark.getAttributeTransforms();\n let getKey: string[] = [channel];\n if (trans && trans.length) {\n const channelTransform = trans.find(entry => {\n return entry.storedAttrs && entry.channels.includes(channel);\n });\n\n if (channelTransform) {\n getKey = [channelTransform.storedAttrs, channel];\n }\n }\n return get(this.graphicItem?.attribute, getKey);\n }\n\n setGraphicAttribute(channel: string, value: any, final: boolean = true) {\n if (!this.graphicItem) {\n return;\n }\n const finalGraphicAttributes = this.getFinalGraphicAttributes();\n const prevGraphicAttributes = this.getPrevGraphicAttributes();\n\n if (final && finalGraphicAttributes) {\n finalGraphicAttributes[channel] = value;\n }\n if (prevGraphicAttributes && !has(prevGraphicAttributes, channel)) {\n prevGraphicAttributes[channel] = this.graphicItem.attribute[channel];\n }\n\n this.graphicItem.setAttribute(channel, value);\n }\n\n setGraphicAttributes(attributes: { [channel: string]: any }, final: boolean = true) {\n if (!this.graphicItem) {\n return;\n }\n const finalGraphicAttributes = this.getFinalGraphicAttributes();\n const prevGraphicAttributes = this.getPrevGraphicAttributes();\n\n Object.keys(attributes).forEach(key => {\n if (finalGraphicAttributes && final) {\n finalGraphicAttributes[key] = attributes[key];\n }\n if (prevGraphicAttributes && !has(prevGraphicAttributes, key)) {\n prevGraphicAttributes[key] = this.graphicItem.attribute[key];\n }\n });\n\n this.graphicItem.setAttributes(attributes);\n }\n\n /**\n * 获取 vRender 已变更的视觉通道属性,只应当由 VGrammar 中 调用\n * @returns 视觉通道键值对\n */\n getFinalGraphicAttributes() {\n return (this.graphicItem as any).finalAttrs;\n }\n\n protected setFinalGraphicAttributes(attributes: { [channel: string]: any }) {\n (this.graphicItem as any).finalAttrs = attributes;\n }\n\n /**\n * 获取 vRender 变更前的视觉通道属性,只应当由 VGrammar 调用\n * @returns 视觉通道键值对\n */\n getPrevGraphicAttributes() {\n return (this.graphicItem as any).prevAttrs;\n }\n\n protected setPrevGraphicAttributes(attributes: { [channel: string]: any }) {\n (this.graphicItem as any).prevAttrs = attributes;\n }\n\n /**\n * 获取 vRender 在单次 dataflow 中变更的视觉通道属性,只应当由 VGrammar 调用\n * @returns 视觉通道键值对\n */\n getNextGraphicAttributes() {\n return (this.graphicItem as any).nextAttrs;\n }\n\n protected setNextGraphicAttributes(attributes: { [channel: string]: any }) {\n (this.graphicItem as any).nextAttrs = attributes;\n }\n\n clearChangedGraphicAttributes() {\n if (this.graphicItem) {\n this.setPrevGraphicAttributes({});\n this.setNextGraphicAttributes({});\n }\n }\n\n clearGraphicAttributes() {\n if (this.graphicItem) {\n this.setPrevGraphicAttributes({});\n this.setNextGraphicAttributes({});\n this.setFinalGraphicAttributes({});\n }\n }\n\n remove() {\n if (this.graphicItem) {\n removeGraphicItem(this.graphicItem);\n this.graphicItem = null;\n }\n }\n\n release() {\n this.removeGraphicItem();\n this.mark = null;\n this.data = null;\n this.items = null;\n }\n /**\n * hack support for transform & encode logic. DO NOT USE.\n */\n getItemAttribute(channel?: string) {\n if (!this.items?.length) {\n return;\n }\n\n if (this.mark.isCollectionMark()) {\n return isNil(channel)\n ? this.items.map(item => item.nextAttrs)\n : this.items.map(item => item.nextAttrs?.[channel]);\n }\n\n return isNil(channel) ? this.items[0].nextAttrs : this.items[0].nextAttrs?.[channel];\n }\n setItemAttributes(attributes: { [channel: string]: any } | any[]) {\n if (!this.items?.length) {\n return;\n }\n\n if (this.mark.isCollectionMark()) {\n if (isArray(attributes)) {\n this.items.forEach((item, index) => {\n Object.assign(item.nextAttrs, attributes[index]);\n });\n }\n } else {\n Object.assign(this.items[0].nextAttrs, attributes);\n }\n }\n /**\n * hack support for transform & encode logic. DO NOT USE.\n */\n getItem() {\n return this.mark.isCollectionMark() ? this.items ?? [] : this.items?.[0];\n }\n getDatum() {\n return this.mark.isCollectionMark() ? this.data ?? [] : this.data?.[0];\n }\n}\n"]}
|
|
@@ -13,7 +13,7 @@ export declare class GlyphElement extends Element implements IGlyphElement {
|
|
|
13
13
|
[markName: string]: any;
|
|
14
14
|
};
|
|
15
15
|
initGraphicItem(attributes?: any): void;
|
|
16
|
-
useStates(states: string[], hasAnimation?: boolean):
|
|
16
|
+
useStates(states: string[], hasAnimation?: boolean): boolean;
|
|
17
17
|
protected getStateAttrs: (stateName: string, nextStates: string[]) => {
|
|
18
18
|
attributes: Partial<IGraphicAttribute>;
|
|
19
19
|
subAttributes: Partial<IGraphicAttribute>[];
|
|
@@ -46,15 +46,15 @@ class GlyphElement extends element_1.Element {
|
|
|
46
46
|
})), this.clearGraphicAttributes();
|
|
47
47
|
}
|
|
48
48
|
useStates(states, hasAnimation) {
|
|
49
|
-
if (!this.graphicItem) return;
|
|
49
|
+
if (!this.graphicItem) return !1;
|
|
50
50
|
this.mark.emit(enums_1.HOOK_EVENT.BEFORE_ELEMENT_STATE, {
|
|
51
51
|
states: states
|
|
52
52
|
}, this), this.states = states.slice();
|
|
53
53
|
const stateAnimationEnable = (0, vutils_1.isBoolean)(hasAnimation) ? hasAnimation : 0 !== this.mark.animate.getAnimationConfigs("state").length;
|
|
54
|
-
this.graphicItem.glyphStateProxy = this.getStateAttrs, this.graphicItem.useStates(this.states, stateAnimationEnable),
|
|
54
|
+
return this.graphicItem.glyphStateProxy = this.getStateAttrs, this.graphicItem.useStates(this.states, stateAnimationEnable),
|
|
55
55
|
this.mark.emit(enums_1.HOOK_EVENT.AFTER_ELEMENT_STATE, {
|
|
56
56
|
states: states
|
|
57
|
-
}, this);
|
|
57
|
+
}, this), !0;
|
|
58
58
|
}
|
|
59
59
|
encodeGraphic() {
|
|
60
60
|
this.coordinateTransformEncode(this.items);
|