@visactor/vgrammar-core 0.8.0 → 0.8.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/cjs/component/axis.js +9 -9
- package/cjs/component/axis.js.map +1 -1
- package/cjs/component/datazoom.js +9 -9
- package/cjs/component/datazoom.js.map +1 -1
- package/cjs/component/grid.js +18 -18
- package/cjs/component/grid.js.map +1 -1
- package/cjs/component/label.js +27 -22
- package/cjs/component/label.js.map +1 -1
- package/cjs/component/legend.js +13 -13
- package/cjs/component/legend.js.map +1 -1
- package/cjs/component/scrollbar.js +7 -7
- package/cjs/component/scrollbar.js.map +1 -1
- package/cjs/component/slider.js +5 -5
- package/cjs/component/slider.js.map +1 -1
- package/cjs/component/title.js +5 -5
- package/cjs/component/title.js.map +1 -1
- package/cjs/core/factory.d.ts +5 -1
- package/cjs/core/factory.js +13 -3
- package/cjs/core/factory.js.map +1 -1
- package/cjs/graph/animation/animate.d.ts +1 -0
- package/cjs/graph/animation/animate.js +4 -0
- package/cjs/graph/animation/animate.js.map +1 -1
- package/cjs/graph/animation/animation/move.js +10 -8
- package/cjs/graph/animation/animation/move.js.map +1 -1
- package/cjs/graph/attributes/common.js +2 -10
- package/cjs/graph/attributes/common.js.map +1 -1
- package/cjs/graph/attributes/helpers.d.ts +2 -2
- package/cjs/graph/attributes/helpers.js +50 -17
- package/cjs/graph/attributes/helpers.js.map +1 -1
- package/cjs/graph/attributes/index.d.ts +4 -10
- package/cjs/graph/attributes/index.js +16 -251
- package/cjs/graph/attributes/index.js.map +1 -1
- package/cjs/graph/attributes/line.d.ts +3 -0
- package/cjs/graph/attributes/line.js +46 -0
- package/cjs/graph/attributes/line.js.map +1 -0
- package/cjs/graph/attributes/transform.d.ts +5 -0
- package/cjs/graph/attributes/transform.js +167 -0
- package/cjs/graph/attributes/transform.js.map +1 -0
- package/cjs/graph/canvas-renderer.js +1 -1
- package/cjs/graph/canvas-renderer.js.map +1 -1
- package/cjs/graph/constants.d.ts +0 -1
- package/cjs/graph/constants.js +2 -3
- package/cjs/graph/constants.js.map +1 -1
- package/cjs/graph/element.js +12 -14
- package/cjs/graph/element.js.map +1 -1
- package/cjs/graph/glyph-element.js +6 -7
- package/cjs/graph/glyph-element.js.map +1 -1
- package/cjs/graph/layout/relative.js.map +1 -1
- package/cjs/graph/mark/encode.js +4 -4
- package/cjs/graph/mark/encode.js.map +1 -1
- package/cjs/index.d.ts +3 -1
- package/cjs/index.js +3 -2
- package/cjs/index.js.map +1 -1
- package/cjs/interactions/base.js.map +1 -1
- package/cjs/interactions/brush-base.js +2 -2
- package/cjs/interactions/brush-base.js.map +1 -1
- package/cjs/interactions/brush-filter.js +2 -2
- package/cjs/interactions/brush-filter.js.map +1 -1
- package/cjs/interactions/crosshair.d.ts +1 -1
- package/cjs/interactions/crosshair.js +15 -15
- package/cjs/interactions/crosshair.js.map +1 -1
- package/cjs/interactions/datazoom-filter.js +3 -3
- package/cjs/interactions/datazoom-filter.js.map +1 -1
- package/cjs/interactions/drill-down.js +2 -2
- package/cjs/interactions/drill-down.js.map +1 -1
- package/cjs/interactions/legend-filter.js +3 -3
- package/cjs/interactions/legend-filter.js.map +1 -1
- package/cjs/interactions/player-filter.js +3 -3
- package/cjs/interactions/player-filter.js.map +1 -1
- package/cjs/interactions/roll-up.js +2 -2
- package/cjs/interactions/roll-up.js.map +1 -1
- package/cjs/interactions/scrollbar-filter.js +3 -3
- package/cjs/interactions/scrollbar-filter.js.map +1 -1
- package/cjs/interactions/slider-filter.js +3 -3
- package/cjs/interactions/slider-filter.js.map +1 -1
- package/cjs/parse/view.js +1 -1
- package/cjs/parse/view.js.map +1 -1
- package/cjs/semantic-marks/cell.d.ts +3 -1
- package/cjs/semantic-marks/cell.js +10 -4
- package/cjs/semantic-marks/cell.js.map +1 -1
- package/cjs/semantic-marks/interval.d.ts +2 -0
- package/cjs/semantic-marks/interval.js +10 -4
- package/cjs/semantic-marks/interval.js.map +1 -1
- package/cjs/semantic-marks/text.d.ts +1 -0
- package/cjs/semantic-marks/text.js +3 -3
- package/cjs/semantic-marks/text.js.map +1 -1
- package/cjs/theme/common/component.d.ts +2 -1
- package/cjs/theme/common/component.js +13 -1
- package/cjs/theme/common/component.js.map +1 -1
- package/cjs/theme/dark.js.map +1 -1
- package/cjs/transforms/data/sampling.d.ts +2 -0
- package/cjs/transforms/data/sampling.js +111 -0
- package/cjs/transforms/data/sampling.js.map +1 -0
- package/cjs/transforms/index.d.ts +1 -1
- package/cjs/transforms/index.js +6 -6
- package/cjs/transforms/index.js.map +1 -1
- package/cjs/transforms/util/util.d.ts +4 -0
- package/cjs/transforms/util/util.js +20 -2
- package/cjs/transforms/util/util.js.map +1 -1
- package/cjs/types/animate.d.ts +6 -1
- package/cjs/types/animate.js.map +1 -1
- package/cjs/types/grammar.d.ts +1 -1
- package/cjs/types/grammar.js.map +1 -1
- package/cjs/types/mark.d.ts +5 -1
- package/cjs/types/mark.js.map +1 -1
- package/cjs/types/theme.d.ts +2 -1
- package/cjs/types/theme.js.map +1 -1
- package/cjs/types/transform.d.ts +5 -5
- package/cjs/types/transform.js.map +1 -1
- package/cjs/types/view.d.ts +2 -0
- package/cjs/types/view.js.map +1 -1
- package/cjs/view/View.d.ts +0 -1
- package/cjs/view/View.js +18 -27
- package/cjs/view/View.js.map +1 -1
- package/cjs/view/animate.d.ts +1 -0
- package/cjs/view/animate.js +12 -12
- package/cjs/view/animate.js.map +1 -1
- package/cjs/view/constants.d.ts +0 -3
- package/cjs/view/constants.js +2 -3
- package/cjs/view/constants.js.map +1 -1
- package/cjs/view/dataflow.d.ts +1 -0
- package/cjs/view/dataflow.js +9 -4
- package/cjs/view/dataflow.js.map +1 -1
- package/cjs/view/grammar-record.js +5 -5
- package/cjs/view/grammar-record.js.map +1 -1
- package/cjs/view/mark.js +1 -1
- package/cjs/view/mark.js.map +1 -1
- package/es/component/axis.js +1 -1
- package/es/component/axis.js.map +1 -1
- package/es/component/datazoom.js +5 -5
- package/es/component/datazoom.js.map +1 -1
- package/es/component/grid.js +1 -1
- package/es/component/grid.js.map +1 -1
- package/es/component/label.js +13 -8
- package/es/component/label.js.map +1 -1
- package/es/component/legend.js +1 -1
- package/es/component/legend.js.map +1 -1
- package/es/component/scrollbar.js +1 -1
- package/es/component/scrollbar.js.map +1 -1
- package/es/component/slider.js +1 -1
- package/es/component/slider.js.map +1 -1
- package/es/component/title.js +1 -1
- package/es/component/title.js.map +1 -1
- package/es/core/factory.d.ts +5 -1
- package/es/core/factory.js +11 -1
- package/es/core/factory.js.map +1 -1
- package/es/graph/animation/animate.d.ts +1 -0
- package/es/graph/animation/animate.js +4 -0
- package/es/graph/animation/animate.js.map +1 -1
- package/es/graph/animation/animation/move.js +5 -5
- package/es/graph/animation/animation/move.js.map +1 -1
- package/es/graph/attributes/common.js +2 -7
- package/es/graph/attributes/common.js.map +1 -1
- package/es/graph/attributes/helpers.d.ts +2 -2
- package/es/graph/attributes/helpers.js +46 -12
- package/es/graph/attributes/helpers.js.map +1 -1
- package/es/graph/attributes/index.d.ts +4 -10
- package/es/graph/attributes/index.js +4 -227
- package/es/graph/attributes/index.js.map +1 -1
- package/es/graph/attributes/line.d.ts +3 -0
- package/es/graph/attributes/line.js +42 -0
- package/es/graph/attributes/line.js.map +1 -0
- package/es/graph/attributes/transform.d.ts +5 -0
- package/es/graph/attributes/transform.js +153 -0
- package/es/graph/attributes/transform.js.map +1 -0
- package/es/graph/canvas-renderer.js +1 -1
- package/es/graph/canvas-renderer.js.map +1 -1
- package/es/graph/constants.d.ts +0 -1
- package/es/graph/constants.js +0 -2
- package/es/graph/constants.js.map +1 -1
- package/es/graph/element.js +11 -11
- package/es/graph/element.js.map +1 -1
- package/es/graph/glyph-element.js +3 -4
- package/es/graph/glyph-element.js.map +1 -1
- package/es/graph/layout/relative.js.map +1 -1
- package/es/graph/mark/encode.js +1 -1
- package/es/graph/mark/encode.js.map +1 -1
- package/es/index.d.ts +3 -1
- package/es/index.js +5 -1
- package/es/index.js.map +1 -1
- package/es/interactions/base.js.map +1 -1
- package/es/interactions/brush-base.js +1 -1
- package/es/interactions/brush-base.js.map +1 -1
- package/es/interactions/brush-filter.js +2 -3
- package/es/interactions/brush-filter.js.map +1 -1
- package/es/interactions/crosshair.d.ts +1 -1
- package/es/interactions/crosshair.js +1 -1
- package/es/interactions/crosshair.js.map +1 -1
- package/es/interactions/datazoom-filter.js +1 -1
- package/es/interactions/datazoom-filter.js.map +1 -1
- package/es/interactions/drill-down.js +1 -1
- package/es/interactions/drill-down.js.map +1 -1
- package/es/interactions/element-highlight-by-group.js +2 -1
- package/es/interactions/index.js +1 -2
- package/es/interactions/legend-filter.js +2 -2
- package/es/interactions/legend-filter.js.map +1 -1
- package/es/interactions/player-filter.js +2 -2
- package/es/interactions/player-filter.js.map +1 -1
- package/es/interactions/roll-up.js +2 -2
- package/es/interactions/roll-up.js.map +1 -1
- package/es/interactions/scrollbar-filter.js +2 -2
- package/es/interactions/scrollbar-filter.js.map +1 -1
- package/es/interactions/slider-filter.js +2 -2
- package/es/interactions/slider-filter.js.map +1 -1
- package/es/interactions/tooltip.js +1 -1
- package/es/interactions/view-drag-mixin.js +1 -1
- package/es/parse/coordinate.js +1 -1
- package/es/parse/event.js +1 -1
- package/es/parse/mark.js +1 -1
- package/es/parse/option.js +1 -1
- package/es/parse/scale.js +2 -1
- package/es/parse/transform.js +1 -1
- package/es/parse/util.js +1 -1
- package/es/parse/view.js +2 -2
- package/es/parse/view.js.map +1 -1
- package/es/semantic-marks/cell.d.ts +3 -1
- package/es/semantic-marks/cell.js +11 -1
- package/es/semantic-marks/cell.js.map +1 -1
- package/es/semantic-marks/interval.d.ts +2 -0
- package/es/semantic-marks/interval.js +9 -1
- package/es/semantic-marks/interval.js.map +1 -1
- package/es/semantic-marks/text.d.ts +1 -0
- package/es/semantic-marks/text.js +3 -1
- package/es/semantic-marks/text.js.map +1 -1
- package/es/theme/common/component.d.ts +2 -1
- package/es/theme/common/component.js +14 -0
- package/es/theme/common/component.js.map +1 -1
- package/es/theme/dark.js.map +1 -1
- package/es/transforms/data/sampling.d.ts +2 -0
- package/es/transforms/data/sampling.js +105 -0
- package/es/transforms/data/sampling.js.map +1 -0
- package/es/transforms/index.d.ts +1 -1
- package/es/transforms/index.js +4 -4
- package/es/transforms/index.js.map +1 -1
- package/es/transforms/util/util.d.ts +4 -0
- package/es/transforms/util/util.js +17 -0
- package/es/transforms/util/util.js.map +1 -1
- package/es/types/animate.d.ts +6 -1
- package/es/types/animate.js.map +1 -1
- package/es/types/grammar.d.ts +1 -1
- package/es/types/grammar.js.map +1 -1
- package/es/types/mark.d.ts +5 -1
- package/es/types/mark.js.map +1 -1
- package/es/types/theme.d.ts +2 -1
- package/es/types/theme.js.map +1 -1
- package/es/types/transform.d.ts +5 -5
- package/es/types/transform.js.map +1 -1
- package/es/types/view.d.ts +2 -0
- package/es/types/view.js.map +1 -1
- package/es/view/View.d.ts +0 -1
- package/es/view/View.js +15 -29
- package/es/view/View.js.map +1 -1
- package/es/view/animate.d.ts +1 -0
- package/es/view/animate.js +6 -6
- package/es/view/animate.js.map +1 -1
- package/es/view/constants.d.ts +0 -3
- package/es/view/constants.js +0 -6
- package/es/view/constants.js.map +1 -1
- package/es/view/dataflow.d.ts +1 -0
- package/es/view/dataflow.js +9 -4
- package/es/view/dataflow.js.map +1 -1
- package/es/view/grammar-record.js +1 -1
- package/es/view/grammar-record.js.map +1 -1
- package/es/view/mark.js +1 -1
- package/es/view/mark.js.map +1 -1
- package/package.json +9 -9
- package/cjs/transforms/mark/lttb-sample.d.ts +0 -2
- package/cjs/transforms/mark/lttb-sample.js +0 -68
- package/cjs/transforms/mark/lttb-sample.js.map +0 -1
- package/es/transforms/mark/lttb-sample.d.ts +0 -2
- package/es/transforms/mark/lttb-sample.js +0 -60
- package/es/transforms/mark/lttb-sample.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/common/component.ts"],"names":[],"mappings":"AA6BA,MAAM,IAAI,G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M,EAAE,QAAQ;IAChB,UAAU,EAAE,MAAM;IAClB,WAAW,EAAE,IAAI;IACjB,KAAK,EAAE,CAAC;IACR,GAAG,EAAE,CAAC;IACN,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IACxB,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE;IAChC,WAAW,EAAE,EAAE;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAiD,EAAE,CAAC;AAEjF,MAAM,CAAC,MAAM,cAAc,GAA+C,EAAE,CAAC;AAE7E,MAAM,CAAC,MAAM,OAAO,GAAwC,EAAE,CAAC;AAE/D,MAAM,CAAC,MAAM,KAAK,GAAiC;IACjD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;KAChB;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,SAAS;KAChB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAA0C;IAC9D,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACf,SAAS,EAAE;QACT,IAAI,EAAE,mBAAmB;KAC1B;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAoB;IACpD,IAAI;IACJ,UAAU;IAEV,IAAI;IACJ,UAAU;IAEV,cAAc;IACd,WAAW;IACX,UAAU;IAEV,aAAa;IACb,aAAa;IACb,eAAe;IACf,eAAe;IACf,gBAAgB;IAEhB,MAAM;IAEN,SAAS;IACT,UAAU;IACV,SAAS;IACT,SAAS;IACT,WAAW;IACX,QAAQ;IAER,QAAQ;IAER,gBAAgB;IAChB,cAAc;IAEd,OAAO;IAEP,KAAK;IAEL,SAAS;CACV,CAAC","file":"component.js","sourcesContent":["import type {\n CircleAxisAttributes,\n CircleCrosshairAttrs,\n ColorLegendAttributes,\n ContinuousPlayerAttributes,\n DataLabelAttrs,\n DataZoomAttributes,\n DiscreteLegendAttrs,\n DiscretePlayerAttributes,\n LineAxisAttributes,\n LineCrosshairAttrs,\n LineLabelAttrs,\n PolygonCrosshairAttrs,\n RectCrosshairAttrs,\n RectLabelAttrs,\n SectorCrosshairAttrs,\n SizeLegendAttributes,\n SliderAttributes,\n SymbolLabelAttrs,\n ArcLabelAttrs,\n TooltipAttributes,\n BaseLabelAttrs,\n TitleAttrs,\n LineAxisGridAttributes,\n CircleAxisGridAttributes,\n ScrollBarAttributes\n} from '@visactor/vrender-components';\nimport type { IComponentTheme, RecursivePartial } from '../../types';\n\nconst axis: RecursivePartial<LineAxisAttributes> = {\n label: {\n visible: true,\n inside: false,\n space: 4,\n style: {\n fontSize: 12,\n fill: '#89909d',\n fontWeight: 'normal',\n fillOpacity: 1\n }\n },\n tick: {\n visible: true,\n inside: false,\n alignWithLabel: true,\n length: 4,\n style: {\n lineWidth: 1,\n stroke: '#D9DDE4',\n strokeOpacity: 1\n }\n },\n subTick: {\n visible: false,\n inside: false,\n count: 4,\n length: 2,\n style: {\n lineWidth: 1,\n stroke: '#D9DDE4',\n strokeOpacity: 1\n }\n },\n line: {\n visible: true,\n style: {\n lineWidth: 1,\n stroke: '#D9DDE4',\n strokeOpacity: 1\n }\n },\n items: [],\n start: { x: 0, y: 0 },\n end: { x: 100, y: 0 },\n x: 0,\n y: 0\n};\n\nconst circleAxis: RecursivePartial<CircleAxisAttributes> = {\n title: {\n space: 4,\n padding: [0, 0, 0, 0],\n textStyle: {\n fontSize: 12,\n fill: '#333333',\n fontWeight: 'normal',\n fillOpacity: 1\n },\n text: 'theta'\n },\n label: {\n visible: true,\n inside: false,\n space: 4,\n style: {\n fontSize: 12,\n fill: '#6F6F6F',\n fontWeight: 'normal',\n fillOpacity: 1\n }\n },\n tick: {\n visible: true,\n inside: false,\n alignWithLabel: true,\n length: 4,\n style: {\n lineWidth: 1,\n stroke: '#D9DDE4',\n strokeOpacity: 1\n }\n },\n subTick: {\n visible: false,\n inside: false,\n count: 4,\n length: 2,\n style: {\n lineWidth: 1,\n stroke: '#D9DDE4',\n strokeOpacity: 1\n }\n },\n line: {\n visible: true,\n style: {\n lineWidth: 1,\n stroke: '#D9DDE4',\n strokeOpacity: 1\n }\n },\n items: [],\n startAngle: 0,\n endAngle: Math.PI * 2,\n radius: 100,\n innerRadius: 0,\n center: { x: 0, y: 0 },\n x: 0,\n y: 0\n};\n\nconst grid: RecursivePartial<LineAxisGridAttributes> = {\n style: {\n stroke: '#f1f2f5'\n }\n};\n\nconst circleGrid: RecursivePartial<CircleAxisGridAttributes> = {\n style: {\n stroke: '#f1f2f5'\n }\n};\n\nconst discreteLegend: RecursivePartial<DiscreteLegendAttrs> = {\n layout: 'vertical',\n title: {\n align: 'start',\n space: 12,\n textStyle: {\n fontSize: 12,\n fontWeight: 'bold',\n fill: '#2C3542'\n }\n },\n item: {\n spaceCol: 10,\n spaceRow: 10,\n shape: {\n space: 4,\n style: {\n size: 10,\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n opacity: 0.85\n },\n unSelected: {\n fill: '#D8D8D8',\n stroke: '#D8D8D8',\n fillOpacity: 0.5\n }\n }\n },\n label: {\n space: 4,\n style: {\n fontSize: 12,\n fill: 'black',\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n opacity: 0.85\n },\n unSelected: {\n fill: '#D8D8D8',\n fillOpacity: 0.5\n }\n }\n },\n value: {\n alignRight: false,\n style: {\n fontSize: 12,\n fill: '#ccc',\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n opacity: 0.85\n },\n unSelected: {\n fill: '#D8D8D8'\n }\n }\n },\n background: {\n style: {\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n fillOpacity: 0.7,\n fill: 'gray'\n },\n unSelectedHover: {\n fillOpacity: 0.2,\n fill: 'gray'\n }\n }\n },\n focus: false,\n focusIconStyle: {\n size: 10,\n fill: '#333',\n cursor: 'pointer'\n },\n visible: true,\n padding: {\n top: 2,\n bottom: 2,\n left: 2,\n right: 2\n }\n },\n autoPage: true,\n pager: {\n space: 12,\n handler: {\n style: {\n size: 10\n },\n space: 4\n }\n },\n hover: true,\n select: true,\n selectMode: 'multiple',\n allowAllCanceled: false,\n items: [\n {\n index: 0,\n id: '',\n label: '',\n shape: {\n fill: '#6690F2',\n stroke: '#6690F2',\n symbolType: 'circle'\n }\n }\n ]\n};\n\nconst colorLegend: RecursivePartial<ColorLegendAttributes> = {\n title: {\n visible: false,\n text: ''\n },\n colors: [],\n layout: 'horizontal',\n railWidth: 200,\n railHeight: 8,\n railStyle: {\n cornerRadius: 5\n }\n};\n\nconst sizeLegend: RecursivePartial<SizeLegendAttributes> = {\n title: {\n visible: false,\n text: ''\n },\n trackStyle: {\n fill: '#ccc'\n },\n layout: 'horizontal',\n align: 'bottom',\n railWidth: 200,\n railHeight: 6,\n min: 0,\n max: 1,\n value: [0, 1]\n};\n\nconst lineCrosshair: RecursivePartial<LineCrosshairAttrs> = {\n start: { x: 0, y: 0 },\n end: { x: 0, y: 0 }\n};\n\nconst rectCrosshair: RecursivePartial<RectCrosshairAttrs> = {\n start: { x: 0, y: 0 },\n end: { x: 0, y: 0 },\n rectStyle: {\n width: 10,\n height: 10\n }\n};\n\nconst sectorCrosshair: RecursivePartial<SectorCrosshairAttrs> = {\n center: { x: 0, y: 0 },\n radius: 100,\n startAngle: 0,\n endAngle: Math.PI / 6\n};\n\nconst circleCrosshair: RecursivePartial<CircleCrosshairAttrs> = {\n center: { x: 0, y: 0 },\n radius: 100,\n startAngle: 0,\n endAngle: Math.PI * 2\n};\n\nconst polygonCrosshair: RecursivePartial<PolygonCrosshairAttrs> = {\n center: { x: 0, y: 0 },\n radius: 100,\n startAngle: 0,\n endAngle: Math.PI * 2,\n sides: 6\n};\n\nconst slider: RecursivePartial<SliderAttributes> = {\n layout: 'horizontal',\n railWidth: 200,\n railHeight: 10,\n railStyle: {\n cornerRadius: 5\n },\n range: {\n draggableTrack: true\n },\n startText: {\n visible: true,\n text: '',\n space: 8\n },\n endText: {\n visible: true,\n text: '',\n space: 8\n },\n min: 0,\n max: 1,\n value: [0, 1]\n};\n\nexport const dataLabel: RecursivePartial<DataLabelAttrs> = {\n size: { width: 400, height: 400 },\n dataLabels: []\n};\n\nexport const lineLabel: RecursivePartial<LineLabelAttrs> = {\n type: 'line',\n data: [\n {\n text: '',\n data: {}\n }\n ],\n position: 'start',\n overlap: {\n avoidBaseMark: true,\n clampForce: false,\n size: {\n width: 1000,\n height: 1000\n },\n strategy: [\n {\n type: 'position'\n }\n ]\n },\n smartInvert: false\n};\n\nexport const rectLabel: RecursivePartial<RectLabelAttrs> = {\n type: 'rect',\n data: [\n {\n text: '',\n fill: '#606773',\n data: {}\n }\n ],\n position: 'top',\n overlap: {\n size: {\n width: 1000,\n height: 1000\n },\n strategy: [\n {\n type: 'position'\n }\n ]\n },\n smartInvert: false\n};\n\nexport const symbolLabel: RecursivePartial<SymbolLabelAttrs> = {\n type: 'symbol',\n data: [\n {\n text: '',\n fill: '#606773',\n data: {}\n }\n ],\n position: 'top',\n overlap: {\n avoidBaseMark: true,\n size: {\n width: 1000,\n height: 1000\n },\n strategy: [\n {\n type: 'position'\n }\n ]\n },\n smartInvert: false\n};\n\nexport const arcLabel: RecursivePartial<ArcLabelAttrs> = {\n type: 'arc',\n data: [\n {\n text: '',\n fill: '#606773',\n data: {}\n }\n ],\n width: 800,\n height: 600,\n position: 'outside',\n\n zIndex: 302\n};\n\nexport const pointLabel: RecursivePartial<BaseLabelAttrs> = {\n data: [\n {\n text: '',\n fill: '#606773',\n data: {}\n }\n ],\n overlap: {\n avoidBaseMark: false,\n clampForce: false,\n size: {\n width: 1000,\n height: 1000\n }\n },\n smartInvert: false\n};\n\nexport const datazoom: RecursivePartial<DataZoomAttributes> = {\n orient: 'bottom',\n showDetail: 'auto',\n brushSelect: true,\n start: 0,\n end: 1,\n position: { x: 0, y: 0 },\n size: { width: 500, height: 40 },\n previewData: []\n};\n\nexport const continuousPlayer: RecursivePartial<ContinuousPlayerAttributes> = {};\n\nexport const discretePlayer: RecursivePartial<DiscretePlayerAttributes> = {};\n\nexport const tooltip: RecursivePartial<TooltipAttributes> = {};\n\nexport const title: RecursivePartial<TitleAttrs> = {\n textStyle: {\n fill: '#21252c'\n },\n subtextStyle: {\n fill: '#606773'\n }\n};\n\nexport const scrollbar: RecursivePartial<ScrollBarAttributes> = {\n width: 12,\n height: 12,\n padding: [2, 2],\n railStyle: {\n fill: 'rgba(0, 0, 0, .1)'\n }\n};\n\nexport const defaultComponentTheme: IComponentTheme = {\n axis,\n circleAxis,\n\n grid,\n circleGrid,\n\n discreteLegend,\n colorLegend,\n sizeLegend,\n\n lineCrosshair,\n rectCrosshair,\n sectorCrosshair,\n circleCrosshair,\n polygonCrosshair,\n\n slider,\n\n dataLabel,\n pointLabel,\n lineLabel,\n rectLabel,\n symbolLabel,\n arcLabel,\n\n datazoom,\n\n continuousPlayer,\n discretePlayer,\n\n tooltip,\n\n title,\n\n scrollbar\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/theme/common/component.ts"],"names":[],"mappings":"AA8BA,MAAM,IAAI,GAAyC;IACjD,KAAK,EAAE;QACL,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,CAAC;QACR,KAAK,EAAE;YACL,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,QAAQ;YACpB,WAAW,EAAE,CAAC;SACf;KACF;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,KAAK;QACb,cAAc,EAAE,IAAI;QACpB,MAAM,EAAE,CAAC;QACT,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,SAAS;YACjB,aAAa,EAAE,CAAC;SACjB;KACF;IACD,OAAO,EAAE;QACP,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,KAAK,EAA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M,CAAC,MAAM,gBAAgB,GAAiD,EAAE,CAAC;AAEjF,MAAM,CAAC,MAAM,cAAc,GAA+C,EAAE,CAAC;AAE7E,MAAM,CAAC,MAAM,OAAO,GAAwC,EAAE,CAAC;AAE/D,MAAM,CAAC,MAAM,KAAK,GAAiC;IACjD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;KAChB;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,SAAS;KAChB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAA0C;IAC9D,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACf,SAAS,EAAE;QACT,IAAI,EAAE,mBAAmB;KAC1B;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAoB;IACpD,IAAI;IACJ,UAAU;IAEV,IAAI;IACJ,UAAU;IAEV,cAAc;IACd,WAAW;IACX,UAAU;IAEV,aAAa;IACb,aAAa;IACb,eAAe;IACf,eAAe;IACf,gBAAgB;IAEhB,MAAM;IAEN,SAAS;IACT,UAAU;IACV,SAAS;IACT,SAAS;IACT,WAAW;IACX,QAAQ;IACR,aAAa;IAEb,QAAQ;IAER,gBAAgB;IAChB,cAAc;IAEd,OAAO;IAEP,KAAK;IAEL,SAAS;CACV,CAAC","file":"component.js","sourcesContent":["import type {\n CircleAxisAttributes,\n CircleCrosshairAttrs,\n ColorLegendAttributes,\n ContinuousPlayerAttributes,\n DataLabelAttrs,\n LineDataLabelAttrs,\n DataZoomAttributes,\n DiscreteLegendAttrs,\n DiscretePlayerAttributes,\n LineAxisAttributes,\n LineCrosshairAttrs,\n LineLabelAttrs,\n PolygonCrosshairAttrs,\n RectCrosshairAttrs,\n RectLabelAttrs,\n SectorCrosshairAttrs,\n SizeLegendAttributes,\n SliderAttributes,\n SymbolLabelAttrs,\n ArcLabelAttrs,\n TooltipAttributes,\n BaseLabelAttrs,\n TitleAttrs,\n LineAxisGridAttributes,\n CircleAxisGridAttributes,\n ScrollBarAttributes\n} from '@visactor/vrender-components';\nimport type { IComponentTheme, RecursivePartial } from '../../types';\n\nconst axis: RecursivePartial<LineAxisAttributes> = {\n label: {\n visible: true,\n inside: false,\n space: 4,\n style: {\n fontSize: 12,\n fill: '#89909d',\n fontWeight: 'normal',\n fillOpacity: 1\n }\n },\n tick: {\n visible: true,\n inside: false,\n alignWithLabel: true,\n length: 4,\n style: {\n lineWidth: 1,\n stroke: '#D9DDE4',\n strokeOpacity: 1\n }\n },\n subTick: {\n visible: false,\n inside: false,\n count: 4,\n length: 2,\n style: {\n lineWidth: 1,\n stroke: '#D9DDE4',\n strokeOpacity: 1\n }\n },\n line: {\n visible: true,\n style: {\n lineWidth: 1,\n stroke: '#D9DDE4',\n strokeOpacity: 1\n }\n },\n items: [],\n start: { x: 0, y: 0 },\n end: { x: 100, y: 0 },\n x: 0,\n y: 0\n};\n\nconst circleAxis: RecursivePartial<CircleAxisAttributes> = {\n title: {\n space: 4,\n padding: [0, 0, 0, 0],\n textStyle: {\n fontSize: 12,\n fill: '#333333',\n fontWeight: 'normal',\n fillOpacity: 1\n },\n text: 'theta'\n },\n label: {\n visible: true,\n inside: false,\n space: 4,\n style: {\n fontSize: 12,\n fill: '#6F6F6F',\n fontWeight: 'normal',\n fillOpacity: 1\n }\n },\n tick: {\n visible: true,\n inside: false,\n alignWithLabel: true,\n length: 4,\n style: {\n lineWidth: 1,\n stroke: '#D9DDE4',\n strokeOpacity: 1\n }\n },\n subTick: {\n visible: false,\n inside: false,\n count: 4,\n length: 2,\n style: {\n lineWidth: 1,\n stroke: '#D9DDE4',\n strokeOpacity: 1\n }\n },\n line: {\n visible: true,\n style: {\n lineWidth: 1,\n stroke: '#D9DDE4',\n strokeOpacity: 1\n }\n },\n items: [],\n startAngle: 0,\n endAngle: Math.PI * 2,\n radius: 100,\n innerRadius: 0,\n center: { x: 0, y: 0 },\n x: 0,\n y: 0\n};\n\nconst grid: RecursivePartial<LineAxisGridAttributes> = {\n style: {\n stroke: '#f1f2f5'\n }\n};\n\nconst circleGrid: RecursivePartial<CircleAxisGridAttributes> = {\n style: {\n stroke: '#f1f2f5'\n }\n};\n\nconst discreteLegend: RecursivePartial<DiscreteLegendAttrs> = {\n layout: 'vertical',\n title: {\n align: 'start',\n space: 12,\n textStyle: {\n fontSize: 12,\n fontWeight: 'bold',\n fill: '#2C3542'\n }\n },\n item: {\n spaceCol: 10,\n spaceRow: 10,\n shape: {\n space: 4,\n style: {\n size: 10,\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n opacity: 0.85\n },\n unSelected: {\n fill: '#D8D8D8',\n stroke: '#D8D8D8',\n fillOpacity: 0.5\n }\n }\n },\n label: {\n space: 4,\n style: {\n fontSize: 12,\n fill: 'black',\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n opacity: 0.85\n },\n unSelected: {\n fill: '#D8D8D8',\n fillOpacity: 0.5\n }\n }\n },\n value: {\n alignRight: false,\n style: {\n fontSize: 12,\n fill: '#ccc',\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n opacity: 0.85\n },\n unSelected: {\n fill: '#D8D8D8'\n }\n }\n },\n background: {\n style: {\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n fillOpacity: 0.7,\n fill: 'gray'\n },\n unSelectedHover: {\n fillOpacity: 0.2,\n fill: 'gray'\n }\n }\n },\n focus: false,\n focusIconStyle: {\n size: 10,\n fill: '#333',\n cursor: 'pointer'\n },\n visible: true,\n padding: {\n top: 2,\n bottom: 2,\n left: 2,\n right: 2\n }\n },\n autoPage: true,\n pager: {\n space: 12,\n handler: {\n style: {\n size: 10\n },\n space: 4\n }\n },\n hover: true,\n select: true,\n selectMode: 'multiple',\n allowAllCanceled: false,\n items: [\n {\n index: 0,\n id: '',\n label: '',\n shape: {\n fill: '#6690F2',\n stroke: '#6690F2',\n symbolType: 'circle'\n }\n }\n ]\n};\n\nconst colorLegend: RecursivePartial<ColorLegendAttributes> = {\n title: {\n visible: false,\n text: ''\n },\n colors: [],\n layout: 'horizontal',\n railWidth: 200,\n railHeight: 8,\n railStyle: {\n cornerRadius: 5\n }\n};\n\nconst sizeLegend: RecursivePartial<SizeLegendAttributes> = {\n title: {\n visible: false,\n text: ''\n },\n trackStyle: {\n fill: '#ccc'\n },\n layout: 'horizontal',\n align: 'bottom',\n railWidth: 200,\n railHeight: 6,\n min: 0,\n max: 1,\n value: [0, 1]\n};\n\nconst lineCrosshair: RecursivePartial<LineCrosshairAttrs> = {\n start: { x: 0, y: 0 },\n end: { x: 0, y: 0 }\n};\n\nconst rectCrosshair: RecursivePartial<RectCrosshairAttrs> = {\n start: { x: 0, y: 0 },\n end: { x: 0, y: 0 },\n rectStyle: {\n width: 10,\n height: 10\n }\n};\n\nconst sectorCrosshair: RecursivePartial<SectorCrosshairAttrs> = {\n center: { x: 0, y: 0 },\n radius: 100,\n startAngle: 0,\n endAngle: Math.PI / 6\n};\n\nconst circleCrosshair: RecursivePartial<CircleCrosshairAttrs> = {\n center: { x: 0, y: 0 },\n radius: 100,\n startAngle: 0,\n endAngle: Math.PI * 2\n};\n\nconst polygonCrosshair: RecursivePartial<PolygonCrosshairAttrs> = {\n center: { x: 0, y: 0 },\n radius: 100,\n startAngle: 0,\n endAngle: Math.PI * 2,\n sides: 6\n};\n\nconst slider: RecursivePartial<SliderAttributes> = {\n layout: 'horizontal',\n railWidth: 200,\n railHeight: 10,\n railStyle: {\n cornerRadius: 5\n },\n range: {\n draggableTrack: true\n },\n startText: {\n visible: true,\n text: '',\n space: 8\n },\n endText: {\n visible: true,\n text: '',\n space: 8\n },\n min: 0,\n max: 1,\n value: [0, 1]\n};\n\nexport const dataLabel: RecursivePartial<DataLabelAttrs> = {\n size: { width: 400, height: 400 },\n dataLabels: []\n};\n\nexport const lineDataLabel: RecursivePartial<LineDataLabelAttrs> = {\n type: 'line-data',\n data: [\n {\n text: ''\n }\n ],\n position: 'top',\n overlap: {\n avoidBaseMark: false,\n clampForce: false\n },\n smartInvert: false\n};\n\nexport const lineLabel: RecursivePartial<LineLabelAttrs> = {\n type: 'line',\n data: [\n {\n text: '',\n data: {}\n }\n ],\n position: 'start',\n overlap: {\n avoidBaseMark: true,\n clampForce: false,\n size: {\n width: 1000,\n height: 1000\n },\n strategy: [\n {\n type: 'position'\n }\n ]\n },\n smartInvert: false\n};\n\nexport const rectLabel: RecursivePartial<RectLabelAttrs> = {\n type: 'rect',\n data: [\n {\n text: '',\n fill: '#606773',\n data: {}\n }\n ],\n position: 'top',\n overlap: {\n size: {\n width: 1000,\n height: 1000\n },\n strategy: [\n {\n type: 'position'\n }\n ]\n },\n smartInvert: false\n};\n\nexport const symbolLabel: RecursivePartial<SymbolLabelAttrs> = {\n type: 'symbol',\n data: [\n {\n text: '',\n fill: '#606773',\n data: {}\n }\n ],\n position: 'top',\n overlap: {\n avoidBaseMark: true,\n size: {\n width: 1000,\n height: 1000\n },\n strategy: [\n {\n type: 'position'\n }\n ]\n },\n smartInvert: false\n};\n\nexport const arcLabel: RecursivePartial<ArcLabelAttrs> = {\n type: 'arc',\n data: [\n {\n text: '',\n fill: '#606773',\n data: {}\n }\n ],\n width: 800,\n height: 600,\n position: 'outside',\n\n zIndex: 302\n};\n\nexport const pointLabel: RecursivePartial<BaseLabelAttrs> = {\n data: [\n {\n text: '',\n fill: '#606773',\n data: {}\n }\n ],\n overlap: {\n avoidBaseMark: false,\n clampForce: false,\n size: {\n width: 1000,\n height: 1000\n }\n },\n smartInvert: false\n};\n\nexport const datazoom: RecursivePartial<DataZoomAttributes> = {\n orient: 'bottom',\n showDetail: 'auto',\n brushSelect: true,\n start: 0,\n end: 1,\n position: { x: 0, y: 0 },\n size: { width: 500, height: 40 },\n previewData: []\n};\n\nexport const continuousPlayer: RecursivePartial<ContinuousPlayerAttributes> = {};\n\nexport const discretePlayer: RecursivePartial<DiscretePlayerAttributes> = {};\n\nexport const tooltip: RecursivePartial<TooltipAttributes> = {};\n\nexport const title: RecursivePartial<TitleAttrs> = {\n textStyle: {\n fill: '#21252c'\n },\n subtextStyle: {\n fill: '#606773'\n }\n};\n\nexport const scrollbar: RecursivePartial<ScrollBarAttributes> = {\n width: 12,\n height: 12,\n padding: [2, 2],\n railStyle: {\n fill: 'rgba(0, 0, 0, .1)'\n }\n};\n\nexport const defaultComponentTheme: IComponentTheme = {\n axis,\n circleAxis,\n\n grid,\n circleGrid,\n\n discreteLegend,\n colorLegend,\n sizeLegend,\n\n lineCrosshair,\n rectCrosshair,\n sectorCrosshair,\n circleCrosshair,\n polygonCrosshair,\n\n slider,\n\n dataLabel,\n pointLabel,\n lineLabel,\n rectLabel,\n symbolLabel,\n arcLabel,\n lineDataLabel,\n\n datazoom,\n\n continuousPlayer,\n discretePlayer,\n\n tooltip,\n\n title,\n\n scrollbar\n};\n"]}
|
package/es/theme/dark.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/dark.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,qBAAqB,CAAC,CAAC;AAChE,cAAc,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,cAAc,CAAC,IAAI,EAAE;IAC3D,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IACrC,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;IACtC,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;IACtC,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;CAC1C,CAAC,CAAC;AACH,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","file":"dark.js","sourcesContent":["import type { ITheme } from '../types';\nimport { defaultComponentTheme } from './common/component';\nimport { DEFAULT_PADDING } from './common/constants';\nimport { defaultMarkTheme } from './common/mark';\n\nconst darkComponents = Object.assign({}, defaultComponentTheme);\ndarkComponents.axis = Object.assign({}, darkComponents.axis, {\n label: { style: { fill: '#bbbdc3' } },\n line: { style: { stroke: '#4b4f54' } },\n tick: { style: { stroke: '#4b4f54' } },\n subTick: { style: { stroke: '#4b4f54' } }\n});\ndarkComponents.circleAxis = Object.assign({}, darkComponents.circleAxis, {\n label: { style: { fill: '#bbbdc3' } },\n line: { style: { stroke: '#4b4f54' } },\n tick: { style: { stroke: '#4b4f54' } },\n subTick: { style: { stroke: '#4b4f54' } }\n});\ndarkComponents.grid = Object.assign({}, darkComponents.grid, {\n style: { stroke: '#404349' }\n});\ndarkComponents.circleGrid = Object.assign({}, darkComponents.circleGrid, {\n style: { stroke: '#404349' }\n});\ndarkComponents.rectLabel = Object.assign({}, darkComponents.rectLabel, {\n data: [\n {\n text: '',\n fill: '#888c93',\n data: {}\n }\n ]\n});\ndarkComponents.lineLabel = Object.assign({}, darkComponents.lineLabel, {\n data: [\n {\n text: '',\n fill: '#888c93',\n data: {}\n }\n ]\n});\n\ndarkComponents.symbolLabel = Object.assign({}, darkComponents.symbolLabel, {\n data: [\n {\n text: '',\n fill: '#888c93',\n data: {}\n }\n ]\n});\ndarkComponents.title = Object.assign({}, darkComponents.title, {\n textStyle: {\n fill: '#fdfdfd'\n },\n subtextStyle: {\n fill: '#888c93'\n }\n});\n\nexport const darkTheme: ITheme = {\n name: 'dark',\n padding: DEFAULT_PADDING,\n background: '#202226',\n palette: {\n default: [\n '#5383F4',\n '#7BCF8E',\n '#FF9D2C',\n '#FFDB26',\n '#7568D9',\n '#80D8FB',\n '#1857A3',\n '#CAB0E8',\n '#FF8867',\n '#B9E493',\n '#2CB4A8',\n '#B9E4E3'\n ]\n },\n marks: defaultMarkTheme,\n components: darkComponents\n};\n"]}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { average, max, min, sum } from "../util/util";
|
|
2
|
+
|
|
3
|
+
const samplerMap = {
|
|
4
|
+
min: min,
|
|
5
|
+
max: max,
|
|
6
|
+
average: average,
|
|
7
|
+
sum: sum
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
function lttb(size, array, isGroup, yfield) {
|
|
11
|
+
const frameSize = Math.floor(array.length / size), newIndices = [], len = array.length;
|
|
12
|
+
let maxArea, area, nextIndex, currentIndex = 0, sampledIndex = 0;
|
|
13
|
+
newIndices[sampledIndex++] = currentIndex;
|
|
14
|
+
for (let i = 1; i < len - 1; i += frameSize) {
|
|
15
|
+
const nextFrameStart = Math.min(i + frameSize, len - 1), nextFrameEnd = Math.min(i + 2 * frameSize, len), avgX = (nextFrameEnd + nextFrameStart) / 2;
|
|
16
|
+
let avgY = 0;
|
|
17
|
+
for (let idx = nextFrameStart; idx < nextFrameEnd; idx++) {
|
|
18
|
+
const value = array[idx][yfield];
|
|
19
|
+
Number.isNaN(value) || (avgY += value);
|
|
20
|
+
}
|
|
21
|
+
avgY /= nextFrameEnd - nextFrameStart;
|
|
22
|
+
const frameStart = i, frameEnd = Math.min(i + frameSize, len), pointAX = i - 1, pointAY = array[currentIndex][yfield];
|
|
23
|
+
maxArea = -1, nextIndex = frameStart;
|
|
24
|
+
for (let idx = frameStart; idx < frameEnd; idx++) {
|
|
25
|
+
const value = array[idx][yfield];
|
|
26
|
+
Number.isNaN(yfield) || (area = Math.abs((pointAX - avgX) * (value - pointAY) - (pointAX - idx) * (avgY - pointAY)),
|
|
27
|
+
area > maxArea && (maxArea = area, nextIndex = idx));
|
|
28
|
+
}
|
|
29
|
+
newIndices[sampledIndex++] = nextIndex, currentIndex = nextIndex;
|
|
30
|
+
}
|
|
31
|
+
newIndices[sampledIndex - 1] !== len - 1 && (newIndices[sampledIndex++] = len - 1);
|
|
32
|
+
return newIndices.map((i => isGroup ? array[i].i : i));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function sample(size, array, isGroup, mode, yfield) {
|
|
36
|
+
let frameSize = Math.floor(array.length / size);
|
|
37
|
+
const newIndices = [], len = array.length;
|
|
38
|
+
let sampledIndex = 0, frameValues = [];
|
|
39
|
+
newIndices.push(sampledIndex), array[sampledIndex][yfield] = array[sampledIndex][yfield];
|
|
40
|
+
for (let i = 1; i < len - 1; i += frameSize) {
|
|
41
|
+
frameSize > len - i && (frameSize = len - i, frameValues.length = frameSize), frameValues = [];
|
|
42
|
+
for (let k = 0; k < frameSize; k++) frameValues.push(array[i + k][yfield]);
|
|
43
|
+
const value = samplerMap[mode](frameValues);
|
|
44
|
+
sampledIndex = Math.min(Math.round(i + frameValues.length / 2) || 0, len - 1), array[sampledIndex][yfield] = value,
|
|
45
|
+
newIndices.push(sampledIndex);
|
|
46
|
+
}
|
|
47
|
+
return newIndices.map((i => isGroup ? array[i].i : i));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function sampleMin(size, array, isGroup, yfield) {
|
|
51
|
+
return sample(size, array, isGroup, "min", yfield);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function sampleMax(size, array, isGroup, yfield) {
|
|
55
|
+
return sample(size, array, isGroup, "max", yfield);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function sampleAverage(size, array, isGroup, yfield) {
|
|
59
|
+
return sample(size, array, isGroup, "average", yfield);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function sampleSum(size, array, isGroup, yfield) {
|
|
63
|
+
return sample(size, array, isGroup, "sum", yfield);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const transform = (options, upstreamData) => {
|
|
67
|
+
let size = options.size;
|
|
68
|
+
const factor = options.factor || 1;
|
|
69
|
+
if (Array.isArray(size) && (size = Math.floor(size[1] - size[0])), size *= factor,
|
|
70
|
+
size <= 0) return [];
|
|
71
|
+
if (upstreamData.length <= size) return upstreamData;
|
|
72
|
+
if (options.skipfirst) return upstreamData.slice(0, 1);
|
|
73
|
+
const {mode: mode, yfield: y, groupBy: groupBy} = options, yfield = null != y ? y : "y";
|
|
74
|
+
let sampler = lttb;
|
|
75
|
+
if ("min" === mode ? sampler = sampleMin : "max" === mode ? sampler = sampleMax : "average" === mode ? sampler = sampleAverage : "sum" === mode && (sampler = sampleSum),
|
|
76
|
+
upstreamData.length) {
|
|
77
|
+
const groups = {};
|
|
78
|
+
if (groupBy) {
|
|
79
|
+
for (let i = 0, n = upstreamData.length; i < n; i++) {
|
|
80
|
+
const datum = upstreamData[i], groupId = datum[groupBy];
|
|
81
|
+
groups[groupId] ? groups[groupId].push({
|
|
82
|
+
[yfield]: datum[yfield],
|
|
83
|
+
i: i
|
|
84
|
+
}) : (groups[groupId] = [], groups[groupId].push({
|
|
85
|
+
[yfield]: datum[yfield],
|
|
86
|
+
i: i
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
let rawIndice = [];
|
|
90
|
+
return Object.keys(groups).forEach((groupName => {
|
|
91
|
+
const group = groups[groupName];
|
|
92
|
+
if (group.length <= size) {
|
|
93
|
+
const indices = group.map((datum => datum.i));
|
|
94
|
+
rawIndice = rawIndice.concat(indices);
|
|
95
|
+
} else {
|
|
96
|
+
const indices = sampler(size, group, !0, yfield);
|
|
97
|
+
rawIndice = rawIndice.concat(indices), group.forEach((datum => upstreamData[datum.i][yfield] = datum[yfield]));
|
|
98
|
+
}
|
|
99
|
+
})), rawIndice.sort(((a, b) => a - b)), rawIndice.map((index => upstreamData[index]));
|
|
100
|
+
}
|
|
101
|
+
return sampler(size, upstreamData, !1, yfield).map((index => upstreamData[index]));
|
|
102
|
+
}
|
|
103
|
+
return [];
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=sampling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/transforms/data/sampling.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,E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CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;iBAChF;YACH,CAAC,CAAC,CAAC;YAGH,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAEhC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,KAAa,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;SAC9D;QACD,OAAO,OAAO,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;KACrF;IAED,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC","file":"sampling.js","sourcesContent":["import type { SampleTransformOptions } from '../../types';\nimport { average, max, min, sum } from '../util/util';\n\nconst samplerMap = {\n min: min,\n max: max,\n average: average,\n sum: sum\n};\n\nfunction lttb(size: number, array: any[], isGroup: boolean, yfield: string) {\n const frameSize = Math.floor(array.length / size);\n const newIndices = [];\n const len = array.length;\n\n let currentIndex = 0;\n let sampledIndex = 0;\n let maxArea;\n let area;\n let nextIndex;\n\n // First frame use the first data.\n newIndices[sampledIndex++] = currentIndex;\n\n for (let i = 1; i < len - 1; i += frameSize) {\n const nextFrameStart = Math.min(i + frameSize, len - 1);\n const nextFrameEnd = Math.min(i + frameSize * 2, len);\n\n const avgX = (nextFrameEnd + nextFrameStart) / 2;\n let avgY = 0;\n\n for (let idx = nextFrameStart; idx < nextFrameEnd; idx++) {\n const value = array[idx][yfield];\n if (Number.isNaN(value)) {\n continue;\n }\n avgY += value;\n }\n avgY /= nextFrameEnd - nextFrameStart;\n\n const frameStart = i;\n const frameEnd = Math.min(i + frameSize, len);\n\n const pointAX = i - 1;\n const pointAY = array[currentIndex][yfield];\n\n maxArea = -1;\n\n nextIndex = frameStart;\n // Find a point from current frame that construct a triangel with largest area with previous selected point\n // And the average of next frame.\n for (let idx = frameStart; idx < frameEnd; idx++) {\n const value = array[idx][yfield];\n if (Number.isNaN(yfield)) {\n continue;\n }\n // Calculate triangle area over three buckets\n area = Math.abs((pointAX - avgX) * (value - pointAY) - (pointAX - idx) * (avgY - pointAY));\n if (area > maxArea) {\n maxArea = area;\n nextIndex = idx; // Next a is this b\n }\n }\n\n newIndices[sampledIndex++] = nextIndex;\n\n currentIndex = nextIndex; // This a is the next a (chosen b)\n }\n\n // First frame use the last data.\n if (newIndices[sampledIndex - 1] !== len - 1) {\n newIndices[sampledIndex++] = len - 1;\n }\n\n // output newly added tuples\n const newRawIndices = newIndices.map(i => (isGroup ? array[i].i : i));\n return newRawIndices;\n}\n\nfunction sample(size: number, array: any[], isGroup: boolean, mode: 'min' | 'max' | 'average' | 'sum', yfield: string) {\n let frameSize = Math.floor(array.length / size);\n const newIndices = [];\n const len = array.length;\n let sampledIndex = 0;\n let frameValues = [];\n\n newIndices.push(sampledIndex);\n array[sampledIndex][yfield] = array[sampledIndex][yfield];\n\n for (let i = 1; i < len - 1; i += frameSize) {\n if (frameSize > len - i) {\n frameSize = len - i;\n frameValues.length = frameSize;\n }\n frameValues = [];\n for (let k = 0; k < frameSize; k++) {\n frameValues.push(array[i + k][yfield]);\n }\n const value = samplerMap[mode](frameValues);\n sampledIndex = Math.min(Math.round(i + frameValues.length / 2) || 0, len - 1);\n array[sampledIndex][yfield] = value;\n newIndices.push(sampledIndex);\n }\n const newRawIndices = newIndices.map(i => (isGroup ? array[i].i : i));\n return newRawIndices;\n}\n\nfunction sampleMin(size: number, array: any[], isGroup: boolean, yfield: string) {\n return sample(size, array, isGroup, 'min', yfield);\n}\n\nfunction sampleMax(size: number, array: any[], isGroup: boolean, yfield: string) {\n return sample(size, array, isGroup, 'max', yfield);\n}\n\nfunction sampleAverage(size: number, array: any[], isGroup: boolean, yfield: string) {\n return sample(size, array, isGroup, 'average', yfield);\n}\n\nfunction sampleSum(size: number, array: any[], isGroup: boolean, yfield: string) {\n return sample(size, array, isGroup, 'sum', yfield);\n}\n\n/**\n * Samples tuples passing through this operator.\n * mode: 'lttb' - Uses lttb sampling to maintain a trend-maintained sample.\n * mode: 'min' | 'max' | 'average' | 'sum' - Uses aggregation methods to location sample points.\n * @constructor\n * @param {object} options - The parameters for this operator.\n * @param {number} [options.size=1000] - The maximum number of samples.\n * @param {string} [options.yfield] - The yfield string of data.\n * @param {string} [options.groupBy] - The groupBy string of data.\n */\n\nexport const transform = (options: SampleTransformOptions, upstreamData: any[]) => {\n let size = options.size;\n const factor = options.factor || 1;\n\n if (Array.isArray(size)) {\n size = Math.floor(size[1] - size[0]);\n }\n\n size *= factor;\n\n // size<=0的特殊情况不采样,返回空\n if (size <= 0) {\n return [];\n }\n\n // 数据<size的情况,不进行采样,保留所有数据\n if (upstreamData.length <= size) {\n return upstreamData;\n }\n\n const skipfirst = options.skipfirst;\n // 如果是ChartSpace的第一次数据流(evaluateAsync),不需要采样,返回一条数据供布局使用\n // 这里需要依据this.value.length判断是不是第一次数据流,\n // 以避免点击图例,updateChartData等操作清空所有label\n if (skipfirst) {\n return upstreamData.slice(0, 1);\n }\n\n const { mode, yfield: y, groupBy } = options;\n const yfield = y ?? 'y';\n\n // 采样方法\n let sampler = lttb;\n if (mode === 'min') {\n sampler = sampleMin;\n } else if (mode === 'max') {\n sampler = sampleMax;\n } else if (mode === 'average') {\n sampler = sampleAverage;\n } else if (mode === 'sum') {\n sampler = sampleSum;\n }\n\n // 处理数据source,source为采样前的原始数据\n if (upstreamData.length) {\n // 如果有groupBy,数据分组\n const groups = {};\n if (groupBy) {\n for (let i = 0, n = upstreamData.length; i < n; i++) {\n const datum = upstreamData[i];\n const groupId = datum[groupBy];\n if (groups[groupId]) {\n groups[groupId].push({ [yfield]: datum[yfield], i });\n } else {\n groups[groupId] = [];\n groups[groupId].push({ [yfield]: datum[yfield], i });\n }\n }\n\n // 分组采样\n let rawIndice: any[] = [];\n\n Object.keys(groups).forEach(groupName => {\n const group = groups[groupName];\n if (group.length <= size) {\n const indices = group.map((datum: any) => {\n return datum.i;\n });\n rawIndice = rawIndice.concat(indices);\n } else {\n const indices = sampler(size, group, true, yfield);\n rawIndice = rawIndice.concat(indices);\n group.forEach((datum: any) => (upstreamData[datum.i][yfield] = datum[yfield]));\n }\n });\n\n // 采样后,按照原始顺序排序\n rawIndice.sort((a, b) => a - b);\n\n return rawIndice.map((index: number) => upstreamData[index]);\n }\n return sampler(size, upstreamData, false, yfield).map(index => upstreamData[index]);\n }\n\n return [];\n};\n"]}
|
package/es/transforms/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare const registerCircularRelationTransform: () => void;
|
|
|
14
14
|
export declare const registerFoldTransform: () => void;
|
|
15
15
|
export declare const registerUnfoldTransform: () => void;
|
|
16
16
|
export declare const registerIdentifierTransform: () => void;
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const registerSampleTransform: () => void;
|
|
18
18
|
export declare const registerMarkOverlapTransform: () => void;
|
|
19
19
|
export declare const registerDodgeTransform: () => void;
|
|
20
20
|
export declare const registerJitterTransform: () => void;
|
package/es/transforms/index.js
CHANGED
|
@@ -28,7 +28,7 @@ import { transform as pieTransform } from "./data/pie";
|
|
|
28
28
|
|
|
29
29
|
import { transform as circularRelationTransform } from "./data/circular-relation";
|
|
30
30
|
|
|
31
|
-
import { transform as
|
|
31
|
+
import { transform as sampleTransform } from "./data/sampling";
|
|
32
32
|
|
|
33
33
|
import { transform as markoverlapTransform } from "./mark/mark-overlap";
|
|
34
34
|
|
|
@@ -154,9 +154,9 @@ export const registerIdentifierTransform = () => {
|
|
|
154
154
|
}, !0);
|
|
155
155
|
};
|
|
156
156
|
|
|
157
|
-
export const
|
|
158
|
-
Factory.registerTransform("
|
|
159
|
-
transform:
|
|
157
|
+
export const registerSampleTransform = () => {
|
|
158
|
+
Factory.registerTransform("sampling", {
|
|
159
|
+
transform: sampleTransform,
|
|
160
160
|
markPhase: "afterEncode"
|
|
161
161
|
}, !0);
|
|
162
162
|
};
|
|
@@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AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,OAAO,CAAC,iBAAiB,CACvB,OAAO,EACP,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,kBAAkB,EAA8B,EACxF,IAAI,CACL,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,EAAE;IAC1C,OAAO,CAAC,iBAAiB,CACvB,QAAQ,EACR,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,kBAAkB,EAA8B,EACzF,IAAI,CACL,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAC3C,OAAO,CAAC,iBAAiB,CACvB,SAAS,EACT,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,kBAAkB,EAA8B,EAC1F,IAAI,CACL,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAC3C,OAAO,CAAC,iBAAiB,CACvB,SAAS,EACT,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,kBAAkB,EAA8B,EAC1F,IAAI,CACL,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,OAAO,CAAC,iBAAiB,CACvB,UAAU,EACV,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,kBAAkB,EAA8B,EAC3F,IAAI,CACL,CAAC;AACJ,CAAC,CAAC","file":"index.js","sourcesContent":["import { transform as binTransform } from './data/bin';\nimport { transform as contourTransform } from './data/contour';\nimport { transform as sortTransform } from './data/sort';\nimport { transform as filterTransform } from './data/filter';\nimport { transform as mapTransform } from './data/map';\nimport { transform as kdeTransform } from './data/kde';\nimport { transform as joinTransform } from './data/join';\nimport { transform as pickTransform } from './data/pick';\nimport { transform as rangeTransform } from './data/range';\nimport { transform as stackTransform } from './data/stack';\nimport { transform as foldTransform } from './data/fold';\nimport { transform as unfoldTransform } from './data/unfold';\n\nimport { transform as funnelTransform } from './data/funnel';\nimport { transform as pieTransform } from './data/pie';\nimport { transform as circularRelationTransform } from './data/circular-relation';\n\nimport { transform as lttbsampleTransform } from './mark/lttb-sample';\nimport { transform as markoverlapTransform } from './mark/mark-overlap';\n\nimport { transform as identifierTransform } from './view/identifier';\n\nimport { transform as dodgeTransform } from './mark/dodge';\nimport { transform as jitterTransform, jitterX as jitterXTransform, jitterY as jitterYTransform } from './mark/jitter';\nimport { symmetry as symmetryTransform } from './mark/symmetry';\nimport { Factory } from '../core/factory';\nimport type { ITransform } from '../types';\n\nexport const registerBinTransform = () => {\n Factory.registerTransform(\n 'bin',\n { transform: binTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerContourTransform = () => {\n Factory.registerTransform(\n 'contour',\n { transform: contourTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerSortTransform = () => {\n Factory.registerTransform(\n 'sort',\n { transform: sortTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerFilterTransform = () => {\n Factory.registerTransform(\n 'filter',\n { transform: filterTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerJoinTransform = () => {\n Factory.registerTransform(\n 'join',\n { transform: joinTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerKdeTransform = () => {\n Factory.registerTransform(\n 'kde',\n { transform: kdeTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerMapTransform = () => {\n Factory.registerTransform(\n 'map',\n { transform: mapTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerPickTransform = () => {\n Factory.registerTransform(\n 'pick',\n { transform: pickTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerRangeTransform = () => {\n Factory.registerTransform(\n 'range',\n { transform: rangeTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerStackTransform = () => {\n Factory.registerTransform(\n 'stack',\n { transform: stackTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerFunnelTransform = () => {\n Factory.registerTransform(\n 'funnel',\n { transform: funnelTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerPieTransform = () => {\n Factory.registerTransform(\n 'pie',\n { transform: pieTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerCircularRelationTransform = () => {\n Factory.registerTransform(\n 'circularRelation',\n { transform: circularRelationTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerFoldTransform = () => {\n Factory.registerTransform(\n 'fold',\n { transform: foldTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerUnfoldTransform = () => {\n Factory.registerTransform(\n 'unfold',\n { transform: unfoldTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerIdentifierTransform = () => {\n Factory.registerTransform(\n 'identifier',\n { transform: identifierTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerLttbSampleTransform = () => {\n Factory.registerTransform(\n 'lttbsample',\n { transform: lttbsampleTransform, markPhase: 'afterEncode' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerMarkOverlapTransform = () => {\n Factory.registerTransform(\n 'markoverlap',\n { transform: markoverlapTransform, markPhase: 'afterEncode' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerDodgeTransform = () => {\n Factory.registerTransform(\n 'dodge',\n { transform: dodgeTransform, markPhase: 'afterEncodeItems' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerJitterTransform = () => {\n Factory.registerTransform(\n 'jitter',\n { transform: jitterTransform, markPhase: 'afterEncodeItems' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerJitterXTransform = () => {\n Factory.registerTransform(\n 'jitterX',\n { transform: jitterXTransform, markPhase: 'afterEncodeItems' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerJitterYTransform = () => {\n Factory.registerTransform(\n 'jitterY',\n { transform: jitterYTransform, markPhase: 'afterEncodeItems' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerSymmetryTransform = () => {\n Factory.registerTransform(\n 'symmetry',\n { transform: symmetryTransform, markPhase: 'afterEncodeItems' } as Omit<ITransform, 'type'>,\n true\n );\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/transforms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,YAAY,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,SAAS,IAAI,YAAY,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,SAAS,IAAI,YAAY,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,SAAS,IAAI,aAAa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AAE,kBAAkB,EAA8B,EAC1F,IAAI,CACL,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,OAAO,CAAC,iBAAiB,CACvB,UAAU,EACV,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,kBAAkB,EAA8B,EAC3F,IAAI,CACL,CAAC;AACJ,CAAC,CAAC","file":"index.js","sourcesContent":["import { transform as binTransform } from './data/bin';\nimport { transform as contourTransform } from './data/contour';\nimport { transform as sortTransform } from './data/sort';\nimport { transform as filterTransform } from './data/filter';\nimport { transform as mapTransform } from './data/map';\nimport { transform as kdeTransform } from './data/kde';\nimport { transform as joinTransform } from './data/join';\nimport { transform as pickTransform } from './data/pick';\nimport { transform as rangeTransform } from './data/range';\nimport { transform as stackTransform } from './data/stack';\nimport { transform as foldTransform } from './data/fold';\nimport { transform as unfoldTransform } from './data/unfold';\n\nimport { transform as funnelTransform } from './data/funnel';\nimport { transform as pieTransform } from './data/pie';\nimport { transform as circularRelationTransform } from './data/circular-relation';\n\nimport { transform as sampleTransform } from './data/sampling';\nimport { transform as markoverlapTransform } from './mark/mark-overlap';\n\nimport { transform as identifierTransform } from './view/identifier';\n\nimport { transform as dodgeTransform } from './mark/dodge';\nimport { transform as jitterTransform, jitterX as jitterXTransform, jitterY as jitterYTransform } from './mark/jitter';\nimport { symmetry as symmetryTransform } from './mark/symmetry';\nimport { Factory } from '../core/factory';\nimport type { ITransform } from '../types';\n\nexport const registerBinTransform = () => {\n Factory.registerTransform(\n 'bin',\n { transform: binTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerContourTransform = () => {\n Factory.registerTransform(\n 'contour',\n { transform: contourTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerSortTransform = () => {\n Factory.registerTransform(\n 'sort',\n { transform: sortTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerFilterTransform = () => {\n Factory.registerTransform(\n 'filter',\n { transform: filterTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerJoinTransform = () => {\n Factory.registerTransform(\n 'join',\n { transform: joinTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerKdeTransform = () => {\n Factory.registerTransform(\n 'kde',\n { transform: kdeTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerMapTransform = () => {\n Factory.registerTransform(\n 'map',\n { transform: mapTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerPickTransform = () => {\n Factory.registerTransform(\n 'pick',\n { transform: pickTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerRangeTransform = () => {\n Factory.registerTransform(\n 'range',\n { transform: rangeTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerStackTransform = () => {\n Factory.registerTransform(\n 'stack',\n { transform: stackTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerFunnelTransform = () => {\n Factory.registerTransform(\n 'funnel',\n { transform: funnelTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerPieTransform = () => {\n Factory.registerTransform(\n 'pie',\n { transform: pieTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerCircularRelationTransform = () => {\n Factory.registerTransform(\n 'circularRelation',\n { transform: circularRelationTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerFoldTransform = () => {\n Factory.registerTransform(\n 'fold',\n { transform: foldTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerUnfoldTransform = () => {\n Factory.registerTransform(\n 'unfold',\n { transform: unfoldTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerIdentifierTransform = () => {\n Factory.registerTransform(\n 'identifier',\n { transform: identifierTransform, markPhase: 'beforeJoin' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerSampleTransform = () => {\n Factory.registerTransform(\n 'sampling',\n { transform: sampleTransform, markPhase: 'afterEncode' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerMarkOverlapTransform = () => {\n Factory.registerTransform(\n 'markoverlap',\n { transform: markoverlapTransform, markPhase: 'afterEncode' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerDodgeTransform = () => {\n Factory.registerTransform(\n 'dodge',\n { transform: dodgeTransform, markPhase: 'afterEncodeItems' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerJitterTransform = () => {\n Factory.registerTransform(\n 'jitter',\n { transform: jitterTransform, markPhase: 'afterEncodeItems' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerJitterXTransform = () => {\n Factory.registerTransform(\n 'jitterX',\n { transform: jitterXTransform, markPhase: 'afterEncodeItems' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerJitterYTransform = () => {\n Factory.registerTransform(\n 'jitterY',\n { transform: jitterYTransform, markPhase: 'afterEncodeItems' } as Omit<ITransform, 'type'>,\n true\n );\n};\n\nexport const registerSymmetryTransform = () => {\n Factory.registerTransform(\n 'symmetry',\n { transform: symmetryTransform, markPhase: 'afterEncodeItems' } as Omit<ITransform, 'type'>,\n true\n );\n};\n"]}
|
|
@@ -3,3 +3,7 @@ export declare function fieldNames(fields: string[] | FieldGetterFunction[], as?
|
|
|
3
3
|
export declare function partition(data?: any[], groupBy?: FieldGetterFunction[], field?: FieldGetterFunction): any[];
|
|
4
4
|
export declare function normalizeAngle(angle: number): number;
|
|
5
5
|
export declare function computeQuadrant(angle: number): 1 | 2 | 3 | 4;
|
|
6
|
+
export declare function sum(arr: any[]): any;
|
|
7
|
+
export declare function average(arr: any[]): number;
|
|
8
|
+
export declare function min(arr: any[]): number;
|
|
9
|
+
export declare function max(arr: any[]): number;
|
|
@@ -30,4 +30,21 @@ export function normalizeAngle(angle) {
|
|
|
30
30
|
export function computeQuadrant(angle) {
|
|
31
31
|
return (angle = normalizeAngle(angle)) > 0 && angle <= Math.PI / 2 ? 2 : angle > Math.PI / 2 && angle <= Math.PI ? 3 : angle > Math.PI && angle <= 3 * Math.PI / 2 ? 4 : 1;
|
|
32
32
|
}
|
|
33
|
+
|
|
34
|
+
export function sum(arr) {
|
|
35
|
+
return arr.reduce(((accumulator, currentValue) => accumulator + currentValue), 0);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function average(arr) {
|
|
39
|
+
if (0 === arr.length) return 0;
|
|
40
|
+
return sum(arr) / arr.length;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function min(arr) {
|
|
44
|
+
return Math.min(...arr);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function max(arr) {
|
|
48
|
+
return Math.max(...arr);
|
|
49
|
+
}
|
|
33
50
|
//# sourceMappingURL=util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/transforms/util/util.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGvD,MAAM,UAAU,UAAU,CAAC,MAAwC,EAAE,EAAa;IAChF,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,IAAI,CAAC;KACb;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;;QACzB,OAAO,MAAA,EAAE,CAAC,CAAC,CAAC,mCAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC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eAAe,CAAC,KAAa;IAC3C,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE;QACrC,OAAO,CAAC,CAAC;KACV;SAAM,IAAI,KAAK,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,EAAE,EAAE;QAClD,OAAO,CAAC,CAAC;KACV;SAAM,IAAI,KAAK,GAAG,IAAI,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE;QACxD,OAAO,CAAC,CAAC;KACV;IACD,OAAO,CAAC,CAAC;AACX,CAAC","file":"util.js","sourcesContent":["/* Adapted from vega by University of Washington Interactive Data Lab\n * https://vega.github.io/vega/\n * Licensed under the BSD-3-Clause\n\n * url: https://github.com/vega/vega/blob/main/packages/vega-transforms/src/util/util.js\n * License: https://github.com/vega/vega/blob/main/LICENSE\n * @license\n */\n\nimport { isNil, isString } from '@visactor/vutils';\nimport type { FieldGetterFunction } from '@visactor/vgrammar-util';\nimport { accessorName } from '@visactor/vgrammar-util';\n\n// use either provided alias or accessor field name\nexport function fieldNames(fields: string[] | FieldGetterFunction[], as?: string[]) {\n if (!fields) {\n return null;\n }\n return fields.map((f, i) => {\n return as[i] ?? (isString(f) ? f : accessorName(f));\n });\n}\n\nexport function partition(data?: any[], groupBy?: FieldGetterFunction[], field?: FieldGetterFunction) {\n // partition data points into groups\n if (isNil(groupBy)) {\n return [data.map(field)];\n }\n\n const groups: any[] = [];\n const map: Record<string, any> = {};\n data.forEach((entry: any) => {\n const groupKey = groupBy.map((groupFunc: (arg: any) => any) => groupFunc(entry)).toString();\n\n if (!map[groupKey]) {\n const groupItem: any[] = [];\n (groupItem as any).dims = groupKey;\n groups.push(groupItem);\n map[groupKey] = groupItem;\n } else {\n map[groupKey].push(field(entry));\n }\n });\n\n return groups;\n}\n\nexport function normalizeAngle(angle: number): number {\n while (angle < 0) {\n angle += Math.PI * 2;\n }\n while (angle >= Math.PI * 2) {\n angle -= Math.PI * 2;\n }\n return angle;\n}\n\nexport function computeQuadrant(angle: number): 1 | 2 | 3 | 4 {\n angle = normalizeAngle(angle);\n if (angle > 0 && angle <= Math.PI / 2) {\n return 2;\n } else if (angle > Math.PI / 2 && angle <= Math.PI) {\n return 3;\n } else if (angle > Math.PI && angle <= (3 * Math.PI) / 2) {\n return 4;\n }\n return 1;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/transforms/util/util.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGvD,MAAM,UAAU,UAAU,CAAC,MAAwC,EAAE,EAAa;IAChF,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,IAAI,CAAC;KACb;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;;QACzB,OAAO,MAAA,EAAE,CAAC,CAAC,CAAC,mCAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,OAA+B,EAAE,KAA2B;IAElG,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE;QAClB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;KAC1B;IAED,MAAM,MAAM,GAAU,EAAE,CAAC;IACzB,MAAM,GAAG,GAAwB,EAAE,CAAC;IACpC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAU,EAAE,EAAE;QAC1B,MAAM,QAAQ,GAAG,OAAO,CAA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AO,CAAC,CAAC;KACV;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,GAAU;IAC5B,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,YAAY,EAAE,EAAE,CAAC,WAAW,GAAG,YAAY,EAAE,CAAC,CAAC,CAAC;AAClF,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,GAAU;IAChC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,OAAO,CAAC,CAAC;KACV;IACD,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IACvB,OAAO,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,GAAU;IAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,GAAU;IAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;AAC1B,CAAC","file":"util.js","sourcesContent":["/* Adapted from vega by University of Washington Interactive Data Lab\n * https://vega.github.io/vega/\n * Licensed under the BSD-3-Clause\n\n * url: https://github.com/vega/vega/blob/main/packages/vega-transforms/src/util/util.js\n * License: https://github.com/vega/vega/blob/main/LICENSE\n * @license\n */\n\nimport { isNil, isString } from '@visactor/vutils';\nimport type { FieldGetterFunction } from '@visactor/vgrammar-util';\nimport { accessorName } from '@visactor/vgrammar-util';\n\n// use either provided alias or accessor field name\nexport function fieldNames(fields: string[] | FieldGetterFunction[], as?: string[]) {\n if (!fields) {\n return null;\n }\n return fields.map((f, i) => {\n return as[i] ?? (isString(f) ? f : accessorName(f));\n });\n}\n\nexport function partition(data?: any[], groupBy?: FieldGetterFunction[], field?: FieldGetterFunction) {\n // partition data points into groups\n if (isNil(groupBy)) {\n return [data.map(field)];\n }\n\n const groups: any[] = [];\n const map: Record<string, any> = {};\n data.forEach((entry: any) => {\n const groupKey = groupBy.map((groupFunc: (arg: any) => any) => groupFunc(entry)).toString();\n\n if (!map[groupKey]) {\n const groupItem: any[] = [];\n (groupItem as any).dims = groupKey;\n groups.push(groupItem);\n map[groupKey] = groupItem;\n } else {\n map[groupKey].push(field(entry));\n }\n });\n\n return groups;\n}\n\nexport function normalizeAngle(angle: number): number {\n while (angle < 0) {\n angle += Math.PI * 2;\n }\n while (angle >= Math.PI * 2) {\n angle -= Math.PI * 2;\n }\n return angle;\n}\n\nexport function computeQuadrant(angle: number): 1 | 2 | 3 | 4 {\n angle = normalizeAngle(angle);\n if (angle > 0 && angle <= Math.PI / 2) {\n return 2;\n } else if (angle > Math.PI / 2 && angle <= Math.PI) {\n return 3;\n } else if (angle > Math.PI && angle <= (3 * Math.PI) / 2) {\n return 4;\n }\n return 1;\n}\n\nexport function sum(arr: any[]) {\n return arr.reduce((accumulator, currentValue) => accumulator + currentValue, 0);\n}\n\nexport function average(arr: any[]) {\n if (arr.length === 0) {\n return 0;\n }\n const total = sum(arr);\n return total / arr.length;\n}\n\nexport function min(arr: any[]) {\n return Math.min(...arr);\n}\n\nexport function max(arr: any[]) {\n return Math.max(...arr);\n}\n"]}
|
package/es/types/animate.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { IPointLike } from '@visactor/vutils';
|
|
|
3
3
|
import type { MarkFunctionCallback, MarkFunctionType } from './mark';
|
|
4
4
|
import type { IMark } from './grammar';
|
|
5
5
|
import type { IElement } from './element';
|
|
6
|
+
import type { FunctionCallback } from './signal';
|
|
6
7
|
export type TypeAnimation<T extends IElement> = (element: T, options: any, animationParameters: IAnimationParameters) => {
|
|
7
8
|
from?: {
|
|
8
9
|
[channel: string]: any;
|
|
@@ -43,7 +44,10 @@ export interface IMoveAnimationOptions {
|
|
|
43
44
|
point?: {
|
|
44
45
|
x?: number;
|
|
45
46
|
y?: number;
|
|
46
|
-
}
|
|
47
|
+
} | FunctionCallback<{
|
|
48
|
+
x?: number;
|
|
49
|
+
y?: number;
|
|
50
|
+
}>;
|
|
47
51
|
}
|
|
48
52
|
export interface IRotateAnimationOptions {
|
|
49
53
|
orient?: 'clockwise' | 'anticlockwise';
|
|
@@ -215,6 +219,7 @@ export interface IAnimate extends IBaseAnimate {
|
|
|
215
219
|
restart: () => this;
|
|
216
220
|
record: () => this;
|
|
217
221
|
recordEnd: () => this;
|
|
222
|
+
getAnimationConfigs: (animationState: string) => IParsedAnimationConfig[];
|
|
218
223
|
updateConfig: (config: Record<string, IAnimationConfig | IAnimationConfig[]>) => void;
|
|
219
224
|
updateState: (state: MarkFunctionType<string> | null) => void;
|
|
220
225
|
isElementAnimating: (element: IElement) => boolean;
|
package/es/types/animate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/animate.ts"],"names":[],"mappings":"","file":"animate.js","sourcesContent":["import type { IGraphic, ACustomAnimate, EasingType } from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { MarkFunctionCallback, MarkFunctionType } from './mark';\nimport type { IMark } from './grammar';\nimport type { IElement } from './element';\n\nexport type TypeAnimation<T extends IElement> = (\n element: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nexport interface IClipAnimationOptions {\n clipDimension?: 'x' | 'y' | 'auto' | 'default';\n}\n\nexport interface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IGrowAngleAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n overall?: boolean | number;\n}\n\nexport interface IGrowRadiusAnimationOptions {\n orient?: 'inside' | 'outside';\n overall?: boolean | number;\n}\n\nexport interface IGrowPointsAnimationOptions {\n orient?: 'positive' | 'negative';\n}\n\nexport interface IGrowPointsOverallAnimationOptions extends IGrowPointsAnimationOptions {\n center?: IPointLike;\n}\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IMoveAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n orient?: 'positive' | 'negative';\n offset?: number;\n point?: { x?: number; y?: number }
|
|
1
|
+
{"version":3,"sources":["../src/types/animate.ts"],"names":[],"mappings":"","file":"animate.js","sourcesContent":["import type { IGraphic, ACustomAnimate, EasingType } from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { MarkFunctionCallback, MarkFunctionType } from './mark';\nimport type { IMark } from './grammar';\nimport type { IElement } from './element';\nimport type { FunctionCallback } from './signal';\n\nexport type TypeAnimation<T extends IElement> = (\n element: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nexport interface IClipAnimationOptions {\n clipDimension?: 'x' | 'y' | 'auto' | 'default';\n}\n\nexport interface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IGrowAngleAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n overall?: boolean | number;\n}\n\nexport interface IGrowRadiusAnimationOptions {\n orient?: 'inside' | 'outside';\n overall?: boolean | number;\n}\n\nexport interface IGrowPointsAnimationOptions {\n orient?: 'positive' | 'negative';\n}\n\nexport interface IGrowPointsOverallAnimationOptions extends IGrowPointsAnimationOptions {\n center?: IPointLike;\n}\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IMoveAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n orient?: 'positive' | 'negative';\n offset?: number;\n point?: { x?: number; y?: number } | FunctionCallback<{ x?: number; y?: number }>;\n}\n\nexport interface IRotateAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n angle?: number;\n}\n\n/** VGrammar 层提供的图元text上的图形属性,现在暂时会和VRender不一致 */\nexport interface TextItemAttributes {\n fontSize?: number;\n lineHeight?: number;\n font?: string;\n fontStyle?: string;\n fontVariant?: string;\n fontWeight?: string | number;\n lineBreak?: string;\n text?: string | string[];\n limit?: number;\n align?: string;\n baseline?: string;\n ellipsis?: string | boolean;\n dir?: string;\n}\n\n/** animation */\nexport type MarkFunctionValueType<T> = MarkFunctionCallback<T> | T;\n\nexport type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;\n\n/**\n * state动画,暂时只支持简单配置\n */\nexport interface IStateAnimationConfig {\n duration?: number;\n easing?: EasingType;\n}\n\n/**\n * 动画 config 简化配置\n */\nexport interface IAnimationTypeConfig {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n delay?: MarkFunctionValueType<number>;\n duration?: MarkFunctionValueType<number>;\n oneByOne?: MarkFunctionValueType<boolean | number>;\n startTime?: MarkFunctionValueType<number>;\n totalTime?: MarkFunctionValueType<number>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: boolean | number;\n /** 动画 effect 配置项 */\n options?: MarkFunctionValueType<any>;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\n/**\n * 动画 timeline 完整配置,一条时间线内的动画单元只能串行\n * 多个timeline是可以并行的\n * 考虑到同一图元不能在多个timeline上,所以timeline不应该提供数组配置的能力\n */\nexport interface IAnimationTimeline {\n /** 为了方便动画编排,用户可以设置 id 用于识别时间线 */\n id?: string;\n /** 时间切片 */\n timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];\n /** 动画开始的相对时间,可以为负数 */\n startTime?: MarkFunctionValueType<number>;\n /** 动画时长 */\n totalTime?: MarkFunctionValueType<number>;\n /** 动画依次执行的延迟 */\n oneByOne?: MarkFunctionValueType<number | boolean>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: MarkFunctionValueType<number | boolean>;\n /** 对图元元素进行划分,和过滤类似,但是不同时间线不能同时作用在相同的元素上 */\n partitioner?: MarkFunctionCallback<boolean>;\n /** 对同一时间线上的元素进行排序 */\n sort?: (datumA: any, datumB: any, elementA: IElement, elementB: IElement, parameters: any) => number;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\nexport interface IAnimationTimeSlice {\n effects: IAnimationEffect | IAnimationEffect[];\n duration?: MarkFunctionValueType<number>;\n delay?: MarkFunctionValueType<number>;\n}\n\nexport type IAnimationChannelFunction = (datum: any, element: IElement, parameters: IAnimationParameters) => any;\nexport type IAnimationChannelAttrs = Record<\n string,\n {\n from?: any | IAnimationChannelFunction;\n to?: any | IAnimationChannelFunction;\n }\n>;\nexport type IAnimationChannelAttributes = string[];\nexport type IAnimationChannelInterpolator = (\n ratio: number,\n from: any,\n to: any,\n nextAttributes: any,\n datum: any,\n element: IElement,\n parameters: IAnimationParameters\n) => boolean | void;\n\n// TODO: fix ACustomAnimate<any>\nexport interface IAnimationCustomConstructor {\n new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;\n}\n\nexport interface IAnimationEffect {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n /** options暂时没有处理 */\n options?: MarkFunctionValueType<any>;\n}\n\nexport interface IAnimationControlOptions {\n /** 当动画状态变更时清空动画 */\n stopWhenStateChange?: boolean;\n /** 是否立即应用动画初始状态 */\n immediatelyApply?: boolean;\n}\n\n/**\n * Animation timeline should be parsed into animation units,\n * which record all necessary configs for animator to execute animation.\n *\n * animation unit time:\n * |<--initialDelay-->| |<--loopDelay--><--Slices--><--looDelayAfter-->| |<--loopDuration-->|\n * |<-----------------loopDuration--------------->|\n */\nexport interface IAnimationUnit {\n /**\n * initial delay time before any animation loop\n */\n initialDelay: number;\n /**\n * total time for one animation loop\n */\n loopDuration: number;\n /**\n * delay time before time slices\n */\n loopDelay: number;\n /**\n * delay time after time slices\n */\n loopDelayAfter: number;\n /**\n * animating time in one animation loop\n */\n loopAnimateDuration: number;\n loopCount: number;\n totalTime: number;\n timeSlices: IAnimationTimeSlice[];\n}\n\nexport interface IAnimationRecord {\n start: IGraphic;\n end: IGraphic;\n changes: any[];\n}\n\nexport interface IAnimationParameters {\n width: number;\n height: number;\n mark: IMark;\n group: IMark | null;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\nexport interface IParsedAnimationConfig {\n state: string;\n timeline: IAnimationTimeline;\n originConfig: IAnimationConfig;\n id: string;\n}\n\nexport interface IParsedAnimationAttrs {\n from?: any;\n to?: any;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: any;\n}\n\n// animate structure\n\nexport interface IAnimatorOptions {\n state: string;\n timeline: IAnimationTimeline;\n id: string;\n}\n\nexport interface IAnimator {\n id: number;\n element: IElement;\n animationOptions: IAnimatorOptions;\n isAnimating: boolean;\n\n /** execute animation */\n animate: (animationParameters: IAnimationParameters, parameters: any) => this;\n /** set animation callback */\n callback: (callbackFunction: (...args: any[]) => void) => this;\n\n // animation control\n stop: (stopState?: 'start' | 'end', invokeCallback?: boolean) => this;\n pause: () => this;\n resume: () => this;\n\n /** set additional initial animation delay */\n startAt: (startTime: number) => this;\n /** get total animation execution time */\n getTotalAnimationTime: () => number;\n\n getEndAttributes: () => Record<string, any>;\n}\n\nexport interface IAnimateArranger {\n // animation control api\n parallel: (arranger: IAnimateArranger) => this;\n after: (arranger: IAnimateArranger) => this;\n\n // internal properties\n afterArranger: IAnimateArranger;\n parallelArrangers: IAnimateArranger[];\n animators: IAnimator[];\n totalTime: number;\n startTime: number;\n endTime: number;\n arrangeTime: () => void;\n}\n\nexport interface IBaseAnimate {\n // animation control\n stop: () => this;\n pause: () => this;\n resume: () => this;\n\n // internal animation process api\n animate: () => this;\n enable: () => this;\n disable: () => this;\n enableAnimationState: (state: string | string[]) => this;\n disableAnimationState: (state: string | string[]) => this;\n isAnimating: () => boolean;\n\n release: () => void;\n}\n\nexport interface IViewAnimate extends IBaseAnimate {\n animateAddition: (mark: IMark) => this;\n}\n\nexport interface IAnimate extends IBaseAnimate {\n mark: IMark;\n\n // additional animation control\n run: (config: IAnimationConfig | IAnimationConfig[]) => IAnimateArranger;\n runAnimationByState: (animationState: string) => IAnimateArranger;\n stopAnimationByState: (animationState: string) => this;\n pauseAnimationByState: (animationState: string) => this;\n resumeAnimationByState: (animationState: string) => this;\n reverse: () => this;\n restart: () => this;\n record: () => this;\n recordEnd: () => this;\n\n // internal animation process api\n getAnimationConfigs: (animationState: string) => IParsedAnimationConfig[];\n updateConfig: (config: Record<string, IAnimationConfig | IAnimationConfig[]>) => void;\n updateState: (state: MarkFunctionType<string> | null) => void;\n isElementAnimating: (element: IElement) => boolean;\n getAnimatorCount: () => number;\n getElementAnimators: (element: IElement | IElement[], animationState?: string) => IAnimator[];\n release: () => void;\n}\n"]}
|
package/es/types/grammar.d.ts
CHANGED
|
@@ -134,7 +134,7 @@ export interface IMark extends IGrammarBase, IProgressiveGrammar {
|
|
|
134
134
|
elementMap: Map<string, IElement>;
|
|
135
135
|
graphicIndex: number;
|
|
136
136
|
graphicItem?: IGroup;
|
|
137
|
-
animate
|
|
137
|
+
animate?: IAnimate;
|
|
138
138
|
join: (data: IData | string | Nil, key?: MarkKeySpec, sort?: MarkSortSpec, groupBy?: MarkKeySpec, groupSort?: MarkSortSpec) => this;
|
|
139
139
|
coordinate: (coordinate: ICoordinate | string | Nil) => this;
|
|
140
140
|
state: (state: MarkFunctionType<string | string[]> | Nil) => this;
|
package/es/types/grammar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/grammar.ts"],"names":[],"mappings":"","file":"grammar.js","sourcesContent":["import type { EventEmitter, IBounds, IPointLike } from '@visactor/vutils';\nimport type { IGraphic, IGroup } from '@visactor/vrender-core';\nimport type { IBaseScale, ScaleFishEyeOptions, TickData } from '@visactor/vscale';\nimport type { ITransform, TransformSpec } from './transform';\nimport type { DataFormatSpec, IDataFilter } from './data';\nimport type { ParameterFunctionType, SignalFunctionType } from './signal';\nimport type { IAnimate } from './animate';\nimport type { IGlyphMeta } from './glyph';\nimport type { GrammarTypeEnum } from '../graph/enums';\nimport type { Nil } from './base';\nimport type { CoordinateFunctionType } from './coordinate';\nimport type { IElement } from './element';\nimport type {\n MarkFunctionType,\n MarkAnimationSpec,\n MarkType,\n MarkLayoutSpec,\n MarkLayoutCallback,\n MarkSortSpec,\n MarkKeySpec,\n IMarkConfig,\n ChannelEncodeType,\n AttributeTransform,\n BaseSignleEncodeSpec\n} from './mark';\nimport type { ScaleConfigureSpec, ScaleData, ScaleFunctionType, GrammarScaleType, MultiScaleData } from './scale';\nimport type { IView } from './view';\nimport type { BaseEventHandler } from './event';\nimport type { ICartesianCoordinate, IPolarCoordinate } from '@visactor/vgrammar-coordinate';\n\nexport type BuiltInGrammarType = keyof typeof GrammarTypeEnum;\nexport type GrammarType = BuiltInGrammarType | string;\n\n/** 语法元素内置运行的任务 */\nexport interface IGrammarTask extends ITransform {\n /**\n * 参数依赖\n * 只做一级解析\n */\n options?: Record<string, any | IGrammarBase> | (IGrammarBase | any)[];\n /**\n * 依赖的语法元素\n */\n references?: IGrammarBase[];\n /**\n * 是否只支持简单的options配置,不支持在options引用语法元素\n */\n isRawOptions?: boolean;\n}\n\nexport interface GrammarSpec {\n id?: string;\n dependency?: IGrammarBase[] | IGrammarBase | string[] | string;\n}\n\nexport interface IGrammarBase {\n readonly grammarType: GrammarType;\n readonly view: IView;\n readonly uid: number;\n /**\n * 执行的上游节点\n */\n grammarSource: IGrammarBase;\n /**\n * 影响的下游节点\n */\n targets: IGrammarBase[];\n /**\n * 依赖的上游节点,由于不同 spec 配置项中可能引用同一个节点,需要进行计数\n */\n references: Map<IGrammarBase, number>;\n\n depend: (grammar: IGrammarBase[] | IGrammarBase | string[] | string) => this;\n\n addEventListener: (type: string, handler: BaseEventHandler, options?: any) => this;\n removeEventListener: (type: string, handler: BaseEventHandler) => this;\n\n // extended from EventEmitter\n emit: <T extends EventEmitter.EventNames<string | symbol>>(\n event: T,\n ...args: EventEmitter.EventArgs<string | symbol, T>\n ) => boolean;\n emitGrammarEvent: <T extends EventEmitter.EventNames<string | symbol>>(\n event: T,\n ...args: EventEmitter.EventArgs<string | symbol, T>\n ) => boolean;\n\n tasks?: IGrammarTask[];\n // value?: any;\n /** FIXME: operator执行顺序,改造后,dataflow执行元素,应该抽象出来 */\n rank?: number;\n // todo\n set: (value: any) => boolean;\n id: (() => string) & ((id: string) => this);\n name: (() => string) & ((name: string) => this);\n attach: (reference: IGrammarBase | IGrammarBase[], count?: number) => this;\n detach: (reference: IGrammarBase | IGrammarBase[], count?: number) => this;\n detachAll: () => void;\n commit: () => void;\n output: () => any;\n parse: (spec: any) => this;\n parameters: () => { [key: string]: any };\n evaluateSync?: (upstream: any, parameters: any) => this;\n getSpec: () => any;\n reuse: (grammar: IGrammarBase) => this;\n /** clear references */\n clear: () => void;\n /** release all memory storage */\n release: () => void;\n}\n\nexport interface IData extends IGrammarBase {\n values: (values: any | Nil, format?: ParameterFunctionType<DataFormatSpec>, load?: boolean) => this;\n url: (\n url: ParameterFunctionType<string> | Nil,\n format?: ParameterFunctionType<DataFormatSpec>,\n load?: boolean\n ) => this;\n source: (\n source: string | string[] | IData | IData[],\n format?: ParameterFunctionType<DataFormatSpec>,\n load?: boolean\n ) => this;\n transform: (transform: TransformSpec[] | Nil) => this;\n\n // only used in VGrammar\n addDataFilter: (filter: IDataFilter | IDataFilter[]) => this;\n removeDataFilter: (filter: IDataFilter | IDataFilter[]) => this;\n\n // data util methods\n field: (field: string) => any[];\n getValue: () => any[];\n getInput: () => any[];\n getDataIDKey: () => string;\n}\n\n/** 语法元素,TODO */\nexport interface ISignal<T> extends IGrammarBase {\n value: (value: T | Nil) => this;\n update: (update: SignalFunctionType<T> | Nil) => this;\n\n getValue: () => T;\n}\n\n/** 语法元素,TODO */\nexport interface IScale extends IGrammarBase {\n domain: (domain: ScaleFunctionType<any[]> | ScaleData | MultiScaleData | Nil) => this;\n range: (range: ScaleFunctionType<any[]> | ScaleData | MultiScaleData | Nil) => this;\n configure: (config: ScaleConfigureSpec | Nil) => this;\n\n // only used in VGrammar\n getRangeFactor: () => [number, number] | Nil;\n setRangeFactor: (range?: [number, number]) => this;\n getFishEye: () => ScaleFishEyeOptions | Nil;\n setFishEye: (option?: ScaleFishEyeOptions) => this;\n\n // scale util methods\n getScaleType: () => GrammarScaleType;\n getScale: () => IBaseScale;\n ticks: (count?: number) => TickData[];\n getCoordinateAxisPoints: (baseValue?: number) => [IPointLike, IPointLike];\n getCoordinate: () => IPolarCoordinate | ICartesianCoordinate;\n getCoordinateAxisPosition: () => 'top' | 'bottom' | 'left' | 'right' | 'inside' | 'outside' | 'start' | 'end';\n}\n\nexport interface ICoordinate extends IGrammarBase {\n start: (start: CoordinateFunctionType<[number, number]> | Nil) => this;\n end: (end: CoordinateFunctionType<[number, number]> | Nil) => this;\n origin: (origin: CoordinateFunctionType<[number, number]> | Nil) => this;\n\n translate: (offset: CoordinateFunctionType<[number, number]> | Nil) => this;\n rotate: (angle: CoordinateFunctionType<number> | Nil) => this;\n scale: (ratio: CoordinateFunctionType<[number, number]> | Nil) => this;\n transpose: (isTransposed: CoordinateFunctionType<boolean> | Nil) => this;\n\n // coordinate util methods\n}\n\n/** 语法元素,TODO */\n\n/** group mark */\nexport interface IGroupMark extends IMark {\n children: (IMark | IGroupMark | IGlyphMark)[];\n\n layoutChildren?: (IMark | IGroupMark | IGlyphMark)[];\n\n appendChild: (mark: IMark | IGroupMark | IGlyphMark) => this;\n removeChild: (mark: IMark | IGroupMark | IGlyphMark) => this;\n includesChild: (mark: IMark, descendant?: boolean) => boolean;\n\n updateLayoutChildren: () => this;\n}\n\nexport interface IGlyphMark extends IMark {\n glyphType: string;\n getGlyphMeta: () => IGlyphMeta;\n configureGlyph: (config: any) => this;\n getGlyphConfig: () => any;\n}\n\nexport interface IComponent extends IMark {\n componentType: string;\n configureComponent: (config: any) => this;\n}\n\nexport interface IProgressiveGrammar {\n /** 是否启动了增量渲染模式 */\n isProgressive: () => boolean;\n /** 是否正在执行增量渲染 */\n isDoingProgressive: () => boolean;\n /** 清除增量渲染相关状态 */\n clearProgressive: () => void;\n /** 从第一帧开始增量计算 */\n restartProgressive: () => void;\n /** 分片执行 */\n evaluateProgressive: () => void;\n}\n\nexport interface IMark extends IGrammarBase, IProgressiveGrammar {\n group?: IGroupMark;\n\n markType: MarkType;\n context: any;\n coord: ICoordinate;\n /**\n * disable coordinate transform when need\n */\n disableCoordinateTransform?: boolean;\n elements: IElement[];\n elementMap: Map<string, IElement>;\n graphicIndex: number;\n graphicItem?: IGroup;\n animate
|
|
1
|
+
{"version":3,"sources":["../src/types/grammar.ts"],"names":[],"mappings":"","file":"grammar.js","sourcesContent":["import type { EventEmitter, IBounds, IPointLike } from '@visactor/vutils';\nimport type { IGraphic, IGroup } from '@visactor/vrender-core';\nimport type { IBaseScale, ScaleFishEyeOptions, TickData } from '@visactor/vscale';\nimport type { ITransform, TransformSpec } from './transform';\nimport type { DataFormatSpec, IDataFilter } from './data';\nimport type { ParameterFunctionType, SignalFunctionType } from './signal';\nimport type { IAnimate } from './animate';\nimport type { IGlyphMeta } from './glyph';\nimport type { GrammarTypeEnum } from '../graph/enums';\nimport type { Nil } from './base';\nimport type { CoordinateFunctionType } from './coordinate';\nimport type { IElement } from './element';\nimport type {\n MarkFunctionType,\n MarkAnimationSpec,\n MarkType,\n MarkLayoutSpec,\n MarkLayoutCallback,\n MarkSortSpec,\n MarkKeySpec,\n IMarkConfig,\n ChannelEncodeType,\n AttributeTransform,\n BaseSignleEncodeSpec\n} from './mark';\nimport type { ScaleConfigureSpec, ScaleData, ScaleFunctionType, GrammarScaleType, MultiScaleData } from './scale';\nimport type { IView } from './view';\nimport type { BaseEventHandler } from './event';\nimport type { ICartesianCoordinate, IPolarCoordinate } from '@visactor/vgrammar-coordinate';\n\nexport type BuiltInGrammarType = keyof typeof GrammarTypeEnum;\nexport type GrammarType = BuiltInGrammarType | string;\n\n/** 语法元素内置运行的任务 */\nexport interface IGrammarTask extends ITransform {\n /**\n * 参数依赖\n * 只做一级解析\n */\n options?: Record<string, any | IGrammarBase> | (IGrammarBase | any)[];\n /**\n * 依赖的语法元素\n */\n references?: IGrammarBase[];\n /**\n * 是否只支持简单的options配置,不支持在options引用语法元素\n */\n isRawOptions?: boolean;\n}\n\nexport interface GrammarSpec {\n id?: string;\n dependency?: IGrammarBase[] | IGrammarBase | string[] | string;\n}\n\nexport interface IGrammarBase {\n readonly grammarType: GrammarType;\n readonly view: IView;\n readonly uid: number;\n /**\n * 执行的上游节点\n */\n grammarSource: IGrammarBase;\n /**\n * 影响的下游节点\n */\n targets: IGrammarBase[];\n /**\n * 依赖的上游节点,由于不同 spec 配置项中可能引用同一个节点,需要进行计数\n */\n references: Map<IGrammarBase, number>;\n\n depend: (grammar: IGrammarBase[] | IGrammarBase | string[] | string) => this;\n\n addEventListener: (type: string, handler: BaseEventHandler, options?: any) => this;\n removeEventListener: (type: string, handler: BaseEventHandler) => this;\n\n // extended from EventEmitter\n emit: <T extends EventEmitter.EventNames<string | symbol>>(\n event: T,\n ...args: EventEmitter.EventArgs<string | symbol, T>\n ) => boolean;\n emitGrammarEvent: <T extends EventEmitter.EventNames<string | symbol>>(\n event: T,\n ...args: EventEmitter.EventArgs<string | symbol, T>\n ) => boolean;\n\n tasks?: IGrammarTask[];\n // value?: any;\n /** FIXME: operator执行顺序,改造后,dataflow执行元素,应该抽象出来 */\n rank?: number;\n // todo\n set: (value: any) => boolean;\n id: (() => string) & ((id: string) => this);\n name: (() => string) & ((name: string) => this);\n attach: (reference: IGrammarBase | IGrammarBase[], count?: number) => this;\n detach: (reference: IGrammarBase | IGrammarBase[], count?: number) => this;\n detachAll: () => void;\n commit: () => void;\n output: () => any;\n parse: (spec: any) => this;\n parameters: () => { [key: string]: any };\n evaluateSync?: (upstream: any, parameters: any) => this;\n getSpec: () => any;\n reuse: (grammar: IGrammarBase) => this;\n /** clear references */\n clear: () => void;\n /** release all memory storage */\n release: () => void;\n}\n\nexport interface IData extends IGrammarBase {\n values: (values: any | Nil, format?: ParameterFunctionType<DataFormatSpec>, load?: boolean) => this;\n url: (\n url: ParameterFunctionType<string> | Nil,\n format?: ParameterFunctionType<DataFormatSpec>,\n load?: boolean\n ) => this;\n source: (\n source: string | string[] | IData | IData[],\n format?: ParameterFunctionType<DataFormatSpec>,\n load?: boolean\n ) => this;\n transform: (transform: TransformSpec[] | Nil) => this;\n\n // only used in VGrammar\n addDataFilter: (filter: IDataFilter | IDataFilter[]) => this;\n removeDataFilter: (filter: IDataFilter | IDataFilter[]) => this;\n\n // data util methods\n field: (field: string) => any[];\n getValue: () => any[];\n getInput: () => any[];\n getDataIDKey: () => string;\n}\n\n/** 语法元素,TODO */\nexport interface ISignal<T> extends IGrammarBase {\n value: (value: T | Nil) => this;\n update: (update: SignalFunctionType<T> | Nil) => this;\n\n getValue: () => T;\n}\n\n/** 语法元素,TODO */\nexport interface IScale extends IGrammarBase {\n domain: (domain: ScaleFunctionType<any[]> | ScaleData | MultiScaleData | Nil) => this;\n range: (range: ScaleFunctionType<any[]> | ScaleData | MultiScaleData | Nil) => this;\n configure: (config: ScaleConfigureSpec | Nil) => this;\n\n // only used in VGrammar\n getRangeFactor: () => [number, number] | Nil;\n setRangeFactor: (range?: [number, number]) => this;\n getFishEye: () => ScaleFishEyeOptions | Nil;\n setFishEye: (option?: ScaleFishEyeOptions) => this;\n\n // scale util methods\n getScaleType: () => GrammarScaleType;\n getScale: () => IBaseScale;\n ticks: (count?: number) => TickData[];\n getCoordinateAxisPoints: (baseValue?: number) => [IPointLike, IPointLike];\n getCoordinate: () => IPolarCoordinate | ICartesianCoordinate;\n getCoordinateAxisPosition: () => 'top' | 'bottom' | 'left' | 'right' | 'inside' | 'outside' | 'start' | 'end';\n}\n\nexport interface ICoordinate extends IGrammarBase {\n start: (start: CoordinateFunctionType<[number, number]> | Nil) => this;\n end: (end: CoordinateFunctionType<[number, number]> | Nil) => this;\n origin: (origin: CoordinateFunctionType<[number, number]> | Nil) => this;\n\n translate: (offset: CoordinateFunctionType<[number, number]> | Nil) => this;\n rotate: (angle: CoordinateFunctionType<number> | Nil) => this;\n scale: (ratio: CoordinateFunctionType<[number, number]> | Nil) => this;\n transpose: (isTransposed: CoordinateFunctionType<boolean> | Nil) => this;\n\n // coordinate util methods\n}\n\n/** 语法元素,TODO */\n\n/** group mark */\nexport interface IGroupMark extends IMark {\n children: (IMark | IGroupMark | IGlyphMark)[];\n\n layoutChildren?: (IMark | IGroupMark | IGlyphMark)[];\n\n appendChild: (mark: IMark | IGroupMark | IGlyphMark) => this;\n removeChild: (mark: IMark | IGroupMark | IGlyphMark) => this;\n includesChild: (mark: IMark, descendant?: boolean) => boolean;\n\n updateLayoutChildren: () => this;\n}\n\nexport interface IGlyphMark extends IMark {\n glyphType: string;\n getGlyphMeta: () => IGlyphMeta;\n configureGlyph: (config: any) => this;\n getGlyphConfig: () => any;\n}\n\nexport interface IComponent extends IMark {\n componentType: string;\n configureComponent: (config: any) => this;\n}\n\nexport interface IProgressiveGrammar {\n /** 是否启动了增量渲染模式 */\n isProgressive: () => boolean;\n /** 是否正在执行增量渲染 */\n isDoingProgressive: () => boolean;\n /** 清除增量渲染相关状态 */\n clearProgressive: () => void;\n /** 从第一帧开始增量计算 */\n restartProgressive: () => void;\n /** 分片执行 */\n evaluateProgressive: () => void;\n}\n\nexport interface IMark extends IGrammarBase, IProgressiveGrammar {\n group?: IGroupMark;\n\n markType: MarkType;\n context: any;\n coord: ICoordinate;\n /**\n * disable coordinate transform when need\n */\n disableCoordinateTransform?: boolean;\n elements: IElement[];\n elementMap: Map<string, IElement>;\n graphicIndex: number;\n graphicItem?: IGroup;\n animate?: IAnimate;\n\n join: (\n data: IData | string | Nil,\n key?: MarkKeySpec,\n sort?: MarkSortSpec,\n groupBy?: MarkKeySpec,\n groupSort?: MarkSortSpec\n ) => this;\n coordinate: (coordinate: ICoordinate | string | Nil) => this;\n state: (state: MarkFunctionType<string | string[]> | Nil) => this;\n encode: ((encoders: BaseSignleEncodeSpec) => this) & ((channel: string, value: ChannelEncodeType) => this);\n encodeState: ((state: string, channel: string, value: ChannelEncodeType) => this) &\n ((state: string, encoders: BaseSignleEncodeSpec) => this);\n animation: (animationConfig: MarkAnimationSpec | Nil) => this;\n animationState: (animationState: MarkFunctionType<string> | Nil) => this;\n layout: (layout: MarkLayoutSpec | MarkLayoutCallback | Nil) => this;\n configure: (config: IMarkConfig | Nil) => this;\n transform: (transform: TransformSpec[] | Nil) => this;\n\n needAnimate: () => boolean;\n getBounds: () => IBounds;\n isCollectionMark: () => boolean;\n getAllElements: () => IElement[];\n\n // position: () => this;\n // color: () => this;\n // shape: () => this;\n\n // mark 执行流程相关接口\n\n isUpdated: boolean;\n getGroupGraphicItem: () => any;\n cleanExitElements: () => void;\n addGraphicItem: (attrs: any, groupKey?: string) => IGraphic;\n getMorphConfig: () => { morph: boolean; morphKey: string | undefined; morphElementKey: string | undefined };\n prepareRelease: () => void;\n\n layoutBounds?: IBounds;\n relativePosition?: { top?: number; bottom?: number; left?: number; right?: number };\n needLayout: () => boolean;\n handleLayoutEnd: () => void;\n handleRenderEnd: () => void;\n isLargeMode: () => boolean;\n getAttributeTransforms: () => AttributeTransform[];\n\n getScalesByChannel: () => Record<string, IBaseScale> | undefined;\n getFieldsByChannel: () => Record<string, string> | undefined;\n getScales: () => Record<string, IBaseScale> | undefined;\n}\n\nexport interface IGrammarBaseConstructor {\n new (view: IView): IGrammarBase;\n}\n\nexport interface ProgressiveContext {\n currentIndex: number;\n totalStep: number;\n step: number;\n data: any[];\n groupKeys?: string[];\n groupedData?: Map<string, any[]>;\n}\n"]}
|
package/es/types/mark.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { IMark, IScale, IGroupMark, ICoordinate, GrammarSpec, IData } from
|
|
|
6
6
|
import type { GenericFunctionType } from './signal';
|
|
7
7
|
import type { TransformSpec } from './transform';
|
|
8
8
|
import type { CommonPaddingSpec } from './base';
|
|
9
|
-
import type { ILayoutOptions } from './view';
|
|
9
|
+
import type { ILayoutOptions, IView } from './view';
|
|
10
10
|
import type { AxisSpec, BuiltInComponentSpec, DatazoomSpec, LabelSpec, LegendSpec, PlayerSpec, SliderSpec } from './component';
|
|
11
11
|
import type { GrammarMarkType } from '../graph/enums';
|
|
12
12
|
export type MarkFunctionCallback<T> = (datum: any, element: IElement, parameters: any) => T;
|
|
@@ -341,3 +341,7 @@ export interface AttributeTransform {
|
|
|
341
341
|
transform: (graphicAttributes: any, nextAttrs: any, storedAttrs: any) => void;
|
|
342
342
|
storedAttrs?: string;
|
|
343
343
|
}
|
|
344
|
+
export interface IMarkConstructor {
|
|
345
|
+
readonly markType: string;
|
|
346
|
+
new (view: IView, markType: MarkType, group?: IGroupMark): IMark;
|
|
347
|
+
}
|