@visactor/vseed 0.3.13 → 0.3.15
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/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/builder/builder/builder.d.ts +3135 -25697
- package/dist/esm/builder/register/all.js +4 -1
- package/dist/esm/builder/register/all.js.map +1 -1
- package/dist/esm/builder/register/chartType/index.d.ts +3 -0
- package/dist/esm/builder/register/chartType/index.js +4 -1
- package/dist/esm/builder/register/chartType/raceBar.d.ts +5 -0
- package/dist/esm/builder/register/chartType/raceBar.js +9 -0
- package/dist/esm/builder/register/chartType/raceBar.js.map +1 -0
- package/dist/esm/builder/register/chartType/raceColumn.d.ts +5 -0
- package/dist/esm/builder/register/chartType/raceColumn.js +9 -0
- package/dist/esm/builder/register/chartType/raceColumn.js.map +1 -0
- package/dist/esm/builder/register/chartType/raceScatter.d.ts +5 -0
- package/dist/esm/builder/register/chartType/raceScatter.js +9 -0
- package/dist/esm/builder/register/chartType/raceScatter.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/index.d.ts +3 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/index.js +4 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/raceBar.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/raceBar.js +5 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/raceBar.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/raceColumn.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/raceColumn.js +5 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/raceColumn.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/raceScatter.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/raceScatter.js +5 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/raceScatter.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/index.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipeline/area.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipeline/area.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/column.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipeline/column.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/donut.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipeline/donut.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/funnel.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipeline/funnel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipeline/heatmap.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/index.d.ts +3 -0
- package/dist/esm/pipeline/spec/chart/pipeline/index.js +4 -1
- package/dist/esm/pipeline/spec/chart/pipeline/line.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipeline/line.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/pie.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipeline/pie.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/raceBar.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipeline/raceBar.js +26 -0
- package/dist/esm/pipeline/spec/chart/pipeline/raceBar.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipeline/raceColumn.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipeline/raceColumn.js +26 -0
- package/dist/esm/pipeline/spec/chart/pipeline/raceColumn.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipeline/raceScatter.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipeline/raceScatter.js +24 -0
- package/dist/esm/pipeline/spec/chart/pipeline/raceScatter.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipeline/radar.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipeline/radar.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/rose.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipeline/rose.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/scatter.js +4 -0
- package/dist/esm/pipeline/spec/chart/pipes/init/scatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/player/index.d.ts +8 -1
- package/dist/esm/pipeline/spec/chart/pipes/player/index.js +8 -2
- package/dist/esm/pipeline/spec/chart/pipes/player/isPlayer.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/isPlayer.js +11 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/isPlayer.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerXBand.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerXBand.js +10 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerXBand.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerXLinear.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerXLinear.js +14 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerXLinear.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerXY.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerXY.js +171 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerXY.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerYBand.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerYBand.js +13 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerYBand.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerYLinear.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerYLinear.js +14 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerYLinear.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerYX.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerYX.js +157 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerYX.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerYY.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerYY.js +173 -0
- package/dist/esm/pipeline/spec/chart/pipes/player/playerYY.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/utils/condition.d.ts +3 -0
- package/dist/esm/pipeline/spec/chart/utils/condition.js +7 -0
- package/dist/esm/pipeline/spec/chart/utils/condition.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/utils/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/utils/index.js +1 -0
- package/dist/esm/pipeline/utils/chatType.d.ts +1 -1
- package/dist/esm/pipeline/utils/chatType.js +4 -1
- package/dist/esm/pipeline/utils/chatType.js.map +1 -1
- package/dist/esm/pipeline/utils/constant.d.ts +3 -0
- package/dist/esm/pipeline/utils/constant.js +3 -0
- package/dist/esm/pipeline/utils/constant.js.map +1 -1
- package/dist/esm/theme/dark/dark.js +74 -29
- package/dist/esm/theme/dark/dark.js.map +1 -1
- package/dist/esm/theme/light/light.js +61 -15
- package/dist/esm/theme/light/light.js.map +1 -1
- package/dist/esm/types/advancedVSeed.d.ts +35 -18880
- package/dist/esm/types/advancedVSeed.js.map +1 -1
- package/dist/esm/types/chartType/area/area.d.ts +1 -5
- package/dist/esm/types/chartType/areaPercent/areaPercent.d.ts +1 -5
- package/dist/esm/types/chartType/bar/bar.d.ts +1 -5
- package/dist/esm/types/chartType/barParallel/barParallel.d.ts +1 -5
- package/dist/esm/types/chartType/barPercent/barPercent.d.ts +1 -5
- package/dist/esm/types/chartType/column/column.d.ts +1 -5
- package/dist/esm/types/chartType/columnParallel/columnParallel.d.ts +1 -5
- package/dist/esm/types/chartType/columnPercent/columnPercent.d.ts +1 -5
- package/dist/esm/types/chartType/donut/donut.d.ts +1 -5
- package/dist/esm/types/chartType/funnel/funnel.d.ts +1 -5
- package/dist/esm/types/chartType/heatmap/heatmap.d.ts +1 -6
- package/dist/esm/types/chartType/index.d.ts +3 -0
- package/dist/esm/types/chartType/index.js +3 -0
- package/dist/esm/types/chartType/line/line.d.ts +1 -5
- package/dist/esm/types/chartType/pie/pie.d.ts +1 -5
- package/dist/esm/types/chartType/raceBar/index.d.ts +2 -0
- package/dist/esm/types/chartType/raceBar/index.js +1 -0
- package/dist/esm/types/chartType/raceBar/raceBar.d.ts +118 -0
- package/dist/esm/types/chartType/raceBar/raceBar.js +0 -0
- package/dist/esm/types/chartType/raceBar/zRaceBar.d.ts +1217 -0
- package/dist/esm/types/chartType/raceBar/zRaceBar.js +36 -0
- package/dist/esm/types/chartType/raceBar/zRaceBar.js.map +1 -0
- package/dist/esm/types/chartType/raceColumn/index.d.ts +2 -0
- package/dist/esm/types/chartType/raceColumn/index.js +1 -0
- package/dist/esm/types/chartType/raceColumn/raceColumn.d.ts +31 -0
- package/dist/esm/types/chartType/raceColumn/raceColumn.js +0 -0
- package/dist/esm/types/chartType/raceColumn/zRaceColumn.d.ts +1217 -0
- package/dist/esm/types/chartType/raceColumn/zRaceColumn.js +36 -0
- package/dist/esm/types/chartType/raceColumn/zRaceColumn.js.map +1 -0
- package/dist/esm/types/chartType/raceScatter/index.d.ts +2 -0
- package/dist/esm/types/chartType/raceScatter/index.js +1 -0
- package/dist/esm/types/chartType/raceScatter/raceScatter.d.ts +27 -0
- package/dist/esm/types/chartType/raceScatter/raceScatter.js +0 -0
- package/dist/esm/types/chartType/raceScatter/zRaceScatter.d.ts +1416 -0
- package/dist/esm/types/chartType/raceScatter/zRaceScatter.js +33 -0
- package/dist/esm/types/chartType/raceScatter/zRaceScatter.js.map +1 -0
- package/dist/esm/types/chartType/radar/radar.d.ts +1 -5
- package/dist/esm/types/chartType/rose/rose.d.ts +1 -6
- package/dist/esm/types/chartType/roseParallel/roseParallel.d.ts +1 -6
- package/dist/esm/types/chartType/scatter/scatter.d.ts +1 -5
- package/dist/esm/types/properties/chartType/chartType.d.ts +2 -1
- package/dist/esm/types/properties/chartType/chartType.js +1 -0
- package/dist/esm/types/properties/chartType/chartType.js.map +1 -1
- package/dist/esm/types/properties/config/area.d.ts +0 -38
- package/dist/esm/types/properties/config/area.js +0 -2
- package/dist/esm/types/properties/config/area.js.map +1 -1
- package/dist/esm/types/properties/config/bar.d.ts +0 -57
- package/dist/esm/types/properties/config/bar.js +0 -2
- package/dist/esm/types/properties/config/bar.js.map +1 -1
- package/dist/esm/types/properties/config/column.d.ts +0 -57
- package/dist/esm/types/properties/config/column.js +0 -2
- package/dist/esm/types/properties/config/column.js.map +1 -1
- package/dist/esm/types/properties/config/config.d.ts +1820 -441
- package/dist/esm/types/properties/config/config.js +4 -0
- package/dist/esm/types/properties/config/config.js.map +1 -1
- package/dist/esm/types/properties/config/funnel.d.ts +0 -19
- package/dist/esm/types/properties/config/funnel.js +0 -2
- package/dist/esm/types/properties/config/funnel.js.map +1 -1
- package/dist/esm/types/properties/config/heatmap.d.ts +0 -19
- package/dist/esm/types/properties/config/heatmap.js +0 -2
- package/dist/esm/types/properties/config/heatmap.js.map +1 -1
- package/dist/esm/types/properties/config/line.d.ts +0 -19
- package/dist/esm/types/properties/config/line.js +1 -3
- package/dist/esm/types/properties/config/line.js.map +1 -1
- package/dist/esm/types/properties/config/pie.d.ts +0 -57
- package/dist/esm/types/properties/config/pie.js +0 -2
- package/dist/esm/types/properties/config/pie.js.map +1 -1
- package/dist/esm/types/properties/config/race.d.ts +1706 -0
- package/dist/esm/types/properties/config/race.js +18 -0
- package/dist/esm/types/properties/config/race.js.map +1 -0
- package/dist/esm/types/properties/config/rose.d.ts +0 -38
- package/dist/esm/types/properties/config/rose.js +0 -2
- package/dist/esm/types/properties/config/rose.js.map +1 -1
- package/dist/esm/types/properties/config/scatter.d.ts +0 -19
- package/dist/esm/types/properties/config/scatter.js +0 -2
- package/dist/esm/types/properties/config/scatter.js.map +1 -1
- package/dist/esm/types/properties/measures/baseMeasure.d.ts +8 -6
- package/dist/esm/types/properties/theme/customTheme.d.ts +5548 -2790
- package/dist/esm/types/vseed.d.ts +2 -2
- package/dist/esm/types/zVseed.d.ts +3844 -0
- package/dist/esm/types/zVseed.js +4 -1
- package/dist/esm/types/zVseed.js.map +1 -1
- package/dist/umd/index.js +1599 -872
- package/dist/umd/index.js.map +1 -1
- package/package.json +8 -7
- package/dist/esm/pipeline/spec/chart/pipes/player/playerAdapter.d.ts +0 -2
- package/dist/esm/pipeline/spec/chart/pipes/player/playerAdapter.js +0 -88
- package/dist/esm/pipeline/spec/chart/pipes/player/playerAdapter.js.map +0 -1
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { groupBy } from "remeda";
|
|
2
|
+
import { isPivotChart, isVTable } from "../../../../utils/index.js";
|
|
3
|
+
import { datasetXY } from "../dataset/index.js";
|
|
4
|
+
const playerXY = (spec, context)=>{
|
|
5
|
+
const { vseed, advancedVSeed } = context;
|
|
6
|
+
const { datasetReshapeInfo, chartType } = advancedVSeed;
|
|
7
|
+
const baseConfig = advancedVSeed.config[chartType];
|
|
8
|
+
const result = datasetXY(spec, context);
|
|
9
|
+
if (!('player' in vseed) || !baseConfig || !baseConfig.player || isVTable(vseed) || isPivotChart(vseed)) return result;
|
|
10
|
+
const { player } = baseConfig;
|
|
11
|
+
const id = datasetReshapeInfo[0].id;
|
|
12
|
+
const { field, autoPlay = true, interval = 1000, loop = false, position, railColor, trackColor, sliderHandleColor, sliderHandleBorderColor, startButtonColor, pauseButtonColor, backwardButtonColor, forwardButtonColor } = player;
|
|
13
|
+
const dataGroups = groupBy(advancedVSeed.dataset, (item)=>item[field]);
|
|
14
|
+
if (result.data && 'values' in result.data) result.data.values = [];
|
|
15
|
+
const specs = Object.values(dataGroups).map((items)=>({
|
|
16
|
+
data: {
|
|
17
|
+
id: id,
|
|
18
|
+
values: items.slice(0, 10)
|
|
19
|
+
}
|
|
20
|
+
}));
|
|
21
|
+
const duration = interval;
|
|
22
|
+
const exchangeDuration = 0.6 * interval;
|
|
23
|
+
return {
|
|
24
|
+
...result,
|
|
25
|
+
stackCornerRadius: void 0,
|
|
26
|
+
animationUpdate: {
|
|
27
|
+
bar: [
|
|
28
|
+
{
|
|
29
|
+
type: 'update',
|
|
30
|
+
options: {
|
|
31
|
+
excludeChannels: [
|
|
32
|
+
'x'
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
easing: 'linear',
|
|
36
|
+
duration
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
channel: [
|
|
40
|
+
'x'
|
|
41
|
+
],
|
|
42
|
+
easing: 'circInOut',
|
|
43
|
+
duration: exchangeDuration
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
point: [
|
|
47
|
+
{
|
|
48
|
+
type: 'update',
|
|
49
|
+
easing: 'linear',
|
|
50
|
+
duration
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
line: [
|
|
54
|
+
{
|
|
55
|
+
type: 'update',
|
|
56
|
+
easing: 'linear',
|
|
57
|
+
duration
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
axis: {
|
|
61
|
+
duration: exchangeDuration,
|
|
62
|
+
easing: 'circInOut'
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
animationEnter: {
|
|
66
|
+
bar: [
|
|
67
|
+
{
|
|
68
|
+
type: 'moveIn',
|
|
69
|
+
duration: exchangeDuration,
|
|
70
|
+
easing: 'circInOut',
|
|
71
|
+
options: {
|
|
72
|
+
direction: 'x',
|
|
73
|
+
orient: 'negative'
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
animationExit: {
|
|
79
|
+
bar: [
|
|
80
|
+
{
|
|
81
|
+
type: 'fadeOut',
|
|
82
|
+
duration: exchangeDuration
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
customMark: [
|
|
87
|
+
{
|
|
88
|
+
type: 'text',
|
|
89
|
+
dataId: 'year',
|
|
90
|
+
style: {
|
|
91
|
+
textBaseline: 'bottom',
|
|
92
|
+
fontSize: 24,
|
|
93
|
+
textAlign: 'right',
|
|
94
|
+
fontFamily: 'PingFang SC',
|
|
95
|
+
fontWeight: 600,
|
|
96
|
+
text: (datum)=>datum.year,
|
|
97
|
+
x: (datum, ctx)=>ctx.vchart.getChart().getCanvasRect()?.width - 50,
|
|
98
|
+
y: (datum, ctx)=>ctx.vchart.getChart().getCanvasRect()?.height - 50,
|
|
99
|
+
fill: 'grey',
|
|
100
|
+
fillOpacity: 0.5
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
player: {
|
|
105
|
+
visible: true,
|
|
106
|
+
auto: autoPlay,
|
|
107
|
+
interval: interval,
|
|
108
|
+
loop: loop,
|
|
109
|
+
alternate: false,
|
|
110
|
+
position: 'middle',
|
|
111
|
+
orient: position,
|
|
112
|
+
type: 'discrete',
|
|
113
|
+
specs,
|
|
114
|
+
controller: {
|
|
115
|
+
visible: true,
|
|
116
|
+
start: {
|
|
117
|
+
visible: true,
|
|
118
|
+
order: 0,
|
|
119
|
+
style: {
|
|
120
|
+
fill: startButtonColor
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
pause: {
|
|
124
|
+
visible: true,
|
|
125
|
+
order: 1,
|
|
126
|
+
style: {
|
|
127
|
+
fill: pauseButtonColor
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
backward: {
|
|
131
|
+
visible: true,
|
|
132
|
+
order: 2,
|
|
133
|
+
style: {
|
|
134
|
+
fill: backwardButtonColor
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
forward: {
|
|
138
|
+
visible: true,
|
|
139
|
+
order: 3,
|
|
140
|
+
position: 'end',
|
|
141
|
+
style: {
|
|
142
|
+
fill: forwardButtonColor
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
slider: {
|
|
147
|
+
visible: true,
|
|
148
|
+
railStyle: {
|
|
149
|
+
visible: true,
|
|
150
|
+
fill: railColor,
|
|
151
|
+
['top' === position || 'bottom' === position ? 'height' : 'width']: 2
|
|
152
|
+
},
|
|
153
|
+
trackStyle: {
|
|
154
|
+
visible: true,
|
|
155
|
+
fill: trackColor,
|
|
156
|
+
['top' === position || 'bottom' === position ? 'height' : 'width']: 2
|
|
157
|
+
},
|
|
158
|
+
handlerStyle: {
|
|
159
|
+
visible: true,
|
|
160
|
+
lineWidth: 2,
|
|
161
|
+
stroke: sliderHandleBorderColor,
|
|
162
|
+
fill: sliderHandleColor,
|
|
163
|
+
size: 9
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
export { playerXY };
|
|
170
|
+
|
|
171
|
+
//# sourceMappingURL=playerXY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/player/playerXY.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/player/playerXY.ts"],"sourcesContent":["import type { IPlayerSpec, ISpec } from '@visactor/vchart'\nimport { groupBy } from 'remeda'\nimport { isPivotChart, isVTable } from 'src/pipeline/utils'\nimport type { Player, VChartSpecPipe } from 'src/types'\nimport { datasetXY } from '../dataset'\n\nexport const playerXY: VChartSpecPipe = (spec, context) => {\n const { vseed, advancedVSeed } = context\n const { datasetReshapeInfo, chartType } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { player: Player }\n const result = datasetXY(spec, context)\n\n if (!('player' in vseed) || !baseConfig || !baseConfig.player || isVTable(vseed) || isPivotChart(vseed)) {\n return result\n }\n const { player } = baseConfig\n\n const id = datasetReshapeInfo[0].id\n const {\n field,\n autoPlay = true,\n interval = 1000,\n loop = false,\n position,\n railColor,\n trackColor,\n sliderHandleColor,\n sliderHandleBorderColor,\n startButtonColor,\n pauseButtonColor,\n backwardButtonColor,\n forwardButtonColor,\n } = player\n\n const dataGroups = groupBy(advancedVSeed.dataset, (item) => item[field])\n if (result.data && 'values' in result.data) {\n result.data.values = []\n }\n const specs = Object.values(dataGroups).map((items) => ({\n data: {\n id: id,\n values: items.slice(0, 10),\n },\n }))\n\n const duration = interval\n const exchangeDuration = interval * 0.6\n return {\n ...result,\n stackCornerRadius: undefined,\n animationUpdate: {\n bar: [\n {\n type: 'update',\n options: { excludeChannels: ['x'] },\n easing: 'linear',\n duration,\n },\n {\n channel: ['x'],\n easing: 'circInOut',\n duration: exchangeDuration,\n },\n ],\n point: [\n {\n type: 'update',\n easing: 'linear',\n duration,\n },\n ],\n line: [\n {\n type: 'update',\n easing: 'linear',\n duration,\n },\n ],\n axis: {\n duration: exchangeDuration,\n easing: 'circInOut',\n },\n },\n animationEnter: {\n bar: [\n {\n type: 'moveIn',\n duration: exchangeDuration,\n easing: 'circInOut',\n options: {\n direction: 'x',\n orient: 'negative',\n },\n },\n ],\n },\n animationExit: {\n bar: [\n {\n type: 'fadeOut',\n duration: exchangeDuration,\n },\n ],\n },\n customMark: [\n {\n type: 'text',\n dataId: 'year',\n style: {\n textBaseline: 'bottom',\n fontSize: 24,\n textAlign: 'right',\n fontFamily: 'PingFang SC',\n fontWeight: 600,\n text: (datum: any) => datum.year,\n x: (datum: any, ctx: any) => {\n return ctx.vchart.getChart().getCanvasRect()?.width - 50\n },\n y: (datum: any, ctx: any) => {\n return ctx.vchart.getChart().getCanvasRect()?.height - 50\n },\n fill: 'grey',\n fillOpacity: 0.5,\n },\n },\n ],\n player: {\n visible: true,\n auto: autoPlay,\n interval: interval,\n loop: loop,\n alternate: false,\n position: 'middle',\n orient: position,\n type: 'discrete',\n specs,\n controller: {\n visible: true,\n start: { visible: true, order: 0, style: { fill: startButtonColor } },\n pause: { visible: true, order: 1, style: { fill: pauseButtonColor } },\n backward: { visible: true, order: 2, style: { fill: backwardButtonColor } },\n forward: { visible: true, order: 3, position: 'end', style: { fill: forwardButtonColor } },\n },\n slider: {\n visible: true,\n railStyle: {\n visible: true,\n fill: railColor,\n [position === 'top' || position === 'bottom' ? 'height' : 'width']: 2,\n },\n trackStyle: {\n visible: true,\n fill: trackColor,\n [position === 'top' || position === 'bottom' ? 'height' : 'width']: 2,\n },\n handlerStyle: {\n visible: true,\n lineWidth: 2,\n stroke: sliderHandleBorderColor,\n fill: sliderHandleColor,\n size: 9,\n },\n },\n } as IPlayerSpec,\n } as unknown as ISpec\n}\n"],"names":["playerXY","spec","context","vseed","advancedVSeed","datasetReshapeInfo","chartType","baseConfig","result","datasetXY","isVTable","isPivotChart","player","id","field","autoPlay","interval","loop","position","railColor","trackColor","sliderHandleColor","sliderHandleBorderColor","startButtonColor","pauseButtonColor","backwardButtonColor","forwardButtonColor","dataGroups","groupBy","item","specs","Object","items","duration","exchangeDuration","undefined","datum","ctx"],"mappings":";;;AAMO,MAAMA,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ACA,QAAQ;gBACN,SAAS;gBACT,WAAW;oBACT,SAAS;oBACT,MAAMP;oBACN,CAACD,AAAa,UAAbA,YAAsBA,AAAa,aAAbA,WAAwB,WAAW,QAAQ,EAAE;gBACtE;gBACA,YAAY;oBACV,SAAS;oBACT,MAAME;oBACN,CAACF,AAAa,UAAbA,YAAsBA,AAAa,aAAbA,WAAwB,WAAW,QAAQ,EAAE;gBACtE;gBACA,cAAc;oBACZ,SAAS;oBACT,WAAW;oBACX,QAAQI;oBACR,MAAMD;oBACN,MAAM;gBACR;YACF;QACF;IACF;AACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { yBand } from "../axes/index.js";
|
|
2
|
+
const playerYBand = (spec, context)=>{
|
|
3
|
+
const result = yBand(spec, context);
|
|
4
|
+
const bandAxis = result.axes?.find((axis)=>axis?.type === 'band');
|
|
5
|
+
if (bandAxis) {
|
|
6
|
+
bandAxis.animation = true;
|
|
7
|
+
bandAxis.width = '15%';
|
|
8
|
+
}
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
export { playerYBand };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=playerYBand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/player/playerYBand.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/player/playerYBand.ts"],"sourcesContent":["import type { VChartSpecPipe } from 'src/types'\nimport { yBand } from '../axes'\nimport type { IBarChartSpec } from '@visactor/vchart'\nimport type { ICartesianBandAxisSpec } from '@visactor/vchart/esm/component/axis'\n\nexport const playerYBand: VChartSpecPipe = (spec, context) => {\n const result = yBand(spec, context) as IBarChartSpec\n const bandAxis = result.axes?.find((axis) => axis?.type === 'band') as ICartesianBandAxisSpec\n\n if (bandAxis) {\n bandAxis.animation = true\n bandAxis.width = '15%'\n }\n return result\n}\n"],"names":["playerYBand","spec","context","result","yBand","bandAxis","axis"],"mappings":";AAKO,MAAMA,cAA8B,CAACC,MAAMC;IAChD,MAAMC,SAASC,MAAMH,MAAMC;IAC3B,MAAMG,WAAWF,OAAO,IAAI,EAAE,KAAK,CAACG,OAASA,MAAM,SAAS;IAE5D,IAAID,UAAU;QACZA,SAAS,SAAS,GAAG;QACrBA,SAAS,KAAK,GAAG;IACnB;IACA,OAAOF;AACT"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { yLinear } from "../axes/index.js";
|
|
2
|
+
const playerYLinear = (spec, context)=>{
|
|
3
|
+
const result = yLinear(spec, context);
|
|
4
|
+
const linearAxis = result.axes?.find((axis)=>axis?.type === 'linear');
|
|
5
|
+
if (linearAxis) {
|
|
6
|
+
linearAxis.animation = true;
|
|
7
|
+
linearAxis.nice = false;
|
|
8
|
+
if (linearAxis.tick) linearAxis.tick.tickStep = 10000;
|
|
9
|
+
}
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
export { playerYLinear };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=playerYLinear.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/player/playerYLinear.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/player/playerYLinear.ts"],"sourcesContent":["import type { VChartSpecPipe } from 'src/types'\nimport { yLinear } from '../axes'\nimport type { IBarChartSpec, ICartesianLinearAxisSpec } from '@visactor/vchart'\n\nexport const playerYLinear: VChartSpecPipe = (spec, context) => {\n const result = yLinear(spec, context) as IBarChartSpec\n const linearAxis = result.axes?.find((axis) => axis?.type === 'linear') as ICartesianLinearAxisSpec\n\n if (linearAxis) {\n linearAxis.animation = true\n linearAxis.nice = false\n if (linearAxis.tick) {\n linearAxis.tick.tickStep = 10000\n }\n }\n return result\n}\n"],"names":["playerYLinear","spec","context","result","yLinear","linearAxis","axis"],"mappings":";AAIO,MAAMA,gBAAgC,CAACC,MAAMC;IAClD,MAAMC,SAASC,QAAQH,MAAMC;IAC7B,MAAMG,aAAaF,OAAO,IAAI,EAAE,KAAK,CAACG,OAASA,MAAM,SAAS;IAE9D,IAAID,YAAY;QACdA,WAAW,SAAS,GAAG;QACvBA,WAAW,IAAI,GAAG;QAClB,IAAIA,WAAW,IAAI,EACjBA,WAAW,IAAI,CAAC,QAAQ,GAAG;IAE/B;IACA,OAAOF;AACT"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { groupBy } from "remeda";
|
|
2
|
+
import { isPivotChart, isVTable } from "../../../../utils/index.js";
|
|
3
|
+
import { datasetYX } from "../dataset/index.js";
|
|
4
|
+
const playerYX = (spec, context)=>{
|
|
5
|
+
const { vseed, advancedVSeed } = context;
|
|
6
|
+
const { datasetReshapeInfo, chartType } = advancedVSeed;
|
|
7
|
+
const baseConfig = advancedVSeed.config[chartType];
|
|
8
|
+
const result = datasetYX(spec, context);
|
|
9
|
+
if (!('player' in vseed) || !baseConfig || !baseConfig.player || isVTable(vseed) || isPivotChart(vseed)) return result;
|
|
10
|
+
const { player } = baseConfig;
|
|
11
|
+
const id = datasetReshapeInfo[0].id;
|
|
12
|
+
const { field, autoPlay = true, interval = 1000, loop = false, position, railColor, trackColor, sliderHandleColor, sliderHandleBorderColor, startButtonColor, pauseButtonColor, backwardButtonColor, forwardButtonColor } = player;
|
|
13
|
+
const dataGroups = groupBy(advancedVSeed.dataset, (item)=>item[field]);
|
|
14
|
+
if (result.data && 'values' in result.data) result.data.values = [];
|
|
15
|
+
const specs = Object.values(dataGroups).map((items)=>({
|
|
16
|
+
data: {
|
|
17
|
+
id: id,
|
|
18
|
+
values: items.slice(0, 10)
|
|
19
|
+
}
|
|
20
|
+
}));
|
|
21
|
+
const duration = interval;
|
|
22
|
+
const exchangeDuration = 0.6 * interval;
|
|
23
|
+
return {
|
|
24
|
+
...result,
|
|
25
|
+
stackCornerRadius: void 0,
|
|
26
|
+
animationUpdate: {
|
|
27
|
+
bar: [
|
|
28
|
+
{
|
|
29
|
+
type: 'update',
|
|
30
|
+
options: {
|
|
31
|
+
excludeChannels: [
|
|
32
|
+
'y'
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
easing: 'linear',
|
|
36
|
+
duration
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
channel: [
|
|
40
|
+
'y'
|
|
41
|
+
],
|
|
42
|
+
easing: 'circInOut',
|
|
43
|
+
duration: exchangeDuration
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
axis: {
|
|
47
|
+
duration: exchangeDuration,
|
|
48
|
+
easing: 'circInOut'
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
animationEnter: {
|
|
52
|
+
bar: [
|
|
53
|
+
{
|
|
54
|
+
type: 'moveIn',
|
|
55
|
+
duration: exchangeDuration,
|
|
56
|
+
easing: 'circInOut',
|
|
57
|
+
options: {
|
|
58
|
+
direction: 'y',
|
|
59
|
+
orient: 'negative'
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
animationExit: {
|
|
65
|
+
bar: [
|
|
66
|
+
{
|
|
67
|
+
type: 'fadeOut',
|
|
68
|
+
duration: exchangeDuration
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
customMark: [
|
|
73
|
+
{
|
|
74
|
+
type: 'text',
|
|
75
|
+
dataId: 'year',
|
|
76
|
+
style: {
|
|
77
|
+
textBaseline: 'bottom',
|
|
78
|
+
fontSize: 24,
|
|
79
|
+
textAlign: 'right',
|
|
80
|
+
fontFamily: 'PingFang SC',
|
|
81
|
+
fontWeight: 600,
|
|
82
|
+
text: (datum)=>datum.year,
|
|
83
|
+
x: (datum, ctx)=>ctx.vchart.getChart().getCanvasRect()?.width - 50,
|
|
84
|
+
y: (datum, ctx)=>ctx.vchart.getChart().getCanvasRect()?.height - 50,
|
|
85
|
+
fill: 'grey',
|
|
86
|
+
fillOpacity: 0.5
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
player: {
|
|
91
|
+
visible: true,
|
|
92
|
+
auto: autoPlay,
|
|
93
|
+
interval: interval,
|
|
94
|
+
loop: loop,
|
|
95
|
+
alternate: false,
|
|
96
|
+
position: 'middle',
|
|
97
|
+
orient: position,
|
|
98
|
+
type: 'discrete',
|
|
99
|
+
specs,
|
|
100
|
+
controller: {
|
|
101
|
+
visible: true,
|
|
102
|
+
start: {
|
|
103
|
+
visible: true,
|
|
104
|
+
order: 0,
|
|
105
|
+
style: {
|
|
106
|
+
fill: startButtonColor
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
pause: {
|
|
110
|
+
visible: true,
|
|
111
|
+
order: 1,
|
|
112
|
+
style: {
|
|
113
|
+
fill: pauseButtonColor
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
backward: {
|
|
117
|
+
visible: true,
|
|
118
|
+
order: 2,
|
|
119
|
+
style: {
|
|
120
|
+
fill: backwardButtonColor
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
forward: {
|
|
124
|
+
visible: true,
|
|
125
|
+
order: 3,
|
|
126
|
+
position: 'end',
|
|
127
|
+
style: {
|
|
128
|
+
fill: forwardButtonColor
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
slider: {
|
|
133
|
+
visible: true,
|
|
134
|
+
railStyle: {
|
|
135
|
+
visible: true,
|
|
136
|
+
fill: railColor,
|
|
137
|
+
['top' === position || 'bottom' === position ? 'height' : 'width']: 2
|
|
138
|
+
},
|
|
139
|
+
trackStyle: {
|
|
140
|
+
visible: true,
|
|
141
|
+
fill: trackColor,
|
|
142
|
+
['top' === position || 'bottom' === position ? 'height' : 'width']: 2
|
|
143
|
+
},
|
|
144
|
+
handlerStyle: {
|
|
145
|
+
visible: true,
|
|
146
|
+
lineWidth: 2,
|
|
147
|
+
stroke: sliderHandleBorderColor,
|
|
148
|
+
fill: sliderHandleColor,
|
|
149
|
+
size: 9
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
export { playerYX };
|
|
156
|
+
|
|
157
|
+
//# sourceMappingURL=playerYX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/player/playerYX.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/player/playerYX.ts"],"sourcesContent":["import type { IPlayerSpec, ISpec } from '@visactor/vchart'\nimport { groupBy } from 'remeda'\nimport { isPivotChart, isVTable } from 'src/pipeline/utils'\nimport type { Player, VChartSpecPipe } from 'src/types'\nimport { datasetYX } from '../dataset'\n\nexport const playerYX: VChartSpecPipe = (spec, context) => {\n const { vseed, advancedVSeed } = context\n const { datasetReshapeInfo, chartType } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { player: Player }\n const result = datasetYX(spec, context)\n\n if (!('player' in vseed) || !baseConfig || !baseConfig.player || isVTable(vseed) || isPivotChart(vseed)) {\n return result\n }\n const { player } = baseConfig\n\n const id = datasetReshapeInfo[0].id\n const {\n field,\n autoPlay = true,\n interval = 1000,\n loop = false,\n position,\n railColor,\n trackColor,\n sliderHandleColor,\n sliderHandleBorderColor,\n startButtonColor,\n pauseButtonColor,\n backwardButtonColor,\n forwardButtonColor,\n } = player\n\n const dataGroups = groupBy(advancedVSeed.dataset, (item) => item[field])\n if (result.data && 'values' in result.data) {\n result.data.values = []\n }\n const specs = Object.values(dataGroups).map((items) => ({\n data: {\n id: id,\n values: items.slice(0, 10),\n },\n }))\n\n const duration = interval\n const exchangeDuration = interval * 0.6\n return {\n ...result,\n stackCornerRadius: undefined,\n animationUpdate: {\n bar: [\n {\n type: 'update',\n options: { excludeChannels: ['y'] },\n easing: 'linear',\n duration,\n },\n {\n channel: ['y'],\n easing: 'circInOut',\n duration: exchangeDuration,\n },\n ],\n axis: {\n duration: exchangeDuration,\n easing: 'circInOut',\n },\n },\n animationEnter: {\n bar: [\n {\n type: 'moveIn',\n duration: exchangeDuration,\n easing: 'circInOut',\n options: {\n direction: 'y',\n orient: 'negative',\n },\n },\n ],\n },\n animationExit: {\n bar: [\n {\n type: 'fadeOut',\n duration: exchangeDuration,\n },\n ],\n },\n customMark: [\n {\n type: 'text',\n dataId: 'year',\n style: {\n textBaseline: 'bottom',\n fontSize: 24,\n textAlign: 'right',\n fontFamily: 'PingFang SC',\n fontWeight: 600,\n text: (datum: any) => datum.year,\n x: (datum: any, ctx: any) => {\n return ctx.vchart.getChart().getCanvasRect()?.width - 50\n },\n y: (datum: any, ctx: any) => {\n return ctx.vchart.getChart().getCanvasRect()?.height - 50\n },\n fill: 'grey',\n fillOpacity: 0.5,\n },\n },\n ],\n player: {\n visible: true,\n auto: autoPlay,\n interval: interval,\n loop: loop,\n alternate: false,\n position: 'middle',\n orient: position,\n type: 'discrete',\n specs,\n controller: {\n visible: true,\n start: { visible: true, order: 0, style: { fill: startButtonColor } },\n pause: { visible: true, order: 1, style: { fill: pauseButtonColor } },\n backward: { visible: true, order: 2, style: { fill: backwardButtonColor } },\n forward: { visible: true, order: 3, position: 'end', style: { fill: forwardButtonColor } },\n },\n slider: {\n visible: true,\n railStyle: {\n visible: true,\n fill: railColor,\n [position === 'top' || position === 'bottom' ? 'height' : 'width']: 2,\n },\n trackStyle: {\n visible: true,\n fill: trackColor,\n [position === 'top' || position === 'bottom' ? 'height' : 'width']: 2,\n },\n handlerStyle: {\n visible: true,\n lineWidth: 2,\n stroke: sliderHandleBorderColor,\n fill: sliderHandleColor,\n size: 9,\n },\n },\n } as IPlayerSpec,\n } as unknown as ISpec\n}\n"],"names":["playerYX","spec","context","vseed","advancedVSeed","datasetReshapeInfo","chartType","baseConfig","result","datasetYX","isVTable","isPivotChart","player","id","field","autoPlay","interval","loop","position","railColor","trackColor","sliderHandleColor","sliderHandleBorderColor","startButtonColor","pauseButtonColor","backwardButtonColor","forwardButtonColor","dataGroups","groupBy","item","specs","Object","items","duration","exchangeDuration","undefined","datum","ctx"],"m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AAbA,WAAwB,WAAW,QAAQ,EAAE;gBACtE;gBACA,YAAY;oBACV,SAAS;oBACT,MAAME;oBACN,CAACF,AAAa,UAAbA,YAAsBA,AAAa,aAAbA,WAAwB,WAAW,QAAQ,EAAE;gBACtE;gBACA,cAAc;oBACZ,SAAS;oBACT,WAAW;oBACX,QAAQI;oBACR,MAAMD;oBACN,MAAM;gBACR;YACF;QACF;IACF;AACF"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { groupBy } from "remeda";
|
|
2
|
+
import { isPivotChart, isVTable } from "../../../../utils/index.js";
|
|
3
|
+
import { datasetScatter } from "../dataset/index.js";
|
|
4
|
+
const playerYY = (spec, context)=>{
|
|
5
|
+
const { vseed, advancedVSeed } = context;
|
|
6
|
+
const { datasetReshapeInfo, chartType, encoding } = advancedVSeed;
|
|
7
|
+
const baseConfig = advancedVSeed.config[chartType];
|
|
8
|
+
const result = datasetScatter(spec, context);
|
|
9
|
+
if (!('player' in vseed) || !baseConfig || !baseConfig.player || isVTable(vseed) || isPivotChart(vseed)) return result;
|
|
10
|
+
const { player } = baseConfig;
|
|
11
|
+
const id = datasetReshapeInfo[0].id;
|
|
12
|
+
const { field, autoPlay = true, interval = 1000, loop = false, position, railColor, trackColor, sliderHandleColor, sliderHandleBorderColor, startButtonColor, pauseButtonColor, backwardButtonColor, forwardButtonColor } = player;
|
|
13
|
+
const dataGroups = groupBy(advancedVSeed.dataset, (item)=>item[field]);
|
|
14
|
+
if (result.data && 'values' in result.data) result.data.values = [];
|
|
15
|
+
const specs = Object.values(dataGroups).map((items)=>({
|
|
16
|
+
data: {
|
|
17
|
+
id: id,
|
|
18
|
+
values: items
|
|
19
|
+
}
|
|
20
|
+
}));
|
|
21
|
+
const dataKey = encoding.color;
|
|
22
|
+
const duration = interval;
|
|
23
|
+
const exchangeDuration = 0.6 * interval;
|
|
24
|
+
return {
|
|
25
|
+
...result,
|
|
26
|
+
dataKey,
|
|
27
|
+
stackCornerRadius: void 0,
|
|
28
|
+
animationUpdate: {
|
|
29
|
+
bar: [
|
|
30
|
+
{
|
|
31
|
+
type: 'update',
|
|
32
|
+
options: {
|
|
33
|
+
excludeChannels: [
|
|
34
|
+
'x'
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
easing: 'linear',
|
|
38
|
+
duration
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
channel: [
|
|
42
|
+
'x'
|
|
43
|
+
],
|
|
44
|
+
easing: 'circInOut',
|
|
45
|
+
duration: exchangeDuration
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
point: [
|
|
49
|
+
{
|
|
50
|
+
type: 'update',
|
|
51
|
+
easing: 'linear',
|
|
52
|
+
duration
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
line: [
|
|
56
|
+
{
|
|
57
|
+
type: 'update',
|
|
58
|
+
easing: 'linear',
|
|
59
|
+
duration
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
axis: {
|
|
63
|
+
duration: exchangeDuration,
|
|
64
|
+
easing: 'circInOut'
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
animationEnter: {
|
|
68
|
+
bar: [
|
|
69
|
+
{
|
|
70
|
+
type: 'moveIn',
|
|
71
|
+
duration: exchangeDuration,
|
|
72
|
+
easing: 'circInOut',
|
|
73
|
+
options: {
|
|
74
|
+
direction: 'x',
|
|
75
|
+
orient: 'negative'
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
animationExit: {
|
|
81
|
+
bar: [
|
|
82
|
+
{
|
|
83
|
+
type: 'fadeOut',
|
|
84
|
+
duration: exchangeDuration
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
customMark: [
|
|
89
|
+
{
|
|
90
|
+
type: 'text',
|
|
91
|
+
dataId: 'year',
|
|
92
|
+
style: {
|
|
93
|
+
textBaseline: 'bottom',
|
|
94
|
+
fontSize: 24,
|
|
95
|
+
textAlign: 'right',
|
|
96
|
+
fontFamily: 'PingFang SC',
|
|
97
|
+
fontWeight: 600,
|
|
98
|
+
text: (datum)=>datum.year,
|
|
99
|
+
x: (datum, ctx)=>ctx.vchart.getChart().getCanvasRect()?.width - 50,
|
|
100
|
+
y: (datum, ctx)=>ctx.vchart.getChart().getCanvasRect()?.height - 50,
|
|
101
|
+
fill: 'grey',
|
|
102
|
+
fillOpacity: 0.5
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
player: {
|
|
107
|
+
visible: true,
|
|
108
|
+
auto: autoPlay,
|
|
109
|
+
interval: interval,
|
|
110
|
+
loop: loop,
|
|
111
|
+
alternate: false,
|
|
112
|
+
position: 'middle',
|
|
113
|
+
orient: position,
|
|
114
|
+
type: 'discrete',
|
|
115
|
+
specs,
|
|
116
|
+
controller: {
|
|
117
|
+
visible: true,
|
|
118
|
+
start: {
|
|
119
|
+
visible: true,
|
|
120
|
+
order: 0,
|
|
121
|
+
style: {
|
|
122
|
+
fill: startButtonColor
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
pause: {
|
|
126
|
+
visible: true,
|
|
127
|
+
order: 1,
|
|
128
|
+
style: {
|
|
129
|
+
fill: pauseButtonColor
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
backward: {
|
|
133
|
+
visible: true,
|
|
134
|
+
order: 2,
|
|
135
|
+
style: {
|
|
136
|
+
fill: backwardButtonColor
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
forward: {
|
|
140
|
+
visible: true,
|
|
141
|
+
order: 3,
|
|
142
|
+
position: 'end',
|
|
143
|
+
style: {
|
|
144
|
+
fill: forwardButtonColor
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
slider: {
|
|
149
|
+
visible: true,
|
|
150
|
+
railStyle: {
|
|
151
|
+
visible: true,
|
|
152
|
+
fill: railColor,
|
|
153
|
+
['top' === position || 'bottom' === position ? 'height' : 'width']: 2
|
|
154
|
+
},
|
|
155
|
+
trackStyle: {
|
|
156
|
+
visible: true,
|
|
157
|
+
fill: trackColor,
|
|
158
|
+
['top' === position || 'bottom' === position ? 'height' : 'width']: 2
|
|
159
|
+
},
|
|
160
|
+
handlerStyle: {
|
|
161
|
+
visible: true,
|
|
162
|
+
lineWidth: 2,
|
|
163
|
+
stroke: sliderHandleBorderColor,
|
|
164
|
+
fill: sliderHandleColor,
|
|
165
|
+
size: 9
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
export { playerYY };
|
|
172
|
+
|
|
173
|
+
//# sourceMappingURL=playerYY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/player/playerYY.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/player/playerYY.ts"],"sourcesContent":["import type { IPlayerSpec, ISpec } from '@visactor/vchart'\nimport { groupBy } from 'remeda'\nimport { isPivotChart, isVTable } from 'src/pipeline/utils'\nimport type { Player, VChartSpecPipe } from 'src/types'\nimport { datasetScatter } from '../dataset'\n\nexport const playerYY: VChartSpecPipe = (spec, context) => {\n const { vseed, advancedVSeed } = context\n const { datasetReshapeInfo, chartType, encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { player: Player }\n const result = datasetScatter(spec, context)\n\n if (!('player' in vseed) || !baseConfig || !baseConfig.player || isVTable(vseed) || isPivotChart(vseed)) {\n return result\n }\n const { player } = baseConfig\n\n const id = datasetReshapeInfo[0].id\n const {\n field,\n autoPlay = true,\n interval = 1000,\n loop = false,\n position,\n railColor,\n trackColor,\n sliderHandleColor,\n sliderHandleBorderColor,\n startButtonColor,\n pauseButtonColor,\n backwardButtonColor,\n forwardButtonColor,\n } = player\n\n const dataGroups = groupBy(advancedVSeed.dataset, (item) => item[field])\n if (result.data && 'values' in result.data) {\n result.data.values = []\n }\n const specs = Object.values(dataGroups).map((items) => ({\n data: {\n id: id,\n values: items,\n },\n }))\n\n const dataKey = encoding.color\n const duration = interval\n const exchangeDuration = interval * 0.6\n return {\n ...result,\n dataKey,\n stackCornerRadius: undefined,\n animationUpdate: {\n bar: [\n {\n type: 'update',\n options: { excludeChannels: ['x'] },\n easing: 'linear',\n duration,\n },\n {\n channel: ['x'],\n easing: 'circInOut',\n duration: exchangeDuration,\n },\n ],\n point: [\n {\n type: 'update',\n easing: 'linear',\n duration,\n },\n ],\n line: [\n {\n type: 'update',\n easing: 'linear',\n duration,\n },\n ],\n axis: {\n duration: exchangeDuration,\n easing: 'circInOut',\n },\n },\n animationEnter: {\n bar: [\n {\n type: 'moveIn',\n duration: exchangeDuration,\n easing: 'circInOut',\n options: {\n direction: 'x',\n orient: 'negative',\n },\n },\n ],\n },\n animationExit: {\n bar: [\n {\n type: 'fadeOut',\n duration: exchangeDuration,\n },\n ],\n },\n customMark: [\n {\n type: 'text',\n dataId: 'year',\n style: {\n textBaseline: 'bottom',\n fontSize: 24,\n textAlign: 'right',\n fontFamily: 'PingFang SC',\n fontWeight: 600,\n text: (datum: any) => datum.year,\n x: (datum: any, ctx: any) => {\n return ctx.vchart.getChart().getCanvasRect()?.width - 50\n },\n y: (datum: any, ctx: any) => {\n return ctx.vchart.getChart().getCanvasRect()?.height - 50\n },\n fill: 'grey',\n fillOpacity: 0.5,\n },\n },\n ],\n player: {\n visible: true,\n auto: autoPlay,\n interval: interval,\n loop: loop,\n alternate: false,\n position: 'middle',\n orient: position,\n type: 'discrete',\n specs,\n controller: {\n visible: true,\n start: { visible: true, order: 0, style: { fill: startButtonColor } },\n pause: { visible: true, order: 1, style: { fill: pauseButtonColor } },\n backward: { visible: true, order: 2, style: { fill: backwardButtonColor } },\n forward: { visible: true, order: 3, position: 'end', style: { fill: forwardButtonColor } },\n },\n slider: {\n visible: true,\n railStyle: {\n visible: true,\n fill: railColor,\n [position === 'top' || position === 'bottom' ? 'height' : 'width']: 2,\n },\n trackStyle: {\n visible: true,\n fill: trackColor,\n [position === 'top' || position === 'bottom' ? 'height' : 'width']: 2,\n },\n handlerStyle: {\n visible: true,\n lineWidth: 2,\n stroke: sliderHandleBorderColor,\n fill: sliderHandleColor,\n size: 9,\n },\n },\n } as IPlayerSpec,\n } as unknown as ISpec\n}\n"],"names":["playerYY","spec","context","vseed","advancedVSeed","datasetReshapeInfo","chartType","encoding","baseConfig","result","datasetScatter","isVTable","isPivotChart","player","id","field","autoPlay","interval","loop","position","railColor","trackColor","sliderHandleColor","sliderHandleBorderColor","startButtonColor","pauseButtonColor","backwardButtonColor","forwardButtonColor","dataGroups","groupBy","item","specs","Object","items","dataKey","duration","exchangeDuration","undefined","datum","ctx"],"mappings":";;;AAMO,MAAMA,WAA2B,CAACC,MAAMC;IAC7C,MAAM,EAAEC,KAAK,EAAEC,aAAa,EAAE,GAAGF;IACjC,MAAM,EAAEG,kBAAkB,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGH;IACpD,MAAMI,aAAaJ,cAAc,MAAM,CAACE,UAAU;IAClD,MAAMG,SAASC,eAAeT,MAAMC;IAEpC,IAAI,CAAE,aAAYC,KAAI,KAAM,CAACK,cAAc,CAACA,WAAW,MAAM,IAAIG,SAASR,UAAUS,aAAaT,QAC/F,OAAOM;IAET,MAAM,EAAEI,MAAM,EAAE,GAAGL;IAEnB,MAAMM,KAAKT,kBAAkB,CAAC,EAAE,CAAC,EAAE;IACnC,MAAM,EACJU,KAAK,EACLC,WAAW,IAAI,EACfC,WAAW,IAAI,EACfC,OAAO,KAAK,EACZC,QAAQ,EACRC,SAAS,EACTC,UAAU,EACVC,iBAAiB,EACjBC,uBAAuB,EACvBC,gBAAgB,EAChBC,gBAAgB,EAChBC,mBAAmB,EACnBC,kBAAkB,EACnB,GAAGd;IAEJ,MAAMe,aAAaC,QAAQzB,cAAc,OAAO,EAAE,CAAC0B,OAASA,IAAI,CAACf,MAAM;IACvE,IAAIN,OAAO,IAAI,IAAI,YAAYA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BACf;YACF;SACD;QACD,QAAQ;YACN,SAAS;YACT,MAAMvB;YACN,UAAUC;YACV,MAAMC;YACN,WAAW;YACX,UAAU;YACV,QAAQC;YACR,MAAM;YACNY;YACA,YAAY;gBACV,SAAS;gBACT,OAAO;oBAAE,SAAS;oBAAM,OAAO;oBAAG,OAAO;wBAAE,MAAMP;oBAAiB;gBAAE;gBACpE,OAAO;oBAAE,SAAS;oBAAM,OAAO;oBAAG,OAAO;wBAAE,MAAMC;oBAAiB;gBAAE;gBACpE,UAAU;oBAAE,SAAS;oBAAM,OAAO;oBAAG,OAAO;wBAAE,MAAMC;oBAAoB;gBAAE;gBAC1E,SAAS;oBAAE,SAAS;oBAAM,OAAO;oBAAG,UAAU;oBAAO,OAAO;wBAAE,MAAMC;oBAAmB;gBAAE;YAC3F;YACA,QAAQ;gBACN,SAAS;gBACT,WAAW;oBACT,SAAS;oBACT,MAAMP;oBACN,CAACD,AAAa,UAAbA,YAAsBA,AAAa,aAAbA,WAAwB,WAAW,QAAQ,EAAE;gBACtE;gBACA,YAAY;oBACV,SAAS;oBACT,MAAME;oBACN,CAACF,AAAa,UAAbA,YAAsBA,AAAa,aAAbA,WAAwB,WAAW,QAAQ,EAAE;gBACtE;gBACA,cAAc;oBACZ,SAAS;oBACT,WAAW;oBACX,QAAQI;oBACR,MAAMD;oBACN,MAAM;gBACR;YACF;QACF;IACF;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/utils/condition.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/utils/condition.ts"],"sourcesContent":["import type { SpecPipelineContext, SpecPipe } from 'src/types'\n\nexport type Condition = (context: SpecPipelineContext) => boolean\n\nexport const condition = <T extends SpecPipe>(condition: Condition, truePipe: T, falsePipe: T): T => {\n return ((spec: any, context: SpecPipelineContext) => {\n if (condition(context)) {\n return truePipe(spec, context)\n }\n return falsePipe(spec, context)\n }) as T\n}\n"],"names":["condition","truePipe","falsePipe","spec","context"],"mappings":"AAIO,MAAMA,sBAAY,CAAqBA,WAAsBC,UAAaC,YACvE,CAACC,MAAWC;QAClB,IAAIJ,UAAUI,UACZ,OAAOH,SAASE,MAAMC;QAExB,OAAOF,UAAUC,MAAMC;IACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './condition';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./condition.js";
|
|
@@ -5,7 +5,7 @@ export declare const isRadar: (vseed: VSeed) => vseed is import("../../types").R
|
|
|
5
5
|
export declare const isAreaPercent: (vseed: VSeed) => vseed is import("../../types").AreaPercent;
|
|
6
6
|
export declare const isColumnPercent: (vseed: VSeed) => vseed is import("../../types").ColumnPercent;
|
|
7
7
|
export declare const isBarPercent: (vseed: VSeed) => vseed is import("../../types").BarPercent;
|
|
8
|
-
export declare const isBarLikeChart: (vseed: VSeed) => vseed is import("../../types").Bar | import("../../types").BarParallel | import("../../types").BarPercent;
|
|
8
|
+
export declare const isBarLikeChart: (vseed: VSeed) => vseed is import("../../types").Bar | import("../../types").RaceBar | import("../../types").BarParallel | import("../../types").BarPercent;
|
|
9
9
|
export declare const isVTable: (vseed: VSeed) => boolean;
|
|
10
10
|
export declare const isVChart: (vseed: VSeed) => boolean;
|
|
11
11
|
/**
|