vue-echarts 8.2.0 → 8.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"graphic.js","names":[],"sources":["../src/graphic/props-common.ts","../src/graphic/props-shape.ts","../src/graphic/types.ts","../src/graphic/build.ts","../src/graphic/collector.ts","../src/graphic/context.ts","../src/graphic/identity.ts","../src/graphic/marker.ts","../src/graphic/order.ts","../src/graphic/mount.ts","../src/graphic/extension.ts","../src/graphic/component-factory.ts","../src/graphic/components.ts","../src/graphic/index.ts"],"sourcesContent":["import type { ExtractPublicPropTypes, PropType } from \"vue\";\nimport type {\n Color,\n CustomSeriesRenderItemReturn,\n GraphicComponentOption,\n PatternObject,\n TooltipComponentOption,\n} from \"echarts\";\nimport type { FontStyle, FontWeight } from \"../types\";\n\nexport type GraphicDuring = NonNullable<NonNullable<CustomSeriesRenderItemReturn>[\"during\"]>;\ntype GraphicExtra = Record<string, unknown> & {\n transition?: string | string[];\n};\n\nexport const TEXT_ATTACHMENT_PROP_KEYS = [\"textContent\", \"textConfig\"] as const;\n\nexport const COMMON_PROP_KEYS = [\n \"id\",\n \"name\",\n \"x\",\n \"y\",\n \"rotation\",\n \"scaleX\",\n \"scaleY\",\n \"skewX\",\n \"skewY\",\n \"originX\",\n \"originY\",\n \"anchorX\",\n \"anchorY\",\n \"left\",\n \"right\",\n \"top\",\n \"bottom\",\n \"bounding\",\n \"silent\",\n \"draggable\",\n \"ignore\",\n \"extra\",\n \"info\",\n \"tooltip\",\n \"clipPath\",\n ...TEXT_ATTACHMENT_PROP_KEYS,\n \"transition\",\n \"enterFrom\",\n \"leaveTo\",\n \"during\",\n \"enterAnimation\",\n \"updateAnimation\",\n \"leaveAnimation\",\n \"keyframeAnimation\",\n] as const;\n\nexport const GROUP_PROP_KEYS = [\"width\", \"height\"] as const;\n\nexport const DISPLAYABLE_PROP_KEYS = [\"z\", \"z2\", \"zlevel\", \"cursor\", \"invisible\"] as const;\n\nexport const PATH_PROP_KEYS = [\"autoBatch\"] as const;\n\nexport const TEXT_COMMON_STYLE_KEYS = [\n \"shadowBlur\",\n \"shadowOffsetX\",\n \"shadowOffsetY\",\n \"shadowColor\",\n \"opacity\",\n] as const;\n\nexport const COMMON_STYLE_KEYS = [...TEXT_COMMON_STYLE_KEYS, \"blend\"] as const;\n\nconst PAINT_STYLE_KEYS = [\n \"fill\",\n \"stroke\",\n \"strokeNoScale\",\n \"fillOpacity\",\n \"strokeOpacity\",\n \"lineWidth\",\n \"lineDash\",\n \"lineDashOffset\",\n] as const;\n\nexport const PATH_STYLE_KEYS = [\n ...PAINT_STYLE_KEYS,\n \"decal\",\n \"strokePercent\",\n \"lineCap\",\n \"lineJoin\",\n \"miterLimit\",\n \"strokeFirst\",\n] as const;\n\nexport const TEXT_STYLE_KEYS = [\n ...PAINT_STYLE_KEYS,\n \"text\",\n \"font\",\n \"textFont\",\n \"fontStyle\",\n \"fontWeight\",\n \"fontFamily\",\n \"fontSize\",\n \"align\",\n \"verticalAlign\",\n \"lineHeight\",\n \"tag\",\n \"backgroundColor\",\n \"padding\",\n \"margin\",\n \"borderColor\",\n \"borderWidth\",\n \"borderRadius\",\n \"borderDash\",\n \"borderDashOffset\",\n \"rich\",\n \"textStrokeWidth\",\n \"textAlign\",\n \"textVerticalAlign\",\n \"textLineHeight\",\n \"textShadowBlur\",\n \"textShadowOffsetX\",\n \"textShadowOffsetY\",\n \"textShadowColor\",\n \"width\",\n \"height\",\n \"overflow\",\n \"lineOverflow\",\n \"ellipsis\",\n \"placeholder\",\n \"truncateMinChar\",\n] as const;\n\nexport const IMAGE_STYLE_KEYS = [\n \"image\",\n \"x\",\n \"y\",\n \"width\",\n \"height\",\n \"sx\",\n \"sy\",\n \"sWidth\",\n \"sHeight\",\n] as const;\n\nexport const STYLE_KEYS_BY_TYPE = {\n text: TEXT_STYLE_KEYS,\n image: IMAGE_STYLE_KEYS,\n} as const;\n\nexport type GraphicCommonPropKey = (typeof COMMON_PROP_KEYS)[number];\nexport type GraphicGroupPropKey = (typeof GROUP_PROP_KEYS)[number];\nexport type GraphicDisplayablePropKey = (typeof DISPLAYABLE_PROP_KEYS)[number];\nexport type GraphicPathPropKey = (typeof PATH_PROP_KEYS)[number];\nexport type GraphicTextAttachmentPropKey = (typeof TEXT_ATTACHMENT_PROP_KEYS)[number];\nexport type GraphicTextCommonStyleKey = (typeof TEXT_COMMON_STYLE_KEYS)[number];\nexport type GraphicCommonStyleKey = (typeof COMMON_STYLE_KEYS)[number];\nexport type GraphicPathStyleKey = (typeof PATH_STYLE_KEYS)[number];\nexport type GraphicTextStyleKey = (typeof TEXT_STYLE_KEYS)[number];\nexport type GraphicImageStyleKey = (typeof IMAGE_STYLE_KEYS)[number];\n\n// Keep zrender defaults instead of letting Vue cast absent Boolean props to false.\nexport function withUndefinedDefault<T>(type: T) {\n return { type, default: undefined };\n}\n\ntype GraphicTextStyleOnlyKey = Exclude<\n GraphicTextStyleKey,\n GraphicPathStyleKey | \"width\" | \"height\"\n>;\ntype GraphicImageStyleOnlyKey = Exclude<GraphicImageStyleKey, \"x\" | \"y\" | \"width\" | \"height\">;\ntype GraphicImageSource = string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;\ntype GraphicTextAlign = \"left\" | \"center\" | \"right\";\ntype GraphicTextVerticalAlign = \"top\" | \"middle\" | \"bottom\";\ntype GraphicTextOverflow = \"break\" | \"breakAll\" | \"truncate\" | \"none\";\ntype GraphicOptionProp<K extends PropertyKey, T = GraphicComponentOption> = T extends {\n [P in K]?: infer V;\n}\n ? NonNullable<V>\n : never;\nexport type GraphicAnimationOption = GraphicOptionProp<\"enterAnimation\">;\nexport type GraphicKeyframeAnimationOption = GraphicOptionProp<\"keyframeAnimation\">;\n\nconst elementProps = {\n id: [String, Number] as PropType<string | number>,\n name: String,\n x: Number,\n y: Number,\n rotation: Number,\n scaleX: Number,\n scaleY: Number,\n skewX: Number,\n skewY: Number,\n originX: Number,\n originY: Number,\n anchorX: Number,\n anchorY: Number,\n left: [String, Number] as PropType<string | number>,\n right: [String, Number] as PropType<string | number>,\n top: [String, Number] as PropType<string | number>,\n bottom: [String, Number] as PropType<string | number>,\n bounding: String as PropType<\"raw\" | \"all\">,\n z: Number,\n z2: Number,\n zlevel: Number,\n silent: withUndefinedDefault(Boolean),\n draggable: withUndefinedDefault([Boolean, String] as PropType<\n boolean | \"horizontal\" | \"vertical\"\n >),\n cursor: String,\n ignore: withUndefinedDefault(Boolean),\n invisible: withUndefinedDefault(Boolean),\n extra: Object as PropType<GraphicExtra>,\n info: null as unknown as PropType<unknown>,\n tooltip: Object as PropType<TooltipComponentOption>,\n clipPath: withUndefinedDefault([Boolean, Object] as PropType<false | object>),\n textContent: Object as PropType<Record<string, unknown>>,\n textConfig: Object as PropType<object>,\n transition: [String, Array] as PropType<string | string[]>,\n enterFrom: Object as PropType<object>,\n leaveTo: Object as PropType<object>,\n during: Function as PropType<GraphicDuring>,\n enterAnimation: Object as PropType<GraphicAnimationOption>,\n updateAnimation: Object as PropType<GraphicAnimationOption>,\n leaveAnimation: Object as PropType<GraphicAnimationOption>,\n keyframeAnimation: [Object, Array] as PropType<GraphicKeyframeAnimationOption>,\n} as const satisfies Record<GraphicCommonPropKey | GraphicDisplayablePropKey, unknown>;\n\nconst groupProps = {\n width: Number,\n height: Number,\n} as const satisfies Record<GraphicGroupPropKey, unknown>;\n\nconst pathProps = {\n autoBatch: withUndefinedDefault(Boolean),\n} as const satisfies Record<GraphicPathPropKey, unknown>;\n\nconst commonStyleProps = {\n shadowBlur: Number,\n shadowOffsetX: Number,\n shadowOffsetY: Number,\n shadowColor: String,\n opacity: Number,\n blend: String,\n} as const satisfies Record<GraphicCommonStyleKey, unknown>;\n\nconst pathStyleProps = {\n fill: [String, Object] as PropType<Color>,\n stroke: [String, Object] as PropType<Color>,\n decal: Object as PropType<PatternObject>,\n strokePercent: Number,\n strokeNoScale: withUndefinedDefault(Boolean),\n fillOpacity: Number,\n strokeOpacity: Number,\n lineWidth: Number,\n lineDash: withUndefinedDefault([String, Array, Boolean] as PropType<\n \"solid\" | \"dashed\" | \"dotted\" | number[] | false\n >),\n lineDashOffset: Number,\n lineCap: String as PropType<CanvasLineCap>,\n lineJoin: String as PropType<CanvasLineJoin>,\n miterLimit: Number,\n strokeFirst: withUndefinedDefault(Boolean),\n} as const satisfies Record<GraphicPathStyleKey, unknown>;\n\nconst textStyleProps = {\n text: String,\n font: String,\n textFont: String,\n fontStyle: String as PropType<FontStyle>,\n fontWeight: [String, Number] as PropType<FontWeight>,\n fontFamily: String,\n fontSize: [String, Number] as PropType<string | number>,\n align: String as PropType<GraphicTextAlign>,\n verticalAlign: String as PropType<GraphicTextVerticalAlign>,\n lineHeight: Number,\n tag: String,\n backgroundColor: [String, Object] as PropType<string | { image: GraphicImageSource }>,\n padding: [Number, Array] as PropType<number | number[]>,\n margin: [Number, Array] as PropType<number | number[]>,\n borderColor: String,\n borderWidth: Number,\n borderRadius: [Number, Array] as PropType<number | number[]>,\n borderDash: withUndefinedDefault([Array, Boolean] as PropType<number[] | false>),\n borderDashOffset: Number,\n rich: Object as PropType<Record<string, object>>,\n textStrokeWidth: Number,\n textAlign: String as PropType<GraphicTextAlign>,\n textVerticalAlign: String as PropType<GraphicTextVerticalAlign>,\n textLineHeight: Number,\n textShadowBlur: Number,\n textShadowOffsetX: Number,\n textShadowOffsetY: Number,\n textShadowColor: String,\n overflow: String as PropType<GraphicTextOverflow>,\n lineOverflow: String as PropType<\"truncate\">,\n ellipsis: String,\n placeholder: String,\n truncateMinChar: Number,\n} as const satisfies Record<GraphicTextStyleOnlyKey, unknown>;\n\nconst imageStyleProps = {\n image: [String, Object] as PropType<GraphicImageSource>,\n sx: Number,\n sy: Number,\n sWidth: Number,\n sHeight: Number,\n} as const satisfies Record<GraphicImageStyleOnlyKey, unknown>;\n\nexport const commonProps = {\n ...elementProps,\n ...groupProps,\n ...pathProps,\n shape: Object as PropType<Record<string, unknown>>,\n style: Object as PropType<object>,\n shapeTransition: [String, Array] as PropType<string | string[]>,\n styleTransition: [String, Array] as PropType<string | string[]>,\n ...commonStyleProps,\n ...pathStyleProps,\n ...textStyleProps,\n ...imageStyleProps,\n} as const;\n\nexport const textPropOverrides = {\n width: [String, Number] as PropType<string | number>,\n fill: String,\n stroke: String,\n lineDash: withUndefinedDefault([Array, Boolean] as PropType<number[] | false>),\n} as const;\n\nexport type GraphicCommonProps = Omit<ExtractPublicPropTypes<typeof commonProps>, \"width\"> &\n Pick<ExtractPublicPropTypes<typeof textPropOverrides>, \"width\">;\n","import type { ExtractPublicPropTypes, PropType } from \"vue\";\n\nimport type { GraphicComponentType } from \"./marker\";\nimport { withUndefinedDefault } from \"./props-common\";\n\nexport const SHAPE_KEYS_BY_TYPE = {\n rect: [\"x\", \"y\", \"width\", \"height\", \"r\"],\n circle: [\"cx\", \"cy\", \"r\"],\n ellipse: [\"cx\", \"cy\", \"rx\", \"ry\"],\n sector: [\"cx\", \"cy\", \"r\", \"r0\", \"startAngle\", \"endAngle\", \"clockwise\", \"cornerRadius\"],\n ring: [\"cx\", \"cy\", \"r\", \"r0\"],\n arc: [\"cx\", \"cy\", \"r\", \"startAngle\", \"endAngle\", \"clockwise\"],\n line: [\"x1\", \"y1\", \"x2\", \"y2\", \"percent\"],\n polyline: [\"points\", \"percent\", \"smooth\", \"smoothConstraint\"],\n polygon: [\"points\", \"smooth\", \"smoothConstraint\"],\n bezierCurve: [\"x1\", \"y1\", \"x2\", \"y2\", \"cpx1\", \"cpy1\", \"cpx2\", \"cpy2\", \"percent\"],\n} as const satisfies Partial<Record<GraphicComponentType, readonly string[]>>;\n\nexport const shapeProps = {\n x: Number,\n y: Number,\n cx: Number,\n cy: Number,\n rx: Number,\n ry: Number,\n r: [Number, Array] as PropType<number | number[]>,\n r0: Number,\n x1: Number,\n y1: Number,\n x2: Number,\n y2: Number,\n cpx1: Number,\n cpy1: Number,\n cpx2: Number,\n cpy2: Number,\n startAngle: Number,\n endAngle: Number,\n percent: Number,\n points: Array as PropType<number[][]>,\n smooth: Number,\n smoothConstraint: Array as PropType<number[][]>,\n clockwise: withUndefinedDefault(Boolean),\n cornerRadius: [Number, Array] as PropType<number | number[]>,\n} as const;\n\nexport type GraphicShapeProps = ExtractPublicPropTypes<typeof shapeProps>;\n","import type { ElementEvent } from \"echarts/core\";\nimport type { ElementEventAlias, WithOnce } from \"../types\";\n\nexport type GraphicEventName = Exclude<ElementEvent[\"type\"], \"globalout\">;\n\nexport const GRAPHIC_EVENTS = {\n click: true,\n dblclick: true,\n mousewheel: true,\n mouseout: true,\n mouseover: true,\n mouseup: true,\n mousedown: true,\n mousemove: true,\n contextmenu: true,\n drag: true,\n dragstart: true,\n dragend: true,\n dragenter: true,\n dragleave: true,\n dragover: true,\n drop: true,\n} as const satisfies Record<GraphicEventName, true>;\n\nexport type GraphicOnEventName = `on${GraphicEventName}`;\n\ntype GraphicEventAlias = Exclude<ElementEventAlias, \"globalOut\">;\n\nexport type GraphicEmits = WithOnce<{\n [key in GraphicEventName | GraphicEventAlias]: (params: ElementEvent) => boolean | void;\n}>;\n","import type { Option } from \"../types\";\nimport { createEventInvoker, hasEventHandler, parseOnEvent } from \"../utils\";\nimport type { EventHandler } from \"../utils\";\nimport {\n COMMON_PROP_KEYS,\n COMMON_STYLE_KEYS,\n DISPLAYABLE_PROP_KEYS,\n GROUP_PROP_KEYS,\n PATH_PROP_KEYS,\n PATH_STYLE_KEYS,\n STYLE_KEYS_BY_TYPE,\n TEXT_COMMON_STYLE_KEYS,\n} from \"./props-common\";\nimport { SHAPE_KEYS_BY_TYPE } from \"./props-shape\";\nimport type { GraphicNode } from \"./collector\";\nimport { GRAPHIC_EVENTS } from \"./types\";\n\nfunction mergeProps(\n target: Record<string, unknown> | undefined,\n keys: readonly string[],\n props: Record<string, unknown>,\n): Record<string, unknown> | undefined {\n for (const key of keys) {\n const value = props[key];\n if (value !== undefined) {\n (target ??= {})[key] = value;\n }\n }\n return target;\n}\n\nfunction buildNestedProps(\n source: unknown,\n props: Record<string, unknown>,\n keys: readonly string[],\n transition: unknown,\n extraKeys?: readonly string[],\n): Record<string, unknown> | undefined {\n const nested = source as Record<string, unknown> | undefined;\n let result = nested && Object.keys(nested).length > 0 ? { ...nested } : undefined;\n result = mergeProps(result, keys, props);\n if (extraKeys) {\n result = mergeProps(result, extraKeys, props);\n }\n\n if (transition !== undefined) {\n (result ??= {}).transition = transition;\n }\n\n return result;\n}\n\nfunction toEventHandler(value: unknown, once: boolean): EventHandler | undefined {\n const invoke = createEventInvoker(value);\n if (!invoke || !once) {\n return invoke;\n }\n\n let called = false;\n return (...args: unknown[]): unknown => {\n if (called) {\n return;\n }\n called = true;\n return invoke(...args);\n };\n}\n\nfunction mergeHandlers(node: GraphicNode, target: Record<string, unknown>): void {\n const { handlers } = node;\n\n if (node.handlerCache) {\n for (const key of node.handlerCache.keys()) {\n if (!Object.hasOwn(handlers, key)) {\n node.handlerCache.delete(key);\n }\n }\n }\n\n for (const key of Object.keys(handlers)) {\n const value = handlers[key];\n const descriptor = parseOnEvent(key);\n if (!descriptor) {\n continue;\n }\n const event = descriptor.event.toLowerCase();\n if (!Object.hasOwn(GRAPHIC_EVENTS, event)) {\n continue;\n }\n\n const cached = node.handlerCache?.get(key);\n const reused = cached !== undefined && cached.source === value && hasEventHandler(value);\n const handler = reused ? cached.handler : toEventHandler(value, descriptor.once);\n if (!handler) {\n node.handlerCache?.delete(key);\n continue;\n }\n if (!reused) {\n (node.handlerCache ??= new Map()).set(key, { source: value, handler });\n }\n\n const eventKey = `on${event}`;\n const existing = target[eventKey] as EventHandler | undefined;\n if (!existing) {\n target[eventKey] = handler;\n continue;\n }\n\n target[eventKey] = (...args: unknown[]): unknown => {\n const result = existing(...args);\n return handler(...args) || result;\n };\n }\n}\n\nfunction toElement(node: GraphicNode, children?: Option[]): Option {\n const { type, id, props } = node;\n const shapeKeys: readonly string[] | undefined =\n SHAPE_KEYS_BY_TYPE[type as keyof typeof SHAPE_KEYS_BY_TYPE];\n const styleKeys: readonly string[] | undefined = shapeKeys\n ? PATH_STYLE_KEYS\n : STYLE_KEYS_BY_TYPE[type as keyof typeof STYLE_KEYS_BY_TYPE];\n const commonStyleKeys = type === \"text\" ? TEXT_COMMON_STYLE_KEYS : COMMON_STYLE_KEYS;\n const out: Record<string, unknown> = {\n type,\n id,\n };\n\n for (const key of COMMON_PROP_KEYS) {\n const value = props[key];\n if (value !== undefined && !shapeKeys?.includes(key) && !styleKeys?.includes(key)) {\n out[key] = value;\n }\n }\n if (shapeKeys) {\n mergeProps(out, PATH_PROP_KEYS, props);\n }\n\n mergeHandlers(node, out);\n\n if (type === \"group\") {\n mergeProps(out, GROUP_PROP_KEYS, props);\n if (children?.length) {\n out.children = children;\n }\n return out as Option;\n }\n\n mergeProps(out, DISPLAYABLE_PROP_KEYS, props);\n\n const shape = shapeKeys\n ? buildNestedProps(props.shape, props, shapeKeys, props.shapeTransition)\n : undefined;\n if (shape) {\n out.shape = shape;\n }\n\n const style = buildNestedProps(\n props.style,\n props,\n commonStyleKeys,\n props.styleTransition,\n styleKeys,\n );\n if (style) {\n out.style = style;\n }\n\n return out as Option;\n}\n\nexport function buildOption(nodes: Iterable<GraphicNode>, rootId: string): Option {\n const byParent = new Map<string | null, GraphicNode[]>();\n const occupiedRootIds = new Set<string>();\n\n for (const node of nodes) {\n occupiedRootIds.add(node.id);\n const list = byParent.get(node.parentId);\n if (list) {\n list.push(node);\n continue;\n }\n byParent.set(node.parentId, [node]);\n }\n\n while (occupiedRootIds.has(rootId)) {\n rootId += \"_\";\n }\n\n for (const list of byParent.values()) {\n list.sort((a, b) => a.order - b.order);\n }\n\n const childrenOf = (parentId: string | null): Option[] | undefined =>\n byParent.get(parentId)?.map((node) => {\n if (node.type !== \"group\") {\n return toElement(node);\n }\n return toElement(node, childrenOf(node.id));\n });\n\n return {\n graphic: {\n elements: [\n {\n type: \"group\",\n id: rootId,\n $action: \"replace\",\n children: childrenOf(null) ?? [],\n },\n ],\n },\n } as Option;\n}\n","import { warn as coreWarn } from \"../utils\";\nimport type { EventHandler } from \"../utils\";\n\nexport type GraphicNode = {\n id: string;\n type: string;\n parentId: string | null;\n props: Record<string, unknown>;\n handlers: Record<string, unknown>;\n handlerCache?: Map<string, { source: unknown; handler: EventHandler }>;\n order: number;\n sourceId: number;\n};\n\nexport type GraphicCollector = {\n beginPass: () => void;\n register: (node: GraphicRegisterNode) => void;\n unregister: (id: string, sourceId: number) => void;\n warn: (message: string, onceKey: string) => void;\n getNodes: () => Iterable<GraphicNode>;\n requestFlush: () => void;\n cancelPendingFlush: () => void;\n};\n\ntype GraphicRegisterNode = Omit<GraphicNode, \"handlerCache\" | \"order\"> & {\n order?: number;\n};\n\nexport function createCollector(onFlush: () => void): GraphicCollector {\n const nodes = new Map<string, GraphicNode>();\n const seenInPass = new Map<string, number>();\n const warnedKeys = new Set<string>();\n\n let order = 0;\n let pending = false;\n\n function beginPass(): void {\n order = 0;\n seenInPass.clear();\n }\n\n function warn(message: string, onceKey: string): void {\n if (warnedKeys.has(onceKey)) {\n return;\n }\n warnedKeys.add(onceKey);\n coreWarn(message);\n }\n\n function register(node: GraphicRegisterNode): void {\n const seenSource = seenInPass.get(node.id);\n if (seenSource !== undefined && seenSource !== node.sourceId) {\n warn(\n `Duplicate graphic id \"${node.id}\" detected. Updates may be unstable.`,\n `duplicate-id:${node.id}`,\n );\n }\n\n const nextOrder = node.order ?? order;\n order = Math.max(order, nextOrder + 1);\n const existing = nodes.get(node.id);\n const sameSource = existing?.sourceId === node.sourceId;\n const unchanged =\n sameSource &&\n existing.type === node.type &&\n existing.parentId === node.parentId &&\n existing.props === node.props &&\n existing.handlers === node.handlers &&\n existing.order === nextOrder;\n\n seenInPass.set(node.id, node.sourceId);\n // Props and attrs are stable proxies; their watcher covers value-only changes.\n if (unchanged) {\n return;\n }\n\n nodes.set(node.id, {\n ...node,\n handlerCache: sameSource ? existing?.handlerCache : undefined,\n order: nextOrder,\n });\n requestFlush();\n }\n\n function unregister(id: string, sourceId: number): void {\n const existing = nodes.get(id);\n if (!existing || existing.sourceId !== sourceId) {\n return;\n }\n nodes.delete(id);\n requestFlush();\n }\n\n function requestFlush(): void {\n if (pending) {\n return;\n }\n pending = true;\n queueMicrotask(() => {\n if (!pending) {\n return;\n }\n pending = false;\n beginPass();\n onFlush();\n });\n }\n\n function getNodes(): Iterable<GraphicNode> {\n return nodes.values();\n }\n\n function cancelPendingFlush(): void {\n pending = false;\n beginPass();\n }\n\n return {\n beginPass,\n register,\n unregister,\n warn,\n getNodes,\n requestFlush,\n cancelPendingFlush,\n };\n}\n","import type { InjectionKey, Ref } from \"vue\";\n\nimport type { GraphicCollector } from \"./collector\";\n\nexport const GRAPHIC_COLLECTOR_KEY: InjectionKey<GraphicCollector> = Symbol(\n \"vue-echarts:graphic-collector\",\n);\nexport const GRAPHIC_PARENT_ID_KEY: InjectionKey<Ref<string | null>> = Symbol(\n \"vue-echarts:graphic-parent-id\",\n);\nexport const GRAPHIC_ORDER_KEY: InjectionKey<Ref<Map<PropertyKey, number>>> = Symbol(\n \"vue-echarts:graphic-order\",\n);\n","// Vue distinguishes numeric and string keys, while ECharts stringifies element ids.\nfunction toOrderKey(key: PropertyKey | null | undefined): PropertyKey | undefined {\n return typeof key === \"string\" ? `key:${key}` : (key ?? undefined);\n}\n\nexport function resolveIdentity(\n propsId: string | number | undefined,\n vnodeKey: PropertyKey | null | undefined,\n uid: number,\n): { id: string; orderKey?: PropertyKey } {\n if (propsId != null) {\n const id = String(propsId);\n return { id, orderKey: `id:${id}` };\n }\n const orderKey = toOrderKey(vnodeKey);\n if (orderKey !== undefined) {\n return {\n id: typeof vnodeKey === \"string\" ? vnodeKey : `__ve_graphic_${uid}`,\n orderKey,\n };\n }\n return { id: `__ve_graphic_${uid}` };\n}\n\nexport function resolveOrderKey(\n propsId: unknown,\n vnodeKey: PropertyKey | null | undefined,\n): PropertyKey | null {\n if (propsId != null) {\n return `id:${String(propsId)}`;\n }\n return toOrderKey(vnodeKey) ?? null;\n}\n","export const GRAPHIC_COMPONENT_MARKER = Symbol(\"vue-echarts:graphic-component\");\n\nexport type GraphicComponentType =\n | \"group\"\n | \"rect\"\n | \"circle\"\n | \"ellipse\"\n | \"text\"\n | \"line\"\n | \"polyline\"\n | \"polygon\"\n | \"image\"\n | \"sector\"\n | \"ring\"\n | \"arc\"\n | \"bezierCurve\";\n","import { shallowRef } from \"vue\";\nimport type { VNode } from \"vue\";\n\nimport { resolveOrderKey } from \"./identity\";\nimport { GRAPHIC_COMPONENT_MARKER } from \"./marker\";\n\nfunction isGraphic(vnode: VNode): boolean {\n const type = vnode.type as Record<string, unknown> | string | symbol;\n if (!type || typeof type !== \"object\") {\n return false;\n }\n return typeof (type as Record<string | symbol, unknown>)[GRAPHIC_COMPONENT_MARKER] === \"string\";\n}\n\nfunction collect(value: unknown, orderMap: Map<PropertyKey, number>, order: number): number {\n if (Array.isArray(value)) {\n for (const child of value) {\n order = collect(child, orderMap, order);\n }\n return order;\n }\n\n if (!value || typeof value !== \"object\") {\n return order;\n }\n const vnode = value as VNode;\n const children = vnode.children;\n const graphic = isGraphic(vnode);\n const type = typeof vnode.type;\n const opaqueComponent = !Array.isArray(children) && (type === \"object\" || type === \"function\");\n const props = vnode.props as Record<string, unknown> | null;\n const identity = graphic || opaqueComponent ? resolveOrderKey(props?.id, vnode.key) : null;\n if (identity !== null) {\n orderMap.set(identity, order);\n }\n if (graphic) {\n return order + 1;\n }\n\n // An opaque component's slot output is unavailable here, but its identity can\n // still anchor a graphic child that forwards the same id or key.\n if (identity !== null) {\n order++;\n }\n\n if (Array.isArray(children)) {\n for (const child of children) {\n order = collect(child, orderMap, order);\n }\n }\n return order;\n}\n\nfunction isSameOrder(current: Map<PropertyKey, number>, next: Map<PropertyKey, number>): boolean {\n if (current.size !== next.size) {\n return false;\n }\n for (const [key, order] of current) {\n if (next.get(key) !== order) {\n return false;\n }\n }\n return true;\n}\n\nexport function createOrderTracker() {\n let current = new Map<PropertyKey, number>();\n const ref = shallowRef(current);\n\n return {\n ref,\n update(value: unknown): void {\n const next = new Map<PropertyKey, number>();\n collect(value, next, 0);\n if (!isSameOrder(current, next)) {\n current = next;\n ref.value = current;\n }\n },\n };\n}\n","import {\n Teleport,\n defineComponent,\n getCurrentInstance,\n h,\n onBeforeMount,\n onMounted,\n provide,\n shallowRef,\n} from \"vue\";\n\nimport { isBrowser } from \"../utils\";\nimport type { GraphicCollector } from \"./collector\";\nimport { GRAPHIC_COLLECTOR_KEY, GRAPHIC_ORDER_KEY, GRAPHIC_PARENT_ID_KEY } from \"./context\";\nimport { createOrderTracker } from \"./order\";\n\nexport const GraphicMount = defineComponent({\n name: \"GraphicMount\",\n props: {\n collector: {\n type: Object as () => GraphicCollector,\n required: true,\n },\n },\n setup(props, { slots }) {\n const instance = getCurrentInstance()!;\n const { collector } = props;\n const { beginPass } = collector;\n const detachedRoot = shallowRef<HTMLDivElement>();\n // A pre-existing vnode element means Vue is hydrating the empty SSR Teleport.\n const contentReady = shallowRef(isBrowser() && !instance.vnode.el);\n const parentId = shallowRef<string | null>(null);\n const order = createOrderTracker();\n\n onBeforeMount(() => {\n // Keeping the target inside the host lets iframe adoption finish before child mounted hooks.\n const host = instance.parent?.subTree.el as HTMLElement | undefined;\n if (host) {\n const target = host.ownerDocument.createElement(\"div\");\n host.appendChild(target);\n detachedRoot.value = target;\n }\n });\n\n onMounted(() => {\n const ownerDocument = (instance.vnode.el as Node).ownerDocument!;\n const target = detachedRoot.value;\n target?.remove();\n if (target?.ownerDocument !== ownerDocument) {\n detachedRoot.value = ownerDocument.createElement(\"div\");\n }\n contentReady.value = true;\n });\n\n provide(GRAPHIC_COLLECTOR_KEY, collector);\n provide(GRAPHIC_PARENT_ID_KEY, parentId);\n provide(GRAPHIC_ORDER_KEY, order.ref);\n\n return () => {\n beginPass();\n const content = slots.default!();\n order.update(content);\n const target = detachedRoot.value;\n\n return h(\n Teleport,\n {\n to: target ?? \"body\",\n disabled: !target,\n },\n target && contentReady.value ? content : [],\n );\n };\n },\n});\n","import { h, onScopeDispose, onUpdated } from \"vue\";\nimport { use } from \"echarts/core\";\nimport { GraphicComponent } from \"echarts/components\";\nimport { buildOption } from \"./build\";\nimport { createCollector } from \"./collector\";\nimport { GraphicMount } from \"./mount\";\nimport { registerRuntime } from \"./runtime\";\n\nconst ROOT_ID = \"__ve_graphic_root__\";\n\nexport function registerExtension(): void {\n use([GraphicComponent]);\n\n registerRuntime((ctx) => {\n const { slots, manualUpdate, requestUpdate } = ctx;\n const collector = createCollector(handleFlush);\n let hasGraphicSlot = Boolean(slots.graphic);\n\n function handleFlush(): void {\n if (manualUpdate.value) {\n collector.warn(\n \"`#graphic` slot updates are ignored when `manual-update` is `true`.\",\n \"manual-update-graphic\",\n );\n return;\n }\n requestUpdate();\n }\n\n onScopeDispose(collector.cancelPendingFlush);\n onUpdated(() => {\n const nextHasGraphicSlot = Boolean(slots.graphic);\n if (nextHasGraphicSlot === hasGraphicSlot) {\n return;\n }\n hasGraphicSlot = nextHasGraphicSlot;\n if (!hasGraphicSlot) {\n collector.cancelPendingFlush();\n }\n handleFlush();\n });\n\n return {\n patchOption(option) {\n hasGraphicSlot = Boolean(slots.graphic);\n if (!hasGraphicSlot) {\n return option;\n }\n if (option.graphic) {\n collector.warn(\n \"`#graphic` slot is provided, so `option.graphic` is ignored. Remove one of them to avoid ambiguity.\",\n \"option-graphic-override\",\n );\n }\n const nextOption = buildOption(collector.getNodes(), ROOT_ID);\n collector.cancelPendingFlush();\n return {\n ...option,\n graphic: nextOption.graphic,\n };\n },\n render() {\n if (!slots.graphic) {\n return null;\n }\n return h(GraphicMount, { collector }, { default: slots.graphic });\n },\n };\n });\n}\n","import {\n defineComponent,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n provide,\n shallowRef,\n type Slot,\n type SlotsType,\n watch,\n} from \"vue\";\n\nimport type { PublicComponent } from \"../types\";\nimport { warn } from \"../utils\";\nimport { GRAPHIC_COLLECTOR_KEY, GRAPHIC_ORDER_KEY, GRAPHIC_PARENT_ID_KEY } from \"./context\";\nimport { resolveIdentity } from \"./identity\";\nimport { GRAPHIC_COMPONENT_MARKER, type GraphicComponentType } from \"./marker\";\nimport { createOrderTracker } from \"./order\";\nimport { commonProps, textPropOverrides } from \"./props-common\";\nimport type {\n GraphicCommonPropKey,\n GraphicCommonStyleKey,\n GraphicDisplayablePropKey,\n GraphicGroupPropKey,\n GraphicImageStyleKey,\n GraphicPathPropKey,\n GraphicPathStyleKey,\n GraphicTextAttachmentPropKey,\n GraphicTextCommonStyleKey,\n GraphicTextStyleKey,\n} from \"./props-common\";\nimport { SHAPE_KEYS_BY_TYPE, shapeProps } from \"./props-shape\";\nimport type { GraphicEmits } from \"./types\";\n\nconst componentProps = {\n ...commonProps,\n ...shapeProps,\n} as const;\nconst runtimeProps = {\n ...componentProps,\n width: textPropOverrides.width,\n} as const;\n\ntype NestedShapePropKey = \"shape\" | \"shapeTransition\";\ntype NestedStylePropKey = \"style\" | \"styleTransition\";\ntype SpecializedPropKey =\n | GraphicCommonStyleKey\n | GraphicDisplayablePropKey\n | GraphicPathPropKey\n | GraphicPathStyleKey\n | GraphicTextStyleKey\n | GraphicImageStyleKey\n | NestedShapePropKey\n | NestedStylePropKey\n | keyof typeof shapeProps;\ntype SharedPropKey<T extends GraphicComponentType> = Exclude<\n Exclude<keyof typeof componentProps, SpecializedPropKey> | GraphicCommonPropKey,\n T extends \"text\" ? GraphicTextAttachmentPropKey : never\n>;\ntype StylePropKey<T extends GraphicComponentType> = T extends \"group\"\n ? never\n :\n | NestedStylePropKey\n | (T extends \"text\" ? GraphicTextCommonStyleKey : GraphicCommonStyleKey)\n | (T extends keyof typeof SHAPE_KEYS_BY_TYPE\n ? GraphicPathStyleKey\n : T extends \"text\"\n ? GraphicTextStyleKey\n : T extends \"image\"\n ? GraphicImageStyleKey\n : never);\ntype PathPropKey<T extends GraphicComponentType> = T extends keyof typeof SHAPE_KEYS_BY_TYPE\n ? NestedShapePropKey | GraphicPathPropKey | (typeof SHAPE_KEYS_BY_TYPE)[T][number]\n : never;\ntype GroupPropKey<T extends GraphicComponentType> = T extends \"group\" ? GraphicGroupPropKey : never;\ntype DisplayablePropKey<T extends GraphicComponentType> = T extends \"group\"\n ? never\n : GraphicDisplayablePropKey;\ntype ComponentPropDefinitions<T extends GraphicComponentType> = T extends \"text\"\n ? Omit<typeof componentProps, keyof typeof textPropOverrides> & typeof textPropOverrides\n : T extends \"rect\"\n ? typeof componentProps\n : Omit<typeof componentProps, \"r\"> & { r: NumberConstructor };\ntype ComponentProps<T extends GraphicComponentType> = Pick<\n ComponentPropDefinitions<T>,\n Extract<\n SharedPropKey<T> | GroupPropKey<T> | DisplayablePropKey<T> | PathPropKey<T> | StylePropKey<T>,\n keyof typeof componentProps\n >\n>;\ntype ComponentSlots<T extends GraphicComponentType> = SlotsType<\n T extends \"group\" ? { default?: Slot } : Record<never, never>\n>;\n\n/* @__NO_SIDE_EFFECTS__ */\nexport function createComponent<T extends GraphicComponentType>(\n name: string,\n type: T,\n): GraphicComponent<T> {\n const component = defineComponent({\n name,\n inheritAttrs: false,\n props: runtimeProps as unknown as ComponentProps<T>,\n emits: {} as unknown as GraphicEmits,\n setup(props, { attrs, slots }) {\n const instance = getCurrentInstance()!;\n const collector = inject(GRAPHIC_COLLECTOR_KEY, null);\n const parentIdRef = inject(GRAPHIC_PARENT_ID_KEY, null);\n const parentOrderRef = inject(GRAPHIC_ORDER_KEY, null);\n\n if (!collector) {\n warn(`\\`${name}\\` must be used inside \\`#graphic\\` slot.`);\n return () => null;\n }\n const { register: registerNode, unregister, requestFlush } = collector;\n let currentId: string | null = null;\n\n watch([props, () => attrs], requestFlush, { deep: true });\n\n function register(): string {\n const { id, orderKey } = resolveIdentity(\n (props as { id?: string | number }).id,\n instance.vnode.key,\n instance.uid,\n );\n if (currentId !== null && currentId !== id) {\n unregister(currentId, instance.uid);\n }\n currentId = id;\n\n registerNode({\n id,\n type,\n parentId: parentIdRef!.value,\n order: orderKey !== undefined ? parentOrderRef?.value.get(orderKey) : undefined,\n props: props as Record<string, unknown>,\n handlers: attrs as Record<string, unknown>,\n sourceId: instance.uid,\n });\n return id;\n }\n\n onBeforeUnmount(() => unregister(currentId!, instance.uid));\n\n if (type === \"group\") {\n const providedParent = shallowRef<string | null>(null);\n const childOrder = createOrderTracker();\n provide(GRAPHIC_PARENT_ID_KEY, providedParent);\n provide(GRAPHIC_ORDER_KEY, childOrder.ref);\n\n return () => {\n providedParent.value = register();\n const content = (slots as { default?: Slot }).default?.() ?? null;\n childOrder.update(content);\n return content;\n };\n }\n\n return () => {\n register();\n return null;\n };\n },\n }) as GraphicComponent<T>;\n\n (component as unknown as Record<symbol, unknown>)[GRAPHIC_COMPONENT_MARKER] = type;\n\n return component;\n}\n\nexport type GraphicComponent<T extends GraphicComponentType> = PublicComponent<\n ComponentProps<T>,\n Record<never, never>,\n GraphicEmits,\n ComponentSlots<T>\n>;\n","import { createComponent, type GraphicComponent } from \"./component-factory\";\n\nexport const GGroup: GraphicComponent<\"group\"> = createComponent(\"GGroup\", \"group\");\nexport const GRect: GraphicComponent<\"rect\"> = createComponent(\"GRect\", \"rect\");\nexport const GCircle: GraphicComponent<\"circle\"> = createComponent(\"GCircle\", \"circle\");\nexport const GEllipse: GraphicComponent<\"ellipse\"> = createComponent(\"GEllipse\", \"ellipse\");\nexport const GText: GraphicComponent<\"text\"> = createComponent(\"GText\", \"text\");\nexport const GLine: GraphicComponent<\"line\"> = createComponent(\"GLine\", \"line\");\nexport const GPolyline: GraphicComponent<\"polyline\"> = createComponent(\"GPolyline\", \"polyline\");\nexport const GPolygon: GraphicComponent<\"polygon\"> = createComponent(\"GPolygon\", \"polygon\");\nexport const GImage: GraphicComponent<\"image\"> = createComponent(\"GImage\", \"image\");\nexport const GSector: GraphicComponent<\"sector\"> = createComponent(\"GSector\", \"sector\");\nexport const GRing: GraphicComponent<\"ring\"> = createComponent(\"GRing\", \"ring\");\nexport const GArc: GraphicComponent<\"arc\"> = createComponent(\"GArc\", \"arc\");\nexport const GBezierCurve: GraphicComponent<\"bezierCurve\"> = createComponent(\n \"GBezierCurve\",\n \"bezierCurve\",\n);\n","import { registerExtension } from \"./extension\";\n\nregisterExtension();\n\nexport type { VChartSlotsExtension } from \"../index\";\nexport type { GraphicEmits, GraphicEventName, GraphicOnEventName } from \"./types\";\nexport type { GraphicCommonProps } from \"./props-common\";\nexport type { GraphicShapeProps } from \"./props-shape\";\n\nexport {\n GGroup,\n GRect,\n GCircle,\n GEllipse,\n GText,\n GLine,\n GPolyline,\n GPolygon,\n GImage,\n GSector,\n GRing,\n GArc,\n GBezierCurve,\n} from \"./components\";\n"],"mappings":";;;;AAiBA,MAAa,mBAAmB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,GAAG,CA5BqC,eAAe,YA4BpD;CACH;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,kBAAkB,CAAC,SAAS,QAAQ;AAEjD,MAAa,wBAAwB;CAAC;CAAK;CAAM;CAAU;CAAU;AAAW;AAEhF,MAAa,iBAAiB,CAAC,WAAW;AAE1C,MAAa,yBAAyB;CACpC;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,oBAAoB,CAAC,GAAG,wBAAwB,OAAO;AAEpE,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,kBAAkB;CAC7B,GAAG;CACH;CACA;CACA;CACA;CACA;CACA;AACF;AAqDA,MAAa,qBAAqB;CAChC,MAAM;EAnDN,GAAG;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAgBM;CACN,OAAO;EA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AC9E,MAAa,QAAkC,gCAAgB,SAAS,MAAM;AAC9E,MAAa,YAA0C,gCAAgB,aAAa,UAAU;AAC9F,MAAa,WAAwC,gCAAgB,YAAY,SAAS;AAC1F,MAAa,SAAoC,gCAAgB,UAAU,OAAO;AAClF,MAAa,UAAsC,gCAAgB,WAAW,QAAQ;AACtF,MAAa,QAAkC,gCAAgB,SAAS,MAAM;AAC9E,MAAa,OAAgC,gCAAgB,QAAQ,KAAK;AAC1E,MAAa,eAAgD,gCAC3D,gBACA,aACF;;;ACfA,kBAAkB"}
1
+ {"version":3,"file":"graphic.js","names":[],"sources":["../src/graphic/props-common.ts","../src/graphic/props-shape.ts","../src/graphic/types.ts","../src/graphic/build.ts","../src/graphic/collector.ts","../src/graphic/context.ts","../src/graphic/mount.ts","../src/graphic/extension.ts","../src/graphic/identity.ts","../src/graphic/component-factory.ts","../src/graphic/components.ts","../src/graphic/index.ts"],"sourcesContent":["import type { ExtractPublicPropTypes, PropType } from \"vue\";\nimport type {\n Color,\n CustomSeriesRenderItemReturn,\n GraphicComponentOption,\n PatternObject,\n TooltipComponentOption,\n} from \"echarts\";\nimport type { FontStyle, FontWeight } from \"../types\";\n\nexport type GraphicDuring = NonNullable<NonNullable<CustomSeriesRenderItemReturn>[\"during\"]>;\ntype GraphicExtra = Record<string, unknown> & {\n transition?: string | string[];\n};\n\nexport const TEXT_ATTACHMENT_PROP_KEYS = [\"textContent\", \"textConfig\"] as const;\n\nexport const COMMON_PROP_KEYS = [\n \"id\",\n \"name\",\n \"x\",\n \"y\",\n \"rotation\",\n \"scaleX\",\n \"scaleY\",\n \"skewX\",\n \"skewY\",\n \"originX\",\n \"originY\",\n \"anchorX\",\n \"anchorY\",\n \"left\",\n \"right\",\n \"top\",\n \"bottom\",\n \"bounding\",\n \"silent\",\n \"draggable\",\n \"ignore\",\n \"extra\",\n \"info\",\n \"tooltip\",\n \"clipPath\",\n ...TEXT_ATTACHMENT_PROP_KEYS,\n \"transition\",\n \"enterFrom\",\n \"leaveTo\",\n \"during\",\n \"enterAnimation\",\n \"updateAnimation\",\n \"leaveAnimation\",\n \"keyframeAnimation\",\n] as const;\n\nexport const GROUP_PROP_KEYS = [\"width\", \"height\"] as const;\n\nexport const DISPLAYABLE_PROP_KEYS = [\"z\", \"z2\", \"zlevel\", \"cursor\", \"invisible\"] as const;\n\nexport const PATH_PROP_KEYS = [\"autoBatch\"] as const;\n\nexport const TEXT_COMMON_STYLE_KEYS = [\n \"shadowBlur\",\n \"shadowOffsetX\",\n \"shadowOffsetY\",\n \"shadowColor\",\n \"opacity\",\n] as const;\n\nexport const COMMON_STYLE_KEYS = [...TEXT_COMMON_STYLE_KEYS, \"blend\"] as const;\n\nconst PAINT_STYLE_KEYS = [\n \"fill\",\n \"stroke\",\n \"strokeNoScale\",\n \"fillOpacity\",\n \"strokeOpacity\",\n \"lineWidth\",\n \"lineDash\",\n \"lineDashOffset\",\n] as const;\n\nexport const PATH_STYLE_KEYS = [\n ...PAINT_STYLE_KEYS,\n \"decal\",\n \"strokePercent\",\n \"lineCap\",\n \"lineJoin\",\n \"miterLimit\",\n \"strokeFirst\",\n] as const;\n\nexport const TEXT_STYLE_KEYS = [\n ...PAINT_STYLE_KEYS,\n \"text\",\n \"font\",\n \"textFont\",\n \"fontStyle\",\n \"fontWeight\",\n \"fontFamily\",\n \"fontSize\",\n \"align\",\n \"verticalAlign\",\n \"lineHeight\",\n \"tag\",\n \"backgroundColor\",\n \"padding\",\n \"margin\",\n \"borderColor\",\n \"borderWidth\",\n \"borderRadius\",\n \"borderDash\",\n \"borderDashOffset\",\n \"rich\",\n \"textStrokeWidth\",\n \"textAlign\",\n \"textVerticalAlign\",\n \"textLineHeight\",\n \"textShadowBlur\",\n \"textShadowOffsetX\",\n \"textShadowOffsetY\",\n \"textShadowColor\",\n \"width\",\n \"height\",\n \"overflow\",\n \"lineOverflow\",\n \"ellipsis\",\n \"placeholder\",\n \"truncateMinChar\",\n] as const;\n\nexport const IMAGE_STYLE_KEYS = [\n \"image\",\n \"x\",\n \"y\",\n \"width\",\n \"height\",\n \"sx\",\n \"sy\",\n \"sWidth\",\n \"sHeight\",\n] as const;\n\nexport const STYLE_KEYS_BY_TYPE = {\n text: TEXT_STYLE_KEYS,\n image: IMAGE_STYLE_KEYS,\n} as const;\n\nexport type GraphicCommonPropKey = (typeof COMMON_PROP_KEYS)[number];\nexport type GraphicGroupPropKey = (typeof GROUP_PROP_KEYS)[number];\nexport type GraphicDisplayablePropKey = (typeof DISPLAYABLE_PROP_KEYS)[number];\nexport type GraphicPathPropKey = (typeof PATH_PROP_KEYS)[number];\nexport type GraphicTextAttachmentPropKey = (typeof TEXT_ATTACHMENT_PROP_KEYS)[number];\nexport type GraphicTextCommonStyleKey = (typeof TEXT_COMMON_STYLE_KEYS)[number];\nexport type GraphicCommonStyleKey = (typeof COMMON_STYLE_KEYS)[number];\nexport type GraphicPathStyleKey = (typeof PATH_STYLE_KEYS)[number];\nexport type GraphicTextStyleKey = (typeof TEXT_STYLE_KEYS)[number];\nexport type GraphicImageStyleKey = (typeof IMAGE_STYLE_KEYS)[number];\n\n// Keep zrender defaults instead of letting Vue cast absent Boolean props to false.\nexport function withUndefinedDefault<T>(type: T) {\n return { type, default: undefined };\n}\n\ntype GraphicTextStyleOnlyKey = Exclude<\n GraphicTextStyleKey,\n GraphicPathStyleKey | \"width\" | \"height\"\n>;\ntype GraphicImageStyleOnlyKey = Exclude<GraphicImageStyleKey, \"x\" | \"y\" | \"width\" | \"height\">;\ntype GraphicImageSource = string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;\ntype GraphicTextAlign = \"left\" | \"center\" | \"right\";\ntype GraphicTextVerticalAlign = \"top\" | \"middle\" | \"bottom\";\ntype GraphicTextOverflow = \"break\" | \"breakAll\" | \"truncate\" | \"none\";\ntype GraphicOptionProp<K extends PropertyKey, T = GraphicComponentOption> = T extends {\n [P in K]?: infer V;\n}\n ? NonNullable<V>\n : never;\nexport type GraphicAnimationOption = GraphicOptionProp<\"enterAnimation\">;\nexport type GraphicKeyframeAnimationOption = GraphicOptionProp<\"keyframeAnimation\">;\n\nconst elementProps = {\n id: [String, Number] as PropType<string | number>,\n name: String,\n x: Number,\n y: Number,\n rotation: Number,\n scaleX: Number,\n scaleY: Number,\n skewX: Number,\n skewY: Number,\n originX: Number,\n originY: Number,\n anchorX: Number,\n anchorY: Number,\n left: [String, Number] as PropType<string | number>,\n right: [String, Number] as PropType<string | number>,\n top: [String, Number] as PropType<string | number>,\n bottom: [String, Number] as PropType<string | number>,\n bounding: String as PropType<\"raw\" | \"all\">,\n z: Number,\n z2: Number,\n zlevel: Number,\n silent: withUndefinedDefault(Boolean),\n draggable: withUndefinedDefault([Boolean, String] as PropType<\n boolean | \"horizontal\" | \"vertical\"\n >),\n cursor: String,\n ignore: withUndefinedDefault(Boolean),\n invisible: withUndefinedDefault(Boolean),\n extra: Object as PropType<GraphicExtra>,\n info: null as unknown as PropType<unknown>,\n tooltip: Object as PropType<TooltipComponentOption>,\n clipPath: withUndefinedDefault([Boolean, Object] as PropType<false | object>),\n textContent: Object as PropType<Record<string, unknown>>,\n textConfig: Object as PropType<object>,\n transition: [String, Array] as PropType<string | string[]>,\n enterFrom: Object as PropType<object>,\n leaveTo: Object as PropType<object>,\n during: Function as PropType<GraphicDuring>,\n enterAnimation: Object as PropType<GraphicAnimationOption>,\n updateAnimation: Object as PropType<GraphicAnimationOption>,\n leaveAnimation: Object as PropType<GraphicAnimationOption>,\n keyframeAnimation: [Object, Array] as PropType<GraphicKeyframeAnimationOption>,\n} as const satisfies Record<GraphicCommonPropKey | GraphicDisplayablePropKey, unknown>;\n\nconst groupProps = {\n width: Number,\n height: Number,\n} as const satisfies Record<GraphicGroupPropKey, unknown>;\n\nconst pathProps = {\n autoBatch: withUndefinedDefault(Boolean),\n} as const satisfies Record<GraphicPathPropKey, unknown>;\n\nconst commonStyleProps = {\n shadowBlur: Number,\n shadowOffsetX: Number,\n shadowOffsetY: Number,\n shadowColor: String,\n opacity: Number,\n blend: String,\n} as const satisfies Record<GraphicCommonStyleKey, unknown>;\n\nconst pathStyleProps = {\n fill: [String, Object] as PropType<Color>,\n stroke: [String, Object] as PropType<Color>,\n decal: Object as PropType<PatternObject>,\n strokePercent: Number,\n strokeNoScale: withUndefinedDefault(Boolean),\n fillOpacity: Number,\n strokeOpacity: Number,\n lineWidth: Number,\n lineDash: withUndefinedDefault([String, Array, Boolean] as PropType<\n \"solid\" | \"dashed\" | \"dotted\" | number[] | false\n >),\n lineDashOffset: Number,\n lineCap: String as PropType<CanvasLineCap>,\n lineJoin: String as PropType<CanvasLineJoin>,\n miterLimit: Number,\n strokeFirst: withUndefinedDefault(Boolean),\n} as const satisfies Record<GraphicPathStyleKey, unknown>;\n\nconst textStyleProps = {\n text: String,\n font: String,\n textFont: String,\n fontStyle: String as PropType<FontStyle>,\n fontWeight: [String, Number] as PropType<FontWeight>,\n fontFamily: String,\n fontSize: [String, Number] as PropType<string | number>,\n align: String as PropType<GraphicTextAlign>,\n verticalAlign: String as PropType<GraphicTextVerticalAlign>,\n lineHeight: Number,\n tag: String,\n backgroundColor: [String, Object] as PropType<string | { image: GraphicImageSource }>,\n padding: [Number, Array] as PropType<number | number[]>,\n margin: [Number, Array] as PropType<number | number[]>,\n borderColor: String,\n borderWidth: Number,\n borderRadius: [Number, Array] as PropType<number | number[]>,\n borderDash: withUndefinedDefault([Array, Boolean] as PropType<number[] | false>),\n borderDashOffset: Number,\n rich: Object as PropType<Record<string, object>>,\n textStrokeWidth: Number,\n textAlign: String as PropType<GraphicTextAlign>,\n textVerticalAlign: String as PropType<GraphicTextVerticalAlign>,\n textLineHeight: Number,\n textShadowBlur: Number,\n textShadowOffsetX: Number,\n textShadowOffsetY: Number,\n textShadowColor: String,\n overflow: String as PropType<GraphicTextOverflow>,\n lineOverflow: String as PropType<\"truncate\">,\n ellipsis: String,\n placeholder: String,\n truncateMinChar: Number,\n} as const satisfies Record<GraphicTextStyleOnlyKey, unknown>;\n\nconst imageStyleProps = {\n image: [String, Object] as PropType<GraphicImageSource>,\n sx: Number,\n sy: Number,\n sWidth: Number,\n sHeight: Number,\n} as const satisfies Record<GraphicImageStyleOnlyKey, unknown>;\n\nexport const commonProps = {\n ...elementProps,\n ...groupProps,\n ...pathProps,\n shape: Object as PropType<Record<string, unknown>>,\n style: Object as PropType<object>,\n shapeTransition: [String, Array] as PropType<string | string[]>,\n styleTransition: [String, Array] as PropType<string | string[]>,\n ...commonStyleProps,\n ...pathStyleProps,\n ...textStyleProps,\n ...imageStyleProps,\n} as const;\n\nexport const textPropOverrides = {\n width: [String, Number] as PropType<string | number>,\n fill: String,\n stroke: String,\n lineDash: withUndefinedDefault([Array, Boolean] as PropType<number[] | false>),\n} as const;\n\nexport type GraphicCommonProps = Omit<ExtractPublicPropTypes<typeof commonProps>, \"width\"> &\n Pick<ExtractPublicPropTypes<typeof textPropOverrides>, \"width\">;\n","import type { ExtractPublicPropTypes, PropType } from \"vue\";\n\nimport type { GraphicComponentType } from \"./component-type\";\nimport { withUndefinedDefault } from \"./props-common\";\n\nexport const SHAPE_KEYS_BY_TYPE = {\n rect: [\"x\", \"y\", \"width\", \"height\", \"r\"],\n circle: [\"cx\", \"cy\", \"r\"],\n ellipse: [\"cx\", \"cy\", \"rx\", \"ry\"],\n sector: [\"cx\", \"cy\", \"r\", \"r0\", \"startAngle\", \"endAngle\", \"clockwise\", \"cornerRadius\"],\n ring: [\"cx\", \"cy\", \"r\", \"r0\"],\n arc: [\"cx\", \"cy\", \"r\", \"startAngle\", \"endAngle\", \"clockwise\"],\n line: [\"x1\", \"y1\", \"x2\", \"y2\", \"percent\"],\n polyline: [\"points\", \"percent\", \"smooth\", \"smoothConstraint\"],\n polygon: [\"points\", \"smooth\", \"smoothConstraint\"],\n bezierCurve: [\"x1\", \"y1\", \"x2\", \"y2\", \"cpx1\", \"cpy1\", \"cpx2\", \"cpy2\", \"percent\"],\n} as const satisfies Partial<Record<GraphicComponentType, readonly string[]>>;\n\nexport const shapeProps = {\n x: Number,\n y: Number,\n cx: Number,\n cy: Number,\n rx: Number,\n ry: Number,\n r: [Number, Array] as PropType<number | number[]>,\n r0: Number,\n x1: Number,\n y1: Number,\n x2: Number,\n y2: Number,\n cpx1: Number,\n cpy1: Number,\n cpx2: Number,\n cpy2: Number,\n startAngle: Number,\n endAngle: Number,\n percent: Number,\n points: Array as PropType<number[][]>,\n smooth: Number,\n smoothConstraint: Array as PropType<number[][]>,\n clockwise: withUndefinedDefault(Boolean),\n cornerRadius: [Number, Array] as PropType<number | number[]>,\n} as const;\n\nexport type GraphicShapeProps = ExtractPublicPropTypes<typeof shapeProps>;\n","import type { ElementEvent } from \"echarts/core\";\nimport type { ElementEventAlias, WithOnce } from \"../types\";\n\nexport type GraphicEventName = Exclude<ElementEvent[\"type\"], \"globalout\">;\n\nexport const GRAPHIC_EVENTS = {\n click: true,\n dblclick: true,\n mousewheel: true,\n mouseout: true,\n mouseover: true,\n mouseup: true,\n mousedown: true,\n mousemove: true,\n contextmenu: true,\n drag: true,\n dragstart: true,\n dragend: true,\n dragenter: true,\n dragleave: true,\n dragover: true,\n drop: true,\n} as const satisfies Record<GraphicEventName, true>;\n\nexport type GraphicOnEventName = `on${GraphicEventName}`;\n\ntype GraphicEventAlias = Exclude<ElementEventAlias, \"globalOut\">;\n\nexport type GraphicEmits = WithOnce<{\n [key in GraphicEventName | GraphicEventAlias]: (params: ElementEvent) => boolean | void;\n}>;\n","import { createEventInvoker, hasEventHandler, parseOnEvent } from \"../utils\";\nimport type { EventHandler } from \"../utils\";\nimport {\n COMMON_PROP_KEYS,\n COMMON_STYLE_KEYS,\n DISPLAYABLE_PROP_KEYS,\n GROUP_PROP_KEYS,\n PATH_PROP_KEYS,\n PATH_STYLE_KEYS,\n STYLE_KEYS_BY_TYPE,\n TEXT_COMMON_STYLE_KEYS,\n} from \"./props-common\";\nimport { SHAPE_KEYS_BY_TYPE } from \"./props-shape\";\nimport type { GraphicNode } from \"./collector\";\nimport { GRAPHIC_EVENTS } from \"./types\";\n\nexport type GraphicElement = Record<string, unknown> & {\n type: string;\n id: string;\n children?: GraphicElement[];\n};\n\nfunction mergeProps(\n target: Record<string, unknown> | undefined,\n keys: readonly string[],\n props: Record<string, unknown>,\n): Record<string, unknown> | undefined {\n for (const key of keys) {\n const value = props[key];\n if (value !== undefined) {\n (target ??= {})[key] = value;\n }\n }\n return target;\n}\n\nfunction buildNestedProps(\n source: unknown,\n props: Record<string, unknown>,\n keys: readonly string[],\n transition: unknown,\n extraKeys?: readonly string[],\n): Record<string, unknown> | undefined {\n const nested = source as Record<string, unknown> | undefined;\n let result = nested && Object.keys(nested).length > 0 ? { ...nested } : undefined;\n result = mergeProps(result, keys, props);\n if (extraKeys) {\n result = mergeProps(result, extraKeys, props);\n }\n\n if (transition !== undefined) {\n (result ??= {}).transition = transition;\n }\n\n return result;\n}\n\nfunction toEventHandler(value: unknown, once: boolean): EventHandler | undefined {\n const invoke = createEventInvoker(value);\n if (!invoke || !once) {\n return invoke;\n }\n\n let called = false;\n return (...args: unknown[]): unknown => {\n if (called) {\n return;\n }\n called = true;\n return invoke(...args);\n };\n}\n\nfunction mergeHandlers(node: GraphicNode, target: Record<string, unknown>): void {\n const { handlers } = node;\n\n if (node.handlerCache) {\n for (const key of node.handlerCache.keys()) {\n if (!Object.hasOwn(handlers, key)) {\n node.handlerCache.delete(key);\n }\n }\n }\n\n for (const key of Object.keys(handlers)) {\n const value = handlers[key];\n const descriptor = parseOnEvent(key);\n if (!descriptor) {\n continue;\n }\n const event = descriptor.event.toLowerCase();\n if (!Object.hasOwn(GRAPHIC_EVENTS, event)) {\n continue;\n }\n\n const cached = node.handlerCache?.get(key);\n const reused = cached !== undefined && cached.source === value && hasEventHandler(value);\n const handler = reused ? cached.handler : toEventHandler(value, descriptor.once);\n if (!handler) {\n node.handlerCache?.delete(key);\n continue;\n }\n if (!reused) {\n (node.handlerCache ??= new Map()).set(key, { source: value, handler });\n }\n\n const eventKey = `on${event}`;\n const existing = target[eventKey] as EventHandler | undefined;\n if (!existing) {\n target[eventKey] = handler;\n continue;\n }\n\n target[eventKey] = (...args: unknown[]): unknown => {\n const result = existing(...args);\n return handler(...args) || result;\n };\n }\n}\n\nfunction toElement(node: GraphicNode, children?: GraphicElement[]): GraphicElement {\n const { type, id, props } = node;\n const shapeKeys: readonly string[] | undefined =\n SHAPE_KEYS_BY_TYPE[type as keyof typeof SHAPE_KEYS_BY_TYPE];\n const styleKeys: readonly string[] | undefined = shapeKeys\n ? PATH_STYLE_KEYS\n : STYLE_KEYS_BY_TYPE[type as keyof typeof STYLE_KEYS_BY_TYPE];\n const commonStyleKeys = type === \"text\" ? TEXT_COMMON_STYLE_KEYS : COMMON_STYLE_KEYS;\n const out: Record<string, unknown> = {\n type,\n id,\n };\n\n for (const key of COMMON_PROP_KEYS) {\n const value = props[key];\n if (value !== undefined && !shapeKeys?.includes(key) && !styleKeys?.includes(key)) {\n out[key] = value;\n }\n }\n if (shapeKeys) {\n mergeProps(out, PATH_PROP_KEYS, props);\n }\n\n mergeHandlers(node, out);\n\n if (type === \"group\") {\n mergeProps(out, GROUP_PROP_KEYS, props);\n if (children?.length) {\n out.children = children;\n }\n return out as GraphicElement;\n }\n\n mergeProps(out, DISPLAYABLE_PROP_KEYS, props);\n\n const shape = shapeKeys\n ? buildNestedProps(props.shape, props, shapeKeys, props.shapeTransition)\n : undefined;\n if (shape) {\n out.shape = shape;\n }\n\n const style = buildNestedProps(\n props.style,\n props,\n commonStyleKeys,\n props.styleTransition,\n styleKeys,\n );\n if (style) {\n out.style = style;\n }\n\n return out as GraphicElement;\n}\n\nexport function buildOption(\n nodes: Iterable<GraphicNode>,\n rootId: string,\n): { graphic: { elements: GraphicElement[] } } {\n const byParent = new Map<string | null, GraphicNode[]>();\n const occupiedRootIds = new Set<string>();\n\n for (const node of nodes) {\n occupiedRootIds.add(node.id);\n const list = byParent.get(node.parentId);\n if (list) {\n list.push(node);\n continue;\n }\n byParent.set(node.parentId, [node]);\n }\n\n while (occupiedRootIds.has(rootId)) {\n rootId += \"_\";\n }\n\n for (const list of byParent.values()) {\n list.sort((a, b) => a.order - b.order);\n }\n\n const childrenOf = (parentId: string | null): GraphicElement[] | undefined =>\n byParent.get(parentId)?.map((node) => {\n if (node.type !== \"group\") {\n return toElement(node);\n }\n return toElement(node, childrenOf(node.id));\n });\n\n return {\n graphic: {\n elements: [\n {\n type: \"group\",\n id: rootId,\n children: childrenOf(null) ?? [],\n },\n ],\n },\n };\n}\n","import { queuePostFlushCb } from \"vue\";\n\nimport { isIgnorableWatchChange, warn as coreWarn } from \"../utils\";\nimport type { EventHandler } from \"../utils\";\n\nexport type GraphicNode = {\n id: string;\n type: string;\n parentId: string | null;\n props: Record<string, unknown>;\n handlers: Record<string, unknown>;\n handlerCache?: Map<string, { source: unknown; handler: EventHandler }>;\n order: number;\n sourceId: number;\n element?: HTMLElement;\n version?: number;\n};\n\nexport type GraphicCollector = {\n beginPass: () => void;\n register: (node: GraphicRegisterNode) => void;\n unregister: (id: string, sourceId: number) => void;\n warn: (message: string, onceKey: string) => void;\n getNodes: () => Iterable<GraphicNode>;\n requestFlush: (id?: string, sourceId?: number) => void;\n cancelPendingFlush: () => void;\n setRoot: (root: HTMLElement | undefined) => void;\n dispose: () => void;\n};\n\ntype GraphicRegisterNode = Omit<GraphicNode, \"handlerCache\" | \"order\"> & {\n order?: number;\n};\n\nexport function createCollector(onFlush: () => void): GraphicCollector {\n const nodes = new Map<string, GraphicNode>();\n const seenInPass = new Map<string, number>();\n const warnedKeys = new Set<string>();\n\n let order = 0;\n let version = 0;\n let pending = false;\n let root: HTMLElement | undefined;\n let observer: MutationObserver | undefined;\n const byElement = new WeakMap<HTMLElement, GraphicNode>();\n let orderedIds: string[] = [];\n\n function syncOrder(): boolean {\n if (!root) {\n return false;\n }\n const ids: string[] = [];\n const walker = root.ownerDocument.createTreeWalker(root, 1);\n for (let element = walker.nextNode(); element; element = walker.nextNode()) {\n const node = byElement.get(element as HTMLElement);\n if (node && nodes.get(node.id) === node) {\n node.order = ids.length;\n ids.push(node.id);\n }\n }\n const changed =\n ids.length !== orderedIds.length || ids.some((id, index) => id !== orderedIds[index]);\n orderedIds = ids;\n return changed;\n }\n\n function setRoot(value: HTMLElement | undefined): void {\n observer?.disconnect();\n root = value;\n orderedIds = [];\n if (root) {\n // Wrapper components can move unchanged children without rerendering a G* component.\n observer = new MutationObserver(() => {\n if (syncOrder()) {\n requestFlush();\n }\n });\n observer.observe(root, { childList: true, subtree: true });\n }\n }\n\n function beginPass(): void {\n order = 0;\n seenInPass.clear();\n }\n\n function warn(message: string, onceKey: string): void {\n if (warnedKeys.has(onceKey)) {\n return;\n }\n warnedKeys.add(onceKey);\n coreWarn(message);\n }\n\n function register(node: GraphicRegisterNode): void {\n const seenSource = seenInPass.get(node.id);\n if (seenSource !== undefined && seenSource !== node.sourceId) {\n warn(\n `Duplicate graphic id \"${node.id}\" detected. Updates may be unstable.`,\n `duplicate-id:${node.id}`,\n );\n }\n\n const nextOrder = node.order ?? order;\n order = Math.max(order, nextOrder + 1);\n const existing = nodes.get(node.id);\n const sameSource = existing?.sourceId === node.sourceId;\n const unchanged =\n sameSource &&\n existing.type === node.type &&\n existing.parentId === node.parentId &&\n existing.props === node.props &&\n isIgnorableWatchChange(existing.handlers, node.handlers) &&\n existing.element === node.element &&\n (node.element !== undefined || existing.order === nextOrder);\n\n seenInPass.set(node.id, node.sourceId);\n // Props and attrs are stable proxies; their watcher covers value-only changes.\n if (unchanged) {\n return;\n }\n\n const registered = {\n ...node,\n handlerCache: sameSource ? existing?.handlerCache : undefined,\n order: nextOrder,\n version: ++version,\n };\n nodes.set(node.id, registered);\n if (node.element) {\n byElement.set(node.element, registered);\n }\n requestFlush();\n }\n\n function unregister(id: string, sourceId: number): void {\n const existing = nodes.get(id);\n if (!existing || existing.sourceId !== sourceId) {\n return;\n }\n nodes.delete(id);\n requestFlush();\n }\n\n function requestFlush(id?: string, sourceId?: number): void {\n const node = id === undefined ? undefined : nodes.get(id);\n if (node && node.sourceId === sourceId) {\n node.version = ++version;\n }\n if (pending) {\n return;\n }\n pending = true;\n queuePostFlushCb(() => {\n if (!pending) {\n return;\n }\n pending = false;\n beginPass();\n onFlush();\n });\n }\n\n function getNodes(): Iterable<GraphicNode> {\n syncOrder();\n return root ? orderedIds.map((id) => nodes.get(id)!) : nodes.values();\n }\n\n function dispose(): void {\n cancelPendingFlush();\n setRoot(undefined);\n nodes.clear();\n }\n\n function cancelPendingFlush(): void {\n pending = false;\n syncOrder();\n beginPass();\n }\n\n return {\n beginPass,\n register,\n unregister,\n warn,\n getNodes,\n requestFlush,\n cancelPendingFlush,\n setRoot,\n dispose,\n };\n}\n","import type { InjectionKey, Ref } from \"vue\";\n\nimport type { GraphicCollector } from \"./collector\";\n\nexport const GRAPHIC_COLLECTOR_KEY: InjectionKey<GraphicCollector> = Symbol(\n \"vue-echarts:graphic-collector\",\n);\nexport const GRAPHIC_PARENT_ID_KEY: InjectionKey<Ref<string | null>> = Symbol(\n \"vue-echarts:graphic-parent-id\",\n);\n","import {\n Teleport,\n defineComponent,\n getCurrentInstance,\n h,\n onBeforeMount,\n onMounted,\n provide,\n shallowRef,\n} from \"vue\";\n\nimport { isBrowser } from \"../utils\";\nimport type { GraphicCollector } from \"./collector\";\nimport { GRAPHIC_COLLECTOR_KEY, GRAPHIC_PARENT_ID_KEY } from \"./context\";\n\nexport const GraphicMount = defineComponent({\n name: \"GraphicMount\",\n props: {\n collector: {\n type: Object as () => GraphicCollector,\n required: true,\n },\n },\n setup(props, { slots }) {\n const instance = getCurrentInstance()!;\n const { collector } = props;\n const { beginPass } = collector;\n const detachedRoot = shallowRef<HTMLDivElement>();\n // A pre-existing vnode element means Vue is hydrating the empty SSR Teleport.\n const contentReady = shallowRef(isBrowser() && !instance.vnode.el);\n const parentId = shallowRef<string | null>(null);\n\n onBeforeMount(() => {\n // Keeping the target inside the host lets iframe adoption finish before child mounted hooks.\n const host = instance.parent?.subTree.el as HTMLElement | undefined;\n if (host) {\n const target = host.ownerDocument.createElement(\"div\");\n host.appendChild(target);\n detachedRoot.value = target;\n collector.setRoot(target);\n }\n });\n\n onMounted(() => {\n const ownerDocument = (instance.vnode.el as Node).ownerDocument!;\n const target = detachedRoot.value;\n target?.remove();\n if (target?.ownerDocument !== ownerDocument) {\n detachedRoot.value = ownerDocument.createElement(\"div\");\n collector.setRoot(detachedRoot.value);\n }\n contentReady.value = true;\n });\n\n provide(GRAPHIC_COLLECTOR_KEY, collector);\n provide(GRAPHIC_PARENT_ID_KEY, parentId);\n\n return () => {\n beginPass();\n const content = slots.default!();\n const target = detachedRoot.value;\n\n return h(\n Teleport,\n {\n to: target ?? \"body\",\n disabled: !target,\n },\n target && contentReady.value ? content : [],\n );\n };\n },\n});\n","import { h, onScopeDispose, onUpdated } from \"vue\";\nimport { use } from \"echarts/core\";\nimport { GraphicComponent } from \"echarts/components\";\nimport { buildOption, type GraphicElement } from \"./build\";\nimport { planUpdate, type Signature } from \"../update\";\nimport { createCollector } from \"./collector\";\nimport { GraphicMount } from \"./mount\";\nimport { registerRuntime } from \"./runtime\";\n\nconst ROOT_ID = \"__ve_graphic_root__\";\n\nexport function registerExtension(): void {\n use([GraphicComponent]);\n\n registerRuntime((ctx) => {\n const { slots, manualUpdate, requestUpdate } = ctx;\n const collector = createCollector(handleFlush);\n let hasGraphicSlot = Boolean(slots.graphic);\n let signature: Signature | undefined;\n let versions = new Map<string, number | undefined>();\n\n function handleFlush(): void {\n if (manualUpdate.value) {\n const nodes = Array.from(collector.getNodes());\n const changed =\n !slots.graphic ||\n nodes.length !== versions.size ||\n nodes.some((node) => versions.get(node.id) !== node.version);\n if (!signature || !changed) {\n return;\n }\n collector.warn(\n \"`#graphic` slot updates are ignored when `manual-update` is `true`.\",\n \"manual-update-graphic\",\n );\n return;\n }\n requestUpdate();\n }\n\n onScopeDispose(collector.dispose);\n onUpdated(() => {\n const nextHasGraphicSlot = Boolean(slots.graphic);\n if (nextHasGraphicSlot === hasGraphicSlot) {\n return;\n }\n hasGraphicSlot = nextHasGraphicSlot;\n if (!hasGraphicSlot) {\n collector.cancelPendingFlush();\n }\n handleFlush();\n });\n\n return {\n cancelPendingFlush: collector.cancelPendingFlush,\n prepare(option, reset) {\n hasGraphicSlot = Boolean(slots.graphic);\n collector.cancelPendingFlush();\n if (!hasGraphicSlot) {\n return {\n option,\n replace: false,\n commit: () => {\n signature = undefined;\n versions.clear();\n },\n };\n }\n if (option.graphic) {\n collector.warn(\n \"`#graphic` slot is provided, so `option.graphic` is ignored. Remove one of them to avoid ambiguity.\",\n \"option-graphic-override\",\n );\n }\n const nodes = Array.from(collector.getNodes());\n const nextOption = buildOption(nodes, ROOT_ID);\n const planned = planUpdate(signature, nextOption);\n const replace =\n reset ||\n !signature ||\n planned.plan.notMerge ||\n Boolean(planned.plan.replaceMerge?.length);\n const nextVersions = new Map(nodes.map((node) => [node.id, node.version]));\n const elements: GraphicElement[] = [];\n function collectChanges(element: GraphicElement, parentId?: string): void {\n const { children, ...props } = element;\n if (\n nextVersions.has(element.id) &&\n nextVersions.get(element.id) !== versions.get(element.id)\n ) {\n elements.push({ ...props, parentId });\n }\n children?.forEach((child) => collectChanges(child, element.id));\n }\n if (!replace) {\n nextOption.graphic.elements.forEach((element) => collectChanges(element));\n }\n const patched = { ...option };\n delete patched.graphic;\n if (replace || elements.length) {\n patched.graphic = replace ? nextOption.graphic : { elements };\n }\n return {\n option: patched,\n replace,\n commit: () => {\n signature = planned.signature;\n versions = nextVersions;\n },\n };\n },\n render() {\n if (!slots.graphic) {\n return null;\n }\n return h(GraphicMount, { collector }, { default: slots.graphic });\n },\n };\n });\n}\n","export function resolveIdentity(\n propsId: string | number | undefined,\n vnodeKey: PropertyKey | null | undefined,\n uid: number,\n): string {\n if (propsId != null) {\n return String(propsId);\n }\n // Vue distinguishes numeric and string keys, while ECharts stringifies IDs.\n return typeof vnodeKey === \"string\" ? vnodeKey : `__ve_graphic_${uid}`;\n}\n","import {\n defineComponent,\n getCurrentInstance,\n h,\n inject,\n onBeforeUnmount,\n provide,\n shallowRef,\n type Slot,\n type SlotsType,\n watch,\n} from \"vue\";\n\nimport type { PublicComponent } from \"../types\";\nimport { warn } from \"../utils\";\nimport { GRAPHIC_COLLECTOR_KEY, GRAPHIC_PARENT_ID_KEY } from \"./context\";\nimport { resolveIdentity } from \"./identity\";\nimport type { GraphicComponentType } from \"./component-type\";\nimport {\n COMMON_PROP_KEYS,\n COMMON_STYLE_KEYS,\n DISPLAYABLE_PROP_KEYS,\n GROUP_PROP_KEYS,\n PATH_PROP_KEYS,\n PATH_STYLE_KEYS,\n STYLE_KEYS_BY_TYPE,\n TEXT_COMMON_STYLE_KEYS,\n commonProps,\n textPropOverrides,\n} from \"./props-common\";\nimport type {\n GraphicCommonPropKey,\n GraphicCommonStyleKey,\n GraphicDisplayablePropKey,\n GraphicGroupPropKey,\n GraphicImageStyleKey,\n GraphicPathPropKey,\n GraphicPathStyleKey,\n GraphicTextAttachmentPropKey,\n GraphicTextCommonStyleKey,\n GraphicTextStyleKey,\n} from \"./props-common\";\nimport { SHAPE_KEYS_BY_TYPE, shapeProps } from \"./props-shape\";\nimport type { GraphicEmits } from \"./types\";\n\nconst componentProps = {\n ...commonProps,\n ...shapeProps,\n} as const;\n\nfunction getRuntimeProps(type: GraphicComponentType) {\n const keys: Array<keyof typeof componentProps> = COMMON_PROP_KEYS.filter(\n (key) => type !== \"text\" || (key !== \"textContent\" && key !== \"textConfig\"),\n );\n if (type === \"group\") {\n keys.push(...GROUP_PROP_KEYS);\n } else {\n const shapeKeys = SHAPE_KEYS_BY_TYPE[type as keyof typeof SHAPE_KEYS_BY_TYPE];\n const styleKeys = shapeKeys\n ? PATH_STYLE_KEYS\n : STYLE_KEYS_BY_TYPE[type as keyof typeof STYLE_KEYS_BY_TYPE];\n const commonStyleKeys = type === \"text\" ? TEXT_COMMON_STYLE_KEYS : COMMON_STYLE_KEYS;\n keys.push(\n \"style\",\n \"styleTransition\",\n ...DISPLAYABLE_PROP_KEYS,\n ...commonStyleKeys,\n ...styleKeys,\n );\n if (shapeKeys) {\n keys.push(\"shape\", \"shapeTransition\", ...PATH_PROP_KEYS, ...shapeKeys);\n }\n }\n const definitions =\n type === \"text\"\n ? { ...componentProps, ...textPropOverrides }\n : { ...componentProps, r: type === \"rect\" ? componentProps.r : Number };\n return Object.fromEntries(keys.map((key) => [key, definitions[key]]));\n}\n\ntype NestedShapePropKey = \"shape\" | \"shapeTransition\";\ntype NestedStylePropKey = \"style\" | \"styleTransition\";\ntype SharedPropKey<T extends GraphicComponentType> = Exclude<\n GraphicCommonPropKey,\n T extends \"text\" ? GraphicTextAttachmentPropKey : never\n>;\ntype StylePropKey<T extends GraphicComponentType> = T extends \"group\"\n ? never\n :\n | NestedStylePropKey\n | (T extends \"text\" ? GraphicTextCommonStyleKey : GraphicCommonStyleKey)\n | (T extends keyof typeof SHAPE_KEYS_BY_TYPE\n ? GraphicPathStyleKey\n : T extends \"text\"\n ? GraphicTextStyleKey\n : T extends \"image\"\n ? GraphicImageStyleKey\n : never);\ntype PathPropKey<T extends GraphicComponentType> = T extends keyof typeof SHAPE_KEYS_BY_TYPE\n ? NestedShapePropKey | GraphicPathPropKey | (typeof SHAPE_KEYS_BY_TYPE)[T][number]\n : never;\ntype GroupPropKey<T extends GraphicComponentType> = T extends \"group\" ? GraphicGroupPropKey : never;\ntype DisplayablePropKey<T extends GraphicComponentType> = T extends \"group\"\n ? never\n : GraphicDisplayablePropKey;\ntype ComponentPropDefinitions<T extends GraphicComponentType> = T extends \"text\"\n ? Omit<typeof componentProps, keyof typeof textPropOverrides> & typeof textPropOverrides\n : T extends \"rect\"\n ? typeof componentProps\n : Omit<typeof componentProps, \"r\"> & { r: NumberConstructor };\ntype ComponentProps<T extends GraphicComponentType> = Pick<\n ComponentPropDefinitions<T>,\n Extract<\n SharedPropKey<T> | GroupPropKey<T> | DisplayablePropKey<T> | PathPropKey<T> | StylePropKey<T>,\n keyof typeof componentProps\n >\n>;\ntype ComponentSlots<T extends GraphicComponentType> = SlotsType<\n T extends \"group\" ? { default?: Slot } : Record<never, never>\n>;\n\n/* @__NO_SIDE_EFFECTS__ */\nexport function createComponent<T extends GraphicComponentType>(\n name: string,\n type: T,\n): GraphicComponent<T> {\n return defineComponent({\n name,\n inheritAttrs: false,\n props: getRuntimeProps(type) as ComponentProps<T>,\n emits: {} as unknown as GraphicEmits,\n setup(props, { attrs, slots }) {\n const instance = getCurrentInstance()!;\n const collector = inject(GRAPHIC_COLLECTOR_KEY, null);\n const parentIdRef = inject(GRAPHIC_PARENT_ID_KEY, null);\n\n if (!collector) {\n warn(`\\`${name}\\` must be used inside \\`#graphic\\` slot.`);\n return () => null;\n }\n const { register: registerNode, unregister, requestFlush } = collector;\n let currentId: string | null = null;\n let element: HTMLElement | undefined;\n\n watch([props, () => attrs], () => requestFlush(currentId ?? undefined, instance.uid), {\n deep: true,\n });\n\n function register(): string {\n const id = resolveIdentity(\n (props as { id?: string | number }).id,\n instance.vnode.key,\n instance.uid,\n );\n if (currentId !== null && currentId !== id) {\n unregister(currentId, instance.uid);\n }\n currentId = id;\n\n if (element) {\n registerNode({\n id,\n type,\n parentId: parentIdRef!.value,\n element,\n props: props as Record<string, unknown>,\n handlers: { ...attrs },\n sourceId: instance.uid,\n });\n }\n return id;\n }\n\n const setElement = (value: unknown): void => {\n if (value === element) {\n return;\n }\n element = (value as HTMLElement | null) ?? undefined;\n if (element) {\n register();\n }\n };\n onBeforeUnmount(() => unregister(currentId!, instance.uid));\n\n if (type === \"group\") {\n const providedParent = shallowRef<string | null>(null);\n provide(GRAPHIC_PARENT_ID_KEY, providedParent);\n\n return () => {\n providedParent.value = register();\n const content = (slots as { default?: Slot }).default?.() ?? [];\n return h(\"div\", { ref: setElement }, content);\n };\n }\n\n return () => {\n register();\n return h(\"div\", { ref: setElement });\n };\n },\n }) as GraphicComponent<T>;\n}\n\nexport type GraphicComponent<T extends GraphicComponentType> = PublicComponent<\n ComponentProps<T>,\n Record<never, never>,\n GraphicEmits,\n ComponentSlots<T>\n>;\n","import { createComponent, type GraphicComponent } from \"./component-factory\";\n\nexport const GGroup: GraphicComponent<\"group\"> = createComponent(\"GGroup\", \"group\");\nexport const GRect: GraphicComponent<\"rect\"> = createComponent(\"GRect\", \"rect\");\nexport const GCircle: GraphicComponent<\"circle\"> = createComponent(\"GCircle\", \"circle\");\nexport const GEllipse: GraphicComponent<\"ellipse\"> = createComponent(\"GEllipse\", \"ellipse\");\nexport const GText: GraphicComponent<\"text\"> = createComponent(\"GText\", \"text\");\nexport const GLine: GraphicComponent<\"line\"> = createComponent(\"GLine\", \"line\");\nexport const GPolyline: GraphicComponent<\"polyline\"> = createComponent(\"GPolyline\", \"polyline\");\nexport const GPolygon: GraphicComponent<\"polygon\"> = createComponent(\"GPolygon\", \"polygon\");\nexport const GImage: GraphicComponent<\"image\"> = createComponent(\"GImage\", \"image\");\nexport const GSector: GraphicComponent<\"sector\"> = createComponent(\"GSector\", \"sector\");\nexport const GRing: GraphicComponent<\"ring\"> = createComponent(\"GRing\", \"ring\");\nexport const GArc: GraphicComponent<\"arc\"> = createComponent(\"GArc\", \"arc\");\nexport const GBezierCurve: GraphicComponent<\"bezierCurve\"> = createComponent(\n \"GBezierCurve\",\n \"bezierCurve\",\n);\n","import { registerExtension } from \"./extension\";\n\nregisterExtension();\n\nexport type { VChartSlotsExtension } from \"../index\";\nexport type { GraphicEmits, GraphicEventName, GraphicOnEventName } from \"./types\";\nexport type { GraphicCommonProps } from \"./props-common\";\nexport type { GraphicShapeProps } from \"./props-shape\";\n\nexport {\n GGroup,\n GRect,\n GCircle,\n GEllipse,\n GText,\n GLine,\n GPolyline,\n GPolygon,\n GImage,\n GSector,\n GRing,\n GArc,\n GBezierCurve,\n} from \"./components\";\n"],"mappings":";;;;AAiBA,MAAa,mBAAmB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,GA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