@visactor/vseed 0.1.12 → 0.1.13
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 +357 -9
- 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/bar.js +8 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/bar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/column.js +8 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/column.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/dualAxis.js +8 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/funnel.js +8 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/funnel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/heatmap.js +8 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/heatmap.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/line.js +8 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/line.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/pie.js +8 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/pie.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/radar.js +8 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/radar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/rose.js +8 -0
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/rose.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/encoding/scatter.js +8 -0
- 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/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 +41 -20
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/legend/pivotColorLegend.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 +19 -4
- package/dist/esm/theme/dark.js.map +1 -1
- package/dist/esm/theme/light.js +19 -4
- package/dist/esm/theme/light.js.map +1 -1
- package/dist/esm/types/advancedVSeed.d.ts +160 -40
- package/dist/esm/types/chartType/area/zArea.d.ts +4 -1
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +4 -1
- package/dist/esm/types/chartType/bar/zBar.d.ts +4 -1
- package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +4 -1
- package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +4 -1
- package/dist/esm/types/chartType/column/zColumn.d.ts +4 -1
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +4 -1
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +4 -1
- package/dist/esm/types/chartType/donut/zDonut.d.ts +4 -1
- package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +4 -1
- package/dist/esm/types/chartType/funnel/zFunnel.d.ts +4 -1
- package/dist/esm/types/chartType/heatmap/zHeatmap.d.ts +4 -1
- package/dist/esm/types/chartType/line/zLine.d.ts +4 -1
- package/dist/esm/types/chartType/pie/zPie.d.ts +4 -1
- package/dist/esm/types/chartType/radar/zRadar.d.ts +4 -1
- package/dist/esm/types/chartType/rose/zRose.d.ts +4 -1
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +4 -1
- package/dist/esm/types/chartType/scatter/zScatter.d.ts +4 -1
- package/dist/esm/types/properties/config/config.d.ts +144 -36
- package/dist/esm/types/properties/config/config.js +1 -1
- 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 +15 -6
- package/dist/esm/types/properties/config/label/label.js +0 -7
- package/dist/esm/types/properties/config/label/zLabel.d.ts +7 -0
- package/dist/esm/types/properties/config/label/zLabel.js +10 -0
- package/dist/esm/types/properties/config/label/zLabel.js.map +1 -0
- 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 +144 -36
- package/dist/esm/types/zVseed.d.ts +72 -18
- package/dist/umd/index.js +405 -205
- package/dist/umd/index.js.map +1 -1
- package/package.json +2 -2
- 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/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
|
}
|
@@ -1735,6 +1827,8 @@
|
|
1735
1827
|
];
|
1736
1828
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
1737
1829
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
1830
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
1831
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
1738
1832
|
};
|
1739
1833
|
const line_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
1740
1834
|
encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'yAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -1743,100 +1837,18 @@
|
|
1743
1837
|
encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'yAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
1744
1838
|
const color = chunk_QJLMYOTX_i(measures.filter((item)=>'color' === item.encoding).map((item)=>item.id));
|
1745
1839
|
if (color.length > 0) encoding.color = color;
|
1840
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
1841
|
+
encoding.label = chunk_QJLMYOTX_i([
|
1842
|
+
...encoding.label || [],
|
1843
|
+
...label
|
1844
|
+
]);
|
1746
1845
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
1747
1846
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
1748
1847
|
...encoding.tooltip || [],
|
1848
|
+
...label,
|
1749
1849
|
...tooltip
|
1750
1850
|
]);
|
1751
1851
|
};
|
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
1852
|
const buildMeasures = (advancedVSeed)=>{
|
1841
1853
|
if (isMeasureTreeWithChildren(advancedVSeed.measures)) {
|
1842
1854
|
advancedVSeed.measures = normalizeMeasureTree(advancedVSeed.measures);
|
@@ -1918,14 +1930,60 @@
|
|
1918
1930
|
}
|
1919
1931
|
return measureTree;
|
1920
1932
|
};
|
1921
|
-
const
|
1922
|
-
const deleteBy = (measure)=>'tooltip' === measure.encoding;
|
1933
|
+
const deleteTooltipAndLabelMeasure = (advancedVSeed)=>{
|
1934
|
+
const deleteBy = (measure)=>'tooltip' === measure.encoding || 'label' === measure.encoding;
|
1923
1935
|
const measureTree = deleteMeasureTreeByCallback(advancedVSeed.measures, deleteBy);
|
1924
1936
|
return {
|
1925
1937
|
...advancedVSeed,
|
1926
1938
|
measures: measureTree
|
1927
1939
|
};
|
1928
1940
|
};
|
1941
|
+
const isDimension = (dimension)=>!('children' in dimension);
|
1942
|
+
const isDimensionGroup = (dimension)=>'children' in dimension;
|
1943
|
+
const deleteDimensionTreeByCallback = (dimensionTree, callback)=>{
|
1944
|
+
if (!dimensionTree) return dimensionTree;
|
1945
|
+
const stack = [
|
1946
|
+
...dimensionTree
|
1947
|
+
].reverse();
|
1948
|
+
const parents = new Map();
|
1949
|
+
dimensionTree.forEach((node)=>{
|
1950
|
+
parents.set(node, dimensionTree);
|
1951
|
+
});
|
1952
|
+
const nodesToProcess = [];
|
1953
|
+
const visited = new Set();
|
1954
|
+
while(stack.length > 0){
|
1955
|
+
const node = stack[stack.length - 1];
|
1956
|
+
if (isDimensionGroup(node) && node.children && !visited.has(node)) {
|
1957
|
+
visited.add(node);
|
1958
|
+
const children = node.children.slice().reverse();
|
1959
|
+
for (const child of children){
|
1960
|
+
parents.set(child, node.children);
|
1961
|
+
stack.push(child);
|
1962
|
+
}
|
1963
|
+
} else {
|
1964
|
+
stack.pop();
|
1965
|
+
nodesToProcess.push(node);
|
1966
|
+
}
|
1967
|
+
}
|
1968
|
+
for (const node of nodesToProcess){
|
1969
|
+
const parentList = parents.get(node);
|
1970
|
+
if (parentList) {
|
1971
|
+
const index = parentList.indexOf(node);
|
1972
|
+
if (isDimension(node)) {
|
1973
|
+
if (callback?.(node, index, parentList)) parentList.splice(index, 1);
|
1974
|
+
}
|
1975
|
+
}
|
1976
|
+
}
|
1977
|
+
return dimensionTree;
|
1978
|
+
};
|
1979
|
+
const deleteTooltipAndLabelDimension = (advancedVSeed)=>{
|
1980
|
+
const deleteBy = (dimension)=>'tooltip' === dimension.encoding || 'label' === dimension.encoding;
|
1981
|
+
const dimensionTree = deleteDimensionTreeByCallback(advancedVSeed.dimensions, deleteBy);
|
1982
|
+
return {
|
1983
|
+
...advancedVSeed,
|
1984
|
+
dimensions: dimensionTree
|
1985
|
+
};
|
1986
|
+
};
|
1929
1987
|
const pivotAdapter = (pipeline, pivotPipeline)=>(advancedVSeed, context)=>{
|
1930
1988
|
const { vseed } = context;
|
1931
1989
|
const usePivotChart = isPivotChart(vseed);
|
@@ -2327,7 +2385,8 @@
|
|
2327
2385
|
], [
|
2328
2386
|
encodingForLine,
|
2329
2387
|
buildMeasures,
|
2330
|
-
|
2388
|
+
deleteTooltipAndLabelMeasure,
|
2389
|
+
deleteTooltipAndLabelDimension
|
2331
2390
|
]),
|
2332
2391
|
pivotAdapter([
|
2333
2392
|
reshapeWithEncoding
|
@@ -3213,36 +3272,56 @@
|
|
3213
3272
|
const result = {
|
3214
3273
|
...spec
|
3215
3274
|
};
|
3216
|
-
const { advancedVSeed } = context;
|
3217
|
-
const { measures, datasetReshapeInfo
|
3218
|
-
const { chartType } = advancedVSeed;
|
3275
|
+
const { advancedVSeed, vseed } = context;
|
3276
|
+
const { measures, datasetReshapeInfo } = advancedVSeed;
|
3277
|
+
const { chartType, encoding } = advancedVSeed;
|
3219
3278
|
const baseConfig = advancedVSeed.config[chartType];
|
3220
3279
|
if (!baseConfig || !baseConfig.label) return result;
|
3221
|
-
const { measureId, measureValue } = datasetReshapeInfo[0].foldInfo;
|
3280
|
+
const { measureId, measureValue, statistics } = datasetReshapeInfo[0].foldInfo;
|
3222
3281
|
const { label } = baseConfig;
|
3223
|
-
const { enable } = label;
|
3282
|
+
const { enable, wrap, showValue, showValuePercent } = label;
|
3283
|
+
const labelDims = T((vseed.dimensions || []).filter((item)=>encoding.label?.includes(item.id)), (item)=>item.id);
|
3284
|
+
const labelMeas = T((vseed.measures || []).filter((item)=>encoding.label?.includes(item.id)), (item)=>item.id);
|
3285
|
+
const format = {
|
3286
|
+
type: 'percent'
|
3287
|
+
};
|
3288
|
+
const formatter = createFormatter(format);
|
3224
3289
|
result.label = {
|
3225
3290
|
visible: enable,
|
3226
|
-
formatMethod: (
|
3291
|
+
formatMethod: (_, datum)=>{
|
3227
3292
|
const result = [];
|
3228
|
-
const
|
3229
|
-
|
3230
|
-
|
3231
|
-
|
3232
|
-
|
3233
|
-
|
3234
|
-
|
3235
|
-
|
3236
|
-
|
3237
|
-
|
3238
|
-
return String(value);
|
3239
|
-
};
|
3240
|
-
result.push(formatValue(datum[measureValue]));
|
3293
|
+
const measure = findMeasureById(measures, datum[measureId]);
|
3294
|
+
const dimLabels = labelDims.map((item)=>item.alias || item.id);
|
3295
|
+
const meaLabels = labelMeas.map((item)=>generateMeasureValue(datum[item.id], item));
|
3296
|
+
const measureValueLabel = generateMeasureValue(datum[measureValue], measure);
|
3297
|
+
const measurePercentLabel = generateMeasurePercent(datum[measureValue], statistics.sum, formatter);
|
3298
|
+
result.push(...dimLabels);
|
3299
|
+
if (showValue) result.push(measureValueLabel);
|
3300
|
+
if (showValuePercent) result.push(measurePercentLabel);
|
3301
|
+
result.push(...meaLabels);
|
3302
|
+
if (wrap) return result;
|
3241
3303
|
return result.join(' ');
|
3242
3304
|
}
|
3243
3305
|
};
|
3244
3306
|
return result;
|
3245
3307
|
};
|
3308
|
+
const generateMeasureValue = (value, measure)=>{
|
3309
|
+
if (!measure) return value;
|
3310
|
+
const { format = {}, autoFormat = true } = measure;
|
3311
|
+
if (!chunk_VCYTMP4D_n(format)) {
|
3312
|
+
const formatter = createFormatter(format);
|
3313
|
+
return formatter(value);
|
3314
|
+
}
|
3315
|
+
if (autoFormat) return autoFormatter(value, intl.getLocale());
|
3316
|
+
return String(value);
|
3317
|
+
};
|
3318
|
+
const generateMeasurePercent = (value, sum, formatter)=>{
|
3319
|
+
if (null == value) return String(value);
|
3320
|
+
const num = Number(value);
|
3321
|
+
if (Number.isNaN(num)) return String(value);
|
3322
|
+
const percentValue = num / sum;
|
3323
|
+
return formatter(percentValue);
|
3324
|
+
};
|
3246
3325
|
const tooltip_tooltip = (spec, context)=>{
|
3247
3326
|
const result = {
|
3248
3327
|
...spec
|
@@ -4145,8 +4224,8 @@
|
|
4145
4224
|
const baseConfig = advancedVSeed.config[chartType];
|
4146
4225
|
if (!baseConfig || !baseConfig.legend) return result;
|
4147
4226
|
const { datasetReshapeInfo } = advancedVSeed;
|
4148
|
-
const max = Math.max(...datasetReshapeInfo.map((d)=>d.foldInfo.
|
4149
|
-
const min = Math.min(...datasetReshapeInfo.map((d)=>d.foldInfo.
|
4227
|
+
const max = Math.max(...datasetReshapeInfo.map((d)=>d.foldInfo.statistics.colorMin));
|
4228
|
+
const min = Math.min(...datasetReshapeInfo.map((d)=>d.foldInfo.statistics.colorMax));
|
4150
4229
|
const { legend, color } = baseConfig;
|
4151
4230
|
const { colorScheme, linearColorScheme } = color;
|
4152
4231
|
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight = 400 } = legend || {};
|
@@ -4334,6 +4413,8 @@
|
|
4334
4413
|
if (0 === encoding.detail.length) encoding.detail = encoding.color;
|
4335
4414
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
4336
4415
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
4416
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
4417
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
4337
4418
|
};
|
4338
4419
|
const column_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
4339
4420
|
encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'yAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -4342,9 +4423,15 @@
|
|
4342
4423
|
encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'yAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
4343
4424
|
const color = chunk_QJLMYOTX_i(measures.filter((item)=>'color' === item.encoding).map((item)=>item.id));
|
4344
4425
|
if (color.length > 0) encoding.color = color;
|
4426
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
4427
|
+
encoding.label = chunk_QJLMYOTX_i([
|
4428
|
+
...encoding.label || [],
|
4429
|
+
...label
|
4430
|
+
]);
|
4345
4431
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
4346
4432
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
4347
4433
|
...encoding.tooltip || [],
|
4434
|
+
...label,
|
4348
4435
|
...tooltip
|
4349
4436
|
]);
|
4350
4437
|
};
|
@@ -4359,7 +4446,8 @@
|
|
4359
4446
|
], [
|
4360
4447
|
encodingForColumn,
|
4361
4448
|
buildMeasures,
|
4362
|
-
|
4449
|
+
deleteTooltipAndLabelMeasure,
|
4450
|
+
deleteTooltipAndLabelDimension
|
4363
4451
|
]),
|
4364
4452
|
pivotAdapter([
|
4365
4453
|
reshapeWithEncoding
|
@@ -4729,7 +4817,8 @@
|
|
4729
4817
|
], [
|
4730
4818
|
encodingForColumn,
|
4731
4819
|
buildMeasures,
|
4732
|
-
|
4820
|
+
deleteTooltipAndLabelMeasure,
|
4821
|
+
deleteTooltipAndLabelDimension
|
4733
4822
|
]),
|
4734
4823
|
pivotAdapter([
|
4735
4824
|
reshapeWithEncoding
|
@@ -4834,7 +4923,8 @@
|
|
4834
4923
|
], [
|
4835
4924
|
encodingForColumn,
|
4836
4925
|
buildMeasures,
|
4837
|
-
|
4926
|
+
deleteTooltipAndLabelMeasure,
|
4927
|
+
deleteTooltipAndLabelDimension
|
4838
4928
|
]),
|
4839
4929
|
pivotAdapter([
|
4840
4930
|
reshapeWithEncoding
|
@@ -4962,6 +5052,8 @@
|
|
4962
5052
|
if (0 === encoding.detail.length) encoding.detail = encoding.color;
|
4963
5053
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
4964
5054
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
5055
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
5056
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
4965
5057
|
};
|
4966
5058
|
const bar_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
4967
5059
|
encoding.x = chunk_QJLMYOTX_i(measures.filter((item)=>'xAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -4970,9 +5062,15 @@
|
|
4970
5062
|
encoding.x = chunk_QJLMYOTX_i(measures.filter((item)=>'xAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
4971
5063
|
const color = chunk_QJLMYOTX_i(measures.filter((item)=>'color' === item.encoding).map((item)=>item.id));
|
4972
5064
|
if (color.length > 0) encoding.color = color;
|
5065
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
5066
|
+
encoding.label = chunk_QJLMYOTX_i([
|
5067
|
+
...encoding.label || [],
|
5068
|
+
...label
|
5069
|
+
]);
|
4973
5070
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
4974
5071
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
4975
5072
|
...encoding.tooltip || [],
|
5073
|
+
...label,
|
4976
5074
|
...tooltip
|
4977
5075
|
]);
|
4978
5076
|
};
|
@@ -5003,7 +5101,8 @@
|
|
5003
5101
|
], [
|
5004
5102
|
encodingForBar,
|
5005
5103
|
buildMeasures,
|
5006
|
-
|
5104
|
+
deleteTooltipAndLabelMeasure,
|
5105
|
+
deleteTooltipAndLabelDimension
|
5007
5106
|
]),
|
5008
5107
|
pivotAdapter([
|
5009
5108
|
reshapeWithEncoding
|
@@ -5364,7 +5463,8 @@
|
|
5364
5463
|
], [
|
5365
5464
|
encodingForBar,
|
5366
5465
|
buildMeasures,
|
5367
|
-
|
5466
|
+
deleteTooltipAndLabelMeasure,
|
5467
|
+
deleteTooltipAndLabelDimension
|
5368
5468
|
]),
|
5369
5469
|
pivotAdapter([
|
5370
5470
|
reshapeWithEncoding
|
@@ -5468,7 +5568,8 @@
|
|
5468
5568
|
], [
|
5469
5569
|
encodingForBar,
|
5470
5570
|
buildMeasures,
|
5471
|
-
|
5571
|
+
deleteTooltipAndLabelMeasure,
|
5572
|
+
deleteTooltipAndLabelDimension
|
5472
5573
|
]),
|
5473
5574
|
pivotAdapter([
|
5474
5575
|
reshapeWithEncoding
|
@@ -5547,7 +5648,8 @@
|
|
5547
5648
|
], [
|
5548
5649
|
encodingForLine,
|
5549
5650
|
buildMeasures,
|
5550
|
-
|
5651
|
+
deleteTooltipAndLabelMeasure,
|
5652
|
+
deleteTooltipAndLabelDimension
|
5551
5653
|
]),
|
5552
5654
|
pivotAdapter([
|
5553
5655
|
reshapeWithEncoding
|
@@ -5713,7 +5815,8 @@
|
|
5713
5815
|
], [
|
5714
5816
|
encodingForLine,
|
5715
5817
|
buildMeasures,
|
5716
|
-
|
5818
|
+
deleteTooltipAndLabelMeasure,
|
5819
|
+
deleteTooltipAndLabelDimension
|
5717
5820
|
]),
|
5718
5821
|
pivotAdapter([
|
5719
5822
|
reshapeWithEncoding
|
@@ -5835,6 +5938,8 @@
|
|
5835
5938
|
];
|
5836
5939
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
5837
5940
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
5941
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
5942
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
5838
5943
|
};
|
5839
5944
|
const scatter_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
5840
5945
|
encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'xAxis' === item.encoding || 'yAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -5845,9 +5950,15 @@
|
|
5845
5950
|
if (color.length > 0) encoding.color = [
|
5846
5951
|
color[0]
|
5847
5952
|
];
|
5953
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
5954
|
+
encoding.label = chunk_QJLMYOTX_i([
|
5955
|
+
...encoding.label || [],
|
5956
|
+
...label
|
5957
|
+
]);
|
5848
5958
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
5849
5959
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
5850
5960
|
...encoding.tooltip || [],
|
5961
|
+
...label,
|
5851
5962
|
...tooltip
|
5852
5963
|
]);
|
5853
5964
|
};
|
@@ -6089,7 +6200,8 @@
|
|
6089
6200
|
], [
|
6090
6201
|
encodingForScatter,
|
6091
6202
|
buildMeasuresForScatter,
|
6092
|
-
|
6203
|
+
deleteTooltipAndLabelMeasure,
|
6204
|
+
deleteTooltipAndLabelDimension
|
6093
6205
|
]),
|
6094
6206
|
pivotAdapter([
|
6095
6207
|
reshapeWithScatterEncoding
|
@@ -6384,6 +6496,8 @@
|
|
6384
6496
|
if (0 === encoding.detail.length) encoding.detail = encoding.color;
|
6385
6497
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
6386
6498
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
6499
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
6500
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
6387
6501
|
};
|
6388
6502
|
const dualAxis_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
6389
6503
|
encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'primaryYAxis' === item.encoding || 'secondaryYAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -6392,9 +6506,15 @@
|
|
6392
6506
|
encoding.y = chunk_QJLMYOTX_i(measures.filter((item)=>'primaryYAxis' === item.encoding || 'secondaryYAxis' === item.encoding || !item.encoding).map((item)=>item.id));
|
6393
6507
|
const color = chunk_QJLMYOTX_i(measures.filter((item)=>'color' === item.encoding).map((item)=>item.id));
|
6394
6508
|
if (color.length > 0) encoding.color = color;
|
6509
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
6510
|
+
encoding.label = chunk_QJLMYOTX_i([
|
6511
|
+
...encoding.label || [],
|
6512
|
+
...label
|
6513
|
+
]);
|
6395
6514
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
6396
6515
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
6397
6516
|
...encoding.tooltip || [],
|
6517
|
+
...label,
|
6398
6518
|
...tooltip
|
6399
6519
|
]);
|
6400
6520
|
};
|
@@ -6659,7 +6779,8 @@
|
|
6659
6779
|
], [
|
6660
6780
|
encodingForDualAxis,
|
6661
6781
|
buildMeasuresForDualAxis,
|
6662
|
-
|
6782
|
+
deleteTooltipAndLabelMeasure,
|
6783
|
+
deleteTooltipAndLabelDimension
|
6663
6784
|
]),
|
6664
6785
|
pivotAdapter([
|
6665
6786
|
reshapeWithDualEncoding
|
@@ -6789,6 +6910,7 @@
|
|
6789
6910
|
case 'columnPercent':
|
6790
6911
|
result.type = 'bar';
|
6791
6912
|
result.percent = true;
|
6913
|
+
result.zIndex = 1000;
|
6792
6914
|
break;
|
6793
6915
|
case 'area':
|
6794
6916
|
result.type = 'area';
|
@@ -6845,6 +6967,7 @@
|
|
6845
6967
|
case 'columnPercent':
|
6846
6968
|
result.type = 'bar';
|
6847
6969
|
result.percent = true;
|
6970
|
+
result.zIndex = 1000;
|
6848
6971
|
break;
|
6849
6972
|
case 'area':
|
6850
6973
|
result.type = 'area';
|
@@ -7444,6 +7567,8 @@
|
|
7444
7567
|
];
|
7445
7568
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
7446
7569
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
7570
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
7571
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
7447
7572
|
};
|
7448
7573
|
const pie_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
7449
7574
|
encoding.angle = chunk_QJLMYOTX_i(measures.filter((item)=>'angle' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -7452,9 +7577,15 @@
|
|
7452
7577
|
encoding.angle = chunk_QJLMYOTX_i(measures.filter((item)=>'angle' === item.encoding || !item.encoding).map((item)=>item.id));
|
7453
7578
|
const color = chunk_QJLMYOTX_i(measures.filter((item)=>'color' === item.encoding).map((item)=>item.id));
|
7454
7579
|
if (color.length > 0) encoding.color = color;
|
7580
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
7581
|
+
encoding.label = chunk_QJLMYOTX_i([
|
7582
|
+
...encoding.label || [],
|
7583
|
+
...label
|
7584
|
+
]);
|
7455
7585
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
7456
7586
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
7457
7587
|
...encoding.tooltip || [],
|
7588
|
+
...label,
|
7458
7589
|
...tooltip
|
7459
7590
|
]);
|
7460
7591
|
};
|
@@ -7469,7 +7600,8 @@
|
|
7469
7600
|
], [
|
7470
7601
|
encodingForPie,
|
7471
7602
|
buildMeasures,
|
7472
|
-
|
7603
|
+
deleteTooltipAndLabelMeasure,
|
7604
|
+
deleteTooltipAndLabelDimension
|
7473
7605
|
]),
|
7474
7606
|
pivotAdapter([
|
7475
7607
|
reshapeWithEncoding
|
@@ -7595,7 +7727,8 @@
|
|
7595
7727
|
], [
|
7596
7728
|
encodingForPie,
|
7597
7729
|
buildMeasures,
|
7598
|
-
|
7730
|
+
deleteTooltipAndLabelMeasure,
|
7731
|
+
deleteTooltipAndLabelDimension
|
7599
7732
|
]),
|
7600
7733
|
pivotAdapter([
|
7601
7734
|
reshapeWithEncoding
|
@@ -7722,6 +7855,8 @@
|
|
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
|
@@ -7953,7 +8095,8 @@
|
|
7953
8095
|
], [
|
7954
8096
|
encodingForRose,
|
7955
8097
|
buildMeasures,
|
7956
|
-
|
8098
|
+
deleteTooltipAndLabelMeasure,
|
8099
|
+
deleteTooltipAndLabelDimension
|
7957
8100
|
]),
|
7958
8101
|
pivotAdapter([
|
7959
8102
|
reshapeWithEncoding
|
@@ -8111,6 +8254,8 @@
|
|
8111
8254
|
];
|
8112
8255
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
8113
8256
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
8257
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
8258
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
8114
8259
|
};
|
8115
8260
|
const radar_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
8116
8261
|
encoding.radius = chunk_QJLMYOTX_i(measures.filter((item)=>'radius' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -8119,9 +8264,15 @@
|
|
8119
8264
|
encoding.radius = chunk_QJLMYOTX_i(measures.filter((item)=>'radius' === item.encoding || !item.encoding).map((item)=>item.id));
|
8120
8265
|
const color = chunk_QJLMYOTX_i(measures.filter((item)=>'color' === item.encoding).map((item)=>item.id));
|
8121
8266
|
if (color.length > 0) encoding.color = color;
|
8267
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
8268
|
+
encoding.label = chunk_QJLMYOTX_i([
|
8269
|
+
...encoding.label || [],
|
8270
|
+
...label
|
8271
|
+
]);
|
8122
8272
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
8123
8273
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
8124
8274
|
...encoding.tooltip || [],
|
8275
|
+
...label,
|
8125
8276
|
...tooltip
|
8126
8277
|
]);
|
8127
8278
|
};
|
@@ -8136,7 +8287,8 @@
|
|
8136
8287
|
], [
|
8137
8288
|
encodingForRadar,
|
8138
8289
|
buildMeasures,
|
8139
|
-
|
8290
|
+
deleteTooltipAndLabelMeasure,
|
8291
|
+
deleteTooltipAndLabelDimension
|
8140
8292
|
]),
|
8141
8293
|
pivotAdapter([
|
8142
8294
|
reshapeWithEncoding
|
@@ -8317,6 +8469,8 @@
|
|
8317
8469
|
];
|
8318
8470
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
8319
8471
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
8472
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
8473
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
8320
8474
|
};
|
8321
8475
|
const funnel_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
8322
8476
|
encoding.size = chunk_QJLMYOTX_i(measures.filter((item)=>'size' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -8327,9 +8481,15 @@
|
|
8327
8481
|
if (color.length > 0) encoding.color = [
|
8328
8482
|
color[0]
|
8329
8483
|
];
|
8484
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
8485
|
+
encoding.label = chunk_QJLMYOTX_i([
|
8486
|
+
...encoding.label || [],
|
8487
|
+
...label
|
8488
|
+
]);
|
8330
8489
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
8331
8490
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
8332
8491
|
...encoding.tooltip || [],
|
8492
|
+
...label,
|
8333
8493
|
...tooltip
|
8334
8494
|
]);
|
8335
8495
|
};
|
@@ -8344,7 +8504,8 @@
|
|
8344
8504
|
], [
|
8345
8505
|
encodingForFunnel,
|
8346
8506
|
buildMeasures,
|
8347
|
-
|
8507
|
+
deleteTooltipAndLabelMeasure,
|
8508
|
+
deleteTooltipAndLabelDimension
|
8348
8509
|
]),
|
8349
8510
|
pivotAdapter([
|
8350
8511
|
reshapeWithEncoding
|
@@ -8512,6 +8673,8 @@
|
|
8512
8673
|
if (0 === encoding.detail.length) encoding.detail = encoding.color;
|
8513
8674
|
encoding.tooltip = chunk_QJLMYOTX_i(dimensions.map((item)=>item.id));
|
8514
8675
|
encoding.tooltip = encoding.tooltip.filter((d)=>d !== MeasureName);
|
8676
|
+
encoding.label = chunk_QJLMYOTX_i(dimensions.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
8677
|
+
encoding.label = encoding.label.filter((d)=>d !== MeasureName);
|
8515
8678
|
};
|
8516
8679
|
const heatmap_generateDefaultMeasureEncoding = (measures, encoding)=>{
|
8517
8680
|
const colorDims = chunk_QJLMYOTX_i(measures.filter((item)=>'color' === item.encoding || !item.encoding).map((item)=>item.id));
|
@@ -8524,9 +8687,15 @@
|
|
8524
8687
|
if (color.length > 0) encoding.color = [
|
8525
8688
|
color[0]
|
8526
8689
|
];
|
8690
|
+
const label = chunk_QJLMYOTX_i(measures.filter((item)=>'label' === item.encoding).map((item)=>item.id));
|
8691
|
+
encoding.label = chunk_QJLMYOTX_i([
|
8692
|
+
...encoding.label || [],
|
8693
|
+
...label
|
8694
|
+
]);
|
8527
8695
|
const tooltip = chunk_QJLMYOTX_i(measures.filter((item)=>'tooltip' === item.encoding).map((item)=>item.id));
|
8528
8696
|
encoding.tooltip = chunk_QJLMYOTX_i([
|
8529
8697
|
...encoding.tooltip || [],
|
8698
|
+
...label,
|
8530
8699
|
...tooltip
|
8531
8700
|
]);
|
8532
8701
|
};
|
@@ -8541,7 +8710,8 @@
|
|
8541
8710
|
], [
|
8542
8711
|
encodingForHeatmap,
|
8543
8712
|
buildMeasures,
|
8544
|
-
|
8713
|
+
deleteTooltipAndLabelMeasure,
|
8714
|
+
deleteTooltipAndLabelDimension
|
8545
8715
|
]),
|
8546
8716
|
pivotAdapter([
|
8547
8717
|
reshapeWithEncoding
|
@@ -8902,7 +9072,10 @@
|
|
8902
9072
|
]
|
8903
9073
|
},
|
8904
9074
|
label: {
|
8905
|
-
enable: true
|
9075
|
+
enable: true,
|
9076
|
+
wrap: true,
|
9077
|
+
showValue: true,
|
9078
|
+
showValuePercent: false
|
8906
9079
|
},
|
8907
9080
|
tooltip: {
|
8908
9081
|
enable: true
|
@@ -9063,7 +9236,11 @@
|
|
9063
9236
|
crosshairRect
|
9064
9237
|
},
|
9065
9238
|
pie: {
|
9066
|
-
...baseConfig
|
9239
|
+
...baseConfig,
|
9240
|
+
label: {
|
9241
|
+
...baseConfig.label,
|
9242
|
+
showValuePercent: true
|
9243
|
+
}
|
9067
9244
|
},
|
9068
9245
|
donut: {
|
9069
9246
|
...baseConfig
|
@@ -9072,10 +9249,18 @@
|
|
9072
9249
|
...baseConfig
|
9073
9250
|
},
|
9074
9251
|
rose: {
|
9075
|
-
...baseConfig
|
9252
|
+
...baseConfig,
|
9253
|
+
label: {
|
9254
|
+
...baseConfig.label,
|
9255
|
+
showValuePercent: true
|
9256
|
+
}
|
9076
9257
|
},
|
9077
9258
|
roseParallel: {
|
9078
|
-
...baseConfig
|
9259
|
+
...baseConfig,
|
9260
|
+
label: {
|
9261
|
+
...baseConfig.label,
|
9262
|
+
showValuePercent: true
|
9263
|
+
}
|
9079
9264
|
},
|
9080
9265
|
funnel: {
|
9081
9266
|
...baseConfig
|
@@ -9211,7 +9396,10 @@
|
|
9211
9396
|
]
|
9212
9397
|
},
|
9213
9398
|
label: {
|
9214
|
-
enable: true
|
9399
|
+
enable: true,
|
9400
|
+
wrap: true,
|
9401
|
+
showValue: true,
|
9402
|
+
showValuePercent: false
|
9215
9403
|
},
|
9216
9404
|
tooltip: {
|
9217
9405
|
enable: true
|
@@ -9371,7 +9559,11 @@
|
|
9371
9559
|
crosshairRect
|
9372
9560
|
},
|
9373
9561
|
pie: {
|
9374
|
-
...baseConfig
|
9562
|
+
...baseConfig,
|
9563
|
+
label: {
|
9564
|
+
...baseConfig.label,
|
9565
|
+
showValuePercent: true
|
9566
|
+
}
|
9375
9567
|
},
|
9376
9568
|
donut: {
|
9377
9569
|
...baseConfig
|
@@ -9380,10 +9572,18 @@
|
|
9380
9572
|
...baseConfig
|
9381
9573
|
},
|
9382
9574
|
rose: {
|
9383
|
-
...baseConfig
|
9575
|
+
...baseConfig,
|
9576
|
+
label: {
|
9577
|
+
...baseConfig.label,
|
9578
|
+
showValuePercent: true
|
9579
|
+
}
|
9384
9580
|
},
|
9385
9581
|
roseParallel: {
|
9386
|
-
...baseConfig
|
9582
|
+
...baseConfig,
|
9583
|
+
label: {
|
9584
|
+
...baseConfig.label,
|
9585
|
+
showValuePercent: true
|
9586
|
+
}
|
9387
9587
|
},
|
9388
9588
|
funnel: {
|
9389
9589
|
...baseConfig
|
@@ -9437,15 +9637,6 @@
|
|
9437
9637
|
const updateSpec = (chartType, specPipe)=>{
|
9438
9638
|
Builder._customSpecPipe[chartType] = specPipe;
|
9439
9639
|
};
|
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
9640
|
Object.freeze({
|
9450
9641
|
status: "aborted"
|
9451
9642
|
});
|
@@ -12867,8 +13058,14 @@
|
|
12867
13058
|
const zScatterMeasures = schemas_array(zScatterMeasure);
|
12868
13059
|
const zFoldInfo = schemas_object({
|
12869
13060
|
foldMap: record(schemas_string(), schemas_string().or(schemas_undefined())),
|
12870
|
-
|
12871
|
-
|
13061
|
+
statistics: schemas_object({
|
13062
|
+
min: schemas_number(),
|
13063
|
+
max: schemas_number(),
|
13064
|
+
sum: schemas_number(),
|
13065
|
+
count: schemas_number(),
|
13066
|
+
colorMin: schemas_number(),
|
13067
|
+
colorMax: schemas_number()
|
13068
|
+
}),
|
12872
13069
|
measureId: schemas_string(),
|
12873
13070
|
measureName: schemas_string(),
|
12874
13071
|
measureValue: schemas_string()
|
@@ -13083,7 +13280,10 @@
|
|
13083
13280
|
linearColorScheme: schemas_array(schemas_string()).nullish()
|
13084
13281
|
});
|
13085
13282
|
const zLabel = schemas_object({
|
13086
|
-
enable: schemas_boolean().
|
13283
|
+
enable: schemas_boolean().nullish(),
|
13284
|
+
wrap: schemas_boolean().nullish(),
|
13285
|
+
showValue: schemas_boolean().nullish(),
|
13286
|
+
showValuePercent: schemas_boolean().nullish()
|
13087
13287
|
});
|
13088
13288
|
const zLegend = schemas_object({
|
13089
13289
|
enable: schemas_boolean().default(true).nullish(),
|