@visactor/vchart 2.0.1-alpha.1 → 2.0.1-alpha.2

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,"sources":["../src/component/player/player.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAK/C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEjG,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAW3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,8BAA8B,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,6CAA6C,CAAC;AAErE,MAAM,OAAO,MAAO,SAAQ,aAAsB;IAAlD;;QACE,iBAAY,GAAW,YAAY,CAAC,MAAM,CAAC;QAC3C,gBAAW,GAAW,WAAW,CAAC,MAAM,CAAC;QAOzC,YAAO,GAAW,QAAQ,CAAC;QAG3B,SAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC;QACtB,YAAO,GAAgB,QAAQ,CAAC;QA+ElC,oBAAe,GAAG,GAAG,EAAE;;YAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YAC7B,MAAM,WAAW,GAAG;gBAClB,IAAI,EAAE;oBACJ,KAAK,EAAE,IAAI,CAAC,MAAM;oBAClB,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C;IAKO,UAAU,CAAC,IAAiB;QAElC,IAAI,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;YAC9B,OAAO,CAAC,CAAC;SACV;QAGD,IAAI,IAAI,CAAC,SAAS,KAAK,OAAO,EAAE;YAC9B,OAAO,CAAC,CAAC;SACV;aAEI,IAAI,IAAI,CAAC,SAAS,KAAK,QAAQ,EAAE;YACpC,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;SACzC;QAGD,OAAO,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;IACpC,CAAC;IAiCD,iBAAiB,CAAC,KAAa;QAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEhC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,cAAc,CAAE,IAAY,CAAC,IAAI,CAAC,CAAC;QAE/D,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE;YACvC,KAAK,EAAE,IAAI;YACX,KAAK,EAAE;gBACL,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,IAAI,CAAC,MAAM;aACnB;SACF,CAAC,CAAC;IACL,CAAC;;AAlSe,mBAAY,GAAG;IAC7B,MAAM;CACP,CAAC;AAEK,cAAO,GAAG,QAAQ,CAAC;AAGnB,WAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC;AA+XzC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACjD,CAAC,CAAC","file":"player.js","sourcesContent":["import { Factory } from './../../core/factory';\nimport type { INode, IGroup, IGraphic } from '@visactor/vrender-core';\nimport type { ContinuousPlayerAttributes, DiscretePlayerAttributes } from '@visactor/vrender-components';\n\n// eslint-disable-next-line no-duplicate-imports\nimport { DiscretePlayer, ContinuousPlayer, PlayerEventEnum } from '@visactor/vrender-components';\n// eslint-disable-next-line no-duplicate-imports\nimport { isNumber, array, isEqual, isValidNumber } from '@visactor/vutils';\n\nimport type { IModelRenderOption } from '../../model/interface';\nimport type { IRegion } from '../../region/interface';\n\nimport type { DirectionType, IPlayer } from './interface';\n// eslint-disable-next-line no-duplicate-imports\nimport type { IComponent } from '../interface';\nimport type { IPoint, IOrientType, ILayoutRect, IChartSpec, IDataValues } from '../../typings';\n\n// eslint-disable-next-line no-duplicate-imports\nimport { ComponentTypeEnum } from '../interface/type';\nimport { BaseComponent } from '../base/base-component';\nimport { transformContinuousSpecToAttrs, transformDiscreteSpecToAttrs } from './utils/transform';\nimport { isHorizontal, isVertical } from './utils/orient';\nimport { LayoutLevel, LayoutZIndex } from '../../constant/layout';\nimport { ChartEvent } from '../../constant/event';\nimport { player } from '../../theme/builtin/common/component/player';\n\nexport class Player extends BaseComponent<IPlayer> implements IComponent {\n layoutZIndex: number = LayoutZIndex.Player;\n layoutLevel: number = LayoutLevel.Player;\n\n static readonly builtInTheme = {\n player\n };\n\n static specKey = 'player';\n specKey: string = 'player';\n\n static type = ComponentTypeEnum.player;\n type = ComponentTypeEnum.player;\n protected _orient: IOrientType = 'bottom';\n private _specs: Partial<IChartSpec>[];\n\n private _playerComponent: DiscretePlayer | ContinuousPlayer;\n private _cacheAttrs: ContinuousPlayerAttributes | DiscretePlayerAttributes;\n\n private _visible: boolean;\n private _direction: DirectionType;\n private _alternate: boolean;\n private _dx: number;\n private _dy: number;\n private _width: number;\n private _height: number;\n private _position: 'start' | 'middle' | 'end';\n\n get orient() {\n return this._orient;\n }\n\n set layoutOrient(v: IOrientType) {\n this._orient = v;\n }\n\n /**\n * 设置Attr\n */\n setAttrFromSpec() {\n super.setAttrFromSpec();\n this._orient = this._spec.orient ?? 'bottom';\n this._specs = this._spec.specs ?? [];\n this._direction = this._spec.direction ?? 'default';\n this._alternate = this._spec.alternate ?? false;\n this._dx = this._spec.dx ?? 0;\n this._dy = this._spec.dy ?? 0;\n this._position = this._spec.position ?? 'middle';\n this._visible = this._spec.visible ?? true;\n }\n\n /**\n * 计算组件位置(布局的左上角起点)\n * @param pos\n */\n afterSetLayoutStartPoint(pos: IPoint) {\n super.afterSetLayoutStartPoint(pos);\n if (isValidNumber(pos.x)) {\n const offsetX = isVertical(this._orient) ? pos.x + this._sliderExceededSize() / 2 : pos.x;\n this._playerComponent && this._playerComponent.setAttribute('x', offsetX);\n }\n if (isValidNumber(pos.y)) {\n const offsetY = isHorizontal(this._orient) ? pos.y + this._sliderExceededSize() / 2 : pos.y;\n this._playerComponent && this._playerComponent.setAttribute('y', offsetY);\n }\n }\n\n /**\n * 计算组件占用的bound box\n * @param rect\n * @returns\n */\n getBoundsInRect(rect: ILayoutRect, fullSpace: ILayoutRect) {\n this._width = this._computeWidth(rect);\n this._height = this._computeHeight(rect);\n this._dx = this._computeDx(fullSpace);\n this._dy = this._computeDy(fullSpace);\n\n const bounds = this._computeLayoutRect(rect, this._width, this._height);\n\n this._createOrUpdatePlayerComponent();\n\n return bounds;\n }\n\n protected _getNeedClearVRenderComponents(): IGraphic[] {\n return [this._playerComponent] as unknown as IGroup[];\n }\n\n /**\n * 播放器属性\n */\n private _getPlayerAttrs = () => {\n const type = this._spec.type;\n const layoutAttrs = {\n size: {\n width: this._width,\n height: this._height\n },\n dx: this._spec.dx ?? 0 + this._dx,\n dy: this._spec.dy ?? 0 + this._dy\n };\n // 离散类型Attrs\n if (type === 'discrete') {\n return {\n ...transformDiscreteSpecToAttrs(this._spec, this._specs),\n ...layoutAttrs,\n disableTriggerEvent: this._option.disableTriggerEvent,\n loop: this._spec?.loop ?? true\n };\n }\n // 连续类型Attrs\n return {\n ...transformContinuousSpecToAttrs(this._spec, this._specs),\n ...layoutAttrs,\n disableTriggerEvent: this._option.disableTriggerEvent,\n loop: this._spec?.loop ?? true\n };\n };\n\n /**\n * 创建或更新播放器组件\n */\n private _createOrUpdatePlayerComponent = () => {\n const attrs = { ...this._getPlayerAttrs() };\n const container = this.getContainer();\n if (this._playerComponent) {\n if (!isEqual(attrs, this._cacheAttrs)) {\n this._cacheAttrs = attrs;\n this._playerComponent.setAttributes(attrs);\n // FIXME: player 组件没有重写 setAttributes 方法,因此不能正常更新样式。以下两句模拟执行了 setAttributes 方法,但是应在 vrender-component 的后续版本中实现 setAttributes 方法\n this._playerComponent._initAttributes();\n this._playerComponent.render();\n }\n } else {\n if (attrs.type === 'discrete') {\n this._playerComponent = new DiscretePlayer(attrs);\n } else {\n this._playerComponent = new ContinuousPlayer(attrs);\n }\n\n this._cacheAttrs = attrs;\n this._playerComponent.name = `player`;\n\n container.add(this._playerComponent as unknown as INode);\n\n this._initEvent();\n }\n };\n\n /**\n * 计算起点\n */\n private _computeLayoutRect(rect: ILayoutRect, width: number, height: number) {\n // don't set bounds when player hidden\n if (this._visible === false) {\n return { x1: 0, x2: 0, y1: 0, y2: 0 };\n }\n // set bounds by 4 kinds of orient\n switch (this._orient) {\n case 'top': {\n return { x1: 0, y1: 0, x2: width, y2: height };\n }\n case 'right': {\n return { x1: rect.width - width, y1: 0, x2: rect.width, y2: rect.height };\n }\n case 'left': {\n return { x1: 0, y1: 0, x2: width, y2: height };\n }\n case 'bottom':\n default: {\n return { x1: 0, y1: rect.height - height, x2: rect.width, y2: rect.height };\n }\n }\n }\n\n /**\n * 计算组件宽度\n */\n private _computeWidth(rect: ILayoutRect) {\n // 若设置的是数值则直接返回\n if (isNumber(this._spec.width)) {\n return Math.min(rect.width, Number(this._spec.width));\n }\n\n if (isVertical(this._orient)) {\n return this._maxSize();\n }\n return rect.width;\n }\n\n /**\n * 计算组件高度\n */\n private _computeHeight(rect: ILayoutRect) {\n // 若设置的是数值则直接返回\n if (isNumber(this._spec.height)) {\n this._height = this._spec.height;\n return Math.min(rect.height, Number(this._spec.height));\n }\n\n if (isHorizontal(this._orient)) {\n return this._maxSize();\n }\n return rect.height;\n }\n\n /**\n * 计算x方向的偏移, 用于实现对齐\n */\n private _computeDx(rect: ILayoutRect) {\n // 垂直时, x不偏移\n if (isVertical(this._orient)) {\n return 0;\n }\n\n // start\n if (this._position === 'start') {\n return 0;\n }\n // middle\n else if (this._position === 'middle') {\n return (rect.width - this._width) / 2;\n }\n // end\n return rect.width - this._width;\n }\n\n /**\n * 计算y方向的偏移, 用于实现对齐\n */\n private _computeDy(rect: ILayoutRect) {\n // 水平时, y不偏移\n if (isHorizontal(this._orient)) {\n return 0;\n }\n\n // start\n if (this._position === 'start') {\n return 0;\n }\n // middle\n else if (this._position === 'middle') {\n return (rect.height - this._height) / 2;\n }\n\n // end\n return rect.height - this._height;\n }\n\n /**\n * 播放器宽度取计算子组件中最高的一个\n */\n private _maxSize = () => {\n return Math.max(\n ...array(this._spec.controller.start?.style?.size),\n ...array(this._spec.controller.pause?.style?.size),\n ...array(this._spec.controller.backward?.style?.size),\n ...array(this._spec.controller.forward?.style?.size),\n (isVertical(this._orient) ? this._spec.slider.railStyle.width : this._spec.slider.railStyle.height) ?? 10\n );\n };\n\n /**\n * 滑动条超过按钮的高度\n */\n private _sliderExceededSize = () => {\n const sliderHeight =\n (isVertical(this._orient) ? this._spec.slider.railStyle.width : this._spec.slider.railStyle.height) ?? 10;\n const controllersHeight = Math.max(\n ...array(this._spec.controller.start?.style?.size),\n ...array(this._spec.controller.pause?.style?.size),\n ...array(this._spec.controller.backward?.style?.size),\n ...array(this._spec.controller.forward?.style?.size)\n );\n if (sliderHeight >= controllersHeight) {\n return sliderHeight - controllersHeight;\n }\n return 0;\n };\n\n changePlayerIndex(index: number) {\n const spec = this._specs[index];\n\n this._option.globalInstance.updateFullData((spec as any).data);\n\n this.event.emit(ChartEvent.playerChange, {\n model: this,\n value: {\n spec: spec,\n index: index,\n specs: this._specs\n }\n });\n }\n\n /**\n * 事件\n */\n private _initEvent = () => {\n if (this._option.disableTriggerEvent) {\n return;\n }\n // 自动播放\n this._option.globalInstance.on(ChartEvent.rendered, () => {\n if (this._spec?.auto) {\n this._playerComponent.play();\n }\n });\n\n // 循环播放 与 交替方向\n this._playerComponent.addEventListener(PlayerEventEnum.end, () => {\n this.event.emit(ChartEvent.playerEnd, { model: this });\n\n // 交替方向, 仅离散轴支持\n if (this._alternate && this._spec.type === 'discrete') {\n this._direction = this._direction === 'default' ? 'reverse' : 'default';\n this._playerComponent.setAttributes({\n direction: this._direction,\n dataIndex: this._direction === 'reverse' ? this._specs.length - 2 : 1\n });\n }\n\n // 循环播放\n if (this._spec?.loop) {\n this._playerComponent.play();\n }\n });\n\n // 数据更新\n this._playerComponent.addEventListener(PlayerEventEnum.change, (e: { detail: { index: number } }) => {\n // 更新data\n const { index } = e.detail;\n this.changePlayerIndex(index);\n });\n\n // 后退\n this._playerComponent.addEventListener(PlayerEventEnum.backward, (e: { detail: { index: number } }) => {\n const { index } = e.detail;\n const spec = this._specs[index];\n this.event.emit(ChartEvent.playerBackward, {\n model: this,\n value: {\n spec: spec,\n index: index,\n specs: this._specs\n }\n });\n });\n\n // 前进\n this._playerComponent.addEventListener(PlayerEventEnum.forward, (e: { detail: { index: number } }) => {\n const { index } = e.detail;\n const spec = this._specs[index];\n this.event.emit(ChartEvent.playerForward, {\n model: this,\n value: {\n spec: spec,\n index: index,\n specs: this._specs\n }\n });\n });\n\n // 播放\n this._playerComponent.addEventListener(PlayerEventEnum.play, (e: { detail: { index: number } }) => {\n const { index } = e.detail;\n const spec = this._specs[index];\n this.event.emit(ChartEvent.playerPlay, {\n model: this,\n value: {\n spec: spec,\n index: index,\n specs: this._specs\n }\n });\n });\n\n // 暂停\n this._playerComponent.addEventListener(PlayerEventEnum.pause, (e: { detail: { index: number } }) => {\n const { index } = e.detail;\n const spec = this._specs[index];\n this.event.emit(ChartEvent.playerPause, {\n model: this,\n value: {\n spec: spec,\n index: index,\n specs: this._specs\n }\n });\n });\n };\n}\n\nexport const registerPlayer = () => {\n Factory.registerComponent(Player.type, Player);\n};\n"]}
1
+ {"version":3,"sources":["../src/component/player/player.ts"],"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AI,IAAI,CAAC,SAAS,KAAK,OAAO,EAAE;YAC9B,OAAO,CAAC,CAAC;SACV;aAEI,IAAI,IAAI,CAAC,SAAS,KAAK,QAAQ,EAAE;YACpC,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;SACzC;QAGD,OAAO,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;IACpC,CAAC;IAiCD,iBAAiB,CAAC,KAAa;QAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEhC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,cAAc,CAAE,IAAY,CAAC,IAAI,CAAC,CAAC;QAE/D,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE;YACvC,KAAK,EAAE,IAAI;YACX,KAAK,EAAE;gBACL,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,IAAI,CAAC,MAAM;aACnB;SACF,CAAC,CAAC;IACL,CAAC;;AAlSe,mBAAY,GAAG;IAC7B,MAAM;CACP,CAAC;AAEK,cAAO,GAAG,QAAQ,CAAC;AAGnB,WAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC;AAgYzC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACjD,CAAC,CAAC","file":"player.js","sourcesContent":["import { Factory } from './../../core/factory';\nimport type { INode, IGroup, IGraphic } from '@visactor/vrender-core';\nimport type { ContinuousPlayerAttributes, DiscretePlayerAttributes } from '@visactor/vrender-components';\n\n// eslint-disable-next-line no-duplicate-imports\nimport { DiscretePlayer, ContinuousPlayer, PlayerEventEnum } from '@visactor/vrender-components';\n// eslint-disable-next-line no-duplicate-imports\nimport { isNumber, array, isEqual, isValidNumber } from '@visactor/vutils';\n\nimport type { IModelRenderOption } from '../../model/interface';\nimport type { IRegion } from '../../region/interface';\n\nimport type { DirectionType, IPlayer } from './interface';\n// eslint-disable-next-line no-duplicate-imports\nimport type { IComponent } from '../interface';\nimport type { IPoint, IOrientType, ILayoutRect, IChartSpec, IDataValues } from '../../typings';\n\n// eslint-disable-next-line no-duplicate-imports\nimport { ComponentTypeEnum } from '../interface/type';\nimport { BaseComponent } from '../base/base-component';\nimport { transformContinuousSpecToAttrs, transformDiscreteSpecToAttrs } from './utils/transform';\nimport { isHorizontal, isVertical } from './utils/orient';\nimport { LayoutLevel, LayoutZIndex } from '../../constant/layout';\nimport { ChartEvent } from '../../constant/event';\nimport { player } from '../../theme/builtin/common/component/player';\n\nexport class Player extends BaseComponent<IPlayer> implements IComponent {\n layoutZIndex: number = LayoutZIndex.Player;\n layoutLevel: number = LayoutLevel.Player;\n\n static readonly builtInTheme = {\n player\n };\n\n static specKey = 'player';\n specKey: string = 'player';\n\n static type = ComponentTypeEnum.player;\n type = ComponentTypeEnum.player;\n protected _orient: IOrientType = 'bottom';\n private _specs: Partial<IChartSpec>[];\n\n private _playerComponent: DiscretePlayer | ContinuousPlayer;\n private _cacheAttrs: ContinuousPlayerAttributes | DiscretePlayerAttributes;\n\n private _visible: boolean;\n private _direction: DirectionType;\n private _alternate: boolean;\n private _dx: number;\n private _dy: number;\n private _width: number;\n private _height: number;\n private _position: 'start' | 'middle' | 'end';\n\n get orient() {\n return this._orient;\n }\n\n set layoutOrient(v: IOrientType) {\n this._orient = v;\n }\n\n /**\n * 设置Attr\n */\n setAttrFromSpec() {\n super.setAttrFromSpec();\n this._orient = this._spec.orient ?? 'bottom';\n this._specs = this._spec.specs ?? [];\n this._direction = this._spec.direction ?? 'default';\n this._alternate = this._spec.alternate ?? false;\n this._dx = this._spec.dx ?? 0;\n this._dy = this._spec.dy ?? 0;\n this._position = this._spec.position ?? 'middle';\n this._visible = this._spec.visible ?? true;\n }\n\n /**\n * 计算组件位置(布局的左上角起点)\n * @param pos\n */\n afterSetLayoutStartPoint(pos: IPoint) {\n super.afterSetLayoutStartPoint(pos);\n if (isValidNumber(pos.x)) {\n const offsetX = isVertical(this._orient) ? pos.x + this._sliderExceededSize() / 2 : pos.x;\n this._playerComponent && this._playerComponent.setAttribute('x', offsetX);\n }\n if (isValidNumber(pos.y)) {\n const offsetY = isHorizontal(this._orient) ? pos.y + this._sliderExceededSize() / 2 : pos.y;\n this._playerComponent && this._playerComponent.setAttribute('y', offsetY);\n }\n }\n\n /**\n * 计算组件占用的bound box\n * @param rect\n * @returns\n */\n getBoundsInRect(rect: ILayoutRect, fullSpace: ILayoutRect) {\n this._width = this._computeWidth(rect);\n this._height = this._computeHeight(rect);\n this._dx = this._computeDx(fullSpace);\n this._dy = this._computeDy(fullSpace);\n\n const bounds = this._computeLayoutRect(rect, this._width, this._height);\n\n this._createOrUpdatePlayerComponent();\n\n return bounds;\n }\n\n protected _getNeedClearVRenderComponents(): IGraphic[] {\n return [this._playerComponent] as unknown as IGroup[];\n }\n\n /**\n * 播放器属性\n */\n private _getPlayerAttrs = () => {\n const type = this._spec.type;\n const layoutAttrs = {\n size: {\n width: this._width,\n height: this._height\n },\n dx: this._spec.dx ?? 0 + this._dx,\n dy: this._spec.dy ?? 0 + this._dy\n };\n // 离散类型Attrs\n if (type === 'discrete') {\n return {\n ...transformDiscreteSpecToAttrs(this._spec, this._specs),\n ...layoutAttrs,\n disableTriggerEvent: this._option.disableTriggerEvent,\n loop: this._spec?.loop ?? true\n };\n }\n // 连续类型Attrs\n return {\n ...transformContinuousSpecToAttrs(this._spec, this._specs),\n ...layoutAttrs,\n disableTriggerEvent: this._option.disableTriggerEvent,\n loop: this._spec?.loop ?? true\n };\n };\n\n /**\n * 创建或更新播放器组件\n */\n private _createOrUpdatePlayerComponent = () => {\n const attrs = { ...this._getPlayerAttrs() };\n const container = this.getContainer();\n if (this._playerComponent) {\n if (!isEqual(attrs, this._cacheAttrs)) {\n this._cacheAttrs = attrs;\n this._playerComponent.setAttributes(attrs);\n // FIXME: player 组件没有重写 setAttributes 方法,因此不能正常更新样式。以下两句模拟执行了 setAttributes 方法,但是应在 vrender-component 的后续版本中实现 setAttributes 方法\n this._playerComponent._initAttributes();\n this._playerComponent.render();\n }\n } else {\n if (attrs.type === 'discrete') {\n this._playerComponent = new DiscretePlayer(attrs);\n } else {\n this._playerComponent = new ContinuousPlayer(attrs);\n }\n\n this._cacheAttrs = attrs;\n this._playerComponent.name = `player`;\n\n container.add(this._playerComponent as unknown as INode);\n\n this._initEvent();\n }\n };\n\n /**\n * 计算起点\n */\n private _computeLayoutRect(rect: ILayoutRect, width: number, height: number) {\n // don't set bounds when player hidden\n if (this._visible === false) {\n return { x1: 0, x2: 0, y1: 0, y2: 0 };\n }\n // set bounds by 4 kinds of orient\n switch (this._orient) {\n case 'top': {\n return { x1: 0, y1: 0, x2: width, y2: height };\n }\n case 'right': {\n return { x1: rect.width - width, y1: 0, x2: rect.width, y2: rect.height };\n }\n case 'left': {\n return { x1: 0, y1: 0, x2: width, y2: height };\n }\n case 'bottom':\n default: {\n return { x1: 0, y1: rect.height - height, x2: rect.width, y2: rect.height };\n }\n }\n }\n\n /**\n * 计算组件宽度\n */\n private _computeWidth(rect: ILayoutRect) {\n // 若设置的是数值则直接返回\n if (isNumber(this._spec.width)) {\n return Math.min(rect.width, Number(this._spec.width));\n }\n\n if (isVertical(this._orient)) {\n return this._maxSize();\n }\n return rect.width;\n }\n\n /**\n * 计算组件高度\n */\n private _computeHeight(rect: ILayoutRect) {\n // 若设置的是数值则直接返回\n if (isNumber(this._spec.height)) {\n this._height = this._spec.height;\n return Math.min(rect.height, Number(this._spec.height));\n }\n\n if (isHorizontal(this._orient)) {\n return this._maxSize();\n }\n return rect.height;\n }\n\n /**\n * 计算x方向的偏移, 用于实现对齐\n */\n private _computeDx(rect: ILayoutRect) {\n // 垂直时, x不偏移\n if (isVertical(this._orient)) {\n return 0;\n }\n\n // start\n if (this._position === 'start') {\n return 0;\n }\n // middle\n else if (this._position === 'middle') {\n return (rect.width - this._width) / 2;\n }\n // end\n return rect.width - this._width;\n }\n\n /**\n * 计算y方向的偏移, 用于实现对齐\n */\n private _computeDy(rect: ILayoutRect) {\n // 水平时, y不偏移\n if (isHorizontal(this._orient)) {\n return 0;\n }\n\n // start\n if (this._position === 'start') {\n return 0;\n }\n // middle\n else if (this._position === 'middle') {\n return (rect.height - this._height) / 2;\n }\n\n // end\n return rect.height - this._height;\n }\n\n /**\n * 播放器宽度取计算子组件中最高的一个\n */\n private _maxSize = () => {\n return Math.max(\n ...array(this._spec.controller.start?.style?.size),\n ...array(this._spec.controller.pause?.style?.size),\n ...array(this._spec.controller.backward?.style?.size),\n ...array(this._spec.controller.forward?.style?.size),\n (isVertical(this._orient) ? this._spec.slider.railStyle.width : this._spec.slider.railStyle.height) ?? 10\n );\n };\n\n /**\n * 滑动条超过按钮的高度\n */\n private _sliderExceededSize = () => {\n const sliderHeight =\n (isVertical(this._orient) ? this._spec.slider.railStyle.width : this._spec.slider.railStyle.height) ?? 10;\n const controllersHeight = Math.max(\n ...array(this._spec.controller.start?.style?.size),\n ...array(this._spec.controller.pause?.style?.size),\n ...array(this._spec.controller.backward?.style?.size),\n ...array(this._spec.controller.forward?.style?.size)\n );\n if (sliderHeight >= controllersHeight) {\n return sliderHeight - controllersHeight;\n }\n return 0;\n };\n\n changePlayerIndex(index: number) {\n const spec = this._specs[index];\n\n this._option.globalInstance.updateFullData((spec as any).data);\n\n this.event.emit(ChartEvent.playerChange, {\n model: this,\n value: {\n spec: spec,\n index: index,\n specs: this._specs\n }\n });\n }\n\n /**\n * 事件\n */\n private _initEvent = () => {\n if (this._option.disableTriggerEvent) {\n return;\n }\n // 自动播放\n this._option.globalInstance.on(ChartEvent.rendered, () => {\n if (this._spec?.auto) {\n this._playerComponent.pause();\n this._playerComponent.play();\n }\n });\n\n // 循环播放 与 交替方向\n this._playerComponent.addEventListener(PlayerEventEnum.end, () => {\n this.event.emit(ChartEvent.playerEnd, { model: this });\n\n // 交替方向, 仅离散轴支持\n if (this._alternate && this._spec.type === 'discrete') {\n this._direction = this._direction === 'default' ? 'reverse' : 'default';\n this._playerComponent.setAttributes({\n direction: this._direction,\n dataIndex: this._direction === 'reverse' ? this._specs.length - 2 : 1\n });\n }\n\n // 循环播放\n if (this._spec?.loop) {\n this._playerComponent.play();\n }\n });\n\n // 数据更新\n this._playerComponent.addEventListener(PlayerEventEnum.change, (e: { detail: { index: number } }) => {\n // 更新data\n const { index } = e.detail;\n this.changePlayerIndex(index);\n });\n\n // 后退\n this._playerComponent.addEventListener(PlayerEventEnum.backward, (e: { detail: { index: number } }) => {\n const { index } = e.detail;\n const spec = this._specs[index];\n this.event.emit(ChartEvent.playerBackward, {\n model: this,\n value: {\n spec: spec,\n index: index,\n specs: this._specs\n }\n });\n });\n\n // 前进\n this._playerComponent.addEventListener(PlayerEventEnum.forward, (e: { detail: { index: number } }) => {\n const { index } = e.detail;\n const spec = this._specs[index];\n this.event.emit(ChartEvent.playerForward, {\n model: this,\n value: {\n spec: spec,\n index: index,\n specs: this._specs\n }\n });\n });\n\n // 播放\n this._playerComponent.addEventListener(PlayerEventEnum.play, (e: { detail: { index: number } }) => {\n const { index } = e.detail;\n const spec = this._specs[index];\n this.event.emit(ChartEvent.playerPlay, {\n model: this,\n value: {\n spec: spec,\n index: index,\n specs: this._specs\n }\n });\n });\n\n // 暂停\n this._playerComponent.addEventListener(PlayerEventEnum.pause, (e: { detail: { index: number } }) => {\n const { index } = e.detail;\n const spec = this._specs[index];\n this.event.emit(ChartEvent.playerPause, {\n model: this,\n value: {\n spec: spec,\n index: index,\n specs: this._specs\n }\n });\n });\n };\n}\n\nexport const registerPlayer = () => {\n Factory.registerComponent(Player.type, Player);\n};\n"]}
@@ -1,7 +1,7 @@
1
1
  import { VChart } from './vchart';
2
2
  import { Factory } from './factory';
3
3
  export { VChart, Factory };
4
- export declare const version = "2.0.1-alpha.1";
4
+ export declare const version = "2.0.1-alpha.2";
5
5
  export type { IVChart } from './interface';
6
6
  export type { IStateSpec, StateValueType } from '../compile/mark';
7
7
  export type { IRegion } from '../region/interface';
package/esm/core/index.js CHANGED
@@ -4,7 +4,7 @@ import { Factory } from "./factory";
4
4
 
5
5
  export { VChart, Factory };
6
6
 
7
- export const version = "2.0.1-alpha.1";
7
+ export const version = "2.0.1-alpha.2";
8
8
 
9
9
  export * from "../event/interface";
10
10
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAG3B,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC;AAOvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAI3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EACL,OAAO,EACP,WAAW,EACX,cAAc,EACd,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGtE,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC","file":"index.js","sourcesContent":["/**\n * @description The core module of VChart, containing the necessary interfaces for using VChart.\n */\n\nimport { VChart } from './vchart';\nimport { Factory } from './factory';\n\nexport { VChart, Factory };\n\n// export the version\nexport const version = \"2.0.1-alpha.1\";\n\n// export necessary types\nexport type { IVChart } from './interface';\nexport type { IStateSpec, StateValueType } from '../compile/mark';\nexport type { IRegion } from '../region/interface';\n\nexport * from '../event/interface';\nexport * from '../theme/interface';\nexport * from '../model/interface';\n\nexport * from './interface';\nexport * from '../typings';\nexport type { IMarkGraphic, IGraphicContext } from '../mark/interface/';\n\n// some constants\nexport * from '../constant/base';\nexport * from '../constant/data';\nexport * from '../constant/layout';\nexport { AttributeLevel } from '../constant/attribute';\nexport { TransformLevel } from '../data/initialize';\nexport { STATE_VALUE_ENUM } from '../compile/mark/interface';\nexport { ChartEvent } from '../constant/event';\n\n/**\n * spec\n */\nexport * from '../typings/spec/index';\nexport * from '../typings/visual';\n\n// tooltip\nexport * from '../typings/tooltip';\n\n// theme\nexport * from '../theme/index';\n\n// vrender\nexport {\n vglobal,\n createGroup,\n createRichText,\n createText,\n createArc,\n createArea,\n createRect,\n createLine,\n createSymbol\n} from '@visactor/vrender-core';\nexport { ManualTicker, StreamLight } from '@visactor/vrender-animate';\n\n// utils\nexport * from '../util/space';\nexport { transformToGraphic } from '../util/style';\nexport { getSpecInfo } from '../component/util';\nexport { registerDataSetInstanceParser, registerDataSetInstanceTransform } from '../data/register';\nexport { lookup } from '../data/transforms/lookup';\nexport { warn } from '../util/debug';\nexport { measureText } from '../util/text';\n"]}
1
+ {"version":3,"sources":["../src/core/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAG3B,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC;AAOvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAI3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EACL,OAAO,EACP,WAAW,EACX,cAAc,EACd,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGtE,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC","file":"index.js","sourcesContent":["/**\n * @description The core module of VChart, containing the necessary interfaces for using VChart.\n */\n\nimport { VChart } from './vchart';\nimport { Factory } from './factory';\n\nexport { VChart, Factory };\n\n// export the version\nexport const version = \"2.0.1-alpha.2\";\n\n// export necessary types\nexport type { IVChart } from './interface';\nexport type { IStateSpec, StateValueType } from '../compile/mark';\nexport type { IRegion } from '../region/interface';\n\nexport * from '../event/interface';\nexport * from '../theme/interface';\nexport * from '../model/interface';\n\nexport * from './interface';\nexport * from '../typings';\nexport type { IMarkGraphic, IGraphicContext } from '../mark/interface/';\n\n// some constants\nexport * from '../constant/base';\nexport * from '../constant/data';\nexport * from '../constant/layout';\nexport { AttributeLevel } from '../constant/attribute';\nexport { TransformLevel } from '../data/initialize';\nexport { STATE_VALUE_ENUM } from '../compile/mark/interface';\nexport { ChartEvent } from '../constant/event';\n\n/**\n * spec\n */\nexport * from '../typings/spec/index';\nexport * from '../typings/visual';\n\n// tooltip\nexport * from '../typings/tooltip';\n\n// theme\nexport * from '../theme/index';\n\n// vrender\nexport {\n vglobal,\n createGroup,\n createRichText,\n createText,\n createArc,\n createArea,\n createRect,\n createLine,\n createSymbol\n} from '@visactor/vrender-core';\nexport { ManualTicker, StreamLight } from '@visactor/vrender-animate';\n\n// utils\nexport * from '../util/space';\nexport { transformToGraphic } from '../util/style';\nexport { getSpecInfo } from '../component/util';\nexport { registerDataSetInstanceParser, registerDataSetInstanceTransform } from '../data/register';\nexport { lookup } from '../data/transforms/lookup';\nexport { warn } from '../util/debug';\nexport { measureText } from '../util/text';\n"]}
@@ -22,4 +22,4 @@ export class InstanceManager {
22
22
  }
23
23
 
24
24
  InstanceManager.instances = new Map;
25
- //# sourceMappingURL=instance-manager.js.map
25
+ //# sourceMappingURL=instance-manager.js.map
@@ -1,2 +1,2 @@
1
1
  export { };
2
- //# sourceMappingURL=interface.js.map
2
+ //# sourceMappingURL=interface.js.map
@@ -81,4 +81,4 @@ export var TransformLevel;
81
81
  TransformLevel[TransformLevel.linkDotInfo = -7] = "linkDotInfo", TransformLevel[TransformLevel.sankeyLayout = -7] = "sankeyLayout",
82
82
  TransformLevel[TransformLevel.dataZoomFilter = -6] = "dataZoomFilter", TransformLevel[TransformLevel.legendFilter = -5] = "legendFilter";
83
83
  }(TransformLevel || (TransformLevel = {}));
84
- //# sourceMappingURL=initialize.js.map
84
+ //# sourceMappingURL=initialize.js.map
@@ -5,4 +5,4 @@ export function registerDataSetInstanceTransform(dataSet, name, transform) {
5
5
  export function registerDataSetInstanceParser(dataSet, name, parse) {
6
6
  dataSet.getParser(name) || dataSet.registerParser(name, parse);
7
7
  }
8
- //# sourceMappingURL=register.js.map
8
+ //# sourceMappingURL=register.js.map
@@ -476,7 +476,7 @@ export class BaseMark extends GrammarItem {
476
476
  this._graphicMap = mark._graphicMap, this._graphicMap.forEach((g => {
477
477
  g.context = Object.assign(Object.assign({}, g.context), this._getCommonContext());
478
478
  })), this._dataByKey = mark._dataByKey, this._prevDataByKey = mark._prevDataByKey,
479
- this.needClear = mark.needClear);
479
+ this.needClear = mark.needClear, this._aniamtionStateCallback = mark._aniamtionStateCallback);
480
480
  }
481
481
  _parseProgressiveContext(data) {
482
482
  const enableProgressive = this._markConfig.progressiveStep > 0 && this._markConfig.progressiveThreshold > 0 && this._markConfig.progressiveStep < this._markConfig.progressiveThreshold, large = this._markConfig.large && this._markConfig.largeThreshold > 0 && data.length >= this._markConfig.largeThreshold;
@@ -514,12 +514,12 @@ export class BaseMark extends GrammarItem {
514
514
  var _a;
515
515
  let config = animationConfig[type];
516
516
  return config && Array.isArray(config) && (config = 1 === config.length ? config[0] : config),
517
- Array.isArray(config) && (config = config.map(((item, index) => {
517
+ Array.isArray(config) ? config.map(((item, index) => {
518
518
  var _a;
519
519
  return Object.assign(Object.assign({}, item), {
520
520
  priority: null !== (_a = item.priority) && void 0 !== _a ? _a : 1 / 0
521
521
  });
522
- }))), config ? Object.assign(Object.assign({}, config), {
522
+ })) : config ? Object.assign(Object.assign({}, config), {
523
523
  priority: "normal" === type ? null !== (_a = config.priority) && void 0 !== _a ? _a : 1 / 0 : config.priority
524
524
  }) : config;
525
525
  }