@visactor/vgrammar-core 0.10.0-alpha.1 → 0.10.0-alpha.3
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.js.map +1 -1
- package/cjs/component/datazoom.js.map +1 -1
- package/cjs/component/grid.js.map +1 -1
- package/cjs/component/label.js +1 -0
- package/cjs/component/label.js.map +1 -1
- package/cjs/component/legend.js.map +1 -1
- package/cjs/component/player.js.map +1 -1
- package/cjs/component/scrollbar.js.map +1 -1
- package/cjs/component/slider.js.map +1 -1
- package/cjs/component/title.d.ts +4 -3
- package/cjs/component/title.js.map +1 -1
- package/cjs/core/factory.d.ts +8 -4
- package/cjs/core/factory.js +9 -3
- package/cjs/core/factory.js.map +1 -1
- package/cjs/env.d.ts +3 -1
- package/cjs/env.js +22 -16
- package/cjs/env.js.map +1 -1
- package/cjs/glyph/boxplot.js +4 -2
- package/cjs/glyph/boxplot.js.map +1 -1
- package/cjs/glyph/link-path.js +3 -2
- package/cjs/glyph/link-path.js.map +1 -1
- package/cjs/glyph/ripple.js +2 -2
- package/cjs/glyph/ripple.js.map +1 -1
- package/cjs/glyph/tree-path.js +3 -2
- package/cjs/glyph/tree-path.js.map +1 -1
- package/cjs/glyph/violin.js +4 -2
- package/cjs/glyph/violin.js.map +1 -1
- package/cjs/glyph/wave.js +2 -2
- package/cjs/glyph/wave.js.map +1 -1
- package/cjs/graph/animation/animate.js +5 -3
- package/cjs/graph/animation/animate.js.map +1 -1
- package/cjs/graph/animation/animation/grow-cartesian.js.map +1 -1
- package/cjs/graph/animation/animator.js +6 -5
- package/cjs/graph/animation/animator.js.map +1 -1
- package/cjs/graph/animation/attribute.d.ts +2 -2
- package/cjs/graph/animation/attribute.js +6 -6
- package/cjs/graph/animation/attribute.js.map +1 -1
- package/cjs/graph/animation/config.js +9 -7
- package/cjs/graph/animation/config.js.map +1 -1
- package/cjs/graph/animation/morph.js +4 -4
- package/cjs/graph/animation/morph.js.map +1 -1
- package/cjs/graph/attributes/line.d.ts +1 -0
- package/cjs/graph/attributes/line.js +11 -3
- package/cjs/graph/attributes/line.js.map +1 -1
- package/cjs/graph/attributes/transform.js +0 -42
- package/cjs/graph/attributes/transform.js.map +1 -1
- package/cjs/graph/canvas-renderer.d.ts +1 -1
- package/cjs/graph/canvas-renderer.js +7 -6
- package/cjs/graph/canvas-renderer.js.map +1 -1
- package/cjs/graph/constants.d.ts +1 -0
- package/cjs/graph/constants.js +3 -3
- package/cjs/graph/constants.js.map +1 -1
- package/cjs/graph/element.d.ts +2 -2
- package/cjs/graph/element.js +16 -19
- package/cjs/graph/element.js.map +1 -1
- package/cjs/graph/glyph-element.d.ts +1 -1
- package/cjs/graph/glyph-element.js +2 -3
- package/cjs/graph/glyph-element.js.map +1 -1
- package/cjs/graph/mark/graphic.d.ts +22 -0
- package/cjs/graph/mark/graphic.js +138 -0
- package/cjs/graph/mark/graphic.js.map +1 -0
- package/cjs/graph/mark/large-rects.d.ts +2 -2
- package/cjs/graph/mark/large-rects.js +3 -3
- package/cjs/graph/mark/large-rects.js.map +1 -1
- package/cjs/graph/mark/large-symbols.d.ts +2 -2
- package/cjs/graph/mark/large-symbols.js +3 -3
- package/cjs/graph/mark/large-symbols.js.map +1 -1
- package/cjs/graph/util/env.js +2 -2
- package/cjs/graph/util/env.js.map +1 -1
- package/cjs/graph/util/events-extend.d.ts +1 -1
- package/cjs/graph/util/events-extend.js.map +1 -1
- package/cjs/graph/util/graphic.d.ts +3 -5
- package/cjs/graph/util/graphic.js +12 -28
- package/cjs/graph/util/graphic.js.map +1 -1
- package/cjs/index.d.ts +5 -2
- package/cjs/index.js +34 -5
- package/cjs/index.js.map +1 -1
- package/cjs/interactions/brush-active.d.ts +1 -1
- package/cjs/interactions/brush-active.js.map +1 -1
- package/cjs/interactions/brush-base.d.ts +1 -1
- package/cjs/interactions/brush-base.js.map +1 -1
- package/cjs/interactions/brush-filter.d.ts +1 -1
- package/cjs/interactions/brush-filter.js.map +1 -1
- package/cjs/interactions/brush-highlight.d.ts +1 -1
- package/cjs/interactions/brush-highlight.js.map +1 -1
- package/cjs/interactions/crosshair.js.map +1 -1
- package/cjs/interactions/drill-down.d.ts +1 -1
- package/cjs/interactions/drill-down.js.map +1 -1
- package/cjs/parse/scale.js +1 -1
- package/cjs/parse/scale.js.map +1 -1
- package/cjs/semantic-marks/cell.d.ts +1 -1
- package/cjs/semantic-marks/interval.d.ts +1 -1
- package/cjs/semantic-marks/interval.js +4 -2
- package/cjs/semantic-marks/interval.js.map +1 -1
- package/cjs/transforms/data/contour.js +2 -1
- package/cjs/transforms/data/contour.js.map +1 -1
- package/cjs/transforms/data/sampling.js +3 -3
- package/cjs/transforms/data/sampling.js.map +1 -1
- package/cjs/transforms/data/unfold.js +2 -2
- package/cjs/transforms/data/unfold.js.map +1 -1
- package/cjs/transforms/mark/symmetry.js +2 -1
- package/cjs/transforms/mark/symmetry.js.map +1 -1
- package/cjs/transforms/util/util.d.ts +0 -2
- package/cjs/transforms/util/util.js +2 -11
- package/cjs/transforms/util/util.js.map +1 -1
- package/cjs/types/animate.d.ts +3 -1
- package/cjs/types/animate.js.map +1 -1
- package/cjs/types/component.d.ts +5 -5
- package/cjs/types/component.js.map +1 -1
- package/cjs/types/element.d.ts +1 -1
- package/cjs/types/element.js.map +1 -1
- package/cjs/types/event.d.ts +1 -1
- package/cjs/types/event.js.map +1 -1
- package/cjs/types/grammar.d.ts +7 -6
- package/cjs/types/grammar.js.map +1 -1
- package/cjs/types/interaction.d.ts +1 -1
- package/cjs/types/interaction.js.map +1 -1
- package/cjs/types/mark.d.ts +2 -1
- package/cjs/types/mark.js.map +1 -1
- package/cjs/types/morph.d.ts +1 -1
- package/cjs/types/morph.js.map +1 -1
- package/cjs/types/plot.d.ts +1 -1
- package/cjs/types/plot.js.map +1 -1
- package/cjs/types/renderer.d.ts +1 -1
- package/cjs/types/renderer.js.map +1 -1
- package/cjs/types/theme.d.ts +1 -1
- package/cjs/types/theme.js.map +1 -1
- package/cjs/types/view.d.ts +1 -1
- package/cjs/types/view.js.map +1 -1
- package/cjs/util/text.d.ts +1 -1
- package/cjs/util/text.js +3 -3
- package/cjs/util/text.js.map +1 -1
- package/cjs/view/View.d.ts +1 -1
- package/cjs/view/View.js +17 -14
- package/cjs/view/View.js.map +1 -1
- package/cjs/view/component.d.ts +1 -1
- package/cjs/view/coordinate.d.ts +1 -0
- package/cjs/view/coordinate.js +8 -2
- package/cjs/view/coordinate.js.map +1 -1
- package/cjs/view/mark.d.ts +7 -5
- package/cjs/view/mark.js +21 -11
- package/cjs/view/mark.js.map +1 -1
- package/cjs/view/scale.d.ts +1 -0
- package/cjs/view/scale.js +8 -2
- package/cjs/view/scale.js.map +1 -1
- package/es/component/axis.js.map +1 -1
- package/es/component/datazoom.js.map +1 -1
- package/es/component/grid.js.map +1 -1
- package/es/component/label.js +1 -0
- package/es/component/label.js.map +1 -1
- package/es/component/legend.js.map +1 -1
- package/es/component/player.js.map +1 -1
- package/es/component/scrollbar.js.map +1 -1
- package/es/component/slider.js.map +1 -1
- package/es/component/title.d.ts +4 -3
- package/es/component/title.js.map +1 -1
- package/es/core/factory.d.ts +8 -4
- package/es/core/factory.js +8 -3
- package/es/core/factory.js.map +1 -1
- package/es/env.d.ts +3 -1
- package/es/env.js +9 -1
- package/es/env.js.map +1 -1
- package/es/glyph/boxplot.js +4 -1
- package/es/glyph/boxplot.js.map +1 -1
- package/es/glyph/link-path.js +4 -1
- package/es/glyph/link-path.js.map +1 -1
- package/es/glyph/ripple.js +3 -1
- package/es/glyph/ripple.js.map +1 -1
- package/es/glyph/tree-path.js +4 -1
- package/es/glyph/tree-path.js.map +1 -1
- package/es/glyph/violin.js +4 -1
- package/es/glyph/violin.js.map +1 -1
- package/es/glyph/wave.js +3 -1
- package/es/glyph/wave.js.map +1 -1
- package/es/graph/animation/animate.js +4 -3
- package/es/graph/animation/animate.js.map +1 -1
- package/es/graph/animation/animation/grow-cartesian.js.map +1 -1
- package/es/graph/animation/animator.js +3 -2
- package/es/graph/animation/animator.js.map +1 -1
- package/es/graph/animation/attribute.d.ts +2 -2
- package/es/graph/animation/attribute.js +1 -1
- package/es/graph/animation/attribute.js.map +1 -1
- package/es/graph/animation/config.js +10 -8
- package/es/graph/animation/config.js.map +1 -1
- package/es/graph/animation/morph.js +1 -1
- package/es/graph/animation/morph.js.map +1 -1
- package/es/graph/attributes/line.d.ts +1 -0
- package/es/graph/attributes/line.js +8 -1
- package/es/graph/attributes/line.js.map +1 -1
- package/es/graph/attributes/transform.js +0 -38
- package/es/graph/attributes/transform.js.map +1 -1
- package/es/graph/canvas-renderer.d.ts +1 -1
- package/es/graph/canvas-renderer.js +4 -3
- package/es/graph/canvas-renderer.js.map +1 -1
- package/es/graph/constants.d.ts +1 -0
- package/es/graph/constants.js +2 -0
- package/es/graph/constants.js.map +1 -1
- package/es/graph/element.d.ts +2 -2
- package/es/graph/element.js +16 -19
- package/es/graph/element.js.map +1 -1
- package/es/graph/glyph-element.d.ts +1 -1
- package/es/graph/glyph-element.js +2 -3
- package/es/graph/glyph-element.js.map +1 -1
- package/es/graph/mark/graphic.d.ts +22 -0
- package/es/graph/mark/graphic.js +98 -0
- package/es/graph/mark/graphic.js.map +1 -0
- package/es/graph/mark/large-rects.d.ts +2 -2
- package/es/graph/mark/large-rects.js +1 -1
- package/es/graph/mark/large-rects.js.map +1 -1
- package/es/graph/mark/large-symbols.d.ts +2 -2
- package/es/graph/mark/large-symbols.js +1 -1
- package/es/graph/mark/large-symbols.js.map +1 -1
- package/es/graph/util/env.js +1 -1
- package/es/graph/util/env.js.map +1 -1
- package/es/graph/util/events-extend.d.ts +1 -1
- package/es/graph/util/events-extend.js.map +1 -1
- package/es/graph/util/graphic.d.ts +3 -5
- package/es/graph/util/graphic.js +13 -35
- package/es/graph/util/graphic.js.map +1 -1
- package/es/index.d.ts +5 -2
- package/es/index.js +8 -2
- package/es/index.js.map +1 -1
- package/es/interactions/brush-active.d.ts +1 -1
- package/es/interactions/brush-active.js.map +1 -1
- package/es/interactions/brush-base.d.ts +1 -1
- package/es/interactions/brush-base.js.map +1 -1
- package/es/interactions/brush-filter.d.ts +1 -1
- package/es/interactions/brush-filter.js +2 -1
- package/es/interactions/brush-filter.js.map +1 -1
- package/es/interactions/brush-highlight.d.ts +1 -1
- package/es/interactions/brush-highlight.js.map +1 -1
- package/es/interactions/crosshair.js.map +1 -1
- package/es/interactions/drill-down.d.ts +1 -1
- package/es/interactions/drill-down.js.map +1 -1
- package/es/interactions/element-highlight-by-group.js +1 -2
- package/es/interactions/index.js +2 -1
- package/es/interactions/legend-filter.js +1 -1
- package/es/interactions/player-filter.js +1 -1
- package/es/interactions/roll-up.js +1 -1
- package/es/interactions/scrollbar-filter.js +1 -1
- package/es/interactions/slider-filter.js +1 -1
- package/es/interactions/tooltip.js +1 -1
- package/es/interactions/view-drag-mixin.js +1 -1
- package/es/parse/coordinate.js +1 -1
- package/es/parse/event.js +1 -1
- package/es/parse/mark.js +1 -1
- package/es/parse/option.js +1 -1
- package/es/parse/scale.js +3 -4
- package/es/parse/scale.js.map +1 -1
- package/es/parse/transform.js +1 -1
- package/es/parse/util.js +1 -1
- package/es/parse/view.js +1 -1
- package/es/semantic-marks/cell.d.ts +1 -1
- package/es/semantic-marks/interval.d.ts +1 -1
- package/es/semantic-marks/interval.js +3 -3
- package/es/semantic-marks/interval.js.map +1 -1
- package/es/transforms/data/contour.js +2 -2
- package/es/transforms/data/contour.js.map +1 -1
- package/es/transforms/data/sampling.js +5 -3
- package/es/transforms/data/sampling.js.map +1 -1
- package/es/transforms/data/unfold.js +3 -3
- package/es/transforms/data/unfold.js.map +1 -1
- package/es/transforms/mark/symmetry.js +2 -2
- package/es/transforms/mark/symmetry.js.map +1 -1
- package/es/transforms/util/util.d.ts +0 -2
- package/es/transforms/util/util.js +0 -8
- package/es/transforms/util/util.js.map +1 -1
- package/es/types/animate.d.ts +3 -1
- package/es/types/animate.js.map +1 -1
- package/es/types/component.d.ts +5 -5
- package/es/types/component.js.map +1 -1
- package/es/types/element.d.ts +1 -1
- package/es/types/element.js.map +1 -1
- package/es/types/event.d.ts +1 -1
- package/es/types/event.js.map +1 -1
- package/es/types/grammar.d.ts +7 -6
- package/es/types/grammar.js.map +1 -1
- package/es/types/interaction.d.ts +1 -1
- package/es/types/interaction.js.map +1 -1
- package/es/types/mark.d.ts +2 -1
- package/es/types/mark.js.map +1 -1
- package/es/types/morph.d.ts +1 -1
- package/es/types/morph.js.map +1 -1
- package/es/types/plot.d.ts +1 -1
- package/es/types/plot.js.map +1 -1
- package/es/types/renderer.d.ts +1 -1
- package/es/types/renderer.js.map +1 -1
- package/es/types/theme.d.ts +1 -1
- package/es/types/theme.js.map +1 -1
- package/es/types/view.d.ts +1 -1
- package/es/types/view.js.map +1 -1
- package/es/util/text.d.ts +1 -1
- package/es/util/text.js +1 -1
- package/es/util/text.js.map +1 -1
- package/es/view/View.d.ts +1 -1
- package/es/view/View.js +11 -12
- package/es/view/View.js.map +1 -1
- package/es/view/component.d.ts +1 -1
- package/es/view/coordinate.d.ts +1 -0
- package/es/view/coordinate.js +6 -0
- package/es/view/coordinate.js.map +1 -1
- package/es/view/mark.d.ts +7 -5
- package/es/view/mark.js +21 -10
- package/es/view/mark.js.map +1 -1
- package/es/view/scale.d.ts +1 -0
- package/es/view/scale.js +6 -0
- package/es/view/scale.js.map +1 -1
- package/package.json +11 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graph/glyph-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAUlD,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,SAAS,EA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AC,EAAE,CAAC,CAAC;QAClC,IAAI,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC;QACnC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACrD,IAAI,CAAC,wBAAwB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;YAC5C,IAAI,CAAC,wBAAwB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;YAC5C,IAAI,CAAC,yBAAyB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,KAAK,CAAC,MAAM,EAAE,CAAC;IACjB,CAAC;IAED,OAAO;QACL,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;gBAC1D,WAAW,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;YACvC,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;SAC/B;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;CACF","file":"glyph-element.js","sourcesContent":["import { has, isNil, isBoolean, isFunction } from '@visactor/vutils';\nimport { isEqual } from '@visactor/vgrammar-util';\nimport type {\n IGlyphElement,\n IGlyphMark,\n MarkElementItem,\n MarkSpec,\n IGlyphMeta,\n MarkType,\n StateProxyEncodeSpec\n} from '../types';\nimport { cloneTransformAttributes, transformAttributes } from './attributes/transform';\nimport { BridgeElementKey, CollectionMarkType } from './constants';\nimport { DiffState, HOOK_EVENT, GrammarMarkType } from './enums';\nimport { Element } from './element';\nimport { invokeEncoderToItems } from './mark/encode';\nimport type { IGraphicAttribute, IGlyph } from '@visactor/vrender-core';\n\nexport class GlyphElement extends Element implements IGlyphElement {\n declare graphicItem: IGlyph;\n\n declare mark: IGlyphMark;\n protected glyphGraphicItems: { [markName: string]: any };\n\n private glyphMeta: IGlyphMeta;\n\n constructor(mark: IGlyphMark) {\n super(mark);\n this.glyphMeta = this.mark.getGlyphMeta();\n }\n\n getGlyphGraphicItems() {\n return this.glyphGraphicItems;\n }\n\n initGraphicItem(attributes: any = {}) {\n if (this.graphicItem) {\n return;\n }\n\n const attrs = Object.assign({}, attributes);\n this.graphicItem = this.mark.addGraphicItem(attrs, this.groupKey) as IGlyph;\n this.graphicItem[BridgeElementKey] = this;\n this.graphicItem.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(false);\n\n const glyphMarks = this.glyphMeta.getMarks();\n this.glyphGraphicItems = {};\n this.graphicItem.getSubGraphic().forEach((graphic: any) => {\n const markType = glyphMarks[graphic.name];\n this.glyphGraphicItems[graphic.name] = graphic;\n graphic.onBeforeAttributeUpdate = (attributes: any) => {\n // mark might be released\n if (!this.mark) {\n return attributes;\n }\n const graphicAttributes = transformAttributes(markType, attributes, this, graphic.name);\n return graphicAttributes;\n };\n });\n\n this.clearGraphicAttributes();\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\n const stateAnimationEnable = isBoolean(hasAnimation)\n ? hasAnimation\n : this.mark.animate.getAnimationConfigs('state').length !== 0;\n\n this.graphicItem.glyphStateProxy = 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 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 const glyphStateAttributes = {} as {\n attributes: Partial<IGraphicAttribute>;\n subAttributes: Partial<IGraphicAttribute>[];\n };\n\n if (!encoder) {\n return glyphStateAttributes;\n }\n\n if (isFunction(encoder)) {\n glyphStateAttributes.attributes = (encoder as StateProxyEncodeSpec)(this.getDatum(), this, stateName, nextStates);\n return glyphStateAttributes;\n }\n\n if (!isRuntimeState && this.graphicItem.glyphStates?.[stateName]) {\n return this.graphicItem.glyphStates[stateName];\n }\n\n if (encoder) {\n const item = this.items[0];\n const targetItems = [Object.assign({}, item, { nextAttrs: {} })];\n\n invokeEncoderToItems(this, targetItems, encoder, (this.mark as any).parameters());\n this.coordinateTransformEncode(targetItems);\n\n glyphStateAttributes.attributes = targetItems[0].nextAttrs;\n\n if (!this.graphicItem.glyphStates) {\n this.graphicItem.glyphStates = { [stateName]: glyphStateAttributes };\n } else if (!this.graphicItem.glyphStates[stateName]) {\n this.graphicItem.glyphStates[stateName] = glyphStateAttributes;\n }\n\n return glyphStateAttributes;\n }\n\n return glyphStateAttributes;\n };\n\n encodeGraphic() {\n this.coordinateTransformEncode(this.items);\n const graphicAttributes = this.transformElementItems(this.items, this.mark.markType);\n\n if (!this.graphicItem) {\n this.initGraphicItem();\n }\n\n if (this.diffState === DiffState.enter) {\n // apply default encoder when enter\n this.graphicItem.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(true);\n this.applyGraphicAttributes(graphicAttributes);\n this.graphicItem.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(false);\n } else {\n this.applyGraphicAttributes(graphicAttributes);\n }\n\n if ((this.diffState === DiffState.enter || this.diffState === DiffState.update) && this.states.length) {\n Object.values(this.glyphGraphicItems).forEach(graphicItem => {\n // 更新数据流后,states计算不缓存\n graphicItem.states = {};\n });\n this.useStates(this.states);\n }\n\n // clear item attributes\n this.items.map(item => {\n item.nextAttrs = {};\n });\n }\n\n encodeCustom(nextAttrs?: any): { [markName: string]: any } {\n let customEncodeValues: { [markName: string]: any } = {};\n const channelEncoder = this.glyphMeta.getChannelEncoder();\n const functionEncoder = this.glyphMeta.getFunctionEncoder();\n\n if (functionEncoder) {\n customEncodeValues = functionEncoder.call(\n null,\n Object.assign({}, this.graphicItem?.attribute, nextAttrs),\n this.getDatum(),\n this,\n this.mark.getGlyphConfig()\n );\n }\n if (channelEncoder) {\n // TODO: maybe delete origin encode value?\n let allAttrs: any;\n Object.keys(channelEncoder).forEach(channel => {\n if (!isNil(nextAttrs[channel])) {\n if (!allAttrs) {\n allAttrs = Object.assign({}, this.graphicItem?.attribute, nextAttrs);\n }\n const encodeResult = channelEncoder[channel].call(\n null,\n channel,\n nextAttrs[channel],\n allAttrs,\n this.getDatum(),\n this,\n this.mark.getGlyphConfig()\n );\n Object.keys(encodeResult ?? {}).forEach(markName => {\n customEncodeValues[markName] = Object.assign(customEncodeValues[markName] ?? {}, encodeResult[markName]);\n });\n }\n });\n }\n return customEncodeValues;\n }\n\n private encodeDefault() {\n const defaultEncodeValues: { [markName: string]: any } = {};\n // apply default encode\n if (this.diffState === DiffState.enter && this.glyphMeta.getDefaultEncoder()) {\n const defaultEncodeResult = this.glyphMeta\n .getDefaultEncoder()\n .call(null, this.getDatum(), this, this.mark.getGlyphConfig());\n Object.assign(defaultEncodeValues, defaultEncodeResult);\n }\n return defaultEncodeValues;\n }\n\n private _onGlyphAttributeUpdate(first: boolean = false) {\n return (attributes: any) => {\n // mark might be released\n if (!this.mark) {\n return attributes;\n }\n const glyphMarks = this.glyphMeta.getMarks();\n\n const graphicAttributes = transformAttributes(this.mark.getAttributeTransforms(), attributes, this);\n\n // apply default encode\n const defaultEncodeValues = first ? this.encodeDefault() : null;\n // apply custom encode\n const customEncodeValues = this.encodeCustom(attributes);\n\n Object.keys(glyphMarks).forEach(markName => {\n const markType = glyphMarks[markName];\n const graphicItem = this.glyphGraphicItems[markName];\n const customAttributes = customEncodeValues?.[markName];\n const additionalAttributes = Object.assign({}, customAttributes);\n if (first) {\n // apply default attributes when visual channel is not set\n const defaultAttributes = defaultEncodeValues?.[markName];\n Object.keys(defaultAttributes ?? {}).forEach(key => {\n if (!has(this.items[0].nextAttrs, key) && !has(additionalAttributes, key)) {\n additionalAttributes[key] = defaultAttributes[key];\n }\n });\n }\n const glyphAttributes = Object.assign({}, cloneTransformAttributes(markType, attributes), additionalAttributes);\n const glyphItems = this._generateGlyphItems(markType, this.items, glyphAttributes);\n this.coordinateTransformEncode(glyphItems);\n const graphicAttributes = this.transformElementItems(glyphItems, markType);\n\n this.applyGlyphGraphicAttributes(graphicAttributes, markName, graphicItem);\n\n if (markType === GrammarMarkType.shape) {\n // FIXME: shape需要拿到原始数据进行编码,暂时把数据绑定到graphicItem上,看后续graphicItem是否需要支持数据绑定\n graphicItem.datum = glyphItems[0].datum;\n }\n });\n\n return graphicAttributes;\n };\n }\n\n private _generateGlyphItems(markType: MarkType, items: MarkElementItem[], additionalAttributes: any) {\n const nextAttrs = items[0]?.nextAttrs;\n const glyphItems = items.map(item => Object.assign({}, item, { nextAttrs: additionalAttributes }));\n\n if ((CollectionMarkType as string[]).includes(markType) && nextAttrs.enableSegments) {\n // segment mark require all items to apply additional attributes\n glyphItems.forEach((glyphItem, index) => {\n glyphItem.nextAttrs = Object.assign({}, items[index].nextAttrs, additionalAttributes);\n });\n }\n\n return glyphItems;\n }\n\n getGraphicAttribute(channel: string, prev: boolean = false, markName?: any) {\n if (!this.graphicItem) {\n return undefined;\n }\n const prevGraphicAttributes = this.getPrevGraphicAttributes(markName);\n if (prev && has(prevGraphicAttributes, channel)) {\n return prevGraphicAttributes[channel];\n }\n\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n return graphicItem.attribute[channel];\n }\n\n setGraphicAttribute(channel: string, value: any, final: boolean = true, markName?: any) {\n if (!this.graphicItem) {\n return;\n }\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n const finalGraphicAttributes = this.getFinalGraphicAttributes(markName);\n const prevGraphicAttributes = this.getPrevGraphicAttributes(markName);\n\n if (final) {\n finalGraphicAttributes[channel] = value;\n }\n if (!has(prevGraphicAttributes, channel)) {\n prevGraphicAttributes[channel] = graphicItem.attribute[channel];\n }\n\n graphicItem.setAttribute(channel, value);\n }\n\n setGraphicAttributes(attributes: { [channel: string]: any }, final: boolean = true, markName?: any) {\n if (!this.graphicItem) {\n return;\n }\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n const finalGraphicAttributes = this.getFinalGraphicAttributes(markName);\n const prevGraphicAttributes = this.getPrevGraphicAttributes(markName);\n\n Object.keys(attributes).forEach(key => {\n if (final) {\n finalGraphicAttributes[key] = attributes[key];\n }\n if (!has(prevGraphicAttributes, key)) {\n prevGraphicAttributes[key] = graphicItem.attribute[key];\n }\n });\n\n graphicItem.setAttributes(attributes);\n }\n\n protected diffAttributes(graphicAttributes: { [channel: string]: any }, markName?: string) {\n const diffResult = {};\n const finalGraphicAttributes = this.getFinalGraphicAttributes(markName);\n for (const key in graphicAttributes) {\n if (!isEqual(key, finalGraphicAttributes, graphicAttributes)) {\n diffResult[key] = graphicAttributes[key];\n }\n }\n return diffResult;\n }\n\n protected applyGlyphGraphicAttributes(graphicAttributes: any, markName: string, graphicItem: any): void {\n if (this.mark.needAnimate()) {\n // If mark need animate, diff attributes.\n const nextGraphicAttributes = this.diffAttributes(graphicAttributes, markName);\n const prevGraphicAttributes = this.getPrevGraphicAttributes(markName);\n const finalGraphicAttributes = this.getFinalGraphicAttributes(markName);\n Object.keys(nextGraphicAttributes).forEach(channel => {\n prevGraphicAttributes[channel] = graphicItem.attribute[channel];\n finalGraphicAttributes[channel] = nextGraphicAttributes[channel];\n });\n this.setNextGraphicAttributes(nextGraphicAttributes, markName);\n this.setPrevGraphicAttributes(prevGraphicAttributes, markName);\n this.setFinalGraphicAttributes(finalGraphicAttributes, markName);\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 graphicItem.setAttributes(nextGraphicAttributes);\n } else {\n graphicItem.setAttributes(graphicAttributes);\n }\n }\n\n getFinalGraphicAttributes(markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n return graphicItem.finalAttrs;\n }\n\n protected setFinalGraphicAttributes(attributes: { [channel: string]: any }, markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n graphicItem.finalAttrs = attributes;\n }\n\n getPrevGraphicAttributes(markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n return graphicItem.prevAttrs;\n }\n\n protected setPrevGraphicAttributes(attributes: { [channel: string]: any }, markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n graphicItem.prevAttrs = attributes;\n }\n\n getNextGraphicAttributes(markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n return graphicItem.nextAttrs;\n }\n\n protected setNextGraphicAttributes(attributes: { [channel: string]: any }, markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n graphicItem.nextAttrs = attributes;\n }\n\n clearChangedGraphicAttributes() {\n this.setPrevGraphicAttributes({});\n this.setNextGraphicAttributes({});\n Object.keys(this.glyphGraphicItems).forEach(markName => {\n this.setPrevGraphicAttributes({}, markName);\n this.setNextGraphicAttributes({}, markName);\n });\n }\n\n clearGraphicAttributes() {\n this.setPrevGraphicAttributes({});\n this.setNextGraphicAttributes({});\n this.setFinalGraphicAttributes({});\n Object.keys(this.glyphGraphicItems).forEach(markName => {\n this.setPrevGraphicAttributes({}, markName);\n this.setNextGraphicAttributes({}, markName);\n this.setFinalGraphicAttributes({}, markName);\n });\n }\n\n remove() {\n this.glyphGraphicItems = null;\n super.remove();\n }\n\n release() {\n if (this.glyphGraphicItems) {\n Object.values(this.glyphGraphicItems).forEach(graphicItem => {\n graphicItem[BridgeElementKey] = null;\n });\n this.glyphGraphicItems = null;\n }\n super.release();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/graph/glyph-element.ts"],"names":[],"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;YACrD,IAAI,CAAC,wBAAwB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;YAC5C,IAAI,CAAC,wBAAwB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,sBAAsB;QACpB,IAAI,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;QAClC,IAAI,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;QAClC,IAAI,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC;QACnC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACrD,IAAI,CAAC,wBAAwB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;YAC5C,IAAI,CAAC,wBAAwB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;YAC5C,IAAI,CAAC,yBAAyB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,KAAK,CAAC,MAAM,EAAE,CAAC;IACjB,CAAC;IAED,OAAO;QACL,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;gBAC1D,WAAW,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;YACvC,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;SAC/B;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;CACF","file":"glyph-element.js","sourcesContent":["import { has, isNil, isBoolean, isFunction } from '@visactor/vutils';\nimport { isEqual } from '@visactor/vgrammar-util';\nimport type {\n IGlyphElement,\n IGlyphMark,\n MarkElementItem,\n MarkSpec,\n IGlyphMeta,\n MarkType,\n StateProxyEncodeSpec\n} from '../types';\nimport { cloneTransformAttributes, transformAttributes } from './attributes/transform';\nimport { BridgeElementKey, CollectionMarkType } from './constants';\nimport { DiffState, HOOK_EVENT, GrammarMarkType } from './enums';\nimport { Element } from './element';\nimport { invokeEncoderToItems } from './mark/encode';\nimport type { IGraphicAttribute, IGlyph } from '@visactor/vrender/es/core';\n\nexport class GlyphElement extends Element implements IGlyphElement {\n declare graphicItem: IGlyph;\n\n declare mark: IGlyphMark;\n protected glyphGraphicItems: { [markName: string]: any };\n\n private glyphMeta: IGlyphMeta;\n\n constructor(mark: IGlyphMark) {\n super(mark);\n this.glyphMeta = this.mark.getGlyphMeta();\n }\n\n getGlyphGraphicItems() {\n return this.glyphGraphicItems;\n }\n\n initGraphicItem(attributes: any = {}) {\n if (this.graphicItem) {\n return;\n }\n\n const attrs = Object.assign({}, attributes);\n this.graphicItem = this.mark.addGraphicItem(attrs, this.groupKey) as IGlyph;\n this.graphicItem[BridgeElementKey] = this;\n this.graphicItem.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(false);\n\n const glyphMarks = this.glyphMeta.getMarks();\n this.glyphGraphicItems = {};\n this.graphicItem.getSubGraphic().forEach((graphic: any) => {\n const markType = glyphMarks[graphic.name];\n this.glyphGraphicItems[graphic.name] = graphic;\n graphic.onBeforeAttributeUpdate = (attributes: any) => {\n // mark might be released\n if (!this.mark) {\n return attributes;\n }\n const graphicAttributes = transformAttributes(markType, attributes, this, graphic.name);\n return graphicAttributes;\n };\n });\n\n this.clearGraphicAttributes();\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\n const stateAnimationEnable = isBoolean(hasAnimation)\n ? hasAnimation\n : this.mark.animate.getAnimationConfigs('state').length !== 0;\n\n this.graphicItem.glyphStateProxy = 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 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 const glyphStateAttributes = {} as {\n attributes: Partial<IGraphicAttribute>;\n subAttributes: Partial<IGraphicAttribute>[];\n };\n\n if (!encoder) {\n return glyphStateAttributes;\n }\n\n if (isFunction(encoder)) {\n glyphStateAttributes.attributes = (encoder as StateProxyEncodeSpec)(this.getDatum(), this, stateName, nextStates);\n return glyphStateAttributes;\n }\n\n if (!isRuntimeState && this.graphicItem.glyphStates?.[stateName]) {\n return this.graphicItem.glyphStates[stateName];\n }\n\n if (encoder) {\n const item = this.items[0];\n const targetItems = [Object.assign({}, item, { nextAttrs: {} })];\n\n invokeEncoderToItems(this, targetItems, encoder, (this.mark as any).parameters());\n this.coordinateTransformEncode(targetItems);\n\n glyphStateAttributes.attributes = targetItems[0].nextAttrs;\n\n if (!this.graphicItem.glyphStates) {\n this.graphicItem.glyphStates = { [stateName]: glyphStateAttributes };\n } else if (!this.graphicItem.glyphStates[stateName]) {\n this.graphicItem.glyphStates[stateName] = glyphStateAttributes;\n }\n\n return glyphStateAttributes;\n }\n\n return glyphStateAttributes;\n };\n\n encodeGraphic() {\n this.coordinateTransformEncode(this.items);\n const graphicAttributes = this.transformElementItems(this.items, this.mark.markType);\n\n if (!this.graphicItem) {\n this.initGraphicItem();\n }\n\n if (this.diffState === DiffState.enter) {\n // apply default encoder when enter\n this.graphicItem.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(true);\n this.applyGraphicAttributes(graphicAttributes);\n this.graphicItem.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(false);\n } else {\n this.applyGraphicAttributes(graphicAttributes);\n }\n\n if ((this.diffState === DiffState.enter || this.diffState === DiffState.update) && this.states.length) {\n Object.values(this.glyphGraphicItems).forEach(graphicItem => {\n // 更新数据流后,states计算不缓存\n graphicItem.states = {};\n });\n this.useStates(this.states);\n }\n\n // clear item attributes\n this.items.map(item => {\n item.nextAttrs = {};\n });\n }\n\n encodeCustom(nextAttrs?: any): { [markName: string]: any } {\n let customEncodeValues: { [markName: string]: any } = {};\n const channelEncoder = this.glyphMeta.getChannelEncoder();\n const functionEncoder = this.glyphMeta.getFunctionEncoder();\n\n if (functionEncoder) {\n customEncodeValues = functionEncoder.call(\n null,\n Object.assign({}, this.graphicItem?.attribute, nextAttrs),\n this.getDatum(),\n this,\n this.mark.getGlyphConfig()\n );\n }\n if (channelEncoder) {\n // TODO: maybe delete origin encode value?\n let allAttrs: any;\n Object.keys(channelEncoder).forEach(channel => {\n if (!isNil(nextAttrs[channel])) {\n if (!allAttrs) {\n allAttrs = Object.assign({}, this.graphicItem?.attribute, nextAttrs);\n }\n const encodeResult = channelEncoder[channel].call(\n null,\n channel,\n nextAttrs[channel],\n allAttrs,\n this.getDatum(),\n this,\n this.mark.getGlyphConfig()\n );\n Object.keys(encodeResult ?? {}).forEach(markName => {\n customEncodeValues[markName] = Object.assign(customEncodeValues[markName] ?? {}, encodeResult[markName]);\n });\n }\n });\n }\n return customEncodeValues;\n }\n\n private encodeDefault() {\n const defaultEncodeValues: { [markName: string]: any } = {};\n // apply default encode\n if (this.diffState === DiffState.enter && this.glyphMeta.getDefaultEncoder()) {\n const defaultEncodeResult = this.glyphMeta\n .getDefaultEncoder()\n .call(null, this.getDatum(), this, this.mark.getGlyphConfig());\n Object.assign(defaultEncodeValues, defaultEncodeResult);\n }\n return defaultEncodeValues;\n }\n\n private _onGlyphAttributeUpdate(first: boolean = false) {\n return (attributes: any) => {\n // mark might be released\n if (!this.mark) {\n return attributes;\n }\n const glyphMarks = this.glyphMeta.getMarks();\n\n const graphicAttributes = transformAttributes(this.mark.getAttributeTransforms(), attributes, this);\n\n // apply default encode\n const defaultEncodeValues = first ? this.encodeDefault() : null;\n // apply custom encode\n const customEncodeValues = this.encodeCustom(attributes);\n\n Object.keys(glyphMarks).forEach(markName => {\n const markType = glyphMarks[markName];\n const graphicItem = this.glyphGraphicItems[markName];\n const customAttributes = customEncodeValues?.[markName];\n const additionalAttributes = Object.assign({}, customAttributes);\n if (first) {\n // apply default attributes when visual channel is not set\n const defaultAttributes = defaultEncodeValues?.[markName];\n Object.keys(defaultAttributes ?? {}).forEach(key => {\n if (!has(this.items[0].nextAttrs, key) && !has(additionalAttributes, key)) {\n additionalAttributes[key] = defaultAttributes[key];\n }\n });\n }\n const glyphAttributes = Object.assign({}, cloneTransformAttributes(markType, attributes), additionalAttributes);\n const glyphItems = this._generateGlyphItems(markType, this.items, glyphAttributes);\n this.coordinateTransformEncode(glyphItems);\n const graphicAttributes = this.transformElementItems(glyphItems, markType);\n\n this.applyGlyphGraphicAttributes(graphicAttributes, markName, graphicItem);\n\n if (markType === GrammarMarkType.shape) {\n // FIXME: shape需要拿到原始数据进行编码,暂时把数据绑定到graphicItem上,看后续graphicItem是否需要支持数据绑定\n graphicItem.datum = glyphItems[0].datum;\n }\n });\n\n return graphicAttributes;\n };\n }\n\n private _generateGlyphItems(markType: MarkType, items: MarkElementItem[], additionalAttributes: any) {\n const glyphItems = items.map(item => Object.assign({}, item, { nextAttrs: additionalAttributes }));\n\n if ((CollectionMarkType as string[]).includes(markType) && this.mark.getSpec().enableSegments) {\n // segment mark require all items to apply additional attributes\n glyphItems.forEach((glyphItem, index) => {\n glyphItem.nextAttrs = Object.assign({}, items[index].nextAttrs, additionalAttributes);\n });\n }\n\n return glyphItems;\n }\n\n getGraphicAttribute(channel: string, prev: boolean = false, markName?: any) {\n if (!this.graphicItem) {\n return undefined;\n }\n const prevGraphicAttributes = this.getPrevGraphicAttributes(markName);\n if (prev && has(prevGraphicAttributes, channel)) {\n return prevGraphicAttributes[channel];\n }\n\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n return graphicItem.attribute[channel];\n }\n\n setGraphicAttribute(channel: string, value: any, final: boolean = true, markName?: any) {\n if (!this.graphicItem) {\n return;\n }\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n const finalGraphicAttributes = this.getFinalGraphicAttributes(markName);\n const prevGraphicAttributes = this.getPrevGraphicAttributes(markName);\n\n if (final) {\n finalGraphicAttributes[channel] = value;\n }\n if (!has(prevGraphicAttributes, channel)) {\n prevGraphicAttributes[channel] = graphicItem.attribute[channel];\n }\n\n graphicItem.setAttribute(channel, value);\n }\n\n setGraphicAttributes(attributes: { [channel: string]: any }, final: boolean = true, markName?: any) {\n if (!this.graphicItem) {\n return;\n }\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n const finalGraphicAttributes = this.getFinalGraphicAttributes(markName);\n const prevGraphicAttributes = this.getPrevGraphicAttributes(markName);\n\n Object.keys(attributes).forEach(key => {\n if (final) {\n finalGraphicAttributes[key] = attributes[key];\n }\n if (!has(prevGraphicAttributes, key)) {\n prevGraphicAttributes[key] = graphicItem.attribute[key];\n }\n });\n\n graphicItem.setAttributes(attributes);\n }\n\n protected diffAttributes(graphicAttributes: { [channel: string]: any }, markName?: string) {\n const diffResult = {};\n const finalGraphicAttributes = this.getFinalGraphicAttributes(markName);\n for (const key in graphicAttributes) {\n if (!isEqual(key, finalGraphicAttributes, graphicAttributes)) {\n diffResult[key] = graphicAttributes[key];\n }\n }\n return diffResult;\n }\n\n protected applyGlyphGraphicAttributes(graphicAttributes: any, markName: string, graphicItem: any): void {\n if (this.mark.needAnimate()) {\n // If mark need animate, diff attributes.\n const nextGraphicAttributes = this.diffAttributes(graphicAttributes, markName);\n const prevGraphicAttributes = this.getPrevGraphicAttributes(markName);\n const finalGraphicAttributes = this.getFinalGraphicAttributes(markName);\n Object.keys(nextGraphicAttributes).forEach(channel => {\n prevGraphicAttributes[channel] = graphicItem.attribute[channel];\n finalGraphicAttributes[channel] = nextGraphicAttributes[channel];\n });\n this.setNextGraphicAttributes(nextGraphicAttributes, markName);\n this.setPrevGraphicAttributes(prevGraphicAttributes, markName);\n this.setFinalGraphicAttributes(finalGraphicAttributes, markName);\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 graphicItem.setAttributes(nextGraphicAttributes);\n } else {\n graphicItem.setAttributes(graphicAttributes);\n }\n }\n\n getFinalGraphicAttributes(markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n return graphicItem.finalAttrs;\n }\n\n protected setFinalGraphicAttributes(attributes: { [channel: string]: any }, markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n graphicItem.finalAttrs = attributes;\n }\n\n getPrevGraphicAttributes(markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n return graphicItem.prevAttrs;\n }\n\n protected setPrevGraphicAttributes(attributes: { [channel: string]: any }, markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n graphicItem.prevAttrs = attributes;\n }\n\n getNextGraphicAttributes(markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n return graphicItem.nextAttrs;\n }\n\n protected setNextGraphicAttributes(attributes: { [channel: string]: any }, markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n graphicItem.nextAttrs = attributes;\n }\n\n clearChangedGraphicAttributes() {\n this.setPrevGraphicAttributes({});\n this.setNextGraphicAttributes({});\n Object.keys(this.glyphGraphicItems).forEach(markName => {\n this.setPrevGraphicAttributes({}, markName);\n this.setNextGraphicAttributes({}, markName);\n });\n }\n\n clearGraphicAttributes() {\n this.setPrevGraphicAttributes({});\n this.setNextGraphicAttributes({});\n this.setFinalGraphicAttributes({});\n Object.keys(this.glyphGraphicItems).forEach(markName => {\n this.setPrevGraphicAttributes({}, markName);\n this.setNextGraphicAttributes({}, markName);\n this.setFinalGraphicAttributes({}, markName);\n });\n }\n\n remove() {\n this.glyphGraphicItems = null;\n super.remove();\n }\n\n release() {\n if (this.glyphGraphicItems) {\n Object.values(this.glyphGraphicItems).forEach(graphicItem => {\n graphicItem[BridgeElementKey] = null;\n });\n this.glyphGraphicItems = null;\n }\n super.release();\n }\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const registerCircleGraphic: () => void;
|
|
2
|
+
export declare const registerArcGraphic: () => void;
|
|
3
|
+
export declare const registerArc3dGraphic: () => void;
|
|
4
|
+
export declare const registerPyramid3dGraphic: () => void;
|
|
5
|
+
export declare const registerAreaGraphic: () => void;
|
|
6
|
+
export declare const registerGroupGraphic: () => void;
|
|
7
|
+
export declare const registerImageGraphic: () => void;
|
|
8
|
+
export declare const registerLineGraphic: () => void;
|
|
9
|
+
export declare const registerPathGraphic: () => void;
|
|
10
|
+
export declare const registerRectGraphic: () => void;
|
|
11
|
+
export declare const registerRect3dGraphic: () => void;
|
|
12
|
+
export declare const registerRuleGraphic: () => void;
|
|
13
|
+
export declare const registerShapeGraphic: () => void;
|
|
14
|
+
export declare const registerSymbolGraphic: () => void;
|
|
15
|
+
export declare const registerTextGraphic: () => void;
|
|
16
|
+
export declare const registerPolygonGraphic: () => void;
|
|
17
|
+
export declare const registerRichTextGraphic: () => void;
|
|
18
|
+
export declare const registerCellGraphic: () => void;
|
|
19
|
+
export declare const registerIntervalGraphic: () => void;
|
|
20
|
+
export declare const registerGlyphGraphic: () => void;
|
|
21
|
+
export declare const registerLargeRectsGraphic: () => void;
|
|
22
|
+
export declare const registerLargeSymbolsGraphic: () => void;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Factory } from "../../core/factory";
|
|
2
|
+
|
|
3
|
+
import { GrammarMarkType } from "../enums";
|
|
4
|
+
|
|
5
|
+
import { LargeRects } from "./large-rects";
|
|
6
|
+
|
|
7
|
+
import { LargeSymbols } from "./large-symbols";
|
|
8
|
+
|
|
9
|
+
import { createArc, createCircle, createArc3d, createPyramid3d, createArea, createGroup, createImage, createRect3d, createLine, createPath, createRect, createSymbol, createText, createPolygon, createRichText, createGlyph, registerCircle, registerArc, registerArc3d, registerPyramid3d, registerArea, registerGroup, registerImage, registerRect3d, registerLine, registerPath, registerRect, registerSymbol, registerText, registerPolygon, registerRichtext, registerGlyph } from "@visactor/vrender/es/register";
|
|
10
|
+
|
|
11
|
+
export const registerCircleGraphic = () => {
|
|
12
|
+
registerCircle(), Factory.registerGraphic(GrammarMarkType.circle, createCircle);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const registerArcGraphic = () => {
|
|
16
|
+
registerArc(), Factory.registerGraphic(GrammarMarkType.arc, createArc);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const registerArc3dGraphic = () => {
|
|
20
|
+
registerArc3d(), Factory.registerGraphic(GrammarMarkType.arc3d, createArc3d);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const registerPyramid3dGraphic = () => {
|
|
24
|
+
registerPyramid3d(), Factory.registerGraphic(GrammarMarkType.pyramid3d, createPyramid3d);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const registerAreaGraphic = () => {
|
|
28
|
+
registerArea(), Factory.registerGraphic(GrammarMarkType.area, createArea);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const registerGroupGraphic = () => {
|
|
32
|
+
registerGroup(), Factory.registerGraphic(GrammarMarkType.group, createGroup);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const registerImageGraphic = () => {
|
|
36
|
+
registerImage(), Factory.registerGraphic(GrammarMarkType.image, createImage);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const registerLineGraphic = () => {
|
|
40
|
+
registerLine(), Factory.registerGraphic(GrammarMarkType.line, createLine);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const registerPathGraphic = () => {
|
|
44
|
+
registerPath(), Factory.registerGraphic(GrammarMarkType.path, createPath);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const registerRectGraphic = () => {
|
|
48
|
+
registerRect(), Factory.registerGraphic(GrammarMarkType.rect, createRect);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const registerRect3dGraphic = () => {
|
|
52
|
+
registerRect3d(), Factory.registerGraphic(GrammarMarkType.rect3d, createRect3d);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const registerRuleGraphic = () => {
|
|
56
|
+
registerLine(), Factory.registerGraphic(GrammarMarkType.rule, createLine);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const registerShapeGraphic = () => {
|
|
60
|
+
registerPath(), Factory.registerGraphic(GrammarMarkType.shape, createPath);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const registerSymbolGraphic = () => {
|
|
64
|
+
registerSymbol(), Factory.registerGraphic(GrammarMarkType.symbol, createSymbol);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const registerTextGraphic = () => {
|
|
68
|
+
registerText(), Factory.registerGraphic(GrammarMarkType.text, createText);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const registerPolygonGraphic = () => {
|
|
72
|
+
registerPolygon(), Factory.registerGraphic(GrammarMarkType.polygon, createPolygon);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const registerRichTextGraphic = () => {
|
|
76
|
+
registerRichtext(), Factory.registerGraphic(GrammarMarkType.richtext, createRichText);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const registerCellGraphic = () => {
|
|
80
|
+
registerSymbol(), Factory.registerGraphic(GrammarMarkType.cell, createSymbol);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const registerIntervalGraphic = () => {
|
|
84
|
+
registerRect(), Factory.registerGraphic(GrammarMarkType.interval, createRect);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const registerGlyphGraphic = () => {
|
|
88
|
+
registerGlyph(), Factory.registerGraphic(GrammarMarkType.glyph, createGlyph);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export const registerLargeRectsGraphic = () => {
|
|
92
|
+
registerPath(), Factory.registerGraphic(GrammarMarkType.largeRects, (attrs => new LargeRects(attrs)));
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const registerLargeSymbolsGraphic = () => {
|
|
96
|
+
registerPath(), Factory.registerGraphic(GrammarMarkType.largeSymbols, (attrs => new LargeSymbols(attrs)));
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=graphic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/graph/mark/graphic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,OAAO,EACL,SAAS,EACT,YAAY,EACZ,WAAW,EACX,eAAe,EACf,UAAU,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,UAAU,EACV,aAAa,EACb,cAAc,EACd,WAAW,EACX,cAAc,EACd,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,aAAa,EACd,MAAM,+BAA+B,CAAC;AAEvC,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,cAAc,EAAE,CAAC;IACjB,OAAO,CAAC,eAAe,CAAC,eAAe,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAChE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC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,GAAG,EAAE;IAC1C,gBAAgB,EAAE,CAAC;IACnB,OAAO,CAAC,eAAe,CAAC,eAAe,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;AACpE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,cAAc,EAAE,CAAC;IACjB,OAAO,CAAC,eAAe,CAAC,eAAe,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AAC9D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,EAAE;IAC1C,YAAY,EAAE,CAAC;IACf,OAAO,CAAC,eAAe,CAAC,eAAe,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AAChE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACvC,aAAa,EAAE,CAAC;IAChB,OAAO,CAAC,eAAe,CAAC,eAAe,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;AAC9D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,YAAY,EAAE,CAAC;IACf,OAAO,CAAC,eAAe,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC,KAAU,EAAE,EAAE;QACjE,OAAO,IAAI,UAAU,CAAC,KAAK,CAAwB,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,EAAE;IAC9C,YAAY,EAAE,CAAC;IACf,OAAO,CAAC,eAAe,CAAC,eAAe,CAAC,YAAY,EAAE,CAAC,KAAU,EAAE,EAAE;QACnE,OAAO,IAAI,YAAY,CAAC,KAAK,CAAwB,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","file":"graphic.js","sourcesContent":["import { Factory } from '../../core/factory';\nimport { GrammarMarkType } from '../enums';\nimport { LargeRects } from './large-rects';\nimport { LargeSymbols } from './large-symbols';\nimport type { IGraphic } from '@visactor/vrender/es';\n\nimport {\n createArc,\n createCircle,\n createArc3d,\n createPyramid3d,\n createArea,\n createGroup,\n createImage,\n createRect3d,\n createLine,\n createPath,\n createRect,\n createSymbol,\n createText,\n createPolygon,\n createRichText,\n createGlyph,\n registerCircle,\n registerArc,\n registerArc3d,\n registerPyramid3d,\n registerArea,\n registerGroup,\n registerImage,\n registerRect3d,\n registerLine,\n registerPath,\n registerRect,\n registerSymbol,\n registerText,\n registerPolygon,\n registerRichtext,\n registerGlyph\n} from '@visactor/vrender/es/register';\n\nexport const registerCircleGraphic = () => {\n registerCircle();\n Factory.registerGraphic(GrammarMarkType.circle, createCircle);\n};\n\nexport const registerArcGraphic = () => {\n registerArc();\n Factory.registerGraphic(GrammarMarkType.arc, createArc);\n};\n\nexport const registerArc3dGraphic = () => {\n registerArc3d();\n Factory.registerGraphic(GrammarMarkType.arc3d, createArc3d);\n};\n\nexport const registerPyramid3dGraphic = () => {\n registerPyramid3d();\n Factory.registerGraphic(GrammarMarkType.pyramid3d, createPyramid3d);\n};\n\nexport const registerAreaGraphic = () => {\n registerArea();\n Factory.registerGraphic(GrammarMarkType.area, createArea);\n};\n\nexport const registerGroupGraphic = () => {\n registerGroup();\n Factory.registerGraphic(GrammarMarkType.group, createGroup);\n};\n\nexport const registerImageGraphic = () => {\n registerImage();\n Factory.registerGraphic(GrammarMarkType.image, createImage);\n};\n\nexport const registerLineGraphic = () => {\n registerLine();\n Factory.registerGraphic(GrammarMarkType.line, createLine);\n};\n\nexport const registerPathGraphic = () => {\n registerPath();\n Factory.registerGraphic(GrammarMarkType.path, createPath);\n};\n\nexport const registerRectGraphic = () => {\n registerRect();\n Factory.registerGraphic(GrammarMarkType.rect, createRect);\n};\n\nexport const registerRect3dGraphic = () => {\n registerRect3d();\n Factory.registerGraphic(GrammarMarkType.rect3d, createRect3d);\n};\n\nexport const registerRuleGraphic = () => {\n registerLine();\n Factory.registerGraphic(GrammarMarkType.rule, createLine);\n};\n\nexport const registerShapeGraphic = () => {\n registerPath();\n Factory.registerGraphic(GrammarMarkType.shape, createPath);\n};\n\nexport const registerSymbolGraphic = () => {\n registerSymbol();\n Factory.registerGraphic(GrammarMarkType.symbol, createSymbol);\n};\n\nexport const registerTextGraphic = () => {\n registerText();\n Factory.registerGraphic(GrammarMarkType.text, createText);\n};\n\nexport const registerPolygonGraphic = () => {\n registerPolygon();\n Factory.registerGraphic(GrammarMarkType.polygon, createPolygon);\n};\n\nexport const registerRichTextGraphic = () => {\n registerRichtext();\n Factory.registerGraphic(GrammarMarkType.richtext, createRichText);\n};\n\nexport const registerCellGraphic = () => {\n registerSymbol();\n Factory.registerGraphic(GrammarMarkType.cell, createSymbol);\n};\n\nexport const registerIntervalGraphic = () => {\n registerRect();\n Factory.registerGraphic(GrammarMarkType.interval, createRect);\n};\n\nexport const registerGlyphGraphic = () => {\n registerGlyph();\n Factory.registerGraphic(GrammarMarkType.glyph, createGlyph);\n};\n\nexport const registerLargeRectsGraphic = () => {\n registerPath();\n Factory.registerGraphic(GrammarMarkType.largeRects, (attrs: any) => {\n return new LargeRects(attrs) as unknown as IGraphic;\n });\n};\n\nexport const registerLargeSymbolsGraphic = () => {\n registerPath();\n Factory.registerGraphic(GrammarMarkType.largeSymbols, (attrs: any) => {\n return new LargeSymbols(attrs) as unknown as IGraphic;\n });\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IGroupGraphicAttribute } from '@visactor/vrender
|
|
2
|
-
import { Group } from '@visactor/vrender
|
|
1
|
+
import type { IGroupGraphicAttribute } from '@visactor/vrender/es/core';
|
|
2
|
+
import { Group } from '@visactor/vrender/es/core';
|
|
3
3
|
interface LargeRectsAttribute extends IGroupGraphicAttribute {
|
|
4
4
|
points: Float32Array | number[];
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graph/mark/large-rects.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,YAAY,EAA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S,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QACpF,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACnB,QAAkB,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAC/C,CAAC;CACF","file":"large-rects.js","sourcesContent":["/**\n * use when mark render in large mode or progressive mode\n */\nimport type { IGroupGraphicAttribute, IPath, ICustomPath2D } from '@visactor/vrender/es/core';\nimport { Group, CustomPath2D } from '@visactor/vrender/es/core';\n\ninterface LargeRectsAttribute extends IGroupGraphicAttribute {\n points: Float32Array | number[];\n}\n\nexport class LargeRects extends Group {\n constructor(attributes: LargeRectsAttribute) {\n super(attributes);\n this.attribute = attributes;\n // 这里调用渲染和事件绑定逻辑\n this.onSetStage(() => {\n this.render();\n });\n }\n\n render() {\n const pathNode = this.createOrUpdateChild('large-path', {}, 'path') as IPath;\n const points = (this.attribute as LargeRectsAttribute).points;\n const path2d = (pathNode.attribute.path as ICustomPath2D) ?? new CustomPath2D();\n let x;\n let y;\n let width;\n let height;\n\n path2d.clear();\n for (let i = 0, len = points.length; i < len; i += 4) {\n x = points[i];\n y = points[i + 1];\n width = points[i + 2];\n height = points[i + 3];\n path2d.rect(x, y, width, height);\n }\n\n const pathAttrs = Object.assign({}, this.attribute, { path: path2d, points: null });\n this.attribute = {};\n (pathNode as IPath).setAttributes(pathAttrs);\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IGroupGraphicAttribute } from '@visactor/vrender
|
|
2
|
-
import { Group } from '@visactor/vrender
|
|
1
|
+
import type { IGroupGraphicAttribute } from '@visactor/vrender/es/core';
|
|
2
|
+
import { Group } from '@visactor/vrender/es/core';
|
|
3
3
|
interface LargeSymbolsAttribute extends IGroupGraphicAttribute {
|
|
4
4
|
size: number;
|
|
5
5
|
points: Float32Array | number[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isNumber, max } from "@visactor/vutils";
|
|
2
2
|
|
|
3
|
-
import { CustomPath2D, Group, DefaultSymbolAttribute } from "@visactor/vrender
|
|
3
|
+
import { CustomPath2D, Group, DefaultSymbolAttribute } from "@visactor/vrender/es/core";
|
|
4
4
|
|
|
5
5
|
export class LargeSymbols extends Group {
|
|
6
6
|
constructor(attributes) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graph/mark/large-symbols.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"sources":["../src/graph/mark/large-symbols.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAOxF,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,YAAY,UAAiC;QAC3C,KAAK,CAAC,UAAU,CAAC,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC;QAE5B,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE;YACnB,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM;;QACJ,MAAM,QAAQ,GAAG,IAAI,CAAC,mBAAmB,CAAC,YAAY,EAAE,EAAE,EAAE,MAAM,CAAU,CAAC;QAC7E,MAAM,MAAM,GAAI,IAAI,CAAC,SAAmC,CAAC,MAAM,CAAC;QAChE,MAAM,IAAI,GAAG,MAAC,IAAI,CAAC,SAAmC,CAAC,IAAI,mCAAK,sBAAsB,CAAC,IAAe,CAAC;QACvG,MAAM,MAAM,GAAG,MAAC,QAAQ,CAAC,SAAS,CAAC,IAAsB,mCAAI,IAAI,YAAY,EAAE,CAAC;QAChF,IAAI,CAAC,CAAC;QACN,IAAI,CAAC,CAAC;QAEN,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;YACpD,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACd,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAClB,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;YAC9C,MAAM,CAAC,SAAS,EAAE,CAAC;SACpB;QAED,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAChG,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACnB,QAAkB,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAC/C,CAAC;CACF","file":"large-symbols.js","sourcesContent":["import type { ICustomPath2D, IGroupGraphicAttribute, IPath } from '@visactor/vrender/es/core';\nimport { isNumber, max } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { CustomPath2D, Group, DefaultSymbolAttribute } from '@visactor/vrender/es/core';\n\ninterface LargeSymbolsAttribute extends IGroupGraphicAttribute {\n size: number;\n points: Float32Array | number[];\n}\n\nexport class LargeSymbols extends Group {\n constructor(attributes: LargeSymbolsAttribute) {\n super(attributes);\n this.attribute = attributes;\n // 这里调用渲染和事件绑定逻辑\n this.onSetStage(() => {\n this.render();\n });\n }\n\n render() {\n const pathNode = this.createOrUpdateChild('large-path', {}, 'path') as IPath;\n const points = (this.attribute as LargeSymbolsAttribute).points;\n const size = (this.attribute as LargeSymbolsAttribute).size ?? (DefaultSymbolAttribute.size as number);\n const path2d = (pathNode.attribute.path as ICustomPath2D) ?? new CustomPath2D();\n let x;\n let y;\n\n path2d.clear();\n const maxSize = isNumber(size) ? size : max(size[0], size[1]);\n for (let i = 0, len = points.length; i < len; i += 4) {\n x = points[i];\n y = points[i + 1];\n path2d.arc(x, y, maxSize / 2, 0, Math.PI * 2);\n path2d.closePath();\n }\n\n const pathAttrs = Object.assign({}, this.attribute, { path: path2d, points: null, size: null });\n this.attribute = {};\n (pathNode as IPath).setAttributes(pathAttrs);\n }\n}\n"]}
|
package/es/graph/util/env.js
CHANGED
package/es/graph/util/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graph/util/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"sources":["../src/graph/util/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAGpD,MAAM,UAAU,oBAAoB,CAAC,OAA4B;IAC/D,IAAI,OAAO,CAAC,IAAI,EAAE;QAChB,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;KACxD;AACH,CAAC","file":"env.js","sourcesContent":["import { vglobal } from '@visactor/vrender/es/core';\nimport type { IEnvironmentOptions } from '../../types';\n\nexport function configureEnvironment(options: IEnvironmentOptions) {\n if (options.mode) {\n vglobal.setEnv(options.mode, options.modeParams || {});\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FederatedEvent } from '@visactor/vrender
|
|
1
|
+
import type { FederatedEvent } from '@visactor/vrender/es/core';
|
|
2
2
|
import type { IElement } from './../../types/element';
|
|
3
3
|
import type { IView } from './../../types/view';
|
|
4
4
|
import type { EventSourceType } from '../../types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graph/util/events-extend.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAG3D,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,IAAW,EACX,KAAqB,EACrB,IAAc,EACd,IAAY,EACZ,MAAuB;IAEvB,IAAI,MAAM,KAAK,mBAAmB,EAAE;QAClC,MAAM,CAAC,GAAI,KAAa,CAAC,cAAc,CAAC,CAAC,CAAE,KAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QACnF,KAAK,CAAC,CAAC,CAAC,CAAC;KACV;IAEA,KAAa,CAAC,OAAO,GAAG,IAAI,CAAC;IAE9B,OAAO,KAAK,CAAC;AACf,CAAC","file":"events-extend.js","sourcesContent":["import type { FederatedEvent } from '@visactor/vrender
|
|
1
|
+
{"version":3,"sources":["../src/graph/util/events-extend.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAG3D,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,IAAW,EACX,KAAqB,EACrB,IAAc,EACd,IAAY,EACZ,MAAuB;IAEvB,IAAI,MAAM,KAAK,mBAAmB,EAAE;QAClC,MAAM,CAAC,GAAI,KAAa,CAAC,cAAc,CAAC,CAAC,CAAE,KAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QACnF,KAAK,CAAC,CAAC,CAAC,CAAC;KACV;IAEA,KAAa,CAAC,OAAO,GAAG,IAAI,CAAC;IAE9B,OAAO,KAAK,CAAC;AACf,CAAC","file":"events-extend.js","sourcesContent":["import type { FederatedEvent } from '@visactor/vrender/es/core';\nimport type { IElement } from './../../types/element';\nimport type { IView } from './../../types/view';\nimport { point } from './point';\nimport { EVENT_SOURCE_WINDOW } from '../../view/constants';\nimport type { EventSourceType } from '../../types';\n\nexport default function getExtendedEvents(\n view: IView,\n event: FederatedEvent,\n item: IElement,\n type: string,\n source: EventSourceType\n) {\n if (source === EVENT_SOURCE_WINDOW) {\n const e = (event as any).changedTouches ? (event as any).changedTouches[0] : event;\n point(e);\n }\n\n (event as any).element = item;\n\n return event;\n}\n"]}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { IGlyphMeta, IMark } from '../../types';
|
|
2
|
-
import type { IGraphic } from '@visactor/vrender
|
|
3
|
-
import { LargeRects } from '../mark/large-rects';
|
|
4
|
-
import { LargeSymbols } from '../mark/large-symbols';
|
|
2
|
+
import type { IGraphic } from '@visactor/vrender/es/core';
|
|
5
3
|
export declare const isMarkType: (type: string) => boolean;
|
|
6
|
-
export declare function createGraphicItem(mark: IMark, markType: string, attrs?: any): IGraphic<Partial<import("@visactor/vrender
|
|
7
|
-
export declare function createGlyphGraphicItem(mark: IMark, glyphMeta: IGlyphMeta, attrs?: any):
|
|
4
|
+
export declare function createGraphicItem(mark: IMark, markType: string, attrs?: any): IGraphic<Partial<import("@visactor/vrender/es/core").IGraphicAttribute>>;
|
|
5
|
+
export declare function createGlyphGraphicItem(mark: IMark, glyphMeta: IGlyphMeta, attrs?: any): IGraphic<Partial<import("@visactor/vrender/es/core").IGraphicAttribute>>;
|
|
8
6
|
export declare const removeGraphicItem: (graphicItem: IGraphic) => void;
|
|
9
7
|
export declare const getMarkTypeOfLarge: (markType: string) => string;
|
package/es/graph/util/graphic.js
CHANGED
|
@@ -1,54 +1,32 @@
|
|
|
1
|
-
import { createArc, createArea, createGroup, createImage, createRect3d, createLine, createPath, createRect, createSymbol, createRichText, createText, createPolygon, createGlyph, createArc3d, createPyramid3d, createCircle } from "@visactor/vrender-core";
|
|
2
|
-
|
|
3
1
|
import { HOOK_EVENT, GrammarMarkType } from "../enums";
|
|
4
2
|
|
|
5
3
|
import { BridgeElementKey } from "../constants";
|
|
6
4
|
|
|
7
|
-
import { LargeRects } from "../mark/large-rects";
|
|
8
|
-
|
|
9
|
-
import { LargeSymbols } from "../mark/large-symbols";
|
|
10
|
-
|
|
11
5
|
import { Factory } from "../../core/factory";
|
|
12
6
|
|
|
13
|
-
|
|
14
|
-
circle: createCircle,
|
|
15
|
-
arc: createArc,
|
|
16
|
-
arc3d: createArc3d,
|
|
17
|
-
pyramid3d: createPyramid3d,
|
|
18
|
-
area: createArea,
|
|
19
|
-
group: createGroup,
|
|
20
|
-
image: createImage,
|
|
21
|
-
rect3d: createRect3d,
|
|
22
|
-
line: createLine,
|
|
23
|
-
path: createPath,
|
|
24
|
-
rect: createRect,
|
|
25
|
-
rule: createLine,
|
|
26
|
-
shape: createPath,
|
|
27
|
-
symbol: createSymbol,
|
|
28
|
-
text: createText,
|
|
29
|
-
richtext: createRichText,
|
|
30
|
-
polygon: createPolygon,
|
|
31
|
-
cell: createSymbol,
|
|
32
|
-
interval: createRect
|
|
33
|
-
};
|
|
7
|
+
import { Logger } from "@visactor/vutils";
|
|
34
8
|
|
|
35
|
-
export const isMarkType = type => !!
|
|
9
|
+
export const isMarkType = type => !!GrammarMarkType[type];
|
|
36
10
|
|
|
37
11
|
export function createGraphicItem(mark, markType, attrs = {}) {
|
|
38
12
|
var _a;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const graphicItem = itemCreator[markType] ? itemCreator[markType](attrs) : Factory.createGraphicComponent(markType, attrs, {
|
|
13
|
+
mark.emit(HOOK_EVENT.BEFORE_CREATE_VRENDER_MARK);
|
|
14
|
+
const graphicItem = Factory.getGraphicType(markType) ? Factory.createGraphic(markType, attrs) : Factory.createGraphicComponent(markType, attrs, {
|
|
42
15
|
skipDefault: null === (_a = null == mark ? void 0 : mark.spec) || void 0 === _a ? void 0 : _a.skipTheme
|
|
43
16
|
});
|
|
17
|
+
if (!graphicItem) {
|
|
18
|
+
Logger.getInstance().error(`create ${markType} graphic failed!`);
|
|
19
|
+
}
|
|
44
20
|
return mark.emit(HOOK_EVENT.AFTER_CREATE_VRENDER_MARK), graphicItem;
|
|
45
21
|
}
|
|
46
22
|
|
|
47
23
|
export function createGlyphGraphicItem(mark, glyphMeta, attrs = {}) {
|
|
48
|
-
mark.emit(HOOK_EVENT.BEFORE_CREATE_VRENDER_MARK);
|
|
49
|
-
const graphicItem =
|
|
50
|
-
|
|
51
|
-
|
|
24
|
+
if (mark.emit(HOOK_EVENT.BEFORE_CREATE_VRENDER_MARK), !Factory.getGraphicType(GrammarMarkType.glyph)) return;
|
|
25
|
+
const graphicItem = Factory.createGraphic(GrammarMarkType.glyph, attrs), glyphMarks = glyphMeta.getMarks(), subGraphics = Object.keys(glyphMarks).map((name => {
|
|
26
|
+
if (Factory.getGraphicType(glyphMarks[name])) {
|
|
27
|
+
const graphic = Factory.createGraphic(glyphMarks[name]);
|
|
28
|
+
if (graphic) return graphic.name = name, graphic;
|
|
29
|
+
}
|
|
52
30
|
}));
|
|
53
31
|
return graphicItem.setSubGraphic(subGraphics), mark.emit(HOOK_EVENT.AFTER_CREATE_VRENDER_MARK),
|
|
54
32
|
graphicItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graph/util/graphic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/graph/util/graphic.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAA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AAE,CAAC;IACxC,MAAM,WAAW,GAAe,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACjE,IAAI,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE;YAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;YACxD,IAAI,OAAO,EAAE;gBACX,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;gBACpB,OAAO,OAAO,CAAC;aAChB;SACF;IACH,CAAC,CAAC,CAAC;IACH,WAAW,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAEvC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC;IAChD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,WAAqB,EAAE,EAAE;IACzD,IAAI,WAAW,EAAE;QACf,WAAW,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;QACrC,WAAW,CAAC,OAAO,EAAE,CAAC;QACtB,IAAI,WAAW,CAAC,MAAM,EAAE;YACtB,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;SAC7C;KACF;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAAgB,EAAE,EAAE;IACrD,IAAI,QAAQ,KAAK,eAAe,CAAC,IAAI,EAAE;QACrC,OAAO,eAAe,CAAC,UAAU,CAAC;KACnC;IAED,IAAI,QAAQ,KAAK,eAAe,CAAC,MAAM,EAAE;QACvC,OAAO,eAAe,CAAC,YAAY,CAAC;KACrC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC","file":"graphic.js","sourcesContent":["import type { IGlyphMeta, IMark } from '../../types';\nimport type { IGraphic } from '@visactor/vrender/es/core';\n// eslint-disable-next-line no-duplicate-imports\n\nimport { HOOK_EVENT, GrammarMarkType } from '../enums';\nimport { BridgeElementKey } from '../constants';\nimport { Factory } from '../../core/factory';\nimport { Logger } from '@visactor/vutils';\n\nexport const isMarkType = (type: string) => {\n return !!GrammarMarkType[type];\n};\n\nexport function createGraphicItem(mark: IMark, markType: string, attrs: any = {}) {\n mark.emit(HOOK_EVENT.BEFORE_CREATE_VRENDER_MARK);\n\n const graphicItem: IGraphic = Factory.getGraphicType(markType)\n ? Factory.createGraphic(markType, attrs)\n : Factory.createGraphicComponent(markType, attrs, {\n skipDefault: (mark as any)?.spec?.skipTheme\n });\n\n if (!graphicItem) {\n const logger = Logger.getInstance();\n logger.error(`create ${markType} graphic failed!`);\n }\n\n mark.emit(HOOK_EVENT.AFTER_CREATE_VRENDER_MARK);\n return graphicItem;\n}\n\nexport function createGlyphGraphicItem(mark: IMark, glyphMeta: IGlyphMeta, attrs: any = {}) {\n mark.emit(HOOK_EVENT.BEFORE_CREATE_VRENDER_MARK);\n if (!Factory.getGraphicType(GrammarMarkType.glyph)) {\n return;\n }\n const graphicItem = Factory.createGraphic(GrammarMarkType.glyph, attrs);\n const glyphMarks = glyphMeta.getMarks();\n const subGraphics: IGraphic[] = Object.keys(glyphMarks).map(name => {\n if (Factory.getGraphicType(glyphMarks[name])) {\n const graphic = Factory.createGraphic(glyphMarks[name]);\n if (graphic) {\n graphic.name = name;\n return graphic;\n }\n }\n });\n graphicItem.setSubGraphic(subGraphics);\n\n mark.emit(HOOK_EVENT.AFTER_CREATE_VRENDER_MARK);\n return graphicItem;\n}\n\nexport const removeGraphicItem = (graphicItem: IGraphic) => {\n if (graphicItem) {\n graphicItem[BridgeElementKey] = null;\n graphicItem.release();\n if (graphicItem.parent) {\n graphicItem.parent.removeChild(graphicItem);\n }\n }\n};\n\nexport const getMarkTypeOfLarge = (markType: string) => {\n if (markType === GrammarMarkType.rect) {\n return GrammarMarkType.largeRects;\n }\n\n if (markType === GrammarMarkType.symbol) {\n return GrammarMarkType.largeSymbols;\n }\n\n return markType;\n};\n"]}
|
package/es/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export declare const version = "0.10.0-alpha.
|
|
1
|
+
export declare const version = "0.10.0-alpha.3";
|
|
2
2
|
export * from './graph';
|
|
3
3
|
export * from './interactions';
|
|
4
4
|
export { View } from './view';
|
|
5
|
+
export { Scale, registerScale } from './view/scale';
|
|
6
|
+
export { Coordinate, registerCoordinate } from './view/coordinate';
|
|
5
7
|
export { parseFunctionType, invokeFunctionType } from './parse/util';
|
|
6
8
|
export { GrammarBase } from './view/grammar-base';
|
|
7
9
|
export * from './util/text';
|
|
@@ -13,8 +15,9 @@ export * from './glyph';
|
|
|
13
15
|
export * from './component';
|
|
14
16
|
export * from './transforms';
|
|
15
17
|
export * from './graph/animation/animation';
|
|
16
|
-
export { vglobal } from '@visactor/vrender
|
|
18
|
+
export { vglobal } from '@visactor/vrender/es/core';
|
|
17
19
|
export * from './env';
|
|
18
20
|
export * from './interactions';
|
|
19
21
|
export * from './semantic-marks/cell';
|
|
20
22
|
export * from './semantic-marks/interval';
|
|
23
|
+
export * from './graph/mark/graphic';
|
package/es/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const version = "0.10.0-alpha.
|
|
1
|
+
export const version = "0.10.0-alpha.3";
|
|
2
2
|
|
|
3
3
|
export * from "./graph";
|
|
4
4
|
|
|
@@ -6,6 +6,10 @@ export * from "./interactions";
|
|
|
6
6
|
|
|
7
7
|
export { View } from "./view";
|
|
8
8
|
|
|
9
|
+
export { Scale, registerScale } from "./view/scale";
|
|
10
|
+
|
|
11
|
+
export { Coordinate, registerCoordinate } from "./view/coordinate";
|
|
12
|
+
|
|
9
13
|
export { parseFunctionType, invokeFunctionType } from "./parse/util";
|
|
10
14
|
|
|
11
15
|
export { GrammarBase } from "./view/grammar-base";
|
|
@@ -28,7 +32,7 @@ export * from "./transforms";
|
|
|
28
32
|
|
|
29
33
|
export * from "./graph/animation/animation";
|
|
30
34
|
|
|
31
|
-
export { vglobal } from "@visactor/vrender
|
|
35
|
+
export { vglobal } from "@visactor/vrender/es/core";
|
|
32
36
|
|
|
33
37
|
export * from "./env";
|
|
34
38
|
|
|
@@ -37,4 +41,6 @@ export * from "./interactions";
|
|
|
37
41
|
export * from "./semantic-marks/cell";
|
|
38
42
|
|
|
39
43
|
export * from "./semantic-marks/interval";
|
|
44
|
+
|
|
45
|
+
export * from "./graph/mark/graphic";
|
|
40
46
|
//# sourceMappingURL=index.js.map
|
package/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAExC,cAAc,SAAS,CAAC;AAExB,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EACL,cAAc,EACd,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAExC,cAAc,SAAS,CAAC;AAExB,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EACL,cAAc,EACd,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC","file":"index.js","sourcesContent":["// -- Exports -----\nexport const version = \"0.10.0-alpha.3\";\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/es/core';\nexport * from './env';\nexport * from './interactions';\nexport * from './semantic-marks/cell';\nexport * from './semantic-marks/interval';\nexport * from './graph/mark/graphic';\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IPolygon } from '@visactor/vrender
|
|
1
|
+
import type { IPolygon } from '@visactor/vrender/es/core';
|
|
2
2
|
import type { BrushActiveOptions, IView } from '../types';
|
|
3
3
|
import { BrushBase } from './brush-base';
|
|
4
4
|
import { type IBounds } from '@visactor/vutils';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/interactions/brush-active.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,MAAM,OAAO,WAAY,SAAQ,SAA6B;IAQ5D,YAAY,IAAW,EAAE,MAA2B;QAClD,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,WAAW,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;QAPrE,SAAI,GAAW,WAAW,CAAC,IAAI,CAAC;QAUhC,sBAAiB,GAAG,CAAC,OAIpB,EAAE,EAAE;YACH,MAAM,QAAQ,GAAiC,EAAE,CAAC;YAElD,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBACzB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;oBACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC;oBAE1F,IAAI,QAAQ,EAAE;wBACZ,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;wBAClB,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;qBACjC;yBAAM;wBACL,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;qBACpC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACxC,CAAC,CAAC;IAvBF,CAAC;;AATM,gBAAI,GAAW,cAAc,CAAC;AAG9B,0BAAc,GAAuB;IAC1C,KAAK,EAAE,oBAAoB,CAAC,MAAM;CACnC,CAAC","file":"brush-active.js","sourcesContent":["import type { IPolygon } from '@visactor/vrender
|
|
1
|
+
{"version":3,"sources":["../src/interactions/brush-active.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,MAAM,OAAO,WAAY,SAAQ,SAA6B;IAQ5D,YAAY,IAAW,EAAE,MAA2B;QAClD,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,WAAW,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;QAPrE,SAAI,GAAW,WAAW,CAAC,IAAI,CAAC;QAUhC,sBAAiB,GAAG,CAAC,OAIpB,EAAE,EAAE;YACH,MAAM,QAAQ,GAAiC,EAAE,CAAC;YAElD,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBACzB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;oBACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC;oBAE1F,IAAI,QAAQ,EAAE;wBACZ,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;wBAClB,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;qBACjC;yBAAM;wBACL,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;qBACpC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACxC,CAAC,CAAC;IAvBF,CAAC;;AATM,gBAAI,GAAW,cAAc,CAAC;AAG9B,0BAAc,GAAuB;IAC1C,KAAK,EAAE,oBAAoB,CAAC,MAAM;CACnC,CAAC","file":"brush-active.js","sourcesContent":["import type { IPolygon } from '@visactor/vrender/es/core';\nimport { InteractionStateEnum } from '../graph/enums';\nimport type { BrushActiveOptions, IElement, IGlyphElement, IView } from '../types';\nimport { BrushBase } from './brush-base';\nimport { type IBounds } from '@visactor/vutils';\n\nexport class BrushActive extends BrushBase<BrushActiveOptions> {\n static type: string = 'brush-active';\n type: string = BrushActive.type;\n\n static defaultOptions: BrushActiveOptions = {\n state: InteractionStateEnum.active\n };\n\n constructor(view: IView, option?: BrushActiveOptions) {\n super(view, Object.assign({}, BrushActive.defaultOptions, option));\n }\n\n handleBrushUpdate = (options: {\n operateType: string;\n operateMask: IPolygon;\n operatedMaskAABBBounds: { [name: string]: IBounds };\n }) => {\n const elements: (IElement | IGlyphElement)[] = [];\n\n this._marks.forEach(mark => {\n mark.elements.forEach(el => {\n const isActive = this.isBrushContainGraphicItem(options.operateMask, el.getGraphicItem());\n\n if (isActive) {\n elements.push(el);\n el.addState(this.options.state);\n } else {\n el.removeState(this.options.state);\n }\n });\n });\n\n this.dispatchEvent(options, elements);\n };\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Brush } from '@visactor/vrender-components';
|
|
2
2
|
import type { BrushOptions, IElement, IGlyphElement, IMark, IView, InteractionEventHandler } from '../types';
|
|
3
3
|
import { BaseInteraction } from './base';
|
|
4
|
-
import type { IGraphic, IPolygon } from '@visactor/vrender
|
|
4
|
+
import type { IGraphic, IPolygon } from '@visactor/vrender/es/core';
|
|
5
5
|
import { type IBounds } from '@visactor/vutils';
|
|
6
6
|
export declare abstract class BrushBase<T extends BrushOptions> extends BaseInteraction<T> {
|
|
7
7
|
options: T;
|