@antv/g2 5.0.0-beta.5 → 5.0.0-beta.6
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 +4 -4
- package/dist/g2.min.js +4 -4
- package/esm/api/chart.d.ts +4 -0
- package/esm/api/chart.js +26 -4
- package/esm/api/chart.js.map +1 -1
- package/esm/api/mark/mark.js +1 -0
- package/esm/api/mark/mark.js.map +1 -1
- package/esm/api/mark/types.d.ts +1 -0
- package/esm/component/axis.js +18 -5
- package/esm/component/axis.js.map +1 -1
- package/esm/component/index.d.ts +2 -0
- package/esm/component/index.js +2 -0
- package/esm/component/index.js.map +1 -1
- package/esm/component/scrollbar.d.ts +9 -0
- package/esm/component/scrollbar.js +36 -0
- package/esm/component/scrollbar.js.map +1 -0
- package/esm/component/scrollbarX.d.ts +7 -0
- package/esm/component/scrollbarX.js +9 -0
- package/esm/component/scrollbarX.js.map +1 -0
- package/esm/component/scrollbarY.d.ts +7 -0
- package/esm/component/scrollbarY.js +9 -0
- package/esm/component/scrollbarY.js.map +1 -0
- package/esm/component/title.js +46 -22
- package/esm/component/title.js.map +1 -1
- package/esm/data/fold.js +4 -10
- package/esm/data/fold.js.map +1 -1
- package/esm/data/index.d.ts +2 -2
- package/esm/data/index.js +1 -1
- package/esm/data/index.js.map +1 -1
- package/esm/data/pick.js +10 -2
- package/esm/data/pick.js.map +1 -1
- package/esm/data/slice.d.ts +8 -0
- package/esm/data/slice.js +10 -0
- package/esm/data/slice.js.map +1 -0
- package/esm/interaction/index.d.ts +5 -0
- package/esm/interaction/index.js +4 -30
- package/esm/interaction/index.js.map +1 -1
- package/esm/interaction/native/brushAxisHighlight.d.ts +26 -0
- package/esm/interaction/native/brushAxisHighlight.js +159 -0
- package/esm/interaction/native/brushAxisHighlight.js.map +1 -0
- package/esm/interaction/native/brushFilter.d.ts +12 -0
- package/esm/interaction/native/brushFilter.js +147 -0
- package/esm/interaction/native/brushFilter.js.map +1 -0
- package/esm/interaction/native/brushHighlight.d.ts +30 -5
- package/esm/interaction/native/brushHighlight.js +92 -34
- package/esm/interaction/native/brushHighlight.js.map +1 -1
- package/esm/interaction/native/brushXFilter.d.ts +1 -0
- package/esm/interaction/native/brushXFilter.js +6 -0
- package/esm/interaction/native/brushXFilter.js.map +1 -0
- package/esm/interaction/native/brushXHighlight.d.ts +6 -1
- package/esm/interaction/native/brushXHighlight.js +5 -4
- package/esm/interaction/native/brushXHighlight.js.map +1 -1
- package/esm/interaction/native/brushYFilter.d.ts +1 -0
- package/esm/interaction/native/brushYFilter.js +6 -0
- package/esm/interaction/native/brushYFilter.js.map +1 -0
- package/esm/interaction/native/brushYHighlight.d.ts +6 -1
- package/esm/interaction/native/brushYHighlight.js +5 -4
- package/esm/interaction/native/brushYHighlight.js.map +1 -1
- package/esm/interaction/native/tooltip.js +6 -5
- package/esm/interaction/native/tooltip.js.map +1 -1
- package/esm/interaction/native/utils.d.ts +5 -1
- package/esm/interaction/native/utils.js +11 -3
- package/esm/interaction/native/utils.js.map +1 -1
- package/esm/mark/area.js +1 -1
- package/esm/mark/area.js.map +1 -1
- package/esm/mark/boxplot.js +5 -18
- package/esm/mark/boxplot.js.map +1 -1
- package/esm/runtime/component.js +33 -38
- package/esm/runtime/component.js.map +1 -1
- package/esm/runtime/layout.js +7 -7
- package/esm/runtime/layout.js.map +1 -1
- package/esm/runtime/plot.js +5 -1
- package/esm/runtime/plot.js.map +1 -1
- package/esm/runtime/render.d.ts +0 -1
- package/esm/runtime/render.js +4 -34
- package/esm/runtime/render.js.map +1 -1
- package/esm/runtime/transform.js +6 -2
- package/esm/runtime/transform.js.map +1 -1
- package/esm/runtime/types/common.d.ts +26 -9
- package/esm/runtime/types/options.d.ts +2 -5
- package/esm/runtime/types/theme.d.ts +2 -5
- package/esm/shape/area/curve.js +15 -8
- package/esm/shape/area/curve.js.map +1 -1
- package/esm/shape/box/box.js +1 -1
- package/esm/shape/box/box.js.map +1 -1
- package/esm/shape/connector/connector.js +2 -2
- package/esm/shape/connector/connector.js.map +1 -1
- package/esm/shape/image/image.js +2 -2
- package/esm/shape/image/image.js.map +1 -1
- package/esm/shape/interval/color.js +3 -1
- package/esm/shape/interval/color.js.map +1 -1
- package/esm/shape/label/position/default.d.ts +5 -7
- package/esm/shape/label/position/default.js +14 -40
- package/esm/shape/label/position/default.js.map +1 -1
- package/esm/shape/label/position/outside.d.ts +18 -1
- package/esm/shape/label/position/outside.js +66 -1
- package/esm/shape/label/position/outside.js.map +1 -1
- package/esm/shape/label/position/spider.d.ts +1 -1
- package/esm/shape/label/position/spider.js +12 -18
- package/esm/shape/label/position/spider.js.map +1 -1
- package/esm/shape/label/position/surround.d.ts +1 -1
- package/esm/shape/label/position/surround.js +12 -14
- package/esm/shape/label/position/surround.js.map +1 -1
- package/esm/shape/line/curve.js +1 -1
- package/esm/shape/line/curve.js.map +1 -1
- package/esm/shape/lineXY/line.js +2 -2
- package/esm/shape/lineXY/line.js.map +1 -1
- package/esm/shape/link/arc.js +2 -2
- package/esm/shape/link/arc.js.map +1 -1
- package/esm/shape/link/link.js +2 -2
- package/esm/shape/link/link.js.map +1 -1
- package/esm/shape/link/smooth.js +2 -2
- package/esm/shape/link/smooth.js.map +1 -1
- package/esm/shape/link/vhv.js +2 -2
- package/esm/shape/link/vhv.js.map +1 -1
- package/esm/shape/point/color.js +1 -1
- package/esm/shape/point/color.js.map +1 -1
- package/esm/shape/polygon/polygon.js +3 -3
- package/esm/shape/polygon/polygon.js.map +1 -1
- package/esm/shape/polygon/ribbon.js +3 -3
- package/esm/shape/polygon/ribbon.js.map +1 -1
- package/esm/shape/text/advance.js +1 -1
- package/esm/shape/text/advance.js.map +1 -1
- package/esm/shape/text/badge.js +3 -3
- package/esm/shape/text/badge.js.map +1 -1
- package/esm/shape/text/text.js +1 -1
- package/esm/shape/text/text.js.map +1 -1
- package/esm/shape/utils.d.ts +4 -0
- package/esm/shape/utils.js +6 -1
- package/esm/shape/utils.js.map +1 -1
- package/esm/shape/vector/vector.js +3 -3
- package/esm/shape/vector/vector.js.map +1 -1
- package/esm/spec/data.d.ts +24 -9
- package/esm/spec/geometry.d.ts +1 -0
- package/esm/spec/interaction.d.ts +22 -3
- package/esm/stdlib/index.js +5 -5
- package/esm/stdlib/index.js.map +1 -1
- package/esm/theme/academy.js +11 -15
- package/esm/theme/academy.js.map +1 -1
- package/esm/theme/dark.js +11 -18
- package/esm/theme/dark.js.map +1 -1
- package/esm/theme/light.js +25 -19
- package/esm/theme/light.js.map +1 -1
- package/lib/api/chart.d.ts +4 -0
- package/lib/api/chart.js +26 -4
- package/lib/api/chart.js.map +1 -1
- package/lib/api/mark/mark.js +1 -0
- package/lib/api/mark/mark.js.map +1 -1
- package/lib/api/mark/types.d.ts +1 -0
- package/lib/component/axis.js +18 -5
- package/lib/component/axis.js.map +1 -1
- package/lib/component/index.d.ts +2 -0
- package/lib/component/index.js +5 -1
- package/lib/component/index.js.map +1 -1
- package/lib/component/scrollbar.d.ts +9 -0
- package/lib/component/scrollbar.js +40 -0
- package/lib/component/scrollbar.js.map +1 -0
- package/lib/component/scrollbarX.d.ts +7 -0
- package/lib/component/scrollbarX.js +13 -0
- package/lib/component/scrollbarX.js.map +1 -0
- package/lib/component/scrollbarY.d.ts +7 -0
- package/lib/component/scrollbarY.js +13 -0
- package/lib/component/scrollbarY.js.map +1 -0
- package/lib/component/title.js +46 -22
- package/lib/component/title.js.map +1 -1
- package/lib/data/fold.js +4 -10
- package/lib/data/fold.js.map +1 -1
- package/lib/data/index.d.ts +2 -2
- package/lib/data/index.js +3 -3
- package/lib/data/index.js.map +1 -1
- package/lib/data/pick.js +10 -2
- package/lib/data/pick.js.map +1 -1
- package/lib/data/slice.d.ts +8 -0
- package/lib/data/slice.js +14 -0
- package/lib/data/slice.js.map +1 -0
- package/lib/interaction/index.d.ts +5 -0
- package/lib/interaction/index.js +9 -31
- package/lib/interaction/index.js.map +1 -1
- package/lib/interaction/native/brushAxisHighlight.d.ts +26 -0
- package/lib/interaction/native/brushAxisHighlight.js +164 -0
- package/lib/interaction/native/brushAxisHighlight.js.map +1 -0
- package/lib/interaction/native/brushFilter.d.ts +12 -0
- package/lib/interaction/native/brushFilter.js +152 -0
- package/lib/interaction/native/brushFilter.js.map +1 -0
- package/lib/interaction/native/brushHighlight.d.ts +30 -5
- package/lib/interaction/native/brushHighlight.js +91 -33
- package/lib/interaction/native/brushHighlight.js.map +1 -1
- package/lib/interaction/native/brushXFilter.d.ts +1 -0
- package/lib/interaction/native/brushXFilter.js +10 -0
- package/lib/interaction/native/brushXFilter.js.map +1 -0
- package/lib/interaction/native/brushXHighlight.d.ts +6 -1
- package/lib/interaction/native/brushXHighlight.js +7 -5
- package/lib/interaction/native/brushXHighlight.js.map +1 -1
- package/lib/interaction/native/brushYFilter.d.ts +1 -0
- package/lib/interaction/native/brushYFilter.js +10 -0
- package/lib/interaction/native/brushYFilter.js.map +1 -0
- package/lib/interaction/native/brushYHighlight.d.ts +6 -1
- package/lib/interaction/native/brushYHighlight.js +7 -5
- package/lib/interaction/native/brushYHighlight.js.map +1 -1
- package/lib/interaction/native/tooltip.js +6 -5
- package/lib/interaction/native/tooltip.js.map +1 -1
- package/lib/interaction/native/utils.d.ts +5 -1
- package/lib/interaction/native/utils.js +14 -5
- package/lib/interaction/native/utils.js.map +1 -1
- package/lib/mark/area.js +1 -1
- package/lib/mark/area.js.map +1 -1
- package/lib/mark/boxplot.js +5 -18
- package/lib/mark/boxplot.js.map +1 -1
- package/lib/runtime/component.js +33 -38
- package/lib/runtime/component.js.map +1 -1
- package/lib/runtime/layout.js +7 -7
- package/lib/runtime/layout.js.map +1 -1
- package/lib/runtime/plot.js +5 -1
- package/lib/runtime/plot.js.map +1 -1
- package/lib/runtime/render.d.ts +0 -1
- package/lib/runtime/render.js +4 -35
- package/lib/runtime/render.js.map +1 -1
- package/lib/runtime/transform.js +6 -2
- package/lib/runtime/transform.js.map +1 -1
- package/lib/runtime/types/common.d.ts +26 -9
- package/lib/runtime/types/options.d.ts +2 -5
- package/lib/runtime/types/theme.d.ts +2 -5
- package/lib/shape/area/curve.js +14 -7
- package/lib/shape/area/curve.js.map +1 -1
- package/lib/shape/box/box.js +1 -1
- package/lib/shape/box/box.js.map +1 -1
- package/lib/shape/connector/connector.js +2 -2
- package/lib/shape/connector/connector.js.map +1 -1
- package/lib/shape/image/image.js +2 -2
- package/lib/shape/image/image.js.map +1 -1
- package/lib/shape/interval/color.js +3 -1
- package/lib/shape/interval/color.js.map +1 -1
- package/lib/shape/label/position/default.d.ts +5 -7
- package/lib/shape/label/position/default.js +16 -40
- package/lib/shape/label/position/default.js.map +1 -1
- package/lib/shape/label/position/outside.d.ts +18 -1
- package/lib/shape/label/position/outside.js +72 -3
- package/lib/shape/label/position/outside.js.map +1 -1
- package/lib/shape/label/position/spider.d.ts +1 -1
- package/lib/shape/label/position/spider.js +12 -18
- package/lib/shape/label/position/spider.js.map +1 -1
- package/lib/shape/label/position/surround.d.ts +1 -1
- package/lib/shape/label/position/surround.js +11 -13
- package/lib/shape/label/position/surround.js.map +1 -1
- package/lib/shape/line/curve.js +1 -1
- package/lib/shape/line/curve.js.map +1 -1
- package/lib/shape/lineXY/line.js +2 -2
- package/lib/shape/lineXY/line.js.map +1 -1
- package/lib/shape/link/arc.js +2 -2
- package/lib/shape/link/arc.js.map +1 -1
- package/lib/shape/link/link.js +2 -2
- package/lib/shape/link/link.js.map +1 -1
- package/lib/shape/link/smooth.js +2 -2
- package/lib/shape/link/smooth.js.map +1 -1
- package/lib/shape/link/vhv.js +2 -2
- package/lib/shape/link/vhv.js.map +1 -1
- package/lib/shape/point/color.js +1 -1
- package/lib/shape/point/color.js.map +1 -1
- package/lib/shape/polygon/polygon.js +3 -3
- package/lib/shape/polygon/polygon.js.map +1 -1
- package/lib/shape/polygon/ribbon.js +3 -3
- package/lib/shape/polygon/ribbon.js.map +1 -1
- package/lib/shape/text/advance.js +1 -1
- package/lib/shape/text/advance.js.map +1 -1
- package/lib/shape/text/badge.js +3 -3
- package/lib/shape/text/badge.js.map +1 -1
- package/lib/shape/text/text.js +1 -1
- package/lib/shape/text/text.js.map +1 -1
- package/lib/shape/utils.d.ts +4 -0
- package/lib/shape/utils.js +6 -1
- package/lib/shape/utils.js.map +1 -1
- package/lib/shape/vector/vector.js +3 -3
- package/lib/shape/vector/vector.js.map +1 -1
- package/lib/spec/data.d.ts +24 -9
- package/lib/spec/geometry.d.ts +1 -0
- package/lib/spec/interaction.d.ts +22 -3
- package/lib/stdlib/index.js +2 -2
- package/lib/stdlib/index.js.map +1 -1
- package/lib/theme/academy.js +11 -15
- package/lib/theme/academy.js.map +1 -1
- package/lib/theme/dark.js +11 -18
- package/lib/theme/dark.js.map +1 -1
- package/lib/theme/light.js +25 -19
- package/lib/theme/light.js.map +1 -1
- package/package.json +1 -1
- package/src/api/chart.ts +29 -8
- package/src/api/mark/mark.ts +1 -0
- package/src/api/mark/types.ts +1 -0
- package/src/component/axis.ts +22 -5
- package/src/component/index.ts +2 -0
- package/src/component/scrollbar.ts +41 -0
- package/src/component/scrollbarX.ts +16 -0
- package/src/component/scrollbarY.ts +16 -0
- package/src/component/title.ts +69 -30
- package/src/data/fold.ts +6 -10
- package/src/data/index.ts +2 -2
- package/src/data/pick.ts +11 -2
- package/src/data/slice.ts +15 -0
- package/src/interaction/index.ts +20 -16
- package/src/interaction/native/brushAxisHighlight.ts +194 -0
- package/src/interaction/native/brushFilter.ts +163 -0
- package/src/interaction/native/brushHighlight.ts +104 -31
- package/src/interaction/native/brushXFilter.ts +9 -0
- package/src/interaction/native/brushXHighlight.ts +6 -4
- package/src/interaction/native/brushYFilter.ts +9 -0
- package/src/interaction/native/brushYHighlight.ts +6 -4
- package/src/interaction/native/tooltip.ts +9 -6
- package/src/interaction/native/utils.ts +15 -6
- package/src/mark/area.ts +1 -1
- package/src/mark/boxplot.ts +3 -1
- package/src/runtime/component.ts +46 -47
- package/src/runtime/layout.ts +6 -6
- package/src/runtime/plot.ts +6 -1
- package/src/runtime/render.ts +6 -58
- package/src/runtime/transform.ts +6 -2
- package/src/runtime/types/common.ts +26 -10
- package/src/runtime/types/options.ts +2 -5
- package/src/runtime/types/theme.ts +2 -5
- package/src/shape/area/curve.ts +15 -8
- package/src/shape/box/box.ts +6 -6
- package/src/shape/connector/connector.ts +2 -3
- package/src/shape/image/image.ts +2 -2
- package/src/shape/interval/color.ts +2 -1
- package/src/shape/label/position/default.ts +15 -55
- package/src/shape/label/position/outside.ts +121 -1
- package/src/shape/label/position/spider.ts +12 -19
- package/src/shape/label/position/surround.ts +13 -15
- package/src/shape/line/curve.ts +1 -1
- package/src/shape/lineXY/line.ts +2 -2
- package/src/shape/link/arc.ts +2 -2
- package/src/shape/link/link.ts +2 -2
- package/src/shape/link/smooth.ts +2 -2
- package/src/shape/link/vhv.ts +2 -2
- package/src/shape/point/color.ts +6 -5
- package/src/shape/polygon/polygon.ts +3 -3
- package/src/shape/polygon/ribbon.ts +3 -3
- package/src/shape/text/advance.ts +4 -1
- package/src/shape/text/badge.ts +8 -3
- package/src/shape/text/text.ts +1 -1
- package/src/shape/utils.ts +6 -5
- package/src/shape/vector/vector.ts +3 -3
- package/src/spec/action.ts +0 -1
- package/src/spec/data.ts +25 -10
- package/src/spec/geometry.ts +1 -0
- package/src/spec/interaction.ts +32 -2
- package/src/stdlib/index.ts +14 -2
- package/src/theme/academy.ts +11 -15
- package/src/theme/dark.ts +11 -18
- package/src/theme/light.ts +25 -19
- package/esm/data/subset.d.ts +0 -7
- package/esm/data/subset.js +0 -26
- package/esm/data/subset.js.map +0 -1
- package/lib/data/subset.d.ts +0 -7
- package/lib/data/subset.js +0 -30
- package/lib/data/subset.js.map +0 -1
- package/src/.DS_Store +0 -0
- package/src/data/.DS_Store +0 -0
- package/src/data/subset.ts +0 -35
- package/src/shape/.DS_Store +0 -0
package/src/spec/data.ts
CHANGED
|
@@ -23,11 +23,11 @@ export type DataTransform =
|
|
|
23
23
|
| SortTransform
|
|
24
24
|
| PickTransform
|
|
25
25
|
| RenameTransform
|
|
26
|
-
| SubsetTransform
|
|
27
26
|
| FoldTransform
|
|
28
27
|
| JoinTransform
|
|
29
28
|
| FilterDataTransform
|
|
30
29
|
| MapTransform
|
|
30
|
+
| SliceTransform
|
|
31
31
|
| CustomTransform;
|
|
32
32
|
|
|
33
33
|
export type DataTransformTypes =
|
|
@@ -35,11 +35,11 @@ export type DataTransformTypes =
|
|
|
35
35
|
| 'sort'
|
|
36
36
|
| 'pick'
|
|
37
37
|
| 'rename'
|
|
38
|
-
| 'subset'
|
|
39
38
|
| 'fold'
|
|
40
39
|
| 'join'
|
|
41
40
|
| 'filter'
|
|
42
41
|
| 'map'
|
|
42
|
+
| 'slice'
|
|
43
43
|
| 'custom'
|
|
44
44
|
| DataComponent;
|
|
45
45
|
|
|
@@ -59,13 +59,6 @@ export type RenameTransform = {
|
|
|
59
59
|
[key: string]: string;
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
export type SubsetTransform = {
|
|
63
|
-
type?: 'subset';
|
|
64
|
-
start?: number;
|
|
65
|
-
end?: number;
|
|
66
|
-
fields?: string[];
|
|
67
|
-
};
|
|
68
|
-
|
|
69
62
|
export type FilterDataTransform = {
|
|
70
63
|
type?: 'filter';
|
|
71
64
|
/**
|
|
@@ -74,6 +67,18 @@ export type FilterDataTransform = {
|
|
|
74
67
|
callback?: (v: any, idx: number, arr: any[]) => boolean;
|
|
75
68
|
};
|
|
76
69
|
|
|
70
|
+
export type SliceTransform = {
|
|
71
|
+
type?: 'slice';
|
|
72
|
+
/**
|
|
73
|
+
* The start index for slice. Default is 0.
|
|
74
|
+
*/
|
|
75
|
+
start?: number;
|
|
76
|
+
/**
|
|
77
|
+
* The end index for slice. Default is arr.length - 1
|
|
78
|
+
*/
|
|
79
|
+
end?: number;
|
|
80
|
+
};
|
|
81
|
+
|
|
77
82
|
export type SortTransform = {
|
|
78
83
|
type?: 'sort';
|
|
79
84
|
/**
|
|
@@ -84,8 +89,18 @@ export type SortTransform = {
|
|
|
84
89
|
|
|
85
90
|
export type FoldTransform = {
|
|
86
91
|
type?: 'fold';
|
|
92
|
+
/**
|
|
93
|
+
* Set fields will be folded.
|
|
94
|
+
*/
|
|
87
95
|
fields?: string[];
|
|
88
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Fold key field, default is `key`.
|
|
98
|
+
*/
|
|
99
|
+
key?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Fold value field, default is `value`.
|
|
102
|
+
*/
|
|
103
|
+
value?: string;
|
|
89
104
|
};
|
|
90
105
|
|
|
91
106
|
export type CustomDataTransform = {
|
package/src/spec/geometry.ts
CHANGED
|
@@ -128,6 +128,7 @@ export type BaseGeometry<
|
|
|
128
128
|
| boolean;
|
|
129
129
|
legend?: Partial<Record<'size' | 'color', Legend | boolean>> | boolean;
|
|
130
130
|
slider?: Partial<Record<'x' | 'y', any>>;
|
|
131
|
+
scrollbar?: Partial<Record<'x' | 'y', any>>;
|
|
131
132
|
coordinates?: Coordinate[];
|
|
132
133
|
style?: Record<string, any>;
|
|
133
134
|
interactions?: Interaction[];
|
package/src/spec/interaction.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChannelTypes } from 'spec';
|
|
2
1
|
import { InteractionComponent } from '../runtime';
|
|
2
|
+
import { ChannelTypes } from './geometry';
|
|
3
3
|
import { ActiveRegionAction, PoptipAction, TooltipAction } from './action';
|
|
4
4
|
import { FisheyeCoordinate } from './coordinate';
|
|
5
5
|
|
|
@@ -17,7 +17,11 @@ export type Interaction =
|
|
|
17
17
|
| LegendFilterInteraction
|
|
18
18
|
| BrushHighlightInteraction
|
|
19
19
|
| BrushXHighlightInteraction
|
|
20
|
-
| BrushYHighlightInteraction
|
|
20
|
+
| BrushYHighlightInteraction
|
|
21
|
+
| BrushAxisHighlightInteraction
|
|
22
|
+
| BrushFilter
|
|
23
|
+
| BrushYFilter
|
|
24
|
+
| BrushXFilter;
|
|
21
25
|
// | ElementListHighlightInteraction
|
|
22
26
|
// | LegendActiveInteraction
|
|
23
27
|
// | LegendHighlightInteraction
|
|
@@ -43,6 +47,9 @@ export type InteractionTypes =
|
|
|
43
47
|
| 'brushXHighlight'
|
|
44
48
|
| 'brushYHighlight'
|
|
45
49
|
| 'brushHighlight'
|
|
50
|
+
| 'brushFilter'
|
|
51
|
+
| 'brushXFilter'
|
|
52
|
+
| 'brushYFilter'
|
|
46
53
|
| InteractionComponent;
|
|
47
54
|
// | 'elementListHighlight'
|
|
48
55
|
// | 'legendActive'
|
|
@@ -62,6 +69,7 @@ export type BrushInteraction = {
|
|
|
62
69
|
|
|
63
70
|
export type BrushHighlightInteraction = {
|
|
64
71
|
type?: 'brushHighlight';
|
|
72
|
+
brushKey?: string;
|
|
65
73
|
reverse?: boolean;
|
|
66
74
|
shared?: boolean;
|
|
67
75
|
series?: boolean;
|
|
@@ -70,6 +78,7 @@ export type BrushHighlightInteraction = {
|
|
|
70
78
|
|
|
71
79
|
export type BrushXHighlightInteraction = {
|
|
72
80
|
type?: 'brushXHighlight';
|
|
81
|
+
brushKey?: string;
|
|
73
82
|
reverse?: boolean;
|
|
74
83
|
shared?: boolean;
|
|
75
84
|
series?: boolean;
|
|
@@ -78,12 +87,33 @@ export type BrushXHighlightInteraction = {
|
|
|
78
87
|
|
|
79
88
|
export type BrushYHighlightInteraction = {
|
|
80
89
|
type?: 'brushYHighlight';
|
|
90
|
+
brushKey?: string;
|
|
81
91
|
reverse?: boolean;
|
|
82
92
|
shared?: boolean;
|
|
83
93
|
series?: boolean;
|
|
84
94
|
facet?: boolean;
|
|
85
95
|
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
86
96
|
|
|
97
|
+
export type BrushAxisHighlightInteraction = {
|
|
98
|
+
type?: 'brushAxisHighlight';
|
|
99
|
+
reverse?: boolean;
|
|
100
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
101
|
+
|
|
102
|
+
export type BrushFilter = {
|
|
103
|
+
type?: 'brushFilter';
|
|
104
|
+
reverse?: boolean;
|
|
105
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
106
|
+
|
|
107
|
+
export type BrushXFilter = {
|
|
108
|
+
type?: 'brushXFilter';
|
|
109
|
+
reverse?: boolean;
|
|
110
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
111
|
+
|
|
112
|
+
export type BrushYFilter = {
|
|
113
|
+
type?: 'brushYFilter';
|
|
114
|
+
reverse?: boolean;
|
|
115
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
116
|
+
|
|
87
117
|
export type BrushVisibleInteraction = {
|
|
88
118
|
type?: 'brushVisible';
|
|
89
119
|
brushType?: 'rect' | 'rectX' | 'rectY' | 'polygon';
|
package/src/stdlib/index.ts
CHANGED
|
@@ -140,6 +140,8 @@ import {
|
|
|
140
140
|
TitleComponent,
|
|
141
141
|
SliderX,
|
|
142
142
|
SliderY,
|
|
143
|
+
ScrollbarX,
|
|
144
|
+
ScrollbarY,
|
|
143
145
|
} from '../component';
|
|
144
146
|
import {
|
|
145
147
|
ScaleInX,
|
|
@@ -174,6 +176,10 @@ import {
|
|
|
174
176
|
BrushHighlight,
|
|
175
177
|
BrushXHighlight,
|
|
176
178
|
BrushYHighlight,
|
|
179
|
+
BrushAxisHighlight,
|
|
180
|
+
BrushFilter,
|
|
181
|
+
BrushXFilter,
|
|
182
|
+
BrushYFilter,
|
|
177
183
|
// ElementHighlightByX,
|
|
178
184
|
// ElementHighlightByColor,
|
|
179
185
|
// ElementListHighlight,
|
|
@@ -246,8 +252,8 @@ import {
|
|
|
246
252
|
Map,
|
|
247
253
|
Pick,
|
|
248
254
|
Rename,
|
|
249
|
-
Subset,
|
|
250
255
|
Fold,
|
|
256
|
+
Slice,
|
|
251
257
|
Inline,
|
|
252
258
|
Custom,
|
|
253
259
|
Cluster,
|
|
@@ -275,8 +281,8 @@ export function createLibrary(): G2Library {
|
|
|
275
281
|
'data.filter': DataFilter,
|
|
276
282
|
'data.pick': Pick,
|
|
277
283
|
'data.rename': Rename,
|
|
278
|
-
'data.subset': Subset,
|
|
279
284
|
'data.fold': Fold,
|
|
285
|
+
'data.slice': Slice,
|
|
280
286
|
'data.custom': Custom,
|
|
281
287
|
'data.map': Map,
|
|
282
288
|
'data.cluster': Cluster,
|
|
@@ -471,6 +477,8 @@ export function createLibrary(): G2Library {
|
|
|
471
477
|
'component.title': TitleComponent,
|
|
472
478
|
'component.sliderX': SliderX,
|
|
473
479
|
'component.sliderY': SliderY,
|
|
480
|
+
'component.scrollbarX': ScrollbarX,
|
|
481
|
+
'component.scrollbarY': ScrollbarY,
|
|
474
482
|
'animation.scaleInX': ScaleInX,
|
|
475
483
|
'animation.scaleOutX': ScaleOutX,
|
|
476
484
|
'animation.scaleInY': ScaleInY,
|
|
@@ -497,6 +505,10 @@ export function createLibrary(): G2Library {
|
|
|
497
505
|
'interaction.brushHighlight': BrushHighlight,
|
|
498
506
|
'interaction.brushXHighlight': BrushXHighlight,
|
|
499
507
|
'interaction.brushYHighlight': BrushYHighlight,
|
|
508
|
+
'interaction.brushAxisHighlight': BrushAxisHighlight,
|
|
509
|
+
'interaction.brushFilter': BrushFilter,
|
|
510
|
+
'interaction.brushXFilter': BrushXFilter,
|
|
511
|
+
'interaction.brushYFilter': BrushYFilter,
|
|
500
512
|
// 'interaction.elementSelected': ElementSelected,
|
|
501
513
|
// 'interaction.elementHighlight': ElementHighlight,
|
|
502
514
|
// 'interaction.elementHighlightByX': ElementHighlightByX,
|
package/src/theme/academy.ts
CHANGED
|
@@ -55,19 +55,16 @@ export const Academy: TC<AcademyOptions> = (options) => {
|
|
|
55
55
|
},
|
|
56
56
|
hollow: {
|
|
57
57
|
r: 3,
|
|
58
|
-
fill: '',
|
|
59
58
|
strokeOpacity: 0.95,
|
|
60
59
|
lineWidth: 1,
|
|
61
60
|
},
|
|
62
61
|
plus: {
|
|
63
62
|
r: 3,
|
|
64
|
-
fill: '',
|
|
65
63
|
strokeOpacity: 0.95,
|
|
66
64
|
lineWidth: 3,
|
|
67
65
|
},
|
|
68
66
|
diamond: {
|
|
69
67
|
r: 3,
|
|
70
|
-
fill: '',
|
|
71
68
|
strokeOpacity: 0.95,
|
|
72
69
|
lineWidth: 1,
|
|
73
70
|
},
|
|
@@ -357,6 +354,7 @@ export const Academy: TC<AcademyOptions> = (options) => {
|
|
|
357
354
|
connectorStroke: COLORS.BLACK,
|
|
358
355
|
connectorStrokeOpacity: 0.45,
|
|
359
356
|
connectorLineWidth: 1,
|
|
357
|
+
connectorLength: 12,
|
|
360
358
|
connectorLength2: 8,
|
|
361
359
|
connectorDistance: 4,
|
|
362
360
|
},
|
|
@@ -388,18 +386,16 @@ export const Academy: TC<AcademyOptions> = (options) => {
|
|
|
388
386
|
},
|
|
389
387
|
scrollbar: {},
|
|
390
388
|
title: {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
fontWeight: 'normal',
|
|
402
|
-
textBaseline: 'top',
|
|
389
|
+
titleFill: COLORS.BLACK,
|
|
390
|
+
titleFillOpacity: 0.85,
|
|
391
|
+
titleFontSize: 14,
|
|
392
|
+
titleFontWeight: 'bold',
|
|
393
|
+
titleTextBaseline: 'top',
|
|
394
|
+
subtitleFill: COLORS.BLACK,
|
|
395
|
+
subtitleFillOpacity: 0.65,
|
|
396
|
+
subtitleFontSize: 12,
|
|
397
|
+
subtitleFontWeight: 'normal',
|
|
398
|
+
subtitleTextBaseline: 'top',
|
|
403
399
|
},
|
|
404
400
|
};
|
|
405
401
|
return Object.assign({}, defaultOptions, options);
|
package/src/theme/dark.ts
CHANGED
|
@@ -47,7 +47,6 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
47
47
|
fill: '',
|
|
48
48
|
strokeOpacity: 1,
|
|
49
49
|
lineWidth: 1,
|
|
50
|
-
connectStroke: '#666',
|
|
51
50
|
},
|
|
52
51
|
},
|
|
53
52
|
point: {
|
|
@@ -58,19 +57,16 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
58
57
|
},
|
|
59
58
|
hollow: {
|
|
60
59
|
r: 3,
|
|
61
|
-
fill: '',
|
|
62
60
|
strokeOpacity: 0.95,
|
|
63
61
|
lineWidth: 1,
|
|
64
62
|
},
|
|
65
63
|
plus: {
|
|
66
64
|
r: 3,
|
|
67
|
-
fill: '',
|
|
68
65
|
strokeOpacity: 0.95,
|
|
69
66
|
lineWidth: 3,
|
|
70
67
|
},
|
|
71
68
|
diamond: {
|
|
72
69
|
r: 3,
|
|
73
|
-
fill: '',
|
|
74
70
|
strokeOpacity: 0.95,
|
|
75
71
|
lineWidth: 1,
|
|
76
72
|
},
|
|
@@ -89,8 +85,6 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
89
85
|
area: {
|
|
90
86
|
fillOpacity: 0.85,
|
|
91
87
|
lineWidth: 0,
|
|
92
|
-
connectFill: COLORS.BLACK,
|
|
93
|
-
connectFillOpacity: 0.1,
|
|
94
88
|
},
|
|
95
89
|
},
|
|
96
90
|
polygon: {
|
|
@@ -364,6 +358,7 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
364
358
|
connectorStroke: COLORS.BLACK,
|
|
365
359
|
connectorStrokeOpacity: 0.45,
|
|
366
360
|
connectorLineWidth: 1,
|
|
361
|
+
connectorLength: 12,
|
|
367
362
|
connectorLength2: 8,
|
|
368
363
|
connectorDistance: 4,
|
|
369
364
|
},
|
|
@@ -395,18 +390,16 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
395
390
|
},
|
|
396
391
|
scrollbar: {},
|
|
397
392
|
title: {
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
fontWeight: 'normal',
|
|
409
|
-
textBaseline: 'top',
|
|
393
|
+
titleFill: COLORS.BLACK,
|
|
394
|
+
titleFillOpacity: 0.85,
|
|
395
|
+
titleFontSize: 14,
|
|
396
|
+
titleFontWeight: 'bold',
|
|
397
|
+
titleTextBaseline: 'top',
|
|
398
|
+
subtitleFill: COLORS.BLACK,
|
|
399
|
+
subtitleFillOpacity: 0.65,
|
|
400
|
+
subtitleFontSize: 12,
|
|
401
|
+
subtitleFontWeight: 'normal',
|
|
402
|
+
subtitleTextBaseline: 'top',
|
|
410
403
|
},
|
|
411
404
|
};
|
|
412
405
|
return Object.assign({}, defaultOptions, options);
|
package/src/theme/light.ts
CHANGED
|
@@ -47,7 +47,6 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
47
47
|
fill: '',
|
|
48
48
|
strokeOpacity: 1,
|
|
49
49
|
lineWidth: 1,
|
|
50
|
-
connectStroke: '#aaa',
|
|
51
50
|
},
|
|
52
51
|
},
|
|
53
52
|
point: {
|
|
@@ -58,19 +57,16 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
58
57
|
},
|
|
59
58
|
hollow: {
|
|
60
59
|
r: 3,
|
|
61
|
-
fill: '',
|
|
62
60
|
strokeOpacity: 0.95,
|
|
63
61
|
lineWidth: 1,
|
|
64
62
|
},
|
|
65
63
|
plus: {
|
|
66
64
|
r: 3,
|
|
67
|
-
fill: '',
|
|
68
65
|
strokeOpacity: 0.95,
|
|
69
66
|
lineWidth: 3,
|
|
70
67
|
},
|
|
71
68
|
diamond: {
|
|
72
69
|
r: 3,
|
|
73
|
-
fill: '',
|
|
74
70
|
strokeOpacity: 0.95,
|
|
75
71
|
lineWidth: 1,
|
|
76
72
|
},
|
|
@@ -89,8 +85,6 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
89
85
|
area: {
|
|
90
86
|
fillOpacity: 0.85,
|
|
91
87
|
lineWidth: 0,
|
|
92
|
-
connectFill: COLORS.BLACK,
|
|
93
|
-
connectFillOpacity: 0.1,
|
|
94
88
|
},
|
|
95
89
|
},
|
|
96
90
|
polygon: {
|
|
@@ -365,6 +359,7 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
365
359
|
connectorStroke: COLORS.BLACK,
|
|
366
360
|
connectorStrokeOpacity: 0.45,
|
|
367
361
|
connectorLineWidth: 1,
|
|
362
|
+
connectorLength: 12,
|
|
368
363
|
connectorLength2: 8,
|
|
369
364
|
connectorDistance: 4,
|
|
370
365
|
},
|
|
@@ -394,20 +389,31 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
394
389
|
handleLabelFontSize: 12,
|
|
395
390
|
handleLabelFontWeight: 'normal',
|
|
396
391
|
},
|
|
397
|
-
scrollbar: {
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
392
|
+
scrollbar: {
|
|
393
|
+
padding: [2, 2, 2, 2],
|
|
394
|
+
trackSize: 10,
|
|
395
|
+
isRound: true,
|
|
396
|
+
slidable: true,
|
|
397
|
+
scrollable: true,
|
|
398
|
+
trackFill: '#e5e5e5',
|
|
399
|
+
trackFillOpacity: 0,
|
|
400
|
+
trackStroke: 'none',
|
|
401
|
+
thumbFill: '#000',
|
|
402
|
+
thumbFillOpacity: 0.15,
|
|
403
|
+
thumbStroke: 'none',
|
|
404
|
+
thumbHighlightedFillOpacity: 0.2,
|
|
404
405
|
},
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
406
|
+
title: {
|
|
407
|
+
titleFill: COLORS.BLACK,
|
|
408
|
+
titleFillOpacity: 0.85,
|
|
409
|
+
titleFontSize: 14,
|
|
410
|
+
titleFontWeight: 'bold',
|
|
411
|
+
titleTextBaseline: 'top',
|
|
412
|
+
subtitleFill: COLORS.BLACK,
|
|
413
|
+
subtitleFillOpacity: 0.65,
|
|
414
|
+
subtitleFontSize: 12,
|
|
415
|
+
subtitleFontWeight: 'normal',
|
|
416
|
+
subtitleTextBaseline: 'top',
|
|
411
417
|
},
|
|
412
418
|
};
|
|
413
419
|
return Object.assign({}, defaultOptions, options);
|
package/esm/data/subset.d.ts
DELETED
package/esm/data/subset.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
function constrain(v, min, max) {
|
|
2
|
-
return Math.min(max, Math.max(min, v));
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Immutable data sort by specified fields.
|
|
6
|
-
*/
|
|
7
|
-
export const Subset = (options) => {
|
|
8
|
-
return (data) => {
|
|
9
|
-
const { fields = [] } = options;
|
|
10
|
-
let { start = 0, end = data.length } = options;
|
|
11
|
-
start = constrain(start, 0, data.length - 1);
|
|
12
|
-
end = constrain(end, 1, data.length);
|
|
13
|
-
if (start > end)
|
|
14
|
-
[start, end] = [end, start];
|
|
15
|
-
const pick = (v) => fields.reduce((datum, field) => {
|
|
16
|
-
// Pick the data deeply.
|
|
17
|
-
if (field in v) {
|
|
18
|
-
datum[field] = v[field];
|
|
19
|
-
}
|
|
20
|
-
return datum;
|
|
21
|
-
}, {});
|
|
22
|
-
return data.filter((_, i) => i >= start && i < end).map(pick);
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
Subset.props = {};
|
|
26
|
-
//# sourceMappingURL=subset.js.map
|
package/esm/data/subset.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subset.js","sourceRoot":"src/","sources":["data/subset.ts"],"names":[],"mappings":"AAGA,SAAS,SAAS,CAAC,CAAS,EAAE,GAAW,EAAE,GAAW;IACpD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AACzC,CAAC;AAID;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAsB,CAAC,OAAO,EAAE,EAAE;IACnD,OAAO,CAAC,IAAI,EAAE,EAAE;QACd,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;QAEhC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC;QAC/C,KAAK,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC7C,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACrC,IAAI,KAAK,GAAG,GAAG;YAAE,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAE7C,MAAM,IAAI,GAAG,CAAC,CAAM,EAAE,EAAE,CACtB,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YAC7B,wBAAwB;YACxB,IAAI,KAAK,IAAI,CAAC,EAAE;gBACd,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;aACzB;YACD,OAAO,KAAK,CAAC;QACf,CAAC,EAAE,EAAE,CAAC,CAAC;QAET,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChE,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC"}
|
package/lib/data/subset.d.ts
DELETED
package/lib/data/subset.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Subset = void 0;
|
|
4
|
-
function constrain(v, min, max) {
|
|
5
|
-
return Math.min(max, Math.max(min, v));
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Immutable data sort by specified fields.
|
|
9
|
-
*/
|
|
10
|
-
const Subset = (options) => {
|
|
11
|
-
return (data) => {
|
|
12
|
-
const { fields = [] } = options;
|
|
13
|
-
let { start = 0, end = data.length } = options;
|
|
14
|
-
start = constrain(start, 0, data.length - 1);
|
|
15
|
-
end = constrain(end, 1, data.length);
|
|
16
|
-
if (start > end)
|
|
17
|
-
[start, end] = [end, start];
|
|
18
|
-
const pick = (v) => fields.reduce((datum, field) => {
|
|
19
|
-
// Pick the data deeply.
|
|
20
|
-
if (field in v) {
|
|
21
|
-
datum[field] = v[field];
|
|
22
|
-
}
|
|
23
|
-
return datum;
|
|
24
|
-
}, {});
|
|
25
|
-
return data.filter((_, i) => i >= start && i < end).map(pick);
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
exports.Subset = Subset;
|
|
29
|
-
exports.Subset.props = {};
|
|
30
|
-
//# sourceMappingURL=subset.js.map
|
package/lib/data/subset.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subset.js","sourceRoot":"src/","sources":["data/subset.ts"],"names":[],"mappings":";;;AAGA,SAAS,SAAS,CAAC,CAAS,EAAE,GAAW,EAAE,GAAW;IACpD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AACzC,CAAC;AAID;;GAEG;AACI,MAAM,MAAM,GAAsB,CAAC,OAAO,EAAE,EAAE;IACnD,OAAO,CAAC,IAAI,EAAE,EAAE;QACd,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;QAEhC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC;QAC/C,KAAK,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC7C,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACrC,IAAI,KAAK,GAAG,GAAG;YAAE,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAE7C,MAAM,IAAI,GAAG,CAAC,CAAM,EAAE,EAAE,CACtB,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YAC7B,wBAAwB;YACxB,IAAI,KAAK,IAAI,CAAC,EAAE;gBACd,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;aACzB;YACD,OAAO,KAAK,CAAC;QACf,CAAC,EAAE,EAAE,CAAC,CAAC;QAET,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChE,CAAC,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,MAAM,UAoBjB;AAEF,cAAM,CAAC,KAAK,GAAG,EAAE,CAAC"}
|
package/src/.DS_Store
DELETED
|
Binary file
|
package/src/data/.DS_Store
DELETED
|
Binary file
|
package/src/data/subset.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { DataComponent as DC } from '../runtime';
|
|
2
|
-
import { SubsetTransform } from '../spec';
|
|
3
|
-
|
|
4
|
-
function constrain(v: number, min: number, max: number) {
|
|
5
|
-
return Math.min(max, Math.max(min, v));
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export type SubsetOptions = Omit<SubsetTransform, 'type'>;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Immutable data sort by specified fields.
|
|
12
|
-
*/
|
|
13
|
-
export const Subset: DC<SubsetOptions> = (options) => {
|
|
14
|
-
return (data) => {
|
|
15
|
-
const { fields = [] } = options;
|
|
16
|
-
|
|
17
|
-
let { start = 0, end = data.length } = options;
|
|
18
|
-
start = constrain(start, 0, data.length - 1);
|
|
19
|
-
end = constrain(end, 1, data.length);
|
|
20
|
-
if (start > end) [start, end] = [end, start];
|
|
21
|
-
|
|
22
|
-
const pick = (v: any) =>
|
|
23
|
-
fields.reduce((datum, field) => {
|
|
24
|
-
// Pick the data deeply.
|
|
25
|
-
if (field in v) {
|
|
26
|
-
datum[field] = v[field];
|
|
27
|
-
}
|
|
28
|
-
return datum;
|
|
29
|
-
}, {});
|
|
30
|
-
|
|
31
|
-
return data.filter((_, i) => i >= start && i < end).map(pick);
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
Subset.props = {};
|
package/src/shape/.DS_Store
DELETED
|
Binary file
|