@visactor/vrender-components 0.21.5-vstory.1 → 0.21.6-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/cjs/axis/base.js +6 -2
  2. package/cjs/axis/base.js.map +1 -1
  3. package/cjs/core/base.d.ts +4 -4
  4. package/cjs/core/base.js +13 -5
  5. package/cjs/core/base.js.map +1 -1
  6. package/cjs/index.d.ts +1 -2
  7. package/cjs/index.js +2 -2
  8. package/cjs/index.js.map +1 -1
  9. package/cjs/interface.d.ts +1 -2
  10. package/cjs/interface.js.map +1 -1
  11. package/dist/index.es.js +4903 -5379
  12. package/es/axis/base.js +6 -2
  13. package/es/axis/base.js.map +1 -1
  14. package/es/core/base.d.ts +4 -4
  15. package/es/core/base.js +13 -6
  16. package/es/core/base.js.map +1 -1
  17. package/es/index.d.ts +1 -2
  18. package/es/index.js +1 -3
  19. package/es/index.js.map +1 -1
  20. package/es/interface.d.ts +1 -2
  21. package/es/interface.js.map +1 -1
  22. package/package.json +5 -5
  23. package/cjs/weather/index.d.ts +0 -1
  24. package/cjs/weather/index.js +0 -21
  25. package/cjs/weather/index.js.map +0 -1
  26. package/cjs/weather/register.d.ts +0 -1
  27. package/cjs/weather/register.js +0 -14
  28. package/cjs/weather/register.js.map +0 -1
  29. package/cjs/weather/type.d.ts +0 -24
  30. package/cjs/weather/type.js +0 -6
  31. package/cjs/weather/type.js.map +0 -1
  32. package/cjs/weather/weather-box.d.ts +0 -13
  33. package/cjs/weather/weather-box.js +0 -129
  34. package/cjs/weather/weather-box.js.map +0 -1
  35. package/es/weather/index.d.ts +0 -1
  36. package/es/weather/index.js +0 -2
  37. package/es/weather/index.js.map +0 -1
  38. package/es/weather/register.d.ts +0 -1
  39. package/es/weather/register.js +0 -6
  40. package/es/weather/register.js.map +0 -1
  41. package/es/weather/type.d.ts +0 -24
  42. package/es/weather/type.js +0 -2
  43. package/es/weather/type.js.map +0 -1
  44. package/es/weather/weather-box.d.ts +0 -13
  45. package/es/weather/weather-box.js +0 -127
  46. package/es/weather/weather-box.js.map +0 -1
package/es/axis/base.js CHANGED
@@ -52,7 +52,8 @@ export class AxisBase extends AbstractComponent {
52
52
  x: 0,
53
53
  y: 0,
54
54
  pickable: !1
55
- }), this.add(this._innerView), this._renderInner(this._innerView), this._bindEvent();
55
+ }), this.add(this._innerView), this._renderInner(this._innerView), this.setAttribute("pickable", !1),
56
+ this._bindEvent();
56
57
  }
57
58
  _bindEvent() {
58
59
  if (this.attribute.disableTriggerEvent) return;
@@ -154,7 +155,10 @@ export class AxisBase extends AbstractComponent {
154
155
  isFunction(labelState[key]) && (labelState[key] = labelState[key](item, index, data, layer));
155
156
  })), text.states = labelState;
156
157
  }
157
- labelGroup.add(text);
158
+ text.data = Object.assign(Object.assign({}, item), {
159
+ index: index,
160
+ layer: layer
161
+ }), labelGroup.add(text);
158
162
  })), labelGroup;
159
163
  }
160
164
  renderTitle(container) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/axis/base.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAW9C,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AACpD,OAAO,EAAE,kBA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E,EAAE,MAAA,IAAI,CAAC,EAAE,mCAAI,IAAI,CAAC,KAAK,IACzB,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;CACF","file":"base.js","sourcesContent":["/**\n * TODO:\n * 1. trunk 坐标轴截断\n * @description 坐标轴组件基类\n */\nimport type {\n IGroup,\n INode,\n ITextGraphicAttribute,\n TextAlignType,\n TextBaselineType,\n FederatedPointerEvent,\n IGraphic,\n IText\n} from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { graphicCreator } from '@visactor/vrender-core';\nimport type { Dict } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { abs, cloneDeep, get, isEmpty, isFunction, merge, pi } from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport type { Point } from '../core/type';\nimport type { TagAttributes } from '../tag';\nimport { createTextGraphicByType } from '../util';\nimport { DEFAULT_STATES } from '../constant';\nimport { AXIS_ELEMENT_NAME } from './constant';\nimport { DEFAULT_AXIS_THEME } from './config';\nimport type {\n LabelAttributes,\n AxisBaseAttributes,\n AxisItem,\n TickAttributes,\n TransformedAxisItem,\n SubTickAttributes,\n TickLineItem,\n callbackFunc\n} from './type';\nimport { Tag } from '../tag/tag';\nimport { getElMap, getVerticalCoord } from './util';\nimport { dispatchClickState, dispatchHoverState, dispatchUnHoverState } from '../util/interaction';\n\nexport abstract class AxisBase<T extends AxisBaseAttributes> extends AbstractComponent<Required<T>> {\n name = 'axis';\n\n // TODO: 组件整体统一起来\n protected _innerView: IGroup;\n getInnerView() {\n return this._innerView;\n }\n\n protected _prevInnerView: { [key: string]: IGraphic }; // 缓存旧场景树,用于自定义动画\n /**\n * 获取更新前的旧场景树\n * @returns 返回更新前的旧场景树\n */\n getPrevInnerView() {\n return this._prevInnerView;\n }\n\n // 经过处理后的坐标轴点数据\n protected data: TransformedAxisItem[] = [];\n protected tickLineItems: TickLineItem[] = [];\n protected subTickLineItems: TickLineItem[] = [];\n protected axisLabelLayerSize: Dict<{\n width: number;\n height: number;\n textAlign: string;\n textBaseline: string;\n labelPos: number;\n }> = {};\n protected axisLabelsContainer: IGroup | null = null;\n protected axisContainer: IGroup;\n\n private _lastHover: IGraphic;\n private _lastSelect: IGraphic;\n\n protected abstract renderLine(container: IGroup): void;\n abstract isInValidValue(value: number): boolean;\n abstract getTickCoord(value: number): Point;\n abstract getVerticalVector(offset: number, inside: boolean, point: Point): [number, number];\n abstract getRelativeVector(point?: Point): [number, number];\n protected abstract getTitleAttribute(): TagAttributes;\n protected abstract beforeLabelsOverlap(\n labelShapes: IText[],\n labelData: AxisItem[],\n labelContainer: IGroup,\n layer: number,\n layerCount: number\n ): void;\n protected abstract handleLabelsOverlap(\n labelShapes: IText[],\n labelData: AxisItem[],\n labelContainer: IGroup,\n layer: number,\n layerCount: number\n ): void;\n protected abstract afterLabelsOverlap(\n labelShapes: IText[],\n labelData: AxisItem[],\n labelContainer: IGroup,\n layer: number,\n layerCount: number\n ): void;\n protected abstract getLabelAlign(\n vector: [number, number],\n inside?: boolean,\n angle?: number\n ): { textAlign: TextAlignType; textBaseline: TextBaselineType };\n\n /**\n * 坐标轴的一个特殊的方法,用于不更新场景树来获取更新属性后的包围盒\n * TODO:后面看情况再抽象为通用的方法\n */\n getBoundsWithoutRender(attributes: Partial<T>) {\n const currentAttribute = cloneDeep(this.attribute);\n merge(this.attribute, attributes);\n\n const offscreenGroup = graphicCreator.group({\n x: this.attribute.x,\n y: this.attribute.y\n });\n this.add(offscreenGroup);\n\n this._renderInner(offscreenGroup);\n\n this.removeChild(offscreenGroup);\n this.attribute = currentAttribute;\n return offscreenGroup.AABBBounds;\n }\n\n protected render(): void {\n this._prevInnerView = this._innerView && getElMap(this._innerView);\n this.removeAllChild(true);\n this._innerView = graphicCreator.group({ x: 0, y: 0, pickable: false });\n this.add(this._innerView);\n\n this._renderInner(this._innerView);\n\n this._bindEvent();\n }\n\n private _bindEvent() {\n if (this.attribute.disableTriggerEvent) {\n return;\n }\n const { hover, select } = this.attribute;\n\n if (hover) {\n this._innerView.addEventListener('pointermove', this._onHover as EventListenerOrEventListenerObject);\n this._innerView.addEventListener('pointerout', this._onUnHover as EventListenerOrEventListenerObject);\n }\n\n if (select) {\n this._innerView.addEventListener('pointerdown', this._onClick as EventListenerOrEventListenerObject);\n }\n }\n\n private _onHover = (e: FederatedPointerEvent) => {\n this._lastHover = dispatchHoverState(e, this.axisContainer, this._lastHover);\n };\n\n private _onUnHover = (e: FederatedPointerEvent) => {\n this._lastHover = dispatchUnHoverState(e, this.axisContainer, this._lastHover);\n };\n\n private _onClick = (e: FederatedPointerEvent) => {\n this._lastSelect = dispatchClickState(e, this.axisContainer, this._lastSelect);\n };\n\n protected _renderInner(container: IGroup) {\n const { title, label, tick, line, items } = this.attribute;\n\n const axisContainer = graphicCreator.group({ x: 0, y: 0, zIndex: 1, pickable: false });\n axisContainer.name = AXIS_ELEMENT_NAME.axisContainer;\n axisContainer.id = this._getNodeId('container');\n axisContainer.setMode(this.mode);\n this.axisContainer = axisContainer;\n container.add(axisContainer);\n\n // 渲染轴线\n if (line && line.visible) {\n this.renderLine(axisContainer);\n }\n\n if (items && items.length) {\n this.data = this._transformItems(items[0]);\n\n // 渲染刻度线,包含子刻度线\n if (tick && tick.visible) {\n this.renderTicks(axisContainer);\n }\n // 渲染标签\n if (label && label.visible) {\n const labelGroup = graphicCreator.group({ x: 0, y: 0, pickable: false });\n labelGroup.name = AXIS_ELEMENT_NAME.labelContainer;\n labelGroup.id = this._getNodeId('label-container');\n this.axisLabelsContainer = labelGroup;\n axisContainer.add(labelGroup);\n items.forEach((axisItems: AxisItem[], layer: number) => {\n const layerLabelGroup = this.renderLabels(labelGroup, axisItems, layer);\n\n const labels = layerLabelGroup.getChildren() as IText[];\n this.beforeLabelsOverlap(labels, axisItems, layerLabelGroup, layer, items.length);\n // handle overlap\n this.handleLabelsOverlap(labels, axisItems, layerLabelGroup, layer, items.length);\n this.afterLabelsOverlap(labels, axisItems, layerLabelGroup, layer, items.length);\n\n let maxTextWidth = 0;\n let maxTextHeight = 0;\n let textAlign = 'center';\n let textBaseline = 'middle';\n let labelPos: number = 0;\n labels.forEach((label: IText, index) => {\n const labelStyle = label.attribute;\n\n const angle = labelStyle.angle ?? 0;\n const textBounds = label.AABBBounds;\n let textWidth = textBounds.width();\n let textHeight = textBounds.height();\n if (angle) {\n textWidth = Math.abs(textWidth * Math.cos(angle));\n textHeight = Math.abs(textHeight * Math.sin(angle));\n }\n maxTextWidth = Math.max(maxTextWidth, textWidth);\n maxTextHeight = Math.max(maxTextHeight, textHeight);\n\n textAlign = labelStyle.textAlign as string;\n textBaseline = labelStyle.textBaseline as string;\n if (index === 0) {\n labelPos = labelStyle.x;\n }\n });\n this.axisLabelLayerSize[layer] = {\n width: maxTextWidth,\n height: maxTextHeight,\n\n labelPos,\n textAlign,\n textBaseline\n };\n });\n }\n }\n\n // 渲染标题\n if (title && title.visible) {\n this.renderTitle(axisContainer);\n }\n }\n protected renderTicks(container: IGroup) {\n const tickLineItems = this.getTickLineItems();\n\n const tickLineGroup = graphicCreator.group({ x: 0, y: 0, pickable: false });\n tickLineGroup.name = AXIS_ELEMENT_NAME.tickContainer;\n tickLineGroup.id = this._getNodeId('tick-container');\n container.add(tickLineGroup);\n\n tickLineItems.forEach((item: TickLineItem, index) => {\n const line = graphicCreator.line({\n ...this._getTickLineAttribute('tick', item, index, tickLineItems)\n });\n line.name = AXIS_ELEMENT_NAME.tick;\n line.id = this._getNodeId(item.id);\n\n if (isEmpty(this.attribute.tick?.state)) {\n line.states = DEFAULT_STATES;\n } else {\n const data = this.data[index];\n const tickLineState = merge({}, DEFAULT_STATES, this.attribute.tick.state);\n Object.keys(tickLineState).forEach(key => {\n if (isFunction(tickLineState[key])) {\n tickLineState[key] = tickLineState[key](data.rawValue, index, data, this.data);\n }\n });\n line.states = tickLineState;\n }\n\n tickLineGroup.add(line);\n });\n this.tickLineItems = tickLineItems;\n\n // subTick 处理\n const { subTick } = this.attribute;\n if (subTick && subTick.visible) {\n const subTickLineItems: TickLineItem[] = this.getSubTickLineItems();\n if (subTickLineItems.length) {\n subTickLineItems.forEach((item: TickLineItem, index) => {\n const line = graphicCreator.line({\n ...this._getTickLineAttribute('subTick', item, index, tickLineItems)\n });\n line.name = AXIS_ELEMENT_NAME.subTick;\n line.id = this._getNodeId(`${index}`);\n\n if (isEmpty(subTick.state)) {\n line.states = DEFAULT_STATES;\n } else {\n const subTickLineState = merge({}, DEFAULT_STATES, subTick.state);\n Object.keys(subTickLineState).forEach(key => {\n if (isFunction(subTickLineState[key])) {\n subTickLineState[key] = subTickLineState[key](item.value, index, item, tickLineItems);\n }\n });\n line.states = subTickLineState;\n }\n\n tickLineGroup.add(line);\n });\n }\n\n this.subTickLineItems = subTickLineItems;\n }\n }\n\n protected renderLabels(container: IGroup, items: AxisItem[], layer: number) {\n const { dataFilter } = this.attribute.label;\n if (dataFilter && isFunction(dataFilter)) {\n items = dataFilter(items, layer) as TransformedAxisItem[];\n }\n const data = this._transformItems(items);\n\n const labelGroup = graphicCreator.group({ x: 0, y: 0, pickable: false });\n labelGroup.name = `${AXIS_ELEMENT_NAME.labelContainer}-layer-${layer}`;\n labelGroup.id = this._getNodeId(`label-container-layer-${layer}`);\n container.add(labelGroup);\n\n data.forEach((item: TransformedAxisItem, index: number) => {\n const labelStyle: any = this._getLabelAttribute(item, index, data, layer);\n const text = createTextGraphicByType(labelStyle);\n\n text.name = AXIS_ELEMENT_NAME.label;\n text.id = this._getNodeId(`layer${layer}-label-${item.id}`);\n if (isEmpty(this.attribute.label?.state)) {\n text.states = DEFAULT_STATES;\n } else {\n const labelState = merge({}, DEFAULT_STATES, this.attribute.label.state);\n Object.keys(labelState).forEach(key => {\n if (isFunction(labelState[key])) {\n labelState[key] = labelState[key](item, index, data, layer);\n }\n });\n text.states = labelState;\n }\n\n labelGroup.add(text);\n });\n\n return labelGroup;\n }\n\n protected renderTitle(container: IGroup) {\n const titleAttributes = this.getTitleAttribute();\n const axisTitle = new Tag({\n ...titleAttributes\n });\n axisTitle.name = AXIS_ELEMENT_NAME.title;\n axisTitle.id = this._getNodeId('title');\n container.add(axisTitle as unknown as INode);\n }\n\n protected getVerticalCoord(point: Point, offset: number, inside: boolean): Point {\n return getVerticalCoord(point, this.getVerticalVector(offset, inside, point));\n }\n\n protected getTickLineItems() {\n const { tick } = this.attribute;\n const data = this.data;\n // tick 处理\n const tickLineItems: TickLineItem[] = [];\n const { alignWithLabel, inside = false, length, dataFilter } = tick as TickAttributes;\n let tickSegment = 1;\n const count = data.length;\n if (count >= 2) {\n tickSegment = data[1].value - data[0].value;\n }\n\n (dataFilter && isFunction(dataFilter) ? dataFilter(data) : data).forEach((item: TransformedAxisItem) => {\n let point = item.point;\n let tickValue = item.value;\n if (!alignWithLabel) {\n const value = item.value - tickSegment / 2;\n if (this.isInValidValue(value)) {\n return;\n }\n point = this.getTickCoord(value);\n tickValue = value;\n }\n const endPoint = this.getVerticalCoord(point, length as number, inside);\n\n if (this.mode === '3d') {\n const vec = this.getVerticalVector(length as number, inside, point);\n let alpha = 0;\n let beta = 0;\n if (abs(vec[0]) > abs(vec[1])) {\n alpha = (pi / 2) * (endPoint.x > point.x ? 1 : -1);\n } else {\n beta = (pi / 2) * (endPoint.y > point.y ? -1 : 1);\n }\n tickLineItems.push({\n start: point,\n end: endPoint,\n value: tickValue,\n id: `tick-${item.id}`,\n anchor: [point.x, point.y],\n alpha,\n beta\n });\n } else {\n tickLineItems.push({\n start: point,\n end: endPoint,\n value: tickValue,\n id: `tick-${item.id}`\n });\n }\n });\n\n return tickLineItems;\n }\n\n protected getSubTickLineItems() {\n const { subTick } = this.attribute as AxisBaseAttributes;\n const subTickLineItems: TickLineItem[] = [];\n const { count: subCount = 4, inside = false, length = 2 } = subTick as SubTickAttributes;\n const tickLineItems = this.tickLineItems;\n const tickLineCount = tickLineItems.length;\n\n if (tickLineCount >= 2) {\n for (let i = 0; i < tickLineCount - 1; i++) {\n const pre = tickLineItems[i];\n const next = tickLineItems[i + 1];\n for (let j = 0; j < subCount; j++) {\n const percent = (j + 1) / (subCount + 1);\n const value = (1 - percent) * pre.value + percent * next.value;\n const point = this.getTickCoord(value);\n const endPoint = this.getVerticalCoord(point, length, inside);\n subTickLineItems.push({\n start: point,\n end: endPoint,\n value,\n id: `sub-tick-${value}`\n });\n }\n }\n }\n\n return subTickLineItems;\n }\n\n private _getTickLineAttribute(type: string, tickItem: TickLineItem, index: number, tickItems: TickLineItem[]) {\n let style = get(this.attribute, `${type}.style`);\n const data = this.data[index];\n style = isFunction(style)\n ? merge(\n {},\n get(DEFAULT_AXIS_THEME, `${type}.style`),\n type === 'tick'\n ? style(data.rawValue, index, data, this.data)\n : style(tickItem.value, index, tickItem, tickItems)\n )\n : style;\n\n const { start, end, anchor, alpha, beta } = tickItem;\n return {\n points: [start, end],\n anchor,\n alpha,\n beta,\n ...style\n };\n }\n\n private _getLabelAttribute(\n tickDatum: TransformedAxisItem,\n index: number,\n tickData: TransformedAxisItem[],\n layer: number\n ) {\n const { space = 4, inside = false, formatMethod, type = 'text', text } = this.attribute.label as LabelAttributes;\n let offset = space;\n let tickLength = 0;\n if (this.attribute.tick?.visible && this.attribute.tick.inside === inside) {\n tickLength = this.attribute.tick.length || 4;\n }\n if (this.attribute.subTick?.visible && this.attribute.subTick.inside === inside) {\n tickLength = Math.max(tickLength, this.attribute.subTick.length || 2);\n }\n offset += tickLength;\n\n // 先测试 line\n const axisVector = this.getRelativeVector(tickDatum.point);\n if (layer > 0) {\n if (axisVector[1] === 0) {\n offset += (this.axisLabelLayerSize[layer - 1].height + get(this.attribute, 'label.space', 4)) * layer;\n } else {\n offset += (this.axisLabelLayerSize[layer - 1].width + get(this.attribute, 'label.space', 4)) * layer;\n }\n }\n\n const point = this.getVerticalCoord(tickDatum.point, offset, inside);\n const vector = this.getVerticalVector(offset || 1, inside, point);\n const textContent = formatMethod\n ? formatMethod(`${tickDatum.label}`, tickDatum, index, tickData, layer)\n : tickDatum.label;\n let { style: textStyle } = this.attribute.label as LabelAttributes;\n textStyle = isFunction(textStyle)\n ? merge(\n {},\n DEFAULT_AXIS_THEME.label.style,\n (textStyle as callbackFunc<Partial<ITextGraphicAttribute> | undefined>)(tickDatum, index, tickData, layer)\n )\n : textStyle;\n\n const labelAlign = this.getLabelAlign(vector, inside, (textStyle as ITextGraphicAttribute).angle);\n textStyle = merge(labelAlign, textStyle) as Partial<ITextGraphicAttribute>;\n // 兼容原先 style.text 回调的方式\n if (isFunction(textStyle.text)) {\n // @ts-ignore\n textStyle.text = textStyle.text({\n label: tickDatum.label,\n value: tickDatum.rawValue,\n index: tickDatum.index,\n layer\n });\n }\n return {\n ...this.getLabelPosition(point, vector, textContent, textStyle),\n text: text ?? textContent,\n _originText: tickDatum.label,\n lineHeight: textStyle?.fontSize,\n type,\n ...textStyle\n };\n }\n\n protected getLabelPosition(\n point: Point,\n vector: [number, number],\n text: string | number,\n style: Partial<ITextGraphicAttribute>\n ) {\n return point;\n }\n\n private _transformItems(items: AxisItem[]) {\n const data: TransformedAxisItem[] = [];\n items.forEach((item: AxisItem) => {\n data.push({\n ...item,\n point: this.getTickCoord(item.value),\n id: item.id ?? item.label\n });\n });\n return data;\n }\n\n release(): void {\n super.release();\n this._prevInnerView = null;\n this._innerView = null;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/axis/base.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGjD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AAW,EAAE,SAAS,CAAC,KAAK,EAC5B,UAAU,EAAE,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,QAAQ,EAC/B,IAAI,KACD,SAAS,EACZ;IACJ,CAAC;IAES,gBAAgB,CACxB,KAAY,EACZ,MAAwB,EACxB,IAAqB,EACrB,KAAqC;QAErC,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,eAAe,CAAC,KAAiB;QACvC,MAAM,IAAI,GAA0B,EAAE,CAAC;QACvC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAc,EAAE,EAAE;;YAC/B,IAAI,CAAC,IAAI,iCACJ,IAAI,KACP,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,EACpC,EAAE,EAAE,MAAA,IAAI,CAAC,EAAE,mCAAI,IAAI,CAAC,KAAK,IACzB,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;CACF","file":"base.js","sourcesContent":["/**\n * TODO:\n * 1. trunk 坐标轴截断\n * @description 坐标轴组件基类\n */\nimport type {\n IGroup,\n INode,\n ITextGraphicAttribute,\n TextAlignType,\n TextBaselineType,\n FederatedPointerEvent,\n IGraphic,\n IText\n} from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { graphicCreator } from '@visactor/vrender-core';\nimport type { Dict } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { abs, cloneDeep, get, isEmpty, isFunction, merge, pi } from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport type { Point } from '../core/type';\nimport type { TagAttributes } from '../tag';\nimport { createTextGraphicByType } from '../util';\nimport { DEFAULT_STATES } from '../constant';\nimport { AXIS_ELEMENT_NAME } from './constant';\nimport { DEFAULT_AXIS_THEME } from './config';\nimport type {\n LabelAttributes,\n AxisBaseAttributes,\n AxisItem,\n TickAttributes,\n TransformedAxisItem,\n SubTickAttributes,\n TickLineItem,\n callbackFunc\n} from './type';\nimport { Tag } from '../tag/tag';\nimport { getElMap, getVerticalCoord } from './util';\nimport { dispatchClickState, dispatchHoverState, dispatchUnHoverState } from '../util/interaction';\n\nexport abstract class AxisBase<T extends AxisBaseAttributes> extends AbstractComponent<Required<T>> {\n name = 'axis';\n\n // TODO: 组件整体统一起来\n protected _innerView: IGroup;\n getInnerView() {\n return this._innerView;\n }\n\n protected _prevInnerView: { [key: string]: IGraphic }; // 缓存旧场景树,用于自定义动画\n /**\n * 获取更新前的旧场景树\n * @returns 返回更新前的旧场景树\n */\n getPrevInnerView() {\n return this._prevInnerView;\n }\n\n // 经过处理后的坐标轴点数据\n protected data: TransformedAxisItem[] = [];\n protected tickLineItems: TickLineItem[] = [];\n protected subTickLineItems: TickLineItem[] = [];\n protected axisLabelLayerSize: Dict<{\n width: number;\n height: number;\n textAlign: string;\n textBaseline: string;\n labelPos: number;\n }> = {};\n protected axisLabelsContainer: IGroup | null = null;\n protected axisContainer: IGroup;\n\n private _lastHover: IGraphic;\n private _lastSelect: IGraphic;\n\n protected abstract renderLine(container: IGroup): void;\n abstract isInValidValue(value: number): boolean;\n abstract getTickCoord(value: number): Point;\n abstract getVerticalVector(offset: number, inside: boolean, point: Point): [number, number];\n abstract getRelativeVector(point?: Point): [number, number];\n protected abstract getTitleAttribute(): TagAttributes;\n protected abstract beforeLabelsOverlap(\n labelShapes: IText[],\n labelData: AxisItem[],\n labelContainer: IGroup,\n layer: number,\n layerCount: number\n ): void;\n protected abstract handleLabelsOverlap(\n labelShapes: IText[],\n labelData: AxisItem[],\n labelContainer: IGroup,\n layer: number,\n layerCount: number\n ): void;\n protected abstract afterLabelsOverlap(\n labelShapes: IText[],\n labelData: AxisItem[],\n labelContainer: IGroup,\n layer: number,\n layerCount: number\n ): void;\n protected abstract getLabelAlign(\n vector: [number, number],\n inside?: boolean,\n angle?: number\n ): { textAlign: TextAlignType; textBaseline: TextBaselineType };\n\n /**\n * 坐标轴的一个特殊的方法,用于不更新场景树来获取更新属性后的包围盒\n * TODO:后面看情况再抽象为通用的方法\n */\n getBoundsWithoutRender(attributes: Partial<T>) {\n const currentAttribute = cloneDeep(this.attribute);\n merge(this.attribute, attributes);\n\n const offscreenGroup = graphicCreator.group({\n x: this.attribute.x,\n y: this.attribute.y\n });\n this.add(offscreenGroup);\n\n this._renderInner(offscreenGroup);\n\n this.removeChild(offscreenGroup);\n this.attribute = currentAttribute;\n return offscreenGroup.AABBBounds;\n }\n\n protected render(): void {\n this._prevInnerView = this._innerView && getElMap(this._innerView);\n this.removeAllChild(true);\n this._innerView = graphicCreator.group({ x: 0, y: 0, pickable: false });\n this.add(this._innerView);\n\n this._renderInner(this._innerView);\n this.setAttribute('pickable', false);\n\n this._bindEvent();\n }\n\n private _bindEvent() {\n if (this.attribute.disableTriggerEvent) {\n return;\n }\n const { hover, select } = this.attribute;\n\n if (hover) {\n this._innerView.addEventListener('pointermove', this._onHover as EventListenerOrEventListenerObject);\n this._innerView.addEventListener('pointerout', this._onUnHover as EventListenerOrEventListenerObject);\n }\n\n if (select) {\n this._innerView.addEventListener('pointerdown', this._onClick as EventListenerOrEventListenerObject);\n }\n }\n\n private _onHover = (e: FederatedPointerEvent) => {\n this._lastHover = dispatchHoverState(e, this.axisContainer, this._lastHover);\n };\n\n private _onUnHover = (e: FederatedPointerEvent) => {\n this._lastHover = dispatchUnHoverState(e, this.axisContainer, this._lastHover);\n };\n\n private _onClick = (e: FederatedPointerEvent) => {\n this._lastSelect = dispatchClickState(e, this.axisContainer, this._lastSelect);\n };\n\n protected _renderInner(container: IGroup) {\n const { title, label, tick, line, items } = this.attribute;\n\n const axisContainer = graphicCreator.group({ x: 0, y: 0, zIndex: 1, pickable: false });\n axisContainer.name = AXIS_ELEMENT_NAME.axisContainer;\n axisContainer.id = this._getNodeId('container');\n axisContainer.setMode(this.mode);\n this.axisContainer = axisContainer;\n container.add(axisContainer);\n\n // 渲染轴线\n if (line && line.visible) {\n this.renderLine(axisContainer);\n }\n\n if (items && items.length) {\n this.data = this._transformItems(items[0]);\n\n // 渲染刻度线,包含子刻度线\n if (tick && tick.visible) {\n this.renderTicks(axisContainer);\n }\n // 渲染标签\n if (label && label.visible) {\n const labelGroup = graphicCreator.group({ x: 0, y: 0, pickable: false });\n labelGroup.name = AXIS_ELEMENT_NAME.labelContainer;\n labelGroup.id = this._getNodeId('label-container');\n this.axisLabelsContainer = labelGroup;\n axisContainer.add(labelGroup);\n items.forEach((axisItems: AxisItem[], layer: number) => {\n const layerLabelGroup = this.renderLabels(labelGroup, axisItems, layer);\n\n const labels = layerLabelGroup.getChildren() as IText[];\n this.beforeLabelsOverlap(labels, axisItems, layerLabelGroup, layer, items.length);\n // handle overlap\n this.handleLabelsOverlap(labels, axisItems, layerLabelGroup, layer, items.length);\n this.afterLabelsOverlap(labels, axisItems, layerLabelGroup, layer, items.length);\n\n let maxTextWidth = 0;\n let maxTextHeight = 0;\n let textAlign = 'center';\n let textBaseline = 'middle';\n let labelPos: number = 0;\n labels.forEach((label: IText, index) => {\n const labelStyle = label.attribute;\n\n const angle = labelStyle.angle ?? 0;\n const textBounds = label.AABBBounds;\n let textWidth = textBounds.width();\n let textHeight = textBounds.height();\n if (angle) {\n textWidth = Math.abs(textWidth * Math.cos(angle));\n textHeight = Math.abs(textHeight * Math.sin(angle));\n }\n maxTextWidth = Math.max(maxTextWidth, textWidth);\n maxTextHeight = Math.max(maxTextHeight, textHeight);\n\n textAlign = labelStyle.textAlign as string;\n textBaseline = labelStyle.textBaseline as string;\n if (index === 0) {\n labelPos = labelStyle.x;\n }\n });\n this.axisLabelLayerSize[layer] = {\n width: maxTextWidth,\n height: maxTextHeight,\n\n labelPos,\n textAlign,\n textBaseline\n };\n });\n }\n }\n\n // 渲染标题\n if (title && title.visible) {\n this.renderTitle(axisContainer);\n }\n }\n protected renderTicks(container: IGroup) {\n const tickLineItems = this.getTickLineItems();\n\n const tickLineGroup = graphicCreator.group({ x: 0, y: 0, pickable: false });\n tickLineGroup.name = AXIS_ELEMENT_NAME.tickContainer;\n tickLineGroup.id = this._getNodeId('tick-container');\n container.add(tickLineGroup);\n\n tickLineItems.forEach((item: TickLineItem, index) => {\n const line = graphicCreator.line({\n ...this._getTickLineAttribute('tick', item, index, tickLineItems)\n });\n line.name = AXIS_ELEMENT_NAME.tick;\n line.id = this._getNodeId(item.id);\n\n if (isEmpty(this.attribute.tick?.state)) {\n line.states = DEFAULT_STATES;\n } else {\n const data = this.data[index];\n const tickLineState = merge({}, DEFAULT_STATES, this.attribute.tick.state);\n Object.keys(tickLineState).forEach(key => {\n if (isFunction(tickLineState[key])) {\n tickLineState[key] = tickLineState[key](data.rawValue, index, data, this.data);\n }\n });\n line.states = tickLineState;\n }\n\n tickLineGroup.add(line);\n });\n this.tickLineItems = tickLineItems;\n\n // subTick 处理\n const { subTick } = this.attribute;\n if (subTick && subTick.visible) {\n const subTickLineItems: TickLineItem[] = this.getSubTickLineItems();\n if (subTickLineItems.length) {\n subTickLineItems.forEach((item: TickLineItem, index) => {\n const line = graphicCreator.line({\n ...this._getTickLineAttribute('subTick', item, index, tickLineItems)\n });\n line.name = AXIS_ELEMENT_NAME.subTick;\n line.id = this._getNodeId(`${index}`);\n\n if (isEmpty(subTick.state)) {\n line.states = DEFAULT_STATES;\n } else {\n const subTickLineState = merge({}, DEFAULT_STATES, subTick.state);\n Object.keys(subTickLineState).forEach(key => {\n if (isFunction(subTickLineState[key])) {\n subTickLineState[key] = subTickLineState[key](item.value, index, item, tickLineItems);\n }\n });\n line.states = subTickLineState;\n }\n\n tickLineGroup.add(line);\n });\n }\n\n this.subTickLineItems = subTickLineItems;\n }\n }\n\n protected renderLabels(container: IGroup, items: AxisItem[], layer: number) {\n const { dataFilter } = this.attribute.label;\n if (dataFilter && isFunction(dataFilter)) {\n items = dataFilter(items, layer) as TransformedAxisItem[];\n }\n const data = this._transformItems(items);\n\n const labelGroup = graphicCreator.group({ x: 0, y: 0, pickable: false });\n labelGroup.name = `${AXIS_ELEMENT_NAME.labelContainer}-layer-${layer}`;\n labelGroup.id = this._getNodeId(`label-container-layer-${layer}`);\n container.add(labelGroup);\n\n data.forEach((item: TransformedAxisItem, index: number) => {\n const labelStyle: any = this._getLabelAttribute(item, index, data, layer);\n const text = createTextGraphicByType(labelStyle);\n\n text.name = AXIS_ELEMENT_NAME.label;\n text.id = this._getNodeId(`layer${layer}-label-${item.id}`);\n if (isEmpty(this.attribute.label?.state)) {\n text.states = DEFAULT_STATES;\n } else {\n const labelState = merge({}, DEFAULT_STATES, this.attribute.label.state);\n Object.keys(labelState).forEach(key => {\n if (isFunction(labelState[key])) {\n labelState[key] = labelState[key](item, index, data, layer);\n }\n });\n text.states = labelState;\n }\n text.data = { ...item, index, layer };\n labelGroup.add(text);\n });\n\n return labelGroup;\n }\n\n protected renderTitle(container: IGroup) {\n const titleAttributes = this.getTitleAttribute();\n const axisTitle = new Tag({\n ...titleAttributes\n });\n axisTitle.name = AXIS_ELEMENT_NAME.title;\n axisTitle.id = this._getNodeId('title');\n container.add(axisTitle as unknown as INode);\n }\n\n protected getVerticalCoord(point: Point, offset: number, inside: boolean): Point {\n return getVerticalCoord(point, this.getVerticalVector(offset, inside, point));\n }\n\n protected getTickLineItems() {\n const { tick } = this.attribute;\n const data = this.data;\n // tick 处理\n const tickLineItems: TickLineItem[] = [];\n const { alignWithLabel, inside = false, length, dataFilter } = tick as TickAttributes;\n let tickSegment = 1;\n const count = data.length;\n if (count >= 2) {\n tickSegment = data[1].value - data[0].value;\n }\n\n (dataFilter && isFunction(dataFilter) ? dataFilter(data) : data).forEach((item: TransformedAxisItem) => {\n let point = item.point;\n let tickValue = item.value;\n if (!alignWithLabel) {\n const value = item.value - tickSegment / 2;\n if (this.isInValidValue(value)) {\n return;\n }\n point = this.getTickCoord(value);\n tickValue = value;\n }\n const endPoint = this.getVerticalCoord(point, length as number, inside);\n\n if (this.mode === '3d') {\n const vec = this.getVerticalVector(length as number, inside, point);\n let alpha = 0;\n let beta = 0;\n if (abs(vec[0]) > abs(vec[1])) {\n alpha = (pi / 2) * (endPoint.x > point.x ? 1 : -1);\n } else {\n beta = (pi / 2) * (endPoint.y > point.y ? -1 : 1);\n }\n tickLineItems.push({\n start: point,\n end: endPoint,\n value: tickValue,\n id: `tick-${item.id}`,\n anchor: [point.x, point.y],\n alpha,\n beta\n });\n } else {\n tickLineItems.push({\n start: point,\n end: endPoint,\n value: tickValue,\n id: `tick-${item.id}`\n });\n }\n });\n\n return tickLineItems;\n }\n\n protected getSubTickLineItems() {\n const { subTick } = this.attribute as AxisBaseAttributes;\n const subTickLineItems: TickLineItem[] = [];\n const { count: subCount = 4, inside = false, length = 2 } = subTick as SubTickAttributes;\n const tickLineItems = this.tickLineItems;\n const tickLineCount = tickLineItems.length;\n\n if (tickLineCount >= 2) {\n for (let i = 0; i < tickLineCount - 1; i++) {\n const pre = tickLineItems[i];\n const next = tickLineItems[i + 1];\n for (let j = 0; j < subCount; j++) {\n const percent = (j + 1) / (subCount + 1);\n const value = (1 - percent) * pre.value + percent * next.value;\n const point = this.getTickCoord(value);\n const endPoint = this.getVerticalCoord(point, length, inside);\n subTickLineItems.push({\n start: point,\n end: endPoint,\n value,\n id: `sub-tick-${value}`\n });\n }\n }\n }\n\n return subTickLineItems;\n }\n\n private _getTickLineAttribute(type: string, tickItem: TickLineItem, index: number, tickItems: TickLineItem[]) {\n let style = get(this.attribute, `${type}.style`);\n const data = this.data[index];\n style = isFunction(style)\n ? merge(\n {},\n get(DEFAULT_AXIS_THEME, `${type}.style`),\n type === 'tick'\n ? style(data.rawValue, index, data, this.data)\n : style(tickItem.value, index, tickItem, tickItems)\n )\n : style;\n\n const { start, end, anchor, alpha, beta } = tickItem;\n return {\n points: [start, end],\n anchor,\n alpha,\n beta,\n ...style\n };\n }\n\n private _getLabelAttribute(\n tickDatum: TransformedAxisItem,\n index: number,\n tickData: TransformedAxisItem[],\n layer: number\n ) {\n const { space = 4, inside = false, formatMethod, type = 'text', text } = this.attribute.label as LabelAttributes;\n let offset = space;\n let tickLength = 0;\n if (this.attribute.tick?.visible && this.attribute.tick.inside === inside) {\n tickLength = this.attribute.tick.length || 4;\n }\n if (this.attribute.subTick?.visible && this.attribute.subTick.inside === inside) {\n tickLength = Math.max(tickLength, this.attribute.subTick.length || 2);\n }\n offset += tickLength;\n\n // 先测试 line\n const axisVector = this.getRelativeVector(tickDatum.point);\n if (layer > 0) {\n if (axisVector[1] === 0) {\n offset += (this.axisLabelLayerSize[layer - 1].height + get(this.attribute, 'label.space', 4)) * layer;\n } else {\n offset += (this.axisLabelLayerSize[layer - 1].width + get(this.attribute, 'label.space', 4)) * layer;\n }\n }\n\n const point = this.getVerticalCoord(tickDatum.point, offset, inside);\n const vector = this.getVerticalVector(offset || 1, inside, point);\n const textContent = formatMethod\n ? formatMethod(`${tickDatum.label}`, tickDatum, index, tickData, layer)\n : tickDatum.label;\n let { style: textStyle } = this.attribute.label as LabelAttributes;\n textStyle = isFunction(textStyle)\n ? merge(\n {},\n DEFAULT_AXIS_THEME.label.style,\n (textStyle as callbackFunc<Partial<ITextGraphicAttribute> | undefined>)(tickDatum, index, tickData, layer)\n )\n : textStyle;\n\n const labelAlign = this.getLabelAlign(vector, inside, (textStyle as ITextGraphicAttribute).angle);\n textStyle = merge(labelAlign, textStyle) as Partial<ITextGraphicAttribute>;\n // 兼容原先 style.text 回调的方式\n if (isFunction(textStyle.text)) {\n // @ts-ignore\n textStyle.text = textStyle.text({\n label: tickDatum.label,\n value: tickDatum.rawValue,\n index: tickDatum.index,\n layer\n });\n }\n return {\n ...this.getLabelPosition(point, vector, textContent, textStyle),\n text: text ?? textContent,\n _originText: tickDatum.label,\n lineHeight: textStyle?.fontSize,\n type,\n ...textStyle\n };\n }\n\n protected getLabelPosition(\n point: Point,\n vector: [number, number],\n text: string | number,\n style: Partial<ITextGraphicAttribute>\n ) {\n return point;\n }\n\n private _transformItems(items: AxisItem[]) {\n const data: TransformedAxisItem[] = [];\n items.forEach((item: AxisItem) => {\n data.push({\n ...item,\n point: this.getTickCoord(item.value),\n id: item.id ?? item.label\n });\n });\n return data;\n }\n\n release(): void {\n super.release();\n this._prevInnerView = null;\n this._innerView = null;\n }\n}\n"]}
package/es/core/base.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { IGroupGraphicAttribute } from '@visactor/vrender-core';
1
+ import type { IGroupGraphicAttribute, ISetAttributeContext } from '@visactor/vrender-core';
2
2
  import { Group } from '@visactor/vrender-core';
3
3
  import type { Dict } from '@visactor/vutils';
4
4
  import type { ComponentOptions } from '../interface';
@@ -6,10 +6,10 @@ export declare abstract class AbstractComponent<T extends IGroupGraphicAttribute
6
6
  attribute: Partial<T>;
7
7
  protected mode?: '2d' | '3d';
8
8
  protected skipDefault?: boolean;
9
- protected _skipRenderAttributes: string[];
10
9
  constructor(attributes: T, options?: ComponentOptions);
11
- setAttribute(key: string, value: any, forceUpdateTag?: boolean | undefined): void;
12
- setAttributes(params: Partial<T>, forceUpdateTag?: boolean | undefined): void;
10
+ setAttribute(key: string, value: any, forceUpdateTag?: boolean | undefined, context?: ISetAttributeContext): void;
11
+ setAttributes(params: Partial<T>, forceUpdateTag?: boolean | undefined, context?: ISetAttributeContext): void;
12
+ _setAttributes(params: Partial<T>, forceUpdateTag?: boolean | undefined): void;
13
13
  protected _mergeAttributes(params: Partial<T>, keys?: (keyof T)[]): void;
14
14
  protected bindEvents(): void;
15
15
  protected abstract render(): void;
package/es/core/base.js CHANGED
@@ -6,7 +6,7 @@ const GROUP_ATTRIBUTES = [ "x", "y", "dx", "dy", "scaleX", "scaleY", "angle", "a
6
6
 
7
7
  export class AbstractComponent extends Group {
8
8
  constructor(attributes, options) {
9
- super(attributes), this._skipRenderAttributes = GROUP_ATTRIBUTES, (null == options ? void 0 : options.mode) && (this.mode = options.mode,
9
+ super(attributes), (null == options ? void 0 : options.mode) && (this.mode = options.mode,
10
10
  this.setMode(options.mode)), (null == options ? void 0 : options.skipDefault) && (this.skipDefault = !0),
11
11
  this.setTheme({
12
12
  common: {
@@ -16,15 +16,22 @@ export class AbstractComponent extends Group {
16
16
  this.render(), this.bindEvents();
17
17
  }));
18
18
  }
19
- setAttribute(key, value, forceUpdateTag) {
19
+ setAttribute(key, value, forceUpdateTag, context) {
20
+ const params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({
21
+ [key]: value
22
+ }, this.attribute, key, context);
23
+ if (params) return this._setAttributes(params, forceUpdateTag);
20
24
  isPlainObject(this.attribute[key]) && isPlainObject(value) && !isFunction(this.attribute[key]) && !isFunction(value) ? merge(this.attribute[key], value) : this.attribute[key] = value,
21
- this._skipRenderAttributes.includes(key) || this.render(), this.valid = this.isValid(),
22
- this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(),
25
+ GROUP_ATTRIBUTES.includes(key) || this.render(), this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(),
23
26
  this.addUpdatePositionTag(), this.onAttributeUpdate();
24
27
  }
25
- setAttributes(params, forceUpdateTag) {
28
+ setAttributes(params, forceUpdateTag, context) {
29
+ return params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params,
30
+ this._setAttributes(params, forceUpdateTag);
31
+ }
32
+ _setAttributes(params, forceUpdateTag) {
26
33
  const keys = Object.keys(params);
27
- this._mergeAttributes(params, keys), keys.every((key => this._skipRenderAttributes.includes(key))) || this.render(),
34
+ this._mergeAttributes(params, keys), keys.every((key => GROUP_ATTRIBUTES.includes(key))) || this.render(),
28
35
  this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTags(keys) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(),
29
36
  this.addUpdatePositionTag(), this.onAttributeUpdate();
30
37
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/base.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAG3E,MAAM,gBAAgB,GAAG;IACvB,GAAG;IACH,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,YAAY;IACZ,SAAS;IACT,MAAM;IACN,UAAU;IACV,kBAAkB;IAClB,QAAQ;IACR,QAAQ;CACT,CAAC;AAEF,MAAM,OAAgB,iBAA6E,SAAQ,KAAK;IAS9G,YAAY,UAAa,EAAE,OAA0B;QACnD,KAAK,CAAC,UAAU,CAAC,CAAC;QAHV,0BAAqB,GAAa,gBAAgB,CAAC;QAK3D,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;YACjB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YAEzB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAC5B;QAED,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAE;YACxB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;SACzB;QAED,IAAI,CAAC,QAAQ,CAAC;YACZ,MAAM,EAAE;gBACN,kBAAkB,EAAE,CAAC;aACtB;SACF,CAAC,CAAC;QACH,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC;QAE5B,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE;YACnB,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;IASD,YA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;IAGS,cAAc,CAAC,SAAiB,EAAE,OAAmB;;QAE7D,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAGxD,WAAW,CAAC,OAAO,GAAG,MAAA,IAAI,CAAC,KAAK,0CAAE,WAAW,CAAC,OAAO,CAAC;QAEtD,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAClC,CAAC;CACF","file":"base.js","sourcesContent":["/**\n * @description 组件基类\n */\nimport type { IGroupGraphicAttribute } from '@visactor/vrender-core';\nimport { Group, CustomEvent } from '@visactor/vrender-core';\nimport type { Dict } from '@visactor/vutils';\nimport { merge, isFunction, isPlainObject, isNil } from '@visactor/vutils';\nimport type { ComponentOptions } from '../interface';\n\nconst GROUP_ATTRIBUTES = [\n 'x',\n 'y',\n 'dx',\n 'dy',\n 'scaleX',\n 'scaleY',\n 'angle',\n 'anchor',\n 'postMatrix',\n 'visible',\n 'clip',\n 'pickable',\n 'childrenPickable',\n 'zIndex',\n 'cursor'\n];\n\nexport abstract class AbstractComponent<T extends IGroupGraphicAttribute = IGroupGraphicAttribute> extends Group {\n declare attribute: Partial<T>;\n\n protected mode?: '2d' | '3d';\n\n protected skipDefault?: boolean;\n\n protected _skipRenderAttributes: string[] = GROUP_ATTRIBUTES;\n\n constructor(attributes: T, options?: ComponentOptions) {\n super(attributes);\n\n if (options?.mode) {\n this.mode = options.mode;\n\n this.setMode(options.mode);\n }\n\n if (options?.skipDefault) {\n this.skipDefault = true;\n }\n // 组件需要精准 bounds,所以将这个 strokeBoundsBuffer 设置为 0,否则会影响包围盒的获取\n this.setTheme({\n common: {\n strokeBoundsBuffer: 0\n }\n });\n this.attribute = attributes;\n // 这里调用渲染和事件绑定逻辑\n this.onSetStage(() => {\n this.render();\n this.bindEvents();\n });\n }\n\n /**\n * @override\n * 更新单个属性值\n * @param key\n * @param value\n * @param forceUpdateTag\n */\n setAttribute(key: string, value: any, forceUpdateTag?: boolean | undefined): void {\n // overwrite when previous or next attribute is function\n if (\n isPlainObject(this.attribute[key]) &&\n isPlainObject(value) &&\n !isFunction(this.attribute[key]) &&\n !isFunction(value)\n ) {\n merge(this.attribute[key], value);\n } else {\n this.attribute[key] = value;\n }\n\n // HACK: 待优化\n if (!this._skipRenderAttributes.includes(key as string)) {\n this.render();\n }\n\n this.valid = this.isValid();\n if (!this.updateShapeAndBoundsTagSetted() && (forceUpdateTag || this.needUpdateTag(key as string))) {\n this.addUpdateShapeAndBoundsTag();\n } else {\n this.addUpdateBoundTag();\n }\n this.addUpdatePositionTag();\n this.onAttributeUpdate();\n }\n\n // @ts-ignore\n setAttributes(params: Partial<T>, forceUpdateTag?: boolean | undefined): void {\n const keys = Object.keys(params) as (keyof T)[];\n this._mergeAttributes(params, keys);\n\n // HACK: 待优化\n if (!keys.every(key => this._skipRenderAttributes.includes(key as string))) {\n this.render();\n }\n\n this.valid = this.isValid();\n // 没有设置shape&bounds的tag\n if (!this.updateShapeAndBoundsTagSetted() && (forceUpdateTag || this.needUpdateTags(keys as string[]))) {\n this.addUpdateShapeAndBoundsTag();\n } else {\n this.addUpdateBoundTag();\n }\n this.addUpdatePositionTag();\n this.onAttributeUpdate();\n }\n\n protected _mergeAttributes(params: Partial<T>, keys?: (keyof T)[]) {\n if (isNil(keys)) {\n keys = Object.keys(params) as (keyof T)[];\n }\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i] as keyof Partial<T>;\n // overwrite when previous or next attribute is function\n if (isPlainObject(this.attribute[key]) && !isFunction(this.attribute[key]) && !isFunction(params[key])) {\n merge(this.attribute[key], params[key]);\n } else {\n this.attribute[key] = params[key];\n }\n }\n }\n\n protected bindEvents() {\n // please override\n }\n\n protected abstract render(): void;\n\n // 图形元素 id\n protected _getNodeId(id: string) {\n return `${this.id ?? this._uid}-${this.name}-${id}`;\n }\n\n // 用于 emit 组件自己的事件\n protected _dispatchEvent(eventName: string, details?: Dict<any>) {\n // 封装事件\n const changeEvent = new CustomEvent(eventName, details);\n // FIXME: 需要在 vrender 的事件系统支持\n // @ts-ignore\n changeEvent.manager = this.stage?.eventSystem.manager;\n\n this.dispatchEvent(changeEvent);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/core/base.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAG3E,MAAM,gBAAgB,GAAG;IACvB,GAAG;IACH,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,YAAY;IACZ,SAAS;IACT,MAAM;IACN,UAAU;IACV,kBAAkB;IAClB,QAAQ;IACR,QAAQ;CACT,CAAC;AAEF,MAAM,OAAgB,iBAA6E,SAAQ,KAAK;IAO9G,YAAY,UAAa,EAAE,OAA0B;QACnD,KAAK,CAAC,UAAU,CAAC,CAAC;QAElB,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;YACjB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YAEzB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAC5B;QAED,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAE;YACxB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;SACzB;QAED,IAAI,CAAC,QAAQ,CAAC;YACZ,MAAM,EAAE;gBACN,kBAAkB,EAAE,CAAC;aACtB;SACF,CAAC,CAAC;QACH,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC;QAE5B,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE;YACnB,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;IASD,YAAY,CAAC,GAAW,EA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S,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE;gBACtG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;aACzC;iBAAM;gBACL,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;aACnC;SACF;IACH,CAAC;IAES,UAAU;IAEpB,CAAC;IAKS,UAAU,CAAC,EAAU;;QAC7B,OAAO,GAAG,MAAA,IAAI,CAAC,EAAE,mCAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;IACtD,CAAC;IAGS,cAAc,CAAC,SAAiB,EAAE,OAAmB;;QAE7D,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAGxD,WAAW,CAAC,OAAO,GAAG,MAAA,IAAI,CAAC,KAAK,0CAAE,WAAW,CAAC,OAAO,CAAC;QAEtD,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAClC,CAAC;CACF","file":"base.js","sourcesContent":["/**\n * @description 组件基类\n */\nimport type { IGroupGraphicAttribute, ISetAttributeContext } from '@visactor/vrender-core';\nimport { Group, CustomEvent } from '@visactor/vrender-core';\nimport type { Dict } from '@visactor/vutils';\nimport { merge, isFunction, isPlainObject, isNil } from '@visactor/vutils';\nimport type { ComponentOptions } from '../interface';\n\nconst GROUP_ATTRIBUTES = [\n 'x',\n 'y',\n 'dx',\n 'dy',\n 'scaleX',\n 'scaleY',\n 'angle',\n 'anchor',\n 'postMatrix',\n 'visible',\n 'clip',\n 'pickable',\n 'childrenPickable',\n 'zIndex',\n 'cursor'\n];\n\nexport abstract class AbstractComponent<T extends IGroupGraphicAttribute = IGroupGraphicAttribute> extends Group {\n declare attribute: Partial<T>;\n\n protected mode?: '2d' | '3d';\n\n protected skipDefault?: boolean;\n\n constructor(attributes: T, options?: ComponentOptions) {\n super(attributes);\n\n if (options?.mode) {\n this.mode = options.mode;\n\n this.setMode(options.mode);\n }\n\n if (options?.skipDefault) {\n this.skipDefault = true;\n }\n // 组件需要精准 bounds,所以将这个 strokeBoundsBuffer 设置为 0,否则会影响包围盒的获取\n this.setTheme({\n common: {\n strokeBoundsBuffer: 0\n }\n });\n this.attribute = attributes;\n // 这里调用渲染和事件绑定逻辑\n this.onSetStage(() => {\n this.render();\n this.bindEvents();\n });\n }\n\n /**\n * @override\n * 更新单个属性值\n * @param key\n * @param value\n * @param forceUpdateTag\n */\n setAttribute(key: string, value: any, forceUpdateTag?: boolean | undefined, context?: ISetAttributeContext): void {\n const params =\n this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({ [key]: value }, this.attribute, key, context);\n if (params) {\n return this._setAttributes(params as Partial<T>, forceUpdateTag);\n }\n\n // overwrite when previous or next attribute is function\n if (\n isPlainObject(this.attribute[key]) &&\n isPlainObject(value) &&\n !isFunction(this.attribute[key]) &&\n !isFunction(value)\n ) {\n merge(this.attribute[key], value);\n } else {\n this.attribute[key] = value;\n }\n\n // HACK: 待优化\n if (!GROUP_ATTRIBUTES.includes(key as string)) {\n this.render();\n }\n\n this.valid = this.isValid();\n if (!this.updateShapeAndBoundsTagSetted() && (forceUpdateTag || this.needUpdateTag(key as string))) {\n this.addUpdateShapeAndBoundsTag();\n } else {\n this.addUpdateBoundTag();\n }\n this.addUpdatePositionTag();\n this.onAttributeUpdate();\n }\n\n setAttributes(params: Partial<T>, forceUpdateTag?: boolean | undefined, context?: ISetAttributeContext): void {\n params =\n (this.onBeforeAttributeUpdate &&\n (this.onBeforeAttributeUpdate(params, this.attribute, null, context) as Partial<T>)) ||\n params;\n return this._setAttributes(params, forceUpdateTag);\n }\n\n // @ts-ignore\n _setAttributes(params: Partial<T>, forceUpdateTag?: boolean | undefined): void {\n const keys = Object.keys(params) as (keyof T)[];\n this._mergeAttributes(params, keys);\n\n // HACK: 待优化\n if (!keys.every(key => GROUP_ATTRIBUTES.includes(key as string))) {\n this.render();\n }\n\n this.valid = this.isValid();\n // 没有设置shape&bounds的tag\n if (!this.updateShapeAndBoundsTagSetted() && (forceUpdateTag || this.needUpdateTags(keys as string[]))) {\n this.addUpdateShapeAndBoundsTag();\n } else {\n this.addUpdateBoundTag();\n }\n this.addUpdatePositionTag();\n this.onAttributeUpdate();\n }\n\n protected _mergeAttributes(params: Partial<T>, keys?: (keyof T)[]) {\n if (isNil(keys)) {\n keys = Object.keys(params) as (keyof T)[];\n }\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i] as keyof Partial<T>;\n // overwrite when previous or next attribute is function\n if (isPlainObject(this.attribute[key]) && !isFunction(this.attribute[key]) && !isFunction(params[key])) {\n merge(this.attribute[key], params[key]);\n } else {\n this.attribute[key] = params[key];\n }\n }\n }\n\n protected bindEvents() {\n // please override\n }\n\n protected abstract render(): void;\n\n // 图形元素 id\n protected _getNodeId(id: string) {\n return `${this.id ?? this._uid}-${this.name}-${id}`;\n }\n\n // 用于 emit 组件自己的事件\n protected _dispatchEvent(eventName: string, details?: Dict<any>) {\n // 封装事件\n const changeEvent = new CustomEvent(eventName, details);\n // FIXME: 需要在 vrender 的事件系统支持\n // @ts-ignore\n changeEvent.manager = this.stage?.eventSystem.manager;\n\n this.dispatchEvent(changeEvent);\n }\n}\n"]}
package/es/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.21.5-vstory.1";
1
+ export declare const version = "0.21.6-alpha.1";
2
2
  export * from './core/base';
3
3
  export * from './core/type';
4
4
  export * from './scrollbar';
@@ -26,5 +26,4 @@ export * from './jsx';
26
26
  export * from './checkbox';
27
27
  export * from './radio';
28
28
  export * from './empty-tip';
29
- export * from './weather';
30
29
  export * from './util';
package/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export const version = "0.21.5-vstory.1";
1
+ export const version = "0.21.6-alpha.1";
2
2
 
3
3
  export * from "./core/base";
4
4
 
@@ -54,7 +54,5 @@ export * from "./radio";
54
54
 
55
55
  export * from "./empty-tip";
56
56
 
57
- export * from "./weather";
58
-
59
57
  export * from "./util";
60
58
  //# sourceMappingURL=index.js.map
package/es/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,iBAAiB,CAAC;AAEzC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.21.5-vstory.1\";\n\nexport * from './core/base';\nexport * from './core/type';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './timeline';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './weather';\nexport * from './util';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAExC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.21.6-alpha.1\";\n\nexport * from './core/base';\nexport * from './core/type';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './timeline';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './util';\n"]}
package/es/interface.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ICustomPath2D, IGraphicAttribute, IGroup, IRectGraphicAttribute, ITimeline } from '@visactor/vrender-core';
1
+ import type { ICustomPath2D, IGraphicAttribute, IGroup, IRectGraphicAttribute } from '@visactor/vrender-core';
2
2
  export type Direction = 'horizontal' | 'vertical';
3
3
  export type OrientType = 'top' | 'right' | 'bottom' | 'left';
4
4
  export type BackgroundAttributes = {
@@ -9,5 +9,4 @@ export type IDelayType = 'debounce' | 'throttle';
9
9
  export interface ComponentOptions {
10
10
  skipDefault?: boolean;
11
11
  mode?: '2d' | '3d';
12
- timeline?: ITimeline;
13
12
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type {\n ICustomPath2D,\n IGraphicAttribute,\n IGroup,\n IRectGraphicAttribute,\n IRichText,\n IText,\n ITimeline\n} from '@visactor/vrender-core';\n\nexport type Direction = 'horizontal' | 'vertical';\n\nexport type OrientType = 'top' | 'right' | 'bottom' | 'left';\n\nexport type BackgroundAttributes = {\n /**\n * 是否绘制背景层\n */\n visible: boolean;\n /**\n * 自定义路径\n * @since 0.19.19\n */\n customShape?: (container: IGroup, attrs: Partial<IGraphicAttribute>, path: ICustomPath2D) => ICustomPath2D;\n} & Partial<IRectGraphicAttribute>;\n\nexport type IDelayType = 'debounce' | 'throttle';\n\nexport interface ComponentOptions {\n /** skip default attributes of component */\n skipDefault?: boolean;\n /** the mode of component, only axis support 3d mode now */\n mode?: '2d' | '3d';\n /* 传递一个独立的timeline */\n timeline?: ITimeline;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { ICustomPath2D, IGraphicAttribute, IGroup, IRectGraphicAttribute } from '@visactor/vrender-core';\n\nexport type Direction = 'horizontal' | 'vertical';\n\nexport type OrientType = 'top' | 'right' | 'bottom' | 'left';\n\nexport type BackgroundAttributes = {\n /**\n * 是否绘制背景层\n */\n visible: boolean;\n /**\n * 自定义路径\n * @since 0.19.19\n */\n customShape?: (container: IGroup, attrs: Partial<IGraphicAttribute>, path: ICustomPath2D) => ICustomPath2D;\n} & Partial<IRectGraphicAttribute>;\n\nexport type IDelayType = 'debounce' | 'throttle';\n\nexport interface ComponentOptions {\n /** skip default attributes of component */\n skipDefault?: boolean;\n /** the mode of component, only axis support 3d mode now */\n mode?: '2d' | '3d';\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vrender-components",
3
- "version": "0.21.5-vstory.1",
3
+ "version": "0.21.6-alpha.1",
4
4
  "description": "components library for dp visualization",
5
5
  "sideEffects": false,
6
6
  "main": "cjs/index.js",
@@ -14,8 +14,8 @@
14
14
  "dependencies": {
15
15
  "@visactor/vutils": "~0.19.2",
16
16
  "@visactor/vscale": "~0.19.2",
17
- "@visactor/vrender-core": "0.21.5-vstory.1",
18
- "@visactor/vrender-kits": "0.21.5-vstory.1"
17
+ "@visactor/vrender-core": "0.21.6-alpha.1",
18
+ "@visactor/vrender-kits": "0.21.6-alpha.1"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@rushstack/eslint-patch": "~1.1.4",
@@ -29,9 +29,9 @@
29
29
  "vite": "3.2.6",
30
30
  "typescript": "4.9.5",
31
31
  "cross-env": "^7.0.3",
32
- "@internal/bundler": "0.0.1",
33
32
  "@internal/eslint-config": "0.0.1",
34
- "@internal/ts-config": "0.0.1"
33
+ "@internal/ts-config": "0.0.1",
34
+ "@internal/bundler": "0.0.1"
35
35
  },
36
36
  "keywords": [
37
37
  "VisActor",
@@ -1 +0,0 @@
1
- export * from './weather-box';
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
4
- void 0 === k2 && (k2 = k);
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
7
- enumerable: !0,
8
- get: function() {
9
- return m[k];
10
- }
11
- }), Object.defineProperty(o, k2, desc);
12
- } : function(o, m, k, k2) {
13
- void 0 === k2 && (k2 = k), o[k2] = m[k];
14
- }), __exportStar = this && this.__exportStar || function(m, exports) {
15
- for (var p in m) "default" === p || Object.prototype.hasOwnProperty.call(exports, p) || __createBinding(exports, m, p);
16
- };
17
-
18
- Object.defineProperty(exports, "__esModule", {
19
- value: !0
20
- }), __exportStar(require("./weather-box"), exports);
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/weather/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B","file":"index.js","sourcesContent":["export * from './weather-box';\n"]}
@@ -1 +0,0 @@
1
- export declare function loadWeatherComponent(): void;
@@ -1,14 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: !0
5
- }), exports.loadWeatherComponent = void 0;
6
-
7
- const vrender_kits_1 = require("@visactor/vrender-kits");
8
-
9
- function loadWeatherComponent() {
10
- (0, vrender_kits_1.registerGroup)(), (0, vrender_kits_1.registerSymbol)();
11
- }
12
-
13
- exports.loadWeatherComponent = loadWeatherComponent;
14
- //# sourceMappingURL=register.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/weather/register.ts"],"names":[],"mappings":";;;AAAA,yDAAuE;AAEvE,SAAgB,oBAAoB;IAClC,IAAA,4BAAa,GAAE,CAAC;IAChB,IAAA,6BAAc,GAAE,CAAC;AACnB,CAAC;AAHD,oDAGC","file":"register.js","sourcesContent":["import { registerGroup, registerSymbol } from '@visactor/vrender-kits';\n\nexport function loadWeatherComponent() {\n registerGroup();\n registerSymbol();\n}\n"]}
@@ -1,24 +0,0 @@
1
- import type { IGroupGraphicAttribute, ISymbolGraphicAttribute } from '@visactor/vrender-core';
2
- export interface IWeatherBoxAttrs extends IGroupGraphicAttribute {
3
- rainIconPath?: string;
4
- snowIconPath?: string;
5
- windIconPath?: string;
6
- width: number;
7
- height: number;
8
- rainSizeRange?: [number, number];
9
- snowSizeRange?: [number, number];
10
- windSize?: number;
11
- rainSpeed?: number;
12
- snowSpeed?: number;
13
- windSpeed?: number;
14
- snowRainBottomPadding?: number;
15
- rainRatio?: number;
16
- rainCountThreshold?: number;
17
- snowRatio?: number;
18
- snowCountThreshold?: number;
19
- windRatio?: number;
20
- windAnimateEffect?: 'fade' | 'clipRange';
21
- rainStyle?: ISymbolGraphicAttribute;
22
- snowStyle?: ISymbolGraphicAttribute;
23
- windStyle?: ISymbolGraphicAttribute;
24
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: !0
5
- });
6
- //# sourceMappingURL=type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/weather/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type { IGroupGraphicAttribute, IRectGraphicAttribute, ISymbolGraphicAttribute } from '@visactor/vrender-core';\n\nexport interface IWeatherBoxAttrs extends IGroupGraphicAttribute {\n rainIconPath?: string;\n snowIconPath?: string;\n windIconPath?: string;\n width: number;\n height: number;\n rainSizeRange?: [number, number];\n snowSizeRange?: [number, number];\n windSize?: number;\n rainSpeed?: number;\n snowSpeed?: number;\n windSpeed?: number;\n\n snowRainBottomPadding?: number;\n\n rainRatio?: number;\n rainCountThreshold?: number;\n snowRatio?: number;\n snowCountThreshold?: number;\n windRatio?: number;\n\n windAnimateEffect?: 'fade' | 'clipRange';\n\n rainStyle?: ISymbolGraphicAttribute;\n snowStyle?: ISymbolGraphicAttribute;\n windStyle?: ISymbolGraphicAttribute;\n}\n"]}
@@ -1,13 +0,0 @@
1
- import { AbstractComponent } from '../core/base';
2
- import type { IWeatherBoxAttrs } from './type';
3
- import type { ComponentOptions } from '../interface';
4
- import { type IGroup, type ITimeline } from '@visactor/vrender-core';
5
- export declare class WeatherBox extends AbstractComponent<Required<IWeatherBoxAttrs>> {
6
- name: string;
7
- static defaultAttributes: Partial<IWeatherBoxAttrs>;
8
- timeline: ITimeline;
9
- constructor(attributes: IWeatherBoxAttrs, options?: ComponentOptions);
10
- protected render(): void;
11
- protected generateWind(windRatio: number, windIconPath: string, group: IGroup, size: number, speed: number): void;
12
- protected generateRainOrSnow(type: string, ratio: number, threshold: number, windRatio: number, group: IGroup, path: string, windAngle: number, sizeRange: [number, number], speed: number): void;
13
- }