@visactor/vchart 1.1.2 → 1.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +420 -163
- package/build/index.min.js +1 -1
- package/cjs/chart/area/area.js +3 -1
- package/cjs/chart/area/area.js.map +1 -1
- package/cjs/chart/base-chart.d.ts +7 -2
- package/cjs/chart/base-chart.js +51 -23
- package/cjs/chart/base-chart.js.map +1 -1
- package/cjs/chart/interface/chart.d.ts +1 -0
- package/cjs/chart/interface/chart.js.map +1 -1
- package/cjs/chart/line/line.js +3 -1
- package/cjs/chart/line/line.js.map +1 -1
- package/cjs/chart/radar/radar.js +3 -1
- package/cjs/chart/radar/radar.js.map +1 -1
- package/cjs/chart/sequence/sequence.js +5 -3
- package/cjs/chart/sequence/sequence.js.map +1 -1
- package/cjs/chart/stack.js +3 -3
- package/cjs/chart/stack.js.map +1 -1
- package/cjs/compile/compiler.js +9 -5
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/compile/interface/compiler.d.ts +1 -0
- package/cjs/compile/interface/compiler.js.map +1 -1
- package/cjs/component/axis/cartesian/axis.js +1 -1
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/axis/interface.d.ts +25 -27
- package/cjs/component/axis/interface.js.map +1 -1
- package/cjs/component/axis/polar/axis.js +2 -2
- package/cjs/component/axis/polar/axis.js.map +1 -1
- package/cjs/component/geo/geo-coordinate.js +1 -1
- package/cjs/component/geo/geo-coordinate.js.map +1 -1
- package/cjs/component/geo/projection.js +1 -2
- package/cjs/component/geo/projection.js.map +1 -1
- package/cjs/component/indicator/indicator.js +1 -1
- package/cjs/component/indicator/indicator.js.map +1 -1
- package/cjs/component/marker/base-marker.js +1 -1
- package/cjs/component/marker/base-marker.js.map +1 -1
- package/cjs/component/marker/interface.d.ts +2 -2
- package/cjs/component/marker/interface.js.map +1 -1
- package/cjs/component/tooltip/processor/dimension-tooltip.js +3 -2
- package/cjs/component/tooltip/processor/dimension-tooltip.js.map +1 -1
- package/cjs/constant/event.d.ts +2 -0
- package/cjs/constant/event.js +2 -1
- package/cjs/constant/event.js.map +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/vchart.d.ts +6 -0
- package/cjs/core/vchart.js +72 -27
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/data/initialize.d.ts +2 -1
- package/cjs/data/initialize.js +8 -5
- package/cjs/data/initialize.js.map +1 -1
- package/cjs/data/transforms/legend-data/discrete/discrete.js +3 -2
- package/cjs/data/transforms/legend-data/discrete/discrete.js.map +1 -1
- package/cjs/data/transforms/sankey.d.ts +2 -0
- package/cjs/data/transforms/sankey.js +9 -1
- package/cjs/data/transforms/sankey.js.map +1 -1
- package/cjs/event/events/dimension/base.js +6 -4
- package/cjs/event/events/dimension/base.js.map +1 -1
- package/cjs/event/events/dimension/interface.js.map +1 -1
- package/cjs/event/events/dimension/util/cartesian.d.ts +2 -2
- package/cjs/event/events/dimension/util/cartesian.js +12 -11
- package/cjs/event/events/dimension/util/cartesian.js.map +1 -1
- package/cjs/event/events/dimension/util/common.d.ts +1 -1
- package/cjs/event/events/dimension/util/common.js +13 -6
- package/cjs/event/events/dimension/util/common.js.map +1 -1
- package/cjs/layout/base-layout.d.ts +3 -0
- package/cjs/layout/base-layout.js +8 -4
- package/cjs/layout/base-layout.js.map +1 -1
- package/cjs/layout/grid-layout/grid-layout.d.ts +3 -1
- package/cjs/layout/grid-layout/grid-layout.js +3 -2
- package/cjs/layout/grid-layout/grid-layout.js.map +1 -1
- package/cjs/layout/interface.d.ts +2 -1
- package/cjs/layout/interface.js.map +1 -1
- package/cjs/model/interface.d.ts +1 -4
- package/cjs/model/interface.js.map +1 -1
- package/cjs/model/layout-item.d.ts +0 -3
- package/cjs/model/layout-item.js +1 -8
- package/cjs/model/layout-item.js.map +1 -1
- package/cjs/series/area/area.js +5 -4
- package/cjs/series/area/area.js.map +1 -1
- package/cjs/series/area/interface.d.ts +1 -0
- package/cjs/series/area/interface.js.map +1 -1
- package/cjs/series/base/base-series.js +2 -4
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/geo/geo.js +3 -3
- package/cjs/series/geo/geo.js.map +1 -1
- package/cjs/series/line/interface.d.ts +4 -2
- package/cjs/series/line/interface.js.map +1 -1
- package/cjs/series/line/line.js +5 -3
- package/cjs/series/line/line.js.map +1 -1
- package/cjs/series/map/map.js +6 -6
- package/cjs/series/map/map.js.map +1 -1
- package/cjs/series/mixin/line-mixin.d.ts +1 -1
- package/cjs/series/mixin/line-mixin.js +3 -2
- package/cjs/series/mixin/line-mixin.js.map +1 -1
- package/cjs/series/radar/interface.d.ts +1 -0
- package/cjs/series/radar/interface.js.map +1 -1
- package/cjs/series/radar/radar.js +4 -4
- package/cjs/series/radar/radar.js.map +1 -1
- package/cjs/series/sankey/sankey.js +7 -4
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/cjs/series/scatter/scatter.js +7 -4
- package/cjs/series/scatter/scatter.js.map +1 -1
- package/cjs/series/sunburst/sunburst.d.ts +1 -1
- package/cjs/series/word-cloud/base.d.ts +7 -0
- package/cjs/series/word-cloud/base.js +8 -3
- package/cjs/series/word-cloud/base.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/area.js +5 -0
- package/cjs/theme/buildin-theme/light/series/area.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/line.js +5 -0
- package/cjs/theme/buildin-theme/light/series/line.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/radar.js +5 -0
- package/cjs/theme/buildin-theme/light/series/radar.js.map +1 -1
- package/cjs/typings/params.d.ts +5 -0
- package/cjs/typings/params.js.map +1 -1
- package/cjs/typings/spec/common.d.ts +8 -2
- package/cjs/typings/spec/common.js.map +1 -1
- package/cjs/typings/visual.d.ts +1 -1
- package/cjs/typings/visual.js.map +1 -1
- package/cjs/util/debug.d.ts +2 -2
- package/cjs/util/debug.js +4 -3
- package/cjs/util/debug.js.map +1 -1
- package/cjs/util/image.d.ts +2 -1
- package/cjs/util/image.js +10 -6
- package/cjs/util/image.js.map +1 -1
- package/cjs/util/math.js +5 -3
- package/cjs/util/math.js.map +1 -1
- package/cjs/util/spec.d.ts +4 -0
- package/cjs/util/spec.js +24 -2
- package/cjs/util/spec.js.map +1 -1
- package/esm/chart/area/area.js +3 -1
- package/esm/chart/area/area.js.map +1 -1
- package/esm/chart/base-chart.d.ts +7 -2
- package/esm/chart/base-chart.js +51 -21
- package/esm/chart/base-chart.js.map +1 -1
- package/esm/chart/interface/chart.d.ts +1 -0
- package/esm/chart/interface/chart.js.map +1 -1
- package/esm/chart/line/line.js +3 -1
- package/esm/chart/line/line.js.map +1 -1
- package/esm/chart/radar/radar.js +3 -1
- package/esm/chart/radar/radar.js.map +1 -1
- package/esm/chart/sequence/sequence.js +5 -3
- package/esm/chart/sequence/sequence.js.map +1 -1
- package/esm/chart/stack.js +3 -3
- package/esm/chart/stack.js.map +1 -1
- package/esm/compile/compiler.js +10 -6
- package/esm/compile/compiler.js.map +1 -1
- package/esm/compile/interface/compiler.d.ts +1 -0
- package/esm/compile/interface/compiler.js.map +1 -1
- package/esm/component/axis/cartesian/axis.js +1 -1
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/axis/interface.d.ts +25 -27
- package/esm/component/axis/interface.js.map +1 -1
- package/esm/component/axis/polar/axis.js +2 -2
- package/esm/component/axis/polar/axis.js.map +1 -1
- package/esm/component/geo/geo-coordinate.js +1 -1
- package/esm/component/geo/geo-coordinate.js.map +1 -1
- package/esm/component/geo/projection.js +1 -1
- package/esm/component/geo/projection.js.map +1 -1
- package/esm/component/indicator/indicator.js +1 -1
- package/esm/component/indicator/indicator.js.map +1 -1
- package/esm/component/marker/base-marker.js +1 -1
- package/esm/component/marker/base-marker.js.map +1 -1
- package/esm/component/marker/interface.d.ts +2 -2
- package/esm/component/marker/interface.js.map +1 -1
- package/esm/component/tooltip/processor/dimension-tooltip.js +4 -1
- package/esm/component/tooltip/processor/dimension-tooltip.js.map +1 -1
- package/esm/constant/event.d.ts +2 -0
- package/esm/constant/event.js +2 -1
- package/esm/constant/event.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/vchart.d.ts +6 -0
- package/esm/core/vchart.js +74 -27
- package/esm/core/vchart.js.map +1 -1
- package/esm/data/initialize.d.ts +2 -1
- package/esm/data/initialize.js +9 -4
- package/esm/data/initialize.js.map +1 -1
- package/esm/data/transforms/legend-data/discrete/discrete.js +4 -1
- package/esm/data/transforms/legend-data/discrete/discrete.js.map +1 -1
- package/esm/data/transforms/sankey.d.ts +2 -0
- package/esm/data/transforms/sankey.js +9 -1
- package/esm/data/transforms/sankey.js.map +1 -1
- package/esm/event/events/dimension/base.js +8 -4
- package/esm/event/events/dimension/base.js.map +1 -1
- package/esm/event/events/dimension/interface.js.map +1 -1
- package/esm/event/events/dimension/util/cartesian.d.ts +2 -2
- package/esm/event/events/dimension/util/cartesian.js +7 -8
- package/esm/event/events/dimension/util/cartesian.js.map +1 -1
- package/esm/event/events/dimension/util/common.d.ts +1 -1
- package/esm/event/events/dimension/util/common.js +14 -6
- package/esm/event/events/dimension/util/common.js.map +1 -1
- package/esm/layout/base-layout.d.ts +3 -0
- package/esm/layout/base-layout.js +8 -4
- package/esm/layout/base-layout.js.map +1 -1
- package/esm/layout/grid-layout/grid-layout.d.ts +3 -1
- package/esm/layout/grid-layout/grid-layout.js +3 -2
- package/esm/layout/grid-layout/grid-layout.js.map +1 -1
- package/esm/layout/interface.d.ts +2 -1
- package/esm/layout/interface.js.map +1 -1
- package/esm/model/interface.d.ts +1 -4
- package/esm/model/interface.js.map +1 -1
- package/esm/model/layout-item.d.ts +0 -3
- package/esm/model/layout-item.js +1 -8
- package/esm/model/layout-item.js.map +1 -1
- package/esm/series/area/area.js +5 -4
- package/esm/series/area/area.js.map +1 -1
- package/esm/series/area/interface.d.ts +1 -0
- package/esm/series/area/interface.js.map +1 -1
- package/esm/series/base/base-series.js +1 -4
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/geo/geo.js +3 -3
- package/esm/series/geo/geo.js.map +1 -1
- package/esm/series/line/interface.d.ts +4 -2
- package/esm/series/line/interface.js.map +1 -1
- package/esm/series/line/line.js +5 -3
- package/esm/series/line/line.js.map +1 -1
- package/esm/series/map/map.js +6 -6
- package/esm/series/map/map.js.map +1 -1
- package/esm/series/mixin/line-mixin.d.ts +1 -1
- package/esm/series/mixin/line-mixin.js +3 -2
- package/esm/series/mixin/line-mixin.js.map +1 -1
- package/esm/series/radar/interface.d.ts +1 -0
- package/esm/series/radar/interface.js.map +1 -1
- package/esm/series/radar/radar.js +4 -4
- package/esm/series/radar/radar.js.map +1 -1
- package/esm/series/sankey/sankey.js +7 -4
- package/esm/series/sankey/sankey.js.map +1 -1
- package/esm/series/scatter/scatter.js +5 -4
- package/esm/series/scatter/scatter.js.map +1 -1
- package/esm/series/sunburst/sunburst.d.ts +1 -1
- package/esm/series/word-cloud/base.d.ts +7 -0
- package/esm/series/word-cloud/base.js +7 -0
- package/esm/series/word-cloud/base.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/area.js +5 -0
- package/esm/theme/buildin-theme/light/series/area.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/line.js +5 -0
- package/esm/theme/buildin-theme/light/series/line.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/radar.js +5 -0
- package/esm/theme/buildin-theme/light/series/radar.js.map +1 -1
- package/esm/typings/params.d.ts +5 -0
- package/esm/typings/params.js.map +1 -1
- package/esm/typings/spec/common.d.ts +8 -2
- package/esm/typings/spec/common.js.map +1 -1
- package/esm/typings/visual.d.ts +1 -1
- package/esm/typings/visual.js.map +1 -1
- package/esm/util/debug.d.ts +2 -2
- package/esm/util/debug.js +4 -3
- package/esm/util/debug.js.map +1 -1
- package/esm/util/image.d.ts +2 -1
- package/esm/util/image.js +6 -3
- package/esm/util/image.js.map +1 -1
- package/esm/util/math.js +4 -2
- package/esm/util/math.js.map +1 -1
- package/esm/util/spec.d.ts +4 -0
- package/esm/util/spec.js +21 -0
- package/esm/util/spec.js.map +1 -1
- package/package.json +7 -17
- package/chart.d.ts +0 -1
- package/chart.js +0 -1
- package/component.d.ts +0 -1
- package/component.js +0 -1
- package/core.d.ts +0 -1
- package/core.js +0 -1
- package/layout.d.ts +0 -1
- package/layout.js +0 -1
- package/mark.d.ts +0 -1
- package/mark.js +0 -1
- package/series.d.ts +0 -1
- package/series.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/series/word-cloud/base.ts"],"names":[],"mappings":";;;AAEA,6CAA2C;AAC3C,6CAA6F;AAC7F,oDAAoD;AAGpD,4CAAkD;AAClD,qCAA2C;AAC3C,qCAWkB;AAOlB,qEAA2E;AAC3E,iFAAsF;AAEtF,mDAAgE;AAChE,iDAA6E;AAC7E,6CAA+C;AAC/C,2DAAiD;AACjD,0DAKmC;AACnC,wDAA8D;AAE9D,qDAAiD;AACjD,yEAAoE;AACpE,8CAA2C;AAC3C,0CAA2C;AAE3C,eAAM,CAAC,OAAO,CAAC,CAAC,eAAQ,CAAC,CAAC,CAAC;AAE3B,IAAA,gDAA2B,GAAE,CAAC;AAC9B,IAAA,2DAAgC,GAAE,CAAC;AAInC,MAAa,mBAAmF,SAAQ,wBAAa;IAArH;;QAyBY,mBAAc,GAAsB,CAAC,8BAAqB,EAAE,8BAAqB,CAAC,CAAC;QAQnF,sBAAiB,GAAY,KAAK,CAAC;IA6V/C,CAAC;IArXC,aAAa,CAAC,KAAa;QACzB,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,EAAE;YAClB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;YACzB,IAAI,CAAC,gBAAgB,CAAC,+BAAsB,CAAC,CAAC;SAC/C;IACH,CAAC;IAYD,gBAAgB,CAAC,aAA+B;QAC9C,IAAI,IAA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AE,IAAI,EAAE,8BAAkB,CAAC,WAAW,EAAE,IAAI,EAAE,wBAAY,CAAC,IAAI,EAAE,IACnG","file":"base.js","sourcesContent":["/* eslint-disable no-duplicate-imports */\nimport type { IPadding } from '@visactor/vutils';\nimport { isValid } from '@visactor/vutils';\nimport { AttributeLevel, DEFAULT_DATA_KEY, DEFAULT_DATA_SERIES_FIELD } from '../../constant';\nimport { MarkTypeEnum } from '../../mark/interface';\nimport type { ITextMark } from '../../mark/text';\nimport type { SeriesMarkMap } from '../interface';\nimport { SeriesMarkNameEnum } from '../interface';\nimport { isTrueBrowser } from '../../util';\nimport {\n DEFAULT_DRAW_OUT_OF_BOUND,\n DEFAULT_FONTSIZE_RANGE,\n DEFAULT_FONT_PADDING,\n DEFAULT_FONT_WEIGHT_RANGE,\n DEFAULT_MASK_SHAPE,\n DEFAULT_MIN_FONT_SIZE,\n DEFAULT_RANDOM,\n DEFAULT_ROTATE_ANGLES,\n DEFAULT_ZOOM_TO_FIT,\n SHAPE_TYPE\n} from './config';\nimport type {\n IWordCloudSeriesSpec,\n WordCloudConfigType,\n WordCloudShapeConfigType,\n WordCloudShapeType\n} from './interface';\nimport { registerWordCloudTransforms } from '@visactor/vgrammar-wordcloud';\nimport { registerWordCloudShapeTransforms } from '@visactor/vgrammar-wordcloud-shape';\nimport type { Datum, IPoint } from '../../typings';\nimport { DEFAULT_MARK_ANIMATION } from '../../animation/config';\nimport { animationConfig, userAnimationConfig } from '../../animation/utils';\nimport { LinearScale } from '@visactor/vscale';\nimport { extent } from '@visactor/vgrammar-util';\nimport {\n WORD_CLOUD_ANGLE,\n WORD_CLOUD_FILLING_ANGLE,\n WORD_CLOUD_TEXT,\n WORD_CLOUD_WEIGHT\n} from '../../constant/word-cloud';\nimport { getDataScheme } from '../../theme/color-scheme/util';\nimport type { ICompilableMark } from '../../compile/mark';\nimport { BaseSeries } from '../base/base-series';\nimport { ColorOrdinalScale } from '../../scale/color-ordinal-scale';\nimport { VChart } from '../../core/vchart';\nimport { TextMark } from '../../mark/text';\n\nVChart.useMark([TextMark]);\n\nregisterWordCloudTransforms();\nregisterWordCloudShapeTransforms();\n\nexport type IBaseWordCloudSeriesSpec = Omit<IWordCloudSeriesSpec, 'type'> & { type: string };\n\nexport class BaseWordCloudSeries<T extends IBaseWordCloudSeriesSpec = IBaseWordCloudSeriesSpec> extends BaseSeries<T> {\n static readonly mark: SeriesMarkMap = {\n ...BaseSeries.mark,\n [SeriesMarkNameEnum.word]: { name: SeriesMarkNameEnum.word, type: MarkTypeEnum.text },\n [SeriesMarkNameEnum.fillingWord]: { name: SeriesMarkNameEnum.fillingWord, type: MarkTypeEnum.text }\n };\n\n protected _nameField: string;\n protected _valueField?: string;\n setValueField(field: string) {\n if (isValid(field)) {\n this._valueField = field;\n this.setFontSizeRange(DEFAULT_FONTSIZE_RANGE);\n }\n }\n\n protected _fontFamilyField: string;\n protected _fontWeightField: string;\n protected _fontStyleField: string;\n protected _colorHexField: string;\n protected _colorMode: 'linear' | 'ordinal';\n protected _colorList: string[];\n protected _rotateAngles?: number[];\n protected _fontWeightRange?: [number, number];\n\n protected _fontSizeRange?: [number, number] = [DEFAULT_MIN_FONT_SIZE, DEFAULT_MIN_FONT_SIZE];\n setFontSizeRange(fontSizeRange: [number, number]) {\n if (isValid(fontSizeRange) && isValid(this._spec.valueField)) {\n this._fontSizeRange = fontSizeRange;\n }\n }\n\n protected _maskShape?: string | WordCloudShapeType;\n protected _isWordCloudShape: boolean = false;\n\n protected _keepAspect?: boolean;\n protected _random?: boolean;\n protected _fontPadding?: number;\n protected _fillingFontPadding?: number;\n protected _wordCloudConfig?: WordCloudConfigType;\n protected _wordCloudShapeConfig?: WordCloudShapeConfigType;\n\n protected _padding?: IPadding;\n\n /**\n * @override\n */\n setAttrFromSpec() {\n super.setAttrFromSpec();\n // series布局相关\n this._padding = this._option.getChart().padding;\n\n // 普通词云 & 形状词云 共有spec相关\n this._nameField = this._spec.nameField;\n this._fontFamilyField = this._spec.fontFamilyField;\n this._fontWeightField = this._spec.fontWeightField;\n this._fontStyleField = this._spec.fontStyleField;\n this._colorHexField = this._spec.colorHexField;\n this._colorMode = this._spec.colorMode ?? 'ordinal';\n this._colorList = this._spec.colorList;\n this.setValueField(this._spec.valueField);\n this._fontWeightRange = this._spec.fontWeightRange ?? DEFAULT_FONT_WEIGHT_RANGE;\n this._rotateAngles = this._spec.rotateAngles ?? DEFAULT_ROTATE_ANGLES;\n this.setFontSizeRange(this._spec.fontSizeRange);\n this._maskShape = this._spec.maskShape ?? DEFAULT_MASK_SHAPE;\n this._keepAspect = this._spec.keepAspect;\n this._random = this._spec.random ?? DEFAULT_RANDOM;\n this._fontPadding = this._spec?.word?.padding ?? this._theme?.wordCloud?.word?.padding ?? DEFAULT_FONT_PADDING;\n\n // 普通词云spec相关\n this._wordCloudConfig = {\n drawOutOfBound: DEFAULT_DRAW_OUT_OF_BOUND,\n layoutMode: 'default',\n zoomToFit: DEFAULT_ZOOM_TO_FIT,\n ...this._spec.wordCloudConfig\n };\n\n // 形状词云spec相关\n this._wordCloudShapeConfig = {\n fillingSeriesField: this.getSeriesField(),\n fillingRotateAngles: DEFAULT_ROTATE_ANGLES,\n layoutMode: 'default',\n ...this._spec?.wordCloudShapeConfig\n };\n this._fillingFontPadding =\n this._spec?.fillingWord?.padding ?? this._theme?.wordCloud?.fillingWord?.padding ?? DEFAULT_FONT_PADDING;\n\n this._isWordCloudShape = !SHAPE_TYPE.includes(this._maskShape);\n }\n\n protected _wordMark: ITextMark;\n protected _fillingWordMark: ITextMark;\n initMark(): void {\n this._wordMark = this._createMark(BaseWordCloudSeries.mark.word, {\n defaultMorphElementKey: this._seriesField,\n groupKey: this._seriesField,\n isSeriesMark: true\n }) as ITextMark;\n if (this._isWordCloudShape) {\n this._fillingWordMark = this._createMark(BaseWordCloudSeries.mark.fillingWord) as ITextMark;\n }\n }\n\n initMarkStyle() {\n const wordMark = this._wordMark;\n const fillingWordMark = this._fillingWordMark;\n const textField = this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField;\n if (wordMark) {\n this.setMarkStyle(\n wordMark,\n {\n fill: this._colorHexField\n ? (datum: Datum) => datum[this._colorHexField]\n : this.getWordColorAttribute(this._seriesField, false),\n text: (datum: Datum) => datum[textField],\n x: (datum: Datum) => datum.x,\n y: (datum: Datum) => datum.y,\n fontFamily: (datum: Datum) => datum.fontFamily,\n fontSize: (datum: Datum) => datum.fontSize,\n fontStyle: (datum: Datum) => datum.fontStyle,\n fontWeight: (datum: Datum) => datum.fontWeight,\n angle: (datum: Datum) => datum.angle,\n visible: (datum: Datum) => !datum.isFillingWord\n },\n 'normal',\n AttributeLevel.Series\n );\n }\n if (fillingWordMark) {\n this.setMarkStyle(\n fillingWordMark,\n {\n fill: this._wordCloudShapeConfig.fillingColorHexField\n ? (datum: Datum) => datum[this._wordCloudShapeConfig.fillingColorHexField]\n : this.getWordColorAttribute(this._wordCloudShapeConfig.fillingSeriesField, true),\n text: (datum: Datum) => datum[textField],\n x: (datum: Datum) => datum.x,\n y: (datum: Datum) => datum.y,\n fontFamily: (datum: Datum) => datum.fontFamily,\n fontSize: (datum: Datum) => datum.fontSize,\n fontStyle: (datum: Datum) => datum.fontStyle,\n fontWeight: (datum: Datum) => datum.fontWeight,\n angle: (datum: Datum) => datum.angle,\n visible: (datum: Datum) => datum.isFillingWord\n },\n 'normal',\n AttributeLevel.Series\n );\n }\n this._trigger.registerMark(wordMark);\n this._tooltipHelper?.activeTriggerSet.mark.add(wordMark);\n this._trigger.registerMark(fillingWordMark);\n this._tooltipHelper?.activeTriggerSet.mark.add(fillingWordMark);\n }\n\n initAnimation() {\n if (this._wordMark) {\n this._wordMark.setAnimationConfig(\n animationConfig(DEFAULT_MARK_ANIMATION.wordCloud(), userAnimationConfig(SeriesMarkNameEnum.word, this._spec))\n );\n }\n }\n\n protected getWordOrdinalColorScale(field: string, isFillingWord: boolean) {\n const colorList = isFillingWord ? this._wordCloudShapeConfig.fillingColorList : this._colorList;\n const colorDomain = field ? this.getViewData()?.latestData.map((datum: Datum) => datum[field]) : [];\n const colorRange =\n colorList ??\n this._option.globalScale.getScale('color')?.range() ??\n getDataScheme(this._option.getTheme().colorScheme, this.type as any);\n return new ColorOrdinalScale().domain(colorDomain).range?.(colorRange);\n }\n\n getWordColorAttribute(field: string, isFillingWord: boolean) {\n if (this._colorMode === 'ordinal') {\n return {\n scale: this.getWordOrdinalColorScale(field, isFillingWord),\n field: this._seriesField ?? DEFAULT_DATA_SERIES_FIELD\n };\n }\n // const valueScale = new LinearScale()\n // .domain(extent(this.getViewData()?.latestData.map((datum: Datum) => datum[field])), true)\n // .range([0, 1]);\n let colorList =\n (isFillingWord ? this._colorList : this._wordCloudShapeConfig.fillingColorList) ??\n this._option.globalScale.getScale('color').range();\n // 如果用户只输入了一个 color,无法构成 colorRange,则进行兜底\n if (colorList.length === 1) {\n colorList = [colorList[0], colorList[0]];\n }\n // 颜色插值 todo@chensiji\n // const interpolate = interpolateColors(colorList)\n // return (datum: Datum) => interpolate(valueScale.scale(datum[field]))\n return (datum: Datum) => colorList[0];\n }\n\n compile(): void {\n super.compile();\n\n const wordCloudTransforms: any[] = [];\n const valueField = this._valueField;\n const valueScale = new LinearScale();\n const fontWeightRange = this._fontWeightRange;\n const rotateAngles = this._rotateAngles;\n const fontWeightField = this._fontWeightField;\n const fillingRotateAngles = this._wordCloudShapeConfig.fillingRotateAngles;\n\n // fontWeight处理\n if (valueField) {\n const [minValue, maxValue] = extent(this.getViewData()?.latestData.map((datum: any) => datum[valueField]));\n valueScale.domain([minValue, maxValue], true).range(fontWeightRange);\n wordCloudTransforms.push({\n type: 'map',\n as: WORD_CLOUD_WEIGHT,\n callback: (datum: any) => {\n if (minValue === maxValue) {\n return valueScale.scale(maxValue);\n }\n return valueScale.scale(datum[valueField]);\n }\n });\n }\n\n // rotateAngles处理\n wordCloudTransforms.push({\n type: 'map',\n as: WORD_CLOUD_ANGLE,\n callback: () => {\n return rotateAngles[Math.floor(Math.random() * rotateAngles.length)];\n }\n });\n wordCloudTransforms.push({\n type: 'map',\n as: WORD_CLOUD_FILLING_ANGLE,\n callback: () => {\n return fillingRotateAngles[Math.floor(Math.random() * fillingRotateAngles.length)];\n }\n });\n\n // text fromat method 处理\n if (this._spec.word?.formatMethod) {\n wordCloudTransforms.push({\n type: 'map',\n as: WORD_CLOUD_TEXT,\n callback: this._spec.word.formatMethod\n });\n }\n\n const textField = this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField;\n\n const srView = this.getCompiler().getVGrammarView();\n // 词云 transform\n if (!this._isWordCloudShape) {\n wordCloudTransforms.push({\n type: 'wordcloud',\n // TIP: 非浏览器环境下,使用 fast 布局,否则会出现兼容问题\n layoutType: !isTrueBrowser(this._option.mode) ? 'fast' : this._wordCloudConfig.layoutMode,\n size: [\n srView.width() - this._padding?.left || 0 - this._padding?.right || 0,\n srView.height() - this._padding?.top || 0 - this._padding?.bottom || 0\n ],\n shape: this._maskShape,\n dataIndexKey: DEFAULT_DATA_KEY,\n text: { field: textField },\n fontSize: valueField ? { field: valueField } : this._fontSizeRange[0],\n fontSizeRange: this._fontSizeRange,\n padding: this._fontPadding,\n rotate: { field: WORD_CLOUD_ANGLE },\n fontFamily: this._fontFamilyField ?? this._spec.word?.style?.fontFamily,\n fontWeight: fontWeightField ? { field: fontWeightField } : valueField ? { field: WORD_CLOUD_WEIGHT } : null,\n fontStyle: this._fontStyleField ?? this._spec.word?.style?.fontStyle,\n\n randomVisible: this._random,\n clip: this._wordCloudConfig.drawOutOfBound === 'clip',\n shrink: this._wordCloudConfig.zoomToFit.shrink,\n enlarge: this._wordCloudConfig.zoomToFit.enlarge,\n minFontSize: this._wordCloudConfig.zoomToFit.fontSizeLimitMin,\n progressiveTime: this._wordCloudConfig.progressiveTime,\n progressiveStep: this._wordCloudConfig.progressiveStep\n });\n // 挂到mark的transform上\n (this._wordMark as ICompilableMark).getProduct().transform(wordCloudTransforms);\n }\n // 形状词云 transform\n else {\n wordCloudTransforms.push({\n type: 'wordcloudShape',\n // 形状词云中必须要传入dataIndexKey, 否则填充词无法绘制\n dataIndexKey: DEFAULT_DATA_KEY,\n\n size: [srView.width(), srView.height()],\n shape: this._maskShape,\n\n text: { field: this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField },\n fontSize: valueField ? { field: valueField } : this._fontSizeRange[0],\n fontSizeRange: this._fontSizeRange,\n padding: this._fontPadding,\n rotateList: rotateAngles,\n fontFamily: this._fontFamilyField ?? this._spec.word?.style?.fontFamily,\n fontWeight: fontWeightField ? { field: fontWeightField } : valueField ? { field: WORD_CLOUD_WEIGHT } : null,\n fontStyle: this._fontStyleField ?? this._spec.word?.style?.fontStyle,\n\n fillingFontFamily: this._wordCloudShapeConfig?.fillingFontFamilyField ?? this._spec.word?.style?.fontFamily,\n fillingPadding: this._fillingFontPadding,\n fillingFontStyle: this._wordCloudShapeConfig?.fillingFontStyleField ?? this._spec.word?.style?.fontStyle,\n fillingFontWeight: this._wordCloudShapeConfig?.fillingFontWeightField ?? this._spec.word?.style?.fontWeight, // 填充词fontWeight默认不跟随valueField\n fillingRotateList: fillingRotateAngles,\n\n fillingTimes: this._wordCloudShapeConfig?.fillingTimes,\n fillingXStep: this._wordCloudShapeConfig?.fillingXStep,\n fillingYStep: this._wordCloudShapeConfig?.fillingYStep,\n fillingXRatioStep: this._wordCloudShapeConfig?.fillingXRatioStep,\n fillingYRatioStep: this._wordCloudShapeConfig?.fillingYRatioStep,\n fillingInitialOpacity: this._wordCloudShapeConfig?.fillingInitialOpacity,\n fillingDeltaOpacity: this._wordCloudShapeConfig?.fillingDeltaOpacity,\n fillingInitialFontSize: this._wordCloudShapeConfig?.fillingInitialFontSize,\n fillingDeltaFontSize: this._wordCloudShapeConfig?.fillingDeltaFontSize,\n\n ratio: this._wordCloudShapeConfig?.ratio,\n fillingRatio: this._wordCloudShapeConfig?.fillingRatio,\n removeWhiteBorder: this._wordCloudShapeConfig?.removeWhiteBorder,\n textLayoutTimes: this._wordCloudShapeConfig?.textLayoutTimes,\n fontSizeShrinkFactor: this._wordCloudShapeConfig?.fontSizeShrinkFactor,\n stepFactor: this._wordCloudShapeConfig?.stepFactor,\n layoutMode: this._wordCloudShapeConfig?.layoutMode,\n importantWordCount: this._wordCloudShapeConfig?.importantWordCount,\n globalShinkLimit: this._wordCloudShapeConfig?.globalShinkLimit,\n fontSizeEnlargeFactor: this._wordCloudShapeConfig?.fontSizeEnlargeFactor,\n fillingDeltaFontSizeFactor: this._wordCloudShapeConfig?.fillingDeltaFontSizeFactor\n });\n }\n // 把transform挂载到data的product上\n this._data.getProduct().transform(wordCloudTransforms);\n }\n\n getStatisticFields() {\n const fields: { key: string; operations: Array<'max' | 'min' | 'values'> }[] = [];\n fields.push({ key: this._nameField, operations: ['values'] });\n fields.push({ key: this._valueField, operations: ['max', 'min'] });\n return fields;\n }\n dataToPosition(data: Datum): IPoint {\n return null;\n }\n dataToPositionX(data: any): number {\n return null;\n }\n dataToPositionY(data: any): number {\n return null;\n }\n dataToPositionZ(data: any): number {\n return null;\n }\n valueToPosition(value1: any, value2?: any): IPoint {\n return null;\n }\n setValueFieldToStackOffsetSilhouette(): void {\n // do nothing\n }\n\n getGroupFields(): string[] {\n // do nothing\n return [];\n }\n\n getStackGroupFields(): string[] {\n // do nothing\n return [];\n }\n\n getStackValueField(): string {\n // do nothing\n return '';\n }\n\n setValueFieldToStack(): void {\n // do nothing\n }\n\n setValueFieldToPercent(): void {\n //do nothing\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/series/word-cloud/base.ts"],"names":[],"mappings":";;;AAEA,6CAA2C;AAC3C,6CAA2C;AAC3C,6CAA6F;AAC7F,oDAAoD;AAGpD,4CAAkD;AAClD,qCAA2C;AAC3C,qCAWkB;AAOlB,qEAA2E;AAC3E,iFAAsF;AAEtF,mDAAgE;AAChE,iDAA6E;AAC7E,6CAA+C;AAC/C,2DAAiD;AACjD,0DAKmC;AACnC,wDAA8D;AAE9D,qDAAiD;AACjD,yEA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AI,CAAC;IACd,CAAC;IACD,eAAe,CAAC,MAAW,EAAE,MAAY;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,oCAAoC;IAEpC,CAAC;IAED,cAAc;QAEZ,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,mBAAmB;QAEjB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,kBAAkB;QAEhB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,oBAAoB;IAEpB,CAAC;IAED,sBAAsB;IAEtB,CAAC;IAED,UAAU,CAAC,IAAS;QAClB,MAAM,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC;QACxC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,IAAA,gBAAO,EAAC,YAAY,EAAE,IAAI,CAAC,EAAE;YAChC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC;YACrB,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;YACxB,OAAO,MAAM,CAAC;SACf;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;;AAxYH,kDAyYC;AAxYiB,wBAAI,mCACf,wBAAU,CAAC,IAAI,KAClB,CAAC,8BAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,8BAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,wBAAY,CAAC,IAAI,EAAE,EACrF,CAAC,8BAAkB,CAAC,WAAW,CAAC,EAAE,EAAE,IAAI,EAAE,8BAAkB,CAAC,WAAW,EAAE,IAAI,EAAE,wBAAY,CAAC,IAAI,EAAE,IACnG","file":"base.js","sourcesContent":["/* eslint-disable no-duplicate-imports */\nimport type { IPadding } from '@visactor/vutils';\nimport { isEqual } from '@visactor/vutils';\nimport { isValid } from '@visactor/vutils';\nimport { AttributeLevel, DEFAULT_DATA_KEY, DEFAULT_DATA_SERIES_FIELD } from '../../constant';\nimport { MarkTypeEnum } from '../../mark/interface';\nimport type { ITextMark } from '../../mark/text';\nimport type { SeriesMarkMap } from '../interface';\nimport { SeriesMarkNameEnum } from '../interface';\nimport { isTrueBrowser } from '../../util';\nimport {\n DEFAULT_DRAW_OUT_OF_BOUND,\n DEFAULT_FONTSIZE_RANGE,\n DEFAULT_FONT_PADDING,\n DEFAULT_FONT_WEIGHT_RANGE,\n DEFAULT_MASK_SHAPE,\n DEFAULT_MIN_FONT_SIZE,\n DEFAULT_RANDOM,\n DEFAULT_ROTATE_ANGLES,\n DEFAULT_ZOOM_TO_FIT,\n SHAPE_TYPE\n} from './config';\nimport type {\n IWordCloudSeriesSpec,\n WordCloudConfigType,\n WordCloudShapeConfigType,\n WordCloudShapeType\n} from './interface';\nimport { registerWordCloudTransforms } from '@visactor/vgrammar-wordcloud';\nimport { registerWordCloudShapeTransforms } from '@visactor/vgrammar-wordcloud-shape';\nimport type { Datum, IPoint } from '../../typings';\nimport { DEFAULT_MARK_ANIMATION } from '../../animation/config';\nimport { animationConfig, userAnimationConfig } from '../../animation/utils';\nimport { LinearScale } from '@visactor/vscale';\nimport { extent } from '@visactor/vgrammar-util';\nimport {\n WORD_CLOUD_ANGLE,\n WORD_CLOUD_FILLING_ANGLE,\n WORD_CLOUD_TEXT,\n WORD_CLOUD_WEIGHT\n} from '../../constant/word-cloud';\nimport { getDataScheme } from '../../theme/color-scheme/util';\nimport type { ICompilableMark } from '../../compile/mark';\nimport { BaseSeries } from '../base/base-series';\nimport { ColorOrdinalScale } from '../../scale/color-ordinal-scale';\nimport { VChart } from '../../core/vchart';\nimport { TextMark } from '../../mark/text';\n\nVChart.useMark([TextMark]);\n\nregisterWordCloudTransforms();\nregisterWordCloudShapeTransforms();\n\nexport type IBaseWordCloudSeriesSpec = Omit<IWordCloudSeriesSpec, 'type'> & { type: string };\n\nexport class BaseWordCloudSeries<T extends IBaseWordCloudSeriesSpec = IBaseWordCloudSeriesSpec> extends BaseSeries<T> {\n static readonly mark: SeriesMarkMap = {\n ...BaseSeries.mark,\n [SeriesMarkNameEnum.word]: { name: SeriesMarkNameEnum.word, type: MarkTypeEnum.text },\n [SeriesMarkNameEnum.fillingWord]: { name: SeriesMarkNameEnum.fillingWord, type: MarkTypeEnum.text }\n };\n\n protected _nameField: string;\n protected _valueField?: string;\n setValueField(field: string) {\n if (isValid(field)) {\n this._valueField = field;\n this.setFontSizeRange(DEFAULT_FONTSIZE_RANGE);\n }\n }\n\n protected _fontFamilyField: string;\n protected _fontWeightField: string;\n protected _fontStyleField: string;\n protected _colorHexField: string;\n protected _colorMode: 'linear' | 'ordinal';\n protected _colorList: string[];\n protected _rotateAngles?: number[];\n protected _fontWeightRange?: [number, number];\n\n protected _fontSizeRange?: [number, number] = [DEFAULT_MIN_FONT_SIZE, DEFAULT_MIN_FONT_SIZE];\n setFontSizeRange(fontSizeRange: [number, number]) {\n if (isValid(fontSizeRange) && isValid(this._spec.valueField)) {\n this._fontSizeRange = fontSizeRange;\n }\n }\n\n protected _maskShape?: string | WordCloudShapeType;\n protected _isWordCloudShape: boolean = false;\n\n protected _keepAspect?: boolean;\n protected _random?: boolean;\n protected _fontPadding?: number;\n protected _fillingFontPadding?: number;\n protected _wordCloudConfig?: WordCloudConfigType;\n protected _wordCloudShapeConfig?: WordCloudShapeConfigType;\n\n protected _padding?: IPadding;\n\n /**\n * @override\n */\n setAttrFromSpec() {\n super.setAttrFromSpec();\n // series布局相关\n this._padding = this._option.getChart().padding;\n\n // 普通词云 & 形状词云 共有spec相关\n this._nameField = this._spec.nameField;\n this._fontFamilyField = this._spec.fontFamilyField;\n this._fontWeightField = this._spec.fontWeightField;\n this._fontStyleField = this._spec.fontStyleField;\n this._colorHexField = this._spec.colorHexField;\n this._colorMode = this._spec.colorMode ?? 'ordinal';\n this._colorList = this._spec.colorList;\n this.setValueField(this._spec.valueField);\n this._fontWeightRange = this._spec.fontWeightRange ?? DEFAULT_FONT_WEIGHT_RANGE;\n this._rotateAngles = this._spec.rotateAngles ?? DEFAULT_ROTATE_ANGLES;\n this.setFontSizeRange(this._spec.fontSizeRange);\n this._maskShape = this._spec.maskShape ?? DEFAULT_MASK_SHAPE;\n this._keepAspect = this._spec.keepAspect;\n this._random = this._spec.random ?? DEFAULT_RANDOM;\n this._fontPadding = this._spec?.word?.padding ?? this._theme?.wordCloud?.word?.padding ?? DEFAULT_FONT_PADDING;\n\n // 普通词云spec相关\n this._wordCloudConfig = {\n drawOutOfBound: DEFAULT_DRAW_OUT_OF_BOUND,\n layoutMode: 'default',\n zoomToFit: DEFAULT_ZOOM_TO_FIT,\n ...this._spec.wordCloudConfig\n };\n\n // 形状词云spec相关\n this._wordCloudShapeConfig = {\n fillingSeriesField: this.getSeriesField(),\n fillingRotateAngles: DEFAULT_ROTATE_ANGLES,\n layoutMode: 'default',\n ...this._spec?.wordCloudShapeConfig\n };\n this._fillingFontPadding =\n this._spec?.fillingWord?.padding ?? this._theme?.wordCloud?.fillingWord?.padding ?? DEFAULT_FONT_PADDING;\n\n this._isWordCloudShape = !SHAPE_TYPE.includes(this._maskShape);\n }\n\n protected _wordMark: ITextMark;\n protected _fillingWordMark: ITextMark;\n initMark(): void {\n this._wordMark = this._createMark(BaseWordCloudSeries.mark.word, {\n defaultMorphElementKey: this._seriesField,\n groupKey: this._seriesField,\n isSeriesMark: true\n }) as ITextMark;\n if (this._isWordCloudShape) {\n this._fillingWordMark = this._createMark(BaseWordCloudSeries.mark.fillingWord) as ITextMark;\n }\n }\n\n initMarkStyle() {\n const wordMark = this._wordMark;\n const fillingWordMark = this._fillingWordMark;\n const textField = this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField;\n if (wordMark) {\n this.setMarkStyle(\n wordMark,\n {\n fill: this._colorHexField\n ? (datum: Datum) => datum[this._colorHexField]\n : this.getWordColorAttribute(this._seriesField, false),\n text: (datum: Datum) => datum[textField],\n x: (datum: Datum) => datum.x,\n y: (datum: Datum) => datum.y,\n fontFamily: (datum: Datum) => datum.fontFamily,\n fontSize: (datum: Datum) => datum.fontSize,\n fontStyle: (datum: Datum) => datum.fontStyle,\n fontWeight: (datum: Datum) => datum.fontWeight,\n angle: (datum: Datum) => datum.angle,\n visible: (datum: Datum) => !datum.isFillingWord\n },\n 'normal',\n AttributeLevel.Series\n );\n }\n if (fillingWordMark) {\n this.setMarkStyle(\n fillingWordMark,\n {\n fill: this._wordCloudShapeConfig.fillingColorHexField\n ? (datum: Datum) => datum[this._wordCloudShapeConfig.fillingColorHexField]\n : this.getWordColorAttribute(this._wordCloudShapeConfig.fillingSeriesField, true),\n text: (datum: Datum) => datum[textField],\n x: (datum: Datum) => datum.x,\n y: (datum: Datum) => datum.y,\n fontFamily: (datum: Datum) => datum.fontFamily,\n fontSize: (datum: Datum) => datum.fontSize,\n fontStyle: (datum: Datum) => datum.fontStyle,\n fontWeight: (datum: Datum) => datum.fontWeight,\n angle: (datum: Datum) => datum.angle,\n visible: (datum: Datum) => datum.isFillingWord\n },\n 'normal',\n AttributeLevel.Series\n );\n }\n this._trigger.registerMark(wordMark);\n this._tooltipHelper?.activeTriggerSet.mark.add(wordMark);\n this._trigger.registerMark(fillingWordMark);\n this._tooltipHelper?.activeTriggerSet.mark.add(fillingWordMark);\n }\n\n initAnimation() {\n if (this._wordMark) {\n this._wordMark.setAnimationConfig(\n animationConfig(DEFAULT_MARK_ANIMATION.wordCloud(), userAnimationConfig(SeriesMarkNameEnum.word, this._spec))\n );\n }\n }\n\n protected getWordOrdinalColorScale(field: string, isFillingWord: boolean) {\n const colorList = isFillingWord ? this._wordCloudShapeConfig.fillingColorList : this._colorList;\n const colorDomain = field ? this.getViewData()?.latestData.map((datum: Datum) => datum[field]) : [];\n const colorRange =\n colorList ??\n this._option.globalScale.getScale('color')?.range() ??\n getDataScheme(this._option.getTheme().colorScheme, this.type as any);\n return new ColorOrdinalScale().domain(colorDomain).range?.(colorRange);\n }\n\n getWordColorAttribute(field: string, isFillingWord: boolean) {\n if (this._colorMode === 'ordinal') {\n return {\n scale: this.getWordOrdinalColorScale(field, isFillingWord),\n field: this._seriesField ?? DEFAULT_DATA_SERIES_FIELD\n };\n }\n // const valueScale = new LinearScale()\n // .domain(extent(this.getViewData()?.latestData.map((datum: Datum) => datum[field])), true)\n // .range([0, 1]);\n let colorList =\n (isFillingWord ? this._colorList : this._wordCloudShapeConfig.fillingColorList) ??\n this._option.globalScale.getScale('color').range();\n // 如果用户只输入了一个 color,无法构成 colorRange,则进行兜底\n if (colorList.length === 1) {\n colorList = [colorList[0], colorList[0]];\n }\n // 颜色插值 todo@chensiji\n // const interpolate = interpolateColors(colorList)\n // return (datum: Datum) => interpolate(valueScale.scale(datum[field]))\n return (datum: Datum) => colorList[0];\n }\n\n compile(): void {\n super.compile();\n\n const wordCloudTransforms: any[] = [];\n const valueField = this._valueField;\n const valueScale = new LinearScale();\n const fontWeightRange = this._fontWeightRange;\n const rotateAngles = this._rotateAngles;\n const fontWeightField = this._fontWeightField;\n const fillingRotateAngles = this._wordCloudShapeConfig.fillingRotateAngles;\n\n // fontWeight处理\n if (valueField) {\n const [minValue, maxValue] = extent(this.getViewData()?.latestData.map((datum: any) => datum[valueField]));\n valueScale.domain([minValue, maxValue], true).range(fontWeightRange);\n wordCloudTransforms.push({\n type: 'map',\n as: WORD_CLOUD_WEIGHT,\n callback: (datum: any) => {\n if (minValue === maxValue) {\n return valueScale.scale(maxValue);\n }\n return valueScale.scale(datum[valueField]);\n }\n });\n }\n\n // rotateAngles处理\n wordCloudTransforms.push({\n type: 'map',\n as: WORD_CLOUD_ANGLE,\n callback: () => {\n return rotateAngles[Math.floor(Math.random() * rotateAngles.length)];\n }\n });\n wordCloudTransforms.push({\n type: 'map',\n as: WORD_CLOUD_FILLING_ANGLE,\n callback: () => {\n return fillingRotateAngles[Math.floor(Math.random() * fillingRotateAngles.length)];\n }\n });\n\n // text fromat method 处理\n if (this._spec.word?.formatMethod) {\n wordCloudTransforms.push({\n type: 'map',\n as: WORD_CLOUD_TEXT,\n callback: this._spec.word.formatMethod\n });\n }\n\n const textField = this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField;\n\n const srView = this.getCompiler().getVGrammarView();\n // 词云 transform\n if (!this._isWordCloudShape) {\n wordCloudTransforms.push({\n type: 'wordcloud',\n // TIP: 非浏览器环境下,使用 fast 布局,否则会出现兼容问题\n layoutType: !isTrueBrowser(this._option.mode) ? 'fast' : this._wordCloudConfig.layoutMode,\n size: [\n srView.width() - this._padding?.left || 0 - this._padding?.right || 0,\n srView.height() - this._padding?.top || 0 - this._padding?.bottom || 0\n ],\n shape: this._maskShape,\n dataIndexKey: DEFAULT_DATA_KEY,\n text: { field: textField },\n fontSize: valueField ? { field: valueField } : this._fontSizeRange[0],\n fontSizeRange: this._fontSizeRange,\n padding: this._fontPadding,\n rotate: { field: WORD_CLOUD_ANGLE },\n fontFamily: this._fontFamilyField ?? this._spec.word?.style?.fontFamily,\n fontWeight: fontWeightField ? { field: fontWeightField } : valueField ? { field: WORD_CLOUD_WEIGHT } : null,\n fontStyle: this._fontStyleField ?? this._spec.word?.style?.fontStyle,\n\n randomVisible: this._random,\n clip: this._wordCloudConfig.drawOutOfBound === 'clip',\n shrink: this._wordCloudConfig.zoomToFit.shrink,\n enlarge: this._wordCloudConfig.zoomToFit.enlarge,\n minFontSize: this._wordCloudConfig.zoomToFit.fontSizeLimitMin,\n progressiveTime: this._wordCloudConfig.progressiveTime,\n progressiveStep: this._wordCloudConfig.progressiveStep\n });\n // 挂到mark的transform上\n (this._wordMark as ICompilableMark).getProduct().transform(wordCloudTransforms);\n }\n // 形状词云 transform\n else {\n wordCloudTransforms.push({\n type: 'wordcloudShape',\n // 形状词云中必须要传入dataIndexKey, 否则填充词无法绘制\n dataIndexKey: DEFAULT_DATA_KEY,\n\n size: [srView.width(), srView.height()],\n shape: this._maskShape,\n\n text: { field: this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField },\n fontSize: valueField ? { field: valueField } : this._fontSizeRange[0],\n fontSizeRange: this._fontSizeRange,\n padding: this._fontPadding,\n rotateList: rotateAngles,\n fontFamily: this._fontFamilyField ?? this._spec.word?.style?.fontFamily,\n fontWeight: fontWeightField ? { field: fontWeightField } : valueField ? { field: WORD_CLOUD_WEIGHT } : null,\n fontStyle: this._fontStyleField ?? this._spec.word?.style?.fontStyle,\n\n fillingFontFamily: this._wordCloudShapeConfig?.fillingFontFamilyField ?? this._spec.word?.style?.fontFamily,\n fillingPadding: this._fillingFontPadding,\n fillingFontStyle: this._wordCloudShapeConfig?.fillingFontStyleField ?? this._spec.word?.style?.fontStyle,\n fillingFontWeight: this._wordCloudShapeConfig?.fillingFontWeightField ?? this._spec.word?.style?.fontWeight, // 填充词fontWeight默认不跟随valueField\n fillingRotateList: fillingRotateAngles,\n\n fillingTimes: this._wordCloudShapeConfig?.fillingTimes,\n fillingXStep: this._wordCloudShapeConfig?.fillingXStep,\n fillingYStep: this._wordCloudShapeConfig?.fillingYStep,\n fillingXRatioStep: this._wordCloudShapeConfig?.fillingXRatioStep,\n fillingYRatioStep: this._wordCloudShapeConfig?.fillingYRatioStep,\n fillingInitialOpacity: this._wordCloudShapeConfig?.fillingInitialOpacity,\n fillingDeltaOpacity: this._wordCloudShapeConfig?.fillingDeltaOpacity,\n fillingInitialFontSize: this._wordCloudShapeConfig?.fillingInitialFontSize,\n fillingDeltaFontSize: this._wordCloudShapeConfig?.fillingDeltaFontSize,\n\n ratio: this._wordCloudShapeConfig?.ratio,\n fillingRatio: this._wordCloudShapeConfig?.fillingRatio,\n removeWhiteBorder: this._wordCloudShapeConfig?.removeWhiteBorder,\n textLayoutTimes: this._wordCloudShapeConfig?.textLayoutTimes,\n fontSizeShrinkFactor: this._wordCloudShapeConfig?.fontSizeShrinkFactor,\n stepFactor: this._wordCloudShapeConfig?.stepFactor,\n layoutMode: this._wordCloudShapeConfig?.layoutMode,\n importantWordCount: this._wordCloudShapeConfig?.importantWordCount,\n globalShinkLimit: this._wordCloudShapeConfig?.globalShinkLimit,\n fontSizeEnlargeFactor: this._wordCloudShapeConfig?.fontSizeEnlargeFactor,\n fillingDeltaFontSizeFactor: this._wordCloudShapeConfig?.fillingDeltaFontSizeFactor\n });\n }\n // 把transform挂载到data的product上\n this._data.getProduct().transform(wordCloudTransforms);\n }\n\n getStatisticFields() {\n const fields: { key: string; operations: Array<'max' | 'min' | 'values'> }[] = [];\n fields.push({ key: this._nameField, operations: ['values'] });\n fields.push({ key: this._valueField, operations: ['max', 'min'] });\n return fields;\n }\n dataToPosition(data: Datum): IPoint {\n return null;\n }\n dataToPositionX(data: any): number {\n return null;\n }\n dataToPositionY(data: any): number {\n return null;\n }\n dataToPositionZ(data: any): number {\n return null;\n }\n valueToPosition(value1: any, value2?: any): IPoint {\n return null;\n }\n setValueFieldToStackOffsetSilhouette(): void {\n // do nothing\n }\n\n getGroupFields(): string[] {\n // do nothing\n return [];\n }\n\n getStackGroupFields(): string[] {\n // do nothing\n return [];\n }\n\n getStackValueField(): string {\n // do nothing\n return '';\n }\n\n setValueFieldToStack(): void {\n // do nothing\n }\n\n setValueFieldToPercent(): void {\n //do nothing\n }\n\n updateSpec(spec: any) {\n const originalSpec = this._originalSpec;\n const result = super.updateSpec(spec);\n if (!isEqual(originalSpec, spec)) {\n result.reMake = true;\n result.reCompile = true;\n return result;\n }\n return result;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/buildin-theme/light/series/area.ts"],"names":[],"mappings":";;;AACA,4CAA+C;AAElC,QAAA,IAAI,GAAqB;IACpC,KAAK,EAAE;QACL,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,CAAC;QACT,QAAQ,EAAE,KAAK;QACf,KAAK,EAAE;YACL,MAAM,EAAE,OAAO;YACf,SAAS,EAAE,CAAC;YACZ,QAAQ,EAAE,2BAAe,CAAC,eAAe;SAC1C;KACF;CACF,CAAC","file":"area.js","sourcesContent":["import type { IAreaSeriesTheme } from '../../../../series/area/interface';\nimport { THEME_CONSTANTS } from '../constants';\n\nexport const area: IAreaSeriesTheme = {\n label: {\n visible: false,\n offset: 5,\n position: 'top',\n style: {\n stroke: 'white',\n lineWidth: 2,\n fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE\n }\n }\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/theme/buildin-theme/light/series/area.ts"],"names":[],"mappings":";;;AACA,4CAA+C;AAElC,QAAA,IAAI,GAAqB;IACpC,KAAK,EAAE;QACL,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,CAAC;QACT,QAAQ,EAAE,KAAK;QACf,KAAK,EAAE;YACL,MAAM,EAAE,OAAO;YACf,SAAS,EAAE,CAAC;YACZ,QAAQ,EAAE,2BAAe,CAAC,eAAe;SAC1C;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,UAAU,EAAE,QAAQ;SACrB;KACF;CACF,CAAC","file":"area.js","sourcesContent":["import type { IAreaSeriesTheme } from '../../../../series/area/interface';\nimport { THEME_CONSTANTS } from '../constants';\n\nexport const area: IAreaSeriesTheme = {\n label: {\n visible: false,\n offset: 5,\n position: 'top',\n style: {\n stroke: 'white',\n lineWidth: 2,\n fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE\n }\n },\n point: {\n style: {\n symbolType: 'circle'\n }\n }\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/buildin-theme/light/series/line.ts"],"names":[],"mappings":";;;AACA,4CAA+C;AAElC,QAAA,IAAI,GAAqB;IACpC,KAAK,EAAE;QACL,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,CAAC;QACT,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,OAAO;YACf,QAAQ,EAAE,2BAAe,CAAC,eAAe;SAC1C;KACF;CACF,CAAC","file":"line.js","sourcesContent":["import type { ILineSeriesTheme } from '../../../../series/line/interface';\nimport { THEME_CONSTANTS } from '../constants';\n\nexport const line: ILineSeriesTheme = {\n label: {\n visible: false,\n position: 'top',\n offset: 5,\n style: {\n lineWidth: 2,\n stroke: 'white',\n fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE\n }\n }\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/theme/buildin-theme/light/series/line.ts"],"names":[],"mappings":";;;AACA,4CAA+C;AAElC,QAAA,IAAI,GAAqB;IACpC,KAAK,EAAE;QACL,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,CAAC;QACT,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,OAAO;YACf,QAAQ,EAAE,2BAAe,CAAC,eAAe;SAC1C;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,UAAU,EAAE,QAAQ;SACrB;KACF;CACF,CAAC","file":"line.js","sourcesContent":["import type { ILineSeriesTheme } from '../../../../series/line/interface';\nimport { THEME_CONSTANTS } from '../constants';\n\nexport const line: ILineSeriesTheme = {\n label: {\n visible: false,\n position: 'top',\n offset: 5,\n style: {\n lineWidth: 2,\n stroke: 'white',\n fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE\n }\n },\n point: {\n style: {\n symbolType: 'circle'\n }\n }\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/buildin-theme/light/series/radar.ts"],"names":[],"mappings":";;;AACA,4CAA+C;AAElC,QAAA,KAAK,GAAsB;IACtC,KAAK,EAAE;QACL,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,CAAC;QACT,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,OAAO;YACf,QAAQ,EAAE,2BAAe,CAAC,eAAe;SAC1C;KACF;CACF,CAAC","file":"radar.js","sourcesContent":["import type { IRadarSeriesTheme } from '../../../../series/radar/interface';\nimport { THEME_CONSTANTS } from '../constants';\n\nexport const radar: IRadarSeriesTheme = {\n label: {\n visible: false,\n offset: 5,\n style: {\n lineWidth: 2,\n stroke: 'white',\n fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE\n }\n }\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/theme/buildin-theme/light/series/radar.ts"],"names":[],"mappings":";;;AACA,4CAA+C;AAElC,QAAA,KAAK,GAAsB;IACtC,KAAK,EAAE;QACL,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,CAAC;QACT,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,OAAO;YACf,QAAQ,EAAE,2BAAe,CAAC,eAAe;SAC1C;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,UAAU,EAAE,QAAQ;SACrB;KACF;CACF,CAAC","file":"radar.js","sourcesContent":["import type { IRadarSeriesTheme } from '../../../../series/radar/interface';\nimport { THEME_CONSTANTS } from '../constants';\n\nexport const radar: IRadarSeriesTheme = {\n label: {\n visible: false,\n offset: 5,\n style: {\n lineWidth: 2,\n stroke: 'white',\n fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE\n }\n },\n point: {\n style: {\n symbolType: 'circle'\n }\n }\n};\n"]}
|
package/cjs/typings/params.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IChart } from '../chart/interface';
|
|
1
2
|
import type { StringOrNumber } from './common';
|
|
2
3
|
import type { TooltipActiveType } from './tooltip';
|
|
3
4
|
export interface IRegionQuerier {
|
|
@@ -10,3 +11,7 @@ export interface IShowTooltipOption extends IRegionQuerier {
|
|
|
10
11
|
alwaysShow?: boolean;
|
|
11
12
|
activeType?: TooltipActiveType;
|
|
12
13
|
}
|
|
14
|
+
export interface utilFunctionCtx {
|
|
15
|
+
chart?: IChart;
|
|
16
|
+
onError?: (...args: any[]) => void;
|
|
17
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/typings/params.ts"],"names":[],"mappings":"","file":"params.js","sourcesContent":["import type { StringOrNumber } from './common';\nimport type { TooltipActiveType } from './tooltip';\n\nexport interface IRegionQuerier {\n regionId?: StringOrNumber;\n regionIndex?: number;\n}\n\nexport interface IShowTooltipOption extends IRegionQuerier {\n /* tooltip预期显示的x坐标(为空则在图元附近) */\n x?: number;\n /* tooltip预期显示的y坐标(为空则在图元附近) */\n y?: number;\n /* 是否常显(如果为false或空的话,手动触发tooltip之后,tooltip可能被自动触发的别的tooltip替代) */\n alwaysShow?: boolean;\n /* tooltip类型(为空则自动判断) */\n activeType?: TooltipActiveType;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/typings/params.ts"],"names":[],"mappings":"","file":"params.js","sourcesContent":["import type { IChart } from '../chart/interface';\nimport type { StringOrNumber } from './common';\nimport type { TooltipActiveType } from './tooltip';\n\nexport interface IRegionQuerier {\n regionId?: StringOrNumber;\n regionIndex?: number;\n}\n\nexport interface IShowTooltipOption extends IRegionQuerier {\n /* tooltip预期显示的x坐标(为空则在图元附近) */\n x?: number;\n /* tooltip预期显示的y坐标(为空则在图元附近) */\n y?: number;\n /* 是否常显(如果为false或空的话,手动触发tooltip之后,tooltip可能被自动触发的别的tooltip替代) */\n alwaysShow?: boolean;\n /* tooltip类型(为空则自动判断) */\n activeType?: TooltipActiveType;\n}\n\nexport interface utilFunctionCtx {\n chart?: IChart;\n onError?: (...args: any[]) => void;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IImageMarkSpec } from './../visual';
|
|
1
|
+
import type { IFillMarkSpec, IImageMarkSpec } from './../visual';
|
|
2
2
|
import type { ILayoutPaddingSpec } from '../../model/interface';
|
|
3
3
|
import type { LayoutCallBack } from '../../layout/interface';
|
|
4
4
|
import type { IElement, srIOption3DType } from '@visactor/vgrammar';
|
|
@@ -34,6 +34,7 @@ export interface IInitOption extends Omit<IRenderOption, 'pluginList'> {
|
|
|
34
34
|
options3d?: srIOption3DType;
|
|
35
35
|
layout?: LayoutCallBack;
|
|
36
36
|
poptip?: boolean;
|
|
37
|
+
onError?: (...args: any[]) => void;
|
|
37
38
|
}
|
|
38
39
|
export declare enum RenderModeEnum {
|
|
39
40
|
'desktop-browser' = "desktop-browser",
|
|
@@ -70,8 +71,13 @@ export interface IChartSpec {
|
|
|
70
71
|
scales?: IVisualSpecScale<unknown, unknown>[];
|
|
71
72
|
customMark?: ICustomMarkSpec<EnableMarkType>[];
|
|
72
73
|
theme?: Omit<ITheme, 'name'> | string;
|
|
73
|
-
background?:
|
|
74
|
+
background?: IBackgroundSpec;
|
|
74
75
|
}
|
|
76
|
+
export type IBackgroundStyleSpec = ConvertToMarkStyleSpec<Omit<IFillMarkSpec, 'width' | 'height' | 'background'>> & {
|
|
77
|
+
image?: IRectMarkSpec['background'];
|
|
78
|
+
cornerRadius?: IRectMarkSpec['cornerRadius'];
|
|
79
|
+
};
|
|
80
|
+
export type IBackgroundSpec = string | IBackgroundStyleSpec;
|
|
75
81
|
export type IDataType = IDataValues | DataView;
|
|
76
82
|
export type IData = IDataType | IDataType[];
|
|
77
83
|
export type DataKeyType = string | string[] | ((data: Datum, index: number) => string);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/typings/spec/common.ts"],"names":[],"mappings":";;;AAkGA,IAAY,cAQX;AARD,WAAY,cAAc;IACxB,qDAAqC,CAAA;IACrC,mDAAmC,CAAA;IACnC,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;IACrB,qDAAqC,CAAA;IACrC,+BAAe,CAAA;AACjB,CAAC,EARW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAQzB","file":"common.js","sourcesContent":["import type { IImageMarkSpec } from './../visual';\nimport type { ILayoutPaddingSpec } from '../../model/interface';\nimport type { LayoutCallBack } from '../../layout/interface';\nimport type { IElement, srIOption3DType } from '@visactor/vgrammar';\nimport type {\n DataSet,\n DataView,\n ISimplifyOptions,\n IFieldsOptions,\n IFilterOptions,\n IFoldOptions,\n IDsvParserOptions\n} from '@visactor/vdataset';\nimport type { IRegionSpec } from '../../region/interface';\nimport type { IDiscreteLegendSpec } from '../../component/legend/discrete/interface';\nimport type { IHoverSpec, ISelectSpec, ITriggerSpec } from '../../interaction/interface';\nimport type { IRenderOption } from '../../compile/interface';\nimport type { ITooltipSpec } from '../../component/tooltip/interface';\n// eslint-disable-next-line no-duplicate-imports\nimport type { ILayoutSpec } from '../../layout/interface';\nimport type {\n ConvertToMarkStyleSpec,\n IArc3dMarkSpec,\n IArcMarkSpec,\n IAreaMarkSpec,\n IBoxPlotMarkSpec,\n ICommonSpec,\n IGroupMarkSpec,\n ILineMarkSpec,\n ILinkPathMarkSpec,\n IPathMarkSpec,\n IPolygonMarkSpec,\n IProgressArcMarkSpec,\n IPyramid3dMarkSpec,\n IRect3dMarkSpec,\n IRectMarkSpec,\n IRuleMarkSpec,\n ISymbolMarkSpec,\n ITextMarkSpec,\n IVisualSpecScale\n} from '../visual';\nimport type { StateValue } from '../../compile/mark';\nimport type { ISeriesStyle, SeriesType } from '../../series/interface';\nimport type { ILayoutOrientPadding } from '../../model/interface';\nimport type { Datum, StringOrNumber } from '../common';\nimport type { IInvalidType } from '../data';\nimport type { IMorphSeriesSpec } from '../../animation/spec';\nimport type { IPlayer } from '../../component/player';\nimport type { IMarkProgressiveConfig, MarkTypeEnum } from '../../mark/interface';\nimport type { IDataZoomSpec, IScrollBarSpec } from '../../component/data-zoom';\nimport type { ICrosshairSpec } from '../../component/crosshair/interface';\nimport type { ITheme } from '../../theme';\nimport type { ITitleSpec } from '../../component/title/interface';\nimport type { IBrushSpec } from '../../component/brush';\n\nexport type IChartPadding = ILayoutOrientPadding | number;\n\n/** chart option */\nexport interface IInitOption extends Omit<IRenderOption, 'pluginList'> {\n /**\n * **仅生效于浏览器环境。**\n * 图表挂载的父容器,可以直接指定容器 id,也可以传入 dom 对象\n */\n dom?: string | HTMLElement;\n /**\n * 除去选择 dom 属性进行挂载父容器,也可以使用 renderCanvas 属性直接传入 canvas 实例/ canvasId\n * 小程序/小组件环境请直接传入 id\n */\n renderCanvas?: string | HTMLCanvasElement;\n /** 数据集 */\n dataSet?: DataSet;\n /** 是否自适应容器大小 */\n autoFit?: boolean;\n /**\n * 性能测试钩子\n */\n performanceHook?: IPerformanceHook;\n /**\n * 是否开启动画\n */\n animation?: boolean;\n /**\n * 3d配置\n */\n options3d?: srIOption3DType;\n\n /**\n * 自定义布局函数\n */\n layout?: LayoutCallBack;\n\n /**\n * 当文本省略时,鼠标 hover 到文本上时是否显示 poptip\n * @default true\n */\n poptip?: boolean;\n}\n\nexport enum RenderModeEnum {\n 'desktop-browser' = 'desktop-browser',\n 'mobile-browser' = 'mobile-browser',\n 'node' = 'node',\n 'worker' = 'worker',\n 'miniApp' = 'miniApp',\n 'desktop-miniApp' = 'desktop-miniApp',\n 'lynx' = 'lynx'\n}\nexport type RenderMode = keyof typeof RenderModeEnum;\n\n/** chart spec */\nexport interface IChartSpec {\n /** 图表类型 */\n type: string;\n /** 数据 */\n data?: IData;\n /** 画布宽度 */\n width?: number;\n /** 画布高度 */\n height?: number;\n /**\n * 图表宽高是否自适应容器,浏览器环境下默认为 true。\n * 该配置的优先级高于构造函数中的 autoFit 配置。\n * 如果用户配置了 width,则以用户配置的 width 为准,height 同理。\n */\n autoFit?: boolean;\n /**\n * 图表整体 padding 设置\n */\n padding?: ILayoutPaddingSpec;\n /**\n * 图表色系配置\n */\n color?: string[] | Omit<IVisualSpecScale<unknown, string>, 'id'>;\n /**\n * 系列\n * @description 仅在组合图中使用, 文档中除组合图外均未透出该配置\n */\n series?: ISeriesSpec[];\n /**\n * 系列样式\n * @description 仅在图表配置了seriesField时生效\n */\n seriesStyle?: ISeriesStyle;\n\n /** hover 交互 */\n hover?: boolean | IHoverSpec;\n /** select 交互 */\n select?: boolean | ISelectSpec;\n\n /** region配置 */\n region?: IRegionSpec[];\n /** 图表标题配置 */\n title?: ITitleSpec;\n /** 布局配置 */\n layout?: ILayoutSpec;\n /** 图例配置 */\n legends?: IDiscreteLegendSpec | IDiscreteLegendSpec[];\n /** 十字辅助线配置 */\n crosshair?: ICrosshairSpec | ICrosshairSpec[];\n /** tooltip配置 */\n tooltip?: ITooltipSpec;\n /** 播放器配置 */\n player?: IPlayer;\n /** 缩略轴配置 */\n dataZoom?: IDataZoomSpec[];\n /** 滚动条配置 */\n scrollBar?: IScrollBarSpec[];\n /** 框选配置 */\n brush?: IBrushSpec;\n /** 全局 scale 配置 */\n scales?: IVisualSpecScale<unknown, unknown>[];\n /** 自定义mark */\n customMark?: ICustomMarkSpec<EnableMarkType>[];\n /**\n * 图表上的主题定义。\n * 可以直接配置主题名,前提是该主题名已经注册\n */\n theme?: Omit<ITheme, 'name'> | string;\n /**\n * 图表背景色配置,优先级高于构造函数中的 background 配置\n */\n background?: string;\n\n // TODO:后续开放,现在仍有问题\n // poptip?: PopTipAttributes;\n\n // TODO: 补充动画配置\n}\n\n/** data */\nexport type IDataType = IDataValues | DataView;\nexport type IData = IDataType | IDataType[];\nexport type DataKeyType = string | string[] | ((data: Datum, index: number) => string);\nexport type BuildInTransformOptions =\n | {\n /** 地理数据简化 */\n type: 'simplify';\n options: ISimplifyOptions;\n }\n | {\n /** 数据维度处理,包括排序,逆序,数据筛选能力 */\n type: 'fields';\n options: IFieldsOptions;\n }\n | {\n /** 使用回调的自定义筛选 */\n type: 'filter';\n options: IFilterOptions;\n }\n | {\n /** 数据展开 */\n type: 'fold';\n options: IFoldOptions;\n };\n\nexport interface IFieldsMeta {\n /** TODO: 字段通用format, 暂时先不支持 */\n // format?: (datum: Datum, index: number) => unknown;\n /** 字段别名 */\n alias?: string;\n /** 字段取值范围 */\n domain?: StringOrNumber[];\n /** 是否使用 domain 锁定统计信息。默认为 false */\n lockStatisticsByDomain?: boolean;\n /** 连续型 还是 离散型 */\n type?: 'ordinal' | 'linear';\n /** 排序顺序 不设置的话当前维度不进行排序 */\n sortIndex?: number;\n /** 排序时是否反转 默认为 false */\n sortReverse?: boolean;\n}\n\nexport interface IDataValues {\n /**\n * 数据唯一标识\n */\n id?: StringOrNumber;\n /**\n * 数据\n */\n values: Datum[] | string;\n /**\n * 引用的数据索引\n */\n fromDataIndex?: number;\n /**\n * 引用的数据 id\n */\n fromDataId?: StringOrNumber;\n /**\n * 数据 transform 配置\n */\n transforms?: BuildInTransformOptions[];\n /**\n * 数据字段相关配置\n */\n fields?: Record<\n /** 字段key */\n string,\n IFieldsMeta\n >;\n\n parser?: {\n type: 'csv' | 'dsv' | 'tsv';\n options?: IDsvParserOptions;\n };\n}\n\nexport type IHierarchyNodeData = {\n value?: number;\n children?: IHierarchyNodeData[];\n} & Datum;\n\nexport interface IHierarchyDataValues extends Omit<IDataValues, 'values'> {\n values: IHierarchyNodeData;\n}\n\nexport type IHierarchyData = DataView | IHierarchyDataValues;\n\n/** series */\nexport interface ISeriesSpec extends ITriggerSpec {\n /** 系列类型 */\n type: SeriesType;\n\n /** 系列名称 */\n name?: string;\n\n /** 用户自定义的 series id */\n id?: StringOrNumber;\n /**\n * 系列数据\n * @description 系列可以配置自身的数据,也可以从chart.data中获取数据\n */\n data?: IDataType;\n /**\n * 系列关联的数据索引\n * @default 0\n */\n dataIndex?: number;\n /**\n * 系列关联的数据id\n */\n dataId?: StringOrNumber;\n /**\n * dataKey用于绑定数据与Mark的关系, 该配置在动画中非常重要.\n */\n dataKey?: DataKeyType;\n\n /**\n * 系列关联的region索引\n * @default 0\n */\n regionIndex?: number;\n /** 系列关联的region id */\n regionId?: StringOrNumber;\n /**\n * 分组字段\n */\n seriesField?: string;\n /**\n * 系列样式\n * @description 仅在图表配置了seriesField时生效\n */\n seriesStyle?: ISeriesStyle;\n\n /** 是否对数据进行堆叠处理 */\n stack?: boolean;\n\n /** 是否对数据进行百分比处理 */\n percent?: boolean;\n\n /** 是否围绕中心轴偏移轮廓 */\n stackOffsetSilhouette?: boolean;\n\n /**\n * 非合规数据点连接方式\n * @description null,undefined等非法数据点连接方式。\n * @default 'zero'\n * 'break'指在该数据点处断开\n * 'link' 指忽略该点保持连续\n * 'zero' 指该点默认数值为0\n * 'ignore' 指不处理\n */\n invalidType?: IInvalidType;\n\n /** 提示信息 */\n tooltip?: ITooltipSpec;\n\n /**\n * 是否开启系列动画\n */\n animation?: boolean;\n\n /**\n * 是否支持3d视角\n */\n support3d?: boolean;\n /**\n * morph 动画配置\n */\n morph?: IMorphSeriesSpec;\n\n /**\n * 扩展mark\n */\n extensionMark?: (IExtensionMarkSpec<Exclude<EnableMarkType, MarkTypeEnum.group>> | IExtensionGroupMarkSpec)[];\n}\n\nexport type IChartExtendsSeriesSpec<T extends ISeriesSpec> = Omit<T, 'data' | 'morph'>;\n\n/** markSpec */\nexport type IMarkSpec<T extends ICommonSpec = ICommonSpec> = {\n /**\n * 用户id\n */\n id?: StringOrNumber;\n /**\n * 是否响应交互\n */\n interactive?: boolean;\n // /**\n // * 是否会被region区域裁减\n // * @todo 暂未支持\n // */\n // clip?: boolean;\n /**\n * 与其他mark元素的层级\n */\n zIndex?: number;\n /**\n * mark 层 是否显示配置\n */\n visible?: boolean;\n /** 默认样式设置 */\n style?: ConvertToMarkStyleSpec<T>;\n /** 不同状态下的样式配置 */\n state?: Record<StateValue, IMarkStateSpec<T> | IMarkStateStyleSpec<T>>;\n\n /* 是否是3d视角的mark */\n support3d?: boolean;\n} & IMarkProgressiveConfig;\n\nexport type IMarkStateFilter =\n | {\n /** 维度筛选 */\n fields: { [key in string]: { type: 'ordinal' | 'linear'; domain: StringOrNumber[] } };\n }\n | {\n /** 筛选数据 */\n datums: Datum[];\n /** 筛选数据 */\n datumKeys: string[];\n }\n | {\n /** 筛选 item */\n items: IElement[];\n }\n /** 筛选函数 */\n | ((datum: Datum, options: Record<string, any>) => boolean);\n\nexport interface IMarkStateSpec<T> {\n /** 筛选器 */\n filter?: IMarkStateFilter;\n /** 状态优先级 */\n level?: number | undefined;\n style: ConvertToMarkStyleSpec<T>;\n}\n\nexport type IMarkStateStyleSpec<T> = ConvertToMarkStyleSpec<T>;\n\nexport type IMarkTheme<T> = {\n /**\n * mark 层 是否显示配置\n */\n visible?: boolean;\n /** 默认样式设置 */\n style?: T;\n /** 不同状态下的样式配置 */\n state?: Record<StateValue, T>;\n /**\n * 可交互的开关\n */\n interactive?: boolean;\n};\n\nexport interface IPerformanceHook {\n // InitRender\n // ├── InitializeChart\n // ├── CompileToVGrammar\n // ├── ParseView\n // | └── ParseExpression\n // ├── (new View)\n // | ├── CreateRuntime\n // | └── (view.initialize)\n // | └── CreateVRenderStage\n // └── SrViewEvaluateAsync / SrViewRunAsync\n // ├── MarkTransform\n // ├── FacetTransform\n // ├── CreateVRenderMark\n // └── VRenderDraw\n\n // 初始化图表配置\n beforeInitializeChart?: () => void;\n afterInitializeChart?: () => void;\n\n // 编译\n beforeCompileToVGrammar?: () => void;\n afterCompileToVGrammar?: () => void;\n // 各个图表模块编译\n beforeRegionCompile?: () => void;\n afterRegionCompile?: () => void;\n beforeSeriesCompile?: () => void;\n afterSeriesCompile?: () => void;\n beforeComponentCompile?: () => void;\n afterComponentCompile?: () => void;\n\n // resize的时候的钩子\n beforeResizeWithUpdate?: () => void;\n afterResizeWithUpdate?: () => void;\n\n // LayoutWithSceneGraph 二次布局\n beforeLayoutWithSceneGraph?: () => void;\n afterLayoutWithSceneGraph?: () => void;\n\n // VGrammar 解析spec\n beforeParseView?: () => void;\n afterParseView?: () => void;\n\n // 初始化runtime\n beforeCreateRuntime?: () => void;\n afterCreateRuntime?: () => void;\n\n // VGrammar EvaluateAsync 时间\n beforeSrViewEvaluateAsync?: () => void;\n afterSrViewEvaluateAsync?: () => void;\n\n // VGrammar RunAsync 时间\n beforeSrViewRunAsync?: () => void;\n afterSrViewRunAsync?: () => void;\n\n // transform测量\n beforeTransform?: (name: string) => void;\n afterTransform?: (name: string) => void;\n\n // Create VRender Stage 时间\n beforeCreateVRenderStage?: () => void;\n afterCreateVRenderStage?: () => void;\n\n // Create VRender Mark 时间\n beforeCreateVRenderMark?: () => void;\n afterCreateVRenderMark?: () => void;\n\n // VRender Draw 时间\n beforeVRenderDraw?: () => void;\n afterVRenderDraw?: () => void;\n}\n\nexport type IBuildinMarkSpec = {\n [MarkTypeEnum.group]: IGroupMarkSpec;\n\n [MarkTypeEnum.symbol]: ISymbolMarkSpec;\n [MarkTypeEnum.rule]: IRuleMarkSpec;\n [MarkTypeEnum.line]: ILineMarkSpec;\n [MarkTypeEnum.text]: ITextMarkSpec;\n [MarkTypeEnum.rect]: IRectMarkSpec;\n [MarkTypeEnum.rect3d]: IRect3dMarkSpec;\n [MarkTypeEnum.image]: IImageMarkSpec;\n [MarkTypeEnum.path]: IPathMarkSpec;\n [MarkTypeEnum.area]: IAreaMarkSpec;\n [MarkTypeEnum.arc]: IArcMarkSpec;\n [MarkTypeEnum.arc3d]: IArc3dMarkSpec;\n [MarkTypeEnum.polygon]: IPolygonMarkSpec;\n [MarkTypeEnum.pyramid3d]: IPyramid3dMarkSpec;\n [MarkTypeEnum.boxPlot]: IBoxPlotMarkSpec;\n [MarkTypeEnum.linkPath]: ILinkPathMarkSpec;\n [MarkTypeEnum.progressArc]: IProgressArcMarkSpec;\n};\nexport type EnableMarkType = keyof IBuildinMarkSpec;\nexport interface ICustomMarkSpec<T extends EnableMarkType> extends IMarkSpec<IBuildinMarkSpec[T]> {\n type: T;\n /**\n * 关联的数据索引\n * @default 与系列使用同一份数据\n */\n dataIndex?: number;\n /**\n * 关联的数据id\n */\n dataId?: StringOrNumber;\n}\nexport interface ICustomMarkGroupSpec extends ICustomMarkSpec<MarkTypeEnum.group> {\n children?: ICustomMarkSpec<EnableMarkType>[];\n}\n\nexport interface IExtensionMarkSpec<T extends Exclude<EnableMarkType, MarkTypeEnum.group>> extends ICustomMarkSpec<T> {\n /**\n * 关联的数据索引\n * @default 与系列使用同一份数据\n */\n dataIndex?: number;\n /**\n * 关联的数据id\n */\n dataId?: StringOrNumber;\n}\n\nexport interface IExtensionGroupMarkSpec extends ICustomMarkSpec<MarkTypeEnum.group> {\n /**\n * 支持子节点\n */\n children?: ICustomMarkSpec<EnableMarkType>[];\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/typings/spec/common.ts"],"names":[],"mappings":";;;AAwGA,IAAY,cAQX;AARD,WAAY,cAAc;IACxB,qDAAqC,CAAA;IACrC,mDAAmC,CAAA;IACnC,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;IACrB,qDAAqC,CAAA;IACrC,+BAAe,CAAA;AACjB,CAAC,EARW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAQzB","file":"common.js","sourcesContent":["import type { IFillMarkSpec, IImageMarkSpec } from './../visual';\nimport type { ILayoutPaddingSpec } from '../../model/interface';\nimport type { LayoutCallBack } from '../../layout/interface';\nimport type { IElement, srIOption3DType } from '@visactor/vgrammar';\nimport type {\n DataSet,\n DataView,\n ISimplifyOptions,\n IFieldsOptions,\n IFilterOptions,\n IFoldOptions,\n IDsvParserOptions\n} from '@visactor/vdataset';\nimport type { IRegionSpec } from '../../region/interface';\nimport type { IDiscreteLegendSpec } from '../../component/legend/discrete/interface';\nimport type { IHoverSpec, ISelectSpec, ITriggerSpec } from '../../interaction/interface';\nimport type { IRenderOption } from '../../compile/interface';\nimport type { ITooltipSpec } from '../../component/tooltip/interface';\n// eslint-disable-next-line no-duplicate-imports\nimport type { ILayoutSpec } from '../../layout/interface';\nimport type {\n ConvertToMarkStyleSpec,\n IArc3dMarkSpec,\n IArcMarkSpec,\n IAreaMarkSpec,\n IBoxPlotMarkSpec,\n ICommonSpec,\n IGroupMarkSpec,\n ILineMarkSpec,\n ILinkPathMarkSpec,\n IPathMarkSpec,\n IPolygonMarkSpec,\n IProgressArcMarkSpec,\n IPyramid3dMarkSpec,\n IRect3dMarkSpec,\n IRectMarkSpec,\n IRuleMarkSpec,\n ISymbolMarkSpec,\n ITextMarkSpec,\n IVisualSpecScale\n} from '../visual';\nimport type { StateValue } from '../../compile/mark';\nimport type { ISeriesStyle, SeriesType } from '../../series/interface';\nimport type { ILayoutOrientPadding } from '../../model/interface';\nimport type { Datum, StringOrNumber } from '../common';\nimport type { IInvalidType } from '../data';\nimport type { IMorphSeriesSpec } from '../../animation/spec';\nimport type { IPlayer } from '../../component/player';\nimport type { IMarkProgressiveConfig, MarkTypeEnum } from '../../mark/interface';\nimport type { IDataZoomSpec, IScrollBarSpec } from '../../component/data-zoom';\nimport type { ICrosshairSpec } from '../../component/crosshair/interface';\nimport type { ITheme } from '../../theme';\nimport type { ITitleSpec } from '../../component/title/interface';\nimport type { IBrushSpec } from '../../component/brush';\n\nexport type IChartPadding = ILayoutOrientPadding | number;\n\n/** chart option */\nexport interface IInitOption extends Omit<IRenderOption, 'pluginList'> {\n /**\n * **仅生效于浏览器环境。**\n * 图表挂载的父容器,可以直接指定容器 id,也可以传入 dom 对象\n */\n dom?: string | HTMLElement;\n /**\n * 除去选择 dom 属性进行挂载父容器,也可以使用 renderCanvas 属性直接传入 canvas 实例/ canvasId\n * 小程序/小组件环境请直接传入 id\n */\n renderCanvas?: string | HTMLCanvasElement;\n /** 数据集 */\n dataSet?: DataSet;\n /** 是否自适应容器大小 */\n autoFit?: boolean;\n /**\n * 性能测试钩子\n */\n performanceHook?: IPerformanceHook;\n /**\n * 是否开启动画\n */\n animation?: boolean;\n /**\n * 3d配置\n */\n options3d?: srIOption3DType;\n\n /**\n * 自定义布局函数\n */\n layout?: LayoutCallBack;\n\n /**\n * 当文本省略时,鼠标 hover 到文本上时是否显示 poptip\n * @default true\n */\n poptip?: boolean;\n\n /**\n * @since 1.2.0\n * 报错的回调函数\n */\n onError?: (...args: any[]) => void;\n}\n\nexport enum RenderModeEnum {\n 'desktop-browser' = 'desktop-browser',\n 'mobile-browser' = 'mobile-browser',\n 'node' = 'node',\n 'worker' = 'worker',\n 'miniApp' = 'miniApp',\n 'desktop-miniApp' = 'desktop-miniApp',\n 'lynx' = 'lynx'\n}\nexport type RenderMode = keyof typeof RenderModeEnum;\n\n/** chart spec */\nexport interface IChartSpec {\n /** 图表类型 */\n type: string;\n /** 数据 */\n data?: IData;\n /** 画布宽度 */\n width?: number;\n /** 画布高度 */\n height?: number;\n /**\n * 图表宽高是否自适应容器,浏览器环境下默认为 true。\n * 该配置的优先级高于构造函数中的 autoFit 配置。\n * 如果用户配置了 width,则以用户配置的 width 为准,height 同理。\n */\n autoFit?: boolean;\n /**\n * 图表整体 padding 设置\n */\n padding?: ILayoutPaddingSpec;\n /**\n * 图表色系配置\n */\n color?: string[] | Omit<IVisualSpecScale<unknown, string>, 'id'>;\n /**\n * 系列\n * @description 仅在组合图中使用, 文档中除组合图外均未透出该配置\n */\n series?: ISeriesSpec[];\n /**\n * 系列样式\n * @description 仅在图表配置了seriesField时生效\n */\n seriesStyle?: ISeriesStyle;\n\n /** hover 交互 */\n hover?: boolean | IHoverSpec;\n /** select 交互 */\n select?: boolean | ISelectSpec;\n\n /** region配置 */\n region?: IRegionSpec[];\n /** 图表标题配置 */\n title?: ITitleSpec;\n /** 布局配置 */\n layout?: ILayoutSpec;\n /** 图例配置 */\n legends?: IDiscreteLegendSpec | IDiscreteLegendSpec[];\n /** 十字辅助线配置 */\n crosshair?: ICrosshairSpec | ICrosshairSpec[];\n /** tooltip配置 */\n tooltip?: ITooltipSpec;\n /** 播放器配置 */\n player?: IPlayer;\n /** 缩略轴配置 */\n dataZoom?: IDataZoomSpec[];\n /** 滚动条配置 */\n scrollBar?: IScrollBarSpec[];\n /** 框选配置 */\n brush?: IBrushSpec;\n /** 全局 scale 配置 */\n scales?: IVisualSpecScale<unknown, unknown>[];\n /** 自定义mark */\n customMark?: ICustomMarkSpec<EnableMarkType>[];\n /**\n * 图表上的主题定义。\n * 可以直接配置主题名,前提是该主题名已经注册\n */\n theme?: Omit<ITheme, 'name'> | string;\n /**\n * 图表背景色配置,优先级高于构造函数中的 background 配置\n */\n background?: IBackgroundSpec;\n\n // TODO:后续开放,现在仍有问题\n // poptip?: PopTipAttributes;\n // TODO: 补充动画配置\n}\n\nexport type IBackgroundStyleSpec = ConvertToMarkStyleSpec<Omit<IFillMarkSpec, 'width' | 'height' | 'background'>> & {\n image?: IRectMarkSpec['background'];\n cornerRadius?: IRectMarkSpec['cornerRadius'];\n};\n\nexport type IBackgroundSpec = string | IBackgroundStyleSpec;\n\n/** data */\nexport type IDataType = IDataValues | DataView;\nexport type IData = IDataType | IDataType[];\nexport type DataKeyType = string | string[] | ((data: Datum, index: number) => string);\nexport type BuildInTransformOptions =\n | {\n /** 地理数据简化 */\n type: 'simplify';\n options: ISimplifyOptions;\n }\n | {\n /** 数据维度处理,包括排序,逆序,数据筛选能力 */\n type: 'fields';\n options: IFieldsOptions;\n }\n | {\n /** 使用回调的自定义筛选 */\n type: 'filter';\n options: IFilterOptions;\n }\n | {\n /** 数据展开 */\n type: 'fold';\n options: IFoldOptions;\n };\n\nexport interface IFieldsMeta {\n /** TODO: 字段通用format, 暂时先不支持 */\n // format?: (datum: Datum, index: number) => unknown;\n /** 字段别名 */\n alias?: string;\n /** 字段取值范围 */\n domain?: StringOrNumber[];\n /** 是否使用 domain 锁定统计信息。默认为 false */\n lockStatisticsByDomain?: boolean;\n /** 连续型 还是 离散型 */\n type?: 'ordinal' | 'linear';\n /** 排序顺序 不设置的话当前维度不进行排序 */\n sortIndex?: number;\n /** 排序时是否反转 默认为 false */\n sortReverse?: boolean;\n}\n\nexport interface IDataValues {\n /**\n * 数据唯一标识\n */\n id?: StringOrNumber;\n /**\n * 数据\n */\n values: Datum[] | string;\n /**\n * 引用的数据索引\n */\n fromDataIndex?: number;\n /**\n * 引用的数据 id\n */\n fromDataId?: StringOrNumber;\n /**\n * 数据 transform 配置\n */\n transforms?: BuildInTransformOptions[];\n /**\n * 数据字段相关配置\n */\n fields?: Record<\n /** 字段key */\n string,\n IFieldsMeta\n >;\n\n parser?: {\n type: 'csv' | 'dsv' | 'tsv';\n options?: IDsvParserOptions;\n };\n}\n\nexport type IHierarchyNodeData = {\n value?: number;\n children?: IHierarchyNodeData[];\n} & Datum;\n\nexport interface IHierarchyDataValues extends Omit<IDataValues, 'values'> {\n values: IHierarchyNodeData;\n}\n\nexport type IHierarchyData = DataView | IHierarchyDataValues;\n\n/** series */\nexport interface ISeriesSpec extends ITriggerSpec {\n /** 系列类型 */\n type: SeriesType;\n\n /** 系列名称 */\n name?: string;\n\n /** 用户自定义的 series id */\n id?: StringOrNumber;\n /**\n * 系列数据\n * @description 系列可以配置自身的数据,也可以从chart.data中获取数据\n */\n data?: IDataType;\n /**\n * 系列关联的数据索引\n * @default 0\n */\n dataIndex?: number;\n /**\n * 系列关联的数据id\n */\n dataId?: StringOrNumber;\n /**\n * dataKey用于绑定数据与Mark的关系, 该配置在动画中非常重要.\n */\n dataKey?: DataKeyType;\n\n /**\n * 系列关联的region索引\n * @default 0\n */\n regionIndex?: number;\n /** 系列关联的region id */\n regionId?: StringOrNumber;\n /**\n * 分组字段\n */\n seriesField?: string;\n /**\n * 系列样式\n * @description 仅在图表配置了seriesField时生效\n */\n seriesStyle?: ISeriesStyle;\n\n /** 是否对数据进行堆叠处理 */\n stack?: boolean;\n\n /** 是否对数据进行百分比处理 */\n percent?: boolean;\n\n /** 是否围绕中心轴偏移轮廓 */\n stackOffsetSilhouette?: boolean;\n\n /**\n * 非合规数据点连接方式\n * @description null,undefined等非法数据点连接方式。\n * @default 'zero'\n * 'break'指在该数据点处断开\n * 'link' 指忽略该点保持连续\n * 'zero' 指该点默认数值为0\n * 'ignore' 指不处理\n */\n invalidType?: IInvalidType;\n\n /** 提示信息 */\n tooltip?: ITooltipSpec;\n\n /**\n * 是否开启系列动画\n */\n animation?: boolean;\n\n /**\n * 是否支持3d视角\n */\n support3d?: boolean;\n /**\n * morph 动画配置\n */\n morph?: IMorphSeriesSpec;\n\n /**\n * 扩展mark\n */\n extensionMark?: (IExtensionMarkSpec<Exclude<EnableMarkType, MarkTypeEnum.group>> | IExtensionGroupMarkSpec)[];\n\n /**\n * series background\n * 作用是支持系列的图形对系列背景进行 mask,或者切分等效果。不是作为背景图\n * 暂时不开放api,避免出现break change\n */\n // background?: IBackgroundSpec;\n}\n\nexport type IChartExtendsSeriesSpec<T extends ISeriesSpec> = Omit<T, 'data' | 'morph'>;\n\n/** markSpec */\nexport type IMarkSpec<T extends ICommonSpec = ICommonSpec> = {\n /**\n * 用户id\n */\n id?: StringOrNumber;\n /**\n * 是否响应交互\n */\n interactive?: boolean;\n // /**\n // * 是否会被region区域裁减\n // * @todo 暂未支持\n // */\n // clip?: boolean;\n /**\n * 与其他mark元素的层级\n */\n zIndex?: number;\n /**\n * mark 层 是否显示配置\n */\n visible?: boolean;\n /** 默认样式设置 */\n style?: ConvertToMarkStyleSpec<T>;\n /** 不同状态下的样式配置 */\n state?: Record<StateValue, IMarkStateSpec<T> | IMarkStateStyleSpec<T>>;\n\n /* 是否是3d视角的mark */\n support3d?: boolean;\n} & IMarkProgressiveConfig;\n\nexport type IMarkStateFilter =\n | {\n /** 维度筛选 */\n fields: { [key in string]: { type: 'ordinal' | 'linear'; domain: StringOrNumber[] } };\n }\n | {\n /** 筛选数据 */\n datums: Datum[];\n /** 筛选数据 */\n datumKeys: string[];\n }\n | {\n /** 筛选 item */\n items: IElement[];\n }\n /** 筛选函数 */\n | ((datum: Datum, options: Record<string, any>) => boolean);\n\nexport interface IMarkStateSpec<T> {\n /** 筛选器 */\n filter?: IMarkStateFilter;\n /** 状态优先级 */\n level?: number | undefined;\n style: ConvertToMarkStyleSpec<T>;\n}\n\nexport type IMarkStateStyleSpec<T> = ConvertToMarkStyleSpec<T>;\n\nexport type IMarkTheme<T> = {\n /**\n * mark 层 是否显示配置\n */\n visible?: boolean;\n /** 默认样式设置 */\n style?: T;\n /** 不同状态下的样式配置 */\n state?: Record<StateValue, T>;\n /**\n * 可交互的开关\n */\n interactive?: boolean;\n};\n\nexport interface IPerformanceHook {\n // InitRender\n // ├── InitializeChart\n // ├── CompileToVGrammar\n // ├── ParseView\n // | └── ParseExpression\n // ├── (new View)\n // | ├── CreateRuntime\n // | └── (view.initialize)\n // | └── CreateVRenderStage\n // └── SrViewEvaluateAsync / SrViewRunAsync\n // ├── MarkTransform\n // ├── FacetTransform\n // ├── CreateVRenderMark\n // └── VRenderDraw\n\n // 初始化图表配置\n beforeInitializeChart?: () => void;\n afterInitializeChart?: () => void;\n\n // 编译\n beforeCompileToVGrammar?: () => void;\n afterCompileToVGrammar?: () => void;\n // 各个图表模块编译\n beforeRegionCompile?: () => void;\n afterRegionCompile?: () => void;\n beforeSeriesCompile?: () => void;\n afterSeriesCompile?: () => void;\n beforeComponentCompile?: () => void;\n afterComponentCompile?: () => void;\n\n // resize的时候的钩子\n beforeResizeWithUpdate?: () => void;\n afterResizeWithUpdate?: () => void;\n\n // LayoutWithSceneGraph 二次布局\n beforeLayoutWithSceneGraph?: () => void;\n afterLayoutWithSceneGraph?: () => void;\n\n // VGrammar 解析spec\n beforeParseView?: () => void;\n afterParseView?: () => void;\n\n // 初始化runtime\n beforeCreateRuntime?: () => void;\n afterCreateRuntime?: () => void;\n\n // VGrammar EvaluateAsync 时间\n beforeSrViewEvaluateAsync?: () => void;\n afterSrViewEvaluateAsync?: () => void;\n\n // VGrammar RunAsync 时间\n beforeSrViewRunAsync?: () => void;\n afterSrViewRunAsync?: () => void;\n\n // transform测量\n beforeTransform?: (name: string) => void;\n afterTransform?: (name: string) => void;\n\n // Create VRender Stage 时间\n beforeCreateVRenderStage?: () => void;\n afterCreateVRenderStage?: () => void;\n\n // Create VRender Mark 时间\n beforeCreateVRenderMark?: () => void;\n afterCreateVRenderMark?: () => void;\n\n // VRender Draw 时间\n beforeVRenderDraw?: () => void;\n afterVRenderDraw?: () => void;\n}\n\nexport type IBuildinMarkSpec = {\n [MarkTypeEnum.group]: IGroupMarkSpec;\n\n [MarkTypeEnum.symbol]: ISymbolMarkSpec;\n [MarkTypeEnum.rule]: IRuleMarkSpec;\n [MarkTypeEnum.line]: ILineMarkSpec;\n [MarkTypeEnum.text]: ITextMarkSpec;\n [MarkTypeEnum.rect]: IRectMarkSpec;\n [MarkTypeEnum.rect3d]: IRect3dMarkSpec;\n [MarkTypeEnum.image]: IImageMarkSpec;\n [MarkTypeEnum.path]: IPathMarkSpec;\n [MarkTypeEnum.area]: IAreaMarkSpec;\n [MarkTypeEnum.arc]: IArcMarkSpec;\n [MarkTypeEnum.arc3d]: IArc3dMarkSpec;\n [MarkTypeEnum.polygon]: IPolygonMarkSpec;\n [MarkTypeEnum.pyramid3d]: IPyramid3dMarkSpec;\n [MarkTypeEnum.boxPlot]: IBoxPlotMarkSpec;\n [MarkTypeEnum.linkPath]: ILinkPathMarkSpec;\n [MarkTypeEnum.progressArc]: IProgressArcMarkSpec;\n};\nexport type EnableMarkType = keyof IBuildinMarkSpec;\nexport interface ICustomMarkSpec<T extends EnableMarkType> extends IMarkSpec<IBuildinMarkSpec[T]> {\n type: T;\n /**\n * 关联的数据索引\n * @default 与系列使用同一份数据\n */\n dataIndex?: number;\n /**\n * 关联的数据id\n */\n dataId?: StringOrNumber;\n}\nexport interface ICustomMarkGroupSpec extends ICustomMarkSpec<MarkTypeEnum.group> {\n children?: ICustomMarkSpec<EnableMarkType>[];\n}\n\nexport interface IExtensionMarkSpec<T extends Exclude<EnableMarkType, MarkTypeEnum.group>> extends ICustomMarkSpec<T> {\n /**\n * 关联的数据索引\n * @default 与系列使用同一份数据\n */\n dataIndex?: number;\n /**\n * 关联的数据id\n */\n dataId?: StringOrNumber;\n}\n\nexport interface IExtensionGroupMarkSpec extends ICustomMarkSpec<MarkTypeEnum.group> {\n /**\n * 支持子节点\n */\n children?: ICustomMarkSpec<EnableMarkType>[];\n}\n"]}
|
package/cjs/typings/visual.d.ts
CHANGED
|
@@ -215,7 +215,7 @@ export interface IProgressArcMarkSpec extends IArcMarkSpec {
|
|
|
215
215
|
export interface ICellMarkSpec extends ISymbolMarkSpec {
|
|
216
216
|
padding?: number | number[] | IPadding;
|
|
217
217
|
}
|
|
218
|
-
export interface IGroupMarkSpec extends
|
|
218
|
+
export interface IGroupMarkSpec extends IFillMarkSpec {
|
|
219
219
|
clip?: boolean;
|
|
220
220
|
width?: number;
|
|
221
221
|
height?: number;
|
|
@@ -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 { IAttributeOpt, IModelMarkAttributeContext } from '../compile/mark';\nimport type { Datum, StringOrNumber } from './common';\nimport type { IPadding } from '@visactor/vutils';\nimport type { IColorKey } from '../theme/color-scheme/interface';\nimport type { IRepeatType } from '@visactor/vrender';\n\n// 基础的visual 对应 scale 的属性\nexport interface IVisualSpecBase<D, T> {\n // type of scale\n type: ScaleType;\n // will set to scale.domain, it means input of scale\n domain: D[];\n // will set to scale.range, it means output of scale\n range: T[];\n // will set to scale.specified if scale support, as a key-value pair matching capability\n specified?: { [key: string]: unknown };\n}\n// 用来给用户进行mark.style上的映射配置。所以要配置数据维度\nexport interface IVisualSpecStyle<D, T> extends IVisualSpecBase<D, T> {\n field?: string;\n}\n\nexport type IDataDomainSpec = {\n dataId: string;\n fields: string[];\n};\n\n// 用来提供给用户进行 scale 配置 所以名字是必选的 对用户配置\nexport interface IVisualSpecScale<D, T> extends Omit<IVisualSpecBase<D, T>, 'domain'> {\n id: string;\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> = (\n datum: Datum,\n context: IModelMarkAttributeContext,\n opt?: IAttributeOpt,\n source?: DataView\n) => 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\nexport interface ICommonSpec {\n visible?: boolean;\n x?: number;\n y?: number;\n z?: number;\n stroke?: string | IGradient | IColorKey;\n strokeOpacity?: number;\n opacity?: number;\n lineWidth?: number;\n lineDash?: number[];\n lineDashOffset?: number;\n\n cursor?: Cursor;\n zIndex?: number;\n borderSize?: number;\n borderColor?: string;\n borderSpacing?: number;\n borderOpacity?: number;\n angle?: number;\n anchor?: [number, number];\n\n // 3d旋转的属性\n beta?: number;\n alpha?: number;\n anchor3d?: [number, number];\n\n /**\n * 选择模式,精确模式,粗糙模式(包围盒模式),自定义模式\n */\n pickMode?: 'accurate' | 'imprecise' | 'custom';\n boundsMode?: 'accurate' | 'imprecise';\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?: {\n /**\n * 间距\n */\n distance: number | string;\n stroke?: string | IGradient;\n strokeOpacity?: number;\n lineWidth?: number;\n lineDash?: number[];\n lineDashOffset?: number;\n };\n /**\n * 内边框\n */\n innerBorder?: {\n /**\n * 间距\n */\n distance: number | string;\n stroke?: string | IGradient;\n strokeOpacity?: number;\n lineWidth?: number;\n lineDash?: number[];\n lineDashOffset?: number;\n };\n\n [key: string]: any;\n}\n\nexport interface IFillMarkSpec extends ICommonSpec {\n fill?: VisualType<string> | IGradient | false | IColorKey;\n fillOpacity?: number;\n // TODO:waite VRender support this api\n // backgroundMode: number; // 填充模式(与具体图元有关)\n // can coexist with fill\n background?: string | HTMLImageElement | HTMLCanvasElement | null;\n}\n\n// export interface IFillImageMarkSpec {\n// fillImage?: string;\n// repeatX?: RepeatXYType;\n// repeatY?: RepeatXYType;\n// imageOrigin?: ImageOriginType;\n// }\n\nexport interface ISymbolMarkSpec extends IFillMarkSpec {\n dx?: number;\n dy?: number;\n size?: number | number[];\n /** 对外声明使用shape,vrender图形属性对应的是shape */\n shape?: ShapeType | string;\n /** FIXME: vrender Symbol接收的图形属性,暂时都申明一下 */\n symbolType?: ShapeType | string;\n scaleX?: number;\n scaleY?: number;\n}\n\n// lineMark 和 areaMark 共同配置\nexport interface ILineLikeMarkSpec extends IFillMarkSpec {\n curveType?: InterpolateType;\n defined?: boolean;\n /**\n * @private 一个标志位,用于通知 VGrammar 是否执行 getLineSegmentConfigs 方法\n */\n enableSegments?: boolean;\n}\n\nexport interface IAreaMarkSpec extends ILineLikeMarkSpec {\n x1?: number;\n y1?: number;\n\n orient?: 'horizontal' | 'vertical';\n}\n\nexport interface ILineMarkSpec extends ILineLikeMarkSpec {\n lineCap?: LineStrokeCap;\n lineJoin?: LineStrokeJoin;\n miterLimit?: number;\n strokeBoundsBuffer?: number;\n}\n\nexport interface IRuleMarkSpec extends ILineMarkSpec {\n x1?: number;\n y1?: number;\n}\n\nexport interface ITextMarkSpec extends IFillMarkSpec {\n /**\n * 文字内容\n */\n text?: StringOrNumber | string[];\n /**\n * x 方向偏移\n */\n dx?: number;\n /**\n * y 方向偏移\n */\n dy?: number;\n /**\n * 字号\n */\n fontSize?: number;\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 // TODO: 这些不是常规的文字mark属性,待确认需求背景\n lineBreak?: string;\n /**\n * 下划线\n */\n underline?: boolean;\n /**\n * 中划线\n */\n lineThrough?: boolean;\n /**\n * 行高\n */\n lineHeight?: number;\n /**\n * poptip 相关配置\n */\n poptip?: PopTipAttributes;\n}\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 width?: number;\n height?: number;\n x1?: number;\n y1?: number;\n}\n\n// 3d rect,支持length表示长宽高中的长属性(深度属性)\nexport interface IRect3dMarkSpec extends IRectMarkSpec {\n length?: 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 min?: (datum: Datum) => number;\n q1?: (datum: Datum) => number;\n median?: (datum: Datum) => number;\n q3?: (datum: Datum) => number;\n max?: (datum: Datum) => number;\n}\n\nexport interface IOutlierMarkSpec {\n //异常点填充颜色\n fill?: string;\n //异常点大小\n size?: number;\n}\n\nexport interface IPathMarkSpec extends IFillMarkSpec {\n path?: string;\n scaleX?: number;\n scaleY?: number;\n scaleCenter?: { x: number; y: number };\n // TODO: 该属性后续可能会删除,未定\n // 平滑缩放,不然会发生跳变,在地图交互场景需要配置为true;常规path缩放不需要\n smoothScale?: boolean;\n}\n\nexport interface ILinkPathMarkSpec extends IFillMarkSpec {\n x0?: number;\n y0?: number;\n x1?: number;\n y1?: number;\n thickness?: number;\n curvature?: number;\n /** round all the coordinates */\n round?: boolean;\n /** the ratio of normal style path */\n ratio?: number;\n align?: 'start' | 'end' | 'center';\n pathType?: 'line' | 'smooth' | 'polyline';\n endArrow?: boolean;\n startArrow?: boolean;\n backgroundStyle?: any;\n direction?: 'horizontal' | 'vertical' | 'LR' | 'RL' | 'TB' | 'BL' | 'radial';\n}\n\nexport interface IArcMarkSpec extends IFillMarkSpec {\n startAngle?: number;\n endAngle?: number;\n padAngle?: number;\n\n outerRadius?: number;\n innerRadius?: number;\n cornerRadius?: number;\n\n /** arc的中心点偏移距离 */\n centerOffset?: number;\n\n /** arc 的 roundCap 属性,即圆角是否伸出 startAngle 和 endAngle 之外 */\n cap?: boolean | [boolean, boolean];\n /** arc 在 roundCap 打开且应用环形渐变时是否对 cap 部分生效 */\n autoCapConical?: boolean;\n}\n\n// 3d arc,有高度配置\nexport interface IArc3dMarkSpec extends IArcMarkSpec {\n height?: number;\n}\n\nexport interface IProgressArcMarkSpec extends IArcMarkSpec {\n /** 进度条内侧 padding(接受负值) */\n innerPadding?: number;\n /** 进度条外侧 padding(接受负值) */\n outerPadding?: number;\n}\n\nexport interface ICellMarkSpec extends ISymbolMarkSpec {\n padding?: number | number[] | IPadding;\n}\n\nexport interface IGroupMarkSpec extends ICommonSpec, IFillMarkSpec {\n clip?: boolean;\n width?: number;\n height?: number;\n /**\n * 圆角配置。\n * 1. 如果传入数值,则统一为四个角设置圆角\n * 2. 如果传入数组,则分别为 [上左, 上右, 下右, 下左]\n */\n cornerRadius?: number | number[];\n}\n\nexport interface IPolygonMarkSpec extends ICommonSpec, IFillMarkSpec {\n points?: IPoint[];\n /**\n * 圆角配置,支持数组配置,数组的顺序同组成 polygon 的顺序对应\n */\n cornerRadius?: number | number[];\n scaleX?: number;\n scaleY?: number;\n}\n\nexport interface IPyramid3dMarkSpec extends IPolygonMarkSpec {\n // 只能有4个顶点\n points?: IPoint[];\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 offset: GradientPropValue<number>;\n color: GradientPropValue<string>;\n opacity?: number;\n};\nexport interface IGradientLinear {\n x0?: GradientPropValue<number>;\n y0?: GradientPropValue<number>;\n x1?: GradientPropValue<number>;\n y1?: GradientPropValue<number>;\n stops: GradientStop[];\n gradient: 'linear';\n}\n\nexport interface IGradientRadial {\n r0?: GradientPropValue<number>;\n x0?: GradientPropValue<number>;\n y0?: GradientPropValue<number>;\n x1?: GradientPropValue<number>;\n y1?: GradientPropValue<number>;\n r1?: GradientPropValue<number>;\n stops: GradientStop[];\n gradient: 'radial';\n}\n\nexport interface IGradientConical {\n x?: GradientPropValue<number>;\n y?: GradientPropValue<number>;\n startAngle?: GradientPropValue<number>;\n endAngle?: GradientPropValue<number>;\n stops: GradientStop[];\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 width?: number;\n height?: number;\n repeatX?: IRepeatType;\n repeatY?: IRepeatType;\n image: string | HTMLImageElement | HTMLCanvasElement;\n}\n\n/**\n * text\n */\nexport type TextAlign = 'left' | 'right' | 'center';\nexport type TextBaseLine = 'top' | 'bottom' | 'middle' | 'alphabetic';\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 { IAttributeOpt, IModelMarkAttributeContext } from '../compile/mark';\nimport type { Datum, StringOrNumber } from './common';\nimport type { IPadding } from '@visactor/vutils';\nimport type { IColorKey } from '../theme/color-scheme/interface';\nimport type { IRepeatType } from '@visactor/vrender';\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// 用来给用户进行mark.style上的映射配置。所以要配置数据维度\nexport interface IVisualSpecStyle<D, T> extends IVisualSpecBase<D, T> {\n field?: string;\n}\n\nexport type IDataDomainSpec = {\n dataId: string;\n fields: string[];\n};\n\n// 用来提供给用户进行 scale 配置 所以名字是必选的 对用户配置\nexport interface IVisualSpecScale<D, T> extends Omit<IVisualSpecBase<D, T>, 'domain'> {\n id: string;\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> = (\n datum: Datum,\n context: IModelMarkAttributeContext,\n opt?: IAttributeOpt,\n source?: DataView\n) => 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\nexport interface ICommonSpec {\n visible?: boolean;\n x?: number;\n y?: number;\n z?: number;\n stroke?: string | IGradient | IColorKey;\n strokeOpacity?: number;\n opacity?: number;\n lineWidth?: number;\n lineDash?: number[];\n lineDashOffset?: number;\n\n cursor?: Cursor;\n zIndex?: number;\n borderSize?: number;\n borderColor?: string;\n borderSpacing?: number;\n borderOpacity?: number;\n angle?: number;\n anchor?: [number, number];\n\n // 3d旋转的属性\n beta?: number;\n alpha?: number;\n anchor3d?: [number, number];\n\n /**\n * 选择模式,精确模式,粗糙模式(包围盒模式),自定义模式\n */\n pickMode?: 'accurate' | 'imprecise' | 'custom';\n boundsMode?: 'accurate' | 'imprecise';\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?: {\n /**\n * 间距\n */\n distance: number | string;\n stroke?: string | IGradient;\n strokeOpacity?: number;\n lineWidth?: number;\n lineDash?: number[];\n lineDashOffset?: number;\n };\n /**\n * 内边框\n */\n innerBorder?: {\n /**\n * 间距\n */\n distance: number | string;\n stroke?: string | IGradient;\n strokeOpacity?: number;\n lineWidth?: number;\n lineDash?: number[];\n lineDashOffset?: number;\n };\n\n [key: string]: any;\n}\n\nexport interface IFillMarkSpec extends ICommonSpec {\n fill?: VisualType<string> | IGradient | false | IColorKey;\n fillOpacity?: number;\n // TODO:waite VRender support this api\n // backgroundMode: number; // 填充模式(与具体图元有关)\n // can coexist with fill\n background?: string | HTMLImageElement | HTMLCanvasElement | null;\n}\n\n// export interface IFillImageMarkSpec {\n// fillImage?: string;\n// repeatX?: RepeatXYType;\n// repeatY?: RepeatXYType;\n// imageOrigin?: ImageOriginType;\n// }\n\nexport interface ISymbolMarkSpec extends IFillMarkSpec {\n dx?: number;\n dy?: number;\n size?: number | number[];\n /** 对外声明使用shape,vrender图形属性对应的是shape */\n shape?: ShapeType | string;\n /** FIXME: vrender Symbol接收的图形属性,暂时都申明一下 */\n symbolType?: ShapeType | string;\n scaleX?: number;\n scaleY?: number;\n}\n\n// lineMark 和 areaMark 共同配置\nexport interface ILineLikeMarkSpec extends IFillMarkSpec {\n curveType?: InterpolateType;\n defined?: boolean;\n /**\n * @private 一个标志位,用于通知 VGrammar 是否执行 getLineSegmentConfigs 方法\n */\n enableSegments?: boolean;\n}\n\nexport interface IAreaMarkSpec extends ILineLikeMarkSpec {\n x1?: number;\n y1?: number;\n\n orient?: 'horizontal' | 'vertical';\n}\n\nexport interface ILineMarkSpec extends ILineLikeMarkSpec {\n lineCap?: LineStrokeCap;\n lineJoin?: LineStrokeJoin;\n miterLimit?: number;\n strokeBoundsBuffer?: number;\n}\n\nexport interface IRuleMarkSpec extends ILineMarkSpec {\n x1?: number;\n y1?: number;\n}\n\nexport interface ITextMarkSpec extends IFillMarkSpec {\n /**\n * 文字内容\n */\n text?: StringOrNumber | string[];\n /**\n * x 方向偏移\n */\n dx?: number;\n /**\n * y 方向偏移\n */\n dy?: number;\n /**\n * 字号\n */\n fontSize?: number;\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 // TODO: 这些不是常规的文字mark属性,待确认需求背景\n lineBreak?: string;\n /**\n * 下划线\n */\n underline?: boolean;\n /**\n * 中划线\n */\n lineThrough?: boolean;\n /**\n * 行高\n */\n lineHeight?: number;\n /**\n * poptip 相关配置\n */\n poptip?: PopTipAttributes;\n}\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 width?: number;\n height?: number;\n x1?: number;\n y1?: number;\n}\n\n// 3d rect,支持length表示长宽高中的长属性(深度属性)\nexport interface IRect3dMarkSpec extends IRectMarkSpec {\n length?: 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 min?: (datum: Datum) => number;\n q1?: (datum: Datum) => number;\n median?: (datum: Datum) => number;\n q3?: (datum: Datum) => number;\n max?: (datum: Datum) => number;\n}\n\nexport interface IOutlierMarkSpec {\n //异常点填充颜色\n fill?: string;\n //异常点大小\n size?: number;\n}\n\nexport interface IPathMarkSpec extends IFillMarkSpec {\n path?: string;\n scaleX?: number;\n scaleY?: number;\n scaleCenter?: { x: number; y: number };\n // TODO: 该属性后续可能会删除,未定\n // 平滑缩放,不然会发生跳变,在地图交互场景需要配置为true;常规path缩放不需要\n smoothScale?: boolean;\n}\n\nexport interface ILinkPathMarkSpec extends IFillMarkSpec {\n x0?: number;\n y0?: number;\n x1?: number;\n y1?: number;\n thickness?: number;\n curvature?: number;\n /** round all the coordinates */\n round?: boolean;\n /** the ratio of normal style path */\n ratio?: number;\n align?: 'start' | 'end' | 'center';\n pathType?: 'line' | 'smooth' | 'polyline';\n endArrow?: boolean;\n startArrow?: boolean;\n backgroundStyle?: any;\n direction?: 'horizontal' | 'vertical' | 'LR' | 'RL' | 'TB' | 'BL' | 'radial';\n}\n\nexport interface IArcMarkSpec extends IFillMarkSpec {\n startAngle?: number;\n endAngle?: number;\n padAngle?: number;\n\n outerRadius?: number;\n innerRadius?: number;\n cornerRadius?: number;\n\n /** arc的中心点偏移距离 */\n centerOffset?: number;\n\n /** arc 的 roundCap 属性,即圆角是否伸出 startAngle 和 endAngle 之外 */\n cap?: boolean | [boolean, boolean];\n /** arc 在 roundCap 打开且应用环形渐变时是否对 cap 部分生效 */\n autoCapConical?: boolean;\n}\n\n// 3d arc,有高度配置\nexport interface IArc3dMarkSpec extends IArcMarkSpec {\n height?: number;\n}\n\nexport interface IProgressArcMarkSpec extends IArcMarkSpec {\n /** 进度条内侧 padding(接受负值) */\n innerPadding?: number;\n /** 进度条外侧 padding(接受负值) */\n outerPadding?: number;\n}\n\nexport interface ICellMarkSpec extends ISymbolMarkSpec {\n padding?: number | number[] | IPadding;\n}\n\nexport interface IGroupMarkSpec extends IFillMarkSpec {\n clip?: boolean;\n width?: number;\n height?: number;\n /**\n * 圆角配置。\n * 1. 如果传入数值,则统一为四个角设置圆角\n * 2. 如果传入数组,则分别为 [上左, 上右, 下右, 下左]\n */\n cornerRadius?: number | number[];\n}\n\nexport interface IPolygonMarkSpec extends ICommonSpec, IFillMarkSpec {\n points?: IPoint[];\n /**\n * 圆角配置,支持数组配置,数组的顺序同组成 polygon 的顺序对应\n */\n cornerRadius?: number | number[];\n scaleX?: number;\n scaleY?: number;\n}\n\nexport interface IPyramid3dMarkSpec extends IPolygonMarkSpec {\n // 只能有4个顶点\n points?: IPoint[];\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 offset: GradientPropValue<number>;\n color: GradientPropValue<string>;\n opacity?: number;\n};\nexport interface IGradientLinear {\n x0?: GradientPropValue<number>;\n y0?: GradientPropValue<number>;\n x1?: GradientPropValue<number>;\n y1?: GradientPropValue<number>;\n stops: GradientStop[];\n gradient: 'linear';\n}\n\nexport interface IGradientRadial {\n r0?: GradientPropValue<number>;\n x0?: GradientPropValue<number>;\n y0?: GradientPropValue<number>;\n x1?: GradientPropValue<number>;\n y1?: GradientPropValue<number>;\n r1?: GradientPropValue<number>;\n stops: GradientStop[];\n gradient: 'radial';\n}\n\nexport interface IGradientConical {\n x?: GradientPropValue<number>;\n y?: GradientPropValue<number>;\n startAngle?: GradientPropValue<number>;\n endAngle?: GradientPropValue<number>;\n stops: GradientStop[];\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 width?: number;\n height?: number;\n repeatX?: IRepeatType;\n repeatY?: IRepeatType;\n image: string | HTMLImageElement | HTMLCanvasElement;\n}\n\n/**\n * text\n */\nexport type TextAlign = 'left' | 'right' | 'center';\nexport type TextBaseLine = 'top' | 'bottom' | 'middle' | 'alphabetic';\nexport type FontStyle = 'normal' | 'italic' | 'oblique' | string;\nexport type FontWeight = 'normal' | 'bold' | 'lighter' | 'bolder' | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\n"]}
|
package/cjs/util/debug.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare const log: (msg: string, ...args: any[]) => import("@visactor/vutils").ILogger;
|
|
2
2
|
export declare const warn: (msg: string, detail?: any) => import("@visactor/vutils").ILogger;
|
|
3
|
-
export declare const error: (msg: string, detail?: any, err?: Error) =>
|
|
3
|
+
export declare const error: (msg: string, detail?: any, err?: Error) => void;
|
|
4
4
|
export declare const config: IConfig;
|
|
5
5
|
export interface IConfig {
|
|
6
6
|
silent: boolean;
|
|
7
|
-
errorHandler?: (
|
|
7
|
+
errorHandler?: (msg: string, detail?: any) => void;
|
|
8
8
|
warnHandler?: (msg: string, detail?: any) => void;
|
|
9
9
|
}
|
package/cjs/util/debug.js
CHANGED
|
@@ -14,9 +14,10 @@ detail ? vutils_1.Logger.getInstance().warn(`[VChart warn]: ${msg}`, detail) : v
|
|
|
14
14
|
exports.warn = warn;
|
|
15
15
|
|
|
16
16
|
const error = (msg, detail, err) => {
|
|
17
|
-
if (exports.config.silent)
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
if (!exports.config.silent) {
|
|
18
|
+
if (!(0, vutils_1.isFunction)(exports.config.errorHandler)) throw new Error(msg);
|
|
19
|
+
exports.config.errorHandler.call(null, msg, detail);
|
|
20
|
+
}
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
exports.error = error, exports.config = {
|
package/cjs/util/debug.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/util/debug.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AAE/C,MAAM,GAAG,GAAG,CAAC,GAAW,EAAE,GAAG,IAAW,EAAE,EAAE;IACjD,IAAI,CAAC,cAAM,CAAC,MAAM,EAAE;QAClB,OAAO,eAAM,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;KAChD;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AALW,QAAA,GAAG,OAKd;AAEK,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,MAAY,EAAE,EAAE;IAChD,IAAI,IAAA,mBAAU,EAAC,cAAM,CAAC,WAAW,CAAC,EAAE;QAClC,cAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;KAC5C;IACD,IAAI,MAAM,EAAE;QACV,OAAO,eAAM,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,kBAAkB,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;KACnE;IACD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AAE;QACnC,cAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAC5C,OAAO;KACR;IACD,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC;AATW,QAAA,KAAK,SAShB;AAEW,QAAA,MAAM,GAAG;IACpB,MAAM,EAAE,KAAK;IACb,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,KAAK;CACE,CAAC","file":"debug.js","sourcesContent":["import { Logger, isFunction } from '@visactor/vutils';\n\nexport const log = (msg: string, ...args: any[]) => {\n if (!config.silent) {\n return Logger.getInstance().info(msg, ...args);\n }\n return null;\n};\n\nexport const warn = (msg: string, detail?: any) => {\n if (isFunction(config.warnHandler)) {\n config.warnHandler.call(null, msg, detail);\n }\n if (detail) {\n return Logger.getInstance().warn(`[VChart warn]: ${msg}`, detail);\n }\n return Logger.getInstance().warn(`[VChart warn]: ${msg}`);\n};\n\nexport const error = (msg: string, detail?: any, err?: Error) => {\n if (config.silent) {\n return;\n }\n if (isFunction(config.errorHandler)) {\n config.errorHandler.call(null, msg, detail);\n return;\n }\n throw new Error(msg);\n};\n\nexport const config = {\n silent: false,\n warnHandler: false,\n errorHandler: false\n} as unknown as IConfig;\n\nexport interface IConfig {\n /**\n * 是否开启控制台告警\n */\n silent: boolean;\n /**\n * 错误处理\n */\n errorHandler?: (msg: string, detail?: any) => void;\n /**\n * 警告处理\n */\n warnHandler?: (msg: string, detail?: any) => void;\n}\n"]}
|
package/cjs/util/image.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { utilFunctionCtx } from './../typings/params';
|
|
1
2
|
export declare function URLToImage(name: string, url: string): void;
|
|
2
3
|
export declare function OffscreenCanvasToDataURL(c: OffscreenCanvas): Promise<string>;
|
|
3
|
-
export declare function getCanvasDataURL(c: HTMLCanvasElement | OffscreenCanvas): Promise<string>;
|
|
4
|
+
export declare function getCanvasDataURL(c: HTMLCanvasElement | OffscreenCanvas, ctx?: utilFunctionCtx): Promise<string>;
|
package/cjs/util/image.js
CHANGED
|
@@ -26,6 +26,12 @@ var __awaiter = this && this.__awaiter || function(thisArg, _arguments, P, gener
|
|
|
26
26
|
}));
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
+
Object.defineProperty(exports, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), exports.getCanvasDataURL = exports.OffscreenCanvasToDataURL = exports.URLToImage = void 0;
|
|
32
|
+
|
|
33
|
+
const debug_1 = require("./debug");
|
|
34
|
+
|
|
29
35
|
function URLToImage(name = "vchart", url) {
|
|
30
36
|
const link = document.createElement("a");
|
|
31
37
|
link.setAttribute("href", url), link.setAttribute("target", "_blank"), link.setAttribute("download", `${name}.png`),
|
|
@@ -43,21 +49,19 @@ function OffscreenCanvasToDataURL(c) {
|
|
|
43
49
|
}));
|
|
44
50
|
}
|
|
45
51
|
|
|
46
|
-
function getCanvasDataURL(c) {
|
|
52
|
+
function getCanvasDataURL(c, ctx) {
|
|
53
|
+
var _a;
|
|
47
54
|
return __awaiter(this, void 0, void 0, (function*() {
|
|
48
55
|
if (!c) return "";
|
|
49
56
|
try {
|
|
50
57
|
if (void 0 !== OffscreenCanvas && c instanceof OffscreenCanvas) return OffscreenCanvasToDataURL(c);
|
|
51
|
-
} catch (
|
|
52
|
-
|
|
58
|
+
} catch (_error) {
|
|
59
|
+
(null !== (_a = null == ctx ? void 0 : ctx.onError) && void 0 !== _a ? _a : debug_1.error)(`getCanvasDataURL error : ${_error.toString()}`);
|
|
53
60
|
}
|
|
54
61
|
return c.toDataURL();
|
|
55
62
|
}));
|
|
56
63
|
}
|
|
57
64
|
|
|
58
|
-
Object.defineProperty(exports, "__esModule", {
|
|
59
|
-
value: !0
|
|
60
|
-
}), exports.getCanvasDataURL = exports.OffscreenCanvasToDataURL = exports.URLToImage = void 0,
|
|
61
65
|
exports.URLToImage = URLToImage, exports.OffscreenCanvasToDataURL = OffscreenCanvasToDataURL,
|
|
62
66
|
exports.getCanvasDataURL = getCanvasDataURL;
|
|
63
67
|
//# sourceMappingURL=image.js.map
|
package/cjs/util/image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/util/image.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../src/util/image.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mCAAgC;AAKhC,SAAgB,UAAU,CAAC,OAAe,QAAQ,EAAE,GAAW;IAC7D,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,IAAI,MAAM,CAAC,CAAC;IAC7C,IAAI,CAAC,aAAa,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9C,CAAC;AAND,gCAMC;AAED,SAAgB,wBAAwB,CAAC,CAAkB;IAEzD,OAAO,IAAI,OAAO,CAAC,CAAC,CAAsB,EAAE,EAAE;QAC5C,CAAC,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE;YAChC,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;YAChC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;YACxB,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE;gBACnB,CAAC,CAAC,MAAM,CAAC,MAAgB,CAAC,CAAC;YAC7B,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAXD,4DAWC;AAED,SAAsB,gBAAgB,CAAC,CAAsC,EAAE,GAAqB;;;QAClG,IAAI,CAAC,CAAC,EAAE;YACN,OAAO,EAAE,CAAC;SACX;QACD,IAAI;YACF,IAAI,eAAe,KAAK,SAAS,IAAI,CAAC,YAAY,eAAe,EAAE;gBACjE,OAAO,wBAAwB,CAAC,CAAC,CAAC,CAAC;aACpC;SACF;QAAC,OAAO,MAAM,EAAE;YACf,CAAC,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,mCAAI,aAAK,CAAC,CAAC,4BAA4B,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;SAC1E;QACD,OAA2B,CAAE,CAAC,SAAS,EAAE,CAAC;;CAC3C;AAZD,4CAYC","file":"image.js","sourcesContent":["import type { utilFunctionCtx } from './../typings/params';\nimport { error } from './debug';\n/**\n * @description 图片导出相关接口\n */\n\nexport function URLToImage(name: string = 'vchart', url: string) {\n const link = document.createElement('a');\n link.setAttribute('href', url);\n link.setAttribute('target', '_blank');\n link.setAttribute('download', `${name}.png`);\n link.dispatchEvent(new MouseEvent('click'));\n}\n\nexport function OffscreenCanvasToDataURL(c: OffscreenCanvas) {\n // eslint-disable-next-line promise/param-names\n return new Promise((r: (s: string) => void) => {\n c.convertToBlob().then((b: any) => {\n const reader = new FileReader();\n reader.readAsDataURL(b);\n reader.onload = () => {\n r(reader.result as string);\n };\n });\n });\n}\n\nexport async function getCanvasDataURL(c: HTMLCanvasElement | OffscreenCanvas, ctx?: utilFunctionCtx) {\n if (!c) {\n return '';\n }\n try {\n if (OffscreenCanvas !== undefined && c instanceof OffscreenCanvas) {\n return OffscreenCanvasToDataURL(c);\n }\n } catch (_error) {\n (ctx?.onError ?? error)(`getCanvasDataURL error : ${_error.toString()}`);\n }\n return (<HTMLCanvasElement>c).toDataURL();\n}\n"]}
|
package/cjs/util/math.js
CHANGED
|
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "isGreater", {
|
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
const type_1 = require("./type"), vgrammar_util_1 = require("@visactor/vgrammar-util");
|
|
21
|
+
const type_1 = require("./type"), vgrammar_util_1 = require("@visactor/vgrammar-util"), debug_1 = require("./debug");
|
|
22
22
|
|
|
23
23
|
function normalizeAngle(angle) {
|
|
24
24
|
for (;angle < 0; ) angle += 2 * Math.PI;
|
|
@@ -152,7 +152,8 @@ function insideBounds(bounds, x, y) {
|
|
|
152
152
|
|
|
153
153
|
function min(data, field) {
|
|
154
154
|
const initialData = field ? +data[0][field] : +data[0];
|
|
155
|
-
if (!(0, type_1.isValidNumber)(initialData))
|
|
155
|
+
if (!(0, type_1.isValidNumber)(initialData)) return (0, debug_1.warn)("invalid data"),
|
|
156
|
+
0;
|
|
156
157
|
return data.reduce(((pre, _cur) => {
|
|
157
158
|
const cur = field ? +_cur[field] : +_cur;
|
|
158
159
|
return (0, type_1.isValidNumber)(cur) && cur < pre && (pre = cur), pre;
|
|
@@ -161,7 +162,8 @@ function min(data, field) {
|
|
|
161
162
|
|
|
162
163
|
function max(data, field) {
|
|
163
164
|
const initialData = field ? +data[0][field] : +data[0];
|
|
164
|
-
if (!(0, type_1.isValidNumber)(initialData))
|
|
165
|
+
if (!(0, type_1.isValidNumber)(initialData)) return (0, debug_1.warn)("invalid data"),
|
|
166
|
+
0;
|
|
165
167
|
return data.reduce(((pre, _cur) => {
|
|
166
168
|
const cur = field ? +_cur[field] : +_cur;
|
|
167
169
|
return (0, type_1.isValidNumber)(cur) && cur > pre && (pre = cur), pre;
|