@visactor/vgrammar-core 0.7.7-alpha.2 → 0.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/cjs/component/axis.js.map +1 -1
  2. package/cjs/component/crosshair.js.map +1 -1
  3. package/cjs/component/datazoom.js.map +1 -1
  4. package/cjs/component/grid.js.map +1 -1
  5. package/cjs/component/label.js.map +1 -1
  6. package/cjs/component/legend.js.map +1 -1
  7. package/cjs/component/player.js.map +1 -1
  8. package/cjs/component/scrollbar.js.map +1 -1
  9. package/cjs/component/slider.js.map +1 -1
  10. package/cjs/component/title.js.map +1 -1
  11. package/cjs/component/tooltip.js.map +1 -1
  12. package/cjs/core/factory.d.ts +2 -2
  13. package/cjs/core/factory.js.map +1 -1
  14. package/cjs/glyph/index.js +1 -2
  15. package/cjs/glyph/ripple.js +2 -2
  16. package/cjs/glyph/ripple.js.map +1 -1
  17. package/cjs/graph/animation/animation/grow-cartesian.js.map +1 -1
  18. package/cjs/graph/animation/animator.js +4 -4
  19. package/cjs/graph/animation/animator.js.map +1 -1
  20. package/cjs/graph/animation/attribute.d.ts +2 -2
  21. package/cjs/graph/animation/attribute.js +6 -6
  22. package/cjs/graph/animation/attribute.js.map +1 -1
  23. package/cjs/graph/animation/morph.js +4 -4
  24. package/cjs/graph/animation/morph.js.map +1 -1
  25. package/cjs/graph/attributes/index.js.map +1 -1
  26. package/cjs/graph/canvas-renderer.d.ts +1 -1
  27. package/cjs/graph/canvas-renderer.js +7 -6
  28. package/cjs/graph/canvas-renderer.js.map +1 -1
  29. package/cjs/graph/element.d.ts +1 -1
  30. package/cjs/graph/element.js +2 -2
  31. package/cjs/graph/element.js.map +1 -1
  32. package/cjs/graph/glyph-element.d.ts +1 -1
  33. package/cjs/graph/glyph-element.js.map +1 -1
  34. package/cjs/graph/mark/large-rects.d.ts +2 -2
  35. package/cjs/graph/mark/large-rects.js +3 -3
  36. package/cjs/graph/mark/large-rects.js.map +1 -1
  37. package/cjs/graph/mark/large-symbols.d.ts +2 -2
  38. package/cjs/graph/mark/large-symbols.js +3 -3
  39. package/cjs/graph/mark/large-symbols.js.map +1 -1
  40. package/cjs/graph/util/env.js +2 -2
  41. package/cjs/graph/util/env.js.map +1 -1
  42. package/cjs/graph/util/events-extend.d.ts +1 -1
  43. package/cjs/graph/util/events-extend.js.map +1 -1
  44. package/cjs/graph/util/graphic.d.ts +3 -3
  45. package/cjs/graph/util/graphic.js +21 -21
  46. package/cjs/graph/util/graphic.js.map +1 -1
  47. package/cjs/index.d.ts +1 -3
  48. package/cjs/index.js +3 -13
  49. package/cjs/index.js.map +1 -1
  50. package/cjs/parse/mark.js +2 -1
  51. package/cjs/parse/option.js +1 -2
  52. package/cjs/semantic-marks/cell.d.ts +1 -1
  53. package/cjs/semantic-marks/interval.d.ts +1 -1
  54. package/cjs/types/animate.d.ts +1 -1
  55. package/cjs/types/animate.js.map +1 -1
  56. package/cjs/types/component.d.ts +1 -1
  57. package/cjs/types/component.js.map +1 -1
  58. package/cjs/types/coordinate.js +2 -1
  59. package/cjs/types/data.js +1 -2
  60. package/cjs/types/element.d.ts +1 -1
  61. package/cjs/types/element.js.map +1 -1
  62. package/cjs/types/grammar.d.ts +1 -1
  63. package/cjs/types/grammar.js.map +1 -1
  64. package/cjs/types/index.js +1 -1
  65. package/cjs/types/mark.d.ts +1 -1
  66. package/cjs/types/mark.js.map +1 -1
  67. package/cjs/types/morph.d.ts +1 -1
  68. package/cjs/types/morph.js.map +1 -1
  69. package/cjs/types/plot.d.ts +1 -1
  70. package/cjs/types/plot.js.map +1 -1
  71. package/cjs/types/renderer.d.ts +1 -1
  72. package/cjs/types/renderer.js.map +1 -1
  73. package/cjs/types/theme.d.ts +1 -1
  74. package/cjs/types/theme.js.map +1 -1
  75. package/cjs/types/view.d.ts +1 -1
  76. package/cjs/types/view.js.map +1 -1
  77. package/cjs/util/text.d.ts +1 -1
  78. package/cjs/util/text.js +3 -3
  79. package/cjs/util/text.js.map +1 -1
  80. package/cjs/view/View.d.ts +1 -1
  81. package/cjs/view/View.js +7 -7
  82. package/cjs/view/View.js.map +1 -1
  83. package/cjs/view/component.d.ts +1 -1
  84. package/cjs/view/mark.d.ts +2 -2
  85. package/cjs/view/mark.js.map +1 -1
  86. package/es/component/axis.js.map +1 -1
  87. package/es/component/crosshair.js.map +1 -1
  88. package/es/component/datazoom.js.map +1 -1
  89. package/es/component/grid.js.map +1 -1
  90. package/es/component/label.js.map +1 -1
  91. package/es/component/legend.js.map +1 -1
  92. package/es/component/player.js.map +1 -1
  93. package/es/component/scrollbar.js.map +1 -1
  94. package/es/component/slider.js.map +1 -1
  95. package/es/component/title.js.map +1 -1
  96. package/es/component/tooltip.js.map +1 -1
  97. package/es/core/factory.d.ts +2 -2
  98. package/es/core/factory.js.map +1 -1
  99. package/es/glyph/boxplot.js +2 -1
  100. package/es/glyph/index.js +1 -2
  101. package/es/glyph/ripple.js +2 -2
  102. package/es/glyph/ripple.js.map +1 -1
  103. package/es/graph/animation/animation/grow-cartesian.js.map +1 -1
  104. package/es/graph/animation/animator.js +1 -1
  105. package/es/graph/animation/animator.js.map +1 -1
  106. package/es/graph/animation/attribute.d.ts +2 -2
  107. package/es/graph/animation/attribute.js +1 -1
  108. package/es/graph/animation/attribute.js.map +1 -1
  109. package/es/graph/animation/morph.js +1 -1
  110. package/es/graph/animation/morph.js.map +1 -1
  111. package/es/graph/attributes/index.js.map +1 -1
  112. package/es/graph/canvas-renderer.d.ts +1 -1
  113. package/es/graph/canvas-renderer.js +1 -3
  114. package/es/graph/canvas-renderer.js.map +1 -1
  115. package/es/graph/element.d.ts +1 -1
  116. package/es/graph/element.js +1 -1
  117. package/es/graph/element.js.map +1 -1
  118. package/es/graph/glyph-element.d.ts +1 -1
  119. package/es/graph/glyph-element.js.map +1 -1
  120. package/es/graph/mark/large-rects.d.ts +2 -2
  121. package/es/graph/mark/large-rects.js +1 -1
  122. package/es/graph/mark/large-rects.js.map +1 -1
  123. package/es/graph/mark/large-symbols.d.ts +2 -2
  124. package/es/graph/mark/large-symbols.js +1 -1
  125. package/es/graph/mark/large-symbols.js.map +1 -1
  126. package/es/graph/util/env.js +1 -1
  127. package/es/graph/util/env.js.map +1 -1
  128. package/es/graph/util/events-extend.d.ts +1 -1
  129. package/es/graph/util/events-extend.js.map +1 -1
  130. package/es/graph/util/graphic.d.ts +3 -3
  131. package/es/graph/util/graphic.js +1 -1
  132. package/es/graph/util/graphic.js.map +1 -1
  133. package/es/index.d.ts +1 -3
  134. package/es/index.js +2 -7
  135. package/es/index.js.map +1 -1
  136. package/es/parse/mark.js +2 -1
  137. package/es/parse/option.js +1 -2
  138. package/es/semantic-marks/cell.d.ts +1 -1
  139. package/es/semantic-marks/interval.d.ts +1 -1
  140. package/es/types/animate.d.ts +1 -1
  141. package/es/types/animate.js.map +1 -1
  142. package/es/types/component.d.ts +1 -1
  143. package/es/types/component.js.map +1 -1
  144. package/es/types/coordinate.js +2 -1
  145. package/es/types/data.js +1 -2
  146. package/es/types/element.d.ts +1 -1
  147. package/es/types/element.js.map +1 -1
  148. package/es/types/grammar.d.ts +1 -1
  149. package/es/types/grammar.js.map +1 -1
  150. package/es/types/index.js +1 -1
  151. package/es/types/mark.d.ts +1 -1
  152. package/es/types/mark.js.map +1 -1
  153. package/es/types/morph.d.ts +1 -1
  154. package/es/types/morph.js.map +1 -1
  155. package/es/types/plot.d.ts +1 -1
  156. package/es/types/plot.js.map +1 -1
  157. package/es/types/renderer.d.ts +1 -1
  158. package/es/types/renderer.js.map +1 -1
  159. package/es/types/theme.d.ts +1 -1
  160. package/es/types/theme.js.map +1 -1
  161. package/es/types/view.d.ts +1 -1
  162. package/es/types/view.js.map +1 -1
  163. package/es/util/text.d.ts +1 -1
  164. package/es/util/text.js +1 -1
  165. package/es/util/text.js.map +1 -1
  166. package/es/view/View.d.ts +1 -1
  167. package/es/view/View.js +1 -1
  168. package/es/view/View.js.map +1 -1
  169. package/es/view/component.d.ts +1 -1
  170. package/es/view/mark.d.ts +2 -2
  171. package/es/view/mark.js.map +1 -1
  172. package/package.json +5 -6
  173. package/cjs/env.d.ts +0 -1
  174. package/cjs/env.js +0 -20
  175. package/cjs/env.js.map +0 -1
  176. package/es/env.d.ts +0 -1
  177. package/es/env.js +0 -1
  178. package/es/env.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graph/glyph-element.ts"],"names":[],"mappings":";;;AAAA,6CAAqE;AACrE,2DAAkD;AAUlD,6CAA6E;AAC7E,2CAAmE;AACnE,mCAAiE;AACjE,uCAAoC;AACpC,0CAAqD;AAGrD,MAAa,YAAa,SAAQ,iBAAO;IAQvC,YAAY,IAAgB;QAC1B,KAAK,CAAC,IAAI,CAAC,CAAC;QAoDJ,kBAAa,GAAG,CAAC,SAAiB,EAAE,UAAoB,EAAE,EAAE;;YACpE,MAAM,cAAc,GAAG,CAAC,IAAA,cAAK,EAAC,MAAA,IAAI,CAAC,oBAAoB,0CAAG,SAAS,CAAC,CAAC,CAAC;YACtE,MAAM,OAAO,GAAG,cAAc;gBAC5B,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC;gBACtC,CAAC,CAAC,MAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAe,CAAC,MAAM,0CAAG,SAAS,CAAC,CAAC;YAE1D,MAAM,oBAAoB,GAAG,EAG5B,CAAC;YAEF,IAAI,CAAC,OAAO,EAAE;gBACZ,OAAO,oBAAoB,CAAC;aAC7B;YAED,IAAI,IAAA,mBAAU,EAAC,OAAO,CAAC,EAAE;gBACvB,oBAAoB,CAAC,UAAU,GAAI,OAAgC,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;gBAClH,OAAO,oBAAoB,CAAC;aAC7B;YAED,IAAI,CAAC,cAAc,KAAI,MAAA,IAAI,CAAC,WAAW,CAAC,WAAW,0CAAG,SAAS,CAAC,CAAA,EAAE;gBAChE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@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';\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 const stateAnimation = isBoolean(hasAnimation)\n ? hasAnimation\n : !!(this.mark.getSpec() as MarkSpec).animation?.state;\n this.graphicItem.glyphStateProxy = this.getStateAttrs;\n this.graphicItem.useStates(this.states, stateAnimation);\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":[],"mappings":";;;AAAA,6CAAqE;AACrE,2DAAkD;AAUlD,6CAA6E;AAC7E,2CAAmE;AACnE,mCAAiE;AACjE,uCAAoC;AACpC,0CAAqD;AAGrD,MAAa,YAAa,SAAQ,iBAAO;IAQvC,YAAY,IAAgB;QAC1B,KAAK,CAAC,IAAI,CAAC,CAAC;QAoDJ,kBAAa,GAAG,CAAC,SAAiB,EAAE,UAAoB,EAAE,EAAE;;YACpE,MAAM,cAAc,GAAG,CAAC,IAAA,cAAK,EAAC,MAAA,IAAI,CAAC,oBAAoB,0CAAG,SAAS,CAAC,CAAC,CAAC;YACtE,MAAM,OAAO,GAAG,cAAc;gBAC5B,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC;gBACtC,CAAC,CAAC,MAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAe,CAAC,MAAM,0CAAG,SAAS,CAAC,CAAC;YAE1D,MAAM,oBAAoB,GAAG,EAG5B,CAAC;YAEF,IAAI,CAAC,OAAO,EAAE;gBACZ,OAAO,oBAAoB,CAAC;aAC7B;YAED,IAAI,IAAA,mBAAU,EAAC,OAAO,CAAC,EAAE;gBACvB,oBAAoB,CAAC,UAAU,GAAI,OAAgC,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;gBAClH,OAAO,oBAAoB,CAAC;aAC7B;YAED,IAAI,CAAC,cAAc,KAAI,MAAA,IAAI,CAAC,WA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":["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';\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';\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 const stateAnimation = isBoolean(hasAnimation)\n ? hasAnimation\n : !!(this.mark.getSpec() as MarkSpec).animation?.state;\n this.graphicItem.glyphStateProxy = this.getStateAttrs;\n this.graphicItem.useStates(this.states, stateAnimation);\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,5 +1,5 @@
1
- import type { IGroupGraphicAttribute } from '@visactor/vrender-core';
2
- import { Group } from '@visactor/vrender-core';
1
+ import type { IGroupGraphicAttribute } from '@visactor/vrender';
2
+ import { Group } from '@visactor/vrender';
3
3
  interface LargeRectsAttribute extends IGroupGraphicAttribute {
4
4
  points: Float32Array | number[];
5
5
  }
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.LargeRects = void 0;
6
6
 
7
- const vrender_core_1 = require("@visactor/vrender-core");
7
+ const vrender_1 = require("@visactor/vrender");
8
8
 
9
- class LargeRects extends vrender_core_1.Group {
9
+ class LargeRects extends vrender_1.Group {
10
10
  constructor(attributes) {
11
11
  super(attributes), this.attribute = attributes, this.onSetStage((() => {
12
12
  this.render();
@@ -14,7 +14,7 @@ class LargeRects extends vrender_core_1.Group {
14
14
  }
15
15
  render() {
16
16
  var _a;
17
- const pathNode = this.createOrUpdateChild("large-path", {}, "path"), points = this.attribute.points, path2d = null !== (_a = pathNode.attribute.path) && void 0 !== _a ? _a : new vrender_core_1.CustomPath2D;
17
+ const pathNode = this.createOrUpdateChild("large-path", {}, "path"), points = this.attribute.points, path2d = null !== (_a = pathNode.attribute.path) && void 0 !== _a ? _a : new vrender_1.CustomPath2D;
18
18
  let x, y, width, height;
19
19
  path2d.clear();
20
20
  for (let i = 0, len = points.length; i < len; i += 4) x = points[i], y = points[i + 1],
@@ -1 +1 @@
1
- {"version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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;AAhCD,gCAgCC","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-core';\nimport { Group, CustomPath2D } from '@visactor/vrender-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
+ {"version":3,"sources":["../src/graph/mark/large-rects.ts"],"names":[],"mappings":";;;AAIA,+CAAwD;AAMxD,MAAa,UAAW,SAAQ,eAAK;IACnC,YAAY,UAA+B;QACzC,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,SAAiC,CAAC,MAAM,CAAC;QAC9D,MAAM,MAAM,GAAG,MAAC,QAAQ,CAAC,SAAS,CAAC,IAAsB,mCAAI,IAAI,sBAAY,EAAE,CAAC;QAChF,IAAI,CAAC,CAAC;QACN,IAAI,CAAC,CAAC;QACN,IAAI,KAAK,CAAC;QACV,IAAI,MAAM,CAAC;QAEX,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,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,KAAK,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACtB,MAAM,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACvB,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;SAClC;QAED,MAAM,SAAS,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;AAhCD,gCAgCC","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';\nimport { Group, CustomPath2D } from '@visactor/vrender';\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-core';
2
- import { Group } from '@visactor/vrender-core';
1
+ import type { IGroupGraphicAttribute } from '@visactor/vrender';
2
+ import { Group } from '@visactor/vrender';
3
3
  interface LargeSymbolsAttribute extends IGroupGraphicAttribute {
4
4
  size: number;
5
5
  points: Float32Array | number[];
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.LargeSymbols = void 0;
6
6
 
7
- const vutils_1 = require("@visactor/vutils"), vrender_core_1 = require("@visactor/vrender-core");
7
+ const vutils_1 = require("@visactor/vutils"), vrender_1 = require("@visactor/vrender");
8
8
 
9
- class LargeSymbols extends vrender_core_1.Group {
9
+ class LargeSymbols extends vrender_1.Group {
10
10
  constructor(attributes) {
11
11
  super(attributes), this.attribute = attributes, this.onSetStage((() => {
12
12
  this.render();
@@ -14,7 +14,7 @@ class LargeSymbols extends vrender_core_1.Group {
14
14
  }
15
15
  render() {
16
16
  var _a, _b;
17
- const pathNode = this.createOrUpdateChild("large-path", {}, "path"), points = this.attribute.points, size = null !== (_a = this.attribute.size) && void 0 !== _a ? _a : vrender_core_1.DefaultSymbolAttribute.size, path2d = null !== (_b = pathNode.attribute.path) && void 0 !== _b ? _b : new vrender_core_1.CustomPath2D;
17
+ const pathNode = this.createOrUpdateChild("large-path", {}, "path"), points = this.attribute.points, size = null !== (_a = this.attribute.size) && void 0 !== _a ? _a : vrender_1.DefaultSymbolAttribute.size, path2d = null !== (_b = pathNode.attribute.path) && void 0 !== _b ? _b : new vrender_1.CustomPath2D;
18
18
  let x, y;
19
19
  path2d.clear();
20
20
  const maxSize = (0, vutils_1.isNumber)(size) ? size : (0, vutils_1.max)(size[0], size[1]);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graph/mark/large-symbols.ts"],"names":[],"mappings":";;;AACA,6CAAiD;AAEjD,yDAAqF;AAOrF,MAAa,YAAa,SAAQ,oBAAK;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,qCAAsB,CAAC,IAAe,CAAC;QACvG,MAAM,MAAM,GAAG,MAAC,QAAQ,CAAC,SAAS,CAAC,IAAsB,mCAAI,IAAI,2BAAY,EAAE,CAAC;QAChF,IAAI,CAAC,CAAC;QACN,IAAI,CAAC,CAAC;QAEN,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,IAAA,iBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,YAAG,EAAC,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;AA/BD,oCA+BC","file":"large-symbols.js","sourcesContent":["import type { ICustomPath2D, IGroupGraphicAttribute, IPath } from '@visactor/vrender-core';\nimport { isNumber, max } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { CustomPath2D, Group, DefaultSymbolAttribute } from '@visactor/vrender-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"]}
1
+ {"version":3,"sources":["../src/graph/mark/large-symbols.ts"],"names":[],"mappings":";;;AACA,6CAAiD;AAEjD,+CAAgF;AAOhF,MAAa,YAAa,SAAQ,eAAK;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,gCAAsB,CAAC,IAAe,CAAC;QACvG,MAAM,MAAM,GAAG,MAAC,QAAQ,CAAC,SAAS,CAAC,IAAsB,mCAAI,IAAI,sBAAY,EAAE,CAAC;QAChF,IAAI,CAAC,CAAC;QACN,IAAI,CAAC,CAAC;QAEN,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,IAAA,iBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,YAAG,EAAC,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;AA/BD,oCA+BC","file":"large-symbols.js","sourcesContent":["import type { ICustomPath2D, IGroupGraphicAttribute, IPath } from '@visactor/vrender';\nimport { isNumber, max } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { CustomPath2D, Group, DefaultSymbolAttribute } from '@visactor/vrender';\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"]}
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.configureEnvironment = void 0;
6
6
 
7
- const vrender_core_1 = require("@visactor/vrender-core");
7
+ const vrender_1 = require("@visactor/vrender");
8
8
 
9
9
  function configureEnvironment(options) {
10
- options.mode && vrender_core_1.vglobal.setEnv(options.mode, options.modeParams || {});
10
+ options.mode && vrender_1.vglobal.setEnv(options.mode, options.modeParams || {});
11
11
  }
12
12
 
13
13
  exports.configureEnvironment = configureEnvironment;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graph/util/env.ts"],"names":[],"mappings":";;;AAAA,yDAAiD;AAGjD,SAAgB,oBAAoB,CAAC,OAA4B;IAC/D,IAAI,OAAO,CAAC,IAAI,EAAE;QAChB,sBAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;KACxD;AACH,CAAC;AAJD,oDAIC","file":"env.js","sourcesContent":["import { vglobal } from '@visactor/vrender-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
+ {"version":3,"sources":["../src/graph/util/env.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAG5C,SAAgB,oBAAoB,CAAC,OAA4B;IAC/D,IAAI,OAAO,CAAC,IAAI,EAAE;QAChB,iBAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;KACxD;AACH,CAAC;AAJD,oDAIC","file":"env.js","sourcesContent":["import { vglobal } from '@visactor/vrender';\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-core';
1
+ import type { FederatedEvent } from '@visactor/vrender';
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,mCAAgC;AAChC,oDAA2D;AAG3D,SAAwB,iBAAiB,CACvC,IAAW,EACX,KAAqB,EACrB,IAAc,EACd,IAAY,EACZ,MAAuB;IAEvB,IAAI,MAAM,KAAK,+BAAmB,EAAE;QAClC,MAAM,CAAC,GAAI,KAAa,CAAC,cAAc,CAAC,CAAC,CAAE,KAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QACnF,IAAA,aAAK,EAAC,CAAC,CAAC,CAAC;KACV;IAEA,KAAa,CAAC,OAAO,GAAG,IAAI,CAAC;IAC7B,KAAa,CAAC,YAAY,GAAG,IAAI,CAAC;IAEnC,OAAO,KAAK,CAAC;AACf,CAAC;AAhBD,oCAgBC","file":"events-extend.js","sourcesContent":["import type { FederatedEvent } from '@visactor/vrender-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 (event as any).vGrammarType = type;\n\n return event;\n}\n"]}
1
+ {"version":3,"sources":["../src/graph/util/events-extend.ts"],"names":[],"mappings":";;AAGA,mCAAgC;AAChC,oDAA2D;AAG3D,SAAwB,iBAAiB,CACvC,IAAW,EACX,KAAqB,EACrB,IAAc,EACd,IAAY,EACZ,MAAuB;IAEvB,IAAI,MAAM,KAAK,+BAAmB,EAAE;QAClC,MAAM,CAAC,GAAI,KAAa,CAAC,cAAc,CAAC,CAAC,CAAE,KAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QACnF,IAAA,aAAK,EAAC,CAAC,CAAC,CAAC;KACV;IAEA,KAAa,CAAC,OAAO,GAAG,IAAI,CAAC;IAC7B,KAAa,CAAC,YAAY,GAAG,IAAI,CAAC;IAEnC,OAAO,KAAK,CAAC;AACf,CAAC;AAhBD,oCAgBC","file":"events-extend.js","sourcesContent":["import type { FederatedEvent } from '@visactor/vrender';\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 (event as any).vGrammarType = type;\n\n return event;\n}\n"]}
@@ -1,9 +1,9 @@
1
1
  import type { IGlyphMeta, IMark } from '../../types';
2
- import type { IGraphic } from '@visactor/vrender-core';
2
+ import type { IGraphic } from '@visactor/vrender';
3
3
  import { LargeRects } from '../mark/large-rects';
4
4
  import { LargeSymbols } from '../mark/large-symbols';
5
5
  export declare const isMarkType: (type: string) => boolean;
6
- export declare function createGraphicItem(mark: IMark, markType: string, attrs?: any): IGraphic<Partial<import("@visactor/vrender-core").IGraphicAttribute>> | LargeRects | LargeSymbols;
7
- export declare function createGlyphGraphicItem(mark: IMark, glyphMeta: IGlyphMeta, attrs?: any): import("@visactor/vrender-core").IGlyph<Partial<import("@visactor/vrender-core").IGraphicAttribute>>;
6
+ export declare function createGraphicItem(mark: IMark, markType: string, attrs?: any): IGraphic<Partial<import("@visactor/vrender").IGraphicAttribute>> | LargeRects | LargeSymbols;
7
+ export declare function createGlyphGraphicItem(mark: IMark, glyphMeta: IGlyphMeta, attrs?: any): import("@visactor/vrender").IGlyph<Partial<import("@visactor/vrender").IGraphicAttribute>>;
8
8
  export declare const removeGraphicItem: (graphicItem: IGraphic) => void;
9
9
  export declare const getMarkTypeOfLarge: (markType: string) => string;
@@ -4,26 +4,26 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.getMarkTypeOfLarge = exports.removeGraphicItem = exports.createGlyphGraphicItem = exports.createGraphicItem = exports.isMarkType = void 0;
6
6
 
7
- const vrender_core_1 = require("@visactor/vrender-core"), enums_1 = require("../enums"), constants_1 = require("../constants"), large_rects_1 = require("../mark/large-rects"), large_symbols_1 = require("../mark/large-symbols"), factory_1 = require("../../core/factory"), itemCreator = {
8
- circle: vrender_core_1.createCircle,
9
- arc: vrender_core_1.createArc,
10
- arc3d: vrender_core_1.createArc3d,
11
- pyramid3d: vrender_core_1.createPyramid3d,
12
- area: vrender_core_1.createArea,
13
- group: vrender_core_1.createGroup,
14
- image: vrender_core_1.createImage,
15
- rect3d: vrender_core_1.createRect3d,
16
- line: vrender_core_1.createLine,
17
- path: vrender_core_1.createPath,
18
- rect: vrender_core_1.createRect,
19
- rule: vrender_core_1.createLine,
20
- shape: vrender_core_1.createPath,
21
- symbol: vrender_core_1.createSymbol,
22
- text: vrender_core_1.createText,
23
- richtext: vrender_core_1.createRichText,
24
- polygon: vrender_core_1.createPolygon,
25
- cell: vrender_core_1.createSymbol,
26
- interval: vrender_core_1.createRect
7
+ const vrender_1 = require("@visactor/vrender"), enums_1 = require("../enums"), constants_1 = require("../constants"), large_rects_1 = require("../mark/large-rects"), large_symbols_1 = require("../mark/large-symbols"), factory_1 = require("../../core/factory"), itemCreator = {
8
+ circle: vrender_1.createCircle,
9
+ arc: vrender_1.createArc,
10
+ arc3d: vrender_1.createArc3d,
11
+ pyramid3d: vrender_1.createPyramid3d,
12
+ area: vrender_1.createArea,
13
+ group: vrender_1.createGroup,
14
+ image: vrender_1.createImage,
15
+ rect3d: vrender_1.createRect3d,
16
+ line: vrender_1.createLine,
17
+ path: vrender_1.createPath,
18
+ rect: vrender_1.createRect,
19
+ rule: vrender_1.createLine,
20
+ shape: vrender_1.createPath,
21
+ symbol: vrender_1.createSymbol,
22
+ text: vrender_1.createText,
23
+ richtext: vrender_1.createRichText,
24
+ polygon: vrender_1.createPolygon,
25
+ cell: vrender_1.createSymbol,
26
+ interval: vrender_1.createRect
27
27
  }, isMarkType = type => !!itemCreator[type];
28
28
 
29
29
  function createGraphicItem(mark, markType, attrs = {}) {
@@ -35,7 +35,7 @@ function createGraphicItem(mark, markType, attrs = {}) {
35
35
 
36
36
  function createGlyphGraphicItem(mark, glyphMeta, attrs = {}) {
37
37
  mark.emit(enums_1.HOOK_EVENT.BEFORE_CREATE_VRENDER_MARK);
38
- const graphicItem = (0, vrender_core_1.createGlyph)(attrs), glyphMarks = glyphMeta.getMarks(), subGraphics = Object.keys(glyphMarks).map((name => {
38
+ const graphicItem = (0, vrender_1.createGlyph)(attrs), glyphMarks = glyphMeta.getMarks(), subGraphics = Object.keys(glyphMarks).map((name => {
39
39
  const graphic = itemCreator[glyphMarks[name]]();
40
40
  return graphic.name = name, graphic;
41
41
  }));
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,kBAAkB,GAAG,CAAC,QAAgB,EAAE,EAAE;IACrD,IAAI,QAAQ,KAAK,uBAAe,CAAC,IAAI,EAAE;QACrC,OAAO,uBAAe,CAAC,UAAU,CAAC;KACnC;IAED,IAAI,QAAQ,KAAK,uBAAe,CAAC,MAAM,EAAE;QACvC,OAAO,uBAAe,CAAC,YAAY,CAAC;KACrC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAVW,QAAA,kBAAkB,sBAU7B","file":"graphic.js","sourcesContent":["import type { IGlyphMeta, IMark } from '../../types';\nimport type { IGraphic } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport {\n createArc,\n createArea,\n createGroup,\n createImage,\n createRect3d,\n createLine,\n createPath,\n createRect,\n createSymbol,\n createRichText,\n createText,\n createPolygon,\n createGlyph,\n createArc3d,\n createPyramid3d,\n createCircle\n} from '@visactor/vrender-core';\nimport { HOOK_EVENT, GrammarMarkType } from '../enums';\nimport { BridgeElementKey } from '../constants';\nimport { LargeRects } from '../mark/large-rects';\nimport { LargeSymbols } from '../mark/large-symbols';\nimport { Factory } from '../../core/factory';\n\nconst itemCreator = {\n circle: createCircle,\n arc: createArc,\n arc3d: createArc3d,\n pyramid3d: createPyramid3d,\n area: createArea,\n group: createGroup,\n image: createImage,\n rect3d: createRect3d,\n line: createLine,\n path: createPath,\n rect: createRect,\n rule: createLine,\n shape: createPath,\n symbol: createSymbol,\n text: createText,\n richtext: createRichText,\n polygon: createPolygon,\n cell: createSymbol,\n interval: createRect\n};\n\nexport const isMarkType = (type: string) => {\n return !!itemCreator[type];\n};\n\nexport function createGraphicItem(mark: IMark, markType: string, attrs: any = {}) {\n mark.emit(HOOK_EVENT.BEFORE_CREATE_VRENDER_MARK);\n\n if (markType === GrammarMarkType.largeRects) {\n return new LargeRects(attrs);\n } else if (markType === GrammarMarkType.largeSymbols) {\n return new LargeSymbols(attrs);\n }\n\n const graphicItem: IGraphic = itemCreator[markType]\n ? itemCreator[markType](attrs)\n : Factory.createGraphicComponent(markType, attrs);\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\n const graphicItem = createGlyph(attrs);\n const glyphMarks = glyphMeta.getMarks();\n const subGraphics: IGraphic[] = Object.keys(glyphMarks).map(name => {\n const graphic = itemCreator[glyphMarks[name]]();\n graphic.name = name;\n return graphic;\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"]}
1
+ {"version":3,"sources":["../src/graph/util/graphic.ts"],"names":[],"mappings":";;;AAGA,+CAiB2B;AAC3B,oCAAuD;AACvD,4CAAgD;AAChD,qDAAiD;AACjD,yDAAqD;AACrD,gDAA6C;AAE7C,MAAM,WAAW,GAAG;IAClB,MAAM,EAAE,sBAAY;IACpB,GAAG,EAAE,mBAAS;IACd,KAAK,EAAE,qBAAW;IAClB,SAAS,EAAE,yBAAe;IAC1B,IAAI,EAAE,oBAAU;IAChB,KAAK,EAAE,qBAAW;IAClB,KAAK,EAAE,qBAAW;IAClB,MAAM,EAAE,sBAAY;IACpB,IAAI,EAAE,oBAAU;IAChB,IAAI,EAAE,oBAAU;IAChB,IAAI,EAAE,oBAAU;IAChB,IAAI,EAAE,oBAAU;IAChB,KAAK,EAAE,oBAAU;I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,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACjE,MAAM,OAAO,GAAG,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QAChD,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;QACpB,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC,CAAC;IACH,WAAW,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAEvC,IAAI,CAAC,IAAI,CAAC,kBAAU,CAAC,yBAAyB,CAAC,CAAC;IAChD,OAAO,WAAW,CAAC;AACrB,CAAC;AAdD,wDAcC;AAEM,MAAM,iBAAiB,GAAG,CAAC,WAAqB,EAAE,EAAE;IACzD,IAAI,WAAW,EAAE;QACf,WAAW,CAAC,4BAAgB,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;AARW,QAAA,iBAAiB,qBAQ5B;AAEK,MAAM,kBAAkB,GAAG,CAAC,QAAgB,EAAE,EAAE;IACrD,IAAI,QAAQ,KAAK,uBAAe,CAAC,IAAI,EAAE;QACrC,OAAO,uBAAe,CAAC,UAAU,CAAC;KACnC;IAED,IAAI,QAAQ,KAAK,uBAAe,CAAC,MAAM,EAAE;QACvC,OAAO,uBAAe,CAAC,YAAY,CAAC;KACrC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAVW,QAAA,kBAAkB,sBAU7B","file":"graphic.js","sourcesContent":["import type { IGlyphMeta, IMark } from '../../types';\nimport type { IGraphic } from '@visactor/vrender';\n// eslint-disable-next-line no-duplicate-imports\nimport {\n createArc,\n createArea,\n createGroup,\n createImage,\n createRect3d,\n createLine,\n createPath,\n createRect,\n createSymbol,\n createRichText,\n createText,\n createPolygon,\n createGlyph,\n createArc3d,\n createPyramid3d,\n createCircle\n} from '@visactor/vrender';\nimport { HOOK_EVENT, GrammarMarkType } from '../enums';\nimport { BridgeElementKey } from '../constants';\nimport { LargeRects } from '../mark/large-rects';\nimport { LargeSymbols } from '../mark/large-symbols';\nimport { Factory } from '../../core/factory';\n\nconst itemCreator = {\n circle: createCircle,\n arc: createArc,\n arc3d: createArc3d,\n pyramid3d: createPyramid3d,\n area: createArea,\n group: createGroup,\n image: createImage,\n rect3d: createRect3d,\n line: createLine,\n path: createPath,\n rect: createRect,\n rule: createLine,\n shape: createPath,\n symbol: createSymbol,\n text: createText,\n richtext: createRichText,\n polygon: createPolygon,\n cell: createSymbol,\n interval: createRect\n};\n\nexport const isMarkType = (type: string) => {\n return !!itemCreator[type];\n};\n\nexport function createGraphicItem(mark: IMark, markType: string, attrs: any = {}) {\n mark.emit(HOOK_EVENT.BEFORE_CREATE_VRENDER_MARK);\n\n if (markType === GrammarMarkType.largeRects) {\n return new LargeRects(attrs);\n } else if (markType === GrammarMarkType.largeSymbols) {\n return new LargeSymbols(attrs);\n }\n\n const graphicItem: IGraphic = itemCreator[markType]\n ? itemCreator[markType](attrs)\n : Factory.createGraphicComponent(markType, attrs);\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\n const graphicItem = createGlyph(attrs);\n const glyphMarks = glyphMeta.getMarks();\n const subGraphics: IGraphic[] = Object.keys(glyphMarks).map(name => {\n const graphic = itemCreator[glyphMarks[name]]();\n graphic.name = name;\n return graphic;\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/cjs/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.7.7-alpha.2";
1
+ export declare const version = "0.7.7";
2
2
  export * from './graph';
3
3
  export { View } from './view';
4
4
  export { parseFunctionType, invokeFunctionType } from './parse/util';
@@ -12,5 +12,3 @@ export * from './glyph';
12
12
  export * from './component';
13
13
  export * from './transforms';
14
14
  export * from './graph/animation/animation';
15
- export { vglobal } from '@visactor/vrender-core';
16
- export * from './env';
package/cjs/index.js CHANGED
@@ -17,8 +17,8 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
17
17
 
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
- }), exports.vglobal = exports.ThemeManager = exports.SIGNAL_VIEW_BOX = exports.SIGNAL_WIDTH = exports.SIGNAL_VIEW_WIDTH = exports.SIGNAL_VIEW_HEIGHT = exports.SIGNAL_PADDING = exports.SIGNAL_HEIGHT = exports.SIGNAL_AUTOFIT = exports.Factory = exports.GrammarBase = exports.invokeFunctionType = exports.parseFunctionType = exports.View = exports.version = void 0,
21
- exports.version = "0.7.7-alpha.2", __exportStar(require("./graph"), exports);
20
+ }), exports.ThemeManager = exports.SIGNAL_VIEW_BOX = exports.SIGNAL_WIDTH = exports.SIGNAL_VIEW_WIDTH = exports.SIGNAL_VIEW_HEIGHT = exports.SIGNAL_PADDING = exports.SIGNAL_HEIGHT = exports.SIGNAL_AUTOFIT = exports.Factory = exports.GrammarBase = exports.invokeFunctionType = exports.parseFunctionType = exports.View = exports.version = void 0,
21
+ exports.version = "0.7.7", __exportStar(require("./graph"), exports);
22
22
 
23
23
  var view_1 = require("./view");
24
24
 
@@ -108,14 +108,4 @@ Object.defineProperty(exports, "ThemeManager", {
108
108
  return theme_manager_1.ThemeManager;
109
109
  }
110
110
  }), __exportStar(require("./glyph"), exports), __exportStar(require("./component"), exports),
111
- __exportStar(require("./transforms"), exports), __exportStar(require("./graph/animation/animation"), exports);
112
-
113
- var vrender_core_1 = require("@visactor/vrender-core");
114
-
115
- Object.defineProperty(exports, "vglobal", {
116
- enumerable: !0,
117
- get: function() {
118
- return vrender_core_1.vglobal;
119
- }
120
- }), __exportStar(require("./env"), exports);
121
- //# sourceMappingURL=index.js.map
111
+ __exportStar(require("./transforms"), exports), __exportStar(require("./graph/animation/animation"), exports);
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,eAAe,CAAC;AAEvC,0CAAwB;AAExB,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,qCAAqE;AAA5D,yGAAA,iBAAiB,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAC9C,oDAAkD;AAAzC,2GAAA,WAAW,OAAA;AACpB,8CAA4B;AAC5B,0CAAwB;AACxB,0CAAyC;AAAhC,kGAAA,OAAO,OAAA;AAChB,8CAQ0B;AAPxB,2GAAA,cAAc,OAAA;AACd,0GAAA,aAAa,OAAA;AACb,2GAAA,cAAc,OAAA;AACd,+GAAA,kBAAkB,OAAA;AAClB,8GAAA,iBAAiB,OAAA;AACjB,yGAAA,YAAY,OAAA;AACZ,4GAAA,eAAe,OAAA;AAGjB,uDAAqD;AAA5C,6GAAA,YAAY,OAAA;AAErB,0CAAwB;AACxB,8CAA4B;AAC5B,+CAA6B;AAC7B,8DAA4C;AAE5C,uDAAiD;AAAxC,uGAAA,OAAO,OAAA;AAChB,wCAAsB","file":"index.js","sourcesContent":["// -- Exports -----\nexport const version = \"0.7.7-alpha.2\";\n\nexport * from './graph';\n\nexport { View } from './view';\nexport { parseFunctionType, invokeFunctionType } from './parse/util';\nexport { GrammarBase } from './view/grammar-base';\nexport * from './util/text';\nexport * from './types';\nexport { Factory } from './core/factory';\nexport {\n SIGNAL_AUTOFIT,\n SIGNAL_HEIGHT,\n SIGNAL_PADDING,\n SIGNAL_VIEW_HEIGHT,\n SIGNAL_VIEW_WIDTH,\n SIGNAL_WIDTH,\n SIGNAL_VIEW_BOX\n} from './view/constants';\n\nexport { ThemeManager } from './theme/theme-manager';\n\nexport * from './glyph';\nexport * from './component';\nexport * from './transforms';\nexport * from './graph/animation/animation';\n\nexport { vglobal } from '@visactor/vrender-core';\nexport * from './env';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,OAAO,CAAC;AAE/B,0CAAwB;AAExB,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,qCAAqE;AAA5D,yGAAA,iBAAiB,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAC9C,oDAAkD;AAAzC,2GAAA,WAAW,OAAA;AACpB,8CAA4B;AAC5B,0CAAwB;AACxB,0CAAyC;AAAhC,kGAAA,OAAO,OAAA;AAChB,8CAQ0B;AAPxB,2GAAA,cAAc,OAAA;AACd,0GAAA,aAAa,OAAA;AACb,2GAAA,cAAc,OAAA;AACd,+GAAA,kBAAkB,OAAA;AAClB,8GAAA,iBAAiB,OAAA;AACjB,yGAAA,YAAY,OAAA;AACZ,4GAAA,eAAe,OAAA;AAGjB,uDAAqD;AAA5C,6GAAA,YAAY,OAAA;AAErB,0CAAwB;AACxB,8CAA4B;AAC5B,+CAA6B;AAC7B,8DAA4C","file":"index.js","sourcesContent":["// -- Exports -----\nexport const version = \"0.7.7\";\n\nexport * from './graph';\n\nexport { View } from './view';\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"]}
package/cjs/parse/mark.js CHANGED
@@ -21,4 +21,5 @@ function parseEncodeType(encoder, view) {
21
21
  vutils_1.array)(view.getScaleById(encoder.scale))), dependencies.concat((0, util_1.parseFunctionType)(encoder, view));
22
22
  }
23
23
 
24
- exports.isScaleEncode = isScaleEncode, exports.isFieldEncode = isFieldEncode, exports.parseEncodeType = parseEncodeType;
24
+ exports.isScaleEncode = isScaleEncode, exports.isFieldEncode = isFieldEncode, exports.parseEncodeType = parseEncodeType;
25
+ //# sourceMappingURL=mark.js.map
@@ -16,5 +16,4 @@ const parseOptions = (options, params) => options ? (0, vutils_1.isObject)(optio
16
16
  return res[key] = (0, exports.parseOptionValue)(option, params), res;
17
17
  }), {}) : options.map((option => (0, exports.parseOptionValue)(option, params))) : options;
18
18
 
19
- exports.parseOptions = parseOptions;
20
- //# sourceMappingURL=option.js.map
19
+ exports.parseOptions = parseOptions;
@@ -7,7 +7,7 @@ export declare class Cell extends Mark {
7
7
  protected _encoders: StateEncodeSpec | null;
8
8
  encodeState(state: string, channel: string | BaseSignleEncodeSpec, value?: MarkFunctionType<any>): this;
9
9
  protected _updateComponentEncoders(state: string): void;
10
- protected _getEncoders(): StateEncodeSpec<Partial<Omit<import("@visactor/vrender-core").IGraphicAttribute, "strokeSeg" | "boundsPadding" | "pickMode" | "boundsMode" | "customPickShape" | "pickable" | "childrenPickable" | "visible" | "zIndex" | "layout" | "keepDirIn3d" | "postMatrix" | "anchor" | "anchor3d">>>;
10
+ protected _getEncoders(): StateEncodeSpec<Partial<Omit<import("@visactor/vrender").IGraphicAttribute, "strokeSeg" | "boundsPadding" | "pickMode" | "boundsMode" | "customPickShape" | "pickable" | "childrenPickable" | "visible" | "zIndex" | "layout" | "keepDirIn3d" | "postMatrix" | "anchor" | "anchor3d">>>;
11
11
  getAttributeTransforms(): AttributeTransform[];
12
12
  release(): void;
13
13
  }
@@ -7,7 +7,7 @@ export declare class Interval extends Mark {
7
7
  protected _encoders: StateEncodeSpec;
8
8
  encodeState(state: string, channel: string | BaseSignleEncodeSpec, value?: MarkFunctionType<any>): this;
9
9
  protected _updateComponentEncoders(state: string): void;
10
- protected _getEncoders(): StateEncodeSpec<Partial<Omit<import("@visactor/vrender-core").IGraphicAttribute, "strokeSeg" | "boundsPadding" | "pickMode" | "boundsMode" | "customPickShape" | "pickable" | "childrenPickable" | "visible" | "zIndex" | "layout" | "keepDirIn3d" | "postMatrix" | "anchor" | "anchor3d">>>;
10
+ protected _getEncoders(): StateEncodeSpec<Partial<Omit<import("@visactor/vrender").IGraphicAttribute, "strokeSeg" | "boundsPadding" | "pickMode" | "boundsMode" | "customPickShape" | "pickable" | "childrenPickable" | "visible" | "zIndex" | "layout" | "keepDirIn3d" | "postMatrix" | "anchor" | "anchor3d">>>;
11
11
  getAttributeTransforms(): AttributeTransform[];
12
12
  addGraphicItem(attrs: any, groupKey?: string): any;
13
13
  release(): void;
@@ -1,4 +1,4 @@
1
- import type { IGraphic, ACustomAnimate, EasingType } from '@visactor/vrender-core';
1
+ import type { IGraphic, ACustomAnimate, EasingType } from '@visactor/vrender';
2
2
  import type { IPointLike } from '@visactor/vutils';
3
3
  import type { MarkFunctionCallback, MarkFunctionType } from './mark';
4
4
  import type { IMark } from './grammar';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/animate.ts"],"names":[],"mappings":"","file":"animate.js","sourcesContent":["import type { IGraphic, ACustomAnimate, EasingType } from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { MarkFunctionCallback, MarkFunctionType } from './mark';\nimport type { IMark } from './grammar';\nimport type { IElement } from './element';\n\nexport type TypeAnimation<T extends IElement> = (\n element: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nexport interface IClipAnimationOptions {\n clipDimension?: 'x' | 'y' | 'auto' | 'default';\n}\n\nexport interface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IGrowAngleAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n overall?: boolean | number;\n}\n\nexport interface IGrowRadiusAnimationOptions {\n orient?: 'inside' | 'outside';\n overall?: boolean | number;\n}\n\nexport interface IGrowPointsAnimationOptions {\n orient?: 'positive' | 'negative';\n}\n\nexport interface IGrowPointsOverallAnimationOptions extends IGrowPointsAnimationOptions {\n center?: IPointLike;\n}\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IMoveAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n orient?: 'positive' | 'negative';\n offset?: number;\n point?: { x?: number; y?: number };\n}\n\nexport interface IRotateAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n angle?: number;\n}\n\n/** VGrammar 层提供的图元text上的图形属性,现在暂时会和VRender不一致 */\nexport interface TextItemAttributes {\n fontSize?: number;\n lineHeight?: number;\n font?: string;\n fontStyle?: string;\n fontVariant?: string;\n fontWeight?: string | number;\n lineBreak?: string;\n text?: string | string[];\n limit?: number;\n align?: string;\n baseline?: string;\n ellipsis?: string | boolean;\n dir?: string;\n}\n\n/** animation */\nexport type MarkFunctionValueType<T> = MarkFunctionCallback<T> | T;\n\nexport type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;\n\n/**\n * state动画,暂时只支持简单配置\n */\nexport interface IStateAnimationConfig {\n duration?: number;\n easing?: EasingType;\n}\n\n/**\n * 动画 config 简化配置\n */\nexport interface IAnimationTypeConfig {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n delay?: MarkFunctionValueType<number>;\n duration?: MarkFunctionValueType<number>;\n oneByOne?: MarkFunctionValueType<boolean | number>;\n startTime?: MarkFunctionValueType<number>;\n totalTime?: MarkFunctionValueType<number>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: boolean | number;\n /** 动画 effect 配置项 */\n options?: MarkFunctionValueType<any>;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\n/**\n * 动画 timeline 完整配置,一条时间线内的动画单元只能串行\n * 多个timeline是可以并行的\n * 考虑到同一图元不能在多个timeline上,所以timeline不应该提供数组配置的能力\n */\nexport interface IAnimationTimeline {\n /** 为了方便动画编排,用户可以设置 id 用于识别时间线 */\n id?: string;\n /** 时间切片 */\n timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];\n /** 动画开始的相对时间,可以为负数 */\n startTime?: MarkFunctionValueType<number>;\n /** 动画时长 */\n totalTime?: MarkFunctionValueType<number>;\n /** 动画依次执行的延迟 */\n oneByOne?: MarkFunctionValueType<number | boolean>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: MarkFunctionValueType<number | boolean>;\n /** 对图元元素进行划分,和过滤类似,但是不同时间线不能同时作用在相同的元素上 */\n partitioner?: MarkFunctionCallback<boolean>;\n /** 对同一时间线上的元素进行排序 */\n sort?: (datumA: any, datumB: any, elementA: IElement, elementB: IElement, parameters: any) => number;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\nexport interface IAnimationTimeSlice {\n effects: IAnimationEffect | IAnimationEffect[];\n duration?: MarkFunctionValueType<number>;\n delay?: MarkFunctionValueType<number>;\n}\n\nexport type IAnimationChannelFunction = (datum: any, element: IElement, parameters: IAnimationParameters) => any;\nexport type IAnimationChannelAttrs = Record<\n string,\n {\n from?: any | IAnimationChannelFunction;\n to?: any | IAnimationChannelFunction;\n }\n>;\nexport type IAnimationChannelAttributes = string[];\nexport type IAnimationChannelInterpolator = (\n ratio: number,\n from: any,\n to: any,\n nextAttributes: any,\n datum: any,\n element: IElement,\n parameters: IAnimationParameters\n) => boolean | void;\n\n// TODO: fix ACustomAnimate<any>\nexport interface IAnimationCustomConstructor {\n new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;\n}\n\nexport interface IAnimationEffect {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n /** options暂时没有处理 */\n options?: MarkFunctionValueType<any>;\n}\n\nexport interface IAnimationControlOptions {\n /** 当动画状态变更时清空动画 */\n stopWhenStateChange?: boolean;\n /** 是否立即应用动画初始状态 */\n immediatelyApply?: boolean;\n}\n\n/**\n * Animation timeline should be parsed into animation units,\n * which record all necessary configs for animator to execute animation.\n *\n * animation unit time:\n * |<--initialDelay-->| |<--loopDelay--><--Slices--><--looDelayAfter-->| |<--loopDuration-->|\n * |<-----------------loopDuration--------------->|\n */\nexport interface IAnimationUnit {\n /**\n * initial delay time before any animation loop\n */\n initialDelay: number;\n /**\n * total time for one animation loop\n */\n loopDuration: number;\n /**\n * delay time before time slices\n */\n loopDelay: number;\n /**\n * delay time after time slices\n */\n loopDelayAfter: number;\n /**\n * animating time in one animation loop\n */\n loopAnimateDuration: number;\n loopCount: number;\n totalTime: number;\n timeSlices: IAnimationTimeSlice[];\n}\n\nexport interface IAnimationRecord {\n start: IGraphic;\n end: IGraphic;\n changes: any[];\n}\n\nexport interface IAnimationParameters {\n width: number;\n height: number;\n mark: IMark;\n group: IMark | null;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\nexport interface IParsedAnimationConfig {\n state: string;\n timeline: IAnimationTimeline;\n originConfig: IAnimationConfig;\n id: string;\n}\n\nexport interface IParsedAnimationAttrs {\n from?: any;\n to?: any;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: any;\n}\n\n// animate structure\n\nexport interface IAnimatorOptions {\n state: string;\n timeline: IAnimationTimeline;\n id: string;\n}\n\nexport interface IAnimator {\n id: number;\n element: IElement;\n animationOptions: IAnimatorOptions;\n isAnimating: boolean;\n\n /** execute animation */\n animate: (animationParameters: IAnimationParameters, parameters: any) => this;\n /** set animation callback */\n callback: (callbackFunction: (...args: any[]) => void) => this;\n\n // animation control\n stop: (stopState?: 'start' | 'end', invokeCallback?: boolean) => this;\n pause: () => this;\n resume: () => this;\n\n /** set additional initial animation delay */\n startAt: (startTime: number) => this;\n /** get total animation execution time */\n getTotalAnimationTime: () => number;\n\n getEndAttributes: () => Record<string, any>;\n}\n\nexport interface IAnimateArranger {\n // animation control api\n parallel: (arranger: IAnimateArranger) => this;\n after: (arranger: IAnimateArranger) => this;\n\n // internal properties\n afterArranger: IAnimateArranger;\n parallelArrangers: IAnimateArranger[];\n animators: IAnimator[];\n totalTime: number;\n startTime: number;\n endTime: number;\n arrangeTime: () => void;\n}\n\nexport interface IBaseAnimate {\n // animation control\n stop: () => this;\n pause: () => this;\n resume: () => this;\n\n // internal animation process api\n animate: () => this;\n enable: () => this;\n disable: () => this;\n enableAnimationState: (state: string | string[]) => this;\n disableAnimationState: (state: string | string[]) => this;\n isAnimating: () => boolean;\n\n release: () => void;\n}\n\nexport interface IViewAnimate extends IBaseAnimate {\n animateAddition: (mark: IMark) => this;\n}\n\nexport interface IAnimate extends IBaseAnimate {\n mark: IMark;\n\n // additional animation control\n run: (config: IAnimationConfig | IAnimationConfig[]) => IAnimateArranger;\n runAnimationByState: (animationState: string) => IAnimateArranger;\n stopAnimationByState: (animationState: string) => this;\n pauseAnimationByState: (animationState: string) => this;\n resumeAnimationByState: (animationState: string) => this;\n reverse: () => this;\n restart: () => this;\n record: () => this;\n recordEnd: () => this;\n\n // internal animation process api\n updateConfig: (config: Record<string, IAnimationConfig | IAnimationConfig[]>) => void;\n updateState: (state: MarkFunctionType<string> | null) => void;\n isElementAnimating: (element: IElement) => boolean;\n getAnimatorCount: () => number;\n getElementAnimators: (element: IElement | IElement[], animationState?: string) => IAnimator[];\n release: () => void;\n}\n"]}
1
+ {"version":3,"sources":["../src/types/animate.ts"],"names":[],"mappings":"","file":"animate.js","sourcesContent":["import type { IGraphic, ACustomAnimate, EasingType } from '@visactor/vrender';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { MarkFunctionCallback, MarkFunctionType } from './mark';\nimport type { IMark } from './grammar';\nimport type { IElement } from './element';\n\nexport type TypeAnimation<T extends IElement> = (\n element: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nexport interface IClipAnimationOptions {\n clipDimension?: 'x' | 'y' | 'auto' | 'default';\n}\n\nexport interface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IGrowAngleAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n overall?: boolean | number;\n}\n\nexport interface IGrowRadiusAnimationOptions {\n orient?: 'inside' | 'outside';\n overall?: boolean | number;\n}\n\nexport interface IGrowPointsAnimationOptions {\n orient?: 'positive' | 'negative';\n}\n\nexport interface IGrowPointsOverallAnimationOptions extends IGrowPointsAnimationOptions {\n center?: IPointLike;\n}\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IMoveAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n orient?: 'positive' | 'negative';\n offset?: number;\n point?: { x?: number; y?: number };\n}\n\nexport interface IRotateAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n angle?: number;\n}\n\n/** VGrammar 层提供的图元text上的图形属性,现在暂时会和VRender不一致 */\nexport interface TextItemAttributes {\n fontSize?: number;\n lineHeight?: number;\n font?: string;\n fontStyle?: string;\n fontVariant?: string;\n fontWeight?: string | number;\n lineBreak?: string;\n text?: string | string[];\n limit?: number;\n align?: string;\n baseline?: string;\n ellipsis?: string | boolean;\n dir?: string;\n}\n\n/** animation */\nexport type MarkFunctionValueType<T> = MarkFunctionCallback<T> | T;\n\nexport type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;\n\n/**\n * state动画,暂时只支持简单配置\n */\nexport interface IStateAnimationConfig {\n duration?: number;\n easing?: EasingType;\n}\n\n/**\n * 动画 config 简化配置\n */\nexport interface IAnimationTypeConfig {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n delay?: MarkFunctionValueType<number>;\n duration?: MarkFunctionValueType<number>;\n oneByOne?: MarkFunctionValueType<boolean | number>;\n startTime?: MarkFunctionValueType<number>;\n totalTime?: MarkFunctionValueType<number>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: boolean | number;\n /** 动画 effect 配置项 */\n options?: MarkFunctionValueType<any>;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\n/**\n * 动画 timeline 完整配置,一条时间线内的动画单元只能串行\n * 多个timeline是可以并行的\n * 考虑到同一图元不能在多个timeline上,所以timeline不应该提供数组配置的能力\n */\nexport interface IAnimationTimeline {\n /** 为了方便动画编排,用户可以设置 id 用于识别时间线 */\n id?: string;\n /** 时间切片 */\n timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];\n /** 动画开始的相对时间,可以为负数 */\n startTime?: MarkFunctionValueType<number>;\n /** 动画时长 */\n totalTime?: MarkFunctionValueType<number>;\n /** 动画依次执行的延迟 */\n oneByOne?: MarkFunctionValueType<number | boolean>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: MarkFunctionValueType<number | boolean>;\n /** 对图元元素进行划分,和过滤类似,但是不同时间线不能同时作用在相同的元素上 */\n partitioner?: MarkFunctionCallback<boolean>;\n /** 对同一时间线上的元素进行排序 */\n sort?: (datumA: any, datumB: any, elementA: IElement, elementB: IElement, parameters: any) => number;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\nexport interface IAnimationTimeSlice {\n effects: IAnimationEffect | IAnimationEffect[];\n duration?: MarkFunctionValueType<number>;\n delay?: MarkFunctionValueType<number>;\n}\n\nexport type IAnimationChannelFunction = (datum: any, element: IElement, parameters: IAnimationParameters) => any;\nexport type IAnimationChannelAttrs = Record<\n string,\n {\n from?: any | IAnimationChannelFunction;\n to?: any | IAnimationChannelFunction;\n }\n>;\nexport type IAnimationChannelAttributes = string[];\nexport type IAnimationChannelInterpolator = (\n ratio: number,\n from: any,\n to: any,\n nextAttributes: any,\n datum: any,\n element: IElement,\n parameters: IAnimationParameters\n) => boolean | void;\n\n// TODO: fix ACustomAnimate<any>\nexport interface IAnimationCustomConstructor {\n new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;\n}\n\nexport interface IAnimationEffect {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n /** options暂时没有处理 */\n options?: MarkFunctionValueType<any>;\n}\n\nexport interface IAnimationControlOptions {\n /** 当动画状态变更时清空动画 */\n stopWhenStateChange?: boolean;\n /** 是否立即应用动画初始状态 */\n immediatelyApply?: boolean;\n}\n\n/**\n * Animation timeline should be parsed into animation units,\n * which record all necessary configs for animator to execute animation.\n *\n * animation unit time:\n * |<--initialDelay-->| |<--loopDelay--><--Slices--><--looDelayAfter-->| |<--loopDuration-->|\n * |<-----------------loopDuration--------------->|\n */\nexport interface IAnimationUnit {\n /**\n * initial delay time before any animation loop\n */\n initialDelay: number;\n /**\n * total time for one animation loop\n */\n loopDuration: number;\n /**\n * delay time before time slices\n */\n loopDelay: number;\n /**\n * delay time after time slices\n */\n loopDelayAfter: number;\n /**\n * animating time in one animation loop\n */\n loopAnimateDuration: number;\n loopCount: number;\n totalTime: number;\n timeSlices: IAnimationTimeSlice[];\n}\n\nexport interface IAnimationRecord {\n start: IGraphic;\n end: IGraphic;\n changes: any[];\n}\n\nexport interface IAnimationParameters {\n width: number;\n height: number;\n mark: IMark;\n group: IMark | null;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\nexport interface IParsedAnimationConfig {\n state: string;\n timeline: IAnimationTimeline;\n originConfig: IAnimationConfig;\n id: string;\n}\n\nexport interface IParsedAnimationAttrs {\n from?: any;\n to?: any;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: any;\n}\n\n// animate structure\n\nexport interface IAnimatorOptions {\n state: string;\n timeline: IAnimationTimeline;\n id: string;\n}\n\nexport interface IAnimator {\n id: number;\n element: IElement;\n animationOptions: IAnimatorOptions;\n isAnimating: boolean;\n\n /** execute animation */\n animate: (animationParameters: IAnimationParameters, parameters: any) => this;\n /** set animation callback */\n callback: (callbackFunction: (...args: any[]) => void) => this;\n\n // animation control\n stop: (stopState?: 'start' | 'end', invokeCallback?: boolean) => this;\n pause: () => this;\n resume: () => this;\n\n /** set additional initial animation delay */\n startAt: (startTime: number) => this;\n /** get total animation execution time */\n getTotalAnimationTime: () => number;\n\n getEndAttributes: () => Record<string, any>;\n}\n\nexport interface IAnimateArranger {\n // animation control api\n parallel: (arranger: IAnimateArranger) => this;\n after: (arranger: IAnimateArranger) => this;\n\n // internal properties\n afterArranger: IAnimateArranger;\n parallelArrangers: IAnimateArranger[];\n animators: IAnimator[];\n totalTime: number;\n startTime: number;\n endTime: number;\n arrangeTime: () => void;\n}\n\nexport interface IBaseAnimate {\n // animation control\n stop: () => this;\n pause: () => this;\n resume: () => this;\n\n // internal animation process api\n animate: () => this;\n enable: () => this;\n disable: () => this;\n enableAnimationState: (state: string | string[]) => this;\n disableAnimationState: (state: string | string[]) => this;\n isAnimating: () => boolean;\n\n release: () => void;\n}\n\nexport interface IViewAnimate extends IBaseAnimate {\n animateAddition: (mark: IMark) => this;\n}\n\nexport interface IAnimate extends IBaseAnimate {\n mark: IMark;\n\n // additional animation control\n run: (config: IAnimationConfig | IAnimationConfig[]) => IAnimateArranger;\n runAnimationByState: (animationState: string) => IAnimateArranger;\n stopAnimationByState: (animationState: string) => this;\n pauseAnimationByState: (animationState: string) => this;\n resumeAnimationByState: (animationState: string) => this;\n reverse: () => this;\n restart: () => this;\n record: () => this;\n recordEnd: () => this;\n\n // internal animation process api\n updateConfig: (config: Record<string, IAnimationConfig | IAnimationConfig[]>) => void;\n updateState: (state: MarkFunctionType<string> | null) => void;\n isElementAnimating: (element: IElement) => boolean;\n getAnimatorCount: () => number;\n getElementAnimators: (element: IElement | IElement[], animationState?: string) => IAnimator[];\n release: () => void;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { IGraphicAttribute, ISymbolGraphicAttribute, ITextAttribute, ITextGraphicAttribute } from '@visactor/vrender-core';
1
+ import type { IGraphicAttribute, ISymbolGraphicAttribute, ITextAttribute, ITextGraphicAttribute } from '@visactor/vrender';
2
2
  import type { AxisBaseAttributes, BaseCrosshairAttrs, BaseLabelAttrs, DataLabelAttrs, DataZoomAttributes, Direction, GridBaseAttributes, LegendBaseAttributes, OrientType, PlayerAttributes, ScrollBarAttributes, SliderAttributes, TitleAttrs, TooltipAttributes, TooltipRowAttrs } from '@visactor/vrender-components';
3
3
  import type { AxisEnum, ComponentEnum } from '../graph';
4
4
  import type { Nil } from './base';