@visactor/vchart 2.0.9 → 2.0.10-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 (52) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +269 -55
  3. package/build/index.js +269 -55
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/chart/box-plot/box-plot-transformer.js +1 -1
  7. package/cjs/chart/box-plot/box-plot-transformer.js.map +1 -1
  8. package/cjs/component/custom-mark/custom-mark.js +2 -2
  9. package/cjs/component/custom-mark/custom-mark.js.map +1 -1
  10. package/cjs/component/tooltip/utils/show-tooltip.js +3 -3
  11. package/cjs/component/tooltip/utils/show-tooltip.js.map +1 -1
  12. package/cjs/core/index.d.ts +1 -1
  13. package/cjs/core/index.js +1 -1
  14. package/cjs/core/index.js.map +1 -1
  15. package/cjs/mark/base/base-mark.d.ts +1 -1
  16. package/cjs/mark/base/base-mark.js +3 -3
  17. package/cjs/mark/base/base-mark.js.map +1 -1
  18. package/cjs/series/base/base-series.js +3 -3
  19. package/cjs/series/base/base-series.js.map +1 -1
  20. package/cjs/series/box-plot/box-plot.d.ts +3 -1
  21. package/cjs/series/box-plot/box-plot.js +54 -29
  22. package/cjs/series/box-plot/box-plot.js.map +1 -1
  23. package/cjs/series/box-plot/interface.d.ts +7 -2
  24. package/cjs/series/box-plot/interface.js.map +1 -1
  25. package/cjs/theme/token/builtin/default.js +1 -1
  26. package/cjs/theme/token/builtin/default.js.map +1 -1
  27. package/cjs/typings/visual.d.ts +3 -3
  28. package/cjs/typings/visual.js.map +1 -1
  29. package/esm/chart/box-plot/box-plot-transformer.js +1 -1
  30. package/esm/chart/box-plot/box-plot-transformer.js.map +1 -1
  31. package/esm/component/custom-mark/custom-mark.js +2 -2
  32. package/esm/component/custom-mark/custom-mark.js.map +1 -1
  33. package/esm/component/tooltip/utils/show-tooltip.js +3 -3
  34. package/esm/component/tooltip/utils/show-tooltip.js.map +1 -1
  35. package/esm/core/index.d.ts +1 -1
  36. package/esm/core/index.js +1 -1
  37. package/esm/core/index.js.map +1 -1
  38. package/esm/mark/base/base-mark.d.ts +1 -1
  39. package/esm/mark/base/base-mark.js +3 -3
  40. package/esm/mark/base/base-mark.js.map +1 -1
  41. package/esm/series/base/base-series.js +3 -3
  42. package/esm/series/base/base-series.js.map +1 -1
  43. package/esm/series/box-plot/box-plot.d.ts +3 -1
  44. package/esm/series/box-plot/box-plot.js +56 -29
  45. package/esm/series/box-plot/box-plot.js.map +1 -1
  46. package/esm/series/box-plot/interface.d.ts +7 -2
  47. package/esm/series/box-plot/interface.js.map +1 -1
  48. package/esm/theme/token/builtin/default.js +1 -1
  49. package/esm/theme/token/builtin/default.js.map +1 -1
  50. package/esm/typings/visual.d.ts +3 -3
  51. package/esm/typings/visual.js.map +1 -1
  52. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/series/box-plot/box-plot.ts"],"names":[],"mappings":";;;AACA,wDAA0D;AAC1D,8CAAyD;AACzD,8CAA6C;AAI7C,4CAAqD;AACrD,sDAAyD;AAEzD,4CAAuE;AAEvE,4DAAgE;AAChE,kDAAuE;AACvE,iDAA8C;AAC9C,6DAAiE;AACjE,sDAAuE;AACvE,qDAA8D;AAC9D,qEAAuE;AACvE,6DAAwE;AACxE,iDAA6E;AAC7E,mDAAqE;AAErE,kDAA0D;AAC1D,8CAAuD;AACvD,yCAA+C;AAC/C,gDAA6C;AAE7C,6CAAmD;AACnD,yCAAwD;AACxD,8DAAwG;AAExG,6CAAoD;AACpD,2CAA2D;AAC3D,yEAAqE;AAErE,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,0BAA0B,GAAG,GAAG,CAAC;AACvC,MAAM,mBAAmB,GAAG,MAAM,CAAC;AACtB,QAAA,kBAAkB,GAAG,MAAM,CAAC;AAC5B,QAAA,oBAAoB,GAAG,MAAM,CAAC;AAE3C,MAAM,oBA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AO,CAAC;AAGtC,0BAAY,GAAG,EAAE,OAAO,EAAP,kBAAO,EAAE,CAAC;AAC3B,kBAAI,GAAkB,4BAAiB,CAAC;AAuWnD,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,IAAA,8BAAmB,GAAE,CAAC;IACtB,IAAA,2BAAkB,GAAE,CAAC;IACrB,IAAA,oCAA2B,GAAE,CAAC;IAC9B,IAAA,qCAAyB,GAAE,CAAC;IAC5B,IAAA,uCAA2B,GAAE,CAAC;IAC9B,IAAA,wCAA4B,GAAE,CAAC;IAC/B,iBAAO,CAAC,cAAc,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;AAC5D,CAAC,CAAC;AARW,QAAA,qBAAqB,yBAQhC","file":"box-plot.js","sourcesContent":["/* eslint-disable no-duplicate-imports */\nimport { AttributeLevel } from '../../constant/attribute';\nimport { DEFAULT_DATA_INDEX } from '../../constant/data';\nimport { PREFIX } from '../../constant/base';\nimport type { IModelEvaluateOption, IModelInitOption } from '../../model/interface';\nimport type { BoxPlotShaftShape, IOutlierMarkSpec, Datum } from '../../typings';\nimport { Direction } from '../../typings/space';\nimport { valueInScaleRange } from '../../util/scale';\nimport { CartesianSeries } from '../cartesian/cartesian';\nimport type { SeriesMarkMap } from '../interface';\nimport { SeriesMarkNameEnum, SeriesTypeEnum } from '../interface/type';\nimport type { IBoxPlotSeriesSpec } from './interface';\nimport { STATE_VALUE_ENUM } from '../../compile/mark/interface';\nimport { registerDataSetInstanceTransform } from '../../data/register';\nimport { DataView } from '@visactor/vdataset';\nimport { foldOutlierData } from '../../data/transforms/box-plot';\nimport { BOX_PLOT_OUTLIER_VALUE_FIELD } from '../../constant/box-plot';\nimport { BoxPlotSeriesTooltipHelper } from './tooltip-helper';\nimport { addVChartProperty } from '../../data/transforms/add-property';\nimport { addDataKey, initKeyMap } from '../../data/transforms/data-key';\nimport { animationConfig, userAnimationConfig } from '../../animation/utils';\nimport { registerScaleInOutAnimation } from '../../animation/config';\nimport type { IMarkAnimateSpec } from '../../animation/spec';\nimport { registerBoxPlotMark } from '../../mark/box-plot';\nimport { registerSymbolMark } from '../../mark/symbol';\nimport { boxPlotSeriesMark } from './constant';\nimport { Factory } from '../../core/factory';\nimport type { IBoxPlotMark, IGlyphMark, IMark, ISymbolMark } from '../../mark/interface';\nimport { merge, isNumber } from '@visactor/vutils';\nimport { getGroupAnimationParams } from '../util/utils';\nimport { registerCartesianLinearAxis, registerCartesianBandAxis } from '../../component/axis/cartesian';\nimport type { ICompilableData } from '../../compile/data';\nimport { CompilableData } from '../../compile/data';\nimport { registeBoxPlotScaleAnimation } from './animation';\nimport { boxPlot } from '../../theme/builtin/common/series/box-plot';\n\nconst DEFAULT_STROKE_WIDTH = 2;\nconst DEFAULT_SHAFT_FILL_OPACITY = 0.5;\nconst DEFAULT_SHAFT_SHAPE = 'line';\nexport const DEFAULT_FILL_COLOR = '#FFF';\nexport const DEFAULT_STROKE_COLOR = '#000';\n\nconst DEFAULT_OUTLIER_SIZE = 10;\n\nexport class BoxPlotSeries<T extends IBoxPlotSeriesSpec = IBoxPlotSeriesSpec> extends CartesianSeries<T> {\n static readonly type: string = SeriesTypeEnum.boxPlot;\n type = SeriesTypeEnum.boxPlot;\n\n static readonly builtInTheme = { boxPlot };\n static readonly mark: SeriesMarkMap = boxPlotSeriesMark;\n\n protected _minField: string;\n getMinField() {\n return this._minField;\n }\n protected _maxField: string;\n getMaxField() {\n return this._maxField;\n }\n protected _q1Field: string;\n getQ1Field() {\n return this._q1Field;\n }\n protected _medianField: string;\n getMedianField() {\n return this._medianField;\n }\n protected _q3Field: string;\n getQ3Field() {\n return this._q3Field;\n }\n protected _outliersField: string;\n getOutliersField() {\n return this._outliersField;\n }\n protected _lineWidth: number;\n protected _boxWidth: number;\n protected _shaftShape: BoxPlotShaftShape;\n getShaftShape() {\n return this._shaftShape;\n }\n protected _shaftWidth: number;\n protected _boxFillColor: string;\n getBoxFillColor() {\n return this._boxFillColor;\n }\n protected _strokeColor: string;\n getStrokeColor() {\n return this._strokeColor;\n }\n protected _shaftFillOpacity: number;\n protected _outliersStyle: IOutlierMarkSpec;\n getOutliersStyle() {\n return this._outliersStyle;\n }\n protected _outlierDataView: ICompilableData;\n\n private _autoBoxWidth: number;\n\n /**\n * @override\n */\n setAttrFromSpec() {\n super.setAttrFromSpec();\n const boxPlotStyle: any = this._spec.boxPlot?.style ?? {};\n this._minField = this._spec.minField;\n this._maxField = this._spec.maxField;\n this._q1Field = this._spec.q1Field;\n this._medianField = this._spec.medianField;\n this._q3Field = this._spec.q3Field;\n this._outliersField = this._spec.outliersField;\n this._lineWidth = boxPlotStyle.lineWidth ?? DEFAULT_STROKE_WIDTH;\n this._boxWidth = boxPlotStyle.boxWidth;\n this._shaftShape = boxPlotStyle.shaftShape ?? DEFAULT_SHAFT_SHAPE;\n this._shaftWidth = boxPlotStyle.shaftWidth;\n this._boxFillColor = boxPlotStyle.boxFill;\n this._strokeColor = boxPlotStyle.stroke;\n\n this._shaftFillOpacity =\n this._shaftShape === 'bar' ? boxPlotStyle.shaftFillOpacity ?? DEFAULT_SHAFT_FILL_OPACITY : undefined;\n\n this._outliersStyle = this._spec.outliersStyle;\n }\n\n private _boxPlotMark?: IBoxPlotMark;\n private _outlierMark?: ISymbolMark;\n\n initMark(): void {\n this._boxPlotMark = this._createMark(BoxPlotSeries.mark.boxPlot, {\n groupKey: this._seriesField,\n isSeriesMark: true\n }) as IBoxPlotMark;\n if (this._outliersField) {\n this._outlierMark = this._createMark(BoxPlotSeries.mark.outlier, {\n key: DEFAULT_DATA_INDEX,\n groupKey: this._seriesField,\n dataView: this._outlierDataView.getDataView(),\n dataProductId: this._outlierDataView.getProductId()\n }) as ISymbolMark;\n }\n }\n\n initMarkStyle(): void {\n const boxPlotMark = this._boxPlotMark;\n if (boxPlotMark) {\n const commonBoxplotStyles = {\n lineWidth: this._lineWidth,\n fill: this._boxFillColor ?? (this._shaftShape === 'line' ? DEFAULT_FILL_COLOR : this.getColorAttribute()),\n minMaxFillOpacity: this._shaftFillOpacity,\n stroke: this._strokeColor ?? (this._shaftShape === 'line' ? this.getColorAttribute() : DEFAULT_STROKE_COLOR)\n };\n\n (boxPlotMark as IGlyphMark).setGlyphConfig({\n direction: this._direction,\n shaftShape: this._shaftShape\n });\n\n const boxPlotMarkStyles =\n this._direction === Direction.horizontal\n ? {\n y: this.dataToPositionY.bind(this),\n ...commonBoxplotStyles,\n boxHeight: () => this._boxWidth ?? this._getMarkWidth(),\n ruleHeight: () => this._shaftWidth ?? this._getMarkWidth(),\n q1q3Height: () => this._boxWidth ?? this._getMarkWidth(),\n minMaxHeight: () => this._shaftWidth ?? this._getMarkWidth()\n }\n : {\n x: this.dataToPositionX.bind(this),\n ...commonBoxplotStyles,\n boxWidth: () => this._boxWidth ?? this._getMarkWidth(),\n ruleWidth: () => this._shaftWidth ?? this._getMarkWidth(),\n q1q3Width: () => this._boxWidth ?? this._getMarkWidth(),\n minMaxWidth: () => this._shaftWidth ?? this._getMarkWidth()\n };\n this.setMarkStyle(boxPlotMark, boxPlotMarkStyles, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Series);\n }\n\n const outlierMark = this._outlierMark;\n if (outlierMark) {\n this.setMarkStyle(\n outlierMark,\n {\n fill: this._outliersStyle?.fill ?? this.getColorAttribute(),\n size: isNumber(this._outliersStyle?.size) ? this._outliersStyle.size : DEFAULT_OUTLIER_SIZE,\n symbolType: 'circle'\n },\n STATE_VALUE_ENUM.STATE_NORMAL,\n AttributeLevel.Series\n );\n }\n }\n\n initBoxPlotMarkStyle(): void {\n const boxPlotMark = this._boxPlotMark;\n const axisHelper = this._direction === Direction.horizontal ? this._xAxisHelper : this._yAxisHelper;\n if (boxPlotMark && axisHelper) {\n const { dataToPosition } = axisHelper;\n const scale = axisHelper?.getScale?.(0);\n this.setMarkStyle(\n boxPlotMark,\n {\n min: (datum: Datum) =>\n valueInScaleRange(\n dataToPosition(this.getDatumPositionValues(datum, this._minField), {\n bandPosition: this._bandPosition\n }),\n scale\n ),\n q1: (datum: Datum) =>\n valueInScaleRange(\n dataToPosition(this.getDatumPositionValues(datum, this._q1Field), {\n bandPosition: this._bandPosition\n }),\n scale\n ),\n median: (datum: Datum) =>\n valueInScaleRange(\n dataToPosition(this.getDatumPositionValues(datum, this._medianField), {\n bandPosition: this._bandPosition\n }),\n scale\n ),\n q3: (datum: Datum) =>\n valueInScaleRange(\n dataToPosition(this.getDatumPositionValues(datum, this._q3Field), {\n bandPosition: this._bandPosition\n }),\n scale\n ),\n max: (datum: Datum) =>\n valueInScaleRange(\n dataToPosition(this.getDatumPositionValues(datum, this._maxField), {\n bandPosition: this._bandPosition\n }),\n scale\n )\n },\n STATE_VALUE_ENUM.STATE_NORMAL,\n AttributeLevel.Series\n );\n }\n const outlierMark = this._outlierMark;\n if (outlierMark && axisHelper) {\n const { dataToPosition } = axisHelper;\n const scale = axisHelper?.getScale?.(0);\n const outlierMarkPositionChannel =\n this._direction === Direction.horizontal\n ? {\n y: this.dataToPositionY.bind(this),\n x: (datum: Datum) =>\n valueInScaleRange(\n dataToPosition(this.getDatumPositionValues(datum, BOX_PLOT_OUTLIER_VALUE_FIELD), {\n bandPosition: this._bandPosition\n }),\n scale\n )\n }\n : {\n x: this.dataToPositionX.bind(this),\n y: (datum: Datum) =>\n valueInScaleRange(\n dataToPosition(this.getDatumPositionValues(datum, BOX_PLOT_OUTLIER_VALUE_FIELD), {\n bandPosition: this._bandPosition\n }),\n scale\n )\n };\n this.setMarkStyle(outlierMark, outlierMarkPositionChannel, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Series);\n }\n }\n\n initData(): void {\n super.initData();\n if (!this._data) {\n return;\n }\n\n registerDataSetInstanceTransform(this._dataSet, 'foldOutlierData', foldOutlierData);\n registerDataSetInstanceTransform(this._dataSet, 'addVChartProperty', addVChartProperty);\n\n const outlierDataView = new DataView(this._dataSet, { name: `${this.type}_outlier_${this.id}_data` });\n outlierDataView.parse([this.getViewData()], {\n type: 'dataview'\n });\n outlierDataView.name = `${PREFIX}_series_${this.id}_outlierData`;\n outlierDataView.transform({\n type: 'foldOutlierData',\n options: {\n dimensionField: this._direction === Direction.horizontal ? this._fieldY : this._fieldX,\n outliersField: this._outliersField\n }\n });\n\n outlierDataView.transform(\n {\n type: 'addVChartProperty',\n options: {\n beforeCall: initKeyMap.bind(this),\n call: addDataKey\n }\n },\n false\n );\n\n this._outlierDataView = new CompilableData(this._option, outlierDataView);\n }\n\n compileData() {\n super.compileData();\n this._outlierDataView?.compile();\n }\n\n init(option: IModelInitOption): void {\n super.init(option);\n //init在axis初始化之后才被执行,此时axisHelper不为空\n this.initBoxPlotMarkStyle();\n }\n\n private _getMarkWidth() {\n if (this._autoBoxWidth) {\n return this._autoBoxWidth;\n }\n //获取自适应的图元宽度\n const bandAxisHelper = this._direction === Direction.horizontal ? this._yAxisHelper : this._xAxisHelper;\n const xField = this._direction === Direction.horizontal ? this._fieldY : this._fieldX;\n\n const innerBandWidth = bandAxisHelper.getBandwidth(xField.length - 1);\n const autoBoxWidth = innerBandWidth / xField.length;\n this._autoBoxWidth = autoBoxWidth;\n\n return this._autoBoxWidth;\n }\n\n onLayoutEnd() {\n super.onLayoutEnd();\n //每次布局结束,清除自适应宽度缓存\n this._autoBoxWidth = null;\n }\n\n private _initAnimationSpec(config: any = {}) {\n //将spec中的animation的type替换为箱型图的type\n const newConfig = merge({}, config);\n ['appear', 'enter', 'update', 'exit', 'disappear'].forEach(state => {\n if (newConfig[state] && newConfig[state].type === 'scaleIn') {\n newConfig[state].type = this._shaftShape === 'line' ? 'boxplotScaleIn' : 'barBoxplotScaleIn';\n } else if (newConfig[state] && newConfig[state].type === 'scaleOut') {\n newConfig[state].type = this._shaftShape === 'line' ? 'boxplotScaleOut' : 'barBoxplotScaleOut';\n }\n });\n return newConfig;\n }\n\n initAnimation() {\n const animationParams = getGroupAnimationParams(this);\n\n if (this._boxPlotMark) {\n const newDefaultConfig = this._initAnimationSpec(Factory.getAnimationInKey('scaleInOut')?.());\n const newConfig = this._initAnimationSpec(\n userAnimationConfig(SeriesMarkNameEnum.boxPlot, this._spec, this._markAttributeContext)\n );\n this._boxPlotMark.setAnimationConfig(animationConfig(newDefaultConfig, newConfig, animationParams));\n }\n\n if (this._outlierMark) {\n const outlierMarkUserAnimation = {\n appear: (this._spec.animationAppear as IMarkAnimateSpec<string>)?.symbol,\n disappear: (this._spec.animationDisappear as IMarkAnimateSpec<string>)?.symbol,\n enter: (this._spec.animationEnter as IMarkAnimateSpec<string>)?.symbol,\n exit: (this._spec.animationExit as IMarkAnimateSpec<string>)?.symbol,\n update: (this._spec.animationUpdate as IMarkAnimateSpec<string>)?.symbol\n };\n this._outlierMark.setAnimationConfig(\n animationConfig(Factory.getAnimationInKey('scaleInOut')?.(), outlierMarkUserAnimation, animationParams)\n );\n }\n }\n\n protected initTooltip() {\n this._tooltipHelper = new BoxPlotSeriesTooltipHelper(this);\n this._boxPlotMark && this._tooltipHelper.activeTriggerSet.mark.add(this._boxPlotMark);\n this._outlierMark && this._tooltipHelper.activeTriggerSet.mark.add(this._outlierMark);\n }\n\n getStatisticFields() {\n const fields = super.getStatisticFields();\n const outliersField = fields.find(f => f.key === this._outliersField);\n if (outliersField) {\n outliersField.operations = ['array-min', 'array-max'];\n }\n return fields;\n }\n\n onEvaluateEnd(ctx: IModelEvaluateOption): void {\n //初次编译时,会传入空数据;待所有计算完成后,需要重新执行updateData更新数据\n super.onEvaluateEnd(ctx);\n this._outlierDataView.updateData();\n }\n\n getDefaultShapeType(): string {\n return 'square';\n }\n\n getActiveMarks(): IMark[] {\n return [this._boxPlotMark];\n }\n}\n\nexport const registerBoxplotSeries = () => {\n registerBoxPlotMark();\n registerSymbolMark();\n registerScaleInOutAnimation();\n registerCartesianBandAxis();\n registerCartesianLinearAxis();\n registeBoxPlotScaleAnimation();\n Factory.registerSeries(BoxPlotSeries.type, BoxPlotSeries);\n};\n"]}
1
+ {"version":3,"sources":["../src/series/box-plot/box-plot.ts"],"names":[],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iBAAO,CAAC,cAAc,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;AAC5D,CAAC,CAAC;AARW,QAAA,qBAAqB,yBAQhC","file":"box-plot.js","sourcesContent":["/* eslint-disable no-duplicate-imports */\nimport { AttributeLevel } from '../../constant/attribute';\nimport { DEFAULT_DATA_INDEX } from '../../constant/data';\nimport { PREFIX } from '../../constant/base';\nimport type { IModelEvaluateOption, IModelInitOption } from '../../model/interface';\nimport type { BoxPlotShaftShape, IOutlierMarkSpec, Datum, DirectionType } from '../../typings';\nimport { Direction } from '../../typings/space';\nimport { valueInScaleRange } from '../../util/scale';\nimport { CartesianSeries } from '../cartesian/cartesian';\nimport type { SeriesMarkMap } from '../interface';\nimport { SeriesMarkNameEnum, SeriesTypeEnum } from '../interface/type';\nimport type { IBoxPlotSeriesSpec } from './interface';\nimport { STATE_VALUE_ENUM } from '../../compile/mark/interface';\nimport { registerDataSetInstanceTransform } from '../../data/register';\nimport { DataView } from '@visactor/vdataset';\nimport { foldOutlierData } from '../../data/transforms/box-plot';\nimport { BOX_PLOT_OUTLIER_VALUE_FIELD } from '../../constant/box-plot';\nimport { BoxPlotSeriesTooltipHelper } from './tooltip-helper';\nimport { addVChartProperty } from '../../data/transforms/add-property';\nimport { addDataKey, initKeyMap } from '../../data/transforms/data-key';\nimport { animationConfig, userAnimationConfig } from '../../animation/utils';\nimport { registerScaleInOutAnimation } from '../../animation/config';\nimport type { IMarkAnimateSpec } from '../../animation/spec';\nimport { registerBoxPlotMark } from '../../mark/box-plot';\nimport { registerSymbolMark } from '../../mark/symbol';\nimport { boxPlotSeriesMark } from './constant';\nimport { Factory } from '../../core/factory';\nimport type { IBoxPlotMark, IGlyphMark, IMark, ISymbolMark } from '../../mark/interface';\nimport { merge, isNumber, isValid, isNil, array, last } from '@visactor/vutils';\nimport { getGroupAnimationParams } from '../util/utils';\nimport { registerCartesianLinearAxis, registerCartesianBandAxis } from '../../component/axis/cartesian';\nimport type { ICompilableData } from '../../compile/data';\nimport { CompilableData } from '../../compile/data';\nimport { registeBoxPlotScaleAnimation } from './animation';\nimport { boxPlot } from '../../theme/builtin/common/series/box-plot';\nimport { getActualNumValue } from '../../util/space';\nimport { isContinuous } from '@visactor/vscale';\n\nconst DEFAULT_STROKE_WIDTH = 2;\nconst DEFAULT_SHAFT_FILL_OPACITY = 0.5;\nconst DEFAULT_SHAFT_SHAPE = 'line';\nexport const DEFAULT_FILL_COLOR = '#FFF';\nexport const DEFAULT_STROKE_COLOR = '#000';\n\nconst DEFAULT_OUTLIER_SIZE = 10;\n\nexport class BoxPlotSeries<T extends IBoxPlotSeriesSpec = IBoxPlotSeriesSpec> extends CartesianSeries<T> {\n static readonly type: string = SeriesTypeEnum.boxPlot;\n type = SeriesTypeEnum.boxPlot;\n\n static readonly builtInTheme = { boxPlot };\n static readonly mark: SeriesMarkMap = boxPlotSeriesMark;\n\n protected _bandPosition = 0;\n protected _minField: string;\n getMinField() {\n return this._minField;\n }\n protected _maxField: string;\n getMaxField() {\n return this._maxField;\n }\n protected _q1Field: string;\n getQ1Field() {\n return this._q1Field;\n }\n protected _medianField: string;\n getMedianField() {\n return this._medianField;\n }\n protected _q3Field: string;\n getQ3Field() {\n return this._q3Field;\n }\n protected _outliersField: string;\n getOutliersField() {\n return this._outliersField;\n }\n protected _lineWidth: number;\n protected _boxWidth: number;\n protected _shaftShape: BoxPlotShaftShape;\n getShaftShape() {\n return this._shaftShape;\n }\n protected _shaftWidth: number;\n protected _boxFillColor: string;\n getBoxFillColor() {\n return this._boxFillColor;\n }\n protected _strokeColor: string;\n getStrokeColor() {\n return this._strokeColor;\n }\n protected _shaftFillOpacity: number;\n protected _outliersStyle: IOutlierMarkSpec;\n getOutliersStyle() {\n return this._outliersStyle;\n }\n protected _outlierDataView: ICompilableData;\n\n private _autoBoxWidth: number;\n\n /**\n * @override\n */\n setAttrFromSpec() {\n super.setAttrFromSpec();\n const boxPlotStyle: any = this._spec.boxPlot?.style ?? {};\n this._minField = this._spec.minField;\n this._maxField = this._spec.maxField;\n this._q1Field = this._spec.q1Field;\n this._medianField = this._spec.medianField;\n this._q3Field = this._spec.q3Field;\n this._outliersField = this._spec.outliersField;\n this._lineWidth = boxPlotStyle.lineWidth ?? DEFAULT_STROKE_WIDTH;\n this._boxWidth = boxPlotStyle.boxWidth;\n this._shaftShape = boxPlotStyle.shaftShape ?? DEFAULT_SHAFT_SHAPE;\n this._shaftWidth = boxPlotStyle.shaftWidth;\n this._boxFillColor = boxPlotStyle.boxFill;\n this._strokeColor = boxPlotStyle.stroke;\n\n this._shaftFillOpacity =\n this._shaftShape === 'bar' ? boxPlotStyle.shaftFillOpacity ?? DEFAULT_SHAFT_FILL_OPACITY : undefined;\n\n this._outliersStyle = (this._spec.outliersStyle ?? this._spec.outlier?.style) as IOutlierMarkSpec;\n }\n\n private _boxPlotMark?: IBoxPlotMark;\n private _outlierMark?: ISymbolMark;\n\n initMark(): void {\n this._boxPlotMark = this._createMark(BoxPlotSeries.mark.boxPlot, {\n groupKey: this._seriesField,\n isSeriesMark: true\n }) as IBoxPlotMark;\n if (this._outliersField) {\n this._outlierMark = this._createMark(BoxPlotSeries.mark.outlier, {\n key: DEFAULT_DATA_INDEX,\n groupKey: this._seriesField,\n dataView: this._outlierDataView.getDataView(),\n dataProductId: this._outlierDataView.getProductId()\n }) as ISymbolMark;\n }\n }\n\n initMarkStyle(): void {\n const boxPlotMark = this._boxPlotMark;\n if (boxPlotMark) {\n const commonBoxplotStyles = {\n lineWidth: this._lineWidth,\n fill: this._boxFillColor ?? (this._shaftShape !== 'line' ? this.getColorAttribute() : DEFAULT_FILL_COLOR),\n minMaxFillOpacity: this._shaftFillOpacity,\n stroke: this._strokeColor ?? (this._shaftShape !== 'line' ? DEFAULT_STROKE_COLOR : this.getColorAttribute())\n };\n\n (boxPlotMark as IGlyphMark).setGlyphConfig({\n direction: this._direction,\n shaftShape: this._shaftShape\n });\n\n const boxPlotMarkStyles =\n this._direction === Direction.horizontal\n ? {\n y: (datum: Datum) => this._getPosition(this.direction, datum),\n boxHeight: () => getActualNumValue(this._boxWidth ?? '100%', this._getMarkWidth()),\n ruleHeight: () => getActualNumValue(this._shaftWidth ?? '100%', this._getMarkWidth()),\n q1q3Height: () => getActualNumValue(this._boxWidth ?? '100%', this._getMarkWidth()),\n minMaxHeight: () => getActualNumValue(this._shaftWidth ?? '100%', this._getMarkWidth())\n }\n : {\n x: (datum: Datum) => this._getPosition(this.direction, datum),\n boxWidth: () => getActualNumValue(this._boxWidth ?? '100%', this._getMarkWidth()),\n ruleWidth: () => getActualNumValue(this._shaftWidth ?? '100%', this._getMarkWidth()),\n q1q3Width: () => getActualNumValue(this._boxWidth ?? '100%', this._getMarkWidth()),\n minMaxWidth: () => getActualNumValue(this._shaftWidth ?? '100%', this._getMarkWidth())\n };\n\n this.setMarkStyle(boxPlotMark, commonBoxplotStyles, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Series);\n this.setMarkStyle(boxPlotMark, boxPlotMarkStyles, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Built_In);\n }\n\n const outlierMark = this._outlierMark;\n if (outlierMark) {\n this.setMarkStyle(\n outlierMark,\n {\n fill: this._outliersStyle?.fill ?? this.getColorAttribute(),\n size: isNumber(this._outliersStyle?.size) ? this._outliersStyle.size : DEFAULT_OUTLIER_SIZE\n },\n STATE_VALUE_ENUM.STATE_NORMAL,\n AttributeLevel.Series\n );\n }\n }\n\n initBoxPlotMarkStyle(): void {\n const boxPlotMark = this._boxPlotMark;\n const axisHelper = this._direction === Direction.horizontal ? this._xAxisHelper : this._yAxisHelper;\n if (boxPlotMark && axisHelper) {\n const { dataToPosition } = axisHelper;\n const scale = axisHelper?.getScale?.(0);\n this.setMarkStyle(\n boxPlotMark,\n {\n min: (datum: Datum) =>\n valueInScaleRange(\n dataToPosition(this.getDatumPositionValues(datum, this._minField), {\n bandPosition: this._bandPosition\n }),\n scale\n ),\n q1: (datum: Datum) =>\n valueInScaleRange(\n dataToPosition(this.getDatumPositionValues(datum, this._q1Field), {\n bandPosition: this._bandPosition\n }),\n scale\n ),\n median: (datum: Datum) =>\n valueInScaleRange(\n dataToPosition(this.getDatumPositionValues(datum, this._medianField), {\n bandPosition: this._bandPosition\n }),\n scale\n ),\n q3: (datum: Datum) =>\n valueInScaleRange(\n dataToPosition(this.getDatumPositionValues(datum, this._q3Field), {\n bandPosition: this._bandPosition\n }),\n scale\n ),\n max: (datum: Datum) =>\n valueInScaleRange(\n dataToPosition(this.getDatumPositionValues(datum, this._maxField), {\n bandPosition: this._bandPosition\n }),\n scale\n )\n },\n STATE_VALUE_ENUM.STATE_NORMAL,\n AttributeLevel.Series\n );\n }\n const outlierMark = this._outlierMark;\n if (outlierMark && axisHelper) {\n const { dataToPosition } = axisHelper;\n const scale = axisHelper?.getScale?.(0);\n const outlierMarkPositionChannel =\n this._direction === Direction.horizontal\n ? {\n y: (datum: Datum) => this._getPosition(this.direction, datum),\n x: (datum: Datum) =>\n valueInScaleRange(\n dataToPosition(this.getDatumPositionValues(datum, BOX_PLOT_OUTLIER_VALUE_FIELD), {\n bandPosition: this._bandPosition\n }),\n scale\n )\n }\n : {\n x: (datum: Datum) => this._getPosition(this.direction, datum),\n y: (datum: Datum) =>\n valueInScaleRange(\n dataToPosition(this.getDatumPositionValues(datum, BOX_PLOT_OUTLIER_VALUE_FIELD), {\n bandPosition: this._bandPosition\n }),\n scale\n )\n };\n this.setMarkStyle(outlierMark, outlierMarkPositionChannel, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Series);\n }\n }\n\n initData(): void {\n super.initData();\n if (!this._data) {\n return;\n }\n\n registerDataSetInstanceTransform(this._dataSet, 'foldOutlierData', foldOutlierData);\n registerDataSetInstanceTransform(this._dataSet, 'addVChartProperty', addVChartProperty);\n\n const outlierDataView = new DataView(this._dataSet, { name: `${this.type}_outlier_${this.id}_data` });\n outlierDataView.parse([this.getViewData()], {\n type: 'dataview'\n });\n outlierDataView.name = `${PREFIX}_series_${this.id}_outlierData`;\n outlierDataView.transform({\n type: 'foldOutlierData',\n options: {\n dimensionField: this._direction === Direction.horizontal ? this._fieldY : this._fieldX,\n outliersField: this._outliersField\n }\n });\n\n outlierDataView.transform(\n {\n type: 'addVChartProperty',\n options: {\n beforeCall: initKeyMap.bind(this),\n call: addDataKey\n }\n },\n false\n );\n\n this._outlierDataView = new CompilableData(this._option, outlierDataView);\n }\n\n compileData() {\n super.compileData();\n this._outlierDataView?.compile();\n }\n\n init(option: IModelInitOption): void {\n super.init(option);\n //init在axis初始化之后才被执行,此时axisHelper不为空\n this.initBoxPlotMarkStyle();\n }\n\n private _getMarkWidth() {\n if (this._autoBoxWidth) {\n return this._autoBoxWidth;\n }\n //获取自适应的图元宽度\n const bandAxisHelper = this._direction === Direction.horizontal ? this._yAxisHelper : this._xAxisHelper;\n const depthFromSpec = this._groups ? this._groups.fields.length : 1;\n const bandWidth = bandAxisHelper.getBandwidth?.(depthFromSpec - 1);\n\n let width = bandWidth;\n if (isValid(this._spec.boxWidth)) {\n width = getActualNumValue(this._spec.boxWidth, bandWidth);\n }\n if (isValid(this._spec.boxMinWidth)) {\n width = Math.max(width, getActualNumValue(this._spec.boxMinWidth, bandWidth));\n }\n if (isValid(this._spec.boxMaxWidth)) {\n width = Math.min(width, getActualNumValue(this._spec.boxMaxWidth, bandWidth));\n }\n\n this._autoBoxWidth = width;\n\n return this._autoBoxWidth;\n }\n\n protected _getPosition(direction: DirectionType, datum: Datum) {\n let axisHelper;\n let sizeAttribute;\n let dataToPosition;\n if (direction === Direction.horizontal) {\n axisHelper = this.getYAxisHelper();\n sizeAttribute = 'boxHeight';\n dataToPosition = this.dataToPositionY.bind(this);\n } else {\n axisHelper = this.getXAxisHelper();\n sizeAttribute = 'boxWidth';\n dataToPosition = this.dataToPositionX.bind(this);\n }\n const scale = axisHelper.getScale(0);\n\n const depthFromSpec = this._groups ? this._groups.fields.length : 1;\n const depth = depthFromSpec;\n\n const bandWidth = axisHelper.getBandwidth?.(depth - 1);\n const size = this._boxPlotMark.getAttribute(sizeAttribute, datum) as number;\n\n if (depth > 1 && isValid(this._spec.boxGapInGroup)) {\n // 自里向外计算,沿着第一层分组的中心点进行位置调整\n const groupFields = this._groups.fields;\n const boxGapInGroup = array(this._spec.boxGapInGroup);\n let totalWidth: number = 0;\n let offSet: number = 0;\n\n for (let index = groupFields.length - 1; index >= 1; index--) {\n const groupField = groupFields[index];\n // const groupValues = this.getViewDataStatistics()?.latestData?.[groupField]?.values ?? [];\n const groupValues = axisHelper.getScale(index)?.domain() ?? [];\n const groupCount = groupValues.length;\n const gap = getActualNumValue(boxGapInGroup[index - 1] ?? last(boxGapInGroup), bandWidth);\n const i = groupValues.indexOf(datum[groupField]);\n if (index === groupFields.length - 1) {\n totalWidth += groupCount * size + (groupCount - 1) * gap;\n offSet += i * (size + gap);\n } else {\n offSet += i * (totalWidth + gap);\n totalWidth += totalWidth + (groupCount - 1) * gap;\n }\n }\n\n const center = scale.scale(datum[groupFields[0]]) + axisHelper.getBandwidth(0) / 2;\n return center - totalWidth / 2 + offSet + size / 2;\n }\n\n const continuous = isContinuous(scale.type || 'band');\n const pos = dataToPosition(datum);\n\n return pos + bandWidth * 0.5 + (continuous ? -bandWidth / 2 : 0);\n }\n\n onLayoutEnd() {\n super.onLayoutEnd();\n //每次布局结束,清除自适应宽度缓存\n this._autoBoxWidth = null;\n }\n\n private _initAnimationSpec(config: any = {}) {\n //将spec中的animation的type替换为箱型图的type\n const newConfig = merge({}, config);\n ['appear', 'enter', 'update', 'exit', 'disappear'].forEach(state => {\n if (newConfig[state] && newConfig[state].type === 'scaleIn') {\n newConfig[state].type = this._shaftShape === 'bar' ? 'barBoxplotScaleIn' : 'boxplotScaleIn';\n } else if (newConfig[state] && newConfig[state].type === 'scaleOut') {\n newConfig[state].type = this._shaftShape === 'bar' ? 'barBoxplotScaleOut' : 'boxplotScaleOut';\n }\n });\n return newConfig;\n }\n\n initAnimation() {\n const animationParams = getGroupAnimationParams(this);\n\n if (this._boxPlotMark) {\n const newDefaultConfig = this._initAnimationSpec(Factory.getAnimationInKey('scaleInOut')?.());\n const newConfig = this._initAnimationSpec(\n userAnimationConfig(SeriesMarkNameEnum.boxPlot, this._spec, this._markAttributeContext)\n );\n this._boxPlotMark.setAnimationConfig(animationConfig(newDefaultConfig, newConfig, animationParams));\n }\n\n if (this._outlierMark) {\n const outlierMarkUserAnimation = {\n appear: (this._spec.animationAppear as IMarkAnimateSpec<string>)?.symbol,\n disappear: (this._spec.animationDisappear as IMarkAnimateSpec<string>)?.symbol,\n enter: (this._spec.animationEnter as IMarkAnimateSpec<string>)?.symbol,\n exit: (this._spec.animationExit as IMarkAnimateSpec<string>)?.symbol,\n update: (this._spec.animationUpdate as IMarkAnimateSpec<string>)?.symbol\n };\n this._outlierMark.setAnimationConfig(\n animationConfig(Factory.getAnimationInKey('scaleInOut')?.(), outlierMarkUserAnimation, animationParams)\n );\n }\n }\n\n protected initTooltip() {\n this._tooltipHelper = new BoxPlotSeriesTooltipHelper(this);\n this._boxPlotMark && this._tooltipHelper.activeTriggerSet.mark.add(this._boxPlotMark);\n this._outlierMark && this._tooltipHelper.activeTriggerSet.mark.add(this._outlierMark);\n }\n\n getStatisticFields() {\n const fields = super.getStatisticFields();\n const outliersField = fields.find(f => f.key === this._outliersField);\n if (outliersField) {\n outliersField.operations = ['array-min', 'array-max'];\n }\n return fields;\n }\n\n onEvaluateEnd(ctx: IModelEvaluateOption): void {\n //初次编译时,会传入空数据;待所有计算完成后,需要重新执行updateData更新数据\n super.onEvaluateEnd(ctx);\n this._outlierDataView.updateData();\n }\n\n getDefaultShapeType(): string {\n return 'square';\n }\n\n getActiveMarks(): IMark[] {\n return [this._boxPlotMark];\n }\n}\n\nexport const registerBoxplotSeries = () => {\n registerBoxPlotMark();\n registerSymbolMark();\n registerScaleInOutAnimation();\n registerCartesianBandAxis();\n registerCartesianLinearAxis();\n registeBoxPlotScaleAnimation();\n Factory.registerSeries(BoxPlotSeries.type, BoxPlotSeries);\n};\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { IAnimationSpec } from '../../animation/spec';
2
2
  import type { IMarkProgressiveConfig } from '../../mark/interface';
3
- import type { DirectionType, IBoxPlotMarkSpec, IOutlierMarkSpec, IMarkSpec, IMarkTheme } from '../../typings';
3
+ import type { DirectionType, IBoxPlotMarkSpec, IOutlierMarkSpec, IMarkSpec, IMarkTheme, ISymbolMarkSpec } from '../../typings';
4
4
  import type { ICartesianSeriesSpec, ICartesianSeriesTheme } from '../cartesian/interface';
5
5
  import type { SeriesMarkNameEnum } from '../interface/type';
6
6
  export interface IBoxPlotSeriesSpec extends Omit<ICartesianSeriesSpec, 'xField' | 'yField' | 'direction'>, IAnimationSpec<SeriesMarkNameEnum.boxPlot, string>, IMarkProgressiveConfig {
@@ -13,9 +13,14 @@ export interface IBoxPlotSeriesSpec extends Omit<ICartesianSeriesSpec, 'xField'
13
13
  q1Field?: string;
14
14
  medianField?: string;
15
15
  q3Field?: string;
16
- [SeriesMarkNameEnum.boxPlot]?: IMarkSpec<IBoxPlotMarkSpec>;
17
16
  outliersField?: string;
17
+ [SeriesMarkNameEnum.boxPlot]?: IMarkSpec<IBoxPlotMarkSpec>;
18
+ [SeriesMarkNameEnum.outlier]?: IMarkSpec<ISymbolMarkSpec>;
18
19
  outliersStyle?: IOutlierMarkSpec;
20
+ boxWidth?: number | string;
21
+ boxMinWidth?: number | string;
22
+ boxMaxWidth?: number | string;
23
+ boxGapInGroup?: number | string | (number | string)[];
19
24
  }
20
25
  export interface IBoxPlotSeriesTheme extends ICartesianSeriesTheme {
21
26
  [SeriesMarkNameEnum.boxPlot]?: Partial<IMarkTheme<IBoxPlotMarkSpec>>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/series/box-plot/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { IAnimationSpec } from '../../animation/spec';\nimport type { IMarkProgressiveConfig } from '../../mark/interface';\nimport type { DirectionType, IBoxPlotMarkSpec, IOutlierMarkSpec, IMarkSpec, IMarkTheme } from '../../typings';\nimport type { ICartesianSeriesSpec, ICartesianSeriesTheme } from '../cartesian/interface';\nimport type { SeriesMarkNameEnum } from '../interface/type';\n\nexport interface IBoxPlotSeriesSpec\n extends Omit<ICartesianSeriesSpec, 'xField' | 'yField' | 'direction'>,\n // TODO: 补充动画类型 @chengda\n IAnimationSpec<SeriesMarkNameEnum.boxPlot, string>,\n IMarkProgressiveConfig {\n /** 系列类型 */\n type: 'boxPlot';\n direction?: DirectionType;\n /**\n *x轴字段(direction=vertical时生效)\n */\n xField?: string | string[];\n /**\n *y轴字段(direction=horizontal时生效)\n */\n yField?: string | string[];\n /**\n *最小值字段\n */\n minField?: string;\n /**\n *最大值字段\n */\n maxField?: string;\n /**\n *q1字段\n */\n q1Field?: string;\n /**\n *中位数字段\n */\n medianField?: string;\n /**\n *q3字段\n */\n q3Field?: string;\n /**\n *异常值字段\n */\n /**\n * 图元配置\n */\n [SeriesMarkNameEnum.boxPlot]?: IMarkSpec<IBoxPlotMarkSpec>;\n /**\n * 异常值字段\n */\n outliersField?: string;\n /**\n * 异常值样式配置\n */\n outliersStyle?: IOutlierMarkSpec;\n}\n\nexport interface IBoxPlotSeriesTheme extends ICartesianSeriesTheme {\n [SeriesMarkNameEnum.boxPlot]?: Partial<IMarkTheme<IBoxPlotMarkSpec>>;\n}\n"]}
1
+ {"version":3,"sources":["../src/series/box-plot/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { IAnimationSpec } from '../../animation/spec';\nimport type { IMarkProgressiveConfig } from '../../mark/interface';\nimport type {\n DirectionType,\n IBoxPlotMarkSpec,\n IOutlierMarkSpec,\n IMarkSpec,\n IMarkTheme,\n ISymbolMarkSpec\n} from '../../typings';\nimport type { ICartesianSeriesSpec, ICartesianSeriesTheme } from '../cartesian/interface';\nimport type { SeriesMarkNameEnum } from '../interface/type';\n\nexport interface IBoxPlotSeriesSpec\n extends Omit<ICartesianSeriesSpec, 'xField' | 'yField' | 'direction'>,\n // TODO: 补充动画类型 @chengda\n IAnimationSpec<SeriesMarkNameEnum.boxPlot, string>,\n IMarkProgressiveConfig {\n /** 系列类型 */\n type: 'boxPlot';\n direction?: DirectionType;\n /**\n *x轴字段(direction=vertical时生效)\n */\n xField?: string | string[];\n /**\n *y轴字段(direction=horizontal时生效)\n */\n yField?: string | string[];\n /**\n *最小值字段\n */\n minField?: string;\n /**\n *最大值字段\n */\n maxField?: string;\n /**\n *q1字段\n */\n q1Field?: string;\n /**\n *中位数字段\n */\n medianField?: string;\n /**\n *q3字段\n */\n q3Field?: string;\n /**\n * 异常值字段\n */\n outliersField?: string;\n /**\n * 图元配置\n */\n [SeriesMarkNameEnum.boxPlot]?: IMarkSpec<IBoxPlotMarkSpec>;\n /**\n * 异常值图元配置\n * @since 2.0.10\n */\n [SeriesMarkNameEnum.outlier]?: IMarkSpec<ISymbolMarkSpec>;\n /**\n * 异常值样式配置\n * @todo 将在未来版本中废弃,请使用 outlier 配置项代替\n */\n outliersStyle?: IOutlierMarkSpec;\n\n /**\n * 宽度,可以设置绝对的像素值,也可以使用百分比(如 '10%')\n * 1. number 类型,表示像素值\n * 2. string 类型,百分比用法,如 '10%',该值为对应最后一个分组字段对应的 scale 的 bandWidth 占比\n * @since 2.0.10\n */\n boxWidth?: number | string;\n /**\n * 最小宽度,可以设置绝对的像素值,也可以使用百分比(如 '10%')\n * 1. number 类型,表示像素值\n * 2. string 类型,百分比用法,如 '10%',该值为对应最后一个分组字段对应的 scale 的 bandWidth 占比\n * @since 2.0.10\n */\n boxMinWidth?: number | string;\n /**\n * 最大宽度,可以设置绝对的像素值,也可以使用百分比(如 '10%')\n * 1. number 类型,表示像素值\n * 2. string 类型,百分比用法,如 '10%',该值为对应最后一个分组字段对应的 scale 的 bandWidth 占比\n * @since 2.0.10\n */\n boxMaxWidth?: number | string;\n\n /**\n * 分组箱线图中各个分组内的间距,可以设置绝对的像素值,也可以使用百分比(如 '10%')。\n * 1. number 类型,表示像素值\n * 2. string 类型,百分比用法,如 '10%',该值为对应最后一个分组字段对应的 scale 的 bandWidth 占比\n * @since 2.0.10\n */\n boxGapInGroup?: number | string | (number | string)[];\n}\n\nexport interface IBoxPlotSeriesTheme extends ICartesianSeriesTheme {\n [SeriesMarkNameEnum.boxPlot]?: Partial<IMarkTheme<IBoxPlotMarkSpec>>;\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.token = void 0, exports.token = {
6
- fontFamily: "PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",
6
+ fontFamily: "PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,'-apple-system',segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",
7
7
  fontSize: 14,
8
8
  l1FontSize: 32,
9
9
  l1LineHeight: "150%",
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/theme/token/builtin/default.ts"],"names":[],"mappings":";;;AAGa,QAAA,KAAK,GAAoB;IACpC,UAAU,EAER,gKAAgK;IAClK,QAAQ,EAAE,EAAE;IAEZ,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,MAAM;IAEpB,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,MAAM;IAEpB,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,MAAM;IAEpB,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,MAAM;IAEpB,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,MAAM;IAEpB,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,MAAM;CACrB,CAAC","file":"default.js","sourcesContent":["import type { BuiltinTokenMap } from './interface';\n\n/** 标准色板 */\nexport const token: BuiltinTokenMap = {\n fontFamily:\n // eslint-disable-next-line max-len\n 'PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol',\n fontSize: 14,\n\n l1FontSize: 32,\n l1LineHeight: '150%',\n\n l2FontSize: 20,\n l2LineHeight: '140%',\n\n l3FontSize: 16,\n l3LineHeight: '150%',\n\n l4FontSize: 14,\n l4LineHeight: '150%',\n\n l5FontSize: 12,\n l5LineHeight: '130%',\n\n l6FontSize: 10,\n l6LineHeight: '120%'\n};\n"]}
1
+ {"version":3,"sources":["../src/theme/token/builtin/default.ts"],"names":[],"mappings":";;;AAGa,QAAA,KAAK,GAAoB;IACpC,UAAU,EAER,kKAAkK;IACpK,QAAQ,EAAE,EAAE;IAEZ,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,MAAM;IAEpB,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,MAAM;IAEpB,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,MAAM;IAEpB,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,MAAM;IAEpB,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,MAAM;IAEpB,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,MAAM;CACrB,CAAC","file":"default.js","sourcesContent":["import type { BuiltinTokenMap } from './interface';\n\n/** 标准色板 */\nexport const token: BuiltinTokenMap = {\n fontFamily:\n // eslint-disable-next-line max-len\n `PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,'-apple-system',segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol`,\n fontSize: 14,\n\n l1FontSize: 32,\n l1LineHeight: '150%',\n\n l2FontSize: 20,\n l2LineHeight: '140%',\n\n l3FontSize: 16,\n l3LineHeight: '150%',\n\n l4FontSize: 14,\n l4LineHeight: '150%',\n\n l5FontSize: 12,\n l5LineHeight: '130%',\n\n l6FontSize: 10,\n l6LineHeight: '120%'\n};\n"]}
@@ -159,8 +159,8 @@ export interface IRectMarkSpec extends IFillMarkSpec {
159
159
  }
160
160
  export interface IBoxPlotMarkSpec extends ICommonSpec {
161
161
  lineWidth?: number;
162
- boxWidth?: number;
163
- shaftWidth?: number;
162
+ boxWidth?: number | string;
163
+ shaftWidth?: number | string;
164
164
  shaftShape?: BoxPlotShaftShape;
165
165
  boxFill?: string;
166
166
  shaftFillOpacity?: number;
@@ -271,7 +271,7 @@ export type GradientType = 'linear' | 'radial' | 'conical';
271
271
  export type IGradient = IGradientLinear | IGradientRadial | IGradientConical;
272
272
  export type LineStrokeCap = 'butt' | 'round' | 'square';
273
273
  export type LineStrokeJoin = 'arcs' | 'bevel' | 'miter' | 'miter-clip' | 'round';
274
- export type BoxPlotShaftShape = 'line' | 'bar';
274
+ export type BoxPlotShaftShape = 'line' | 'bar' | 'filled-line';
275
275
  export interface IThresholdStyle extends IVisualSpecStyle<number, string> {
276
276
  domain: number[];
277
277
  field: string;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/typings/visual.ts"],"names":[],"mappings":"","file":"visual.js","sourcesContent":["import type { PopTipAttributes } from '@visactor/vrender-components';\nimport type { DataView } from '@visactor/vdataset';\nimport type { Cursor } from './cursor';\nimport type { InterpolateType } from './interpolate';\nimport type { ScaleType } from './scale';\nimport type { ShapeType } from './shape';\nimport type { IPoint } from './coordinate';\nimport type { IModelMarkAttributeContext } from '../compile/mark/interface';\nimport type { Datum } from './common';\nimport type { IPadding } from '@visactor/vutils';\nimport type { IColorKey } from '../theme/color-scheme/interface';\nimport type { ITokenKey } from '../theme/token/interface';\nimport type {\n IRepeatType,\n TextAlignType,\n TextBaselineType,\n IRichTextAttribute,\n IGraphicStyle,\n IColor\n} from '@visactor/vrender-core';\n\n// 基础的visual 对应 scale 的属性\nexport interface IVisualSpecBase<D, T> {\n /**\n * type of scale\n */\n type: ScaleType;\n /**\n * will set to scale.domain, it means input of scale\n */\n domain: D[];\n /**\n * will set to scale.range, it means output of scale\n */\n range: T[];\n /**\n * will set to scale.specified if scale support, as a key-value pair matching capability\n * @since 1.1.0\n */\n specified?: { [key: string]: unknown };\n /**\n * enable clamp in linear scale\n * If clamp is enabled, the return value of the scale is always within the scale’s range.\n * @since 1.13.6\n * @default false\n */\n clamp?: boolean;\n}\n// 用来给用户进行mark.style上的映射配置。所以要配置数据维度\nexport interface IVisualSpecStyle<D, T> extends IVisualSpecBase<D, T> {\n /**\n * 指定映射对应的数据字段\n */\n field?: string;\n}\n\nexport type IDataDomainSpec = {\n /**\n * 数据的id\n */\n dataId: string;\n /**\n * 数据字段\n */\n fields: string[];\n};\n\n// 用来提供给用户进行 scale 配置 所以名字是必选的 对用户配置\nexport interface IVisualSpecScale<D, T> extends Omit<IVisualSpecBase<D, T>, 'domain'> {\n /**\n * scale 的id\n */\n id: string;\n /**\n * 定义域范围\n */\n domain:\n | IVisualSpecBase<D, T>['domain']\n // 使用数据的字段值,如果 scale 是连续的,就取区间,如果是离散的就使用 values 。\n // 不考虑图表内的交互等数据筛选,这里只用原始数据的统计信息\n | IDataDomainSpec[];\n}\n// 对用户配置\nexport type IVisual<D = any, R = any> = IVisualSpecStyle<D, R> | IVisualScale;\n\nexport interface IVisualScale {\n /**\n * 对应 IVisualSpecScale 的用户配置 scale-id\n */\n scale: string;\n /**\n * 指定参与映射的数据字段\n */\n field?: string;\n /**\n * 当用户指定 field 后,用该属性来控制值域。\n * @default 'none'\n */\n changeDomain?: 'none' | 'replace' | 'expand';\n}\n\nexport type FunctionType<T> = (datum: Datum, context: IModelMarkAttributeContext, source?: DataView) => T;\nexport type ValueType<T> = T;\nexport type VisualType<T> = ValueType<T> | FunctionType<T> | IVisual<unknown, T>;\n\nexport type TextureType =\n | 'circle'\n | 'dimond'\n | 'rect'\n | 'vertical-line'\n | 'horizontal-line'\n | 'bias-lr'\n | 'bias-rl'\n | 'grid';\n\n/**\n * style格式转换\n */\nexport type ConvertToMarkStyleSpec<T extends Record<string, any>> = {\n [key in keyof T]: VisualType<T[key]>;\n};\n\n/**\n * border\n */\nexport interface IBorder {\n /**\n * 边框离图形边缘的距离\n */\n distance: number | string;\n /**\n * 边框的颜色\n */\n stroke?: string | IGradient;\n /**\n * 边框的透明度\n */\n strokeOpacity?: number;\n /**\n * 边框线的宽度\n */\n lineWidth?: number;\n /**\n * 给边框配置虚线模式。它使用一组值来指定描述模式的线和间隙的交替长度\n */\n lineDash?: number[];\n /**\n * 设置边框的虚线偏移量\n */\n lineDashOffset?: number;\n}\n\nexport interface ICommonSpec {\n /**\n * 图形是否可见\n */\n visible?: boolean;\n /**\n * 图形的x坐标\n */\n x?: number;\n /**\n * 图形的y坐标\n */\n y?: number;\n /**\n * 图形的z坐标,仅适用于3D图表\n */\n z?: number;\n /**\n * 图形的描边颜色。\n * 支持使用 'rgb(255,255,255)','rgba(255,255,255,1)','#fff' 等方式设置为纯色,也支持设置为渐变色描边\n * @todo 隔离主题和 spec 配置\n * IColorKey 类型只适用于主题\n */\n stroke?: string | IGradient | false | (number | boolean)[] | IColorKey | null;\n /**\n * 描边透明度\n */\n strokeOpacity?: number;\n /**\n * 图形的透明度,既影响描边也影响填充\n */\n opacity?: number;\n /**\n * 图形的描边宽度\n */\n lineWidth?: number;\n /**\n * 给描边配置虚线模式。它使用一组值来指定描述模式的线和间隙的交替长度\n */\n lineDash?: number[];\n /**\n * 设置虚线偏移量的属性\n */\n lineDashOffset?: number;\n /**\n * 设置图形的鼠标样式\n */\n cursor?: Cursor;\n /**\n * 设置图形的层级,主意这个是相对层级,图形引擎绘制的时候,会对相同group下的所有图形根据zIndex进行排序,然后从小到大进行渲染\n */\n zIndex?: number;\n /**\n * 图形的旋转角度\n */\n angle?: number;\n /**\n * 基于AABB的锚点位置,用于简单的定位某些path的位置\n */\n anchor?: [number, number];\n\n /**\n * x方向的缩放比例,默认为1,即不进行缩放\n */\n scaleX?: number;\n /**\n * y方向的缩放比例,默认为1,即不进行缩放\n */\n scaleY?: number;\n /**\n * 图形缩放中心\n * @since 1.4.0\n * 可以配置固定坐标,例如 [100, 100];或者百分比坐标,例如 ['50%', '50%'],代表以图元中心为缩放中心\n * */\n scaleCenter?: [number | string, number | string];\n\n // 3d旋转的属性\n /**\n * x方向的旋转角度\n */\n alpha?: number;\n /**\n * y方向的旋转角度\n */\n beta?: number;\n /**\n * 3d的锚点位置\n */\n anchor3d?: [number, number];\n\n /**\n * 选择模式,精确模式,粗糙模式(包围盒模式),自定义模式\n */\n pickMode?: 'accurate' | 'imprecise' | 'custom';\n /**\n * bounds的计算模式\n */\n boundsMode?: 'accurate' | 'imprecise';\n\n /**\n * 用于扩展描边的拾取范围,为 0 就是默认线宽,正数就加宽,负数就减宽\n * @default 0\n * @since 1.7.3\n */\n pickStrokeBuffer?: number;\n\n // 以下是纹理相关的属性\n /**\n * 纹理的类型\n */\n texture?: TextureType | string;\n /**\n * 纹理的颜色\n */\n textureColor?: string;\n /**\n * 纹理单元的大小\n */\n textureSize?: number; // 纹理大小\n /**\n * 纹理之间空隙的大小\n */\n texturePadding?: number;\n\n /**\n * 外边框,外描边,描边位于图形外侧\n */\n outerBorder?: IBorder;\n /**\n * 内边框,内描边,描边位于图形内侧\n */\n innerBorder?: IBorder;\n /**\n * html 浮层,会将配置的html相关内容,绝对定位到图元的位置\n * @experimental\n * @since 1.10.0\n */\n html?: IMarkHtmlSpec;\n\n [key: string]: any;\n}\n\nexport interface IFillMarkSpec extends ICommonSpec {\n /**\n * 图形的填充颜色\n * @todo 隔离主题和 spec 配置\n * IColorKey 类型只适用于主题\n */\n fill?: VisualType<string> | IGradient | false | IColorKey;\n /**\n * 填充的透明度\n */\n fillOpacity?: number;\n\n /**\n * 图形的背景色,支持纯色、image元素、canvas元素\n */\n background?: IColor | HTMLImageElement | HTMLCanvasElement | null;\n}\n\nexport type IMarkHtmlSpec = Partial<IGraphicStyle['html']>;\n\nexport interface ISymbolMarkSpec extends IFillMarkSpec {\n /**\n * x方向的偏移量\n */\n dx?: number;\n /**\n * y方向的偏移量\n */\n dy?: number;\n /**\n * 大小,相当于外接圆的半径\n */\n size?: number | number[];\n /** 对外声明使用shape,vrender图形属性对应的是shape */\n shape?: ShapeType | string;\n /**\n * 标记的类型\n * FIXME: vrender Symbol接收的图形属性,暂时都申明一下\n * */\n symbolType?: ShapeType | string;\n /**\n * x方向的缩放比例,默认为1,即不进行缩放\n */\n scaleX?: number;\n /**\n * y方向的缩放比例,默认为1,即不进行缩放\n */\n scaleY?: number;\n}\n\n// lineMark 和 areaMark 共同配置\nexport interface ILineLikeMarkSpec extends IFillMarkSpec {\n /**\n * 取消的差值类型,默认为线性插值,也就是普通的折线\n */\n curveType?: InterpolateType;\n /**\n * 设置点是否有效,也就是是否合法\n */\n defined?: boolean;\n}\n\nexport interface IAreaMarkSpec extends ILineLikeMarkSpec {\n /**\n * 面积的x1值\n */\n x1?: number;\n /**\n * 面积的y1值\n */\n y1?: number;\n /**\n * 面积图元的方向,\n * horizontal - 水平方向\n * vertical - 垂直方向\n */\n orient?: 'horizontal' | 'vertical';\n}\n\nexport interface ILineMarkSpec extends ILineLikeMarkSpec {\n /**\n * 指定如何绘制每一条线段末端的属性。有 3 个可能的值,分别是:'butt', 'round' and 'square'。默认值是 butt。\n */\n lineCap?: LineStrokeCap;\n /**\n * 用来设置 2 个长度不为 0 的相连部分(线段、圆弧、曲线)如何连接在一起的属性(长度为 0 的变形部分,其指定的末端和控制点在同一位置,会被忽略)。此属性有 3 个值: 'round', 'bevel' and 'miter'。默认值是 'miter'\n */\n lineJoin?: LineStrokeJoin;\n /**\n * 设置斜接面限制比例的属性。当获取属性值时,会返回当前的值(默认值是 10.0 )。当给属性赋值时,0、负数、 Infinity 和 NaN 都会被忽略;除此之外都会被赋予一个新值。\n */\n miterLimit?: number;\n /**\n * stroke 的有界缓冲区\n */\n strokeBoundsBuffer?: number;\n}\n\nexport interface IRuleMarkSpec extends ILineMarkSpec {\n /**\n * 终点x坐标\n */\n x1?: number;\n /**\n * 终点y坐标\n */\n y1?: number;\n}\n\nexport interface ITextMarkSpec extends IFillMarkSpec {\n /**\n * 文字内容\n */\n text?: string | number | string[] | number[];\n /**\n * x 方向偏移\n */\n dx?: number;\n /**\n * y 方向偏移\n */\n dy?: number;\n /**\n * 字号\n */\n fontSize?: number | ITokenKey;\n /**\n * 文字水平方向的对齐方式\n */\n textAlign?: TextAlign;\n /**\n * 文字竖直方向的对齐方式\n */\n textBaseline?: TextBaseLine;\n /**\n * 字体\n */\n fontFamily?: string;\n /**\n * 字重\n */\n fontWeight?: FontWeight;\n /**\n * 字体样式,是否为斜体等\n */\n fontStyle?: FontStyle;\n /**\n * 文字的最大长度\n */\n maxLineWidth?: number;\n /**\n * 文字超出 maxLineWidth 后的省略符\n */\n ellipsis?: string;\n /**\n * 文本省略的位置,默认尾部省略\n * 1. 'start' 文字首部省略\n * 2. 'middle' 文本中间省略\n * 3. 'end' 文本尾部省略\n * @default 'end'\n * @since 1.7.3\n */\n suffixPosition?: 'start' | 'end' | 'middle';\n /**\n * 下划线\n */\n underline?: boolean;\n /**\n * 下划线的虚线样式\n */\n underlineDash?: number[];\n /**\n * 下划线的虚线偏移量\n */\n underlineOffset?: number;\n /**\n * 中划线\n */\n lineThrough?: boolean;\n /**\n * 行高(1.3.1 版本新增字符串类型表示比例值,如\"150%\")\n * @since 1.3.1\n */\n lineHeight?: number | string | ITokenKey;\n /**\n * poptip 相关配置\n */\n poptip?: PopTipAttributes;\n /**\n * 文本的排布方向,如果需要文本纵向排布,可以配置为 'vertical'\n * @default 'horizontal'\n */\n direction?: 'horizontal' | 'vertical';\n /*\n * 单词断行\n */\n wordBreak?: 'break-word' | 'break-all' | 'keep-all';\n /**\n * 高度限制控制显示内容及省略号\n */\n heightLimit?: number;\n /**\n * 按照行数限制显示内容及省略号\n */\n lineClamp?: number;\n /**\n * 设置如何处理空白字符\n */\n whiteSpace?: 'normal' | 'no-wrap';\n}\n\nexport type IRichTextMarkSpec = IRichTextAttribute &\n IFillMarkSpec & { type: 'rich'; text: IRichTextAttribute['textConfig'] };\n\nexport type IComposedTextMarkSpec = ITextMarkSpec | IRichTextMarkSpec;\n\nexport type IPositionedTextMarkSpec = Omit<ITextMarkSpec, 'align' | 'textAlign' | 'baseline' | 'textBaseline'>;\n\nexport interface IRectMarkSpec extends IFillMarkSpec {\n /**\n * 圆角配置。\n * 1. 如果传入数值,则统一为四个角设置圆角\n * 2. 如果传入数组,则分别为 [上左, 上右, 下右, 下左]\n */\n cornerRadius?: number | number[];\n /**\n * 宽度\n */\n width?: number;\n /**\n * 高度\n */\n height?: number;\n /**\n * x方向终点坐标\n */\n x1?: number;\n /**\n * y方向终点坐标\n */\n\n y1?: number;\n}\n\nexport interface IBoxPlotMarkSpec extends ICommonSpec {\n /**\n * box描边宽度\n */\n lineWidth?: number;\n /**\n * box宽度\n */\n boxWidth?: number;\n /**\n * 最大最小值宽度\n */\n shaftWidth?: number;\n /**\n * 中轴线类型\n */\n shaftShape?: BoxPlotShaftShape;\n /**\n * 盒子填充颜色,为空则不填充\n */\n boxFill?: string;\n // /**\n // * 描边颜色\n // */\n // stroke?: string;\n /**\n * 中轴线透明度,仅当shaftType=bar时生效\n */\n shaftFillOpacity?: number;\n /**\n * 最小值\n */\n min?: (datum: Datum) => number;\n /**\n * 25%分位数\n */\n q1?: (datum: Datum) => number;\n /**\n * 中位数\n */\n median?: (datum: Datum) => number;\n /**\n * 75%分位数\n */\n q3?: (datum: Datum) => number;\n /**\n * 最大值\n */\n max?: (datum: Datum) => number;\n}\n\nexport interface IRippleMarkSpec extends ICommonSpec {\n /**\n * 波纹密度ripple\n * ripple 取值范为[0,1]\n */\n ripple?: number;\n /**\n * 水波纹最大半径\n */\n size?: number;\n}\n\nexport interface ILiquidMarkSpec extends ICommonSpec {\n /**\n * 波浪的变化状态,范围为 [0, 1]\n */\n wave?: number;\n}\n\nexport interface ILiquidOutlineSpec extends ISymbolMarkSpec {\n /**\n * 描边的宽度\n */\n lineWidth: number;\n}\n\nexport interface IOutlierMarkSpec {\n /**\n * 异常点填充颜色\n */\n fill?: string;\n /**\n * 异常点大小\n */\n size?: number;\n}\n\nexport interface IPathMarkSpec extends IFillMarkSpec {\n path?: string;\n // TODO: 该属性后续可能会删除,未定\n /**\n * 平滑缩放,不然会发生跳变,在地图交互场景需要配置为true;常规path缩放不需要\n */\n smoothScale?: boolean;\n}\n\nexport interface ILinkPathMarkSpec extends IFillMarkSpec {\n /**\n * 连边起点的x坐标\n */\n x0?: number;\n /**\n * 连边起点的y坐标\n */\n y0?: number;\n /**\n * 连边终点的x坐标\n */\n x1?: number;\n /**\n * 连边终点的y坐标\n */\n y1?: number;\n /**\n * 连边的厚度,也可以理解为宽度\n */\n thickness?: number;\n /**\n * 连边的曲度,决定了连边的弯曲程度,取值范围为0-1,\n * 0表示不弯曲,也就是直线\n * 1表示最大的弯曲度,\n * 默认值为0.5\n */\n curvature?: number;\n /** round all the coordinates */\n round?: boolean;\n /** the ratio of normal style path */\n ratio?: number;\n /**\n * 对齐方式\n */\n align?: 'start' | 'end' | 'center';\n /**\n * 连边的类型\n *\n */\n pathType?: 'line' | 'smooth' | 'polyline';\n /**\n * 是否展示终点的箭头\n */\n endArrow?: boolean;\n /**\n * 是否展示起点的箭头\n */\n startArrow?: boolean;\n /**\n * 背景线的样式,主要用于部分高亮的场景\n */\n backgroundStyle?: any;\n /**\n * 连边的方向\n */\n direction?: 'horizontal' | 'vertical' | 'LR' | 'RL' | 'TB' | 'BL' | 'radial';\n}\n\n/**\n * arc图元的视觉通道配置\n */\nexport interface IArcMarkSpec extends IFillMarkSpec {\n /**\n * 圆弧的开始角度\n */\n startAngle?: number;\n /**\n * 圆弧的结束角度\n */\n endAngle?: number;\n /**\n * 间隙角度;间隔角度会转换为一个在两个相邻的弧之间的确定的线性距离,定义为 padRadius * | padAngle |\n * 这个距离在弧的开始和结束处都是相等的;\n * 间隔角度通常只应用于环形扇区(即当内半径大于 0)\n */\n padAngle?: number;\n\n /**\n * 外径,既外半径\n */\n outerRadius?: number;\n /**\n * 内径,既内半径\n */\n innerRadius?: number;\n /**\n * 圆角\n */\n cornerRadius?: number;\n /**\n * 内边距\n */\n innerPadding?: number;\n /**\n * 外边距\n */\n outerPadding?: number;\n /**\n * arc的中心点偏移距离,一般是通过在交互状态下设置这个属性来实现将扇区移出中心的一个效果\n */\n centerOffset?: number;\n /**\n * arc 的 roundCap 属性,即圆角是否伸出 startAngle 和 endAngle 之外\n */\n cap?: boolean | [boolean, boolean];\n /**\n * arc 在 roundCap 打开且应用环形渐变时是否对 cap 部分生效\n */\n autoCapConical?: boolean;\n}\n\nexport interface ICellMarkSpec extends ISymbolMarkSpec {\n /**\n * 内边距\n */\n padding?: number | number[] | IPadding;\n}\n\nexport interface IGroupMarkSpec extends IFillMarkSpec {\n /**\n * 是否开启裁剪\n */\n clip?: boolean;\n /**\n * 宽度\n */\n width?: number;\n /**\n * 高度\n */\n height?: number;\n /**\n * 圆角配置。\n * 1. 如果传入数值,则统一为四个角设置圆角\n * 2. 如果传入数组,则分别为 [上左, 上右, 下右, 下左]\n */\n cornerRadius?: number | number[];\n}\n\nexport interface IPolygonMarkSpec extends ICommonSpec, IFillMarkSpec {\n /**\n * 顶点坐标\n */\n points?: IPoint[];\n /**\n * 圆角配置,支持数组配置,数组的顺序同组成 polygon 的顺序对应\n */\n cornerRadius?: number | number[];\n /**\n * x方向的缩放比例,默认为1,即不进行缩放\n */\n scaleX?: number;\n /**\n * y方向的缩放比例,默认为1,即不进行缩放\n */\n scaleY?: number;\n}\n\n/**\n * ImageFill\n */\nexport type RepeatType = 'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat';\nexport type RepeatXYType = 'no-repeat' | 'repeat' | 'stretch';\nexport type ImageOriginType = 'top' | 'bottom';\n\n/**\n * gradient\n */\nexport type GradientPropValue<T> = ValueType<T> | FunctionType<T>;\nexport type GradientStop = {\n /**\n * 渐变色的偏移量,0-1的值\n */\n offset: GradientPropValue<number>;\n /**\n * 渐变色的颜色\n */\n color?: GradientPropValue<string>;\n /**\n * 渐变色的透明度\n */\n opacity?: number;\n};\nexport interface IGradientLinear {\n /**\n * 渐变色的起点x坐标,0-1的值,相对于图形包围盒x方向取值的比例值\n */\n x0?: GradientPropValue<number>;\n /**\n * 渐变色的起点y坐标,0-1的值,相对于图形包围盒y方向取值的比例值\n */\n y0?: GradientPropValue<number>;\n /**\n * 渐变色的终点x坐标,0-1的值,相对于图形包围盒x方向取值的比例值\n */\n x1?: GradientPropValue<number>;\n /**\n * 渐变色的终点y坐标,0-1的值,相对于图形包围盒y方向取值的比例值\n */\n y1?: GradientPropValue<number>;\n /**\n * 渐变色的颜色\n */\n stops: GradientStop[];\n /**\n * 渐变色的类型设置为 'linear',即线形渐变\n */\n gradient: 'linear';\n}\n\nexport interface IGradientRadial {\n /**\n * 径向渐变的起点的半径\n */\n r0?: GradientPropValue<number>;\n /**\n * 径向渐变的起点的x坐标\n */\n x0?: GradientPropValue<number>;\n /**\n * 径向渐变的起点的y坐标\n */\n y0?: GradientPropValue<number>;\n /**\n * 径向渐变的终点的x坐标\n */\n x1?: GradientPropValue<number>;\n /**\n * 径向渐变的终点的y坐标\n */\n y1?: GradientPropValue<number>;\n /**\n * 径向渐变的终点的半径\n */\n r1?: GradientPropValue<number>;\n /**\n * 渐变色的颜色\n */\n stops: GradientStop[];\n /**\n * 渐变色的类型设置为 'radial',即径向渐变\n */\n gradient: 'radial';\n}\n\nexport interface IGradientConical {\n /**\n * 锥形渐变的中心点x坐标\n */\n x?: GradientPropValue<number>;\n /**\n * 锥形渐变的中心点y坐标\n */\n y?: GradientPropValue<number>;\n /**\n * 锥形渐变的开始角度\n */\n startAngle?: GradientPropValue<number>;\n /**\n * 锥形渐变的结束角度\n */\n endAngle?: GradientPropValue<number>;\n /**\n * 锥形渐变的颜色\n */\n stops: GradientStop[];\n /**\n * 渐变色的类型设置为 'conical',即锥形渐变\n */\n gradient: 'conical';\n}\n\nexport type GradientType = 'linear' | 'radial' | 'conical';\nexport type IGradient = IGradientLinear | IGradientRadial | IGradientConical;\n\nexport type LineStrokeCap = 'butt' | 'round' | 'square';\nexport type LineStrokeJoin = 'arcs' | 'bevel' | 'miter' | 'miter-clip' | 'round';\n\nexport type BoxPlotShaftShape = 'line' | 'bar';\n/**\n * threshold\n */\nexport interface IThresholdStyle extends IVisualSpecStyle<number, string> {\n domain: number[];\n field: string;\n range: string[];\n type: 'threshold';\n}\n\n// FIXME: For some tool methods that need to use common configuration types\nexport interface IUnknownMarkSpec extends ICommonSpec {\n [key: string]: unknown;\n}\n\nexport interface IImageMarkSpec extends IFillMarkSpec {\n /**\n * 圆角配置。\n * 1. 如果传入数值,则统一为四个角设置圆角\n * 2. 如果传入数组,则分别为 [上左, 上右, 下右, 下左]\n */\n cornerRadius?: number | number[];\n /**\n * 图片的宽度\n */\n width?: number;\n /**\n * 图片的高度\n */\n height?: number;\n /**\n * 当图片的宽度小于 width 时,图片的重复方式\n */\n repeatX?: IRepeatType;\n /**\n * 当图片的高度小于 height 时,图片的重复方式\n */\n repeatY?: IRepeatType;\n /**\n * 设置图片的内容,支持三种类型:\n * 1. string类型,可以是图片资源的路径或者是svg 标签字符串\n * 2. image 元素\n * 3. canvas 元素\n */\n image?: string | HTMLImageElement | HTMLCanvasElement;\n}\n\n/**\n * text\n */\nexport type TextAlign = TextAlignType;\nexport type TextBaseLine = TextBaselineType;\nexport type FontStyle = 'normal' | 'italic' | 'oblique' | string;\nexport type FontWeight = 'normal' | 'bold' | 'lighter' | 'bolder' | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\n"]}
1
+ {"version":3,"sources":["../src/typings/visual.ts"],"names":[],"mappings":"","file":"visual.js","sourcesContent":["import type { PopTipAttributes } from '@visactor/vrender-components';\nimport type { DataView } from '@visactor/vdataset';\nimport type { Cursor } from './cursor';\nimport type { InterpolateType } from './interpolate';\nimport type { ScaleType } from './scale';\nimport type { ShapeType } from './shape';\nimport type { IPoint } from './coordinate';\nimport type { IModelMarkAttributeContext } from '../compile/mark/interface';\nimport type { Datum } from './common';\nimport type { IPadding } from '@visactor/vutils';\nimport type { IColorKey } from '../theme/color-scheme/interface';\nimport type { ITokenKey } from '../theme/token/interface';\nimport type {\n IRepeatType,\n TextAlignType,\n TextBaselineType,\n IRichTextAttribute,\n IGraphicStyle,\n IColor\n} from '@visactor/vrender-core';\n\n// 基础的visual 对应 scale 的属性\nexport interface IVisualSpecBase<D, T> {\n /**\n * type of scale\n */\n type: ScaleType;\n /**\n * will set to scale.domain, it means input of scale\n */\n domain: D[];\n /**\n * will set to scale.range, it means output of scale\n */\n range: T[];\n /**\n * will set to scale.specified if scale support, as a key-value pair matching capability\n * @since 1.1.0\n */\n specified?: { [key: string]: unknown };\n /**\n * enable clamp in linear scale\n * If clamp is enabled, the return value of the scale is always within the scale’s range.\n * @since 1.13.6\n * @default false\n */\n clamp?: boolean;\n}\n// 用来给用户进行mark.style上的映射配置。所以要配置数据维度\nexport interface IVisualSpecStyle<D, T> extends IVisualSpecBase<D, T> {\n /**\n * 指定映射对应的数据字段\n */\n field?: string;\n}\n\nexport type IDataDomainSpec = {\n /**\n * 数据的id\n */\n dataId: string;\n /**\n * 数据字段\n */\n fields: string[];\n};\n\n// 用来提供给用户进行 scale 配置 所以名字是必选的 对用户配置\nexport interface IVisualSpecScale<D, T> extends Omit<IVisualSpecBase<D, T>, 'domain'> {\n /**\n * scale 的id\n */\n id: string;\n /**\n * 定义域范围\n */\n domain:\n | IVisualSpecBase<D, T>['domain']\n // 使用数据的字段值,如果 scale 是连续的,就取区间,如果是离散的就使用 values 。\n // 不考虑图表内的交互等数据筛选,这里只用原始数据的统计信息\n | IDataDomainSpec[];\n}\n// 对用户配置\nexport type IVisual<D = any, R = any> = IVisualSpecStyle<D, R> | IVisualScale;\n\nexport interface IVisualScale {\n /**\n * 对应 IVisualSpecScale 的用户配置 scale-id\n */\n scale: string;\n /**\n * 指定参与映射的数据字段\n */\n field?: string;\n /**\n * 当用户指定 field 后,用该属性来控制值域。\n * @default 'none'\n */\n changeDomain?: 'none' | 'replace' | 'expand';\n}\n\nexport type FunctionType<T> = (datum: Datum, context: IModelMarkAttributeContext, source?: DataView) => T;\nexport type ValueType<T> = T;\nexport type VisualType<T> = ValueType<T> | FunctionType<T> | IVisual<unknown, T>;\n\nexport type TextureType =\n | 'circle'\n | 'dimond'\n | 'rect'\n | 'vertical-line'\n | 'horizontal-line'\n | 'bias-lr'\n | 'bias-rl'\n | 'grid';\n\n/**\n * style格式转换\n */\nexport type ConvertToMarkStyleSpec<T extends Record<string, any>> = {\n [key in keyof T]: VisualType<T[key]>;\n};\n\n/**\n * border\n */\nexport interface IBorder {\n /**\n * 边框离图形边缘的距离\n */\n distance: number | string;\n /**\n * 边框的颜色\n */\n stroke?: string | IGradient;\n /**\n * 边框的透明度\n */\n strokeOpacity?: number;\n /**\n * 边框线的宽度\n */\n lineWidth?: number;\n /**\n * 给边框配置虚线模式。它使用一组值来指定描述模式的线和间隙的交替长度\n */\n lineDash?: number[];\n /**\n * 设置边框的虚线偏移量\n */\n lineDashOffset?: number;\n}\n\nexport interface ICommonSpec {\n /**\n * 图形是否可见\n */\n visible?: boolean;\n /**\n * 图形的x坐标\n */\n x?: number;\n /**\n * 图形的y坐标\n */\n y?: number;\n /**\n * 图形的z坐标,仅适用于3D图表\n */\n z?: number;\n /**\n * 图形的描边颜色。\n * 支持使用 'rgb(255,255,255)','rgba(255,255,255,1)','#fff' 等方式设置为纯色,也支持设置为渐变色描边\n * @todo 隔离主题和 spec 配置\n * IColorKey 类型只适用于主题\n */\n stroke?: string | IGradient | false | (number | boolean)[] | IColorKey | null;\n /**\n * 描边透明度\n */\n strokeOpacity?: number;\n /**\n * 图形的透明度,既影响描边也影响填充\n */\n opacity?: number;\n /**\n * 图形的描边宽度\n */\n lineWidth?: number;\n /**\n * 给描边配置虚线模式。它使用一组值来指定描述模式的线和间隙的交替长度\n */\n lineDash?: number[];\n /**\n * 设置虚线偏移量的属性\n */\n lineDashOffset?: number;\n /**\n * 设置图形的鼠标样式\n */\n cursor?: Cursor;\n /**\n * 设置图形的层级,主意这个是相对层级,图形引擎绘制的时候,会对相同group下的所有图形根据zIndex进行排序,然后从小到大进行渲染\n */\n zIndex?: number;\n /**\n * 图形的旋转角度\n */\n angle?: number;\n /**\n * 基于AABB的锚点位置,用于简单的定位某些path的位置\n */\n anchor?: [number, number];\n\n /**\n * x方向的缩放比例,默认为1,即不进行缩放\n */\n scaleX?: number;\n /**\n * y方向的缩放比例,默认为1,即不进行缩放\n */\n scaleY?: number;\n /**\n * 图形缩放中心\n * @since 1.4.0\n * 可以配置固定坐标,例如 [100, 100];或者百分比坐标,例如 ['50%', '50%'],代表以图元中心为缩放中心\n * */\n scaleCenter?: [number | string, number | string];\n\n // 3d旋转的属性\n /**\n * x方向的旋转角度\n */\n alpha?: number;\n /**\n * y方向的旋转角度\n */\n beta?: number;\n /**\n * 3d的锚点位置\n */\n anchor3d?: [number, number];\n\n /**\n * 选择模式,精确模式,粗糙模式(包围盒模式),自定义模式\n */\n pickMode?: 'accurate' | 'imprecise' | 'custom';\n /**\n * bounds的计算模式\n */\n boundsMode?: 'accurate' | 'imprecise';\n\n /**\n * 用于扩展描边的拾取范围,为 0 就是默认线宽,正数就加宽,负数就减宽\n * @default 0\n * @since 1.7.3\n */\n pickStrokeBuffer?: number;\n\n // 以下是纹理相关的属性\n /**\n * 纹理的类型\n */\n texture?: TextureType | string;\n /**\n * 纹理的颜色\n */\n textureColor?: string;\n /**\n * 纹理单元的大小\n */\n textureSize?: number; // 纹理大小\n /**\n * 纹理之间空隙的大小\n */\n texturePadding?: number;\n\n /**\n * 外边框,外描边,描边位于图形外侧\n */\n outerBorder?: IBorder;\n /**\n * 内边框,内描边,描边位于图形内侧\n */\n innerBorder?: IBorder;\n /**\n * html 浮层,会将配置的html相关内容,绝对定位到图元的位置\n * @experimental\n * @since 1.10.0\n */\n html?: IMarkHtmlSpec;\n\n [key: string]: any;\n}\n\nexport interface IFillMarkSpec extends ICommonSpec {\n /**\n * 图形的填充颜色\n * @todo 隔离主题和 spec 配置\n * IColorKey 类型只适用于主题\n */\n fill?: VisualType<string> | IGradient | false | IColorKey;\n /**\n * 填充的透明度\n */\n fillOpacity?: number;\n\n /**\n * 图形的背景色,支持纯色、image元素、canvas元素\n */\n background?: IColor | HTMLImageElement | HTMLCanvasElement | null;\n}\n\nexport type IMarkHtmlSpec = Partial<IGraphicStyle['html']>;\n\nexport interface ISymbolMarkSpec extends IFillMarkSpec {\n /**\n * x方向的偏移量\n */\n dx?: number;\n /**\n * y方向的偏移量\n */\n dy?: number;\n /**\n * 大小,相当于外接圆的半径\n */\n size?: number | number[];\n /** 对外声明使用shape,vrender图形属性对应的是shape */\n shape?: ShapeType | string;\n /**\n * 标记的类型\n * FIXME: vrender Symbol接收的图形属性,暂时都申明一下\n * */\n symbolType?: ShapeType | string;\n /**\n * x方向的缩放比例,默认为1,即不进行缩放\n */\n scaleX?: number;\n /**\n * y方向的缩放比例,默认为1,即不进行缩放\n */\n scaleY?: number;\n}\n\n// lineMark 和 areaMark 共同配置\nexport interface ILineLikeMarkSpec extends IFillMarkSpec {\n /**\n * 取消的差值类型,默认为线性插值,也就是普通的折线\n */\n curveType?: InterpolateType;\n /**\n * 设置点是否有效,也就是是否合法\n */\n defined?: boolean;\n}\n\nexport interface IAreaMarkSpec extends ILineLikeMarkSpec {\n /**\n * 面积的x1值\n */\n x1?: number;\n /**\n * 面积的y1值\n */\n y1?: number;\n /**\n * 面积图元的方向,\n * horizontal - 水平方向\n * vertical - 垂直方向\n */\n orient?: 'horizontal' | 'vertical';\n}\n\nexport interface ILineMarkSpec extends ILineLikeMarkSpec {\n /**\n * 指定如何绘制每一条线段末端的属性。有 3 个可能的值,分别是:'butt', 'round' and 'square'。默认值是 butt。\n */\n lineCap?: LineStrokeCap;\n /**\n * 用来设置 2 个长度不为 0 的相连部分(线段、圆弧、曲线)如何连接在一起的属性(长度为 0 的变形部分,其指定的末端和控制点在同一位置,会被忽略)。此属性有 3 个值: 'round', 'bevel' and 'miter'。默认值是 'miter'\n */\n lineJoin?: LineStrokeJoin;\n /**\n * 设置斜接面限制比例的属性。当获取属性值时,会返回当前的值(默认值是 10.0 )。当给属性赋值时,0、负数、 Infinity 和 NaN 都会被忽略;除此之外都会被赋予一个新值。\n */\n miterLimit?: number;\n /**\n * stroke 的有界缓冲区\n */\n strokeBoundsBuffer?: number;\n}\n\nexport interface IRuleMarkSpec extends ILineMarkSpec {\n /**\n * 终点x坐标\n */\n x1?: number;\n /**\n * 终点y坐标\n */\n y1?: number;\n}\n\nexport interface ITextMarkSpec extends IFillMarkSpec {\n /**\n * 文字内容\n */\n text?: string | number | string[] | number[];\n /**\n * x 方向偏移\n */\n dx?: number;\n /**\n * y 方向偏移\n */\n dy?: number;\n /**\n * 字号\n */\n fontSize?: number | ITokenKey;\n /**\n * 文字水平方向的对齐方式\n */\n textAlign?: TextAlign;\n /**\n * 文字竖直方向的对齐方式\n */\n textBaseline?: TextBaseLine;\n /**\n * 字体\n */\n fontFamily?: string;\n /**\n * 字重\n */\n fontWeight?: FontWeight;\n /**\n * 字体样式,是否为斜体等\n */\n fontStyle?: FontStyle;\n /**\n * 文字的最大长度\n */\n maxLineWidth?: number;\n /**\n * 文字超出 maxLineWidth 后的省略符\n */\n ellipsis?: string;\n /**\n * 文本省略的位置,默认尾部省略\n * 1. 'start' 文字首部省略\n * 2. 'middle' 文本中间省略\n * 3. 'end' 文本尾部省略\n * @default 'end'\n * @since 1.7.3\n */\n suffixPosition?: 'start' | 'end' | 'middle';\n /**\n * 下划线\n */\n underline?: boolean;\n /**\n * 下划线的虚线样式\n */\n underlineDash?: number[];\n /**\n * 下划线的虚线偏移量\n */\n underlineOffset?: number;\n /**\n * 中划线\n */\n lineThrough?: boolean;\n /**\n * 行高(1.3.1 版本新增字符串类型表示比例值,如\"150%\")\n * @since 1.3.1\n */\n lineHeight?: number | string | ITokenKey;\n /**\n * poptip 相关配置\n */\n poptip?: PopTipAttributes;\n /**\n * 文本的排布方向,如果需要文本纵向排布,可以配置为 'vertical'\n * @default 'horizontal'\n */\n direction?: 'horizontal' | 'vertical';\n /*\n * 单词断行\n */\n wordBreak?: 'break-word' | 'break-all' | 'keep-all';\n /**\n * 高度限制控制显示内容及省略号\n */\n heightLimit?: number;\n /**\n * 按照行数限制显示内容及省略号\n */\n lineClamp?: number;\n /**\n * 设置如何处理空白字符\n */\n whiteSpace?: 'normal' | 'no-wrap';\n}\n\nexport type IRichTextMarkSpec = IRichTextAttribute &\n IFillMarkSpec & { type: 'rich'; text: IRichTextAttribute['textConfig'] };\n\nexport type IComposedTextMarkSpec = ITextMarkSpec | IRichTextMarkSpec;\n\nexport type IPositionedTextMarkSpec = Omit<ITextMarkSpec, 'align' | 'textAlign' | 'baseline' | 'textBaseline'>;\n\nexport interface IRectMarkSpec extends IFillMarkSpec {\n /**\n * 圆角配置。\n * 1. 如果传入数值,则统一为四个角设置圆角\n * 2. 如果传入数组,则分别为 [上左, 上右, 下右, 下左]\n */\n cornerRadius?: number | number[];\n /**\n * 宽度\n */\n width?: number;\n /**\n * 高度\n */\n height?: number;\n /**\n * x方向终点坐标\n */\n x1?: number;\n /**\n * y方向终点坐标\n */\n\n y1?: number;\n}\n\nexport interface IBoxPlotMarkSpec extends ICommonSpec {\n /**\n * box描边宽度\n */\n lineWidth?: number;\n /**\n * box宽度\n */\n boxWidth?: number | string;\n /**\n * 最大最小值宽度\n */\n shaftWidth?: number | string;\n /**\n * 中轴线类型\n */\n shaftShape?: BoxPlotShaftShape;\n /**\n * 盒子填充颜色,为空则不填充\n */\n boxFill?: string;\n // /**\n // * 描边颜色\n // */\n // stroke?: string;\n /**\n * 中轴线透明度,仅当shaftType=bar时生效\n */\n shaftFillOpacity?: number;\n /**\n * 最小值\n */\n min?: (datum: Datum) => number;\n /**\n * 25%分位数\n */\n q1?: (datum: Datum) => number;\n /**\n * 中位数\n */\n median?: (datum: Datum) => number;\n /**\n * 75%分位数\n */\n q3?: (datum: Datum) => number;\n /**\n * 最大值\n */\n max?: (datum: Datum) => number;\n}\n\nexport interface IRippleMarkSpec extends ICommonSpec {\n /**\n * 波纹密度ripple\n * ripple 取值范为[0,1]\n */\n ripple?: number;\n /**\n * 水波纹最大半径\n */\n size?: number;\n}\n\nexport interface ILiquidMarkSpec extends ICommonSpec {\n /**\n * 波浪的变化状态,范围为 [0, 1]\n */\n wave?: number;\n}\n\nexport interface ILiquidOutlineSpec extends ISymbolMarkSpec {\n /**\n * 描边的宽度\n */\n lineWidth: number;\n}\n\nexport interface IOutlierMarkSpec {\n /**\n * 异常点填充颜色\n */\n fill?: string;\n /**\n * 异常点大小\n */\n size?: number;\n}\n\nexport interface IPathMarkSpec extends IFillMarkSpec {\n path?: string;\n // TODO: 该属性后续可能会删除,未定\n /**\n * 平滑缩放,不然会发生跳变,在地图交互场景需要配置为true;常规path缩放不需要\n */\n smoothScale?: boolean;\n}\n\nexport interface ILinkPathMarkSpec extends IFillMarkSpec {\n /**\n * 连边起点的x坐标\n */\n x0?: number;\n /**\n * 连边起点的y坐标\n */\n y0?: number;\n /**\n * 连边终点的x坐标\n */\n x1?: number;\n /**\n * 连边终点的y坐标\n */\n y1?: number;\n /**\n * 连边的厚度,也可以理解为宽度\n */\n thickness?: number;\n /**\n * 连边的曲度,决定了连边的弯曲程度,取值范围为0-1,\n * 0表示不弯曲,也就是直线\n * 1表示最大的弯曲度,\n * 默认值为0.5\n */\n curvature?: number;\n /** round all the coordinates */\n round?: boolean;\n /** the ratio of normal style path */\n ratio?: number;\n /**\n * 对齐方式\n */\n align?: 'start' | 'end' | 'center';\n /**\n * 连边的类型\n *\n */\n pathType?: 'line' | 'smooth' | 'polyline';\n /**\n * 是否展示终点的箭头\n */\n endArrow?: boolean;\n /**\n * 是否展示起点的箭头\n */\n startArrow?: boolean;\n /**\n * 背景线的样式,主要用于部分高亮的场景\n */\n backgroundStyle?: any;\n /**\n * 连边的方向\n */\n direction?: 'horizontal' | 'vertical' | 'LR' | 'RL' | 'TB' | 'BL' | 'radial';\n}\n\n/**\n * arc图元的视觉通道配置\n */\nexport interface IArcMarkSpec extends IFillMarkSpec {\n /**\n * 圆弧的开始角度\n */\n startAngle?: number;\n /**\n * 圆弧的结束角度\n */\n endAngle?: number;\n /**\n * 间隙角度;间隔角度会转换为一个在两个相邻的弧之间的确定的线性距离,定义为 padRadius * | padAngle |\n * 这个距离在弧的开始和结束处都是相等的;\n * 间隔角度通常只应用于环形扇区(即当内半径大于 0)\n */\n padAngle?: number;\n\n /**\n * 外径,既外半径\n */\n outerRadius?: number;\n /**\n * 内径,既内半径\n */\n innerRadius?: number;\n /**\n * 圆角\n */\n cornerRadius?: number;\n /**\n * 内边距\n */\n innerPadding?: number;\n /**\n * 外边距\n */\n outerPadding?: number;\n /**\n * arc的中心点偏移距离,一般是通过在交互状态下设置这个属性来实现将扇区移出中心的一个效果\n */\n centerOffset?: number;\n /**\n * arc 的 roundCap 属性,即圆角是否伸出 startAngle 和 endAngle 之外\n */\n cap?: boolean | [boolean, boolean];\n /**\n * arc 在 roundCap 打开且应用环形渐变时是否对 cap 部分生效\n */\n autoCapConical?: boolean;\n}\n\nexport interface ICellMarkSpec extends ISymbolMarkSpec {\n /**\n * 内边距\n */\n padding?: number | number[] | IPadding;\n}\n\nexport interface IGroupMarkSpec extends IFillMarkSpec {\n /**\n * 是否开启裁剪\n */\n clip?: boolean;\n /**\n * 宽度\n */\n width?: number;\n /**\n * 高度\n */\n height?: number;\n /**\n * 圆角配置。\n * 1. 如果传入数值,则统一为四个角设置圆角\n * 2. 如果传入数组,则分别为 [上左, 上右, 下右, 下左]\n */\n cornerRadius?: number | number[];\n}\n\nexport interface IPolygonMarkSpec extends ICommonSpec, IFillMarkSpec {\n /**\n * 顶点坐标\n */\n points?: IPoint[];\n /**\n * 圆角配置,支持数组配置,数组的顺序同组成 polygon 的顺序对应\n */\n cornerRadius?: number | number[];\n /**\n * x方向的缩放比例,默认为1,即不进行缩放\n */\n scaleX?: number;\n /**\n * y方向的缩放比例,默认为1,即不进行缩放\n */\n scaleY?: number;\n}\n\n/**\n * ImageFill\n */\nexport type RepeatType = 'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat';\nexport type RepeatXYType = 'no-repeat' | 'repeat' | 'stretch';\nexport type ImageOriginType = 'top' | 'bottom';\n\n/**\n * gradient\n */\nexport type GradientPropValue<T> = ValueType<T> | FunctionType<T>;\nexport type GradientStop = {\n /**\n * 渐变色的偏移量,0-1的值\n */\n offset: GradientPropValue<number>;\n /**\n * 渐变色的颜色\n */\n color?: GradientPropValue<string>;\n /**\n * 渐变色的透明度\n */\n opacity?: number;\n};\nexport interface IGradientLinear {\n /**\n * 渐变色的起点x坐标,0-1的值,相对于图形包围盒x方向取值的比例值\n */\n x0?: GradientPropValue<number>;\n /**\n * 渐变色的起点y坐标,0-1的值,相对于图形包围盒y方向取值的比例值\n */\n y0?: GradientPropValue<number>;\n /**\n * 渐变色的终点x坐标,0-1的值,相对于图形包围盒x方向取值的比例值\n */\n x1?: GradientPropValue<number>;\n /**\n * 渐变色的终点y坐标,0-1的值,相对于图形包围盒y方向取值的比例值\n */\n y1?: GradientPropValue<number>;\n /**\n * 渐变色的颜色\n */\n stops: GradientStop[];\n /**\n * 渐变色的类型设置为 'linear',即线形渐变\n */\n gradient: 'linear';\n}\n\nexport interface IGradientRadial {\n /**\n * 径向渐变的起点的半径\n */\n r0?: GradientPropValue<number>;\n /**\n * 径向渐变的起点的x坐标\n */\n x0?: GradientPropValue<number>;\n /**\n * 径向渐变的起点的y坐标\n */\n y0?: GradientPropValue<number>;\n /**\n * 径向渐变的终点的x坐标\n */\n x1?: GradientPropValue<number>;\n /**\n * 径向渐变的终点的y坐标\n */\n y1?: GradientPropValue<number>;\n /**\n * 径向渐变的终点的半径\n */\n r1?: GradientPropValue<number>;\n /**\n * 渐变色的颜色\n */\n stops: GradientStop[];\n /**\n * 渐变色的类型设置为 'radial',即径向渐变\n */\n gradient: 'radial';\n}\n\nexport interface IGradientConical {\n /**\n * 锥形渐变的中心点x坐标\n */\n x?: GradientPropValue<number>;\n /**\n * 锥形渐变的中心点y坐标\n */\n y?: GradientPropValue<number>;\n /**\n * 锥形渐变的开始角度\n */\n startAngle?: GradientPropValue<number>;\n /**\n * 锥形渐变的结束角度\n */\n endAngle?: GradientPropValue<number>;\n /**\n * 锥形渐变的颜色\n */\n stops: GradientStop[];\n /**\n * 渐变色的类型设置为 'conical',即锥形渐变\n */\n gradient: 'conical';\n}\n\nexport type GradientType = 'linear' | 'radial' | 'conical';\nexport type IGradient = IGradientLinear | IGradientRadial | IGradientConical;\n\nexport type LineStrokeCap = 'butt' | 'round' | 'square';\nexport type LineStrokeJoin = 'arcs' | 'bevel' | 'miter' | 'miter-clip' | 'round';\n\nexport type BoxPlotShaftShape = 'line' | 'bar' | 'filled-line';\n/**\n * threshold\n */\nexport interface IThresholdStyle extends IVisualSpecStyle<number, string> {\n domain: number[];\n field: string;\n range: string[];\n type: 'threshold';\n}\n\n// FIXME: For some tool methods that need to use common configuration types\nexport interface IUnknownMarkSpec extends ICommonSpec {\n [key: string]: unknown;\n}\n\nexport interface IImageMarkSpec extends IFillMarkSpec {\n /**\n * 圆角配置。\n * 1. 如果传入数值,则统一为四个角设置圆角\n * 2. 如果传入数组,则分别为 [上左, 上右, 下右, 下左]\n */\n cornerRadius?: number | number[];\n /**\n * 图片的宽度\n */\n width?: number;\n /**\n * 图片的高度\n */\n height?: number;\n /**\n * 当图片的宽度小于 width 时,图片的重复方式\n */\n repeatX?: IRepeatType;\n /**\n * 当图片的高度小于 height 时,图片的重复方式\n */\n repeatY?: IRepeatType;\n /**\n * 设置图片的内容,支持三种类型:\n * 1. string类型,可以是图片资源的路径或者是svg 标签字符串\n * 2. image 元素\n * 3. canvas 元素\n */\n image?: string | HTMLImageElement | HTMLCanvasElement;\n}\n\n/**\n * text\n */\nexport type TextAlign = TextAlignType;\nexport type TextBaseLine = TextBaselineType;\nexport type FontStyle = 'normal' | 'italic' | 'oblique' | string;\nexport type FontWeight = 'normal' | 'bold' | 'lighter' | 'bolder' | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\n"]}
@@ -5,7 +5,7 @@ import { setDefaultCrosshairForCartesianChart } from "../util";
5
5
  export class BoxPlotChartSpecTransformer extends CartesianChartSpecTransformer {
6
6
  _getDefaultSeriesSpec(spec) {
7
7
  var _a;
8
- const dataFields = [ spec.maxField, spec.medianField, spec.q1Field, spec.q3Field, spec.minField, spec.outliersField ], seriesSpec = super._getDefaultSeriesSpec(spec, [ "boxPlot", "minField", "maxField", "q1Field", "medianField", "q3Field", "outliersField", "outliersStyle" ]);
8
+ const dataFields = [ spec.maxField, spec.medianField, spec.q1Field, spec.q3Field, spec.minField, spec.outliersField ], seriesSpec = super._getDefaultSeriesSpec(spec, [ "boxPlot", "outlier", "minField", "maxField", "q1Field", "medianField", "q3Field", "outliersField", "outliersStyle", "boxWidth", "boxMaxWidth", "boxMinWidth", "boxGapInGroup" ]);
9
9
  return seriesSpec.direction = null !== (_a = spec.direction) && void 0 !== _a ? _a : "vertical",
10
10
  seriesSpec["horizontal" === seriesSpec.direction ? "xField" : "yField"] = dataFields,
11
11
  seriesSpec;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chart/box-plot/box-plot-transformer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,oCAAoC,EAAE,MAAM,SAAS,CAAC;AAG/D,MAAM,OAAO,2BAEX,SAAQ,6BAAgC;IAC9B,qBAAqB,CAAC,IAAO;;QACrC,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QACpH,MAAM,UAAU,GAAG,KAAK,CAAC,qBAAqB,CAAC,IAAI,EAAE;YACnD,SAAS;YACT,UAAU;YACV,UAAU;YACV,SAAS;YACT,aAAa;YACb,SAAS;YACT,eAAe;YACf,eAAe;SAChB,CAAC,CAAC;QACH,UAAU,CAAC,SAAS,GAAG,MAAA,IAAI,CAAC,SAAS,6CAAsB,CAAC;QAC5D,UAAU,CAAC,UAAU,CAAC,SAAS,iBAAyB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC;QAE7F,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,aAAa,CAAC,IAAO;QACnB,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACd,IAAI,CAAC,IAAI,GAAG;gBACV;oBACE,MAAM,EAAE,QAAQ;iBACjB;gBACD;oBACE,MAAM,EAAE,MAAM;iBACf;aACF,CAAC;SACH;QACD,oCAAoC,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;CACF","file":"box-plot-transformer.js","sourcesContent":["import { Direction } from '../../typings';\nimport { CartesianChartSpecTransformer } from '../cartesian';\nimport { setDefaultCrosshairForCartesianChart } from '../util';\nimport type { IBoxPlotChartSpec } from './interface';\n\nexport class BoxPlotChartSpecTransformer<\n T extends IBoxPlotChartSpec = IBoxPlotChartSpec\n> extends CartesianChartSpecTransformer<T> {\n protected _getDefaultSeriesSpec(spec: T): any {\n const dataFields = [spec.maxField, spec.medianField, spec.q1Field, spec.q3Field, spec.minField, spec.outliersField];\n const seriesSpec = super._getDefaultSeriesSpec(spec, [\n 'boxPlot',\n 'minField',\n 'maxField',\n 'q1Field',\n 'medianField',\n 'q3Field',\n 'outliersField',\n 'outliersStyle'\n ]);\n seriesSpec.direction = spec.direction ?? Direction.vertical;\n seriesSpec[seriesSpec.direction === Direction.horizontal ? 'xField' : 'yField'] = dataFields;\n\n return seriesSpec;\n }\n\n transformSpec(spec: T): void {\n super.transformSpec(spec);\n if (!spec.axes) {\n spec.axes = [\n {\n orient: 'bottom'\n },\n {\n orient: 'left'\n }\n ];\n }\n setDefaultCrosshairForCartesianChart(spec);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/chart/box-plot/box-plot-transformer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,oCAAoC,EAAE,MAAM,SAAS,CAAC;AAG/D,MAAM,OAAO,2BAEX,SAAQ,6BAAgC;IAC9B,qBAAqB,CAAC,IAAO;;QACrC,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QACpH,MAAM,UAAU,GAAG,KAAK,CAAC,qBAAqB,CAAC,IAAI,EAAE;YACnD,SAAS;YACT,SAAS;YACT,UAAU;YACV,UAAU;YACV,SAAS;YACT,aAAa;YACb,SAAS;YACT,eAAe;YACf,eAAe;YAEf,UAAU;YACV,aAAa;YACb,aAAa;YACb,eAAe;SAChB,CAAC,CAAC;QACH,UAAU,CAAC,SAAS,GAAG,MAAA,IAAI,CAAC,SAAS,6CAAsB,CAAC;QAC5D,UAAU,CAAC,UAAU,CAAC,SAAS,iBAAyB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC;QAE7F,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,aAAa,CAAC,IAAO;QACnB,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACd,IAAI,CAAC,IAAI,GAAG;gBACV;oBACE,MAAM,EAAE,QAAQ;iBACjB;gBACD;oBACE,MAAM,EAAE,MAAM;iBACf;aACF,CAAC;SACH;QACD,oCAAoC,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;CACF","file":"box-plot-transformer.js","sourcesContent":["import { Direction } from '../../typings';\nimport { CartesianChartSpecTransformer } from '../cartesian';\nimport { setDefaultCrosshairForCartesianChart } from '../util';\nimport type { IBoxPlotChartSpec } from './interface';\n\nexport class BoxPlotChartSpecTransformer<\n T extends IBoxPlotChartSpec = IBoxPlotChartSpec\n> extends CartesianChartSpecTransformer<T> {\n protected _getDefaultSeriesSpec(spec: T): any {\n const dataFields = [spec.maxField, spec.medianField, spec.q1Field, spec.q3Field, spec.minField, spec.outliersField];\n const seriesSpec = super._getDefaultSeriesSpec(spec, [\n 'boxPlot',\n 'outlier',\n 'minField',\n 'maxField',\n 'q1Field',\n 'medianField',\n 'q3Field',\n 'outliersField',\n 'outliersStyle',\n\n 'boxWidth',\n 'boxMaxWidth',\n 'boxMinWidth',\n 'boxGapInGroup'\n ]);\n seriesSpec.direction = spec.direction ?? Direction.vertical;\n seriesSpec[seriesSpec.direction === Direction.horizontal ? 'xField' : 'yField'] = dataFields;\n\n return seriesSpec;\n }\n\n transformSpec(spec: T): void {\n super.transformSpec(spec);\n if (!spec.axes) {\n spec.axes = [\n {\n orient: 'bottom'\n },\n {\n orient: 'left'\n }\n ];\n }\n setDefaultCrosshairForCartesianChart(spec);\n }\n}\n"]}
@@ -63,9 +63,9 @@ export class CustomMark extends BaseComponent {
63
63
  this._createExtensionMark(s, mark, namePrefix, i);
64
64
  }))), isValid(spec.dataId) || isValidNumber(spec.dataIndex)) {
65
65
  const dataview = this.getChart().getSeriesData(spec.dataId, spec.dataIndex);
66
- dataview && (dataview.target.addListener("change", (() => {
66
+ dataview && (mark.setDataView(dataview), dataview.target.addListener("change", (() => {
67
67
  mark.getData().updateData();
68
- })), mark.setDataView(dataview));
68
+ })));
69
69
  }
70
70
  }
71
71
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/component/custom-mark/custom-mark.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB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AK,CAAC;IACf,CAAC;;AAtMM,eAAI,GAAG,iBAAiB,CAAC,UAAU,CAAC;AAGpC,kBAAO,GAAG,YAAY,CAAC;AAsMhC,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,OAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AACzD,CAAC,CAAC","file":"custom-mark.js","sourcesContent":["import { BaseComponent } from '../base/base-component';\nimport { ComponentTypeEnum } from '../interface/type';\n// eslint-disable-next-line no-duplicate-imports\nimport { LayoutLevel, LayoutZIndex } from '../../constant/layout';\nimport { PREFIX } from '../../constant/base';\nimport type { EnableMarkType, ICustomMarkGroupSpec, ICustomMarkSpec, ILayoutRect } from '../../typings';\nimport { IComponentMark, MarkTypeEnum, type IGroupMark } from '../../mark/interface';\n// eslint-disable-next-line no-duplicate-imports\nimport { Bounds, isEqual, isNil, isValid, isValidNumber } from '@visactor/vutils';\nimport { Factory } from '../../core/factory';\nimport { animationConfig, userAnimationConfig } from '../../animation/utils';\nimport type { IModelMarkAttributeContext } from '../../compile/mark/interface';\n\n// TODO: 规范范型\nexport class CustomMark extends BaseComponent<ICustomMarkSpec<EnableMarkType>> {\n static type = ComponentTypeEnum.customMark;\n type = ComponentTypeEnum.customMark;\n\n static specKey = 'customMark';\n specKey = 'customMark';\n\n layoutType: 'none' = 'none';\n layoutZIndex: number = LayoutZIndex.CustomMark;\n layoutLevel: number = LayoutLevel.CustomMark;\n\n protected declare _spec: ICustomMarkSpec<Exclude<EnableMarkType, 'group'>> | ICustomMarkGroupSpec;\n\n created() {\n super.created();\n this.initMarks();\n this.initEvent();\n }\n\n protected _markAttributeContext: IModelMarkAttributeContext;\n getMarkAttributeContext() {\n return this._markAttributeContext;\n }\n\n protected _buildMarkAttributeContext() {\n this._markAttributeContext = {\n vchart: this._option.globalInstance,\n globalScale: (key: string, value: string | number) => {\n return this._option.globalScale.getScale(key)?.scale(value);\n }\n };\n }\n\n protected initMarks() {\n if (!this._spec) {\n return;\n }\n\n let parentMark: IGroupMark | null = null;\n if (this._spec.parent) {\n const mark = this.getChart()\n .getAllMarks()\n .find(m => m.getUserId() === this._spec.parent) as IGroupMark;\n if (mark.type === 'group') {\n parentMark = mark;\n }\n }\n this._createExtensionMark(this._spec, parentMark, `${PREFIX}_series_${this.id}_extensionMark`, 0);\n }\n\n private _createExtensionMark(\n spec: ICustomMarkSpec<Exclude<EnableMarkType, 'group'>> | ICustomMarkGroupSpec,\n parentMark: null | IGroupMark,\n namePrefix: string,\n index: number = 0\n ) {\n const mark = this._createMark(\n {\n type: spec.type,\n name: isValid(spec.name) ? `${spec.name}` : `${namePrefix}_${index}`\n },\n {\n // 避免二次dataflow\n skipBeforeLayouted: true,\n attributeContext: this._getMarkAttributeContext(),\n componentType: spec.componentType,\n key: spec.dataKey\n }\n ) as IGroupMark;\n if (!mark) {\n return;\n }\n\n if (isValid(spec.id)) {\n mark.setUserId(spec.id);\n }\n\n if (this._option.globalInstance?.isAnimationEnable() && spec.animation) {\n // 自定义图元默认不添加动画\n const config = animationConfig({}, userAnimationConfig(spec.type, spec as any, this._markAttributeContext));\n mark.setAnimationConfig(config);\n }\n\n if (isNil(parentMark)) {\n this._marks.addMark(mark);\n } else if (parentMark) {\n parentMark.addMark(mark);\n }\n // set style\n this.initMarkStyleWithSpec(mark, spec);\n if (spec.type === 'group') {\n namePrefix = `${namePrefix}_${index}`;\n spec.children?.forEach((s, i) => {\n this._createExtensionMark(s as any, mark, namePrefix, i);\n });\n }\n\n if (isValid(spec.dataId) || isValidNumber(spec.dataIndex)) {\n const dataview = this.getChart().getSeriesData(spec.dataId, spec.dataIndex);\n if (dataview) {\n dataview.target.addListener('change', () => {\n mark.getData().updateData();\n });\n mark.setDataView(dataview);\n }\n }\n }\n\n initEvent() {\n // do nothing\n }\n\n /**\n * updateSpec\n */\n _compareSpec(spec: ICustomMarkSpec<EnableMarkType>, prevSpec: ICustomMarkSpec<EnableMarkType>) {\n const result = super._compareSpec(spec, prevSpec);\n if (!isEqual(prevSpec, spec)) {\n result.reMake = true;\n }\n\n result.change = true;\n result.reRender = true;\n return result;\n }\n\n private _getMarkAttributeContext() {\n return {\n vchart: this._option.globalInstance,\n chart: this.getChart(),\n globalScale: (key: string, value: string | number) => {\n return this._option.globalScale.getScale(key)?.scale(value);\n },\n getLayoutBounds: () => {\n const { x, y } = this.getLayoutStartPoint();\n const { width, height } = this.getLayoutRect();\n return new Bounds().set(x, y, x + width, y + height);\n }\n };\n }\n\n private _getLayoutRect() {\n const bounds = new Bounds();\n\n this.getMarks().forEach(mark => {\n const product = mark.getProduct();\n\n if (product) {\n bounds.union(product.AABBBounds);\n }\n });\n\n if (bounds.empty()) {\n return {\n width: 0,\n height: 0\n };\n }\n\n return {\n width: bounds.width(),\n height: bounds.height()\n };\n }\n\n getBoundsInRect(rect: ILayoutRect) {\n this.setLayoutRect(rect);\n\n const result = this._getLayoutRect();\n const { x, y } = this.getLayoutStartPoint();\n return {\n x1: x,\n y1: y,\n x2: x + result.width,\n y2: y + result.height\n };\n }\n\n getVRenderComponents() {\n const comps: any[] = [];\n const checkFunc = (m: IComponentMark) => {\n if (m && m.type === MarkTypeEnum.group) {\n m.getMarks().forEach(child => {\n checkFunc(child as IComponentMark);\n });\n } else if (m.type === MarkTypeEnum.component) {\n const comp = m?.getComponent();\n\n if (comp) {\n comps.push(comp);\n }\n }\n };\n\n this.getMarks().forEach(m => {\n checkFunc(m as IComponentMark);\n });\n\n return comps;\n }\n}\n\nexport const registerCustomMark = () => {\n Factory.registerComponent(CustomMark.type, CustomMark);\n};\n"]}
1
+ {"version":3,"sources":["../src/component/custom-mark/custom-mark.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO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,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACf,CAAC;;AAvMM,eAAI,GAAG,iBAAiB,CAAC,UAAU,CAAC;AAGpC,kBAAO,GAAG,YAAY,CAAC;AAuMhC,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,OAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AACzD,CAAC,CAAC","file":"custom-mark.js","sourcesContent":["import { BaseComponent } from '../base/base-component';\nimport { ComponentTypeEnum } from '../interface/type';\n// eslint-disable-next-line no-duplicate-imports\nimport { LayoutLevel, LayoutZIndex } from '../../constant/layout';\nimport { PREFIX } from '../../constant/base';\nimport type { EnableMarkType, ICustomMarkGroupSpec, ICustomMarkSpec, ILayoutRect } from '../../typings';\nimport type { IComponentMark } from '../../mark/interface';\nimport { MarkTypeEnum, type IGroupMark } from '../../mark/interface';\n// eslint-disable-next-line no-duplicate-imports\nimport { Bounds, isEqual, isNil, isValid, isValidNumber } from '@visactor/vutils';\nimport { Factory } from '../../core/factory';\nimport { animationConfig, userAnimationConfig } from '../../animation/utils';\nimport type { IModelMarkAttributeContext } from '../../compile/mark/interface';\n\n// TODO: 规范范型\nexport class CustomMark extends BaseComponent<ICustomMarkSpec<EnableMarkType>> {\n static type = ComponentTypeEnum.customMark;\n type = ComponentTypeEnum.customMark;\n\n static specKey = 'customMark';\n specKey = 'customMark';\n\n layoutType: 'none' = 'none';\n layoutZIndex: number = LayoutZIndex.CustomMark;\n layoutLevel: number = LayoutLevel.CustomMark;\n\n protected declare _spec: ICustomMarkSpec<Exclude<EnableMarkType, 'group'>> | ICustomMarkGroupSpec;\n\n created() {\n super.created();\n this.initMarks();\n this.initEvent();\n }\n\n protected _markAttributeContext: IModelMarkAttributeContext;\n getMarkAttributeContext() {\n return this._markAttributeContext;\n }\n\n protected _buildMarkAttributeContext() {\n this._markAttributeContext = {\n vchart: this._option.globalInstance,\n globalScale: (key: string, value: string | number) => {\n return this._option.globalScale.getScale(key)?.scale(value);\n }\n };\n }\n\n protected initMarks() {\n if (!this._spec) {\n return;\n }\n\n let parentMark: IGroupMark | null = null;\n if (this._spec.parent) {\n const mark = this.getChart()\n .getAllMarks()\n .find(m => m.getUserId() === this._spec.parent) as IGroupMark;\n if (mark.type === 'group') {\n parentMark = mark;\n }\n }\n this._createExtensionMark(this._spec, parentMark, `${PREFIX}_series_${this.id}_extensionMark`, 0);\n }\n\n private _createExtensionMark(\n spec: ICustomMarkSpec<Exclude<EnableMarkType, 'group'>> | ICustomMarkGroupSpec,\n parentMark: null | IGroupMark,\n namePrefix: string,\n index: number = 0\n ) {\n const mark = this._createMark(\n {\n type: spec.type,\n name: isValid(spec.name) ? `${spec.name}` : `${namePrefix}_${index}`\n },\n {\n // 避免二次dataflow\n skipBeforeLayouted: true,\n attributeContext: this._getMarkAttributeContext(),\n componentType: spec.componentType,\n key: spec.dataKey\n }\n ) as IGroupMark;\n if (!mark) {\n return;\n }\n\n if (isValid(spec.id)) {\n mark.setUserId(spec.id);\n }\n\n if (this._option.globalInstance?.isAnimationEnable() && spec.animation) {\n // 自定义图元默认不添加动画\n const config = animationConfig({}, userAnimationConfig(spec.type, spec as any, this._markAttributeContext));\n mark.setAnimationConfig(config);\n }\n\n if (isNil(parentMark)) {\n this._marks.addMark(mark);\n } else if (parentMark) {\n parentMark.addMark(mark);\n }\n // set style\n this.initMarkStyleWithSpec(mark, spec);\n if (spec.type === 'group') {\n namePrefix = `${namePrefix}_${index}`;\n spec.children?.forEach((s, i) => {\n this._createExtensionMark(s as any, mark, namePrefix, i);\n });\n }\n\n if (isValid(spec.dataId) || isValidNumber(spec.dataIndex)) {\n const dataview = this.getChart().getSeriesData(spec.dataId, spec.dataIndex);\n\n if (dataview) {\n mark.setDataView(dataview);\n dataview.target.addListener('change', () => {\n mark.getData().updateData();\n });\n }\n }\n }\n\n initEvent() {\n // do nothing\n }\n\n /**\n * updateSpec\n */\n _compareSpec(spec: ICustomMarkSpec<EnableMarkType>, prevSpec: ICustomMarkSpec<EnableMarkType>) {\n const result = super._compareSpec(spec, prevSpec);\n if (!isEqual(prevSpec, spec)) {\n result.reMake = true;\n }\n\n result.change = true;\n result.reRender = true;\n return result;\n }\n\n private _getMarkAttributeContext() {\n return {\n vchart: this._option.globalInstance,\n chart: this.getChart(),\n globalScale: (key: string, value: string | number) => {\n return this._option.globalScale.getScale(key)?.scale(value);\n },\n getLayoutBounds: () => {\n const { x, y } = this.getLayoutStartPoint();\n const { width, height } = this.getLayoutRect();\n return new Bounds().set(x, y, x + width, y + height);\n }\n };\n }\n\n private _getLayoutRect() {\n const bounds = new Bounds();\n\n this.getMarks().forEach(mark => {\n const product = mark.getProduct();\n\n if (product) {\n bounds.union(product.AABBBounds);\n }\n });\n\n if (bounds.empty()) {\n return {\n width: 0,\n height: 0\n };\n }\n\n return {\n width: bounds.width(),\n height: bounds.height()\n };\n }\n\n getBoundsInRect(rect: ILayoutRect) {\n this.setLayoutRect(rect);\n\n const result = this._getLayoutRect();\n const { x, y } = this.getLayoutStartPoint();\n return {\n x1: x,\n y1: y,\n x2: x + result.width,\n y2: y + result.height\n };\n }\n\n getVRenderComponents() {\n const comps: any[] = [];\n const checkFunc = (m: IComponentMark) => {\n if (m && m.type === MarkTypeEnum.group) {\n m.getMarks().forEach(child => {\n checkFunc(child as IComponentMark);\n });\n } else if (m.type === MarkTypeEnum.component) {\n const comp = m?.getComponent();\n\n if (comp) {\n comps.push(comp);\n }\n }\n };\n\n this.getMarks().forEach(m => {\n checkFunc(m as IComponentMark);\n });\n\n return comps;\n }\n}\n\nexport const registerCustomMark = () => {\n Factory.registerComponent(CustomMark.type, CustomMark);\n};\n"]}
@@ -11,7 +11,7 @@ import { isDiscrete } from "@visactor/vscale";
11
11
  const getDataArrayFromFieldArray = (fields, datum) => isValid(datum) ? fields.map((f => datum[f])) : void 0, datumContainsArray = (fields, data) => datum => fields.every(((key, i) => datum[key] === (null == data ? void 0 : data[i]))), hasData = data => !isNil(data) && (isArray(data) ? data.length > 0 && data.every(isValid) : Object.keys(data).length > 0);
12
12
 
13
13
  export function showTooltip(datum, options, component) {
14
- var _a, _b, _c;
14
+ var _a, _b, _c, _d, _e, _f;
15
15
  const opt = Object.assign({
16
16
  regionIndex: 0
17
17
  }, options), componentOptions = component.getOption(), region = componentOptions.getRegionsInUserIdOrIndex(isValid(opt.regionId) ? [ opt.regionId ] : void 0, isValid(opt.regionIndex) ? [ opt.regionIndex ] : void 0)[0];
@@ -71,7 +71,7 @@ export function showTooltip(datum, options, component) {
71
71
  }),
72
72
  item: void 0
73
73
  };
74
- component.processor.dimension.showTooltip(mockDimensionInfo, mockParams, !1);
74
+ null === (_e = null === (_d = null === (_c = component.processor) || void 0 === _c ? void 0 : _c.dimension) || void 0 === _d ? void 0 : _d.showTooltip) || void 0 === _e || _e.call(_d, mockDimensionInfo, mockParams, !1);
75
75
  const vchart = componentOptions.globalInstance;
76
76
  return VChart.globalConfig.uniqueTooltip && VChart.hideTooltip(vchart.id), activeType;
77
77
  }
@@ -88,7 +88,7 @@ export function showTooltip(datum, options, component) {
88
88
  value: mockDatum[info.data.dimensionFields[0]],
89
89
  data: mockDimensionData
90
90
  } ],
91
- chart: null !== (_c = componentOptions.globalInstance.getChart()) && void 0 !== _c ? _c : void 0,
91
+ chart: null !== (_f = componentOptions.globalInstance.getChart()) && void 0 !== _f ? _f : void 0,
92
92
  datum: mockDatum,
93
93
  model: info.series,
94
94
  source: Event_Source_Type.chart,