@visactor/vgrammar-core 0.9.0-alpha.1 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/component/label.js +15 -10
- package/cjs/component/label.js.map +1 -1
- package/cjs/graph/animation/animator.js +3 -1
- package/cjs/graph/animation/animator.js.map +1 -1
- package/cjs/graph/attributes/helpers.js +4 -4
- package/cjs/graph/attributes/helpers.js.map +1 -1
- package/cjs/graph/element.d.ts +2 -0
- package/cjs/graph/element.js +10 -5
- package/cjs/graph/element.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/theme/common/component.d.ts +2 -1
- package/cjs/theme/common/component.js +20 -6
- package/cjs/theme/common/component.js.map +1 -1
- package/cjs/types/element.d.ts +2 -0
- package/cjs/types/element.js.map +1 -1
- package/cjs/types/theme.d.ts +2 -1
- package/cjs/types/theme.js.map +1 -1
- package/cjs/view/View.js +3 -1
- package/cjs/view/View.js.map +1 -1
- package/cjs/view/dataflow.js +7 -7
- package/cjs/view/dataflow.js.map +1 -1
- package/es/component/label.js +15 -10
- package/es/component/label.js.map +1 -1
- package/es/graph/animation/animator.js +3 -1
- package/es/graph/animation/animator.js.map +1 -1
- package/es/graph/attributes/helpers.js +4 -4
- package/es/graph/attributes/helpers.js.map +1 -1
- package/es/graph/element.d.ts +2 -0
- package/es/graph/element.js +10 -4
- package/es/graph/element.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/theme/common/component.d.ts +2 -1
- package/es/theme/common/component.js +21 -5
- package/es/theme/common/component.js.map +1 -1
- package/es/types/element.d.ts +2 -0
- package/es/types/element.js.map +1 -1
- package/es/types/theme.d.ts +2 -1
- package/es/types/theme.js.map +1 -1
- package/es/view/View.js +3 -1
- package/es/view/View.js.map +1 -1
- package/es/view/dataflow.js +9 -8
- package/es/view/dataflow.js.map +1 -1
- package/package.json +10 -10
|
@@ -368,15 +368,30 @@ export const lineLabel = {
|
|
|
368
368
|
} ],
|
|
369
369
|
position: "start",
|
|
370
370
|
overlap: {
|
|
371
|
-
avoidBaseMark: !
|
|
371
|
+
avoidBaseMark: !1,
|
|
372
372
|
clampForce: !1,
|
|
373
373
|
size: {
|
|
374
374
|
width: 1e3,
|
|
375
375
|
height: 1e3
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
smartInvert: !1
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
export const areaLabel = {
|
|
382
|
+
type: "area",
|
|
383
|
+
data: [ {
|
|
384
|
+
text: "",
|
|
385
|
+
data: {}
|
|
386
|
+
} ],
|
|
387
|
+
position: "end",
|
|
388
|
+
overlap: {
|
|
389
|
+
avoidBaseMark: !1,
|
|
390
|
+
clampForce: !1,
|
|
391
|
+
size: {
|
|
392
|
+
width: 1e3,
|
|
393
|
+
height: 1e3
|
|
394
|
+
}
|
|
380
395
|
},
|
|
381
396
|
smartInvert: !1
|
|
382
397
|
};
|
|
@@ -510,6 +525,7 @@ export const defaultComponentTheme = {
|
|
|
510
525
|
dataLabel: dataLabel,
|
|
511
526
|
pointLabel: pointLabel,
|
|
512
527
|
lineLabel: lineLabel,
|
|
528
|
+
areaLabel: areaLabel,
|
|
513
529
|
rectLabel: rectLabel,
|
|
514
530
|
symbolLabel: symbolLabel,
|
|
515
531
|
arcLabel: arcLabel,
|
|
@@ -1 +1 @@
|
|
|
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,W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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"]}
|
|
1
|
+
{"version":3,"sources":["../src/theme/common/component.ts"],"names":[],"mappings":"AA+BA,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;QACp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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 AreaLabelAttrs\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: false,\n clampForce: false,\n size: {\n width: 1000,\n height: 1000\n }\n },\n smartInvert: false\n};\n\nexport const areaLabel: RecursivePartial<AreaLabelAttrs> = {\n type: 'area',\n data: [\n {\n text: '',\n data: {}\n }\n ],\n position: 'end',\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 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 areaLabel,\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/types/element.d.ts
CHANGED
|
@@ -58,6 +58,8 @@ export interface IElement {
|
|
|
58
58
|
getDatum: () => any;
|
|
59
59
|
getBounds: () => any;
|
|
60
60
|
getGraphicItem: () => IGraphic;
|
|
61
|
+
removeGraphicItem: () => void;
|
|
62
|
+
resetGraphicItem: () => void;
|
|
61
63
|
getGraphicAttribute: (channel: string, prev?: boolean) => any;
|
|
62
64
|
setGraphicAttribute: (channel: string, value: any, final?: boolean) => void;
|
|
63
65
|
setGraphicAttributes: (attributes: {
|
package/es/types/element.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/element.ts"],"names":[],"mappings":"","file":"element.js","sourcesContent":["import type {\n IArc,\n IArc3d,\n IArea,\n ICircle,\n IGlyph,\n IGraphic,\n IGroup,\n IImage,\n ILine,\n IPath,\n IPolygon,\n IPyramid3d,\n IRect,\n IRect3d,\n IRichText,\n ISymbol,\n IText\n} from '@visactor/vrender-core';\nimport type { DiffState } from '../graph/enums';\nimport type { IMark, IGlyphMark } from './grammar';\nimport type { BaseEncodeSpec, IMarkConfig, MarkFunctionType, MarkKeySpec, MarkType } from './mark';\n\nexport interface ElementGraphicMap {\n circle: ICircle;\n arc: IArc;\n area: IArea;\n image: IImage;\n line: ILine;\n path: IPath;\n rule: ILine;\n shape: IPath;\n symbol: ISymbol;\n text: IText;\n richtext: IRichText;\n polygon: IPolygon;\n cell: ISymbol;\n interval: IGraphic;\n rect: IRect;\n rect3d: IRect3d;\n arc3d: IArc3d;\n pyramid3d: IPyramid3d;\n group: IGroup;\n glyph: IGlyph;\n linkPath: IGlyph;\n treePath: IGlyph;\n wave: IGlyph;\n ripplePoint: IGlyph;\n barBoxplot: IGlyph;\n boxPlot: IGlyph;\n component: IGroup;\n axis: IGroup;\n legend: IGroup;\n corsshair: IGroup;\n slider: IGroup;\n datazoom: IGroup;\n label: IGroup;\n player: IGroup;\n}\n\nexport type GetGraphicByType<T> = T extends keyof ElementGraphicMap ? ElementGraphicMap[T] : IGraphic;\n\n/**\n * 保存graphicItem状态\n */\nexport interface MarkElementItem {\n /** 唯一key */\n key: string;\n /** 原始数据 */\n datum: any;\n /** VGrammar view */\n view: any;\n /** 当前渲染帧下graphicItem对应的最新属性 */\n nextAttrs?: any;\n /** 是否初始化过,用于解决collection mark对应的item,可能跳过enter状态的问题 */\n // hasEntered: boolean;\n}\nexport interface IElement {\n mark: IMark;\n isReserved: boolean;\n diffState: DiffState;\n key: string;\n groupKey?: string;\n data?: any[];\n /**\n * 不推荐使用,但是collection图元暂时可能回涉及到相关修改\n */\n items: MarkElementItem[];\n\n initGraphicItem: (attrs?: any) => void;\n updateGraphicItem: (config: IMarkConfig) => void;\n\n getDatum: () => any;\n getBounds: () => any;\n getGraphicItem: () => IGraphic;\n\n /**\n * 获取 graphic 视觉通道属性\n * @param channel 视觉通道\n * @param prev 是否从之前的 graphic 属性上获取,默认为 false\n * @returns 视觉通道值\n */\n getGraphicAttribute: (channel: string, prev?: boolean) => any;\n /**\n * 设置 graphic 视觉通道属性\n * @param channel 视觉通道\n * @param value 视觉通道属性\n * @param final 是否更新 graphic 最终变更的视觉通道结果,默认为 false\n */\n setGraphicAttribute: (channel: string, value: any, final?: boolean) => void;\n /**\n * 设置一系列 graphic 视觉通道属性\n * @param attributes 视觉通道键值对\n * @param final 是否更新 graphic 最终变更的视觉通道结果,默认为 false\n */\n setGraphicAttributes: (attributes: { [channel: string]: any }, final?: boolean) => void;\n\n /**\n * 【慎重使用】获取 VGrammar 自身的视觉通道属性\n * 只有在 'afterEncodeItems' 时机的mark transform中才能调用\n */\n getItemAttribute: (channel?: string) => any;\n /**\n * 【慎重使用】设置 VGrammar 自身的视觉通道\n * 只有在 'afterEncodeItems' 时机的mark transform中才能调用\n * @param attributes\n * @returns\n */\n setItemAttributes: (attributes: { [channel: string]: any } | any[]) => void;\n\n // element 执行流程相关接口\n updateData: (groupKey: string, data: any[], keyGenerator: MarkKeySpec, view: any) => void;\n state: (markState: MarkFunctionType<string | string[]>, parameters?: any) => void;\n encodeItems: (items: MarkElementItem[], encoders: BaseEncodeSpec, isReentered?: boolean, parameters?: any) => void;\n encodeGraphic: (attributes?: any) => void;\n transformElementItems: (items: MarkElementItem[], markType: MarkType, computePoints?: boolean) => Record<string, any>;\n remove: () => void;\n release: () => void;\n\n // 动画相关接口\n\n getFinalGraphicAttributes: () => { [key: string]: any };\n getPrevGraphicAttributes: () => { [key: string]: any };\n getNextGraphicAttributes: () => { [key: string]: any };\n clearChangedGraphicAttributes: () => void;\n clearGraphicAttributes: () => void;\n\n // state相关接口\n getStates: () => string[];\n hasState: (state: string) => boolean;\n clearStates: (noAnimation?: boolean) => void;\n addState: (state: string | string[], attrs?: any) => void;\n removeState: (state: string | string[]) => void;\n useStates: (states: string[], noAnimation?: boolean) => void;\n}\n\nexport interface IGlyphElement<P = any> extends IElement {\n mark: IGlyphMark;\n\n getGlyphGraphicItems: () => { [markName: string]: any };\n\n getGraphicAttribute: (channel: string, prev?: boolean, markName?: any) => any;\n setGraphicAttribute: (channel: string, value: any, final?: boolean, markName?: any) => void;\n setGraphicAttributes: (attributes: { [channel: string]: any }, final?: boolean, markName?: any) => void;\n\n getFinalGraphicAttributes: (markName?: string) => { [key: string]: any };\n getPrevGraphicAttributes: (markName?: string) => { [key: string]: any };\n getNextGraphicAttributes: (markName?: string) => { [key: string]: any };\n\n encodeCustom: (nextAttrs?: any) => { [markName: string]: any };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/types/element.ts"],"names":[],"mappings":"","file":"element.js","sourcesContent":["import type {\n IArc,\n IArc3d,\n IArea,\n ICircle,\n IGlyph,\n IGraphic,\n IGroup,\n IImage,\n ILine,\n IPath,\n IPolygon,\n IPyramid3d,\n IRect,\n IRect3d,\n IRichText,\n ISymbol,\n IText\n} from '@visactor/vrender-core';\nimport type { DiffState } from '../graph/enums';\nimport type { IMark, IGlyphMark } from './grammar';\nimport type { BaseEncodeSpec, IMarkConfig, MarkFunctionType, MarkKeySpec, MarkType } from './mark';\n\nexport interface ElementGraphicMap {\n circle: ICircle;\n arc: IArc;\n area: IArea;\n image: IImage;\n line: ILine;\n path: IPath;\n rule: ILine;\n shape: IPath;\n symbol: ISymbol;\n text: IText;\n richtext: IRichText;\n polygon: IPolygon;\n cell: ISymbol;\n interval: IGraphic;\n rect: IRect;\n rect3d: IRect3d;\n arc3d: IArc3d;\n pyramid3d: IPyramid3d;\n group: IGroup;\n glyph: IGlyph;\n linkPath: IGlyph;\n treePath: IGlyph;\n wave: IGlyph;\n ripplePoint: IGlyph;\n barBoxplot: IGlyph;\n boxPlot: IGlyph;\n component: IGroup;\n axis: IGroup;\n legend: IGroup;\n corsshair: IGroup;\n slider: IGroup;\n datazoom: IGroup;\n label: IGroup;\n player: IGroup;\n}\n\nexport type GetGraphicByType<T> = T extends keyof ElementGraphicMap ? ElementGraphicMap[T] : IGraphic;\n\n/**\n * 保存graphicItem状态\n */\nexport interface MarkElementItem {\n /** 唯一key */\n key: string;\n /** 原始数据 */\n datum: any;\n /** VGrammar view */\n view: any;\n /** 当前渲染帧下graphicItem对应的最新属性 */\n nextAttrs?: any;\n /** 是否初始化过,用于解决collection mark对应的item,可能跳过enter状态的问题 */\n // hasEntered: boolean;\n}\nexport interface IElement {\n mark: IMark;\n isReserved: boolean;\n diffState: DiffState;\n key: string;\n groupKey?: string;\n data?: any[];\n /**\n * 不推荐使用,但是collection图元暂时可能回涉及到相关修改\n */\n items: MarkElementItem[];\n\n initGraphicItem: (attrs?: any) => void;\n updateGraphicItem: (config: IMarkConfig) => void;\n\n getDatum: () => any;\n getBounds: () => any;\n getGraphicItem: () => IGraphic;\n removeGraphicItem: () => void;\n resetGraphicItem: () => void;\n\n /**\n * 获取 graphic 视觉通道属性\n * @param channel 视觉通道\n * @param prev 是否从之前的 graphic 属性上获取,默认为 false\n * @returns 视觉通道值\n */\n getGraphicAttribute: (channel: string, prev?: boolean) => any;\n /**\n * 设置 graphic 视觉通道属性\n * @param channel 视觉通道\n * @param value 视觉通道属性\n * @param final 是否更新 graphic 最终变更的视觉通道结果,默认为 false\n */\n setGraphicAttribute: (channel: string, value: any, final?: boolean) => void;\n /**\n * 设置一系列 graphic 视觉通道属性\n * @param attributes 视觉通道键值对\n * @param final 是否更新 graphic 最终变更的视觉通道结果,默认为 false\n */\n setGraphicAttributes: (attributes: { [channel: string]: any }, final?: boolean) => void;\n\n /**\n * 【慎重使用】获取 VGrammar 自身的视觉通道属性\n * 只有在 'afterEncodeItems' 时机的mark transform中才能调用\n */\n getItemAttribute: (channel?: string) => any;\n /**\n * 【慎重使用】设置 VGrammar 自身的视觉通道\n * 只有在 'afterEncodeItems' 时机的mark transform中才能调用\n * @param attributes\n * @returns\n */\n setItemAttributes: (attributes: { [channel: string]: any } | any[]) => void;\n\n // element 执行流程相关接口\n updateData: (groupKey: string, data: any[], keyGenerator: MarkKeySpec, view: any) => void;\n state: (markState: MarkFunctionType<string | string[]>, parameters?: any) => void;\n encodeItems: (items: MarkElementItem[], encoders: BaseEncodeSpec, isReentered?: boolean, parameters?: any) => void;\n encodeGraphic: (attributes?: any) => void;\n transformElementItems: (items: MarkElementItem[], markType: MarkType, computePoints?: boolean) => Record<string, any>;\n remove: () => void;\n release: () => void;\n\n // 动画相关接口\n\n getFinalGraphicAttributes: () => { [key: string]: any };\n getPrevGraphicAttributes: () => { [key: string]: any };\n getNextGraphicAttributes: () => { [key: string]: any };\n clearChangedGraphicAttributes: () => void;\n clearGraphicAttributes: () => void;\n\n // state相关接口\n getStates: () => string[];\n hasState: (state: string) => boolean;\n clearStates: (noAnimation?: boolean) => void;\n addState: (state: string | string[], attrs?: any) => void;\n removeState: (state: string | string[]) => void;\n useStates: (states: string[], noAnimation?: boolean) => void;\n}\n\nexport interface IGlyphElement<P = any> extends IElement {\n mark: IGlyphMark;\n\n getGlyphGraphicItems: () => { [markName: string]: any };\n\n getGraphicAttribute: (channel: string, prev?: boolean, markName?: any) => any;\n setGraphicAttribute: (channel: string, value: any, final?: boolean, markName?: any) => void;\n setGraphicAttributes: (attributes: { [channel: string]: any }, final?: boolean, markName?: any) => void;\n\n getFinalGraphicAttributes: (markName?: string) => { [key: string]: any };\n getPrevGraphicAttributes: (markName?: string) => { [key: string]: any };\n getNextGraphicAttributes: (markName?: string) => { [key: string]: any };\n\n encodeCustom: (nextAttrs?: any) => { [markName: string]: any };\n}\n"]}
|
package/es/types/theme.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IColor } from '@visactor/vrender-core';
|
|
2
|
-
import type { ArcLabelAttrs, BaseLabelAttrs, CircleAxisAttributes, CircleAxisGridAttributes, CircleCrosshairAttrs, ColorLegendAttributes, ContinuousPlayerAttributes, DataLabelAttrs, DataZoomAttributes, DiscreteLegendAttrs, DiscretePlayerAttributes, LineAxisAttributes, LineAxisGridAttributes, LineCrosshairAttrs, LineDataLabelAttrs, LineLabelAttrs, PolygonCrosshairAttrs, RectCrosshairAttrs, RectLabelAttrs, ScrollBarAttributes, SectorCrosshairAttrs, SizeLegendAttributes, SliderAttributes, SymbolLabelAttrs, TitleAttrs, TooltipAttributes } from '@visactor/vrender-components';
|
|
2
|
+
import type { ArcLabelAttrs, BaseLabelAttrs, CircleAxisAttributes, CircleAxisGridAttributes, CircleCrosshairAttrs, ColorLegendAttributes, ContinuousPlayerAttributes, DataLabelAttrs, DataZoomAttributes, DiscreteLegendAttrs, DiscretePlayerAttributes, LineAxisAttributes, LineAxisGridAttributes, LineCrosshairAttrs, LineDataLabelAttrs, LineLabelAttrs, PolygonCrosshairAttrs, RectCrosshairAttrs, RectLabelAttrs, ScrollBarAttributes, SectorCrosshairAttrs, SizeLegendAttributes, SliderAttributes, SymbolLabelAttrs, TitleAttrs, TooltipAttributes, AreaLabelAttrs } from '@visactor/vrender-components';
|
|
3
3
|
import type { IPadding } from '@visactor/vutils';
|
|
4
4
|
import type { RecursivePartial } from './base';
|
|
5
5
|
import type { BasicEncoderSpecMap } from './mark';
|
|
@@ -20,6 +20,7 @@ export interface IComponentTheme {
|
|
|
20
20
|
slider?: RecursivePartial<SliderAttributes>;
|
|
21
21
|
dataLabel?: RecursivePartial<DataLabelAttrs>;
|
|
22
22
|
lineLabel?: RecursivePartial<LineLabelAttrs>;
|
|
23
|
+
areaLabel?: RecursivePartial<AreaLabelAttrs>;
|
|
23
24
|
rectLabel?: RecursivePartial<RectLabelAttrs>;
|
|
24
25
|
arcLabel?: RecursivePartial<ArcLabelAttrs>;
|
|
25
26
|
symbolLabel?: RecursivePartial<SymbolLabelAttrs>;
|
package/es/types/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["import type { IColor } from '@visactor/vrender-core';\nimport type {\n ArcLabelAttrs,\n BaseLabelAttrs,\n CircleAxisAttributes,\n CircleAxisGridAttributes,\n CircleCrosshairAttrs,\n ColorLegendAttributes,\n ContinuousPlayerAttributes,\n DataLabelAttrs,\n DataZoomAttributes,\n DiscreteLegendAttrs,\n DiscretePlayerAttributes,\n LineAxisAttributes,\n LineAxisGridAttributes,\n LineCrosshairAttrs,\n LineDataLabelAttrs,\n LineLabelAttrs,\n PolygonCrosshairAttrs,\n RectCrosshairAttrs,\n RectLabelAttrs,\n ScrollBarAttributes,\n SectorCrosshairAttrs,\n SizeLegendAttributes,\n SliderAttributes,\n SymbolLabelAttrs,\n TitleAttrs,\n TooltipAttributes\n} from '@visactor/vrender-components';\nimport type { IPadding } from '@visactor/vutils';\nimport type { RecursivePartial } from './base';\nimport type { BasicEncoderSpecMap } from './mark';\n\n// glyph mark includes multiple types, not support theme for glyph for now\nexport type IMarkTheme = Partial<Omit<BasicEncoderSpecMap, 'glyph'>>;\n\nexport interface IComponentTheme {\n axis?: RecursivePartial<LineAxisAttributes>;\n circleAxis?: RecursivePartial<CircleAxisAttributes>;\n\n grid?: RecursivePartial<LineAxisGridAttributes>;\n circleGrid?: RecursivePartial<CircleAxisGridAttributes>;\n\n discreteLegend?: RecursivePartial<DiscreteLegendAttrs>;\n colorLegend?: RecursivePartial<ColorLegendAttributes>;\n sizeLegend?: RecursivePartial<SizeLegendAttributes>;\n\n lineCrosshair?: RecursivePartial<LineCrosshairAttrs>;\n rectCrosshair?: RecursivePartial<RectCrosshairAttrs>;\n sectorCrosshair?: RecursivePartial<SectorCrosshairAttrs>;\n circleCrosshair?: RecursivePartial<CircleCrosshairAttrs>;\n polygonCrosshair?: RecursivePartial<PolygonCrosshairAttrs>;\n\n slider?: RecursivePartial<SliderAttributes>;\n\n dataLabel?: RecursivePartial<DataLabelAttrs>;\n lineLabel?: RecursivePartial<LineLabelAttrs>;\n rectLabel?: RecursivePartial<RectLabelAttrs>;\n arcLabel?: RecursivePartial<ArcLabelAttrs>;\n symbolLabel?: RecursivePartial<SymbolLabelAttrs>;\n pointLabel?: RecursivePartial<BaseLabelAttrs>;\n lineDataLabel?: RecursivePartial<LineDataLabelAttrs>;\n\n datazoom?: RecursivePartial<DataZoomAttributes>;\n\n continuousPlayer?: RecursivePartial<ContinuousPlayerAttributes>;\n discretePlayer?: RecursivePartial<DiscretePlayerAttributes>;\n\n tooltip?: RecursivePartial<TooltipAttributes>;\n\n title?: RecursivePartial<TitleAttrs>;\n\n scrollbar?: RecursivePartial<ScrollBarAttributes>;\n}\n\nexport interface ITheme {\n name?: string;\n background?: IColor;\n padding?: IPadding | number;\n palette?: Record<string, IColor[]>;\n marks?: IMarkTheme;\n components?: IComponentTheme;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/types/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["import type { IColor } from '@visactor/vrender-core';\nimport type {\n ArcLabelAttrs,\n BaseLabelAttrs,\n CircleAxisAttributes,\n CircleAxisGridAttributes,\n CircleCrosshairAttrs,\n ColorLegendAttributes,\n ContinuousPlayerAttributes,\n DataLabelAttrs,\n DataZoomAttributes,\n DiscreteLegendAttrs,\n DiscretePlayerAttributes,\n LineAxisAttributes,\n LineAxisGridAttributes,\n LineCrosshairAttrs,\n LineDataLabelAttrs,\n LineLabelAttrs,\n PolygonCrosshairAttrs,\n RectCrosshairAttrs,\n RectLabelAttrs,\n ScrollBarAttributes,\n SectorCrosshairAttrs,\n SizeLegendAttributes,\n SliderAttributes,\n SymbolLabelAttrs,\n TitleAttrs,\n TooltipAttributes,\n AreaLabelAttrs\n} from '@visactor/vrender-components';\nimport type { IPadding } from '@visactor/vutils';\nimport type { RecursivePartial } from './base';\nimport type { BasicEncoderSpecMap } from './mark';\n\n// glyph mark includes multiple types, not support theme for glyph for now\nexport type IMarkTheme = Partial<Omit<BasicEncoderSpecMap, 'glyph'>>;\n\nexport interface IComponentTheme {\n axis?: RecursivePartial<LineAxisAttributes>;\n circleAxis?: RecursivePartial<CircleAxisAttributes>;\n\n grid?: RecursivePartial<LineAxisGridAttributes>;\n circleGrid?: RecursivePartial<CircleAxisGridAttributes>;\n\n discreteLegend?: RecursivePartial<DiscreteLegendAttrs>;\n colorLegend?: RecursivePartial<ColorLegendAttributes>;\n sizeLegend?: RecursivePartial<SizeLegendAttributes>;\n\n lineCrosshair?: RecursivePartial<LineCrosshairAttrs>;\n rectCrosshair?: RecursivePartial<RectCrosshairAttrs>;\n sectorCrosshair?: RecursivePartial<SectorCrosshairAttrs>;\n circleCrosshair?: RecursivePartial<CircleCrosshairAttrs>;\n polygonCrosshair?: RecursivePartial<PolygonCrosshairAttrs>;\n\n slider?: RecursivePartial<SliderAttributes>;\n\n dataLabel?: RecursivePartial<DataLabelAttrs>;\n lineLabel?: RecursivePartial<LineLabelAttrs>;\n areaLabel?: RecursivePartial<AreaLabelAttrs>;\n rectLabel?: RecursivePartial<RectLabelAttrs>;\n arcLabel?: RecursivePartial<ArcLabelAttrs>;\n symbolLabel?: RecursivePartial<SymbolLabelAttrs>;\n pointLabel?: RecursivePartial<BaseLabelAttrs>;\n lineDataLabel?: RecursivePartial<LineDataLabelAttrs>;\n\n datazoom?: RecursivePartial<DataZoomAttributes>;\n\n continuousPlayer?: RecursivePartial<ContinuousPlayerAttributes>;\n discretePlayer?: RecursivePartial<DiscretePlayerAttributes>;\n\n tooltip?: RecursivePartial<TooltipAttributes>;\n\n title?: RecursivePartial<TitleAttrs>;\n\n scrollbar?: RecursivePartial<ScrollBarAttributes>;\n}\n\nexport interface ITheme {\n name?: string;\n background?: IColor;\n padding?: IPadding | number;\n palette?: Record<string, IColor[]>;\n marks?: IMarkTheme;\n components?: IComponentTheme;\n}\n"]}
|
package/es/view/View.js
CHANGED
|
@@ -278,7 +278,9 @@ export default class View extends EventEmitter {
|
|
|
278
278
|
}
|
|
279
279
|
removeAllGraphicItems() {
|
|
280
280
|
return this.traverseMarkTree((mark => {
|
|
281
|
-
mark.graphicItem && removeGraphicItem(mark.graphicItem), mark.
|
|
281
|
+
mark.graphicItem && (removeGraphicItem(mark.graphicItem), mark.elementMap.forEach((element => {
|
|
282
|
+
element.resetGraphicItem();
|
|
283
|
+
})), mark.graphicItem = null);
|
|
282
284
|
})), this;
|
|
283
285
|
}
|
|
284
286
|
parseSpec(spec) {
|