@visactor/vgrammar-core 0.10.0-alpha.6 → 0.10.0-alpha.8

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 (51) hide show
  1. package/cjs/graph/element.js +3 -2
  2. package/cjs/graph/element.js.map +1 -1
  3. package/cjs/graph/glyph-element.js +8 -8
  4. package/cjs/graph/glyph-element.js.map +1 -1
  5. package/cjs/index.d.ts +1 -1
  6. package/cjs/index.js +1 -1
  7. package/cjs/index.js.map +1 -1
  8. package/cjs/interactions/brush-filter.js +2 -1
  9. package/cjs/interactions/element-highlight-by-group.js +1 -2
  10. package/cjs/interactions/index.js +2 -1
  11. package/cjs/interactions/legend-filter.js +1 -1
  12. package/cjs/interactions/player-filter.js +1 -1
  13. package/cjs/interactions/roll-up.js +1 -1
  14. package/cjs/interactions/scrollbar-filter.js +1 -1
  15. package/cjs/interactions/slider-filter.js +1 -1
  16. package/cjs/interactions/tooltip.js +1 -1
  17. package/cjs/interactions/view-drag-mixin.js +1 -1
  18. package/cjs/parse/coordinate.js +1 -1
  19. package/cjs/parse/event.js +1 -1
  20. package/cjs/parse/mark.js +1 -1
  21. package/cjs/parse/option.js +1 -1
  22. package/cjs/parse/scale.js +1 -2
  23. package/cjs/parse/transform.js +1 -1
  24. package/cjs/parse/util.js +1 -1
  25. package/cjs/parse/view.js +1 -1
  26. package/es/graph/element.js +3 -2
  27. package/es/graph/element.js.map +1 -1
  28. package/es/graph/glyph-element.js +8 -8
  29. package/es/graph/glyph-element.js.map +1 -1
  30. package/es/index.d.ts +1 -1
  31. package/es/index.js +1 -1
  32. package/es/index.js.map +1 -1
  33. package/es/interactions/brush-filter.js +2 -1
  34. package/es/interactions/element-highlight-by-group.js +1 -2
  35. package/es/interactions/index.js +2 -1
  36. package/es/interactions/legend-filter.js +1 -1
  37. package/es/interactions/player-filter.js +1 -1
  38. package/es/interactions/roll-up.js +1 -1
  39. package/es/interactions/scrollbar-filter.js +1 -1
  40. package/es/interactions/slider-filter.js +1 -1
  41. package/es/interactions/tooltip.js +1 -1
  42. package/es/interactions/view-drag-mixin.js +1 -1
  43. package/es/parse/coordinate.js +1 -1
  44. package/es/parse/event.js +1 -1
  45. package/es/parse/mark.js +1 -1
  46. package/es/parse/option.js +1 -1
  47. package/es/parse/scale.js +1 -2
  48. package/es/parse/transform.js +1 -1
  49. package/es/parse/util.js +1 -1
  50. package/es/parse/view.js +1 -1
  51. package/package.json +5 -5
@@ -32,7 +32,7 @@ class Element {
32
32
  this.graphicItem && (this.graphicItem[constants_1.BridgeElementKey] = this, attrTransforms && (this.graphicItem.onBeforeAttributeUpdate = attributes => {
33
33
  if (!this.mark) return attributes;
34
34
  return (0, transform_1.transformAttributes)(attrTransforms, attributes, this);
35
- }), this.clearGraphicAttributes(), this.mark.needAnimate() && (this.setPrevGraphicAttributes({}),
35
+ }), this.clearGraphicAttributes(), this.mark.needAnimate() && (this.setPrevGraphicAttributes(null),
36
36
  this.setNextGraphicAttributes(attributes), this.setFinalGraphicAttributes(attributes)));
37
37
  }
38
38
  updateGraphicItem(config) {
@@ -195,8 +195,9 @@ class Element {
195
195
  return nextAttrs;
196
196
  }
197
197
  applyGraphicAttributes(graphicAttributes) {
198
+ var _a, _b;
198
199
  if (!(0, vutils_1.isEmpty)(graphicAttributes)) if (this.mark.needAnimate()) {
199
- const nextGraphicAttributes = this.diffAttributes(graphicAttributes), prevGraphicAttributes = this.getPrevGraphicAttributes(), finalGraphicAttributes = this.getFinalGraphicAttributes();
200
+ const nextGraphicAttributes = this.diffAttributes(graphicAttributes), prevGraphicAttributes = null !== (_a = this.getPrevGraphicAttributes()) && void 0 !== _a ? _a : {}, finalGraphicAttributes = null !== (_b = this.getFinalGraphicAttributes()) && void 0 !== _b ? _b : {};
200
201
  Object.keys(nextGraphicAttributes).forEach((channel => {
201
202
  prevGraphicAttributes[channel] = this.getGraphicAttribute(channel), finalGraphicAttributes[channel] = nextGraphicAttributes[channel];
202
203
  })), this.setNextGra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iB,CAAC,UAA8C;;QAC9D,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,MAAM,CAAA,EAAE;YACvB,OAAO;SACR;QAED,IAAI,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE;YAChC,IAAI,IAAA,gBAAO,EAAC,UAAU,CAAC,EAAE;gBACvB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;oBACjC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;gBACnD,CAAC,CAAC,CAAC;aACJ;SACF;aAAM;YACL,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;SACpD;IACH,CAAC;IAID,OAAO;;QACL,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,KAAK,mCAAI,EAAE,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,KAAK,0CAAG,CAAC,CAAC,CAAC;IAC3E,CAAC;IACD,QAAQ;;QACN,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,IAAI,mCAAI,EAAE,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,IAAI,0CAAG,CAAC,CAAC,CAAC;IACzE,CAAC;CACF;AAtpBD,0BAspBC","file":"element.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport {\n array,\n has,\n isBoolean,\n isNil,\n isFunction,\n isString,\n isArray,\n get,\n isEmpty,\n isEqual as isObjEqual\n} from '@visactor/vutils';\nimport { isEqual } from '@visactor/vgrammar-util';\nimport type { IBaseCoordinate } from '@visactor/vgrammar-coordinate';\nimport { BridgeElementKey } from './constants';\nimport { DiffState, HOOK_EVENT, GrammarMarkType, BuiltInEncodeNames } from './enums';\nimport { invokeEncoderToItems } from './mark/encode';\nimport { removeGraphicItem } from './util/graphic';\nimport { transformAttributes } from './attributes/transform';\nimport {\n getLargeRectsPoints,\n getLargeSymbolsPoints,\n getLinePoints,\n isValidPointsChannel,\n isPointsMarkType\n} from './attributes/helpers';\nimport { getLineSegmentConfigs, getLinePointsFromSegments, parseCollectionMarkAttributes } from './attributes/line';\nimport type {\n BaseEncodeSpec,\n BaseSingleEncodeSpec,\n IElement,\n IMark,\n IMarkConfig,\n MarkElementItem,\n MarkFunctionType,\n MarkKeySpec,\n MarkSpec,\n MarkType,\n StateProxyEncodeSpec\n} from '../types';\nimport type { IGraphic, ILine, IGraphicAttribute } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { CustomPath2D } from '@visactor/vrender-core';\nimport { invokeFunctionType, parseField } from '../parse/util';\n\nexport class Element implements IElement {\n mark: IMark;\n\n key: string;\n groupKey?: string;\n data: any[] = null;\n\n states: string[] = [];\n\n diffState: DiffState = DiffState.enter;\n // Element should be reserved as long as it need to animate\n isReserved: boolean = false;\n\n runtimeStatesEncoder: BaseEncodeSpec = null;\n\n protected graphicItem: IGraphic;\n\n // hack before vRender refactoring\n items: MarkElementItem[] = [];\n\n constructor(mark: IMark) {\n this.mark = mark;\n }\n\n initGraphicItem(attributes: any = {}) {\n if (this.graphicItem) {\n return;\n }\n // 统一读取mark中是否可交互的配置\n const attrTransforms = this.mark.getAttributeTransforms();\n\n this.graphicItem = this.mark.addGraphicItem(\n attrTransforms ? transformAttributes(attrTransforms, attributes, this) : attributes,\n this.groupKey\n );\n\n if (!this.graphicItem) {\n return;\n }\n // 统一读取mark中是否可交互的配置\n this.graphicItem[BridgeElementKey] = this;\n if (attrTransforms) {\n this.graphicItem.onBeforeAttributeUpdate = (attributes: any) => {\n // mark might be released\n if (!this.mark) {\n return attributes;\n }\n const graphicAttributes = transformAttributes(attrTransforms, attributes, this);\n return graphicAttributes;\n };\n }\n\n // transform initial attributes\n this.clearGraphicAttributes();\n if (this.mark.needAnimate()) {\n this.setPrevGraphicAttributes({});\n this.setNextGraphicAttributes(attributes);\n this.setFinalGraphicAttributes(attributes);\n }\n }\n\n updateGraphicItem(config: IMarkConfig) {\n if (!this.graphicItem) {\n return;\n }\n\n if (!isNil(config.clip)) {\n this.graphicItem.setAttribute('clip', config.clip);\n }\n if (!isNil(config.interactive)) {\n this.graphicItem.setAttribute('pickable', config.interactive);\n }\n if (!isNil(config.zIndex)) {\n this.graphicItem.setAttribute('zIndex', config.zIndex);\n }\n if (this.diffState === DiffState.exit) {\n (this.graphicItem as any).releaseStatus = 'willRelease';\n } else {\n (this.graphicItem as any).releaseStatus = undefined;\n }\n\n const stateAnimation = this.mark.animate.getAnimationConfigs('state');\n if (stateAnimation.length !== 0) {\n (this.graphicItem as any).stateAnimateConfig = stateAnimation[0].originConfig;\n }\n }\n\n getGraphicItem() {\n return this.graphicItem;\n }\n\n removeGraphicItem() {\n // stop all animation when releasing including normal animation & morphing animation\n if (this.graphicItem) {\n this.graphicItem.animates?.forEach?.(animate => animate.stop());\n }\n\n if (this.graphicItem) {\n removeGraphicItem(this.graphicItem);\n this.graphicItem[BridgeElementKey] = null;\n this.graphicItem = null;\n }\n }\n\n resetGraphicItem() {\n if (this.graphicItem) {\n this.graphicItem = null;\n }\n }\n\n getBounds() {\n // FIXME: 没有更新 bounds 时拿到的 bound 可能为 null\n return this.graphicItem?.AABBBounds;\n }\n\n getStates() {\n return this.states.slice();\n }\n\n updateData(groupKey: string | null, data: any[], key: MarkKeySpec) {\n this.mark.emit(HOOK_EVENT.BEFORE_ELEMENT_UPDATE_DATA, { groupKey, data, key }, this);\n this.data = data;\n const keyGetter = parseField(key);\n this.items = data.map(datum => {\n const key = keyGetter(datum);\n const item = {\n datum,\n key,\n view: this.mark.view,\n nextAttrs: {}\n };\n\n return item;\n });\n\n this.groupKey = groupKey;\n this.key = this.mark.isCollectionMark() ? groupKey : this.items?.[0].key;\n\n this.mark.emit(HOOK_EVENT.AFTER_ELEMENT_UPDATE_DATA, { groupKey, data, key }, this);\n return this.items;\n }\n\n state(markState: MarkFunctionType<string | string[]>, parameters?: any) {\n const isCollectionMark = this.mark.isCollectionMark();\n\n const prevStateValues = this.states;\n const newStateValues = array(invokeFunctionType(markState, parameters, this.getDatum(), this));\n const stateSort = this.mark.getSpec()?.stateSort;\n\n if (stateSort) {\n stateSort.sort(stateSort);\n }\n\n const isStateChanged =\n newStateValues.length !== prevStateValues.length ||\n newStateValues.some((newState: string, index: number) => newState !== prevStateValues[index]);\n this.states = newStateValues;\n\n // early logic didn't handle collection mark, only update signal mark state for now\n if (!isCollectionMark && isStateChanged && this.diffState === DiffState.unChange) {\n this.diffState = DiffState.update;\n }\n }\n\n encodeGraphic(attrs?: any) {\n this.coordinateTransformEncode(this.items);\n\n const graphicAttributes = this.transformElementItems(this.items, this.mark.markType);\n\n if (attrs) {\n Object.assign(graphicAttributes, attrs);\n }\n\n if (!this.graphicItem) {\n this.initGraphicItem(graphicAttributes);\n } else {\n this.graphicItem.clearStates();\n // 更新数据流后,states计算不缓存\n this.graphicItem.states = {};\n this.graphicItem.stateProxy = null;\n\n this.applyGraphicAttributes(graphicAttributes);\n }\n\n if ((this.diffState === DiffState.enter || this.diffState === DiffState.update) && this.states.length) {\n this.useStates(this.states);\n }\n\n if (this.mark.markType === GrammarMarkType.shape) {\n // FIXME: shape需要拿到原始数据进行编码,暂时把数据绑定到graphicItem上,看后续graphicItem是否需要支持数据绑定\n (this.graphicItem as any).datum = this.items[0].datum;\n }\n\n // clear item attributes\n this.items.forEach(item => {\n item.nextAttrs = {};\n });\n this._setCustomizedShape();\n }\n\n private _setCustomizedShape() {\n if (!this.graphicItem) {\n return;\n }\n const setCustomizedShape = this.mark.getSpec()?.setCustomizedShape;\n\n if (!setCustomizedShape) {\n return;\n }\n\n this.graphicItem.pathProxy = (attrs: Partial<IGraphicAttribute>) => {\n return setCustomizedShape(this.data, attrs, new CustomPath2D());\n };\n }\n\n encodeItems(items: MarkElementItem[], encoders: BaseEncodeSpec, isReentered: boolean = false, parameters?: any) {\n const isCollectionMark = this.mark.isCollectionMark();\n // marshall encoder functions\n const updateEncoder = encoders[BuiltInEncodeNames.update];\n const enterEncoder = encoders[BuiltInEncodeNames.enter];\n const exitEncoder = encoders[BuiltInEncodeNames.exit];\n const onlyFullEncodeFirst = this.mark.isLargeMode() || (isCollectionMark && !this.mark.getSpec().enableSegments);\n\n if (this.diffState === DiffState.enter) {\n if (enterEncoder) {\n invokeEncoderToItems(this, items, enterEncoder, parameters, onlyFullEncodeFirst);\n }\n if (updateEncoder) {\n invokeEncoderToItems(this, items, updateEncoder, parameters, onlyFullEncodeFirst);\n }\n } else if (this.diffState === DiffState.update) {\n // if mark is reentered or mark is collection type, evaluate enter encode\n if ((isCollectionMark && enterEncoder) || isReentered) {\n invokeEncoderToItems(this, items, enterEncoder, parameters, onlyFullEncodeFirst);\n }\n if (updateEncoder) {\n invokeEncoderToItems(this, items, updateEncoder, parameters, onlyFullEncodeFirst);\n }\n } else if (this.diffState === DiffState.exit && exitEncoder) {\n // if mark is reentered, evaluate enter encode\n if (isReentered) {\n invokeEncoderToItems(this, items, enterEncoder, parameters, onlyFullEncodeFirst);\n }\n invokeEncoderToItems(this, items, exitEncoder, parameters, onlyFullEncodeFirst);\n }\n }\n\n protected coordinateTransformEncode(items: MarkElementItem[]) {\n if (!this.mark.coord || this.mark.markType === 'arc' || this.mark.disableCoordinateTransform === true) {\n return;\n }\n const coord = this.mark.coord.output() as IBaseCoordinate;\n\n items.forEach(item => {\n const nextAttrs = item.nextAttrs;\n const convertedPoint: IPointLike = coord.convert(nextAttrs);\n Object.assign(nextAttrs, convertedPoint);\n });\n }\n\n clearStates(hasAnimation?: boolean) {\n const stateAnimationEnable = isBoolean(hasAnimation)\n ? hasAnimation\n : this.mark.animate.getAnimationConfigs('state').length !== 0;\n\n this.states = [];\n\n if (this.graphicItem) {\n this.graphicItem.clearStates(stateAnimationEnable);\n }\n\n if (this.runtimeStatesEncoder) {\n this.runtimeStatesEncoder = {};\n }\n }\n\n private _updateRuntimeStates(state: string, attrs: any) {\n if (!this.runtimeStatesEncoder) {\n this.runtimeStatesEncoder = {};\n }\n\n this.runtimeStatesEncoder[state] = attrs;\n }\n\n hasState(state: string) {\n return this.states && this.states.includes(state);\n }\n\n addState(state: string | string[], attrs?: BaseSingleEncodeSpec) {\n const states = array(state);\n const nextStates = states.reduce((nextStates: string[], state: string) => {\n if (!nextStates.includes(state)) {\n nextStates.push(state);\n }\n return nextStates;\n }, this.states.slice());\n\n const isRuntimeStateUpdate = attrs && isString(state) && !isObjEqual(attrs, this.runtimeStatesEncoder?.[state]);\n if (isRuntimeStateUpdate) {\n this._updateRuntimeStates(state, attrs);\n }\n\n if (nextStates.length === this.states.length) {\n if (isRuntimeStateUpdate && this.graphicItem) {\n this.graphicItem.clearStates();\n this.useStates(nextStates);\n }\n\n return;\n }\n\n this.useStates(nextStates);\n }\n\n removeState(state: string | string[]) {\n const states = array(state);\n const nextStates = this.states.filter(state => !states.includes(state));\n if (nextStates.length === this.states.length) {\n return;\n }\n\n if (this.runtimeStatesEncoder) {\n states.forEach(state => {\n this.runtimeStatesEncoder[state] = null;\n });\n }\n this.useStates(nextStates);\n }\n\n protected getStateAttrs = (stateName: string, nextStates: string[]) => {\n const isRuntimeState = !isNil(this.runtimeStatesEncoder?.[stateName]);\n const encoder = isRuntimeState\n ? this.runtimeStatesEncoder[stateName]\n : (this.mark.getSpec() as MarkSpec).encode?.[stateName];\n\n if (!encoder) {\n return {};\n }\n\n if (isFunction(encoder)) {\n return (encoder as StateProxyEncodeSpec)(this.getDatum(), this, stateName, nextStates);\n }\n\n if (!isRuntimeState && this.graphicItem.states?.[stateName]) {\n return this.graphicItem.states[stateName];\n }\n\n const stateItems = this.items.map(item => Object.assign({}, item, { nextAttrs: {} }));\n // collection图元,暂时不支持在state更新中,支持更新points更新\n invokeEncoderToItems(this, stateItems, encoder, (this.mark as any).parameters());\n\n const graphicAttributes = this.transformElementItems(stateItems, this.mark.markType);\n\n if (!this.graphicItem.states) {\n this.graphicItem.states = { [stateName]: graphicAttributes };\n } else if (!this.graphicItem.states[stateName]) {\n this.graphicItem.states[stateName] = graphicAttributes;\n }\n\n return graphicAttributes;\n };\n\n useStates(states: string[], hasAnimation?: boolean) {\n if (!this.graphicItem) {\n return;\n }\n this.mark.emit(HOOK_EVENT.BEFORE_ELEMENT_STATE, { states }, this);\n\n this.states = states.slice();\n const stateSort = this.mark.getSpec()?.stateSort;\n\n if (stateSort) {\n this.states.sort(stateSort);\n }\n\n const stateAnimationEnable = isBoolean(hasAnimation)\n ? hasAnimation\n : this.mark.animate.getAnimationConfigs('state').length !== 0;\n\n this.graphicItem.stateProxy = this.getStateAttrs;\n this.graphicItem.useStates(this.states, stateAnimationEnable);\n\n this.mark.emit(HOOK_EVENT.AFTER_ELEMENT_STATE, { states }, this);\n }\n\n protected diffAttributes(graphicAttributes: { [channel: string]: any }) {\n const diffResult = {};\n const finalGraphicAttributes = this.getFinalGraphicAttributes();\n for (const key in graphicAttributes) {\n if (!isEqual(key, finalGraphicAttributes, graphicAttributes) || !has(finalGraphicAttributes, key)) {\n diffResult[key] = graphicAttributes[key];\n }\n }\n return diffResult;\n }\n\n /**\n * tranform the attribute to graphic attribute\n * @param items\n * @param markType In ordinary, markType is equal to mark.markType, but in glyph, markType is different from mark.markType\n * @param markName\n * @param computePoints\n * @returns\n */\n transformElementItems(items: MarkElementItem[], markType: MarkType, computePoints?: boolean): Record<string, any> {\n const item = items[0];\n\n if (!item.nextAttrs || Object.keys(item.nextAttrs).length === 0) {\n return {};\n }\n\n let nextAttrs = item?.nextAttrs;\n\n if (\n isPointsMarkType(markType) &&\n items &&\n items.length &&\n isNil(item.nextAttrs?.points) &&\n (computePoints === true || isValidPointsChannel(Object.keys(item.nextAttrs), this.mark.markType))\n ) {\n const lastPoints = this.getGraphicAttribute('points', false);\n const lastSegments = this.getGraphicAttribute('segments', false);\n const enableSegments = this.mark.getSpec().enableSegments;\n const itemNextAttrs = items.map(item => item.nextAttrs);\n const isProgressive = this.mark.isProgressive();\n nextAttrs = parseCollectionMarkAttributes(nextAttrs);\n\n if (markType === GrammarMarkType.line || markType === GrammarMarkType.area) {\n const linePoints = getLinePoints(items, true, lastPoints, markType === GrammarMarkType.area);\n\n // chartspace新增了配置,用于开启线段解析;渐进渲染状态不支持线段样式\n if (enableSegments && !isProgressive) {\n const points = !linePoints || linePoints.length === 0 ? getLinePointsFromSegments(lastSegments) : linePoints;\n const segments = getLineSegmentConfigs(itemNextAttrs, points, this);\n\n if (segments) {\n nextAttrs.segments = segments;\n nextAttrs.points = null;\n } else {\n nextAttrs.segments = null;\n nextAttrs.points = points;\n }\n } else if (isProgressive) {\n nextAttrs.segments = ((this.graphicItem as ILine)?.attribute?.segments ?? []).concat([\n { points: linePoints }\n ]);\n } else {\n nextAttrs.points = linePoints;\n nextAttrs.segments = null;\n }\n } else if (markType === GrammarMarkType.largeRects) {\n nextAttrs.points = getLargeRectsPoints(items, true, lastPoints);\n } else if (markType === GrammarMarkType.largeSymbols) {\n nextAttrs.points = getLargeSymbolsPoints(items, true, lastPoints);\n }\n }\n\n return nextAttrs;\n }\n\n protected applyGraphicAttributes(graphicAttributes: any) {\n if (isEmpty(graphicAttributes)) {\n return;\n }\n\n if (this.mark.needAnimate()) {\n // If mark need animate, diff attributes.\n const nextGraphicAttributes = this.diffAttributes(graphicAttributes);\n const prevGraphicAttributes = this.getPrevGraphicAttributes();\n\n const finalGraphicAttributes = this.getFinalGraphicAttributes();\n Object.keys(nextGraphicAttributes).forEach(channel => {\n prevGraphicAttributes[channel] = this.getGraphicAttribute(channel);\n finalGraphicAttributes[channel] = nextGraphicAttributes[channel];\n });\n this.setNextGraphicAttributes(nextGraphicAttributes);\n this.setPrevGraphicAttributes(prevGraphicAttributes);\n this.setFinalGraphicAttributes(finalGraphicAttributes);\n\n const currentAnimators = this.mark.animate.getElementAnimators(this);\n const animateGraphicAttributes = currentAnimators.reduce((attributes, animator) => {\n return Object.assign(attributes, animator.getEndAttributes());\n }, {});\n const currentGraphicAttributes = Object.assign({}, animateGraphicAttributes, finalGraphicAttributes);\n\n // Apply next attributes to current graphic item immediately.\n // Scene graph tree should be handled like no animation exists in dataflow procedure.\n this.graphicItem.setAttributes(currentGraphicAttributes);\n } else {\n // Otherwise, directly apply all attributes.\n this.graphicItem.setAttributes(graphicAttributes);\n }\n }\n\n getGraphicAttribute(channel: string, prev: boolean = false) {\n if (!this.graphicItem) {\n return undefined;\n }\n\n if (prev) {\n let value: any;\n const prevGraphicAttributes = this.getPrevGraphicAttributes();\n if (!isNil((value = get(prevGraphicAttributes, channel)))) {\n return value;\n }\n }\n\n // get attribute before transformed\n const trans = this.mark.getAttributeTransforms();\n let getKey: string[] = [channel];\n if (trans && trans.length) {\n const channelTransform = trans.find(entry => {\n return entry.storedAttrs && entry.channels.includes(channel);\n });\n\n if (channelTransform) {\n getKey = [channelTransform.storedAttrs, channel];\n }\n }\n return get(this.graphicItem?.attribute, getKey);\n }\n\n setGraphicAttribute(channel: string, value: any, final: boolean = true) {\n if (!this.graphicItem) {\n return;\n }\n const finalGraphicAttributes = this.getFinalGraphicAttributes();\n const prevGraphicAttributes = this.getPrevGraphicAttributes();\n\n if (final && finalGraphicAttributes) {\n finalGraphicAttributes[channel] = value;\n }\n if (prevGraphicAttributes && !has(prevGraphicAttributes, channel)) {\n prevGraphicAttributes[channel] = this.graphicItem.attribute[channel];\n }\n\n this.graphicItem.setAttribute(channel, value);\n }\n\n setGraphicAttributes(attributes: { [channel: string]: any }, final: boolean = true) {\n if (!this.graphicItem) {\n return;\n }\n const finalGraphicAttributes = this.getFinalGraphicAttributes();\n const prevGraphicAttributes = this.getPrevGraphicAttributes();\n\n Object.keys(attributes).forEach(key => {\n if (finalGraphicAttributes && final) {\n finalGraphicAttributes[key] = attributes[key];\n }\n if (prevGraphicAttributes && !has(prevGraphicAttributes, key)) {\n prevGraphicAttributes[key] = this.graphicItem.attribute[key];\n }\n });\n\n this.graphicItem.setAttributes(attributes);\n }\n\n /**\n * 获取 vRender 已变更的视觉通道属性,只应当由 VGrammar 中 调用\n * @returns 视觉通道键值对\n */\n getFinalGraphicAttributes() {\n return (this.graphicItem as any).finalAttrs;\n }\n\n protected setFinalGraphicAttributes(attributes: { [channel: string]: any }) {\n (this.graphicItem as any).finalAttrs = attributes;\n }\n\n /**\n * 获取 vRender 变更前的视觉通道属性,只应当由 VGrammar 调用\n * @returns 视觉通道键值对\n */\n getPrevGraphicAttributes() {\n return (this.graphicItem as any).prevAttrs;\n }\n\n protected setPrevGraphicAttributes(attributes: { [channel: string]: any }) {\n (this.graphicItem as any).prevAttrs = attributes;\n }\n\n /**\n * 获取 vRender 在单次 dataflow 中变更的视觉通道属性,只应当由 VGrammar 调用\n * @returns 视觉通道键值对\n */\n getNextGraphicAttributes() {\n return (this.graphicItem as any).nextAttrs;\n }\n\n protected setNextGraphicAttributes(attributes: { [channel: string]: any }) {\n (this.graphicItem as any).nextAttrs = attributes;\n }\n\n clearChangedGraphicAttributes() {\n if (this.graphicItem) {\n this.setPrevGraphicAttributes(null);\n this.setNextGraphicAttributes(null);\n }\n }\n\n clearGraphicAttributes() {\n if (this.graphicItem) {\n (this.graphicItem as any).prevAttrs && this.setPrevGraphicAttributes(null);\n (this.graphicItem as any).nextAttrs && this.setNextGraphicAttributes(null);\n (this.graphicItem as any).finalAttrs && this.setFinalGraphicAttributes(null);\n }\n }\n\n remove() {\n if (this.graphicItem) {\n removeGraphicItem(this.graphicItem);\n this.graphicItem = null;\n }\n }\n\n release() {\n this.removeGraphicItem();\n this.mark = null;\n this.data = null;\n this.items = null;\n }\n /**\n * hack support for transform & encode logic. DO NOT USE.\n */\n getItemAttribute(channel?: string) {\n if (!this.items?.length) {\n return;\n }\n\n if (this.mark.isCollectionMark()) {\n return isNil(channel)\n ? this.items.map(item => item.nextAttrs)\n : this.items.map(item => item.nextAttrs?.[channel]);\n }\n\n return isNil(channel) ? this.items[0].nextAttrs : this.items[0].nextAttrs?.[channel];\n }\n setItemAttributes(attributes: { [channel: string]: any } | any[]) {\n if (!this.items?.length) {\n return;\n }\n\n if (this.mark.isCollectionMark()) {\n if (isArray(attributes)) {\n this.items.forEach((item, index) => {\n Object.assign(item.nextAttrs, attributes[index]);\n });\n }\n } else {\n Object.assign(this.items[0].nextAttrs, attributes);\n }\n }\n /**\n * hack support for transform & encode logic. DO NOT USE.\n */\n getItem() {\n return this.mark.isCollectionMark() ? this.items ?? [] : this.items?.[0];\n }\n getDatum() {\n return this.mark.isCollectionMark() ? this.data ?? [] : this.data?.[0];\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/graph/element.ts"],"names":[],"mappings":";;;AAEA,6CAW0B;AAC1B,2DAAkD;AAElD,2CAA+C;AAC/C,mCAAqF;AACrF,0CAAqD;AACrD,4CAAmD;AACnD,sDAA6D;AAC7D,kDAM8B;AAC9B,4CAAoH;AAgBpH,yDAAsD;AACtD,wCAA+D;AAE/D,MAAa,OAAO;IAoBlB,YAAY,IAAW;QAfvB,SAAI,GAAU,IAAI,CAAC;QAEnB,WAAM,GAAa,EAAE,CAAC;QAEtB,cAAS,GAAc,iBAAS,CAAC,KAAK,CAAC;QAEvC,eAAU,GAAY,KAAK,CAAC;QAE5B,yBAAoB,GAAmB,IAAI,CAAC;QAK5C,UAAK,GAAsB,EAAE,CAAC;QAuTpB,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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CAAC,IAAI,mCAAI,EAAE,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,IAAI,0CAAG,CAAC,CAAC,CAAC;IACzE,CAAC;CACF;AAtpBD,0BAspBC","file":"element.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport {\n array,\n has,\n isBoolean,\n isNil,\n isFunction,\n isString,\n isArray,\n get,\n isEmpty,\n isEqual as isObjEqual\n} from '@visactor/vutils';\nimport { isEqual } from '@visactor/vgrammar-util';\nimport type { IBaseCoordinate } from '@visactor/vgrammar-coordinate';\nimport { BridgeElementKey } from './constants';\nimport { DiffState, HOOK_EVENT, GrammarMarkType, BuiltInEncodeNames } from './enums';\nimport { invokeEncoderToItems } from './mark/encode';\nimport { removeGraphicItem } from './util/graphic';\nimport { transformAttributes } from './attributes/transform';\nimport {\n getLargeRectsPoints,\n getLargeSymbolsPoints,\n getLinePoints,\n isValidPointsChannel,\n isPointsMarkType\n} from './attributes/helpers';\nimport { getLineSegmentConfigs, getLinePointsFromSegments, parseCollectionMarkAttributes } from './attributes/line';\nimport type {\n BaseEncodeSpec,\n BaseSingleEncodeSpec,\n IElement,\n IMark,\n IMarkConfig,\n MarkElementItem,\n MarkFunctionType,\n MarkKeySpec,\n MarkSpec,\n MarkType,\n StateProxyEncodeSpec\n} from '../types';\nimport type { IGraphic, ILine, IGraphicAttribute } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { CustomPath2D } from '@visactor/vrender-core';\nimport { invokeFunctionType, parseField } from '../parse/util';\n\nexport class Element implements IElement {\n mark: IMark;\n\n key: string;\n groupKey?: string;\n data: any[] = null;\n\n states: string[] = [];\n\n diffState: DiffState = DiffState.enter;\n // Element should be reserved as long as it need to animate\n isReserved: boolean = false;\n\n runtimeStatesEncoder: BaseEncodeSpec = null;\n\n protected graphicItem: IGraphic;\n\n // hack before vRender refactoring\n items: MarkElementItem[] = [];\n\n constructor(mark: IMark) {\n this.mark = mark;\n }\n\n initGraphicItem(attributes: any = {}) {\n if (this.graphicItem) {\n return;\n }\n // 统一读取mark中是否可交互的配置\n const attrTransforms = this.mark.getAttributeTransforms();\n\n this.graphicItem = this.mark.addGraphicItem(\n attrTransforms ? transformAttributes(attrTransforms, attributes, this) : attributes,\n this.groupKey\n );\n\n if (!this.graphicItem) {\n return;\n }\n // 统一读取mark中是否可交互的配置\n this.graphicItem[BridgeElementKey] = this;\n if (attrTransforms) {\n this.graphicItem.onBeforeAttributeUpdate = (attributes: any) => {\n // mark might be released\n if (!this.mark) {\n return attributes;\n }\n const graphicAttributes = transformAttributes(attrTransforms, attributes, this);\n return graphicAttributes;\n };\n }\n\n // transform initial attributes\n this.clearGraphicAttributes();\n if (this.mark.needAnimate()) {\n this.setPrevGraphicAttributes(null);\n this.setNextGraphicAttributes(attributes);\n this.setFinalGraphicAttributes(attributes);\n }\n }\n\n updateGraphicItem(config: IMarkConfig) {\n if (!this.graphicItem) {\n return;\n }\n\n if (!isNil(config.clip)) {\n this.graphicItem.setAttribute('clip', config.clip);\n }\n if (!isNil(config.interactive)) {\n this.graphicItem.setAttribute('pickable', config.interactive);\n }\n if (!isNil(config.zIndex)) {\n this.graphicItem.setAttribute('zIndex', config.zIndex);\n }\n if (this.diffState === DiffState.exit) {\n (this.graphicItem as any).releaseStatus = 'willRelease';\n } else {\n (this.graphicItem as any).releaseStatus = undefined;\n }\n\n const stateAnimation = this.mark.animate.getAnimationConfigs('state');\n if (stateAnimation.length !== 0) {\n (this.graphicItem as any).stateAnimateConfig = stateAnimation[0].originConfig;\n }\n }\n\n getGraphicItem() {\n return this.graphicItem;\n }\n\n removeGraphicItem() {\n // stop all animation when releasing including normal animation & morphing animation\n if (this.graphicItem) {\n this.graphicItem.animates?.forEach?.(animate => animate.stop());\n }\n\n if (this.graphicItem) {\n removeGraphicItem(this.graphicItem);\n this.graphicItem[BridgeElementKey] = null;\n this.graphicItem = null;\n }\n }\n\n resetGraphicItem() {\n if (this.graphicItem) {\n this.graphicItem = null;\n }\n }\n\n getBounds() {\n // FIXME: 没有更新 bounds 时拿到的 bound 可能为 null\n return this.graphicItem?.AABBBounds;\n }\n\n getStates() {\n return this.states.slice();\n }\n\n updateData(groupKey: string | null, data: any[], key: MarkKeySpec) {\n this.mark.emit(HOOK_EVENT.BEFORE_ELEMENT_UPDATE_DATA, { groupKey, data, key }, this);\n this.data = data;\n const keyGetter = parseField(key);\n this.items = data.map(datum => {\n const key = keyGetter(datum);\n const item = {\n datum,\n key,\n view: this.mark.view,\n nextAttrs: {}\n };\n\n return item;\n });\n\n this.groupKey = groupKey;\n this.key = this.mark.isCollectionMark() ? groupKey : this.items?.[0].key;\n\n this.mark.emit(HOOK_EVENT.AFTER_ELEMENT_UPDATE_DATA, { groupKey, data, key }, this);\n return this.items;\n }\n\n state(markState: MarkFunctionType<string | string[]>, parameters?: any) {\n const isCollectionMark = this.mark.isCollectionMark();\n\n const prevStateValues = this.states;\n const newStateValues = array(invokeFunctionType(markState, parameters, this.getDatum(), this));\n const stateSort = this.mark.getSpec()?.stateSort;\n\n if (stateSort) {\n stateSort.sort(stateSort);\n }\n\n const isStateChanged =\n newStateValues.length !== prevStateValues.length ||\n newStateValues.some((newState: string, index: number) => newState !== prevStateValues[index]);\n this.states = newStateValues;\n\n // early logic didn't handle collection mark, only update signal mark state for now\n if (!isCollectionMark && isStateChanged && this.diffState === DiffState.unChange) {\n this.diffState = DiffState.update;\n }\n }\n\n encodeGraphic(attrs?: any) {\n this.coordinateTransformEncode(this.items);\n\n const graphicAttributes = this.transformElementItems(this.items, this.mark.markType);\n\n if (attrs) {\n Object.assign(graphicAttributes, attrs);\n }\n\n if (!this.graphicItem) {\n this.initGraphicItem(graphicAttributes);\n } else {\n this.graphicItem.clearStates();\n // 更新数据流后,states计算不缓存\n this.graphicItem.states = {};\n this.graphicItem.stateProxy = null;\n\n this.applyGraphicAttributes(graphicAttributes);\n }\n\n if ((this.diffState === DiffState.enter || this.diffState === DiffState.update) && this.states.length) {\n this.useStates(this.states);\n }\n\n if (this.mark.markType === GrammarMarkType.shape) {\n // FIXME: shape需要拿到原始数据进行编码,暂时把数据绑定到graphicItem上,看后续graphicItem是否需要支持数据绑定\n (this.graphicItem as any).datum = this.items[0].datum;\n }\n\n // clear item attributes\n this.items.forEach(item => {\n item.nextAttrs = {};\n });\n this._setCustomizedShape();\n }\n\n private _setCustomizedShape() {\n if (!this.graphicItem) {\n return;\n }\n const setCustomizedShape = this.mark.getSpec()?.setCustomizedShape;\n\n if (!setCustomizedShape) {\n return;\n }\n\n this.graphicItem.pathProxy = (attrs: Partial<IGraphicAttribute>) => {\n return setCustomizedShape(this.data, attrs, new CustomPath2D());\n };\n }\n\n encodeItems(items: MarkElementItem[], encoders: BaseEncodeSpec, isReentered: boolean = false, parameters?: any) {\n const isCollectionMark = this.mark.isCollectionMark();\n // marshall encoder functions\n const updateEncoder = encoders[BuiltInEncodeNames.update];\n const enterEncoder = encoders[BuiltInEncodeNames.enter];\n const exitEncoder = encoders[BuiltInEncodeNames.exit];\n const onlyFullEncodeFirst = this.mark.isLargeMode() || (isCollectionMark && !this.mark.getSpec().enableSegments);\n\n if (this.diffState === DiffState.enter) {\n if (enterEncoder) {\n invokeEncoderToItems(this, items, enterEncoder, parameters, onlyFullEncodeFirst);\n }\n if (updateEncoder) {\n invokeEncoderToItems(this, items, updateEncoder, parameters, onlyFullEncodeFirst);\n }\n } else if (this.diffState === DiffState.update) {\n // if mark is reentered or mark is collection type, evaluate enter encode\n if ((isCollectionMark && enterEncoder) || isReentered) {\n invokeEncoderToItems(this, items, enterEncoder, parameters, onlyFullEncodeFirst);\n }\n if (updateEncoder) {\n invokeEncoderToItems(this, items, updateEncoder, parameters, onlyFullEncodeFirst);\n }\n } else if (this.diffState === DiffState.exit && exitEncoder) {\n // if mark is reentered, evaluate enter encode\n if (isReentered) {\n invokeEncoderToItems(this, items, enterEncoder, parameters, onlyFullEncodeFirst);\n }\n invokeEncoderToItems(this, items, exitEncoder, parameters, onlyFullEncodeFirst);\n }\n }\n\n protected coordinateTransformEncode(items: MarkElementItem[]) {\n if (!this.mark.coord || this.mark.markType === 'arc' || this.mark.disableCoordinateTransform === true) {\n return;\n }\n const coord = this.mark.coord.output() as IBaseCoordinate;\n\n items.forEach(item => {\n const nextAttrs = item.nextAttrs;\n const convertedPoint: IPointLike = coord.convert(nextAttrs);\n Object.assign(nextAttrs, convertedPoint);\n });\n }\n\n clearStates(hasAnimation?: boolean) {\n const stateAnimationEnable = isBoolean(hasAnimation)\n ? hasAnimation\n : this.mark.animate.getAnimationConfigs('state').length !== 0;\n\n this.states = [];\n\n if (this.graphicItem) {\n this.graphicItem.clearStates(stateAnimationEnable);\n }\n\n if (this.runtimeStatesEncoder) {\n this.runtimeStatesEncoder = {};\n }\n }\n\n private _updateRuntimeStates(state: string, attrs: any) {\n if (!this.runtimeStatesEncoder) {\n this.runtimeStatesEncoder = {};\n }\n\n this.runtimeStatesEncoder[state] = attrs;\n }\n\n hasState(state: string) {\n return this.states && this.states.includes(state);\n }\n\n addState(state: string | string[], attrs?: BaseSingleEncodeSpec) {\n const states = array(state);\n const nextStates = states.reduce((nextStates: string[], state: string) => {\n if (!nextStates.includes(state)) {\n nextStates.push(state);\n }\n return nextStates;\n }, this.states.slice());\n\n const isRuntimeStateUpdate = attrs && isString(state) && !isObjEqual(attrs, this.runtimeStatesEncoder?.[state]);\n if (isRuntimeStateUpdate) {\n this._updateRuntimeStates(state, attrs);\n }\n\n if (nextStates.length === this.states.length) {\n if (isRuntimeStateUpdate && this.graphicItem) {\n this.graphicItem.clearStates();\n this.useStates(nextStates);\n }\n\n return;\n }\n\n this.useStates(nextStates);\n }\n\n removeState(state: string | string[]) {\n const states = array(state);\n const nextStates = this.states.filter(state => !states.includes(state));\n if (nextStates.length === this.states.length) {\n return;\n }\n\n if (this.runtimeStatesEncoder) {\n states.forEach(state => {\n this.runtimeStatesEncoder[state] = null;\n });\n }\n this.useStates(nextStates);\n }\n\n protected getStateAttrs = (stateName: string, nextStates: string[]) => {\n const isRuntimeState = !isNil(this.runtimeStatesEncoder?.[stateName]);\n const encoder = isRuntimeState\n ? this.runtimeStatesEncoder[stateName]\n : (this.mark.getSpec() as MarkSpec).encode?.[stateName];\n\n if (!encoder) {\n return {};\n }\n\n if (isFunction(encoder)) {\n return (encoder as StateProxyEncodeSpec)(this.getDatum(), this, stateName, nextStates);\n }\n\n if (!isRuntimeState && this.graphicItem.states?.[stateName]) {\n return this.graphicItem.states[stateName];\n }\n\n const stateItems = this.items.map(item => Object.assign({}, item, { nextAttrs: {} }));\n // collection图元,暂时不支持在state更新中,支持更新points更新\n invokeEncoderToItems(this, stateItems, encoder, (this.mark as any).parameters());\n\n const graphicAttributes = this.transformElementItems(stateItems, this.mark.markType);\n\n if (!this.graphicItem.states) {\n this.graphicItem.states = { [stateName]: graphicAttributes };\n } else if (!this.graphicItem.states[stateName]) {\n this.graphicItem.states[stateName] = graphicAttributes;\n }\n\n return graphicAttributes;\n };\n\n useStates(states: string[], hasAnimation?: boolean) {\n if (!this.graphicItem) {\n return;\n }\n this.mark.emit(HOOK_EVENT.BEFORE_ELEMENT_STATE, { states }, this);\n\n this.states = states.slice();\n const stateSort = this.mark.getSpec()?.stateSort;\n\n if (stateSort) {\n this.states.sort(stateSort);\n }\n\n const stateAnimationEnable = isBoolean(hasAnimation)\n ? hasAnimation\n : this.mark.animate.getAnimationConfigs('state').length !== 0;\n\n this.graphicItem.stateProxy = this.getStateAttrs;\n this.graphicItem.useStates(this.states, stateAnimationEnable);\n\n this.mark.emit(HOOK_EVENT.AFTER_ELEMENT_STATE, { states }, this);\n }\n\n protected diffAttributes(graphicAttributes: { [channel: string]: any }) {\n const diffResult = {};\n const finalGraphicAttributes = this.getFinalGraphicAttributes();\n for (const key in graphicAttributes) {\n if (!isEqual(key, finalGraphicAttributes, graphicAttributes) || !has(finalGraphicAttributes, key)) {\n diffResult[key] = graphicAttributes[key];\n }\n }\n return diffResult;\n }\n\n /**\n * tranform the attribute to graphic attribute\n * @param items\n * @param markType In ordinary, markType is equal to mark.markType, but in glyph, markType is different from mark.markType\n * @param markName\n * @param computePoints\n * @returns\n */\n transformElementItems(items: MarkElementItem[], markType: MarkType, computePoints?: boolean): Record<string, any> {\n const item = items[0];\n\n if (!item.nextAttrs || Object.keys(item.nextAttrs).length === 0) {\n return {};\n }\n\n let nextAttrs = item?.nextAttrs;\n\n if (\n isPointsMarkType(markType) &&\n items &&\n items.length &&\n isNil(item.nextAttrs?.points) &&\n (computePoints === true || isValidPointsChannel(Object.keys(item.nextAttrs), this.mark.markType))\n ) {\n const lastPoints = this.getGraphicAttribute('points', false);\n const lastSegments = this.getGraphicAttribute('segments', false);\n const enableSegments = this.mark.getSpec().enableSegments;\n const itemNextAttrs = items.map(item => item.nextAttrs);\n const isProgressive = this.mark.isProgressive();\n nextAttrs = parseCollectionMarkAttributes(nextAttrs);\n\n if (markType === GrammarMarkType.line || markType === GrammarMarkType.area) {\n const linePoints = getLinePoints(items, true, lastPoints, markType === GrammarMarkType.area);\n\n // chartspace新增了配置,用于开启线段解析;渐进渲染状态不支持线段样式\n if (enableSegments && !isProgressive) {\n const points = !linePoints || linePoints.length === 0 ? getLinePointsFromSegments(lastSegments) : linePoints;\n const segments = getLineSegmentConfigs(itemNextAttrs, points, this);\n\n if (segments) {\n nextAttrs.segments = segments;\n nextAttrs.points = null;\n } else {\n nextAttrs.segments = null;\n nextAttrs.points = points;\n }\n } else if (isProgressive) {\n nextAttrs.segments = ((this.graphicItem as ILine)?.attribute?.segments ?? []).concat([\n { points: linePoints }\n ]);\n } else {\n nextAttrs.points = linePoints;\n nextAttrs.segments = null;\n }\n } else if (markType === GrammarMarkType.largeRects) {\n nextAttrs.points = getLargeRectsPoints(items, true, lastPoints);\n } else if (markType === GrammarMarkType.largeSymbols) {\n nextAttrs.points = getLargeSymbolsPoints(items, true, lastPoints);\n }\n }\n\n return nextAttrs;\n }\n\n protected applyGraphicAttributes(graphicAttributes: any) {\n if (isEmpty(graphicAttributes)) {\n return;\n }\n\n if (this.mark.needAnimate()) {\n // If mark need animate, diff attributes.\n const nextGraphicAttributes = this.diffAttributes(graphicAttributes);\n const prevGraphicAttributes = this.getPrevGraphicAttributes() ?? {};\n const finalGraphicAttributes = this.getFinalGraphicAttributes() ?? {};\n\n Object.keys(nextGraphicAttributes).forEach(channel => {\n prevGraphicAttributes[channel] = this.getGraphicAttribute(channel);\n finalGraphicAttributes[channel] = nextGraphicAttributes[channel];\n });\n this.setNextGraphicAttributes(nextGraphicAttributes);\n this.setPrevGraphicAttributes(prevGraphicAttributes);\n this.setFinalGraphicAttributes(finalGraphicAttributes);\n\n const currentAnimators = this.mark.animate.getElementAnimators(this);\n const animateGraphicAttributes = currentAnimators.reduce((attributes, animator) => {\n return Object.assign(attributes, animator.getEndAttributes());\n }, {});\n const currentGraphicAttributes = Object.assign({}, animateGraphicAttributes, finalGraphicAttributes);\n\n // Apply next attributes to current graphic item immediately.\n // Scene graph tree should be handled like no animation exists in dataflow procedure.\n this.graphicItem.setAttributes(currentGraphicAttributes);\n } else {\n // Otherwise, directly apply all attributes.\n this.graphicItem.setAttributes(graphicAttributes);\n }\n }\n\n getGraphicAttribute(channel: string, prev: boolean = false) {\n if (!this.graphicItem) {\n return undefined;\n }\n\n if (prev) {\n let value: any;\n const prevGraphicAttributes = this.getPrevGraphicAttributes();\n if (!isNil((value = get(prevGraphicAttributes, channel)))) {\n return value;\n }\n }\n\n // get attribute before transformed\n const trans = this.mark.getAttributeTransforms();\n let getKey: string[] = [channel];\n if (trans && trans.length) {\n const channelTransform = trans.find(entry => {\n return entry.storedAttrs && entry.channels.includes(channel);\n });\n\n if (channelTransform) {\n getKey = [channelTransform.storedAttrs, channel];\n }\n }\n return get(this.graphicItem?.attribute, getKey);\n }\n\n setGraphicAttribute(channel: string, value: any, final: boolean = true) {\n if (!this.graphicItem) {\n return;\n }\n const finalGraphicAttributes = this.getFinalGraphicAttributes();\n const prevGraphicAttributes = this.getPrevGraphicAttributes();\n\n if (final && finalGraphicAttributes) {\n finalGraphicAttributes[channel] = value;\n }\n if (prevGraphicAttributes && !has(prevGraphicAttributes, channel)) {\n prevGraphicAttributes[channel] = this.graphicItem.attribute[channel];\n }\n\n this.graphicItem.setAttribute(channel, value);\n }\n\n setGraphicAttributes(attributes: { [channel: string]: any }, final: boolean = true) {\n if (!this.graphicItem) {\n return;\n }\n const finalGraphicAttributes = this.getFinalGraphicAttributes();\n const prevGraphicAttributes = this.getPrevGraphicAttributes();\n\n Object.keys(attributes).forEach(key => {\n if (finalGraphicAttributes && final) {\n finalGraphicAttributes[key] = attributes[key];\n }\n if (prevGraphicAttributes && !has(prevGraphicAttributes, key)) {\n prevGraphicAttributes[key] = this.graphicItem.attribute[key];\n }\n });\n\n this.graphicItem.setAttributes(attributes);\n }\n\n /**\n * 获取 vRender 已变更的视觉通道属性,只应当由 VGrammar 中 调用\n * @returns 视觉通道键值对\n */\n getFinalGraphicAttributes() {\n return (this.graphicItem as any).finalAttrs;\n }\n\n protected setFinalGraphicAttributes(attributes: { [channel: string]: any }) {\n (this.graphicItem as any).finalAttrs = attributes;\n }\n\n /**\n * 获取 vRender 变更前的视觉通道属性,只应当由 VGrammar 调用\n * @returns 视觉通道键值对\n */\n getPrevGraphicAttributes() {\n return (this.graphicItem as any).prevAttrs;\n }\n\n protected setPrevGraphicAttributes(attributes: { [channel: string]: any }) {\n (this.graphicItem as any).prevAttrs = attributes;\n }\n\n /**\n * 获取 vRender 在单次 dataflow 中变更的视觉通道属性,只应当由 VGrammar 调用\n * @returns 视觉通道键值对\n */\n getNextGraphicAttributes() {\n return (this.graphicItem as any).nextAttrs;\n }\n\n protected setNextGraphicAttributes(attributes: { [channel: string]: any }) {\n (this.graphicItem as any).nextAttrs = attributes;\n }\n\n clearChangedGraphicAttributes() {\n if (this.graphicItem) {\n this.setPrevGraphicAttributes(null);\n this.setNextGraphicAttributes(null);\n }\n }\n\n clearGraphicAttributes() {\n if (this.graphicItem) {\n (this.graphicItem as any).prevAttrs && this.setPrevGraphicAttributes(null);\n (this.graphicItem as any).nextAttrs && this.setNextGraphicAttributes(null);\n (this.graphicItem as any).finalAttrs && this.setFinalGraphicAttributes(null);\n }\n }\n\n remove() {\n if (this.graphicItem) {\n removeGraphicItem(this.graphicItem);\n this.graphicItem = null;\n }\n }\n\n release() {\n this.removeGraphicItem();\n this.mark = null;\n this.data = null;\n this.items = null;\n }\n /**\n * hack support for transform & encode logic. DO NOT USE.\n */\n getItemAttribute(channel?: string) {\n if (!this.items?.length) {\n return;\n }\n\n if (this.mark.isCollectionMark()) {\n return isNil(channel)\n ? this.items.map(item => item.nextAttrs)\n : this.items.map(item => item.nextAttrs?.[channel]);\n }\n\n return isNil(channel) ? this.items[0].nextAttrs : this.items[0].nextAttrs?.[channel];\n }\n setItemAttributes(attributes: { [channel: string]: any } | any[]) {\n if (!this.items?.length) {\n return;\n }\n\n if (this.mark.isCollectionMark()) {\n if (isArray(attributes)) {\n this.items.forEach((item, index) => {\n Object.assign(item.nextAttrs, attributes[index]);\n });\n }\n } else {\n Object.assign(this.items[0].nextAttrs, attributes);\n }\n }\n /**\n * hack support for transform & encode logic. DO NOT USE.\n */\n getItem() {\n return this.mark.isCollectionMark() ? this.items ?? [] : this.items?.[0];\n }\n getDatum() {\n return this.mark.isCollectionMark() ? this.data ?? [] : this.data?.[0];\n }\n}\n"]}
@@ -33,8 +33,7 @@ class GlyphElement extends element_1.Element {
33
33
  }
34
34
  initGraphicItem(attributes = {}) {
35
35
  if (this.graphicItem) return;
36
- const attrs = Object.assign({}, attributes);
37
- this.graphicItem = this.mark.addGraphicItem(attrs, this.groupKey), this.graphicItem[constants_1.BridgeElementKey] = this,
36
+ this.graphicItem = this.mark.addGraphicItem(attributes, this.groupKey), this.graphicItem[constants_1.BridgeElementKey] = this,
38
37
  this.graphicItem.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(!1);
39
38
  const glyphMarks = this.glyphMeta.getMarks();
40
39
  this.glyphGraphicItems = {}, this.graphicItem.getSubGraphic().forEach((graphic => {
@@ -148,8 +147,9 @@ class GlyphElement extends element_1.Element {
148
147
  return diffResult;
149
148
  }
150
149
  applyGlyphGraphicAttributes(graphicAttributes, markName, graphicItem) {
150
+ var _a, _b;
151
151
  if (this.mark.needAnimate()) {
152
- const nextGraphicAttributes = this.diffAttributes(graphicAttributes, markName), prevGraphicAttributes = this.getPrevGraphicAttributes(markName), finalGraphicAttributes = this.getFinalGraphicAttributes(markName);
152
+ const nextGraphicAttributes = this.diffAttributes(graphicAttributes, markName), prevGraphicAttributes = null !== (_a = this.getPrevGraphicAttributes(markName)) && void 0 !== _a ? _a : {}, finalGraphicAttributes = null !== (_b = this.getFinalGraphicAttributes(markName)) && void 0 !== _b ? _b : {};
153
153
  Object.keys(nextGraphicAttributes).forEach((channel => {
154
154
  prevGraphicAttributes[channel] = graphicItem.attribute[channel], finalGraphicAttributes[channel] = nextGraphicAttributes[channel];
155
155
  })), this.setNextGraphicAttributes(nextGraphicAttributes, markName), this.setPrevGraphicAttributes(prevGraphicAttributes, markName),
@@ -175,15 +175,15 @@ class GlyphElement extends element_1.Element {
175
175
  (markName ? this.glyphGraphicItems[markName] : this.graphicItem).nextAttrs = attributes;
176
176
  }
177
177
  clearChangedGraphicAttributes() {
178
- this.setPrevGraphicAttributes({}), this.setNextGraphicAttributes({}), Object.keys(this.glyphGraphicItems).forEach((markName => {
179
- this.setPrevGraphicAttributes({}, markName), this.setNextGraphicAttributes({}, markName);
178
+ this.setPrevGraphicAttributes(null), this.setNextGraphicAttributes(null), Object.keys(this.glyphGraphicItems).forEach((markName => {
179
+ this.setPrevGraphicAttributes(null, markName), this.setNextGraphicAttributes(null, markName);
180
180
  }));
181
181
  }
182
182
  clearGraphicAttributes() {
183
- this.setPrevGraphicAttributes({}), this.setNextGraphicAttributes({}), this.setFinalGraphicAttributes({}),
183
+ this.setPrevGraphicAttributes(null), this.setNextGraphicAttributes(null), this.setFinalGraphicAttributes(null),
184
184
  Object.keys(this.glyphGraphicItems).forEach((markName => {
185
- this.setPrevGraphicAttributes({}, markName), this.setNextGraphicAttributes({}, markName),
186
- this.setFinalGraphicAttributes({}, markName);
185
+ this.setPrevGraphicAttributes(null, markName), this.setNextGraphicAttributes(null, markName),
186
+ this.setFinalGraphicAttributes(null, markName);
187
187
  }));
188
188
  }
189
189
  remove() {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graph/glyph-element.ts"],"names":[],"mappings":";;;AAAA,6CAAqE;AACrE,2DAAkD;AAUlD,sDAAuF;AACvF,2CAAmE;AACnE,mCAAiE;AACjE,uCAAoC;AACpC,0CAAqD;AAGrD,MAAa,YAAa,SAAQ,iBAAO;IAQvC,YAAY,IAAgB;QAC1B,KAAK,CAAC,IAAI,CAAC,CAAC;QAsDJ,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,OA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Q,CAAC,EAAE;YACrD,IAAI,CAAC,wBAAwB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;YAC5C,IAAI,CAAC,wBAAwB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,sBAAsB;QACpB,IAAI,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;QAClC,IAAI,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;QAClC,IAAI,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC;QACnC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACrD,IAAI,CAAC,wBAAwB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;YAC5C,IAAI,CAAC,wBAAwB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;YAC5C,IAAI,CAAC,yBAAyB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,KAAK,CAAC,MAAM,EAAE,CAAC;IACjB,CAAC;IAED,OAAO;QACL,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;gBAC1D,WAAW,CAAC,4BAAgB,CAAC,GAAG,IAAI,CAAC;YACvC,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;SAC/B;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;CACF;AA9YD,oCA8YC","file":"glyph-element.js","sourcesContent":["import { has, isNil, isBoolean, isFunction } from '@visactor/vutils';\nimport { isEqual } from '@visactor/vgrammar-util';\nimport type {\n IGlyphElement,\n IGlyphMark,\n MarkElementItem,\n MarkSpec,\n IGlyphMeta,\n MarkType,\n StateProxyEncodeSpec\n} from '../types';\nimport { cloneTransformAttributes, transformAttributes } from './attributes/transform';\nimport { BridgeElementKey, CollectionMarkType } from './constants';\nimport { DiffState, HOOK_EVENT, GrammarMarkType } from './enums';\nimport { Element } from './element';\nimport { invokeEncoderToItems } from './mark/encode';\nimport type { IGraphicAttribute, IGlyph } from '@visactor/vrender-core';\n\nexport class GlyphElement extends Element implements IGlyphElement {\n declare graphicItem: IGlyph;\n\n declare mark: IGlyphMark;\n protected glyphGraphicItems: { [markName: string]: any };\n\n private glyphMeta: IGlyphMeta;\n\n constructor(mark: IGlyphMark) {\n super(mark);\n this.glyphMeta = this.mark.getGlyphMeta();\n }\n\n getGlyphGraphicItems() {\n return this.glyphGraphicItems;\n }\n\n initGraphicItem(attributes: any = {}) {\n if (this.graphicItem) {\n return;\n }\n\n const attrs = Object.assign({}, attributes);\n this.graphicItem = this.mark.addGraphicItem(attrs, this.groupKey) as IGlyph;\n this.graphicItem[BridgeElementKey] = this;\n this.graphicItem.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(false);\n\n const glyphMarks = this.glyphMeta.getMarks();\n this.glyphGraphicItems = {};\n this.graphicItem.getSubGraphic().forEach((graphic: any) => {\n const markType = glyphMarks[graphic.name];\n this.glyphGraphicItems[graphic.name] = graphic;\n graphic.onBeforeAttributeUpdate = (attributes: any) => {\n // mark might be released\n if (!this.mark) {\n return attributes;\n }\n const graphicAttributes = transformAttributes(markType, attributes, this, graphic.name);\n return graphicAttributes;\n };\n });\n\n this.clearGraphicAttributes();\n }\n\n useStates(states: string[], hasAnimation?: boolean) {\n if (!this.graphicItem) {\n return;\n }\n this.mark.emit(HOOK_EVENT.BEFORE_ELEMENT_STATE, { states }, this);\n\n this.states = states.slice();\n\n const stateAnimationEnable = isBoolean(hasAnimation)\n ? hasAnimation\n : this.mark.animate.getAnimationConfigs('state').length !== 0;\n\n this.graphicItem.glyphStateProxy = this.getStateAttrs;\n this.graphicItem.useStates(this.states, stateAnimationEnable);\n\n this.mark.emit(HOOK_EVENT.AFTER_ELEMENT_STATE, { states }, this);\n }\n\n protected getStateAttrs = (stateName: string, nextStates: string[]) => {\n const isRuntimeState = !isNil(this.runtimeStatesEncoder?.[stateName]);\n const encoder = isRuntimeState\n ? this.runtimeStatesEncoder[stateName]\n : (this.mark.getSpec() as MarkSpec).encode?.[stateName];\n\n const glyphStateAttributes = {} as {\n attributes: Partial<IGraphicAttribute>;\n subAttributes: Partial<IGraphicAttribute>[];\n };\n\n if (!encoder) {\n return glyphStateAttributes;\n }\n\n if (isFunction(encoder)) {\n glyphStateAttributes.attributes = (encoder as StateProxyEncodeSpec)(this.getDatum(), this, stateName, nextStates);\n return glyphStateAttributes;\n }\n\n if (!isRuntimeState && this.graphicItem.glyphStates?.[stateName]) {\n return this.graphicItem.glyphStates[stateName];\n }\n\n if (encoder) {\n const item = this.items[0];\n const targetItems = [Object.assign({}, item, { nextAttrs: {} })];\n\n invokeEncoderToItems(this, targetItems, encoder, (this.mark as any).parameters());\n this.coordinateTransformEncode(targetItems);\n\n glyphStateAttributes.attributes = targetItems[0].nextAttrs;\n\n if (!this.graphicItem.glyphStates) {\n this.graphicItem.glyphStates = { [stateName]: glyphStateAttributes };\n } else if (!this.graphicItem.glyphStates[stateName]) {\n this.graphicItem.glyphStates[stateName] = glyphStateAttributes;\n }\n\n return glyphStateAttributes;\n }\n\n return glyphStateAttributes;\n };\n\n encodeGraphic() {\n this.coordinateTransformEncode(this.items);\n const graphicAttributes = this.transformElementItems(this.items, this.mark.markType);\n\n if (!this.graphicItem) {\n this.initGraphicItem();\n }\n\n if (this.diffState === DiffState.enter) {\n // apply default encoder when enter\n this.graphicItem.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(true);\n this.applyGraphicAttributes(graphicAttributes);\n this.graphicItem.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(false);\n } else {\n this.applyGraphicAttributes(graphicAttributes);\n }\n\n if ((this.diffState === DiffState.enter || this.diffState === DiffState.update) && this.states.length) {\n Object.values(this.glyphGraphicItems).forEach(graphicItem => {\n // 更新数据流后,states计算不缓存\n graphicItem.states = {};\n });\n this.useStates(this.states);\n }\n\n // clear item attributes\n this.items.map(item => {\n item.nextAttrs = {};\n });\n }\n\n encodeCustom(nextAttrs?: any): { [markName: string]: any } {\n let customEncodeValues: { [markName: string]: any } = {};\n const channelEncoder = this.glyphMeta.getChannelEncoder();\n const functionEncoder = this.glyphMeta.getFunctionEncoder();\n\n if (functionEncoder) {\n customEncodeValues = functionEncoder.call(\n null,\n Object.assign({}, this.graphicItem?.attribute, nextAttrs),\n this.getDatum(),\n this,\n this.mark.getGlyphConfig()\n );\n }\n if (channelEncoder) {\n // TODO: maybe delete origin encode value?\n let allAttrs: any;\n Object.keys(channelEncoder).forEach(channel => {\n if (!isNil(nextAttrs[channel])) {\n if (!allAttrs) {\n allAttrs = Object.assign({}, this.graphicItem?.attribute, nextAttrs);\n }\n const encodeResult = channelEncoder[channel].call(\n null,\n channel,\n nextAttrs[channel],\n allAttrs,\n this.getDatum(),\n this,\n this.mark.getGlyphConfig()\n );\n Object.keys(encodeResult ?? {}).forEach(markName => {\n customEncodeValues[markName] = Object.assign(customEncodeValues[markName] ?? {}, encodeResult[markName]);\n });\n }\n });\n }\n return customEncodeValues;\n }\n\n private encodeDefault() {\n const defaultEncodeValues: { [markName: string]: any } = {};\n // apply default encode\n if (this.diffState === DiffState.enter && this.glyphMeta.getDefaultEncoder()) {\n const defaultEncodeResult = this.glyphMeta\n .getDefaultEncoder()\n .call(null, this.getDatum(), this, this.mark.getGlyphConfig());\n Object.assign(defaultEncodeValues, defaultEncodeResult);\n }\n return defaultEncodeValues;\n }\n\n private _onGlyphAttributeUpdate(first: boolean = false) {\n return (attributes: any) => {\n // mark might be released\n if (!this.mark) {\n return attributes;\n }\n const glyphMarks = this.glyphMeta.getMarks();\n\n const graphicAttributes = transformAttributes(this.mark.getAttributeTransforms(), attributes, this);\n\n // apply default encode\n const defaultEncodeValues = first ? this.encodeDefault() : null;\n // apply custom encode\n const customEncodeValues = this.encodeCustom(attributes);\n\n Object.keys(glyphMarks).forEach(markName => {\n const markType = glyphMarks[markName];\n const graphicItem = this.glyphGraphicItems[markName];\n const customAttributes = customEncodeValues?.[markName];\n const additionalAttributes = Object.assign({}, customAttributes);\n if (first) {\n // apply default attributes when visual channel is not set\n const defaultAttributes = defaultEncodeValues?.[markName];\n Object.keys(defaultAttributes ?? {}).forEach(key => {\n if (!has(this.items[0].nextAttrs, key) && !has(additionalAttributes, key)) {\n additionalAttributes[key] = defaultAttributes[key];\n }\n });\n }\n const glyphAttributes = Object.assign({}, cloneTransformAttributes(markType, attributes), additionalAttributes);\n const glyphItems = this._generateGlyphItems(markType, this.items, glyphAttributes);\n this.coordinateTransformEncode(glyphItems);\n const graphicAttributes = this.transformElementItems(glyphItems, markType);\n\n this.applyGlyphGraphicAttributes(graphicAttributes, markName, graphicItem);\n\n if (markType === GrammarMarkType.shape) {\n // FIXME: shape需要拿到原始数据进行编码,暂时把数据绑定到graphicItem上,看后续graphicItem是否需要支持数据绑定\n graphicItem.datum = glyphItems[0].datum;\n }\n });\n\n return graphicAttributes;\n };\n }\n\n private _generateGlyphItems(markType: MarkType, items: MarkElementItem[], additionalAttributes: any) {\n const glyphItems = items.map(item => Object.assign({}, item, { nextAttrs: additionalAttributes }));\n\n if ((CollectionMarkType as string[]).includes(markType) && this.mark.getSpec().enableSegments) {\n // segment mark require all items to apply additional attributes\n glyphItems.forEach((glyphItem, index) => {\n glyphItem.nextAttrs = Object.assign({}, items[index].nextAttrs, additionalAttributes);\n });\n }\n\n return glyphItems;\n }\n\n getGraphicAttribute(channel: string, prev: boolean = false, markName?: any) {\n if (!this.graphicItem) {\n return undefined;\n }\n const prevGraphicAttributes = this.getPrevGraphicAttributes(markName);\n if (prev && has(prevGraphicAttributes, channel)) {\n return prevGraphicAttributes[channel];\n }\n\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n return graphicItem.attribute[channel];\n }\n\n setGraphicAttribute(channel: string, value: any, final: boolean = true, markName?: any) {\n if (!this.graphicItem) {\n return;\n }\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n const finalGraphicAttributes = this.getFinalGraphicAttributes(markName);\n const prevGraphicAttributes = this.getPrevGraphicAttributes(markName);\n\n if (final) {\n finalGraphicAttributes[channel] = value;\n }\n if (!has(prevGraphicAttributes, channel)) {\n prevGraphicAttributes[channel] = graphicItem.attribute[channel];\n }\n\n graphicItem.setAttribute(channel, value);\n }\n\n setGraphicAttributes(attributes: { [channel: string]: any }, final: boolean = true, markName?: any) {\n if (!this.graphicItem) {\n return;\n }\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n const finalGraphicAttributes = this.getFinalGraphicAttributes(markName);\n const prevGraphicAttributes = this.getPrevGraphicAttributes(markName);\n\n Object.keys(attributes).forEach(key => {\n if (final) {\n finalGraphicAttributes[key] = attributes[key];\n }\n if (!has(prevGraphicAttributes, key)) {\n prevGraphicAttributes[key] = graphicItem.attribute[key];\n }\n });\n\n graphicItem.setAttributes(attributes);\n }\n\n protected diffAttributes(graphicAttributes: { [channel: string]: any }, markName?: string) {\n const diffResult = {};\n const finalGraphicAttributes = this.getFinalGraphicAttributes(markName);\n for (const key in graphicAttributes) {\n if (!isEqual(key, finalGraphicAttributes, graphicAttributes)) {\n diffResult[key] = graphicAttributes[key];\n }\n }\n return diffResult;\n }\n\n protected applyGlyphGraphicAttributes(graphicAttributes: any, markName: string, graphicItem: any): void {\n if (this.mark.needAnimate()) {\n // If mark need animate, diff attributes.\n const nextGraphicAttributes = this.diffAttributes(graphicAttributes, markName);\n const prevGraphicAttributes = this.getPrevGraphicAttributes(markName);\n const finalGraphicAttributes = this.getFinalGraphicAttributes(markName);\n Object.keys(nextGraphicAttributes).forEach(channel => {\n prevGraphicAttributes[channel] = graphicItem.attribute[channel];\n finalGraphicAttributes[channel] = nextGraphicAttributes[channel];\n });\n this.setNextGraphicAttributes(nextGraphicAttributes, markName);\n this.setPrevGraphicAttributes(prevGraphicAttributes, markName);\n this.setFinalGraphicAttributes(finalGraphicAttributes, markName);\n\n // Apply next attributes to current graphic item immediately.\n // Scene graph tree should be handled like no animation exists in dataflow procedure.\n graphicItem.setAttributes(nextGraphicAttributes);\n } else {\n graphicItem.setAttributes(graphicAttributes);\n }\n }\n\n getFinalGraphicAttributes(markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n return graphicItem.finalAttrs;\n }\n\n protected setFinalGraphicAttributes(attributes: { [channel: string]: any }, markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n graphicItem.finalAttrs = attributes;\n }\n\n getPrevGraphicAttributes(markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n return graphicItem.prevAttrs;\n }\n\n protected setPrevGraphicAttributes(attributes: { [channel: string]: any }, markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n graphicItem.prevAttrs = attributes;\n }\n\n getNextGraphicAttributes(markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n return graphicItem.nextAttrs;\n }\n\n protected setNextGraphicAttributes(attributes: { [channel: string]: any }, markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n graphicItem.nextAttrs = attributes;\n }\n\n clearChangedGraphicAttributes() {\n this.setPrevGraphicAttributes({});\n this.setNextGraphicAttributes({});\n Object.keys(this.glyphGraphicItems).forEach(markName => {\n this.setPrevGraphicAttributes({}, markName);\n this.setNextGraphicAttributes({}, markName);\n });\n }\n\n clearGraphicAttributes() {\n this.setPrevGraphicAttributes({});\n this.setNextGraphicAttributes({});\n this.setFinalGraphicAttributes({});\n Object.keys(this.glyphGraphicItems).forEach(markName => {\n this.setPrevGraphicAttributes({}, markName);\n this.setNextGraphicAttributes({}, markName);\n this.setFinalGraphicAttributes({}, markName);\n });\n }\n\n remove() {\n this.glyphGraphicItems = null;\n super.remove();\n }\n\n release() {\n if (this.glyphGraphicItems) {\n Object.values(this.glyphGraphicItems).forEach(graphicItem => {\n graphicItem[BridgeElementKey] = null;\n });\n this.glyphGraphicItems = null;\n }\n super.release();\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/graph/glyph-element.ts"],"names":[],"mappings":";;;AAAA,6CAAqE;AACrE,2DAAkD;AAUlD,sDAAuF;AACvF,2CAAmE;AACnE,mCAAiE;AACjE,uCAAoC;AACpC,0CAAqD;AAGrD,MAAa,YAAa,SAAQ,iBAAO;IAQvC,YAAY,IAAgB;QAC1B,KAAK,CAAC,IAAI,CAAC,CAAC;QAqDJ,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,OAAO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,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YAC9C,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACL,CAAC;IAED,sBAAsB;QACpB,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC;QACrC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACrD,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YAC9C,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YAC9C,IAAI,CAAC,yBAAyB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,KAAK,CAAC,MAAM,EAAE,CAAC;IACjB,CAAC;IAED,OAAO;QACL,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;gBAC1D,WAAW,CAAC,4BAAgB,CAAC,GAAG,IAAI,CAAC;YACvC,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;SAC/B;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;CACF;AA7YD,oCA6YC","file":"glyph-element.js","sourcesContent":["import { has, isNil, isBoolean, isFunction } from '@visactor/vutils';\nimport { isEqual } from '@visactor/vgrammar-util';\nimport type {\n IGlyphElement,\n IGlyphMark,\n MarkElementItem,\n MarkSpec,\n IGlyphMeta,\n MarkType,\n StateProxyEncodeSpec\n} from '../types';\nimport { cloneTransformAttributes, transformAttributes } from './attributes/transform';\nimport { BridgeElementKey, CollectionMarkType } from './constants';\nimport { DiffState, HOOK_EVENT, GrammarMarkType } from './enums';\nimport { Element } from './element';\nimport { invokeEncoderToItems } from './mark/encode';\nimport type { IGraphicAttribute, IGlyph } from '@visactor/vrender-core';\n\nexport class GlyphElement extends Element implements IGlyphElement {\n declare graphicItem: IGlyph;\n\n declare mark: IGlyphMark;\n protected glyphGraphicItems: { [markName: string]: any };\n\n private glyphMeta: IGlyphMeta;\n\n constructor(mark: IGlyphMark) {\n super(mark);\n this.glyphMeta = this.mark.getGlyphMeta();\n }\n\n getGlyphGraphicItems() {\n return this.glyphGraphicItems;\n }\n\n initGraphicItem(attributes: any = {}) {\n if (this.graphicItem) {\n return;\n }\n\n this.graphicItem = this.mark.addGraphicItem(attributes, this.groupKey) as IGlyph;\n this.graphicItem[BridgeElementKey] = this;\n this.graphicItem.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(false);\n\n const glyphMarks = this.glyphMeta.getMarks();\n this.glyphGraphicItems = {};\n this.graphicItem.getSubGraphic().forEach((graphic: any) => {\n const markType = glyphMarks[graphic.name];\n this.glyphGraphicItems[graphic.name] = graphic;\n graphic.onBeforeAttributeUpdate = (attributes: any) => {\n // mark might be released\n if (!this.mark) {\n return attributes;\n }\n const graphicAttributes = transformAttributes(markType, attributes, this, graphic.name);\n return graphicAttributes;\n };\n });\n\n this.clearGraphicAttributes();\n }\n\n useStates(states: string[], hasAnimation?: boolean) {\n if (!this.graphicItem) {\n return;\n }\n this.mark.emit(HOOK_EVENT.BEFORE_ELEMENT_STATE, { states }, this);\n\n this.states = states.slice();\n\n const stateAnimationEnable = isBoolean(hasAnimation)\n ? hasAnimation\n : this.mark.animate.getAnimationConfigs('state').length !== 0;\n\n this.graphicItem.glyphStateProxy = this.getStateAttrs;\n this.graphicItem.useStates(this.states, stateAnimationEnable);\n\n this.mark.emit(HOOK_EVENT.AFTER_ELEMENT_STATE, { states }, this);\n }\n\n protected getStateAttrs = (stateName: string, nextStates: string[]) => {\n const isRuntimeState = !isNil(this.runtimeStatesEncoder?.[stateName]);\n const encoder = isRuntimeState\n ? this.runtimeStatesEncoder[stateName]\n : (this.mark.getSpec() as MarkSpec).encode?.[stateName];\n\n const glyphStateAttributes = {} as {\n attributes: Partial<IGraphicAttribute>;\n subAttributes: Partial<IGraphicAttribute>[];\n };\n\n if (!encoder) {\n return glyphStateAttributes;\n }\n\n if (isFunction(encoder)) {\n glyphStateAttributes.attributes = (encoder as StateProxyEncodeSpec)(this.getDatum(), this, stateName, nextStates);\n return glyphStateAttributes;\n }\n\n if (!isRuntimeState && this.graphicItem.glyphStates?.[stateName]) {\n return this.graphicItem.glyphStates[stateName];\n }\n\n if (encoder) {\n const item = this.items[0];\n const targetItems = [Object.assign({}, item, { nextAttrs: {} })];\n\n invokeEncoderToItems(this, targetItems, encoder, (this.mark as any).parameters());\n this.coordinateTransformEncode(targetItems);\n\n glyphStateAttributes.attributes = targetItems[0].nextAttrs;\n\n if (!this.graphicItem.glyphStates) {\n this.graphicItem.glyphStates = { [stateName]: glyphStateAttributes };\n } else if (!this.graphicItem.glyphStates[stateName]) {\n this.graphicItem.glyphStates[stateName] = glyphStateAttributes;\n }\n\n return glyphStateAttributes;\n }\n\n return glyphStateAttributes;\n };\n\n encodeGraphic() {\n this.coordinateTransformEncode(this.items);\n const graphicAttributes = this.transformElementItems(this.items, this.mark.markType);\n\n if (!this.graphicItem) {\n this.initGraphicItem();\n }\n\n if (this.diffState === DiffState.enter) {\n // apply default encoder when enter\n this.graphicItem.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(true);\n this.applyGraphicAttributes(graphicAttributes);\n this.graphicItem.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(false);\n } else {\n this.applyGraphicAttributes(graphicAttributes);\n }\n\n if ((this.diffState === DiffState.enter || this.diffState === DiffState.update) && this.states.length) {\n Object.values(this.glyphGraphicItems).forEach(graphicItem => {\n // 更新数据流后,states计算不缓存\n graphicItem.states = {};\n });\n this.useStates(this.states);\n }\n\n // clear item attributes\n this.items.map(item => {\n item.nextAttrs = {};\n });\n }\n\n encodeCustom(nextAttrs?: any): { [markName: string]: any } {\n let customEncodeValues: { [markName: string]: any } = {};\n const channelEncoder = this.glyphMeta.getChannelEncoder();\n const functionEncoder = this.glyphMeta.getFunctionEncoder();\n\n if (functionEncoder) {\n customEncodeValues = functionEncoder.call(\n null,\n Object.assign({}, this.graphicItem?.attribute, nextAttrs),\n this.getDatum(),\n this,\n this.mark.getGlyphConfig()\n );\n }\n if (channelEncoder) {\n // TODO: maybe delete origin encode value?\n let allAttrs: any;\n Object.keys(channelEncoder).forEach(channel => {\n if (!isNil(nextAttrs[channel])) {\n if (!allAttrs) {\n allAttrs = Object.assign({}, this.graphicItem?.attribute, nextAttrs);\n }\n const encodeResult = channelEncoder[channel].call(\n null,\n channel,\n nextAttrs[channel],\n allAttrs,\n this.getDatum(),\n this,\n this.mark.getGlyphConfig()\n );\n Object.keys(encodeResult ?? {}).forEach(markName => {\n customEncodeValues[markName] = Object.assign(customEncodeValues[markName] ?? {}, encodeResult[markName]);\n });\n }\n });\n }\n return customEncodeValues;\n }\n\n private encodeDefault() {\n const defaultEncodeValues: { [markName: string]: any } = {};\n // apply default encode\n if (this.diffState === DiffState.enter && this.glyphMeta.getDefaultEncoder()) {\n const defaultEncodeResult = this.glyphMeta\n .getDefaultEncoder()\n .call(null, this.getDatum(), this, this.mark.getGlyphConfig());\n Object.assign(defaultEncodeValues, defaultEncodeResult);\n }\n return defaultEncodeValues;\n }\n\n private _onGlyphAttributeUpdate(first: boolean = false) {\n return (attributes: any) => {\n // mark might be released\n if (!this.mark) {\n return attributes;\n }\n const glyphMarks = this.glyphMeta.getMarks();\n\n const graphicAttributes = transformAttributes(this.mark.getAttributeTransforms(), attributes, this);\n\n // apply default encode\n const defaultEncodeValues = first ? this.encodeDefault() : null;\n // apply custom encode\n const customEncodeValues = this.encodeCustom(attributes);\n\n Object.keys(glyphMarks).forEach(markName => {\n const markType = glyphMarks[markName];\n const graphicItem = this.glyphGraphicItems[markName];\n const customAttributes = customEncodeValues?.[markName];\n const additionalAttributes = Object.assign({}, customAttributes);\n if (first) {\n // apply default attributes when visual channel is not set\n const defaultAttributes = defaultEncodeValues?.[markName];\n Object.keys(defaultAttributes ?? {}).forEach(key => {\n if (!has(this.items[0].nextAttrs, key) && !has(additionalAttributes, key)) {\n additionalAttributes[key] = defaultAttributes[key];\n }\n });\n }\n const glyphAttributes = Object.assign({}, cloneTransformAttributes(markType, attributes), additionalAttributes);\n const glyphItems = this._generateGlyphItems(markType, this.items, glyphAttributes);\n this.coordinateTransformEncode(glyphItems);\n const graphicAttributes = this.transformElementItems(glyphItems, markType);\n\n this.applyGlyphGraphicAttributes(graphicAttributes, markName, graphicItem);\n\n if (markType === GrammarMarkType.shape) {\n // FIXME: shape需要拿到原始数据进行编码,暂时把数据绑定到graphicItem上,看后续graphicItem是否需要支持数据绑定\n graphicItem.datum = glyphItems[0].datum;\n }\n });\n\n return graphicAttributes;\n };\n }\n\n private _generateGlyphItems(markType: MarkType, items: MarkElementItem[], additionalAttributes: any) {\n const glyphItems = items.map(item => Object.assign({}, item, { nextAttrs: additionalAttributes }));\n\n if ((CollectionMarkType as string[]).includes(markType) && this.mark.getSpec().enableSegments) {\n // segment mark require all items to apply additional attributes\n glyphItems.forEach((glyphItem, index) => {\n glyphItem.nextAttrs = Object.assign({}, items[index].nextAttrs, additionalAttributes);\n });\n }\n\n return glyphItems;\n }\n\n getGraphicAttribute(channel: string, prev: boolean = false, markName?: any) {\n if (!this.graphicItem) {\n return undefined;\n }\n const prevGraphicAttributes = this.getPrevGraphicAttributes(markName);\n if (prev && has(prevGraphicAttributes, channel)) {\n return prevGraphicAttributes[channel];\n }\n\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n return graphicItem.attribute[channel];\n }\n\n setGraphicAttribute(channel: string, value: any, final: boolean = true, markName?: any) {\n if (!this.graphicItem) {\n return;\n }\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n const finalGraphicAttributes = this.getFinalGraphicAttributes(markName);\n const prevGraphicAttributes = this.getPrevGraphicAttributes(markName);\n\n if (final) {\n finalGraphicAttributes[channel] = value;\n }\n if (!has(prevGraphicAttributes, channel)) {\n prevGraphicAttributes[channel] = graphicItem.attribute[channel];\n }\n\n graphicItem.setAttribute(channel, value);\n }\n\n setGraphicAttributes(attributes: { [channel: string]: any }, final: boolean = true, markName?: any) {\n if (!this.graphicItem) {\n return;\n }\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n const finalGraphicAttributes = this.getFinalGraphicAttributes(markName);\n const prevGraphicAttributes = this.getPrevGraphicAttributes(markName);\n\n Object.keys(attributes).forEach(key => {\n if (final) {\n finalGraphicAttributes[key] = attributes[key];\n }\n if (!has(prevGraphicAttributes, key)) {\n prevGraphicAttributes[key] = graphicItem.attribute[key];\n }\n });\n\n graphicItem.setAttributes(attributes);\n }\n\n protected diffAttributes(graphicAttributes: { [channel: string]: any }, markName?: string) {\n const diffResult = {};\n const finalGraphicAttributes = this.getFinalGraphicAttributes(markName);\n for (const key in graphicAttributes) {\n if (!isEqual(key, finalGraphicAttributes, graphicAttributes)) {\n diffResult[key] = graphicAttributes[key];\n }\n }\n return diffResult;\n }\n\n protected applyGlyphGraphicAttributes(graphicAttributes: any, markName: string, graphicItem: any): void {\n if (this.mark.needAnimate()) {\n // If mark need animate, diff attributes.\n const nextGraphicAttributes = this.diffAttributes(graphicAttributes, markName);\n const prevGraphicAttributes = this.getPrevGraphicAttributes(markName) ?? {};\n const finalGraphicAttributes = this.getFinalGraphicAttributes(markName) ?? {};\n Object.keys(nextGraphicAttributes).forEach(channel => {\n prevGraphicAttributes[channel] = graphicItem.attribute[channel];\n finalGraphicAttributes[channel] = nextGraphicAttributes[channel];\n });\n this.setNextGraphicAttributes(nextGraphicAttributes, markName);\n this.setPrevGraphicAttributes(prevGraphicAttributes, markName);\n this.setFinalGraphicAttributes(finalGraphicAttributes, markName);\n\n // Apply next attributes to current graphic item immediately.\n // Scene graph tree should be handled like no animation exists in dataflow procedure.\n graphicItem.setAttributes(nextGraphicAttributes);\n } else {\n graphicItem.setAttributes(graphicAttributes);\n }\n }\n\n getFinalGraphicAttributes(markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n return graphicItem.finalAttrs;\n }\n\n protected setFinalGraphicAttributes(attributes: { [channel: string]: any }, markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n graphicItem.finalAttrs = attributes;\n }\n\n getPrevGraphicAttributes(markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n return graphicItem.prevAttrs;\n }\n\n protected setPrevGraphicAttributes(attributes: { [channel: string]: any }, markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n graphicItem.prevAttrs = attributes;\n }\n\n getNextGraphicAttributes(markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n return graphicItem.nextAttrs;\n }\n\n protected setNextGraphicAttributes(attributes: { [channel: string]: any }, markName?: string) {\n const graphicItem = markName ? this.glyphGraphicItems[markName] : this.graphicItem;\n graphicItem.nextAttrs = attributes;\n }\n\n clearChangedGraphicAttributes() {\n this.setPrevGraphicAttributes(null);\n this.setNextGraphicAttributes(null);\n Object.keys(this.glyphGraphicItems).forEach(markName => {\n this.setPrevGraphicAttributes(null, markName);\n this.setNextGraphicAttributes(null, markName);\n });\n }\n\n clearGraphicAttributes() {\n this.setPrevGraphicAttributes(null);\n this.setNextGraphicAttributes(null);\n this.setFinalGraphicAttributes(null);\n Object.keys(this.glyphGraphicItems).forEach(markName => {\n this.setPrevGraphicAttributes(null, markName);\n this.setNextGraphicAttributes(null, markName);\n this.setFinalGraphicAttributes(null, 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"]}
package/cjs/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.10.0-alpha.6";
1
+ export declare const version = "0.10.0-alpha.8";
2
2
  export * from './graph';
3
3
  export * from './interactions';
4
4
  export { View } from './view';
package/cjs/index.js CHANGED
@@ -18,7 +18,7 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
20
  }), exports.vglobal = exports.ThemeManager = exports.SIGNAL_VIEW_BOX = exports.SIGNAL_WIDTH = exports.SIGNAL_VIEW_WIDTH = exports.SIGNAL_VIEW_HEIGHT = exports.SIGNAL_PADDING = exports.SIGNAL_HEIGHT = exports.SIGNAL_AUTOFIT = exports.Factory = exports.GrammarBase = exports.invokeFunctionType = exports.parseFunctionType = exports.registerCoordinate = exports.Coordinate = exports.registerScale = exports.Scale = exports.View = exports.version = void 0,
21
- exports.version = "0.10.0-alpha.6", __exportStar(require("./graph"), exports), __exportStar(require("./interactions"), exports);
21
+ exports.version = "0.10.0-alpha.8", __exportStar(require("./graph"), exports), __exportStar(require("./interactions"), exports);
22
22
 
23
23
  var view_1 = require("./view");
24
24
 
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,0CAAwB;AAExB,iDAA+B;AAE/B,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,sCAAoD;AAA3C,8FAAA,KAAK,OAAA;AAAE,sGAAA,aAAa,OAAA;AAC7B,gDAAmE;AAA1D,wGAAA,UAAU,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AACvC,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;AACtB,iDAA+B;AAC/B,wDAAsC;AACtC,4DAA0C;AAC1C,uDAAqC","file":"index.js","sourcesContent":["// -- Exports -----\nexport const version = \"0.10.0-alpha.6\";\n\nexport * from './graph';\n\nexport * from './interactions';\n\nexport { View } from './view';\nexport { Scale, registerScale } from './view/scale';\nexport { Coordinate, registerCoordinate } from './view/coordinate';\nexport { parseFunctionType, invokeFunctionType } from './parse/util';\nexport { GrammarBase } from './view/grammar-base';\nexport * from './util/text';\nexport * from './types';\nexport { Factory } from './core/factory';\nexport {\n SIGNAL_AUTOFIT,\n SIGNAL_HEIGHT,\n SIGNAL_PADDING,\n SIGNAL_VIEW_HEIGHT,\n SIGNAL_VIEW_WIDTH,\n SIGNAL_WIDTH,\n SIGNAL_VIEW_BOX\n} from './view/constants';\n\nexport { ThemeManager } from './theme/theme-manager';\n\nexport * from './glyph';\nexport * from './component';\nexport * from './transforms';\nexport * from './graph/animation/animation';\n\nexport { vglobal } from '@visactor/vrender-core';\nexport * from './env';\nexport * from './interactions';\nexport * from './semantic-marks/cell';\nexport * from './semantic-marks/interval';\nexport * from './graph/mark/graphic';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,0CAAwB;AAExB,iDAA+B;AAE/B,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,sCAAoD;AAA3C,8FAAA,KAAK,OAAA;AAAE,sGAAA,aAAa,OAAA;AAC7B,gDAAmE;AAA1D,wGAAA,UAAU,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AACvC,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;AACtB,iDAA+B;AAC/B,wDAAsC;AACtC,4DAA0C;AAC1C,uDAAqC","file":"index.js","sourcesContent":["// -- Exports -----\nexport const version = \"0.10.0-alpha.8\";\n\nexport * from './graph';\n\nexport * from './interactions';\n\nexport { View } from './view';\nexport { Scale, registerScale } from './view/scale';\nexport { Coordinate, registerCoordinate } from './view/coordinate';\nexport { parseFunctionType, invokeFunctionType } from './parse/util';\nexport { GrammarBase } from './view/grammar-base';\nexport * from './util/text';\nexport * from './types';\nexport { Factory } from './core/factory';\nexport {\n SIGNAL_AUTOFIT,\n SIGNAL_HEIGHT,\n SIGNAL_PADDING,\n SIGNAL_VIEW_HEIGHT,\n SIGNAL_VIEW_WIDTH,\n SIGNAL_WIDTH,\n SIGNAL_VIEW_BOX\n} from './view/constants';\n\nexport { ThemeManager } from './theme/theme-manager';\n\nexport * from './glyph';\nexport * from './component';\nexport * from './transforms';\nexport * from './graph/animation/animation';\n\nexport { vglobal } from '@visactor/vrender-core';\nexport * from './env';\nexport * from './interactions';\nexport * from './semantic-marks/cell';\nexport * from './semantic-marks/interval';\nexport * from './graph/mark/graphic';\n"]}
@@ -31,4 +31,5 @@ class BrushFilter extends brush_base_1.BrushBase {
31
31
  }
32
32
  }
33
33
 
34
- exports.BrushFilter = BrushFilter, BrushFilter.type = "brush-filter", BrushFilter.defaultOptions = {};
34
+ exports.BrushFilter = BrushFilter, BrushFilter.type = "brush-filter", BrushFilter.defaultOptions = {};
35
+ //# sourceMappingURL=brush-filter.js.map
@@ -49,5 +49,4 @@ ElementHighlightByGroup.defaultOptions = {
49
49
  blurState: enums_1.InteractionStateEnum.blur,
50
50
  trigger: "pointerover",
51
51
  resetTrigger: "pointerout"
52
- };
53
- //# sourceMappingURL=element-highlight-by-group.js.map
52
+ };
@@ -383,4 +383,5 @@ const registerFishEye = () => {
383
383
  factory_1.Factory.registerInteraction(fish_eye_1.FishEye.type, fish_eye_1.FishEye);
384
384
  };
385
385
 
386
- exports.registerFishEye = registerFishEye;
386
+ exports.registerFishEye = registerFishEye;
387
+ //# sourceMappingURL=index.js.map
@@ -30,4 +30,4 @@ class LegendFilter extends filter_1.Filter {
30
30
  }
31
31
 
32
32
  exports.LegendFilter = LegendFilter, LegendFilter.type = "legend-filter", LegendFilter.defaultOptions = {};
33
- //# sourceMappingURL=legend-filter.js.map
33
+ //# sourceMappingURL=legend-filter.js.map
@@ -29,4 +29,4 @@ class PlayerFilter extends filter_1.Filter {
29
29
  }
30
30
 
31
31
  exports.PlayerFilter = PlayerFilter, PlayerFilter.type = "player-filter", PlayerFilter.defaultOptions = {};
32
- //# sourceMappingURL=player-filter.js.map
32
+ //# sourceMappingURL=player-filter.js.map
@@ -44,4 +44,4 @@ exports.RollUp = RollUp, RollUp.type = "roll-up", RollUp.defaultOptions = {
44
44
  trigger: "click",
45
45
  resetTrigger: "empty"
46
46
  };
47
- //# sourceMappingURL=roll-up.js.map
47
+ //# sourceMappingURL=roll-up.js.map
@@ -51,4 +51,4 @@ class ScrollbarFilter extends filter_1.Filter {
51
51
 
52
52
  exports.ScrollbarFilter = ScrollbarFilter, ScrollbarFilter.type = "scrollbar-filter",
53
53
  ScrollbarFilter.defaultOptions = {};
54
- //# sourceMappingURL=scrollbar-filter.js.map
54
+ //# sourceMappingURL=scrollbar-filter.js.map
@@ -29,4 +29,4 @@ class SliderFilter extends filter_1.Filter {
29
29
  }
30
30
 
31
31
  exports.SliderFilter = SliderFilter, SliderFilter.type = "slider-filter", SliderFilter.defaultOptions = {};
32
- //# sourceMappingURL=slider-filter.js.map
32
+ //# sourceMappingURL=slider-filter.js.map
@@ -59,4 +59,4 @@ exports.Tooltip = Tooltip, Tooltip.type = "tooltip", Tooltip.defaultOptions = {
59
59
  trigger: "pointermove",
60
60
  resetTrigger: "pointerleave"
61
61
  };
62
- //# sourceMappingURL=tooltip.js.map
62
+ //# sourceMappingURL=tooltip.js.map
@@ -49,4 +49,4 @@ class ViewDragMixin {
49
49
  }
50
50
 
51
51
  exports.ViewDragMixin = ViewDragMixin;
52
- //# sourceMappingURL=view-drag-mixin.js.map
52
+ //# sourceMappingURL=view-drag-mixin.js.map
@@ -67,4 +67,4 @@ function configureCoordinate(spec, coordinate, parameters) {
67
67
 
68
68
  exports.createCoordinate = createCoordinate, exports.parseCoordinate = parseCoordinate,
69
69
  exports.configureCoordinate = configureCoordinate;
70
- //# sourceMappingURL=coordinate.js.map
70
+ //# sourceMappingURL=coordinate.js.map
@@ -34,4 +34,4 @@ const parseEventSelector = (selector, source = constants_1.EVENT_SOURCE_VIEW) =>
34
34
  };
35
35
 
36
36
  exports.parseEventSelector = parseEventSelector;
37
- //# sourceMappingURL=event.js.map
37
+ //# sourceMappingURL=event.js.map
package/cjs/parse/mark.js CHANGED
@@ -22,4 +22,4 @@ function parseEncodeType(encoder, view) {
22
22
  }
23
23
 
24
24
  exports.isScaleEncode = isScaleEncode, exports.isFieldEncode = isFieldEncode, exports.parseEncodeType = parseEncodeType;
25
- //# sourceMappingURL=mark.js.map
25
+ //# sourceMappingURL=mark.js.map
@@ -17,4 +17,4 @@ const parseOptions = (options, params) => options ? (0, vutils_1.isObject)(optio
17
17
  }), {}) : options.map((option => (0, exports.parseOptionValue)(option, params))) : options;
18
18
 
19
19
  exports.parseOptions = parseOptions;
20
- //# sourceMappingURL=option.js.map
20
+ //# sourceMappingURL=option.js.map
@@ -361,5 +361,4 @@ function configureScale(spec, scale, parameters) {
361
361
  }
362
362
 
363
363
  exports.createScale = createScale, exports.parseScaleDomainRange = parseScaleDomainRange,
364
- exports.parseScaleConfig = parseScaleConfig, exports.configureScale = configureScale;
365
- //# sourceMappingURL=scale.js.map
364
+ exports.parseScaleConfig = parseScaleConfig, exports.configureScale = configureScale;
@@ -100,4 +100,4 @@ const vutils_1 = require("@visactor/vutils"), factory_1 = require("../core/facto
100
100
  };
101
101
 
102
102
  exports.parseTransformSpec = parseTransformSpec;
103
- //# sourceMappingURL=transform.js.map
103
+ //# sourceMappingURL=transform.js.map
package/cjs/parse/util.js CHANGED
@@ -79,4 +79,4 @@ exports.parseField = parseField;
79
79
  const parseColor = color => (0, vutils_1.isString)(color) && vutils_1.Color.parseColorString(color) ? color : null;
80
80
 
81
81
  exports.parseColor = parseColor;
82
- //# sourceMappingURL=util.js.map
82
+ //# sourceMappingURL=util.js.map
package/cjs/parse/view.js CHANGED
@@ -105,4 +105,4 @@ const normalizeRunningConfig = runningConfig => {
105
105
  };
106
106
 
107
107
  exports.normalizeRunningConfig = normalizeRunningConfig;
108
- //# sourceMappingURL=view.js.map
108
+ //# sourceMappingURL=view.js.map
@@ -46,7 +46,7 @@ export class Element {
46
46
  this.graphicItem && (this.graphicItem[BridgeElementKey] = this, attrTransforms && (this.graphicItem.onBeforeAttributeUpdate = attributes => {
47
47
  if (!this.mark) return attributes;
48
48
  return transformAttributes(attrTransforms, attributes, this);
49
- }), this.clearGraphicAttributes(), this.mark.needAnimate() && (this.setPrevGraphicAttributes({}),
49
+ }), this.clearGraphicAttributes(), this.mark.needAnimate() && (this.setPrevGraphicAttributes(null),
50
50
  this.setNextGraphicAttributes(attributes), this.setFinalGraphicAttributes(attributes)));
51
51
  }
52
52
  updateGraphicItem(config) {
@@ -199,8 +199,9 @@ export class Element {
199
199
  return nextAttrs;
200
200
  }
201
201
  applyGraphicAttributes(graphicAttributes) {
202
+ var _a, _b;
202
203
  if (!isEmpty(graphicAttributes)) if (this.mark.needAnimate()) {
203
- const nextGraphicAttributes = this.diffAttributes(graphicAttributes), prevGraphicAttributes = this.getPrevGraphicAttributes(), finalGraphicAttributes = this.getFinalGraphicAttributes();
204
+ const nextGraphicAttributes = this.diffAttributes(graphicAttributes), prevGraphicAttributes = null !== (_a = this.getPrevGraphicAttributes()) && void 0 !== _a ? _a : {}, finalGraphicAttributes = null !== (_b = this.getFinalGraphicAttributes()) && void 0 !== _b ? _b : {};
204
205
  Object.keys(nextGraphicAttributes).forEach((channel => {
205
206
  prevGraphicAttributes[channel] = this.getGraphicAttribute(channel), finalGraphicAttributes[channel] = nextGraphicAttributes[channel];
206
207
  })), this.setNextGraphicAttributes(nextGraphicAttributes), this.setPrevGraphicAttributes(prevGraphicAttributes),