@visactor/vseed 0.1.12 → 0.1.14
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/advanced/colorItems.js +3 -2
- package/dist/esm/builder/builder/advanced/colorItems.js.map +1 -1
- package/dist/esm/builder/builder/build.js +0 -2
- package/dist/esm/builder/builder/build.js.map +1 -1
- package/dist/esm/builder/builder/buildAdvanced.js +3 -1
- package/dist/esm/builder/builder/buildAdvanced.js.map +1 -1
- package/dist/esm/builder/builder/buildSpec.js +3 -1
- package/dist/esm/builder/builder/buildSpec.js.map +1 -1
- package/dist/esm/builder/builder/builder.d.ts +2629 -121
- package/dist/esm/builder/builder/builder.js +1 -1
- package/dist/esm/builder/builder/builder.js.map +1 -1
- package/dist/esm/dataReshape/foldMeasures.js +16 -16
- package/dist/esm/dataReshape/foldMeasures.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/area.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/area.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/areaPercent.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/areaPercent.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/bar.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/bar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/barParallel.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/barParallel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/barPercent.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/barPercent.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/column.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/column.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/columnParallel.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/columnParallel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/columnPercent.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/columnPercent.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/donut.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/donut.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/dualAxis.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/funnel.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/funnel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/heatmap.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/heatmap.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/line.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/line.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/pie.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/pie.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/radar.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/radar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/rose.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/rose.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/roseParallel.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/roseParallel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js +3 -2
- package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/deleteTooltipAndLabelDimensions.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/deleteTooltipAndLabelDimensions.js +12 -0
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/deleteTooltipAndLabelDimensions.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/index.d.ts +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/index.js +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/{encodingAdapter.d.ts → adapter/encodingAdapter.d.ts} +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/{encodingAdapter.js → adapter/encodingAdapter.js} +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/adapter/encodingAdapter.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/adapter/index.d.ts +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/adapter/index.js +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/bar.js +12 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/bar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/color/addColorToEncoding.d.ts +8 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/color/addColorToEncoding.js +13 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/color/addColorToEncoding.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/color/index.d.ts +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/color/index.js +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/column.js +12 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/column.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/dualAxis.js +12 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/funnel.js +12 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/funnel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/heatmap.js +12 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/heatmap.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/index.d.ts +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/index.js +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/line.js +12 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/line.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/pie.js +12 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/pie.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/radar.js +12 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/radar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/rose.js +12 -6
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/rose.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/scatter.js +10 -4
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/scatter.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/index.d.ts +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/index.js +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/measures/deleteTooltipAndLabelMeasure.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/measures/deleteTooltipAndLabelMeasure.js +12 -0
- package/dist/esm/pipeline/advanced/chart/pipes/measures/deleteTooltipAndLabelMeasure.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/measures/index.d.ts +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/measures/index.js +2 -2
- package/dist/esm/pipeline/advanced/table/pipes/init/index.d.ts +0 -1
- package/dist/esm/pipeline/advanced/table/pipes/init/index.js +0 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/angle.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/angle.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/axes/radius.js +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/axes/radius.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/dual/dualChartType.js +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/dual/dualChartType.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js +56 -22
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/colorLegend.js +3 -3
- package/dist/esm/pipeline/spec/chart/pipes/legend/colorLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/discreteLegend.js +4 -4
- package/dist/esm/pipeline/spec/chart/pipes/legend/discreteLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.js +5 -5
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.js +4 -4
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotDiscreteLegend.js.map +1 -1
- package/dist/esm/pipeline/utils/dimensions/delete.d.ts +8 -0
- package/dist/esm/pipeline/utils/dimensions/delete.js +40 -0
- package/dist/esm/pipeline/utils/dimensions/delete.js.map +1 -0
- package/dist/esm/pipeline/utils/dimensions/find.d.ts +0 -2
- package/dist/esm/pipeline/utils/dimensions/find.js +0 -13
- package/dist/esm/pipeline/utils/dimensions/index.d.ts +2 -1
- package/dist/esm/pipeline/utils/dimensions/index.js +2 -1
- package/dist/esm/pipeline/utils/dimensions/typeGuard.d.ts +3 -0
- package/dist/esm/pipeline/utils/dimensions/typeGuard.js +5 -0
- package/dist/esm/pipeline/utils/dimensions/typeGuard.js.map +1 -0
- package/dist/esm/theme/dark.js +22 -5
- package/dist/esm/theme/dark.js.map +1 -1
- package/dist/esm/theme/light.js +22 -5
- package/dist/esm/theme/light.js.map +1 -1
- package/dist/esm/types/advancedVSeed.d.ts +1564 -76
- package/dist/esm/types/chartType/area/zArea.d.ts +43 -2
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +43 -2
- package/dist/esm/types/chartType/bar/zBar.d.ts +43 -2
- package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +43 -2
- package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +43 -2
- package/dist/esm/types/chartType/column/zColumn.d.ts +43 -2
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +43 -2
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +43 -2
- package/dist/esm/types/chartType/donut/zDonut.d.ts +43 -2
- package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +43 -2
- package/dist/esm/types/chartType/funnel/zFunnel.d.ts +42 -1
- package/dist/esm/types/chartType/heatmap/zHeatmap.d.ts +42 -1
- package/dist/esm/types/chartType/line/zLine.d.ts +43 -2
- package/dist/esm/types/chartType/pie/zPie.d.ts +43 -2
- package/dist/esm/types/chartType/radar/zRadar.d.ts +43 -2
- package/dist/esm/types/chartType/rose/zRose.d.ts +43 -2
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +43 -2
- package/dist/esm/types/chartType/scatter/zScatter.d.ts +43 -2
- package/dist/esm/types/properties/config/axes/axis.d.ts +0 -47
- package/dist/esm/types/properties/config/axes/axis.js +0 -54
- package/dist/esm/types/properties/config/axes/bandAxis.d.ts +0 -79
- package/dist/esm/types/properties/config/axes/bandAxis.js +0 -48
- package/dist/esm/types/properties/config/axes/index.d.ts +6 -3
- package/dist/esm/types/properties/config/axes/index.js +3 -3
- package/dist/esm/types/properties/config/axes/linearAxis.d.ts +0 -81
- package/dist/esm/types/properties/config/axes/linearAxis.js +0 -45
- package/dist/esm/types/properties/config/axes/zAxis.d.ts +47 -0
- package/dist/esm/types/properties/config/axes/zAxis.js +54 -0
- package/dist/esm/types/properties/config/axes/zAxis.js.map +1 -0
- package/dist/esm/types/properties/config/axes/zBandAxis.d.ts +79 -0
- package/dist/esm/types/properties/config/axes/zBandAxis.js +48 -0
- package/dist/esm/types/properties/config/axes/zBandAxis.js.map +1 -0
- package/dist/esm/types/properties/config/axes/zLinearAxis.d.ts +81 -0
- package/dist/esm/types/properties/config/axes/zLinearAxis.js +45 -0
- package/dist/esm/types/properties/config/axes/zLinearAxis.js.map +1 -0
- package/dist/esm/types/properties/config/config.d.ts +1548 -73
- package/dist/esm/types/properties/config/config.js +2 -3
- package/dist/esm/types/properties/config/config.js.map +1 -1
- package/dist/esm/types/properties/config/label/index.d.ts +2 -1
- package/dist/esm/types/properties/config/label/index.js +1 -1
- package/dist/esm/types/properties/config/label/label.d.ts +52 -6
- package/dist/esm/types/properties/config/label/label.js +0 -7
- package/dist/esm/types/properties/config/label/zLabel.d.ts +45 -0
- package/dist/esm/types/properties/config/label/zLabel.js +20 -0
- package/dist/esm/types/properties/config/label/zLabel.js.map +1 -0
- package/dist/esm/types/properties/config/legend/legend.d.ts +6 -2
- package/dist/esm/types/properties/config/legend/legend.js +1 -1
- package/dist/esm/types/properties/config/legend/legend.js.map +1 -1
- package/dist/esm/types/properties/datasetReshapeInfo/datasetReshapeInfo.d.ts +8 -2
- package/dist/esm/types/properties/datasetReshapeInfo/zDatasetReshapeInfo.d.ts +24 -6
- package/dist/esm/types/properties/datasetReshapeInfo/zDatasetReshapeInfo.js +8 -2
- package/dist/esm/types/properties/datasetReshapeInfo/zDatasetReshapeInfo.js.map +1 -1
- package/dist/esm/types/properties/theme/customTheme.d.ts +1548 -72
- package/dist/esm/types/zVseed.d.ts +779 -41
- package/dist/umd/index.js +488 -282
- package/dist/umd/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/encodingAdapter.js.map +0 -1
- package/dist/esm/pipeline/advanced/chart/pipes/measures/deleteTooltipMeasure.d.ts +0 -2
- package/dist/esm/pipeline/advanced/chart/pipes/measures/deleteTooltipMeasure.js +0 -12
- package/dist/esm/pipeline/advanced/chart/pipes/measures/deleteTooltipMeasure.js.map +0 -1
- package/dist/esm/pipeline/advanced/table/pipes/init/autoPivotDimensions.d.ts +0 -2
- package/dist/esm/pipeline/advanced/table/pipes/init/autoPivotDimensions.js +0 -52
- package/dist/esm/pipeline/advanced/table/pipes/init/autoPivotDimensions.js.map +0 -1
- package/dist/esm/pipeline/utils/dimensions/find.js.map +0 -1
- package/dist/esm/types/properties/config/axes/axis.js.map +0 -1
- package/dist/esm/types/properties/config/axes/bandAxis.js.map +0 -1
- package/dist/esm/types/properties/config/axes/linearAxis.js.map +0 -1
- package/dist/esm/types/properties/config/label/label.js.map +0 -1
package/dist/umd/index.js
CHANGED
@@ -87,6 +87,7 @@
|
|
87
87
|
zCrosshairRect: ()=>zCrosshairRect,
|
88
88
|
scatterSpecPipeline: ()=>scatterSpecPipeline,
|
89
89
|
intl: ()=>intl,
|
90
|
+
zXLinearAxis: ()=>zXLinearAxis,
|
90
91
|
zScatterMeasures: ()=>zScatterMeasures,
|
91
92
|
columnPercentAdvancedPipeline: ()=>columnPercentAdvancedPipeline,
|
92
93
|
zColumnConfig: ()=>zColumnConfig,
|
@@ -122,7 +123,6 @@
|
|
122
123
|
zNumFormat: ()=>zNumFormat,
|
123
124
|
DimensionEncodingEnum: ()=>DimensionEncodingEnum,
|
124
125
|
barPercentAdvancedPipeline: ()=>barPercentAdvancedPipeline,
|
125
|
-
findAllDimensions: ()=>findAllDimensions,
|
126
126
|
FoldYMeasureValue: ()=>FoldYMeasureValue,
|
127
127
|
zPivotTableConfig: ()=>zPivotTableConfig,
|
128
128
|
zArea: ()=>zArea,
|
@@ -146,23 +146,23 @@
|
|
146
146
|
registerColumnPercent: ()=>registerColumnPercent,
|
147
147
|
registerHeatmap: ()=>registerHeatmap,
|
148
148
|
registerBarPercent: ()=>registerBarPercent,
|
149
|
-
roseSpecPipeline: ()=>roseSpecPipeline,
|
150
149
|
ColorIdEncoding: ()=>ColorIdEncoding,
|
150
|
+
roseSpecPipeline: ()=>roseSpecPipeline,
|
151
151
|
zCrosshairLine: ()=>zCrosshairLine,
|
152
152
|
registerLightTheme: ()=>registerLightTheme,
|
153
153
|
roseAdvancedPipeline: ()=>roseAdvancedPipeline,
|
154
154
|
zBarParallel: ()=>zBarParallel,
|
155
|
-
isPartialDatumSelector: ()=>isPartialDatumSelector,
|
156
|
-
registerPivotTable: ()=>registerPivotTable,
|
157
155
|
registerDarkTheme: ()=>registerDarkTheme,
|
156
|
+
registerPivotTable: ()=>registerPivotTable,
|
157
|
+
isPartialDatumSelector: ()=>isPartialDatumSelector,
|
158
158
|
pieSpecPipeline: ()=>pieSpecPipeline,
|
159
|
+
isDimensionGroup: ()=>isDimensionGroup,
|
159
160
|
dualAxisSpecPipeline: ()=>dualAxisSpecPipeline,
|
160
161
|
tableAdvancedPipeline: ()=>tableAdvancedPipeline,
|
161
|
-
zAnnotationVerticalLine: ()=>zAnnotationVerticalLine,
|
162
162
|
barSpecPipeline: ()=>barSpecPipeline,
|
163
|
-
|
163
|
+
zAnnotationVerticalLine: ()=>zAnnotationVerticalLine,
|
164
164
|
registerRose: ()=>registerRose,
|
165
|
-
|
165
|
+
zChartType: ()=>zChartType,
|
166
166
|
unfoldDimensions: ()=>unfoldDimensions,
|
167
167
|
roseParallelAdvancedPipeline: ()=>roseParallelAdvancedPipeline,
|
168
168
|
registerTable: ()=>registerTable,
|
@@ -174,9 +174,9 @@
|
|
174
174
|
isVChart: ()=>isVChart,
|
175
175
|
radarSpecPipeline: ()=>radarSpecPipeline,
|
176
176
|
Builder: ()=>Builder,
|
177
|
+
zMeasureTree: ()=>zMeasureTree,
|
177
178
|
zPieConfig: ()=>zPieConfig,
|
178
179
|
zPivotTable: ()=>zPivotTable,
|
179
|
-
zRadar: ()=>zRadar,
|
180
180
|
registerLine: ()=>registerLine,
|
181
181
|
registerCustomTheme: ()=>registerCustomTheme,
|
182
182
|
zColor: ()=>zColor,
|
@@ -196,17 +196,18 @@
|
|
196
196
|
zAxis: ()=>zAxis,
|
197
197
|
isVTable: ()=>isVTable,
|
198
198
|
zMeasures: ()=>zMeasures,
|
199
|
-
|
199
|
+
zRadar: ()=>zRadar,
|
200
200
|
zLine: ()=>zLine,
|
201
201
|
columnSpecPipeline: ()=>columnSpecPipeline,
|
202
202
|
zFoldInfo: ()=>zFoldInfo,
|
203
203
|
zDatasetReshapeInfo: ()=>zDatasetReshapeInfo,
|
204
204
|
zLinearColor: ()=>zLinearColor,
|
205
|
-
|
205
|
+
zRadarConfig: ()=>zRadarConfig,
|
206
206
|
zAreaStyle: ()=>zAreaStyle,
|
207
207
|
ORIGINAL_DATA: ()=>ORIGINAL_DATA,
|
208
|
-
|
208
|
+
zStackCornerRadius: ()=>zStackCornerRadius,
|
209
209
|
zAnnotationArea: ()=>zAnnotationArea,
|
210
|
+
zUnfoldInfo: ()=>zUnfoldInfo,
|
210
211
|
DetailEncoding: ()=>DetailEncoding,
|
211
212
|
zRose: ()=>zRose,
|
212
213
|
columnParallelSpecPipeline: ()=>columnParallelSpecPipeline,
|
@@ -240,9 +241,9 @@
|
|
240
241
|
registerBarParallel: ()=>registerBarParallel,
|
241
242
|
registerRadar: ()=>registerRadar,
|
242
243
|
zLocale: ()=>zLocale,
|
243
|
-
|
244
|
+
isDimension: ()=>isDimension,
|
244
245
|
MeasureEncodingEnum: ()=>MeasureEncodingEnum,
|
245
|
-
|
246
|
+
pivotTableSpecPipeline: ()=>pivotTableSpecPipeline,
|
246
247
|
FoldXMeasureValue: ()=>FoldXMeasureValue,
|
247
248
|
dualAxisAdvancedPipeline: ()=>dualAxisAdvancedPipeline,
|
248
249
|
registerScatter: ()=>registerScatter,
|
@@ -254,9 +255,10 @@
|
|
254
255
|
zAdvancedVSeed: ()=>zAdvancedVSeed,
|
255
256
|
zConfig: ()=>zConfig,
|
256
257
|
zBarStyle: ()=>zBarStyle,
|
257
|
-
|
258
|
-
|
258
|
+
deleteDimensionTreeByCallback: ()=>deleteDimensionTreeByCallback,
|
259
|
+
zMeasure: ()=>zMeasure,
|
259
260
|
zAreaPercent: ()=>zAreaPercent,
|
261
|
+
zRoseParallelConfig: ()=>zRoseParallelConfig,
|
260
262
|
columnParallelAdvancedPipeline: ()=>columnParallelAdvancedPipeline,
|
261
263
|
isValueSelector: ()=>isValueSelector,
|
262
264
|
donutAdvancedPipeline: ()=>donutAdvancedPipeline,
|
@@ -330,7 +332,9 @@
|
|
330
332
|
};
|
331
333
|
if (builder.vseed.locale) intl.setLocale(builder.vseed.locale);
|
332
334
|
try {
|
333
|
-
|
335
|
+
const advancedVSeed = execPipeline(pipeline, context);
|
336
|
+
builder.advancedVSeed = advancedVSeed;
|
337
|
+
return advancedVSeed;
|
334
338
|
} catch (e) {
|
335
339
|
console.error(e);
|
336
340
|
throw new Error("buildAdvanced error, see error info in console");
|
@@ -351,7 +355,9 @@
|
|
351
355
|
};
|
352
356
|
if (builder.vseed.locale) intl.setLocale(builder.vseed.locale);
|
353
357
|
try {
|
354
|
-
|
358
|
+
const spec = execPipeline(pipeline, context);
|
359
|
+
builder.spec = spec;
|
360
|
+
return spec;
|
355
361
|
} catch (e) {
|
356
362
|
console.error(e);
|
357
363
|
throw new Error("buildSpec error, see error info in console");
|
@@ -362,10 +368,8 @@
|
|
362
368
|
};
|
363
369
|
const build = (builder)=>{
|
364
370
|
const advancedVSeed = builder.buildAdvanced();
|
365
|
-
builder.advancedVSeed = advancedVSeed;
|
366
371
|
if (!advancedVSeed) throw new Error('advancedVSeed is null');
|
367
372
|
const spec = builder.buildSpec(advancedVSeed);
|
368
|
-
builder.spec = spec;
|
369
373
|
return spec;
|
370
374
|
};
|
371
375
|
var chunk_ANXBDSUI_s = {
|
@@ -449,9 +453,114 @@
|
|
449
453
|
next: t
|
450
454
|
});
|
451
455
|
}
|
456
|
+
const preorderTraverse = (tree, callback)=>{
|
457
|
+
if (!tree || 0 === tree.length) return;
|
458
|
+
const stack = [
|
459
|
+
...tree
|
460
|
+
].reverse();
|
461
|
+
while(stack.length > 0){
|
462
|
+
const node = stack.pop();
|
463
|
+
const stop = callback(node);
|
464
|
+
if (true === stop) return;
|
465
|
+
if (!('children' in node)) continue;
|
466
|
+
const children = node.children;
|
467
|
+
if (children && children.length > 0) for(let i = children.length - 1; i >= 0; i--){
|
468
|
+
const child = children[i];
|
469
|
+
stack.push(child);
|
470
|
+
}
|
471
|
+
}
|
472
|
+
};
|
473
|
+
const measureDepth = (measures = [])=>{
|
474
|
+
if (!measures) return 0;
|
475
|
+
let depth = 1;
|
476
|
+
preorderTraverse(measures, (node)=>{
|
477
|
+
if ('children' in node) depth = Math.max(depth, 1 + measureDepth(node.children));
|
478
|
+
return false;
|
479
|
+
});
|
480
|
+
return depth;
|
481
|
+
};
|
482
|
+
const isMeasureTreeWithChildren = (measures)=>{
|
483
|
+
if (!measures) return false;
|
484
|
+
return measures.some((measure)=>'children' in measure);
|
485
|
+
};
|
486
|
+
const isMeasureTreeWithParentId = (measures)=>{
|
487
|
+
if (!measures) return false;
|
488
|
+
return measures.some((measure)=>'parentId' in measure);
|
489
|
+
};
|
490
|
+
const normalizeMeasureTree = (measures)=>{
|
491
|
+
const createEmptyMeasureGroup = ()=>({
|
492
|
+
id: 'group',
|
493
|
+
alias: '',
|
494
|
+
children: []
|
495
|
+
});
|
496
|
+
let currentGroup = createEmptyMeasureGroup();
|
497
|
+
const measureGroups = [];
|
498
|
+
for (const measure of measures)if ('children' in measure) {
|
499
|
+
if (currentGroup.children?.length) {
|
500
|
+
currentGroup.id = [
|
501
|
+
currentGroup.id,
|
502
|
+
...currentGroup.children.map((item)=>item.id)
|
503
|
+
].join('-');
|
504
|
+
currentGroup.alias = currentGroup.children.map((item)=>item.alias).join('-');
|
505
|
+
measureGroups.push(currentGroup);
|
506
|
+
currentGroup = createEmptyMeasureGroup();
|
507
|
+
}
|
508
|
+
measureGroups.push(measure);
|
509
|
+
} else currentGroup.children?.push(measure);
|
510
|
+
if (currentGroup.children?.length) {
|
511
|
+
currentGroup.id = [
|
512
|
+
currentGroup.id,
|
513
|
+
...currentGroup.children.map((item)=>item.id)
|
514
|
+
].join('-');
|
515
|
+
currentGroup.alias = currentGroup.children.map((item)=>item.alias).join('-');
|
516
|
+
measureGroups.push(currentGroup);
|
517
|
+
currentGroup = createEmptyMeasureGroup();
|
518
|
+
}
|
519
|
+
return measureGroups;
|
520
|
+
};
|
521
|
+
const DEFAULT_PARENT_ID = '__DefaultParentId__';
|
522
|
+
const isTable = (vseed)=>'table' === vseed.chartType;
|
523
|
+
const isPivotTable = (vseed)=>'pivotTable' === vseed.chartType;
|
524
|
+
const isVTable = (vseed)=>[
|
525
|
+
'table',
|
526
|
+
'pivotTable'
|
527
|
+
].includes(vseed.chartType);
|
528
|
+
const isVChart = (vseed)=>!isVTable(vseed);
|
529
|
+
const isPivotChart = (vseed)=>{
|
530
|
+
if (isVTable(vseed)) return false;
|
531
|
+
if (isMeasureTreeWithParentId(vseed.measures)) {
|
532
|
+
const parentIds = vseed.measures?.map((measure)=>measure.parentId || DEFAULT_PARENT_ID);
|
533
|
+
return parentIds && chunk_QJLMYOTX_i(parentIds).length > 1;
|
534
|
+
}
|
535
|
+
if ('dualAxis' === vseed.chartType || 'scatter' === vseed.chartType) {
|
536
|
+
const { dimensions = [] } = vseed;
|
537
|
+
const hasRowOrColumnDimension = dimensions && dimensions.some((dimension)=>'row' === dimension.encoding || 'column' === dimension.encoding);
|
538
|
+
if (hasRowOrColumnDimension) return true;
|
539
|
+
if ('scatter' === vseed.chartType) {
|
540
|
+
if (isMeasureTreeWithChildren(vseed.measures)) {
|
541
|
+
const depth = measureDepth(vseed.measures);
|
542
|
+
return 3 === depth;
|
543
|
+
}
|
544
|
+
if (vseed.scatterMeasures && vseed.scatterMeasures.length > 1) return true;
|
545
|
+
return false;
|
546
|
+
}
|
547
|
+
if ('dualAxis' === vseed.chartType) {
|
548
|
+
if (isMeasureTreeWithChildren(vseed.measures)) {
|
549
|
+
const depth = measureDepth(vseed.measures);
|
550
|
+
return 3 === depth;
|
551
|
+
}
|
552
|
+
if (vseed.dualMeasures && vseed.dualMeasures.length > 1) return true;
|
553
|
+
}
|
554
|
+
return false;
|
555
|
+
}
|
556
|
+
const { measures = [], dimensions = [] } = vseed;
|
557
|
+
const hasRowOrColumnDimension = dimensions && dimensions.some((dimension)=>'row' === dimension.encoding || 'column' === dimension.encoding);
|
558
|
+
const hasMeasureGroup = measures && measures.some((measure)=>measure && measure.children);
|
559
|
+
return hasRowOrColumnDimension || hasMeasureGroup;
|
560
|
+
};
|
452
561
|
const getColorItems = (builder)=>{
|
453
562
|
const advancedVSeed = builder.advancedVSeed;
|
454
|
-
if (!advancedVSeed) return [];
|
563
|
+
if (!advancedVSeed || isTable(builder.vseed) || isPivotTable(builder.vseed)) return [];
|
455
564
|
const { datasetReshapeInfo } = advancedVSeed;
|
456
565
|
const colorItems = chunk_QJLMYOTX_i(datasetReshapeInfo.flatMap((d)=>d.unfoldInfo.colorItems));
|
457
566
|
const colorIdMap = datasetReshapeInfo.reduce((prev, cur)=>({
|
@@ -462,7 +571,7 @@
|
|
462
571
|
};
|
463
572
|
const getColorIdMap = (builder)=>{
|
464
573
|
const advancedVSeed = builder.advancedVSeed;
|
465
|
-
if (!advancedVSeed) return {};
|
574
|
+
if (!advancedVSeed || isTable(builder.vseed) || isPivotTable(builder.vseed)) return {};
|
466
575
|
const { datasetReshapeInfo } = advancedVSeed;
|
467
576
|
const colorIdMap = datasetReshapeInfo.reduce((prev, cur)=>({
|
468
577
|
...prev,
|
@@ -520,7 +629,7 @@
|
|
520
629
|
if (customPipe) pipeline.push(customPipe);
|
521
630
|
return pipeline;
|
522
631
|
};
|
523
|
-
static getTheme = (themeKey)=>Builder._themeMap[themeKey];
|
632
|
+
static getTheme = (themeKey)=>Builder._themeMap[themeKey || 'light'];
|
524
633
|
static getThemeMap = ()=>Builder._themeMap;
|
525
634
|
static from = (vseed)=>new Builder(vseed);
|
526
635
|
static _advancedPipelineMap = {};
|
@@ -568,23 +677,6 @@
|
|
568
677
|
measures: defaultMeasures
|
569
678
|
};
|
570
679
|
};
|
571
|
-
const preorderTraverse = (tree, callback)=>{
|
572
|
-
if (!tree || 0 === tree.length) return;
|
573
|
-
const stack = [
|
574
|
-
...tree
|
575
|
-
].reverse();
|
576
|
-
while(stack.length > 0){
|
577
|
-
const node = stack.pop();
|
578
|
-
const stop = callback(node);
|
579
|
-
if (true === stop) return;
|
580
|
-
if (!('children' in node)) continue;
|
581
|
-
const children = node.children;
|
582
|
-
if (children && children.length > 0) for(let i = children.length - 1; i >= 0; i--){
|
583
|
-
const child = children[i];
|
584
|
-
stack.push(child);
|
585
|
-
}
|
586
|
-
}
|
587
|
-
};
|
588
680
|
const findMeasureById = (measures = [], id)=>{
|
589
681
|
if (!measures) return;
|
590
682
|
let result;
|
@@ -1244,14 +1336,14 @@
|
|
1244
1336
|
measureId,
|
1245
1337
|
measureName,
|
1246
1338
|
measureValue,
|
1247
|
-
|
1248
|
-
0,
|
1249
|
-
1
|
1250
|
-
|
1251
|
-
|
1252
|
-
0,
|
1253
|
-
1
|
1254
|
-
|
1339
|
+
statistics: {
|
1340
|
+
max: -1 / 0,
|
1341
|
+
min: 1 / 0,
|
1342
|
+
sum: 0,
|
1343
|
+
count: 0,
|
1344
|
+
colorMin: 1 / 0,
|
1345
|
+
colorMax: -1 / 0
|
1346
|
+
},
|
1255
1347
|
foldMap: {}
|
1256
1348
|
};
|
1257
1349
|
const result = new Array(dataset.length * measures.length);
|
@@ -1272,15 +1364,15 @@
|
|
1272
1364
|
const value = datum[ORIGINAL_DATA][colorMeasureId];
|
1273
1365
|
datum[ColorEncoding] = value;
|
1274
1366
|
datum[ColorIdEncoding] = colorMeasureId;
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
foldInfo.
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1367
|
+
const valueNumber = Number(value);
|
1368
|
+
foldInfo.statistics.colorMin = Math.min(foldInfo.statistics.colorMin, valueNumber);
|
1369
|
+
foldInfo.statistics.colorMax = Math.max(foldInfo.statistics.colorMax, valueNumber);
|
1370
|
+
}
|
1371
|
+
const valueNumber = Number(datum[id]);
|
1372
|
+
foldInfo.statistics.min = Math.min(foldInfo.statistics.min, valueNumber);
|
1373
|
+
foldInfo.statistics.max = Math.max(foldInfo.statistics.max, valueNumber);
|
1374
|
+
foldInfo.statistics.sum += valueNumber;
|
1375
|
+
foldInfo.statistics.count++;
|
1284
1376
|
foldInfo.foldMap[id] = alias;
|
1285
1377
|
result[index++] = datum;
|
1286
1378
|
}
|
@@ -1684,6 +1776,14 @@
|
|
1684
1776
|
if (hasEncoding) return execPipeline(hasEncodingPipeline, context, advancedVSeed);
|
1685
1777
|
return execPipeline(noEncodingPipeline, context, advancedVSeed);
|
1686
1778
|
};
|
1779
|
+
const addColorToEncoding = (dimensions, encoding, isMultiMeasure)=>{
|
1780
|
+
encoding.color = chunk_QJLMYOTX_i(dimensions.filter((item)=>'color' === item.encoding).map((item)=>item.id));
|
1781
|
+
const measureName = dimensions.find((item)=>item.id === MeasureName);
|
1782
|
+
if (isMultiMeasure && measureName && !measureName.encoding) encoding.color.push(MeasureName);
|
1783
|
+
if (0 === encoding.color.length) encoding.color = [
|
1784
|
+
MeasureName
|
1785
|
+
];
|
1786
|
+
};
|
1687
1787
|
const defaultEncodingForLine = (advancedVSeed)=>{
|
1688
1788
|
const { measures: vseedMeasures = [], dimensions = [] } = advancedVSeed;
|
1689
1789
|
const measures = findAllMeasures(vseedMeasures);
|
@@ -1701,7 +1801,7 @@
|
|
1701
1801
|
const hasDimensionEncoding = dimensions.some((item)=>item.encoding);
|
1702
1802
|
const hasMeasureEncoding = measures.some((item)=>item.encoding);
|
1703
1803
|
const encoding = {};
|
1704
|
-
if (hasDimensionEncoding) line_generateDimensionEncoding(dimensions, encoding);
|
1804
|
+
if (hasDimensionEncoding) line_generateDimensionEncoding(dimensions, encoding, measures.length > 1);
|
1705
1805
|
else line_generateDefaultDimensionEncoding(dimensions, encoding);
|
1706
1806
|
if (hasMeasureEncoding) line_generateMeasureEncoding(measures, encoding);
|
1707
1807
|
else line_generateDefaultMeasureEncoding(measures, encoding);
|
@@ -1720,21 +1820,20 @@
|
|
1720
1820
|
encoding.row = [];
|
1721
1821
|
encoding.column = [];
|
1722
1822
|
};
|
1723
|
-
const line_generateDimensionEncoding = (dimensions, encoding)=>{
|
1823
|
+
const line_generateDimensionEncoding = (dimensions, encoding, isMultiMeasure)=>{
|
1724
1824
|
encoding.x = chunk_QJLMYOTX_i(dimensions.filter((item)=>'xAxis' === item.encoding).map((item)=>item.id));
|
1725
1825
|
if (0 === encoding.x.length) encoding.x = [
|
1726
1826
|
dimensions[0].id
|
1727
1827
|
];
|
1728
|
-
|
1729
|
-
if (0 === encoding.color.length) encoding.color = [
|
1730
|
-
MeasureName
|
1731
|
-
];
|
1828
|
+
addColorToEncoding(dimensions, encoding, isMultiMeasure);
|
1732
1829
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
1733
1830
|
if (0 === encoding.detail.length) encoding.detail = [
|
1734
1831
|
MeasureName
|
1735
1832
|
];
|
1736
1833
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
1737
1834
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
1835
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
1836
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
1738
1837
|
};
|
1739
1838
|
const line_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
1740
1839
|
encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'yAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -1743,100 +1842,18 @@
|
|
1743
1842
|
encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'yAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
1744
1843
|
const color = chunk_QJLMYOTX_i(measures.filter((item)=>'color' === item.encoding).map((item)=>item.id));
|
1745
1844
|
if (color.length > 0) encoding.color = color;
|
1845
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
1846
|
+
encoding.label = chunk_QJLMYOTX_i([
|
1847
|
+
...encoding.label || [],
|
1848
|
+
...label
|
1849
|
+
]);
|
1746
1850
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
1747
1851
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
1748
1852
|
...encoding.tooltip || [],
|
1853
|
+
...label,
|
1749
1854
|
...tooltip
|
1750
1855
|
]);
|
1751
1856
|
};
|
1752
|
-
const isMeasureTreeWithChildren = (measures)=>{
|
1753
|
-
if (!measures) return false;
|
1754
|
-
return measures.some((measure)=>'children' in measure);
|
1755
|
-
};
|
1756
|
-
const isMeasureTreeWithParentId = (measures)=>{
|
1757
|
-
if (!measures) return false;
|
1758
|
-
return measures.some((measure)=>'parentId' in measure);
|
1759
|
-
};
|
1760
|
-
const normalizeMeasureTree = (measures)=>{
|
1761
|
-
const createEmptyMeasureGroup = ()=>({
|
1762
|
-
id: 'group',
|
1763
|
-
alias: '',
|
1764
|
-
children: []
|
1765
|
-
});
|
1766
|
-
let currentGroup = createEmptyMeasureGroup();
|
1767
|
-
const measureGroups = [];
|
1768
|
-
for (const measure of measures)if ('children' in measure) {
|
1769
|
-
if (currentGroup.children?.length) {
|
1770
|
-
currentGroup.id = [
|
1771
|
-
currentGroup.id,
|
1772
|
-
...currentGroup.children.map((item)=>item.id)
|
1773
|
-
].join('-');
|
1774
|
-
currentGroup.alias = currentGroup.children.map((item)=>item.alias).join('-');
|
1775
|
-
measureGroups.push(currentGroup);
|
1776
|
-
currentGroup = createEmptyMeasureGroup();
|
1777
|
-
}
|
1778
|
-
measureGroups.push(measure);
|
1779
|
-
} else currentGroup.children?.push(measure);
|
1780
|
-
if (currentGroup.children?.length) {
|
1781
|
-
currentGroup.id = [
|
1782
|
-
currentGroup.id,
|
1783
|
-
...currentGroup.children.map((item)=>item.id)
|
1784
|
-
].join('-');
|
1785
|
-
currentGroup.alias = currentGroup.children.map((item)=>item.alias).join('-');
|
1786
|
-
measureGroups.push(currentGroup);
|
1787
|
-
currentGroup = createEmptyMeasureGroup();
|
1788
|
-
}
|
1789
|
-
return measureGroups;
|
1790
|
-
};
|
1791
|
-
const measureDepth = (measures = [])=>{
|
1792
|
-
if (!measures) return 0;
|
1793
|
-
let depth = 1;
|
1794
|
-
preorderTraverse(measures, (node)=>{
|
1795
|
-
if ('children' in node) depth = Math.max(depth, 1 + measureDepth(node.children));
|
1796
|
-
return false;
|
1797
|
-
});
|
1798
|
-
return depth;
|
1799
|
-
};
|
1800
|
-
const DEFAULT_PARENT_ID = '__DefaultParentId__';
|
1801
|
-
const isTable = (vseed)=>'table' === vseed.chartType;
|
1802
|
-
const isPivotTable = (vseed)=>'pivotTable' === vseed.chartType;
|
1803
|
-
const isVTable = (vseed)=>[
|
1804
|
-
'table',
|
1805
|
-
'pivotTable'
|
1806
|
-
].includes(vseed.chartType);
|
1807
|
-
const isVChart = (vseed)=>!isVTable(vseed);
|
1808
|
-
const isPivotChart = (vseed)=>{
|
1809
|
-
if (isVTable(vseed)) return false;
|
1810
|
-
if (isMeasureTreeWithParentId(vseed.measures)) {
|
1811
|
-
const parentIds = vseed.measures?.map((measure)=>measure.parentId || DEFAULT_PARENT_ID);
|
1812
|
-
return parentIds && chunk_QJLMYOTX_i(parentIds).length > 1;
|
1813
|
-
}
|
1814
|
-
if ('dualAxis' === vseed.chartType || 'scatter' === vseed.chartType) {
|
1815
|
-
const { dimensions = [] } = vseed;
|
1816
|
-
const hasRowOrColumnDimension = dimensions && dimensions.some((dimension)=>'row' === dimension.encoding || 'column' === dimension.encoding);
|
1817
|
-
if (hasRowOrColumnDimension) return true;
|
1818
|
-
if ('scatter' === vseed.chartType) {
|
1819
|
-
if (isMeasureTreeWithChildren(vseed.measures)) {
|
1820
|
-
const depth = measureDepth(vseed.measures);
|
1821
|
-
return 3 === depth;
|
1822
|
-
}
|
1823
|
-
if (vseed.scatterMeasures && vseed.scatterMeasures.length > 1) return true;
|
1824
|
-
return false;
|
1825
|
-
}
|
1826
|
-
if ('dualAxis' === vseed.chartType) {
|
1827
|
-
if (isMeasureTreeWithChildren(vseed.measures)) {
|
1828
|
-
const depth = measureDepth(vseed.measures);
|
1829
|
-
return 3 === depth;
|
1830
|
-
}
|
1831
|
-
if (vseed.dualMeasures && vseed.dualMeasures.length > 1) return true;
|
1832
|
-
}
|
1833
|
-
return false;
|
1834
|
-
}
|
1835
|
-
const { measures = [], dimensions = [] } = vseed;
|
1836
|
-
const hasRowOrColumnDimension = dimensions && dimensions.some((dimension)=>'row' === dimension.encoding || 'column' === dimension.encoding);
|
1837
|
-
const hasMeasureGroup = measures && measures.some((measure)=>measure && measure.children);
|
1838
|
-
return hasRowOrColumnDimension || hasMeasureGroup;
|
1839
|
-
};
|
1840
1857
|
const buildMeasures = (advancedVSeed)=>{
|
1841
1858
|
if (isMeasureTreeWithChildren(advancedVSeed.measures)) {
|
1842
1859
|
advancedVSeed.measures = normalizeMeasureTree(advancedVSeed.measures);
|
@@ -1918,14 +1935,60 @@
|
|
1918
1935
|
}
|
1919
1936
|
return measureTree;
|
1920
1937
|
};
|
1921
|
-
const
|
1922
|
-
const deleteBy = (measure)=>'tooltip' === measure.encoding;
|
1938
|
+
const deleteTooltipAndLabelMeasure = (advancedVSeed)=>{
|
1939
|
+
const deleteBy = (measure)=>'tooltip' === measure.encoding || 'label' === measure.encoding;
|
1923
1940
|
const measureTree = deleteMeasureTreeByCallback(advancedVSeed.measures, deleteBy);
|
1924
1941
|
return {
|
1925
1942
|
...advancedVSeed,
|
1926
1943
|
measures: measureTree
|
1927
1944
|
};
|
1928
1945
|
};
|
1946
|
+
const isDimension = (dimension)=>!('children' in dimension);
|
1947
|
+
const isDimensionGroup = (dimension)=>'children' in dimension;
|
1948
|
+
const deleteDimensionTreeByCallback = (dimensionTree, callback)=>{
|
1949
|
+
if (!dimensionTree) return dimensionTree;
|
1950
|
+
const stack = [
|
1951
|
+
...dimensionTree
|
1952
|
+
].reverse();
|
1953
|
+
const parents = new Map();
|
1954
|
+
dimensionTree.forEach((node)=>{
|
1955
|
+
parents.set(node, dimensionTree);
|
1956
|
+
});
|
1957
|
+
const nodesToProcess = [];
|
1958
|
+
const visited = new Set();
|
1959
|
+
while(stack.length > 0){
|
1960
|
+
const node = stack[stack.length - 1];
|
1961
|
+
if (isDimensionGroup(node) && node.children && !visited.has(node)) {
|
1962
|
+
visited.add(node);
|
1963
|
+
const children = node.children.slice().reverse();
|
1964
|
+
for (const child of children){
|
1965
|
+
parents.set(child, node.children);
|
1966
|
+
stack.push(child);
|
1967
|
+
}
|
1968
|
+
} else {
|
1969
|
+
stack.pop();
|
1970
|
+
nodesToProcess.push(node);
|
1971
|
+
}
|
1972
|
+
}
|
1973
|
+
for (const node of nodesToProcess){
|
1974
|
+
const parentList = parents.get(node);
|
1975
|
+
if (parentList) {
|
1976
|
+
const index = parentList.indexOf(node);
|
1977
|
+
if (isDimension(node)) {
|
1978
|
+
if (callback?.(node, index, parentList)) parentList.splice(index, 1);
|
1979
|
+
}
|
1980
|
+
}
|
1981
|
+
}
|
1982
|
+
return dimensionTree;
|
1983
|
+
};
|
1984
|
+
const deleteTooltipAndLabelDimension = (advancedVSeed)=>{
|
1985
|
+
const deleteBy = (dimension)=>'tooltip' === dimension.encoding || 'label' === dimension.encoding;
|
1986
|
+
const dimensionTree = deleteDimensionTreeByCallback(advancedVSeed.dimensions, deleteBy);
|
1987
|
+
return {
|
1988
|
+
...advancedVSeed,
|
1989
|
+
dimensions: dimensionTree
|
1990
|
+
};
|
1991
|
+
};
|
1929
1992
|
const pivotAdapter = (pipeline, pivotPipeline)=>(advancedVSeed, context)=>{
|
1930
1993
|
const { vseed } = context;
|
1931
1994
|
const usePivotChart = isPivotChart(vseed);
|
@@ -2327,7 +2390,8 @@
|
|
2327
2390
|
], [
|
2328
2391
|
encodingForLine,
|
2329
2392
|
buildMeasures,
|
2330
|
-
|
2393
|
+
deleteTooltipAndLabelMeasure,
|
2394
|
+
deleteTooltipAndLabelDimension
|
2331
2395
|
]),
|
2332
2396
|
pivotAdapter([
|
2333
2397
|
reshapeWithEncoding
|
@@ -2739,7 +2803,7 @@
|
|
2739
2803
|
const baseConfig = advancedVSeed.config[chartType];
|
2740
2804
|
if (!baseConfig || !baseConfig.legend) return result;
|
2741
2805
|
const { legend } = baseConfig;
|
2742
|
-
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight, maxSize = 1, border, shapeType = 'rectRound' } = legend || {};
|
2806
|
+
const { enable, position = 'bottom', labelFontColor, labelColor, labelFontSize = 12, labelFontWeight, maxSize = 1, border, shapeType = 'rectRound' } = legend || {};
|
2743
2807
|
const orient = [
|
2744
2808
|
'bottom',
|
2745
2809
|
'bottomLeft',
|
@@ -2799,7 +2863,7 @@
|
|
2799
2863
|
maxWidth: '30%',
|
2800
2864
|
focusIconStyle: {
|
2801
2865
|
size: labelFontSize + 2,
|
2802
|
-
fill: labelFontColor,
|
2866
|
+
fill: labelColor || labelFontColor,
|
2803
2867
|
fontWeight: labelFontWeight
|
2804
2868
|
},
|
2805
2869
|
shape: {
|
@@ -2813,14 +2877,14 @@
|
|
2813
2877
|
formatMethod: (value)=>unfoldInfo.colorIdMap[String(value)] ?? value,
|
2814
2878
|
style: {
|
2815
2879
|
fontSize: labelFontSize,
|
2816
|
-
fill: labelFontColor,
|
2880
|
+
fill: labelColor || labelFontColor,
|
2817
2881
|
fontWeight: labelFontWeight
|
2818
2882
|
}
|
2819
2883
|
},
|
2820
2884
|
background: {
|
2821
2885
|
state: {
|
2822
2886
|
selectedHover: {
|
2823
|
-
fill: labelFontColor,
|
2887
|
+
fill: labelColor || labelFontColor,
|
2824
2888
|
fillOpacity: 0.05
|
2825
2889
|
}
|
2826
2890
|
}
|
@@ -2840,7 +2904,7 @@
|
|
2840
2904
|
const baseConfig = advancedVSeed.config[chartType];
|
2841
2905
|
if (!baseConfig || !baseConfig.legend) return result;
|
2842
2906
|
const { legend } = baseConfig;
|
2843
|
-
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight } = legend || {};
|
2907
|
+
const { enable, position = 'bottom', labelFontColor, labelColor, labelFontSize = 12, labelFontWeight } = legend || {};
|
2844
2908
|
const orient = [
|
2845
2909
|
'bottom',
|
2846
2910
|
'bottomLeft',
|
@@ -2890,7 +2954,7 @@
|
|
2890
2954
|
startText: {
|
2891
2955
|
visible: true,
|
2892
2956
|
style: {
|
2893
|
-
fill: labelFontColor,
|
2957
|
+
fill: labelColor || labelFontColor,
|
2894
2958
|
fontSize: labelFontSize,
|
2895
2959
|
fontWeight: labelFontWeight
|
2896
2960
|
}
|
@@ -2898,7 +2962,7 @@
|
|
2898
2962
|
endText: {
|
2899
2963
|
visible: true,
|
2900
2964
|
style: {
|
2901
|
-
fill: labelFontColor,
|
2965
|
+
fill: labelColor || labelFontColor,
|
2902
2966
|
fontSize: labelFontSize,
|
2903
2967
|
fontWeight: labelFontWeight
|
2904
2968
|
}
|
@@ -3213,36 +3277,69 @@
|
|
3213
3277
|
const result = {
|
3214
3278
|
...spec
|
3215
3279
|
};
|
3216
|
-
const { advancedVSeed } = context;
|
3217
|
-
const { measures, datasetReshapeInfo
|
3218
|
-
const { chartType } = advancedVSeed;
|
3280
|
+
const { advancedVSeed, vseed } = context;
|
3281
|
+
const { measures, datasetReshapeInfo } = advancedVSeed;
|
3282
|
+
const { chartType, encoding } = advancedVSeed;
|
3219
3283
|
const baseConfig = advancedVSeed.config[chartType];
|
3220
|
-
if (!baseConfig ||
|
3221
|
-
const { measureId, measureValue } = datasetReshapeInfo[0].foldInfo;
|
3284
|
+
if (!baseConfig || chunk_VCYTMP4D_n(baseConfig.label)) return result;
|
3285
|
+
const { measureId, measureValue, statistics } = datasetReshapeInfo[0].foldInfo;
|
3222
3286
|
const { label } = baseConfig;
|
3223
|
-
const { enable } = label;
|
3287
|
+
const { enable, wrap, showValue, showValuePercent, labelOverlap, labelColorSmartInvert, labelColor, labelFontSize, labelFontWeight, labelBackgroundColor, labelPosition, autoFormat = true, numFormat = {} } = label;
|
3288
|
+
const labelDims = T((vseed.dimensions || []).filter((item)=>encoding.label?.includes(item.id)), (item)=>item.id);
|
3289
|
+
const labelMeas = T((vseed.measures || []).filter((item)=>encoding.label?.includes(item.id)), (item)=>item.id);
|
3290
|
+
const percentFormat = chunk_5S4PYKVY_t(numFormat, {
|
3291
|
+
type: 'percent'
|
3292
|
+
});
|
3293
|
+
const percentFormatter = createFormatter(percentFormat);
|
3224
3294
|
result.label = {
|
3225
3295
|
visible: enable,
|
3226
|
-
formatMethod: (
|
3296
|
+
formatMethod: (_, datum)=>{
|
3227
3297
|
const result = [];
|
3228
|
-
const
|
3229
|
-
|
3230
|
-
|
3231
|
-
|
3232
|
-
|
3233
|
-
|
3234
|
-
|
3235
|
-
|
3236
|
-
|
3237
|
-
|
3238
|
-
return String(value);
|
3239
|
-
};
|
3240
|
-
result.push(formatValue(datum[measureValue]));
|
3298
|
+
const dimLabels = labelDims.map((item)=>item.alias || item.id);
|
3299
|
+
const meaLabels = labelMeas.map((item)=>generateMeasureValue(datum[item.id], item, autoFormat, numFormat));
|
3300
|
+
const measure = findMeasureById(measures, datum[measureId]);
|
3301
|
+
const measureValueLabel = generateMeasureValue(datum[measureValue], measure, autoFormat, numFormat);
|
3302
|
+
const measurePercentLabel = generateMeasurePercent(datum[measureValue], statistics.sum, percentFormatter);
|
3303
|
+
result.push(...dimLabels);
|
3304
|
+
if (showValue) result.push(measureValueLabel);
|
3305
|
+
if (showValuePercent) result.push(measurePercentLabel);
|
3306
|
+
result.push(...meaLabels);
|
3307
|
+
if (wrap) return result;
|
3241
3308
|
return result.join(' ');
|
3242
|
-
}
|
3309
|
+
},
|
3310
|
+
position: labelPosition,
|
3311
|
+
style: {
|
3312
|
+
fill: labelColor,
|
3313
|
+
fontSize: labelFontSize,
|
3314
|
+
fontWeight: labelFontWeight,
|
3315
|
+
background: labelBackgroundColor
|
3316
|
+
},
|
3317
|
+
smartInvert: labelColorSmartInvert
|
3318
|
+
};
|
3319
|
+
if (labelOverlap) result.label.overlap = {
|
3320
|
+
hideOnHit: true,
|
3321
|
+
clampForce: true
|
3243
3322
|
};
|
3244
3323
|
return result;
|
3245
3324
|
};
|
3325
|
+
const generateMeasureValue = (value, measure, labelAutoFormat = true, numFormat = {})=>{
|
3326
|
+
if (!measure) return value;
|
3327
|
+
const format = chunk_5S4PYKVY_t(numFormat, measure.format);
|
3328
|
+
const autoFormat = labelAutoFormat || measure.autoFormat;
|
3329
|
+
if (!chunk_VCYTMP4D_n(format)) {
|
3330
|
+
const formatter = createFormatter(format);
|
3331
|
+
return formatter(value);
|
3332
|
+
}
|
3333
|
+
if (autoFormat) return autoFormatter(value, intl.getLocale());
|
3334
|
+
return String(value);
|
3335
|
+
};
|
3336
|
+
const generateMeasurePercent = (value, sum, formatter)=>{
|
3337
|
+
if (null == value) return String(value);
|
3338
|
+
const num = Number(value);
|
3339
|
+
if (Number.isNaN(num)) return String(value);
|
3340
|
+
const percentValue = num / sum;
|
3341
|
+
return formatter(percentValue);
|
3342
|
+
};
|
3246
3343
|
const tooltip_tooltip = (spec, context)=>{
|
3247
3344
|
const result = {
|
3248
3345
|
...spec
|
@@ -4038,7 +4135,7 @@
|
|
4038
4135
|
const { legend, color } = baseConfig;
|
4039
4136
|
const { colorScheme, colorMapping } = color;
|
4040
4137
|
const colorSpecified = createSpecifiedForColorMapping(colorMapping, colorIdMap, colorItems);
|
4041
|
-
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight = 400, maxSize = 1, border, shapeType = 'rectRound' } = legend || {};
|
4138
|
+
const { enable, position = 'bottom', labelFontColor, labelColor, labelFontSize = 12, labelFontWeight = 400, maxSize = 1, border, shapeType = 'rectRound' } = legend || {};
|
4042
4139
|
const orient = [
|
4043
4140
|
'bottom',
|
4044
4141
|
'bottomLeft',
|
@@ -4103,7 +4200,7 @@
|
|
4103
4200
|
maxWidth: '30%',
|
4104
4201
|
focusIconStyle: {
|
4105
4202
|
size: labelFontSize + 2,
|
4106
|
-
fill: labelFontColor,
|
4203
|
+
fill: labelColor || labelFontColor,
|
4107
4204
|
fontWeight: labelFontWeight
|
4108
4205
|
},
|
4109
4206
|
shape: {
|
@@ -4117,14 +4214,14 @@
|
|
4117
4214
|
formatMethod: (value)=>colorIdMap[value] ?? value,
|
4118
4215
|
style: {
|
4119
4216
|
fontSize: labelFontSize,
|
4120
|
-
fill: labelFontColor,
|
4217
|
+
fill: labelColor || labelFontColor,
|
4121
4218
|
fontWeight: labelFontWeight
|
4122
4219
|
}
|
4123
4220
|
},
|
4124
4221
|
background: {
|
4125
4222
|
state: {
|
4126
4223
|
selectedHover: {
|
4127
|
-
fill: labelFontColor,
|
4224
|
+
fill: labelColor || labelFontColor,
|
4128
4225
|
fillOpacity: 0.05
|
4129
4226
|
}
|
4130
4227
|
}
|
@@ -4145,11 +4242,11 @@
|
|
4145
4242
|
const baseConfig = advancedVSeed.config[chartType];
|
4146
4243
|
if (!baseConfig || !baseConfig.legend) return result;
|
4147
4244
|
const { datasetReshapeInfo } = advancedVSeed;
|
4148
|
-
const max = Math.max(...datasetReshapeInfo.map((d)=>d.foldInfo.
|
4149
|
-
const min = Math.min(...datasetReshapeInfo.map((d)=>d.foldInfo.
|
4245
|
+
const max = Math.max(...datasetReshapeInfo.map((d)=>d.foldInfo.statistics.colorMin));
|
4246
|
+
const min = Math.min(...datasetReshapeInfo.map((d)=>d.foldInfo.statistics.colorMax));
|
4150
4247
|
const { legend, color } = baseConfig;
|
4151
4248
|
const { colorScheme, linearColorScheme } = color;
|
4152
|
-
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight = 400 } = legend || {};
|
4249
|
+
const { enable, position = 'bottom', labelFontColor, labelColor, labelFontSize = 12, labelFontWeight = 400 } = legend || {};
|
4153
4250
|
const orient = [
|
4154
4251
|
'bottom',
|
4155
4252
|
'bottomLeft',
|
@@ -4204,7 +4301,7 @@
|
|
4204
4301
|
startText: {
|
4205
4302
|
visible: true,
|
4206
4303
|
style: {
|
4207
|
-
fill: labelFontColor,
|
4304
|
+
fill: labelColor || labelFontColor,
|
4208
4305
|
fontSize: labelFontSize,
|
4209
4306
|
fontWeight: labelFontWeight
|
4210
4307
|
}
|
@@ -4212,7 +4309,7 @@
|
|
4212
4309
|
endText: {
|
4213
4310
|
visible: true,
|
4214
4311
|
style: {
|
4215
|
-
fill: labelFontColor,
|
4312
|
+
fill: labelColor || labelFontColor,
|
4216
4313
|
fontSize: labelFontSize,
|
4217
4314
|
fontWeight: labelFontWeight
|
4218
4315
|
}
|
@@ -4301,7 +4398,7 @@
|
|
4301
4398
|
const hasDimensionEncoding = dimensions.some((item)=>item.encoding);
|
4302
4399
|
const hasMeasureEncoding = measures.some((item)=>item.encoding);
|
4303
4400
|
const encoding = {};
|
4304
|
-
if (hasDimensionEncoding) column_generateDimensionEncoding(dimensions, encoding);
|
4401
|
+
if (hasDimensionEncoding) column_generateDimensionEncoding(dimensions, encoding, measures.length > 1);
|
4305
4402
|
else column_generateDefaultDimensionEncoding(dimensions, encoding);
|
4306
4403
|
if (hasMeasureEncoding) column_generateMeasureEncoding(measures, encoding);
|
4307
4404
|
else column_generateDefaultMeasureEncoding(measures, encoding);
|
@@ -4321,19 +4418,18 @@
|
|
4321
4418
|
encoding.row = [];
|
4322
4419
|
encoding.column = [];
|
4323
4420
|
};
|
4324
|
-
const column_generateDimensionEncoding = (dimensions, encoding)=>{
|
4421
|
+
const column_generateDimensionEncoding = (dimensions, encoding, isMultiMeasure)=>{
|
4325
4422
|
encoding.x = chunk_QJLMYOTX_i(dimensions.filter((item)=>'xAxis' === item.encoding).map((item)=>item.id));
|
4326
4423
|
if (0 === encoding.x.length) encoding.x = [
|
4327
4424
|
dimensions[0].id
|
4328
4425
|
];
|
4329
|
-
|
4330
|
-
if (0 === encoding.color.length) encoding.color = [
|
4331
|
-
MeasureName
|
4332
|
-
];
|
4426
|
+
addColorToEncoding(dimensions, encoding, isMultiMeasure);
|
4333
4427
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
4334
4428
|
if (0 === encoding.detail.length) encoding.detail = encoding.color;
|
4335
4429
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
4336
4430
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
4431
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
4432
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
4337
4433
|
};
|
4338
4434
|
const column_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
4339
4435
|
encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'yAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -4342,9 +4438,15 @@
|
|
4342
4438
|
encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'yAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
4343
4439
|
const color = chunk_QJLMYOTX_i(measures.filter((item)=>'color' === item.encoding).map((item)=>item.id));
|
4344
4440
|
if (color.length > 0) encoding.color = color;
|
4441
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
4442
|
+
encoding.label = chunk_QJLMYOTX_i([
|
4443
|
+
...encoding.label || [],
|
4444
|
+
...label
|
4445
|
+
]);
|
4345
4446
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
4346
4447
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
4347
4448
|
...encoding.tooltip || [],
|
4449
|
+
...label,
|
4348
4450
|
...tooltip
|
4349
4451
|
]);
|
4350
4452
|
};
|
@@ -4359,7 +4461,8 @@
|
|
4359
4461
|
], [
|
4360
4462
|
encodingForColumn,
|
4361
4463
|
buildMeasures,
|
4362
|
-
|
4464
|
+
deleteTooltipAndLabelMeasure,
|
4465
|
+
deleteTooltipAndLabelDimension
|
4363
4466
|
]),
|
4364
4467
|
pivotAdapter([
|
4365
4468
|
reshapeWithEncoding
|
@@ -4729,7 +4832,8 @@
|
|
4729
4832
|
], [
|
4730
4833
|
encodingForColumn,
|
4731
4834
|
buildMeasures,
|
4732
|
-
|
4835
|
+
deleteTooltipAndLabelMeasure,
|
4836
|
+
deleteTooltipAndLabelDimension
|
4733
4837
|
]),
|
4734
4838
|
pivotAdapter([
|
4735
4839
|
reshapeWithEncoding
|
@@ -4834,7 +4938,8 @@
|
|
4834
4938
|
], [
|
4835
4939
|
encodingForColumn,
|
4836
4940
|
buildMeasures,
|
4837
|
-
|
4941
|
+
deleteTooltipAndLabelMeasure,
|
4942
|
+
deleteTooltipAndLabelDimension
|
4838
4943
|
]),
|
4839
4944
|
pivotAdapter([
|
4840
4945
|
reshapeWithEncoding
|
@@ -4929,7 +5034,7 @@
|
|
4929
5034
|
const hasDimensionEncoding = dimensions.some((item)=>item.encoding);
|
4930
5035
|
const hasMeasureEncoding = measures.some((item)=>item.encoding);
|
4931
5036
|
const encoding = {};
|
4932
|
-
if (hasDimensionEncoding) bar_generateDimensionEncoding(dimensions, encoding);
|
5037
|
+
if (hasDimensionEncoding) bar_generateDimensionEncoding(dimensions, encoding, measures.length > 1);
|
4933
5038
|
else bar_generateDefaultDimensionEncoding(dimensions, encoding);
|
4934
5039
|
if (hasMeasureEncoding) bar_generateMeasureEncoding(measures, encoding);
|
4935
5040
|
else bar_generateDefaultMeasureEncoding(measures, encoding);
|
@@ -4949,19 +5054,18 @@
|
|
4949
5054
|
encoding.row = [];
|
4950
5055
|
encoding.column = [];
|
4951
5056
|
};
|
4952
|
-
const bar_generateDimensionEncoding = (dimensions, encoding)=>{
|
5057
|
+
const bar_generateDimensionEncoding = (dimensions, encoding, isMultiMeasure)=>{
|
4953
5058
|
encoding.y = chunk_QJLMYOTX_i(dimensions.filter((item)=>'yAxis' === item.encoding).map((item)=>item.id));
|
4954
5059
|
if (0 === encoding.y.length) encoding.y = [
|
4955
5060
|
dimensions[0].id
|
4956
5061
|
];
|
4957
|
-
|
4958
|
-
if (0 === encoding.color.length) encoding.color = [
|
4959
|
-
MeasureName
|
4960
|
-
];
|
5062
|
+
addColorToEncoding(dimensions, encoding, isMultiMeasure);
|
4961
5063
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
4962
5064
|
if (0 === encoding.detail.length) encoding.detail = encoding.color;
|
4963
5065
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
4964
5066
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
5067
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
5068
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
4965
5069
|
};
|
4966
5070
|
const bar_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
4967
5071
|
encoding.x = chunk_QJLMYOTX_i(measures.filter((item)=>'xAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -4970,9 +5074,15 @@
|
|
4970
5074
|
encoding.x = chunk_QJLMYOTX_i(measures.filter((item)=>'xAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
4971
5075
|
const color = chunk_QJLMYOTX_i(measures.filter((item)=>'color' === item.encoding).map((item)=>item.id));
|
4972
5076
|
if (color.length > 0) encoding.color = color;
|
5077
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
5078
|
+
encoding.label = chunk_QJLMYOTX_i([
|
5079
|
+
...encoding.label || [],
|
5080
|
+
...label
|
5081
|
+
]);
|
4973
5082
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
4974
5083
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
4975
5084
|
...encoding.tooltip || [],
|
5085
|
+
...label,
|
4976
5086
|
...tooltip
|
4977
5087
|
]);
|
4978
5088
|
};
|
@@ -5003,7 +5113,8 @@
|
|
5003
5113
|
], [
|
5004
5114
|
encodingForBar,
|
5005
5115
|
buildMeasures,
|
5006
|
-
|
5116
|
+
deleteTooltipAndLabelMeasure,
|
5117
|
+
deleteTooltipAndLabelDimension
|
5007
5118
|
]),
|
5008
5119
|
pivotAdapter([
|
5009
5120
|
reshapeWithEncoding
|
@@ -5364,7 +5475,8 @@
|
|
5364
5475
|
], [
|
5365
5476
|
encodingForBar,
|
5366
5477
|
buildMeasures,
|
5367
|
-
|
5478
|
+
deleteTooltipAndLabelMeasure,
|
5479
|
+
deleteTooltipAndLabelDimension
|
5368
5480
|
]),
|
5369
5481
|
pivotAdapter([
|
5370
5482
|
reshapeWithEncoding
|
@@ -5468,7 +5580,8 @@
|
|
5468
5580
|
], [
|
5469
5581
|
encodingForBar,
|
5470
5582
|
buildMeasures,
|
5471
|
-
|
5583
|
+
deleteTooltipAndLabelMeasure,
|
5584
|
+
deleteTooltipAndLabelDimension
|
5472
5585
|
]),
|
5473
5586
|
pivotAdapter([
|
5474
5587
|
reshapeWithEncoding
|
@@ -5547,7 +5660,8 @@
|
|
5547
5660
|
], [
|
5548
5661
|
encodingForLine,
|
5549
5662
|
buildMeasures,
|
5550
|
-
|
5663
|
+
deleteTooltipAndLabelMeasure,
|
5664
|
+
deleteTooltipAndLabelDimension
|
5551
5665
|
]),
|
5552
5666
|
pivotAdapter([
|
5553
5667
|
reshapeWithEncoding
|
@@ -5713,7 +5827,8 @@
|
|
5713
5827
|
], [
|
5714
5828
|
encodingForLine,
|
5715
5829
|
buildMeasures,
|
5716
|
-
|
5830
|
+
deleteTooltipAndLabelMeasure,
|
5831
|
+
deleteTooltipAndLabelDimension
|
5717
5832
|
]),
|
5718
5833
|
pivotAdapter([
|
5719
5834
|
reshapeWithEncoding
|
@@ -5825,16 +5940,15 @@
|
|
5825
5940
|
encoding.column = [];
|
5826
5941
|
};
|
5827
5942
|
const scatter_generateDimensionEncoding = (dimensions, encoding)=>{
|
5828
|
-
|
5829
|
-
if (0 === encoding.color.length) encoding.color = [
|
5830
|
-
MeasureName
|
5831
|
-
];
|
5943
|
+
addColorToEncoding(dimensions, encoding, false);
|
5832
5944
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
5833
5945
|
if (0 === encoding.detail.length) encoding.detail = [
|
5834
5946
|
MeasureName
|
5835
5947
|
];
|
5836
5948
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
5837
5949
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
5950
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
5951
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
5838
5952
|
};
|
5839
5953
|
const scatter_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
5840
5954
|
encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'xAxis' === item.encoding || 'yAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -5845,9 +5959,15 @@
|
|
5845
5959
|
if (color.length > 0) encoding.color = [
|
5846
5960
|
color[0]
|
5847
5961
|
];
|
5962
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
5963
|
+
encoding.label = chunk_QJLMYOTX_i([
|
5964
|
+
...encoding.label || [],
|
5965
|
+
...label
|
5966
|
+
]);
|
5848
5967
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
5849
5968
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
5850
5969
|
...encoding.tooltip || [],
|
5970
|
+
...label,
|
5851
5971
|
...tooltip
|
5852
5972
|
]);
|
5853
5973
|
};
|
@@ -6089,7 +6209,8 @@
|
|
6089
6209
|
], [
|
6090
6210
|
encodingForScatter,
|
6091
6211
|
buildMeasuresForScatter,
|
6092
|
-
|
6212
|
+
deleteTooltipAndLabelMeasure,
|
6213
|
+
deleteTooltipAndLabelDimension
|
6093
6214
|
]),
|
6094
6215
|
pivotAdapter([
|
6095
6216
|
reshapeWithScatterEncoding
|
@@ -6351,7 +6472,7 @@
|
|
6351
6472
|
const hasDimensionEncoding = dimensions.some((item)=>item.encoding);
|
6352
6473
|
const hasMeasureEncoding = measures.some((item)=>item.encoding);
|
6353
6474
|
const encoding = {};
|
6354
|
-
if (hasDimensionEncoding) dualAxis_generateDimensionEncoding(dimensions, encoding);
|
6475
|
+
if (hasDimensionEncoding) dualAxis_generateDimensionEncoding(dimensions, encoding, measures.length > 1);
|
6355
6476
|
else dualAxis_generateDefaultDimensionEncoding(dimensions, encoding);
|
6356
6477
|
if (hasMeasureEncoding) dualAxis_generateMeasureEncoding(measures, encoding);
|
6357
6478
|
else dualAxis_generateDefaultMeasureEncoding(measures, encoding);
|
@@ -6371,19 +6492,18 @@
|
|
6371
6492
|
encoding.row = [];
|
6372
6493
|
encoding.column = [];
|
6373
6494
|
};
|
6374
|
-
const dualAxis_generateDimensionEncoding = (dimensions, encoding)=>{
|
6495
|
+
const dualAxis_generateDimensionEncoding = (dimensions, encoding, isMultiMeasure)=>{
|
6375
6496
|
encoding.x = chunk_QJLMYOTX_i(dimensions.filter((item)=>'xAxis' === item.encoding).map((item)=>item.id));
|
6376
6497
|
if (0 === encoding.x.length) encoding.x = [
|
6377
6498
|
dimensions[0].id
|
6378
6499
|
];
|
6379
|
-
|
6380
|
-
if (0 === encoding.color.length) encoding.color = [
|
6381
|
-
MeasureName
|
6382
|
-
];
|
6500
|
+
addColorToEncoding(dimensions, encoding, isMultiMeasure);
|
6383
6501
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
6384
6502
|
if (0 === encoding.detail.length) encoding.detail = encoding.color;
|
6385
6503
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
6386
6504
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
6505
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
6506
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
6387
6507
|
};
|
6388
6508
|
const dualAxis_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
6389
6509
|
encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'primaryYAxis' === item.encoding || 'secondaryYAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -6392,9 +6512,15 @@
|
|
6392
6512
|
encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'primaryYAxis' === item.encoding || 'secondaryYAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
6393
6513
|
const color = chunk_QJLMYOTX_i(measures.filter((item)=>'color' === item.encoding).map((item)=>item.id));
|
6394
6514
|
if (color.length > 0) encoding.color = color;
|
6515
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
6516
|
+
encoding.label = chunk_QJLMYOTX_i([
|
6517
|
+
...encoding.label || [],
|
6518
|
+
...label
|
6519
|
+
]);
|
6395
6520
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
6396
6521
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
6397
6522
|
...encoding.tooltip || [],
|
6523
|
+
...label,
|
6398
6524
|
...tooltip
|
6399
6525
|
]);
|
6400
6526
|
};
|
@@ -6659,7 +6785,8 @@
|
|
6659
6785
|
], [
|
6660
6786
|
encodingForDualAxis,
|
6661
6787
|
buildMeasuresForDualAxis,
|
6662
|
-
|
6788
|
+
deleteTooltipAndLabelMeasure,
|
6789
|
+
deleteTooltipAndLabelDimension
|
6663
6790
|
]),
|
6664
6791
|
pivotAdapter([
|
6665
6792
|
reshapeWithDualEncoding
|
@@ -6789,6 +6916,7 @@
|
|
6789
6916
|
case 'columnPercent':
|
6790
6917
|
result.type = 'bar';
|
6791
6918
|
result.percent = true;
|
6919
|
+
result.zIndex = 1000;
|
6792
6920
|
break;
|
6793
6921
|
case 'area':
|
6794
6922
|
result.type = 'area';
|
@@ -6845,6 +6973,7 @@
|
|
6845
6973
|
case 'columnPercent':
|
6846
6974
|
result.type = 'bar';
|
6847
6975
|
result.percent = true;
|
6976
|
+
result.zIndex = 1000;
|
6848
6977
|
break;
|
6849
6978
|
case 'area':
|
6850
6979
|
result.type = 'area';
|
@@ -7415,7 +7544,7 @@
|
|
7415
7544
|
const hasDimensionEncoding = dimensions.some((item)=>item.encoding);
|
7416
7545
|
const hasMeasureEncoding = measures.some((item)=>item.encoding);
|
7417
7546
|
const encoding = {};
|
7418
|
-
if (hasDimensionEncoding) pie_generateDimensionEncoding(dimensions, encoding);
|
7547
|
+
if (hasDimensionEncoding) pie_generateDimensionEncoding(dimensions, encoding, measures.length > 1);
|
7419
7548
|
else pie_generateDefaultDimensionEncoding(dimensions, encoding);
|
7420
7549
|
if (hasMeasureEncoding) pie_generateMeasureEncoding(measures, encoding);
|
7421
7550
|
else pie_generateDefaultMeasureEncoding(measures, encoding);
|
@@ -7433,17 +7562,16 @@
|
|
7433
7562
|
encoding.row = [];
|
7434
7563
|
encoding.column = [];
|
7435
7564
|
};
|
7436
|
-
const pie_generateDimensionEncoding = (dimensions, encoding)=>{
|
7437
|
-
|
7438
|
-
if (0 === encoding.color.length) encoding.color = [
|
7439
|
-
MeasureName
|
7440
|
-
];
|
7565
|
+
const pie_generateDimensionEncoding = (dimensions, encoding, isMultiMeasure)=>{
|
7566
|
+
addColorToEncoding(dimensions, encoding, isMultiMeasure);
|
7441
7567
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
7442
7568
|
if (0 === encoding.detail.length) encoding.detail = [
|
7443
7569
|
MeasureName
|
7444
7570
|
];
|
7445
7571
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
7446
7572
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
7573
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
7574
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
7447
7575
|
};
|
7448
7576
|
const pie_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
7449
7577
|
encoding.angle = chunk_QJLMYOTX_i(measures.filter((item)=>'angle' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -7452,9 +7580,15 @@
|
|
7452
7580
|
encoding.angle = chunk_QJLMYOTX_i(measures.filter((item)=>'angle' === item.encoding || !item.encoding).map((item)=>item.id));
|
7453
7581
|
const color = chunk_QJLMYOTX_i(measures.filter((item)=>'color' === item.encoding).map((item)=>item.id));
|
7454
7582
|
if (color.length > 0) encoding.color = color;
|
7583
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
7584
|
+
encoding.label = chunk_QJLMYOTX_i([
|
7585
|
+
...encoding.label || [],
|
7586
|
+
...label
|
7587
|
+
]);
|
7455
7588
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
7456
7589
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
7457
7590
|
...encoding.tooltip || [],
|
7591
|
+
...label,
|
7458
7592
|
...tooltip
|
7459
7593
|
]);
|
7460
7594
|
};
|
@@ -7469,7 +7603,8 @@
|
|
7469
7603
|
], [
|
7470
7604
|
encodingForPie,
|
7471
7605
|
buildMeasures,
|
7472
|
-
|
7606
|
+
deleteTooltipAndLabelMeasure,
|
7607
|
+
deleteTooltipAndLabelDimension
|
7473
7608
|
]),
|
7474
7609
|
pivotAdapter([
|
7475
7610
|
reshapeWithEncoding
|
@@ -7595,7 +7730,8 @@
|
|
7595
7730
|
], [
|
7596
7731
|
encodingForPie,
|
7597
7732
|
buildMeasures,
|
7598
|
-
|
7733
|
+
deleteTooltipAndLabelMeasure,
|
7734
|
+
deleteTooltipAndLabelDimension
|
7599
7735
|
]),
|
7600
7736
|
pivotAdapter([
|
7601
7737
|
reshapeWithEncoding
|
@@ -7689,7 +7825,7 @@
|
|
7689
7825
|
const hasDimensionEncoding = dimensions.some((item)=>item.encoding);
|
7690
7826
|
const hasMeasureEncoding = measures.some((item)=>item.encoding);
|
7691
7827
|
const encoding = {};
|
7692
|
-
if (hasDimensionEncoding) rose_generateDimensionEncoding(dimensions, encoding);
|
7828
|
+
if (hasDimensionEncoding) rose_generateDimensionEncoding(dimensions, encoding, measures.length > 1);
|
7693
7829
|
else rose_generateDefaultDimensionEncoding(dimensions, encoding);
|
7694
7830
|
if (hasMeasureEncoding) rose_generateMeasureEncoding(measures, encoding);
|
7695
7831
|
else rose_generateDefaultMeasureEncoding(measures, encoding);
|
@@ -7709,19 +7845,18 @@
|
|
7709
7845
|
encoding.row = [];
|
7710
7846
|
encoding.column = [];
|
7711
7847
|
};
|
7712
|
-
const rose_generateDimensionEncoding = (dimensions, encoding)=>{
|
7848
|
+
const rose_generateDimensionEncoding = (dimensions, encoding, isMultiMeasure)=>{
|
7713
7849
|
encoding.angle = chunk_QJLMYOTX_i(dimensions.filter((item)=>'angle' === item.encoding).map((item)=>item.id));
|
7714
7850
|
if (0 === encoding.angle.length) encoding.angle = [
|
7715
7851
|
dimensions[0].id
|
7716
7852
|
];
|
7717
|
-
|
7718
|
-
if (0 === encoding.color.length) encoding.color = [
|
7719
|
-
MeasureName
|
7720
|
-
];
|
7853
|
+
addColorToEncoding(dimensions, encoding, isMultiMeasure);
|
7721
7854
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
7722
7855
|
if (0 === encoding.detail.length) encoding.detail = encoding.color;
|
7723
7856
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
7724
7857
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
7858
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
7859
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
7725
7860
|
};
|
7726
7861
|
const rose_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
7727
7862
|
encoding.radius = chunk_QJLMYOTX_i(measures.filter((item)=>'radius' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -7730,9 +7865,15 @@
|
|
7730
7865
|
encoding.radius = chunk_QJLMYOTX_i(measures.filter((item)=>'radius' === item.encoding || !item.encoding).map((item)=>item.id));
|
7731
7866
|
const color = chunk_QJLMYOTX_i(measures.filter((item)=>'color' === item.encoding).map((item)=>item.id));
|
7732
7867
|
if (color.length > 0) encoding.color = color;
|
7868
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
7869
|
+
encoding.label = chunk_QJLMYOTX_i([
|
7870
|
+
...encoding.label || [],
|
7871
|
+
...label
|
7872
|
+
]);
|
7733
7873
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
7734
7874
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
7735
7875
|
...encoding.tooltip || [],
|
7876
|
+
...label,
|
7736
7877
|
...tooltip
|
7737
7878
|
]);
|
7738
7879
|
};
|
@@ -7747,7 +7888,8 @@
|
|
7747
7888
|
], [
|
7748
7889
|
encodingForRose,
|
7749
7890
|
buildMeasures,
|
7750
|
-
|
7891
|
+
deleteTooltipAndLabelMeasure,
|
7892
|
+
deleteTooltipAndLabelDimension
|
7751
7893
|
]),
|
7752
7894
|
pivotAdapter([
|
7753
7895
|
reshapeWithEncoding
|
@@ -7795,6 +7937,7 @@
|
|
7795
7937
|
const showAxis = !(is0D || is1M1D);
|
7796
7938
|
if (!result.axes) result.axes = [];
|
7797
7939
|
result.axes.push({
|
7940
|
+
type: 'band',
|
7798
7941
|
orient: 'angle',
|
7799
7942
|
visible: showAxis,
|
7800
7943
|
zero: true,
|
@@ -7837,6 +7980,7 @@
|
|
7837
7980
|
const showAxis = !(is0D || is1M1D);
|
7838
7981
|
if (!result.axes) result.axes = [];
|
7839
7982
|
result.axes.push({
|
7983
|
+
type: 'linear',
|
7840
7984
|
orient: 'radius',
|
7841
7985
|
visible: showAxis,
|
7842
7986
|
zero: true,
|
@@ -7953,7 +8097,8 @@
|
|
7953
8097
|
], [
|
7954
8098
|
encodingForRose,
|
7955
8099
|
buildMeasures,
|
7956
|
-
|
8100
|
+
deleteTooltipAndLabelMeasure,
|
8101
|
+
deleteTooltipAndLabelDimension
|
7957
8102
|
]),
|
7958
8103
|
pivotAdapter([
|
7959
8104
|
reshapeWithEncoding
|
@@ -8077,7 +8222,7 @@
|
|
8077
8222
|
const hasDimensionEncoding = dimensions.some((item)=>item.encoding);
|
8078
8223
|
const hasMeasureEncoding = measures.some((item)=>item.encoding);
|
8079
8224
|
const encoding = {};
|
8080
|
-
if (hasDimensionEncoding) radar_generateDimensionEncoding(dimensions, encoding);
|
8225
|
+
if (hasDimensionEncoding) radar_generateDimensionEncoding(dimensions, encoding, measures.length > 1);
|
8081
8226
|
else radar_generateDefaultDimensionEncoding(dimensions, encoding);
|
8082
8227
|
if (hasMeasureEncoding) radar_generateMeasureEncoding(measures, encoding);
|
8083
8228
|
else radar_generateDefaultMeasureEncoding(measures, encoding);
|
@@ -8096,21 +8241,20 @@
|
|
8096
8241
|
encoding.row = [];
|
8097
8242
|
encoding.column = [];
|
8098
8243
|
};
|
8099
|
-
const radar_generateDimensionEncoding = (dimensions, encoding)=>{
|
8244
|
+
const radar_generateDimensionEncoding = (dimensions, encoding, isMultiMeasure)=>{
|
8100
8245
|
encoding.angle = chunk_QJLMYOTX_i(dimensions.filter((item)=>'angle' === item.encoding).map((item)=>item.id));
|
8101
8246
|
if (0 === encoding.angle.length) encoding.angle = [
|
8102
8247
|
dimensions[0].id
|
8103
8248
|
];
|
8104
|
-
|
8105
|
-
if (0 === encoding.color.length) encoding.color = [
|
8106
|
-
MeasureName
|
8107
|
-
];
|
8249
|
+
addColorToEncoding(dimensions, encoding, isMultiMeasure);
|
8108
8250
|
encoding.detail = [];
|
8109
8251
|
if (0 === encoding.detail.length) encoding.detail = [
|
8110
8252
|
MeasureName
|
8111
8253
|
];
|
8112
8254
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
8113
8255
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
8256
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
8257
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
8114
8258
|
};
|
8115
8259
|
const radar_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
8116
8260
|
encoding.radius = chunk_QJLMYOTX_i(measures.filter((item)=>'radius' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -8119,9 +8263,15 @@
|
|
8119
8263
|
encoding.radius = chunk_QJLMYOTX_i(measures.filter((item)=>'radius' === item.encoding || !item.encoding).map((item)=>item.id));
|
8120
8264
|
const color = chunk_QJLMYOTX_i(measures.filter((item)=>'color' === item.encoding).map((item)=>item.id));
|
8121
8265
|
if (color.length > 0) encoding.color = color;
|
8266
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
8267
|
+
encoding.label = chunk_QJLMYOTX_i([
|
8268
|
+
...encoding.label || [],
|
8269
|
+
...label
|
8270
|
+
]);
|
8122
8271
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
8123
8272
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
8124
8273
|
...encoding.tooltip || [],
|
8274
|
+
...label,
|
8125
8275
|
...tooltip
|
8126
8276
|
]);
|
8127
8277
|
};
|
@@ -8136,7 +8286,8 @@
|
|
8136
8286
|
], [
|
8137
8287
|
encodingForRadar,
|
8138
8288
|
buildMeasures,
|
8139
|
-
|
8289
|
+
deleteTooltipAndLabelMeasure,
|
8290
|
+
deleteTooltipAndLabelDimension
|
8140
8291
|
]),
|
8141
8292
|
pivotAdapter([
|
8142
8293
|
reshapeWithEncoding
|
@@ -8288,7 +8439,7 @@
|
|
8288
8439
|
const hasDimensionEncoding = dimensions.some((item)=>item.encoding);
|
8289
8440
|
const hasMeasureEncoding = measures.some((item)=>item.encoding);
|
8290
8441
|
const encoding = {};
|
8291
|
-
if (hasDimensionEncoding) funnel_generateDimensionEncoding(dimensions, encoding);
|
8442
|
+
if (hasDimensionEncoding) funnel_generateDimensionEncoding(dimensions, encoding, measures.length > 1);
|
8292
8443
|
else funnel_generateDefaultDimensionEncoding(dimensions, encoding);
|
8293
8444
|
if (hasMeasureEncoding) funnel_generateMeasureEncoding(measures, encoding);
|
8294
8445
|
else funnel_generateDefaultMeasureEncoding(measures, encoding);
|
@@ -8306,17 +8457,16 @@
|
|
8306
8457
|
encoding.row = [];
|
8307
8458
|
encoding.column = [];
|
8308
8459
|
};
|
8309
|
-
const funnel_generateDimensionEncoding = (dimensions, encoding)=>{
|
8310
|
-
|
8311
|
-
if (0 === encoding.color.length) encoding.color = [
|
8312
|
-
MeasureName
|
8313
|
-
];
|
8460
|
+
const funnel_generateDimensionEncoding = (dimensions, encoding, isMultiMeasure)=>{
|
8461
|
+
addColorToEncoding(dimensions, encoding, isMultiMeasure);
|
8314
8462
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
8315
8463
|
if (0 === encoding.detail.length) encoding.detail = [
|
8316
8464
|
MeasureName
|
8317
8465
|
];
|
8318
8466
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
8319
8467
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
8468
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
8469
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
8320
8470
|
};
|
8321
8471
|
const funnel_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
8322
8472
|
encoding.size = chunk_QJLMYOTX_i(measures.filter((item)=>'size' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -8327,9 +8477,15 @@
|
|
8327
8477
|
if (color.length > 0) encoding.color = [
|
8328
8478
|
color[0]
|
8329
8479
|
];
|
8480
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
8481
|
+
encoding.label = chunk_QJLMYOTX_i([
|
8482
|
+
...encoding.label || [],
|
8483
|
+
...label
|
8484
|
+
]);
|
8330
8485
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
8331
8486
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
8332
8487
|
...encoding.tooltip || [],
|
8488
|
+
...label,
|
8333
8489
|
...tooltip
|
8334
8490
|
]);
|
8335
8491
|
};
|
@@ -8344,7 +8500,8 @@
|
|
8344
8500
|
], [
|
8345
8501
|
encodingForFunnel,
|
8346
8502
|
buildMeasures,
|
8347
|
-
|
8503
|
+
deleteTooltipAndLabelMeasure,
|
8504
|
+
deleteTooltipAndLabelDimension
|
8348
8505
|
]),
|
8349
8506
|
pivotAdapter([
|
8350
8507
|
reshapeWithEncoding
|
@@ -8475,7 +8632,7 @@
|
|
8475
8632
|
const hasDimensionEncoding = dimensions.some((item)=>item.encoding);
|
8476
8633
|
const hasMeasureEncoding = measures.some((item)=>item.encoding);
|
8477
8634
|
const encoding = {};
|
8478
|
-
if (hasDimensionEncoding) heatmap_generateDimensionEncoding(dimensions, encoding);
|
8635
|
+
if (hasDimensionEncoding) heatmap_generateDimensionEncoding(dimensions, encoding, measures.length > 1);
|
8479
8636
|
else heatmap_generateDefaultDimensionEncoding(dimensions, encoding);
|
8480
8637
|
if (hasMeasureEncoding) heatmap_generateMeasureEncoding(measures, encoding);
|
8481
8638
|
else heatmap_generateDefaultMeasureEncoding(measures, encoding);
|
@@ -8496,7 +8653,7 @@
|
|
8496
8653
|
encoding.row = [];
|
8497
8654
|
encoding.column = [];
|
8498
8655
|
};
|
8499
|
-
const heatmap_generateDimensionEncoding = (dimensions, encoding)=>{
|
8656
|
+
const heatmap_generateDimensionEncoding = (dimensions, encoding, isMultiMeasure)=>{
|
8500
8657
|
encoding.x = chunk_QJLMYOTX_i(dimensions.filter((item)=>'xAxis' === item.encoding).map((item)=>item.id));
|
8501
8658
|
if (0 === encoding.x.length) encoding.x = [
|
8502
8659
|
dimensions[0].id
|
@@ -8504,14 +8661,13 @@
|
|
8504
8661
|
encoding.y = chunk_QJLMYOTX_i(dimensions.filter((item)=>'yAxis' === item.encoding).map((item)=>item.id));
|
8505
8662
|
if (0 === encoding.y.length) if (dimensions.length > 1) encoding.y = dimensions.slice(1).map((item)=>item.id);
|
8506
8663
|
else encoding.y = dimensions.slice(0).map((item)=>item.id);
|
8507
|
-
|
8508
|
-
if (0 === encoding.color.length) encoding.color = [
|
8509
|
-
MeasureName
|
8510
|
-
];
|
8664
|
+
addColorToEncoding(dimensions, encoding, isMultiMeasure);
|
8511
8665
|
encoding.detail = chunk_QJLMYOTX_i(dimensions.filter((item)=>'detail' === item.encoding).map((item)=>item.id));
|
8512
8666
|
if (0 === encoding.detail.length) encoding.detail = encoding.color;
|
8513
8667
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
8514
8668
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
8669
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
8670
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
8515
8671
|
};
|
8516
8672
|
const heatmap_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
8517
8673
|
const colorDims = chunk_QJLMYOTX_i(measures.filter((item)=>'color' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -8524,9 +8680,15 @@
|
|
8524
8680
|
if (color.length > 0) encoding.color = [
|
8525
8681
|
color[0]
|
8526
8682
|
];
|
8683
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
8684
|
+
encoding.label = chunk_QJLMYOTX_i([
|
8685
|
+
...encoding.label || [],
|
8686
|
+
...label
|
8687
|
+
]);
|
8527
8688
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
8528
8689
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
8529
8690
|
...encoding.tooltip || [],
|
8691
|
+
...label,
|
8530
8692
|
...tooltip
|
8531
8693
|
]);
|
8532
8694
|
};
|
@@ -8541,7 +8703,8 @@
|
|
8541
8703
|
], [
|
8542
8704
|
encodingForHeatmap,
|
8543
8705
|
buildMeasures,
|
8544
|
-
|
8706
|
+
deleteTooltipAndLabelMeasure,
|
8707
|
+
deleteTooltipAndLabelDimension
|
8545
8708
|
]),
|
8546
8709
|
pivotAdapter([
|
8547
8710
|
reshapeWithEncoding
|
@@ -8902,7 +9065,12 @@
|
|
8902
9065
|
]
|
8903
9066
|
},
|
8904
9067
|
label: {
|
8905
|
-
enable: true
|
9068
|
+
enable: true,
|
9069
|
+
wrap: true,
|
9070
|
+
showValue: true,
|
9071
|
+
showValuePercent: false,
|
9072
|
+
labelColorSmartInvert: false,
|
9073
|
+
labelOverlap: true
|
8906
9074
|
},
|
8907
9075
|
tooltip: {
|
8908
9076
|
enable: true
|
@@ -8913,7 +9081,7 @@
|
|
8913
9081
|
maxSize: 1,
|
8914
9082
|
shapeType: 'rectRound',
|
8915
9083
|
position: 'rt',
|
8916
|
-
|
9084
|
+
labelColor: '#646A73',
|
8917
9085
|
labelFontSize: 12,
|
8918
9086
|
labelFontWeight: 400
|
8919
9087
|
}
|
@@ -9063,7 +9231,11 @@
|
|
9063
9231
|
crosshairRect
|
9064
9232
|
},
|
9065
9233
|
pie: {
|
9066
|
-
...baseConfig
|
9234
|
+
...baseConfig,
|
9235
|
+
label: {
|
9236
|
+
...baseConfig.label,
|
9237
|
+
showValuePercent: true
|
9238
|
+
}
|
9067
9239
|
},
|
9068
9240
|
donut: {
|
9069
9241
|
...baseConfig
|
@@ -9072,10 +9244,18 @@
|
|
9072
9244
|
...baseConfig
|
9073
9245
|
},
|
9074
9246
|
rose: {
|
9075
|
-
...baseConfig
|
9247
|
+
...baseConfig,
|
9248
|
+
label: {
|
9249
|
+
...baseConfig.label,
|
9250
|
+
showValuePercent: true
|
9251
|
+
}
|
9076
9252
|
},
|
9077
9253
|
roseParallel: {
|
9078
|
-
...baseConfig
|
9254
|
+
...baseConfig,
|
9255
|
+
label: {
|
9256
|
+
...baseConfig.label,
|
9257
|
+
showValuePercent: true
|
9258
|
+
}
|
9079
9259
|
},
|
9080
9260
|
funnel: {
|
9081
9261
|
...baseConfig
|
@@ -9211,7 +9391,12 @@
|
|
9211
9391
|
]
|
9212
9392
|
},
|
9213
9393
|
label: {
|
9214
|
-
enable: true
|
9394
|
+
enable: true,
|
9395
|
+
wrap: true,
|
9396
|
+
showValue: true,
|
9397
|
+
showValuePercent: false,
|
9398
|
+
labelColorSmartInvert: false,
|
9399
|
+
labelOverlap: true
|
9215
9400
|
},
|
9216
9401
|
tooltip: {
|
9217
9402
|
enable: true
|
@@ -9222,7 +9407,7 @@
|
|
9222
9407
|
maxSize: 1,
|
9223
9408
|
position: 'rt',
|
9224
9409
|
shapeType: 'rectRound',
|
9225
|
-
|
9410
|
+
labelColor: '#FDFDFD',
|
9226
9411
|
labelFontSize: 12,
|
9227
9412
|
labelFontWeight: 400
|
9228
9413
|
}
|
@@ -9371,7 +9556,11 @@
|
|
9371
9556
|
crosshairRect
|
9372
9557
|
},
|
9373
9558
|
pie: {
|
9374
|
-
...baseConfig
|
9559
|
+
...baseConfig,
|
9560
|
+
label: {
|
9561
|
+
...baseConfig.label,
|
9562
|
+
showValuePercent: true
|
9563
|
+
}
|
9375
9564
|
},
|
9376
9565
|
donut: {
|
9377
9566
|
...baseConfig
|
@@ -9380,10 +9569,18 @@
|
|
9380
9569
|
...baseConfig
|
9381
9570
|
},
|
9382
9571
|
rose: {
|
9383
|
-
...baseConfig
|
9572
|
+
...baseConfig,
|
9573
|
+
label: {
|
9574
|
+
...baseConfig.label,
|
9575
|
+
showValuePercent: true
|
9576
|
+
}
|
9384
9577
|
},
|
9385
9578
|
roseParallel: {
|
9386
|
-
...baseConfig
|
9579
|
+
...baseConfig,
|
9580
|
+
label: {
|
9581
|
+
...baseConfig.label,
|
9582
|
+
showValuePercent: true
|
9583
|
+
}
|
9387
9584
|
},
|
9388
9585
|
funnel: {
|
9389
9586
|
...baseConfig
|
@@ -9437,15 +9634,6 @@
|
|
9437
9634
|
const updateSpec = (chartType, specPipe)=>{
|
9438
9635
|
Builder._customSpecPipe[chartType] = specPipe;
|
9439
9636
|
};
|
9440
|
-
const findAllDimensions = (dimensions = [])=>{
|
9441
|
-
if (!dimensions) return [];
|
9442
|
-
const result = [];
|
9443
|
-
preorderTraverse(dimensions, (node)=>{
|
9444
|
-
if (!('children' in node)) result.push(node);
|
9445
|
-
return false;
|
9446
|
-
});
|
9447
|
-
return result;
|
9448
|
-
};
|
9449
9637
|
Object.freeze({
|
9450
9638
|
status: "aborted"
|
9451
9639
|
});
|
@@ -12867,8 +13055,14 @@
|
|
12867
13055
|
const zScatterMeasures = schemas_array(zScatterMeasure);
|
12868
13056
|
const zFoldInfo = schemas_object({
|
12869
13057
|
foldMap: record(schemas_string(), schemas_string().or(schemas_undefined())),
|
12870
|
-
|
12871
|
-
|
13058
|
+
statistics: schemas_object({
|
13059
|
+
min: schemas_number(),
|
13060
|
+
max: schemas_number(),
|
13061
|
+
sum: schemas_number(),
|
13062
|
+
count: schemas_number(),
|
13063
|
+
colorMin: schemas_number(),
|
13064
|
+
colorMax: schemas_number()
|
13065
|
+
}),
|
12872
13066
|
measureId: schemas_string(),
|
12873
13067
|
measureName: schemas_string(),
|
12874
13068
|
measureValue: schemas_string()
|
@@ -13083,7 +13277,19 @@
|
|
13083
13277
|
linearColorScheme: schemas_array(schemas_string()).nullish()
|
13084
13278
|
});
|
13085
13279
|
const zLabel = schemas_object({
|
13086
|
-
enable: schemas_boolean().
|
13280
|
+
enable: schemas_boolean().nullish(),
|
13281
|
+
wrap: schemas_boolean().nullish(),
|
13282
|
+
showValue: schemas_boolean().nullish(),
|
13283
|
+
showValuePercent: schemas_boolean().nullish(),
|
13284
|
+
autoFormat: schemas_boolean().nullish(),
|
13285
|
+
numFormat: zNumFormat.nullish(),
|
13286
|
+
labelFontSize: schemas_number().nullish(),
|
13287
|
+
labelFontWeight: schemas_number().or(schemas_string()).nullish(),
|
13288
|
+
labelBackgroundColor: schemas_string().nullish(),
|
13289
|
+
labelColor: schemas_string().nullish(),
|
13290
|
+
labelColorSmartInvert: schemas_boolean().nullish(),
|
13291
|
+
labelPosition: schemas_string().nullish(),
|
13292
|
+
labelOverlap: schemas_boolean().nullish()
|
13087
13293
|
});
|
13088
13294
|
const zLegend = schemas_object({
|
13089
13295
|
enable: schemas_boolean().default(true).nullish(),
|
@@ -13135,8 +13341,8 @@
|
|
13135
13341
|
'bl',
|
13136
13342
|
'br'
|
13137
13343
|
]).default('bottom').nullish(),
|
13344
|
+
labelColor: schemas_string().default('#fff').nullish(),
|
13138
13345
|
labelFontSize: schemas_number().default(12).nullish(),
|
13139
|
-
labelFontColor: schemas_string().default('#fff').nullish(),
|
13140
13346
|
labelFontWeight: schemas_number().or(schemas_string()).default(400).nullish()
|
13141
13347
|
});
|
13142
13348
|
const zColorLegend = schemas_object({
|