@antv/g2 5.0.0-beta.8 → 5.0.0-beta.9
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/dist/g2-lite.min.js +3 -3
- package/dist/g2.min.js +4 -4
- package/esm/animation/morphing.js +22 -2
- package/esm/animation/morphing.js.map +1 -1
- package/esm/api/chart.d.ts +3 -2
- package/esm/api/chart.js +6 -4
- package/esm/api/chart.js.map +1 -1
- package/esm/api/mark/base.d.ts +1 -1
- package/esm/api/mark/base.js +1 -1
- package/esm/api/mark/base.js.map +1 -1
- package/esm/component/axis.d.ts +5 -7
- package/esm/component/axis.js +126 -98
- package/esm/component/axis.js.map +1 -1
- package/esm/component/axisArc.d.ts +7 -0
- package/esm/component/axisArc.js +9 -0
- package/esm/component/axisArc.js.map +1 -0
- package/esm/component/axisRadar.d.ts +9 -0
- package/esm/component/axisRadar.js +46 -0
- package/esm/component/axisRadar.js.map +1 -0
- package/esm/component/axisX.d.ts +2 -1
- package/esm/component/axisX.js +5 -4
- package/esm/component/axisX.js.map +1 -1
- package/esm/component/axisY.d.ts +1 -1
- package/esm/component/axisY.js +4 -4
- package/esm/component/axisY.js.map +1 -1
- package/esm/component/index.d.ts +8 -0
- package/esm/component/index.js +5 -0
- package/esm/component/index.js.map +1 -1
- package/esm/component/legendCategory.d.ts +5 -3
- package/esm/component/legendCategory.js +80 -36
- package/esm/component/legendCategory.js.map +1 -1
- package/esm/component/legendContinuous.d.ts +3 -2
- package/esm/component/legendContinuous.js +66 -12
- package/esm/component/legendContinuous.js.map +1 -1
- package/esm/component/legendContinuousBlock.d.ts +4 -0
- package/esm/component/legendContinuousBlock.js +6 -0
- package/esm/component/legendContinuousBlock.js.map +1 -0
- package/esm/component/legendContinuousBlockSize.d.ts +4 -0
- package/esm/component/legendContinuousBlockSize.js +6 -0
- package/esm/component/legendContinuousBlockSize.js.map +1 -0
- package/esm/component/legendContinuousSize.d.ts +4 -0
- package/esm/component/legendContinuousSize.js +10 -0
- package/esm/component/legendContinuousSize.js.map +1 -0
- package/esm/component/scrollbar.js +1 -1
- package/esm/component/scrollbar.js.map +1 -1
- package/esm/component/slider.js +1 -1
- package/esm/component/slider.js.map +1 -1
- package/esm/component/title.js +1 -1
- package/esm/component/title.js.map +1 -1
- package/esm/component/utils.d.ts +12 -0
- package/esm/component/utils.js +35 -0
- package/esm/component/utils.js.map +1 -1
- package/esm/composition/facetCircle.js +1 -1
- package/esm/composition/facetCircle.js.map +1 -1
- package/esm/coordinate/index.d.ts +3 -3
- package/esm/coordinate/index.js +3 -3
- package/esm/coordinate/index.js.map +1 -1
- package/esm/coordinate/polar.d.ts +6 -0
- package/esm/coordinate/polar.js +18 -6
- package/esm/coordinate/polar.js.map +1 -1
- package/esm/coordinate/radial.d.ts +6 -0
- package/esm/coordinate/radial.js +17 -5
- package/esm/coordinate/radial.js.map +1 -1
- package/esm/coordinate/theta.d.ts +7 -0
- package/esm/coordinate/theta.js +16 -4
- package/esm/coordinate/theta.js.map +1 -1
- package/esm/interaction/index.d.ts +1 -0
- package/esm/interaction/index.js +1 -0
- package/esm/interaction/index.js.map +1 -1
- package/esm/interaction/native/brushAxisHighlight.js +6 -1
- package/esm/interaction/native/brushAxisHighlight.js.map +1 -1
- package/esm/interaction/native/brushFilter.js +1 -1
- package/esm/interaction/native/brushFilter.js.map +1 -1
- package/esm/interaction/native/legendFilter.d.ts +2 -0
- package/esm/interaction/native/legendFilter.js +19 -3
- package/esm/interaction/native/legendFilter.js.map +1 -1
- package/esm/interaction/native/legendHighlight.js +2 -3
- package/esm/interaction/native/legendHighlight.js.map +1 -1
- package/esm/interaction/native/poptip.d.ts +5 -0
- package/esm/interaction/native/poptip.js +91 -0
- package/esm/interaction/native/poptip.js.map +1 -0
- package/esm/mark/pack.js +0 -1
- package/esm/mark/pack.js.map +1 -1
- package/esm/mark/treemap.js +0 -1
- package/esm/mark/treemap.js.map +1 -1
- package/esm/runtime/component.d.ts +3 -0
- package/esm/runtime/component.js +246 -103
- package/esm/runtime/component.js.map +1 -1
- package/esm/runtime/coordinate.d.ts +11 -0
- package/esm/runtime/coordinate.js +23 -16
- package/esm/runtime/coordinate.js.map +1 -1
- package/esm/runtime/layout.d.ts +1 -1
- package/esm/runtime/layout.js +145 -76
- package/esm/runtime/layout.js.map +1 -1
- package/esm/runtime/plot.js +1 -0
- package/esm/runtime/plot.js.map +1 -1
- package/esm/runtime/scale.d.ts +2 -1
- package/esm/runtime/scale.js +35 -0
- package/esm/runtime/scale.js.map +1 -1
- package/esm/runtime/transform.js +1 -1
- package/esm/runtime/transform.js.map +1 -1
- package/esm/runtime/types/common.d.ts +11 -2
- package/esm/runtime/types/component.d.ts +9 -7
- package/esm/runtime/types/options.d.ts +5 -5
- package/esm/runtime/types/scale.d.ts +18 -0
- package/esm/runtime/types/scale.js +19 -0
- package/esm/runtime/types/scale.js.map +1 -0
- package/esm/runtime/types/theme.d.ts +2 -1
- package/esm/shape/connector/connector.js +1 -1
- package/esm/shape/utils.js.map +1 -1
- package/esm/spec/geometry.d.ts +1 -1
- package/esm/spec/interaction.d.ts +11 -6
- package/esm/stdlib/index.js +3 -3
- package/esm/stdlib/index.js.map +1 -1
- package/esm/theme/academy.js +10 -4
- package/esm/theme/academy.js.map +1 -1
- package/esm/theme/dark.js +10 -4
- package/esm/theme/dark.js.map +1 -1
- package/esm/theme/light.js +12 -4
- package/esm/theme/light.js.map +1 -1
- package/esm/utils/angle.d.ts +2 -0
- package/esm/utils/angle.js +7 -0
- package/esm/utils/angle.js.map +1 -0
- package/esm/utils/array.d.ts +8 -0
- package/esm/utils/array.js +35 -0
- package/esm/utils/array.js.map +1 -1
- package/esm/utils/coordinate.d.ts +4 -0
- package/esm/utils/coordinate.js +19 -0
- package/esm/utils/coordinate.js.map +1 -1
- package/lib/animation/morphing.js +22 -2
- package/lib/animation/morphing.js.map +1 -1
- package/lib/api/chart.d.ts +3 -2
- package/lib/api/chart.js +6 -4
- package/lib/api/chart.js.map +1 -1
- package/lib/api/mark/base.d.ts +1 -1
- package/lib/api/mark/base.js +1 -1
- package/lib/api/mark/base.js.map +1 -1
- package/lib/component/axis.d.ts +5 -7
- package/lib/component/axis.js +127 -100
- package/lib/component/axis.js.map +1 -1
- package/lib/component/axisArc.d.ts +7 -0
- package/lib/component/axisArc.js +13 -0
- package/lib/component/axisArc.js.map +1 -0
- package/lib/component/axisRadar.d.ts +9 -0
- package/lib/component/axisRadar.js +50 -0
- package/lib/component/axisRadar.js.map +1 -0
- package/lib/component/axisX.d.ts +2 -1
- package/lib/component/axisX.js +6 -4
- package/lib/component/axisX.js.map +1 -1
- package/lib/component/axisY.d.ts +1 -1
- package/lib/component/axisY.js +3 -3
- package/lib/component/axisY.js.map +1 -1
- package/lib/component/index.d.ts +8 -0
- package/lib/component/index.js +12 -1
- package/lib/component/index.js.map +1 -1
- package/lib/component/legendCategory.d.ts +5 -3
- package/lib/component/legendCategory.js +79 -35
- package/lib/component/legendCategory.js.map +1 -1
- package/lib/component/legendContinuous.d.ts +3 -2
- package/lib/component/legendContinuous.js +65 -11
- package/lib/component/legendContinuous.js.map +1 -1
- package/lib/component/legendContinuousBlock.d.ts +4 -0
- package/lib/component/legendContinuousBlock.js +10 -0
- package/lib/component/legendContinuousBlock.js.map +1 -0
- package/lib/component/legendContinuousBlockSize.d.ts +4 -0
- package/lib/component/legendContinuousBlockSize.js +10 -0
- package/lib/component/legendContinuousBlockSize.js.map +1 -0
- package/lib/component/legendContinuousSize.d.ts +4 -0
- package/lib/component/legendContinuousSize.js +14 -0
- package/lib/component/legendContinuousSize.js.map +1 -0
- package/lib/component/scrollbar.js +1 -1
- package/lib/component/scrollbar.js.map +1 -1
- package/lib/component/slider.js +1 -1
- package/lib/component/slider.js.map +1 -1
- package/lib/component/title.js +1 -1
- package/lib/component/title.js.map +1 -1
- package/lib/component/utils.d.ts +12 -0
- package/lib/component/utils.js +39 -1
- package/lib/component/utils.js.map +1 -1
- package/lib/composition/facetCircle.js +1 -1
- package/lib/composition/facetCircle.js.map +1 -1
- package/lib/coordinate/index.d.ts +3 -3
- package/lib/coordinate/index.js +4 -1
- package/lib/coordinate/index.js.map +1 -1
- package/lib/coordinate/polar.d.ts +6 -0
- package/lib/coordinate/polar.js +20 -7
- package/lib/coordinate/polar.js.map +1 -1
- package/lib/coordinate/radial.d.ts +6 -0
- package/lib/coordinate/radial.js +19 -6
- package/lib/coordinate/radial.js.map +1 -1
- package/lib/coordinate/theta.d.ts +7 -0
- package/lib/coordinate/theta.js +18 -5
- package/lib/coordinate/theta.js.map +1 -1
- package/lib/interaction/index.d.ts +1 -0
- package/lib/interaction/index.js +3 -1
- package/lib/interaction/index.js.map +1 -1
- package/lib/interaction/native/brushAxisHighlight.js +6 -1
- package/lib/interaction/native/brushAxisHighlight.js.map +1 -1
- package/lib/interaction/native/brushFilter.js +1 -1
- package/lib/interaction/native/brushFilter.js.map +1 -1
- package/lib/interaction/native/legendFilter.d.ts +2 -0
- package/lib/interaction/native/legendFilter.js +22 -4
- package/lib/interaction/native/legendFilter.js.map +1 -1
- package/lib/interaction/native/legendHighlight.js +1 -2
- package/lib/interaction/native/legendHighlight.js.map +1 -1
- package/lib/interaction/native/poptip.d.ts +5 -0
- package/lib/interaction/native/poptip.js +95 -0
- package/lib/interaction/native/poptip.js.map +1 -0
- package/lib/mark/pack.js +0 -1
- package/lib/mark/pack.js.map +1 -1
- package/lib/mark/treemap.js +0 -1
- package/lib/mark/treemap.js.map +1 -1
- package/lib/runtime/component.d.ts +3 -0
- package/lib/runtime/component.js +250 -107
- package/lib/runtime/component.js.map +1 -1
- package/lib/runtime/coordinate.d.ts +11 -0
- package/lib/runtime/coordinate.js +26 -17
- package/lib/runtime/coordinate.js.map +1 -1
- package/lib/runtime/layout.d.ts +1 -1
- package/lib/runtime/layout.js +146 -77
- package/lib/runtime/layout.js.map +1 -1
- package/lib/runtime/plot.js +1 -0
- package/lib/runtime/plot.js.map +1 -1
- package/lib/runtime/scale.d.ts +2 -1
- package/lib/runtime/scale.js +37 -1
- package/lib/runtime/scale.js.map +1 -1
- package/lib/runtime/transform.js +1 -1
- package/lib/runtime/transform.js.map +1 -1
- package/lib/runtime/types/common.d.ts +11 -2
- package/lib/runtime/types/component.d.ts +9 -7
- package/lib/runtime/types/options.d.ts +5 -5
- package/lib/runtime/types/scale.d.ts +18 -0
- package/lib/runtime/types/scale.js +22 -0
- package/lib/runtime/types/scale.js.map +1 -0
- package/lib/runtime/types/theme.d.ts +2 -1
- package/lib/shape/connector/connector.js +1 -1
- package/lib/shape/utils.js.map +1 -1
- package/lib/spec/geometry.d.ts +1 -1
- package/lib/spec/interaction.d.ts +11 -6
- package/lib/stdlib/index.js +1 -1
- package/lib/stdlib/index.js.map +1 -1
- package/lib/theme/academy.js +10 -4
- package/lib/theme/academy.js.map +1 -1
- package/lib/theme/dark.js +10 -4
- package/lib/theme/dark.js.map +1 -1
- package/lib/theme/light.js +12 -4
- package/lib/theme/light.js.map +1 -1
- package/lib/utils/angle.d.ts +2 -0
- package/lib/utils/angle.js +12 -0
- package/lib/utils/angle.js.map +1 -0
- package/lib/utils/array.d.ts +8 -0
- package/lib/utils/array.js +38 -1
- package/lib/utils/array.js.map +1 -1
- package/lib/utils/coordinate.d.ts +4 -0
- package/lib/utils/coordinate.js +24 -1
- package/lib/utils/coordinate.js.map +1 -1
- package/package.json +5 -6
- package/src/animation/morphing.ts +23 -2
- package/src/api/chart.ts +8 -6
- package/src/api/mark/base.ts +1 -1
- package/src/component/axis.ts +199 -125
- package/src/component/axisArc.ts +16 -0
- package/src/component/axisRadar.ts +73 -0
- package/src/component/axisX.ts +7 -4
- package/src/component/axisY.ts +4 -4
- package/src/component/index.ts +8 -0
- package/src/component/legendCategory.ts +156 -35
- package/src/component/legendContinuous.ts +121 -30
- package/src/component/legendContinuousBlock.ts +17 -0
- package/src/component/legendContinuousBlockSize.ts +22 -0
- package/src/component/legendContinuousSize.ts +27 -0
- package/src/component/scrollbar.ts +1 -1
- package/src/component/slider.ts +1 -1
- package/src/component/title.ts +1 -1
- package/src/component/utils.ts +46 -0
- package/src/composition/facetCircle.ts +1 -1
- package/src/coordinate/index.ts +3 -3
- package/src/coordinate/polar.ts +19 -11
- package/src/coordinate/radial.ts +19 -10
- package/src/coordinate/theta.ts +18 -9
- package/src/interaction/index.ts +1 -0
- package/src/interaction/native/brushAxisHighlight.ts +9 -1
- package/src/interaction/native/brushFilter.ts +1 -1
- package/src/interaction/native/legendFilter.ts +21 -3
- package/src/interaction/native/legendHighlight.ts +2 -3
- package/src/interaction/native/poptip.ts +87 -0
- package/src/mark/pack.ts +0 -1
- package/src/mark/treemap.ts +0 -1
- package/src/runtime/component.ts +335 -124
- package/src/runtime/coordinate.ts +29 -16
- package/src/runtime/layout.ts +206 -97
- package/src/runtime/plot.ts +1 -0
- package/src/runtime/scale.ts +41 -0
- package/src/runtime/transform.ts +3 -0
- package/src/runtime/types/common.ts +23 -10
- package/src/runtime/types/component.ts +19 -10
- package/src/runtime/types/options.ts +15 -15
- package/src/runtime/types/scale.ts +20 -0
- package/src/runtime/types/theme.ts +2 -1
- package/src/shape/connector/connector.ts +1 -1
- package/src/shape/utils.ts +2 -0
- package/src/spec/geometry.ts +3 -1
- package/src/spec/interaction.ts +16 -8
- package/src/stdlib/index.ts +14 -0
- package/src/theme/academy.ts +10 -4
- package/src/theme/dark.ts +10 -4
- package/src/theme/light.ts +12 -4
- package/src/utils/angle.ts +7 -0
- package/src/utils/array.ts +39 -0
- package/src/utils/coordinate.ts +29 -0
- package/src/.DS_Store +0 -0
- package/src/data/.DS_Store +0 -0
- package/src/shape/.DS_Store +0 -0
package/src/runtime/layout.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { Coordinate } from '@antv/coord';
|
|
2
|
-
import {
|
|
2
|
+
import { ascending, group } from 'd3-array';
|
|
3
|
+
import { isParallel, isPolar, isRadar, radiusOf } from '../utils/coordinate';
|
|
3
4
|
import { capitalizeFirst } from '../utils/helper';
|
|
5
|
+
import { divide } from '../utils/array';
|
|
4
6
|
import {
|
|
5
|
-
GuideComponentPosition,
|
|
6
|
-
|
|
7
|
+
GuideComponentPosition as GCP,
|
|
8
|
+
GuideComponentOrientation as GCO,
|
|
7
9
|
Layout,
|
|
10
|
+
Section,
|
|
8
11
|
SectionArea,
|
|
9
12
|
} from './types/common';
|
|
10
|
-
import {
|
|
13
|
+
import { G2GuideComponentOptions, G2View } from './types/options';
|
|
11
14
|
|
|
12
15
|
export function computeLayout(
|
|
13
16
|
components: G2GuideComponentOptions[],
|
|
@@ -31,6 +34,7 @@ export function computeLayout(
|
|
|
31
34
|
marginTop = margin,
|
|
32
35
|
marginRight = margin,
|
|
33
36
|
} = options;
|
|
37
|
+
|
|
34
38
|
return {
|
|
35
39
|
...padding,
|
|
36
40
|
width,
|
|
@@ -57,11 +61,15 @@ function computePadding(
|
|
|
57
61
|
components: G2GuideComponentOptions[],
|
|
58
62
|
options: G2View,
|
|
59
63
|
) {
|
|
60
|
-
const positions:
|
|
64
|
+
const positions: GCP[] = [
|
|
61
65
|
'left',
|
|
62
66
|
'right',
|
|
63
67
|
'top',
|
|
64
68
|
'bottom',
|
|
69
|
+
'top-left',
|
|
70
|
+
'top-right',
|
|
71
|
+
'bottom-left',
|
|
72
|
+
'bottom-right',
|
|
65
73
|
];
|
|
66
74
|
const positionComponents = group(components, (d) => d.position);
|
|
67
75
|
const {
|
|
@@ -119,40 +127,179 @@ export function placeComponents(
|
|
|
119
127
|
const pb = paddingBottom + marginBottom;
|
|
120
128
|
|
|
121
129
|
const section: Section = {
|
|
122
|
-
top: [pl, 0, innerWidth, pt,
|
|
123
|
-
right: [width - pr, pt, pr, innerHeight,
|
|
124
|
-
bottom: [pl, height - pb, innerWidth, pb,
|
|
125
|
-
left: [0, pt, pl, innerHeight,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
top: [pl, 0, innerWidth, pt, 'vertical', true, ascending],
|
|
131
|
+
right: [width - pr, pt, pr, innerHeight, 'horizontal', false, ascending],
|
|
132
|
+
bottom: [pl, height - pb, innerWidth, pb, 'vertical', false, ascending],
|
|
133
|
+
left: [0, pt, pl, innerHeight, 'horizontal', true, ascending],
|
|
134
|
+
'top-left': [pl, 0, innerWidth, pt, 'vertical', true, ascending],
|
|
135
|
+
'top-right': [pl, 0, innerWidth, pt, 'vertical', true, ascending],
|
|
136
|
+
'bottom-left': [
|
|
137
|
+
pl,
|
|
138
|
+
height - pb,
|
|
139
|
+
innerWidth,
|
|
140
|
+
pb,
|
|
141
|
+
'vertical',
|
|
142
|
+
false,
|
|
143
|
+
ascending,
|
|
144
|
+
],
|
|
145
|
+
'bottom-right': [
|
|
146
|
+
pl,
|
|
147
|
+
height - pb,
|
|
148
|
+
innerWidth,
|
|
149
|
+
pb,
|
|
150
|
+
'vertical',
|
|
151
|
+
false,
|
|
152
|
+
ascending,
|
|
153
|
+
],
|
|
154
|
+
center: [pl, pt, innerWidth, innerHeight, 'center', null, null],
|
|
155
|
+
inner: [pl, pt, innerWidth, innerHeight, 'center', null, null],
|
|
156
|
+
outer: [pl, pt, innerWidth, innerHeight, 'center', null, null],
|
|
133
157
|
};
|
|
158
|
+
for (const [position, components] of positionComponents.entries()) {
|
|
159
|
+
const area = section[position];
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* @description non-entity components: axis in the center, inner, outer, component in the center
|
|
163
|
+
* @description entity components: other components
|
|
164
|
+
* @description no volumn components take up no extra space
|
|
165
|
+
*/
|
|
166
|
+
|
|
167
|
+
const [nonEntityComponents, entityComponents] = divide(
|
|
168
|
+
components,
|
|
169
|
+
(component) => {
|
|
170
|
+
if (typeof component.type !== 'string') return false;
|
|
171
|
+
if (position === 'center') return true;
|
|
172
|
+
if (
|
|
173
|
+
component.type.startsWith('axis') &&
|
|
174
|
+
['inner', 'outer'].includes(position)
|
|
175
|
+
) {
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
return false;
|
|
179
|
+
},
|
|
180
|
+
);
|
|
134
181
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
} else if (key === 'centerHorizontal') {
|
|
140
|
-
placeCenterHorizontal(components, coordinate, area);
|
|
141
|
-
} else if (key === 'arc') {
|
|
142
|
-
placeArc(components, coordinate, area);
|
|
143
|
-
} else if (key === 'arcY') {
|
|
144
|
-
placeArcY(components, coordinate, area);
|
|
145
|
-
} else if (key === 'arcInner') {
|
|
146
|
-
placeArcInner(components, coordinate, area);
|
|
147
|
-
} else if (key === 'arcCenter') {
|
|
148
|
-
placeArcCenter(components, coordinate, area);
|
|
149
|
-
} else {
|
|
182
|
+
if (nonEntityComponents.length) {
|
|
183
|
+
placeNonEntityComponents(nonEntityComponents, coordinate, area, position);
|
|
184
|
+
}
|
|
185
|
+
if (entityComponents.length) {
|
|
150
186
|
placePaddingArea(components, coordinate, area);
|
|
151
187
|
}
|
|
152
188
|
}
|
|
153
189
|
}
|
|
154
190
|
|
|
155
|
-
function
|
|
191
|
+
function placeNonEntityComponents(
|
|
192
|
+
components: G2GuideComponentOptions[],
|
|
193
|
+
coordinate: Coordinate,
|
|
194
|
+
area: SectionArea,
|
|
195
|
+
position: GCP,
|
|
196
|
+
) {
|
|
197
|
+
const [axisComponents, nonAxisComponents] = divide(
|
|
198
|
+
components,
|
|
199
|
+
(component) => {
|
|
200
|
+
if (
|
|
201
|
+
typeof component.type === 'string' &&
|
|
202
|
+
component.type.startsWith('axis')
|
|
203
|
+
) {
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
206
|
+
return false;
|
|
207
|
+
},
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
placeNonEntityAxis(axisComponents, coordinate, area, position);
|
|
211
|
+
// in current stage, only legend component which located in the center can be placed
|
|
212
|
+
placeCenter(nonAxisComponents, coordinate, area);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function placeNonEntityAxis(
|
|
216
|
+
components: G2GuideComponentOptions[],
|
|
217
|
+
coordinate: Coordinate,
|
|
218
|
+
area: SectionArea,
|
|
219
|
+
position: GCP,
|
|
220
|
+
) {
|
|
221
|
+
if (position === 'center') {
|
|
222
|
+
if (isRadar(coordinate)) {
|
|
223
|
+
placeAxisRadar(components, coordinate, area, position);
|
|
224
|
+
} else if (isPolar(coordinate)) {
|
|
225
|
+
placeArcLinear(components, coordinate, area);
|
|
226
|
+
} else if (isParallel(coordinate)) {
|
|
227
|
+
placeAxisParallel(
|
|
228
|
+
components,
|
|
229
|
+
coordinate,
|
|
230
|
+
area,
|
|
231
|
+
components[0].orientation, // assume that all components have the same orientation
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
} else if (position === 'inner') {
|
|
235
|
+
placeAxisArcInner(components, coordinate, area);
|
|
236
|
+
} else if (position === 'outer') {
|
|
237
|
+
placeAxisArcOuter(components, coordinate, area);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function placeAxisArcInner(
|
|
242
|
+
components: G2GuideComponentOptions[],
|
|
243
|
+
coordinate: Coordinate,
|
|
244
|
+
area: SectionArea,
|
|
245
|
+
) {
|
|
246
|
+
const [x, y, , height] = area;
|
|
247
|
+
const [cx, cy] = coordinate.getCenter();
|
|
248
|
+
const [innerRadius] = radiusOf(coordinate);
|
|
249
|
+
const r = height / 2;
|
|
250
|
+
const size = innerRadius * r;
|
|
251
|
+
const x0 = cx - size;
|
|
252
|
+
const y0 = cy - size;
|
|
253
|
+
for (let i = 0; i < components.length; i++) {
|
|
254
|
+
const component = components[i];
|
|
255
|
+
component.bbox = {
|
|
256
|
+
x: x + x0,
|
|
257
|
+
y: y + y0,
|
|
258
|
+
width: size * 2,
|
|
259
|
+
height: size * 2,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
function placeAxisArcOuter(
|
|
265
|
+
components: G2GuideComponentOptions[],
|
|
266
|
+
coordinate: Coordinate,
|
|
267
|
+
area: SectionArea,
|
|
268
|
+
) {
|
|
269
|
+
const [x, y, width, height] = area;
|
|
270
|
+
for (const component of components) {
|
|
271
|
+
component.bbox = { x, y, width, height };
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* @example arcX, arcY, axisLinear with angle
|
|
277
|
+
*/
|
|
278
|
+
function placeArcLinear(
|
|
279
|
+
components: G2GuideComponentOptions[],
|
|
280
|
+
coordinate: Coordinate,
|
|
281
|
+
area: SectionArea,
|
|
282
|
+
) {
|
|
283
|
+
const [x, y, width, height] = area;
|
|
284
|
+
for (const component of components) {
|
|
285
|
+
component.bbox = { x: x, y, width, height };
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function placeAxisParallel(
|
|
290
|
+
components: G2GuideComponentOptions[],
|
|
291
|
+
coordinate: Coordinate,
|
|
292
|
+
area: SectionArea,
|
|
293
|
+
orientation: GCO,
|
|
294
|
+
) {
|
|
295
|
+
if (orientation === 'horizontal') {
|
|
296
|
+
placeAxisParallelHorizontal(components, coordinate, area);
|
|
297
|
+
} else if (orientation === 'vertical') {
|
|
298
|
+
placeAxisParallelVertical(components, coordinate, area);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function placeAxisParallelVertical(
|
|
156
303
|
components: G2GuideComponentOptions[],
|
|
157
304
|
coordinate: Coordinate,
|
|
158
305
|
area: SectionArea,
|
|
@@ -177,7 +324,7 @@ function placeCenterVertical(
|
|
|
177
324
|
}
|
|
178
325
|
}
|
|
179
326
|
|
|
180
|
-
function
|
|
327
|
+
function placeAxisParallelHorizontal(
|
|
181
328
|
components: G2GuideComponentOptions[],
|
|
182
329
|
coordinate: Coordinate,
|
|
183
330
|
area: SectionArea,
|
|
@@ -200,13 +347,31 @@ function placeCenterHorizontal(
|
|
|
200
347
|
const height = Y[i + 1] - y;
|
|
201
348
|
component.bbox = { x, y, width, height };
|
|
202
349
|
}
|
|
350
|
+
|
|
351
|
+
// override style
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
function placeAxisRadar(
|
|
355
|
+
components: G2GuideComponentOptions[],
|
|
356
|
+
coordinate: Coordinate,
|
|
357
|
+
area: SectionArea,
|
|
358
|
+
position: GCP,
|
|
359
|
+
) {
|
|
360
|
+
const [x, y, width, height] = area;
|
|
361
|
+
for (const component of components) {
|
|
362
|
+
component.bbox = { x, y, width, height };
|
|
363
|
+
component.radar = {
|
|
364
|
+
index: components.indexOf(component),
|
|
365
|
+
count: components.length,
|
|
366
|
+
};
|
|
367
|
+
}
|
|
203
368
|
}
|
|
204
369
|
|
|
205
370
|
function placePaddingArea(
|
|
206
371
|
components: G2GuideComponentOptions[],
|
|
207
372
|
coordinate: Coordinate,
|
|
208
373
|
area: SectionArea,
|
|
209
|
-
)
|
|
374
|
+
) {
|
|
210
375
|
const [x, y, width, height, direction, reverse, comparator] = area;
|
|
211
376
|
const [
|
|
212
377
|
mainStartKey,
|
|
@@ -218,13 +383,13 @@ function placePaddingArea(
|
|
|
218
383
|
crossSizeKey,
|
|
219
384
|
crossSizeValue,
|
|
220
385
|
] =
|
|
221
|
-
direction ===
|
|
386
|
+
direction === 'vertical'
|
|
222
387
|
? ['y', y, 'x', x, 'height', height, 'width', width]
|
|
223
388
|
: ['x', x, 'y', y, 'width', width, 'height', height];
|
|
224
389
|
|
|
225
390
|
// Sort components by order.
|
|
226
391
|
// The smaller the order, the closer to center.
|
|
227
|
-
components.sort((a, b) => comparator(a.order, b.order));
|
|
392
|
+
components.sort((a, b) => comparator?.(a.order, b.order));
|
|
228
393
|
|
|
229
394
|
const startValue = reverse ? mainStartValue + mainSizeValue : mainStartValue;
|
|
230
395
|
for (let i = 0, start = startValue; i < components.length; i++) {
|
|
@@ -240,40 +405,15 @@ function placePaddingArea(
|
|
|
240
405
|
}
|
|
241
406
|
}
|
|
242
407
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
) {
|
|
248
|
-
const [x, y, width, height] = area;
|
|
249
|
-
for (let i = 0; i < components.length; i++) {
|
|
250
|
-
const component = components[i];
|
|
251
|
-
component.bbox = { x, y, width, height };
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
function placeArcY(
|
|
256
|
-
components: G2GuideComponentOptions[],
|
|
257
|
-
coordinate: Coordinate,
|
|
258
|
-
area: SectionArea,
|
|
259
|
-
) {
|
|
260
|
-
const [x, y, , height] = area;
|
|
261
|
-
const [cx, cy] = coordinate.getCenter();
|
|
262
|
-
const [innerRadius, outerRadius] = radiusOf(coordinate);
|
|
263
|
-
const r = height / 2;
|
|
264
|
-
const y0 = cy - outerRadius * r;
|
|
265
|
-
const h = (outerRadius - innerRadius) * r;
|
|
266
|
-
for (let i = 0; i < components.length; i++) {
|
|
267
|
-
const component = components[i];
|
|
268
|
-
component.bbox = { x: cx + x, y: y0 + y, width: 0, height: h };
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
function placeArcCenter(
|
|
408
|
+
/**
|
|
409
|
+
* @example legend in the center of radial or polar system
|
|
410
|
+
*/
|
|
411
|
+
function placeCenter(
|
|
273
412
|
components: G2GuideComponentOptions[],
|
|
274
413
|
coordinate: Coordinate,
|
|
275
414
|
area: SectionArea,
|
|
276
415
|
) {
|
|
416
|
+
if (components.length === 0) return;
|
|
277
417
|
const [x, y, width, height] = area;
|
|
278
418
|
const [innerRadius] = radiusOf(coordinate);
|
|
279
419
|
const r = ((height / 2) * innerRadius) / Math.sqrt(2);
|
|
@@ -284,34 +424,3 @@ function placeArcCenter(
|
|
|
284
424
|
component.bbox = { x: cx - r, y: cy - r, width: r * 2, height: r * 2 };
|
|
285
425
|
}
|
|
286
426
|
}
|
|
287
|
-
|
|
288
|
-
function placeArcInner(
|
|
289
|
-
components: G2GuideComponentOptions[],
|
|
290
|
-
coordinate: Coordinate,
|
|
291
|
-
area: SectionArea,
|
|
292
|
-
) {
|
|
293
|
-
const [x, y, , height] = area;
|
|
294
|
-
const [cx, cy] = coordinate.getCenter();
|
|
295
|
-
const [innerRadius] = radiusOf(coordinate);
|
|
296
|
-
const r = height / 2;
|
|
297
|
-
const size = innerRadius * r;
|
|
298
|
-
const x0 = cx - size;
|
|
299
|
-
const y0 = cy - size;
|
|
300
|
-
for (let i = 0; i < components.length; i++) {
|
|
301
|
-
const component = components[i];
|
|
302
|
-
component.bbox = {
|
|
303
|
-
x: x + x0,
|
|
304
|
-
y: y + y0,
|
|
305
|
-
width: size * 2,
|
|
306
|
-
height: size * 2,
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
function radiusOf(coordinate: Coordinate): [number, number] {
|
|
312
|
-
const { transformations } = coordinate.getOptions();
|
|
313
|
-
const [, , , innerRadius, outerRadius] = transformations.find(
|
|
314
|
-
(d) => d[0] === 'polar',
|
|
315
|
-
);
|
|
316
|
-
return [innerRadius as number, outerRadius as number];
|
|
317
|
-
}
|
package/src/runtime/plot.ts
CHANGED
package/src/runtime/scale.ts
CHANGED
|
@@ -234,6 +234,7 @@ function inferScaleRange(
|
|
|
234
234
|
case 'linear':
|
|
235
235
|
case 'time':
|
|
236
236
|
case 'log':
|
|
237
|
+
case 'pow':
|
|
237
238
|
case 'sqrt': {
|
|
238
239
|
const colors = categoricalColors(values, options, domain, theme, library);
|
|
239
240
|
const [r0, r1] = inferRangeQ(name, colors);
|
|
@@ -498,3 +499,43 @@ export function isPosition(name: string): boolean {
|
|
|
498
499
|
name === 'exitDuration'
|
|
499
500
|
);
|
|
500
501
|
}
|
|
502
|
+
|
|
503
|
+
export function isValidScale(scale: G2ScaleOptions) {
|
|
504
|
+
if (!scale || !scale.type) return false;
|
|
505
|
+
if (typeof scale.type === 'function') return true;
|
|
506
|
+
const { type, domain, range, interpolator } = scale;
|
|
507
|
+
const isValidDomain = domain && domain.length > 0;
|
|
508
|
+
const isValidRange = range && range.length > 0;
|
|
509
|
+
|
|
510
|
+
if (
|
|
511
|
+
[
|
|
512
|
+
'linear',
|
|
513
|
+
'sqrt',
|
|
514
|
+
'log',
|
|
515
|
+
'time',
|
|
516
|
+
'pow',
|
|
517
|
+
'threshold',
|
|
518
|
+
'quantize',
|
|
519
|
+
'quantile',
|
|
520
|
+
'ordinal',
|
|
521
|
+
'band',
|
|
522
|
+
'point',
|
|
523
|
+
].includes(type) &&
|
|
524
|
+
isValidDomain &&
|
|
525
|
+
isValidRange
|
|
526
|
+
) {
|
|
527
|
+
return true;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
if (
|
|
531
|
+
['sequential'].includes(type) &&
|
|
532
|
+
isValidDomain &&
|
|
533
|
+
(isValidRange || interpolator)
|
|
534
|
+
) {
|
|
535
|
+
return true;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
if (['constant', 'identity'].includes(type) && isValidRange) return true;
|
|
539
|
+
|
|
540
|
+
return false;
|
|
541
|
+
}
|
package/src/runtime/transform.ts
CHANGED
|
@@ -174,6 +174,9 @@ export function addGuideToScale(
|
|
|
174
174
|
),
|
|
175
175
|
color: { guide: normalize(legend, 'color') },
|
|
176
176
|
size: { guide: normalize(legend, 'size') },
|
|
177
|
+
shape: { guide: normalize(legend, 'shape') },
|
|
178
|
+
// fixme: opacity is conflict with DisplayObject.opacity
|
|
179
|
+
// opacity: { guide: normalize(legend, 'opacity') },
|
|
177
180
|
},
|
|
178
181
|
});
|
|
179
182
|
return [I, mark];
|
|
@@ -127,18 +127,24 @@ export type BBox = {
|
|
|
127
127
|
height?: number;
|
|
128
128
|
};
|
|
129
129
|
|
|
130
|
-
export type
|
|
130
|
+
export type GuidePrimitivePosition =
|
|
131
131
|
| 'top'
|
|
132
|
-
| 'left'
|
|
133
132
|
| 'bottom'
|
|
133
|
+
| 'left'
|
|
134
134
|
| 'right'
|
|
135
|
-
| 'centerVertical'
|
|
136
|
-
| 'centerHorizontal'
|
|
137
135
|
| 'center'
|
|
138
|
-
| '
|
|
139
|
-
| '
|
|
140
|
-
|
|
141
|
-
| '
|
|
136
|
+
| 'inner'
|
|
137
|
+
| 'outer';
|
|
138
|
+
export type GuideCompositePosition =
|
|
139
|
+
| 'top-left'
|
|
140
|
+
| 'top-right'
|
|
141
|
+
| 'bottom-left'
|
|
142
|
+
| 'bottom-right';
|
|
143
|
+
export type GuideComponentPosition =
|
|
144
|
+
| GuidePrimitivePosition
|
|
145
|
+
| GuideCompositePosition;
|
|
146
|
+
|
|
147
|
+
export type GuideComponentOrientation = 'horizontal' | 'vertical' | number;
|
|
142
148
|
|
|
143
149
|
export type Layout = {
|
|
144
150
|
paddingLeft?: number;
|
|
@@ -162,13 +168,20 @@ export type Layout = {
|
|
|
162
168
|
y?: number;
|
|
163
169
|
};
|
|
164
170
|
|
|
165
|
-
|
|
171
|
+
export type Direction = 'horizontal' | 'vertical' | 'center';
|
|
172
|
+
|
|
173
|
+
export type FlexLayout = {
|
|
174
|
+
flexDirection?: 'row' | 'column';
|
|
175
|
+
justifyContent?: 'flex-start' | 'flex-end' | 'center';
|
|
176
|
+
alignItems?: 'flex-start' | 'flex-end' | 'center';
|
|
177
|
+
};
|
|
178
|
+
|
|
166
179
|
export type SectionArea = [
|
|
167
180
|
x: number,
|
|
168
181
|
y: number,
|
|
169
182
|
width: number,
|
|
170
183
|
height: number,
|
|
171
|
-
direction:
|
|
184
|
+
direction: Direction,
|
|
172
185
|
reverse: boolean,
|
|
173
186
|
comparator: (a: Primitive, b: Primitive) => number,
|
|
174
187
|
];
|
|
@@ -1,18 +1,25 @@
|
|
|
1
|
+
import { Coordinate, Transformation } from '@antv/coord';
|
|
1
2
|
import { DisplayObject, IAnimation as GAnimation } from '@antv/g';
|
|
2
|
-
import { Transformation, Coordinate } from '@antv/coord';
|
|
3
3
|
import {
|
|
4
|
-
|
|
4
|
+
G2View,
|
|
5
|
+
G2GuideComponentOptions,
|
|
6
|
+
G2CoordinateOptions,
|
|
7
|
+
G2ScaleOptions,
|
|
8
|
+
G2ViewTree,
|
|
9
|
+
} from './options';
|
|
10
|
+
import {
|
|
5
11
|
G2Theme,
|
|
6
|
-
|
|
12
|
+
G2ViewInstance,
|
|
7
13
|
GuideComponentPosition,
|
|
14
|
+
GuideComponentOrientation,
|
|
15
|
+
IndexedValue,
|
|
8
16
|
Layout,
|
|
9
|
-
|
|
17
|
+
Vector2,
|
|
10
18
|
} from './common';
|
|
11
|
-
import { G2ViewTree } from './options';
|
|
12
|
-
import { EncodeComponent, Encode } from './encode';
|
|
13
|
-
import { MarkComponent, Mark } from './mark';
|
|
14
|
-
import { TransformComponent, Transform } from './transform';
|
|
15
19
|
import { DataComponent } from './data';
|
|
20
|
+
import { Encode, EncodeComponent } from './encode';
|
|
21
|
+
import { Mark, MarkComponent } from './mark';
|
|
22
|
+
import { Transform, TransformComponent } from './transform';
|
|
16
23
|
|
|
17
24
|
export type G2ComponentNamespaces =
|
|
18
25
|
| 'coordinate'
|
|
@@ -156,15 +163,17 @@ export type ThemeComponent<O = Record<string, unknown>> = G2BaseComponent<
|
|
|
156
163
|
>;
|
|
157
164
|
|
|
158
165
|
export type GuideComponent = (
|
|
159
|
-
|
|
166
|
+
scales: Scale[],
|
|
160
167
|
style: Record<string, any>,
|
|
161
168
|
coordinate: Coordinate,
|
|
162
169
|
theme: G2Theme,
|
|
163
170
|
) => DisplayObject;
|
|
164
171
|
export type GuideComponentProps = {
|
|
165
|
-
defaultPosition
|
|
172
|
+
defaultPosition?: GuideComponentPosition;
|
|
173
|
+
defaultOrientation?: GuideComponentOrientation;
|
|
166
174
|
defaultSize: number;
|
|
167
175
|
defaultOrder: number;
|
|
176
|
+
[key: string]: any;
|
|
168
177
|
};
|
|
169
178
|
export type GuideComponentComponent<O = Record<string, unknown>> =
|
|
170
179
|
G2BaseComponent<GuideComponent, O, GuideComponentProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, IAnimation as GAnimation } from '@antv/g';
|
|
2
|
-
import type { DisplayObject } from '@antv/g';
|
|
3
1
|
import EventEmitter from '@antv/event-emitter';
|
|
2
|
+
import type { DisplayObject } from '@antv/g';
|
|
3
|
+
import { Canvas, IAnimation as GAnimation } from '@antv/g';
|
|
4
4
|
import {
|
|
5
5
|
G2Title,
|
|
6
6
|
G2ViewDescriptor,
|
|
@@ -9,28 +9,28 @@ import {
|
|
|
9
9
|
Primitive,
|
|
10
10
|
} from './common';
|
|
11
11
|
import {
|
|
12
|
+
AdjustComponent,
|
|
13
|
+
AnimationComponent,
|
|
14
|
+
CompositionComponent,
|
|
15
|
+
CoordinateComponent,
|
|
12
16
|
G2BaseComponent,
|
|
13
|
-
StatisticComponent,
|
|
14
|
-
ThemeComponent,
|
|
15
17
|
G2ComponentNamespaces,
|
|
16
|
-
CoordinateComponent,
|
|
17
|
-
ScaleComponent,
|
|
18
|
-
InferComponent,
|
|
19
|
-
ShapeComponent,
|
|
20
|
-
PaletteComponent,
|
|
21
18
|
GuideComponentComponent,
|
|
22
|
-
|
|
19
|
+
InferComponent,
|
|
23
20
|
InteractionComponent,
|
|
24
|
-
CompositionComponent,
|
|
25
|
-
AdjustComponent,
|
|
26
|
-
Scale,
|
|
27
21
|
LabelTransformComponent,
|
|
22
|
+
PaletteComponent,
|
|
23
|
+
Scale,
|
|
24
|
+
ScaleComponent,
|
|
25
|
+
ShapeComponent,
|
|
26
|
+
StatisticComponent,
|
|
27
|
+
ThemeComponent,
|
|
28
28
|
} from './component';
|
|
29
29
|
|
|
30
|
-
import {
|
|
30
|
+
import { DataComponent } from './data';
|
|
31
31
|
import { EncodeComponent } from './encode';
|
|
32
32
|
import { MarkComponent } from './mark';
|
|
33
|
-
import {
|
|
33
|
+
import { TransformComponent } from './transform';
|
|
34
34
|
|
|
35
35
|
export type G2ViewTree = {
|
|
36
36
|
width?: number;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const ContinuousScale = {
|
|
2
|
+
linear: 'linear',
|
|
3
|
+
identity: 'identity',
|
|
4
|
+
log: 'log',
|
|
5
|
+
pow: 'pow',
|
|
6
|
+
sqrt: 'sqrt',
|
|
7
|
+
sequential: 'sequential',
|
|
8
|
+
} as const;
|
|
9
|
+
|
|
10
|
+
export const DistributionScale = {
|
|
11
|
+
threshold: 'threshold',
|
|
12
|
+
quantize: 'quantize',
|
|
13
|
+
quantile: 'quantile',
|
|
14
|
+
} as const;
|
|
15
|
+
|
|
16
|
+
export const DiscreteScale = {
|
|
17
|
+
ordinal: 'ordinal',
|
|
18
|
+
band: 'band',
|
|
19
|
+
point: 'point',
|
|
20
|
+
} as const;
|
|
@@ -70,11 +70,12 @@ type InteractionTheme = {
|
|
|
70
70
|
|
|
71
71
|
type ComponentTheme = {
|
|
72
72
|
axis?: any;
|
|
73
|
-
|
|
73
|
+
axisLinear?: any;
|
|
74
74
|
axisTop?: any;
|
|
75
75
|
axisBottom?: any;
|
|
76
76
|
axisLeft?: any;
|
|
77
77
|
axisRight?: any;
|
|
78
|
+
axisRadar?: any;
|
|
78
79
|
legend?: any;
|
|
79
80
|
continuousLegend?: any;
|
|
80
81
|
label?: LabelStyleProps;
|
package/src/shape/utils.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Path } from '@antv/g';
|
|
1
2
|
import { Path as D3Path } from 'd3-path';
|
|
2
3
|
import { extent } from 'd3-array';
|
|
3
4
|
import { Coordinate } from '@antv/coord';
|
|
@@ -8,6 +9,7 @@ import { isPolar, isTranspose } from '../utils/coordinate';
|
|
|
8
9
|
import { angle, angleWithQuadrant, dist, sub } from '../utils/vector';
|
|
9
10
|
import { Selection } from '../utils/selection';
|
|
10
11
|
import { indexOf } from '../utils/array';
|
|
12
|
+
import * as Symbols from './point/symbol';
|
|
11
13
|
|
|
12
14
|
type A = ['a' | 'A', number, number, number, number, number, number, number];
|
|
13
15
|
type C = ['c' | 'C', number, number, number, number, number, number];
|
package/src/spec/geometry.ts
CHANGED
|
@@ -126,7 +126,9 @@ export type BaseGeometry<
|
|
|
126
126
|
Record<'x' | 'y' | 'position' | `position${number}`, Axis | boolean>
|
|
127
127
|
>
|
|
128
128
|
| boolean;
|
|
129
|
-
legend?:
|
|
129
|
+
legend?:
|
|
130
|
+
| Partial<Record<'size' | 'color' | 'shape' | 'opacity', Legend | boolean>>
|
|
131
|
+
| boolean;
|
|
130
132
|
slider?: Partial<Record<'x' | 'y', any>>;
|
|
131
133
|
scrollbar?: Partial<Record<'x' | 'y', any>>;
|
|
132
134
|
coordinates?: Coordinate[];
|