@visactor/vseed 0.1.45 → 0.1.46
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 +3 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/builder/builder/builder.d.ts +86 -14
- package/dist/esm/dataReshape/constant.d.ts +2 -2
- package/dist/esm/dataReshape/constant.js +3 -3
- package/dist/esm/dataReshape/constant.js.map +1 -1
- package/dist/esm/i18n/i18n.js +2 -2
- package/dist/esm/i18n/i18n.js.map +1 -1
- package/dist/esm/i18n/i18nData.d.ts +2 -0
- package/dist/esm/i18n/i18nData.js +41 -5
- package/dist/esm/i18n/i18nData.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipeline/area.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/area.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/areaPercent.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/areaPercent.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/bar.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/bar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/barParallel.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/barParallel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/barPercent.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/barPercent.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/boxplot.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/boxplot.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/column.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/column.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/columnParallel.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/columnParallel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/columnPercent.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/columnPercent.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/donut.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/donut.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/dualAxis.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/dualAxis.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/funnel.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/funnel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/heatmap.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/heatmap.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/histogram.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/histogram.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/line.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/line.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/pie.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/pie.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/radar.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/radar.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/rose.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/rose.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/roseParallel.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/roseParallel.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js +3 -3
- package/dist/esm/pipeline/advanced/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/index.d.ts +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/index.js +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/pickDimensionsForReshape.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/pickDimensionsForReshape.js +14 -0
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/pickDimensionsForReshape.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/chart/pipes/measures/pickMeasuresForReshape.d.ts +2 -0
- package/dist/esm/pipeline/advanced/chart/pipes/measures/pickMeasuresForReshape.js +14 -0
- package/dist/esm/pipeline/advanced/chart/pipes/measures/pickMeasuresForReshape.js.map +1 -0
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js +8 -6
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithBoxplotEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithDualEncoding.js +3 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithDualEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithEncoding.js +3 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.js +5 -3
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithHistogramEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithScatterEncoding.js +3 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/pivotReshapeWithScatterEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithBoxplotEncoding.js +8 -6
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithBoxplotEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithDualEncoding.js +3 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithDualEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js +3 -5
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js +3 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithHistogramEncoding.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithScatterEncoding.js +3 -1
- package/dist/esm/pipeline/advanced/chart/pipes/reshape/reshapeWithScatterEncoding.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/boxplot.js +3 -2
- package/dist/esm/pipeline/spec/chart/pipeline/boxplot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js +3 -3
- package/dist/esm/pipeline/spec/chart/pipeline/histogram.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/histogramCrosshair.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/histogramCrosshair.js +27 -0
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/histogramCrosshair.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/crosshair/index.js +2 -1
- package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.js +3 -3
- package/dist/esm/pipeline/spec/chart/pipes/init/boxplot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/legend/boxLegend.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/legend/boxLegend.js +15 -0
- package/dist/esm/pipeline/spec/chart/pipes/legend/boxLegend.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/legend/colorLegend.js +3 -4
- package/dist/esm/pipeline/spec/chart/pipes/legend/colorLegend.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js +31 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/ecdfRegressionLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.js +5 -1
- package/dist/esm/pipeline/spec/chart/pipes/regressionLine/linearRegressionLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.d.ts +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js +5 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltip.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js +14 -5
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipBoxplot.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHistogram.js +6 -4
- package/dist/esm/pipeline/spec/chart/pipes/tooltip/tooltipHistogram.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/utils/histogram.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/utils/histogram.js +12 -0
- package/dist/esm/pipeline/spec/chart/utils/histogram.js.map +1 -0
- package/dist/esm/pipeline/utils/measures/delete.d.ts +2 -2
- package/dist/esm/pipeline/utils/measures/delete.js +7 -3
- package/dist/esm/pipeline/utils/measures/delete.js.map +1 -1
- package/dist/esm/pipeline/utils/tree/traverse.d.ts +1 -0
- package/dist/esm/pipeline/utils/tree/traverse.js +12 -1
- package/dist/esm/pipeline/utils/tree/traverse.js.map +1 -1
- package/dist/esm/types/advancedVSeed.d.ts +116 -3
- package/dist/esm/types/advancedVSeed.js +2 -0
- package/dist/esm/types/advancedVSeed.js.map +1 -1
- package/dist/esm/types/chartType/area/zArea.d.ts +12 -3
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +12 -3
- package/dist/esm/types/chartType/bar/zBar.d.ts +12 -3
- package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +12 -3
- package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +12 -3
- package/dist/esm/types/chartType/boxplot/zBoxplot.d.ts +12 -3
- package/dist/esm/types/chartType/column/zColumn.d.ts +12 -3
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +12 -3
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +12 -3
- package/dist/esm/types/chartType/donut/zDonut.d.ts +12 -3
- package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +42 -15
- package/dist/esm/types/chartType/funnel/zFunnel.d.ts +12 -3
- package/dist/esm/types/chartType/heatmap/zHeatmap.d.ts +12 -3
- package/dist/esm/types/chartType/histogram/zHistogram.d.ts +12 -3
- package/dist/esm/types/chartType/line/zLine.d.ts +12 -3
- package/dist/esm/types/chartType/pie/zPie.d.ts +12 -3
- package/dist/esm/types/chartType/pivotTable/zPivotTable.d.ts +12 -3
- package/dist/esm/types/chartType/radar/zRadar.d.ts +12 -3
- package/dist/esm/types/chartType/rose/zRose.d.ts +12 -3
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +12 -3
- package/dist/esm/types/chartType/scatter/zScatter.d.ts +42 -15
- package/dist/esm/types/chartType/table/zTable.d.ts +12 -3
- package/dist/esm/types/properties/measures/zDualMeasures.d.ts +60 -24
- package/dist/esm/types/properties/measures/zMeasures.d.ts +36 -9
- package/dist/esm/types/properties/measures/zMeasures.js +13 -4
- package/dist/esm/types/properties/measures/zMeasures.js.map +1 -1
- package/dist/esm/types/properties/measures/zScatterMeasures.d.ts +60 -24
- package/dist/esm/types/properties/regressionLine/linearRegressionLine.d.ts +5 -0
- package/dist/esm/types/properties/regressionLine/logisticRegressionLine.d.ts +5 -0
- package/dist/esm/types/properties/regressionLine/lowessRegressionLine.d.ts +5 -0
- package/dist/esm/types/properties/regressionLine/polynomialRegressionLine.d.ts +5 -0
- package/dist/esm/types/zVseed.d.ts +324 -90
- package/dist/umd/index.js +273 -144
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/deleteTooltipAndLabelDimensions.d.ts +0 -2
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/deleteTooltipAndLabelDimensions.js +0 -12
- package/dist/esm/pipeline/advanced/chart/pipes/dimensions/deleteTooltipAndLabelDimensions.js.map +0 -1
- package/dist/esm/pipeline/advanced/chart/pipes/measures/deleteEncodingForMeasure.d.ts +0 -2
- package/dist/esm/pipeline/advanced/chart/pipes/measures/deleteEncodingForMeasure.js +0 -12
- package/dist/esm/pipeline/advanced/chart/pipes/measures/deleteEncodingForMeasure.js.map +0 -1
package/dist/umd/index.js
CHANGED
|
@@ -5,44 +5,7 @@
|
|
|
5
5
|
else root["VSeed"] = factory();
|
|
6
6
|
})(globalThis, ()=>(()=>{
|
|
7
7
|
"use strict";
|
|
8
|
-
var
|
|
9
|
-
var __webpack_module_cache__ = {};
|
|
10
|
-
function __webpack_require__(moduleId) {
|
|
11
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
12
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
13
|
-
var module1 = __webpack_module_cache__[moduleId] = {
|
|
14
|
-
exports: {}
|
|
15
|
-
};
|
|
16
|
-
__webpack_modules__[moduleId](module1, module1.exports, __webpack_require__);
|
|
17
|
-
return module1.exports;
|
|
18
|
-
}
|
|
19
|
-
(()=>{
|
|
20
|
-
var getProto = Object.getPrototypeOf ? (obj)=>Object.getPrototypeOf(obj) : (obj)=>obj.__proto__;
|
|
21
|
-
var leafPrototypes;
|
|
22
|
-
__webpack_require__.t = function(value, mode) {
|
|
23
|
-
if (1 & mode) value = this(value);
|
|
24
|
-
if (8 & mode) return value;
|
|
25
|
-
if ('object' == typeof value && value) {
|
|
26
|
-
if (4 & mode && value.__esModule) return value;
|
|
27
|
-
if (16 & mode && 'function' == typeof value.then) return value;
|
|
28
|
-
}
|
|
29
|
-
var ns = Object.create(null);
|
|
30
|
-
__webpack_require__.r(ns);
|
|
31
|
-
var def = {};
|
|
32
|
-
leafPrototypes = leafPrototypes || [
|
|
33
|
-
null,
|
|
34
|
-
getProto({}),
|
|
35
|
-
getProto([]),
|
|
36
|
-
getProto(getProto)
|
|
37
|
-
];
|
|
38
|
-
for(var current = 2 & mode && value; 'object' == typeof current && !~leafPrototypes.indexOf(current); current = getProto(current))Object.getOwnPropertyNames(current).forEach((key)=>{
|
|
39
|
-
def[key] = ()=>value[key];
|
|
40
|
-
});
|
|
41
|
-
def['default'] = ()=>value;
|
|
42
|
-
__webpack_require__.d(ns, def);
|
|
43
|
-
return ns;
|
|
44
|
-
};
|
|
45
|
-
})();
|
|
8
|
+
var __webpack_require__ = {};
|
|
46
9
|
(()=>{
|
|
47
10
|
__webpack_require__.d = (exports1, definition)=>{
|
|
48
11
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
@@ -151,11 +114,9 @@
|
|
|
151
114
|
zDualChartType: ()=>zDualChartType,
|
|
152
115
|
darkTheme: ()=>darkTheme,
|
|
153
116
|
isVTable: ()=>isVTable,
|
|
154
|
-
MaxMeasureId: ()=>MaxMeasureId,
|
|
155
117
|
ORIGINAL_DATA: ()=>ORIGINAL_DATA,
|
|
156
|
-
MinMeasureId: ()=>MinMeasureId,
|
|
157
|
-
columnParallelSpecPipeline: ()=>columnParallelSpecPipeline,
|
|
158
118
|
zAnnotationHorizontalLineConfig: ()=>zAnnotationHorizontalLineConfig,
|
|
119
|
+
columnParallelSpecPipeline: ()=>columnParallelSpecPipeline,
|
|
159
120
|
zAnnotationPoint: ()=>zAnnotationPoint,
|
|
160
121
|
DATUM_HIDE_KEY: ()=>DATUM_HIDE_KEY,
|
|
161
122
|
isMeasure: ()=>isMeasure,
|
|
@@ -171,20 +132,21 @@
|
|
|
171
132
|
findMeasureById: ()=>findMeasureById,
|
|
172
133
|
AngleEncoding: ()=>AngleEncoding,
|
|
173
134
|
areaPercentAdvancedPipeline: ()=>areaPercentAdvancedPipeline,
|
|
174
|
-
|
|
135
|
+
findTreeNodesBy: ()=>findTreeNodesBy,
|
|
175
136
|
zAreaPercentConfig: ()=>zAreaPercentConfig,
|
|
176
|
-
|
|
137
|
+
zBackgroundColor: ()=>zBackgroundColor,
|
|
177
138
|
MeasureId: ()=>MeasureId,
|
|
178
139
|
registerRadar: ()=>registerRadar,
|
|
179
140
|
zLocale: ()=>zLocale,
|
|
180
141
|
isDimension: ()=>isDimension,
|
|
142
|
+
zLowessRegressionLine: ()=>zLowessRegressionLine,
|
|
181
143
|
zMeasure: ()=>zMeasure,
|
|
182
144
|
registerScatter: ()=>registerScatter,
|
|
183
145
|
boxplotSpecPipeline: ()=>boxplotSpecPipeline,
|
|
184
146
|
autoNumFormatter: ()=>autoNumFormatter,
|
|
185
147
|
tableSpecPipeline: ()=>tableSpecPipeline,
|
|
186
|
-
isCombination: ()=>isCombination,
|
|
187
148
|
zConfig: ()=>zConfig,
|
|
149
|
+
isCombination: ()=>isCombination,
|
|
188
150
|
zBarStyle: ()=>zBarStyle,
|
|
189
151
|
deleteDimensionTreeByCallback: ()=>deleteDimensionTreeByCallback,
|
|
190
152
|
zRoseParallelConfig: ()=>zRoseParallelConfig,
|
|
@@ -198,6 +160,7 @@
|
|
|
198
160
|
registerPie: ()=>registerPie,
|
|
199
161
|
zEcdfRegressionLine: ()=>zEcdfRegressionLine,
|
|
200
162
|
zBarParallelConfig: ()=>zBarParallelConfig,
|
|
163
|
+
LowerWhisker: ()=>LowerWhisker,
|
|
201
164
|
lineAdvancedPipeline: ()=>lineAdvancedPipeline,
|
|
202
165
|
AXIS_LABEL_SPACE: ()=>8,
|
|
203
166
|
FoldMeasureValue: ()=>FoldMeasureValue,
|
|
@@ -235,6 +198,7 @@
|
|
|
235
198
|
Separator: ()=>"-",
|
|
236
199
|
findAllMeasures: ()=>findAllMeasures,
|
|
237
200
|
zColorLegend: ()=>zColorLegend,
|
|
201
|
+
UpperWhisker: ()=>UpperWhisker,
|
|
238
202
|
EncodingEnum: ()=>EncodingEnum,
|
|
239
203
|
preorderTraverse: ()=>preorderTraverse,
|
|
240
204
|
roseParallelSpecPipeline: ()=>roseParallelSpecPipeline,
|
|
@@ -351,11 +315,47 @@
|
|
|
351
315
|
function chunk_JK3VNB42_n(e) {
|
|
352
316
|
return null == e;
|
|
353
317
|
}
|
|
354
|
-
|
|
355
|
-
|
|
318
|
+
const translateMap = {
|
|
319
|
+
指标名称: {
|
|
320
|
+
'en-US': 'MeasureName',
|
|
321
|
+
'zh-CN': "\u6307\u6807\u540D\u79F0"
|
|
322
|
+
},
|
|
323
|
+
指标Id: {
|
|
324
|
+
'en-US': 'MeasureId',
|
|
325
|
+
'zh-CN': "\u6307\u6807Id"
|
|
326
|
+
},
|
|
327
|
+
指标值: {
|
|
328
|
+
'en-US': 'MeasureValue',
|
|
329
|
+
'zh-CN': "\u6307\u6807\u503C"
|
|
330
|
+
},
|
|
331
|
+
异常点: {
|
|
332
|
+
'en-US': 'Outlier',
|
|
333
|
+
'zh-CN': "\u5F02\u5E38\u70B9"
|
|
334
|
+
},
|
|
335
|
+
上边界: {
|
|
336
|
+
'en-US': 'Upper Whisker',
|
|
337
|
+
'zh-CN': "\u4E0A\u8FB9\u754C"
|
|
338
|
+
},
|
|
339
|
+
上四分位数: {
|
|
340
|
+
'en-US': 'Q3',
|
|
341
|
+
'zh-CN': "75\u5206\u4F4D\u6570"
|
|
342
|
+
},
|
|
343
|
+
中位数: {
|
|
344
|
+
'en-US': 'Q2',
|
|
345
|
+
'zh-CN': "\u4E2D\u4F4D\u6570"
|
|
346
|
+
},
|
|
347
|
+
下四分位数: {
|
|
348
|
+
'en-US': 'Q1',
|
|
349
|
+
'zh-CN': "25\u5206\u4F4D\u6570"
|
|
350
|
+
},
|
|
351
|
+
下边界: {
|
|
352
|
+
'en-US': 'Lower Whisker',
|
|
353
|
+
'zh-CN': "\u4E0B\u8FB9\u754C"
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
356
|
class i18n_Intl {
|
|
357
357
|
static instance;
|
|
358
|
-
translateMap =
|
|
358
|
+
translateMap = translateMap;
|
|
359
359
|
locale = 'zh-CN';
|
|
360
360
|
canTranslate = (value)=>!!this.translateMap[value];
|
|
361
361
|
i18n = (segments, ...values)=>{
|
|
@@ -525,6 +525,17 @@
|
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
527
|
};
|
|
528
|
+
const findTreeNodesBy = (nodes = [], callback, childrenKey = 'children')=>{
|
|
529
|
+
if (!nodes) return [];
|
|
530
|
+
const result = [];
|
|
531
|
+
preorderTraverse(nodes, (node)=>{
|
|
532
|
+
if (!(childrenKey in node)) {
|
|
533
|
+
if (callback(node)) result.push(node);
|
|
534
|
+
}
|
|
535
|
+
return false;
|
|
536
|
+
});
|
|
537
|
+
return result;
|
|
538
|
+
};
|
|
528
539
|
const measureDepth = (measures = [])=>{
|
|
529
540
|
if (!measures) return 0;
|
|
530
541
|
let depth = 1;
|
|
@@ -1571,8 +1582,8 @@
|
|
|
1571
1582
|
const DetailEncoding = '__Dim_Detail__';
|
|
1572
1583
|
const ColorEncoding = '__Dim_Color__';
|
|
1573
1584
|
const ColorIdEncoding = '__Dim_ColorId__';
|
|
1574
|
-
const
|
|
1575
|
-
const
|
|
1585
|
+
const LowerWhisker = '__Lower_Whisker__';
|
|
1586
|
+
const UpperWhisker = '__Upper_Whisker__';
|
|
1576
1587
|
const OutliersMeasureId = '__Outliers__';
|
|
1577
1588
|
const MedianMeasureId = '__Meadian__';
|
|
1578
1589
|
const BinStartMeasureId = '__BinStart__';
|
|
@@ -2271,7 +2282,7 @@
|
|
|
2271
2282
|
];
|
|
2272
2283
|
};
|
|
2273
2284
|
const deleteMeasureTreeByCallback = (measureTree, callback)=>{
|
|
2274
|
-
if (!measureTree) return
|
|
2285
|
+
if (!measureTree) return;
|
|
2275
2286
|
const stack = [
|
|
2276
2287
|
...measureTree
|
|
2277
2288
|
].reverse();
|
|
@@ -2295,23 +2306,28 @@
|
|
|
2295
2306
|
nodesToProcess.push(node);
|
|
2296
2307
|
}
|
|
2297
2308
|
}
|
|
2309
|
+
const deleted = [];
|
|
2298
2310
|
for (const node of nodesToProcess){
|
|
2299
2311
|
const parentList = parents.get(node);
|
|
2300
2312
|
if (parentList) {
|
|
2301
2313
|
const index = parentList.indexOf(node);
|
|
2302
2314
|
if (isMeasure(node)) {
|
|
2303
|
-
if (callback?.(node, index, parentList))
|
|
2315
|
+
if (callback?.(node, index, parentList)) {
|
|
2316
|
+
parentList.splice(index, 1);
|
|
2317
|
+
deleted.push(node);
|
|
2318
|
+
}
|
|
2304
2319
|
}
|
|
2305
2320
|
}
|
|
2306
2321
|
}
|
|
2307
|
-
return
|
|
2322
|
+
return deleted;
|
|
2308
2323
|
};
|
|
2309
|
-
const
|
|
2324
|
+
const pickMeasuresForReshape = (encodingKeys)=>(advancedVSeed)=>{
|
|
2325
|
+
const clonedMeasures = chunk_BCBB46UE_d(advancedVSeed.measures);
|
|
2310
2326
|
const deleteBy = (measure)=>encodingKeys.includes(measure.encoding);
|
|
2311
|
-
|
|
2327
|
+
deleteMeasureTreeByCallback(clonedMeasures, deleteBy);
|
|
2312
2328
|
return {
|
|
2313
2329
|
...advancedVSeed,
|
|
2314
|
-
|
|
2330
|
+
reshapeMeasures: clonedMeasures
|
|
2315
2331
|
};
|
|
2316
2332
|
};
|
|
2317
2333
|
const deleteDimensionTreeByCallback = (dimensionTree, callback)=>{
|
|
@@ -2350,12 +2366,13 @@
|
|
|
2350
2366
|
}
|
|
2351
2367
|
return dimensionTree;
|
|
2352
2368
|
};
|
|
2353
|
-
const
|
|
2369
|
+
const pickDimensionsForReshape = (advancedVSeed)=>{
|
|
2354
2370
|
const deleteBy = (dimension)=>'tooltip' === dimension.encoding || 'label' === dimension.encoding;
|
|
2355
|
-
const
|
|
2371
|
+
const reshapeDimensions = chunk_BCBB46UE_d(advancedVSeed.dimensions);
|
|
2372
|
+
deleteDimensionTreeByCallback(reshapeDimensions, deleteBy);
|
|
2356
2373
|
return {
|
|
2357
2374
|
...advancedVSeed,
|
|
2358
|
-
|
|
2375
|
+
reshapeDimensions
|
|
2359
2376
|
};
|
|
2360
2377
|
};
|
|
2361
2378
|
const pivotAdapter = (pipeline, pivotPipeline)=>(advancedVSeed, context)=>{
|
|
@@ -2478,9 +2495,9 @@
|
|
|
2478
2495
|
};
|
|
2479
2496
|
const { vseed } = context;
|
|
2480
2497
|
const { dataset, chartType } = vseed;
|
|
2481
|
-
const {
|
|
2498
|
+
const { encoding } = advancedVSeed;
|
|
2482
2499
|
const colorMeasureId = getColorMeasureId(advancedVSeed, vseed);
|
|
2483
|
-
const { dataset: newDatasets, foldInfo, unfoldInfo } = dataReshapeByEncoding(dataset, T(dimensions, (item)=>item.id), T(findAllMeasures(measures), (item)=>item.id), encoding, {
|
|
2500
|
+
const { dataset: newDatasets, foldInfo, unfoldInfo } = dataReshapeByEncoding(dataset, T(advancedVSeed.reshapeDimensions ?? advancedVSeed.dimensions ?? [], (item)=>item.id), T(advancedVSeed.reshapeMeasures ?? findAllMeasures(advancedVSeed.measures), (item)=>item.id), encoding, {
|
|
2484
2501
|
colorItemAsId: false,
|
|
2485
2502
|
colorMeasureId
|
|
2486
2503
|
});
|
|
@@ -2494,9 +2511,7 @@
|
|
|
2494
2511
|
foldInfo,
|
|
2495
2512
|
unfoldInfo
|
|
2496
2513
|
}
|
|
2497
|
-
]
|
|
2498
|
-
dimensions,
|
|
2499
|
-
measures
|
|
2514
|
+
]
|
|
2500
2515
|
};
|
|
2501
2516
|
};
|
|
2502
2517
|
const pivotReshapeWithEncoding = (advancedVSeed, context)=>{
|
|
@@ -2505,7 +2520,9 @@
|
|
|
2505
2520
|
};
|
|
2506
2521
|
const { vseed } = context;
|
|
2507
2522
|
const { dataset } = vseed;
|
|
2508
|
-
const {
|
|
2523
|
+
const { encoding } = advancedVSeed;
|
|
2524
|
+
const measures = advancedVSeed.reshapeMeasures ?? advancedVSeed.measures ?? [];
|
|
2525
|
+
const dimensions = advancedVSeed.reshapeDimensions ?? advancedVSeed.dimensions ?? [];
|
|
2509
2526
|
const allMeasures = findAllMeasures(measures);
|
|
2510
2527
|
const measureGroups = [];
|
|
2511
2528
|
if (measures) measures.forEach((measure)=>{
|
|
@@ -2667,12 +2684,12 @@
|
|
|
2667
2684
|
], [
|
|
2668
2685
|
encodingForLine,
|
|
2669
2686
|
buildMeasures,
|
|
2670
|
-
|
|
2687
|
+
pickMeasuresForReshape([
|
|
2671
2688
|
'tooltip',
|
|
2672
2689
|
'label',
|
|
2673
2690
|
'color'
|
|
2674
2691
|
]),
|
|
2675
|
-
|
|
2692
|
+
pickDimensionsForReshape
|
|
2676
2693
|
]),
|
|
2677
2694
|
pivotAdapter([
|
|
2678
2695
|
reshapeWithEncoding
|
|
@@ -3218,7 +3235,7 @@
|
|
|
3218
3235
|
...spec
|
|
3219
3236
|
};
|
|
3220
3237
|
const { advancedVSeed } = context;
|
|
3221
|
-
const { datasetReshapeInfo, chartType } = advancedVSeed;
|
|
3238
|
+
const { datasetReshapeInfo, chartType, measures = [] } = advancedVSeed;
|
|
3222
3239
|
const { unfoldInfo } = datasetReshapeInfo[0];
|
|
3223
3240
|
const baseConfig = advancedVSeed.config[chartType];
|
|
3224
3241
|
if (!baseConfig || !baseConfig.legend) return result;
|
|
@@ -3279,8 +3296,7 @@
|
|
|
3279
3296
|
}
|
|
3280
3297
|
}
|
|
3281
3298
|
};
|
|
3282
|
-
const
|
|
3283
|
-
const colorMeasure = measures.find((m)=>'color' === m.encoding);
|
|
3299
|
+
const colorMeasure = findTreeNodesBy(measures, (m)=>'color' === m.encoding)?.[0];
|
|
3284
3300
|
if (colorMeasure) {
|
|
3285
3301
|
const formatter = createFormatterByMeasure(colorMeasure);
|
|
3286
3302
|
result.legends.handlerText.formatter = formatter;
|
|
@@ -3642,7 +3658,11 @@
|
|
|
3642
3658
|
const datum = v;
|
|
3643
3659
|
const key = datum && datum[encodingColor] || '';
|
|
3644
3660
|
return unfoldInfo.colorIdMap[key].alias ?? key;
|
|
3645
|
-
} :
|
|
3661
|
+
} : (v)=>{
|
|
3662
|
+
const datum = v;
|
|
3663
|
+
const key = datum && datum[measureId] || '';
|
|
3664
|
+
return foldMap[key] ?? key;
|
|
3665
|
+
},
|
|
3646
3666
|
value: (v)=>{
|
|
3647
3667
|
const datum = v;
|
|
3648
3668
|
if (!datum) return '';
|
|
@@ -5568,12 +5588,12 @@
|
|
|
5568
5588
|
], [
|
|
5569
5589
|
encodingForColumn,
|
|
5570
5590
|
buildMeasures,
|
|
5571
|
-
|
|
5591
|
+
pickMeasuresForReshape([
|
|
5572
5592
|
'tooltip',
|
|
5573
5593
|
'label',
|
|
5574
5594
|
'color'
|
|
5575
5595
|
]),
|
|
5576
|
-
|
|
5596
|
+
pickDimensionsForReshape
|
|
5577
5597
|
]),
|
|
5578
5598
|
pivotAdapter([
|
|
5579
5599
|
reshapeWithEncoding
|
|
@@ -6439,12 +6459,12 @@
|
|
|
6439
6459
|
], [
|
|
6440
6460
|
encodingForColumn,
|
|
6441
6461
|
buildMeasures,
|
|
6442
|
-
|
|
6462
|
+
pickMeasuresForReshape([
|
|
6443
6463
|
'tooltip',
|
|
6444
6464
|
'label',
|
|
6445
6465
|
'color'
|
|
6446
6466
|
]),
|
|
6447
|
-
|
|
6467
|
+
pickDimensionsForReshape
|
|
6448
6468
|
]),
|
|
6449
6469
|
pivotAdapter([
|
|
6450
6470
|
reshapeWithEncoding
|
|
@@ -6604,12 +6624,12 @@
|
|
|
6604
6624
|
], [
|
|
6605
6625
|
encodingForColumn,
|
|
6606
6626
|
buildMeasures,
|
|
6607
|
-
|
|
6627
|
+
pickMeasuresForReshape([
|
|
6608
6628
|
'tooltip',
|
|
6609
6629
|
'label',
|
|
6610
6630
|
'color'
|
|
6611
6631
|
]),
|
|
6612
|
-
|
|
6632
|
+
pickDimensionsForReshape
|
|
6613
6633
|
]),
|
|
6614
6634
|
pivotAdapter([
|
|
6615
6635
|
reshapeWithEncoding
|
|
@@ -6786,12 +6806,12 @@
|
|
|
6786
6806
|
], [
|
|
6787
6807
|
encodingForBar,
|
|
6788
6808
|
buildMeasures,
|
|
6789
|
-
|
|
6809
|
+
pickMeasuresForReshape([
|
|
6790
6810
|
'tooltip',
|
|
6791
6811
|
'label',
|
|
6792
6812
|
'color'
|
|
6793
6813
|
]),
|
|
6794
|
-
|
|
6814
|
+
pickDimensionsForReshape
|
|
6795
6815
|
]),
|
|
6796
6816
|
pivotAdapter([
|
|
6797
6817
|
reshapeWithEncoding
|
|
@@ -7143,12 +7163,12 @@
|
|
|
7143
7163
|
], [
|
|
7144
7164
|
encodingForBar,
|
|
7145
7165
|
buildMeasures,
|
|
7146
|
-
|
|
7166
|
+
pickMeasuresForReshape([
|
|
7147
7167
|
'tooltip',
|
|
7148
7168
|
'label',
|
|
7149
7169
|
'color'
|
|
7150
7170
|
]),
|
|
7151
|
-
|
|
7171
|
+
pickDimensionsForReshape
|
|
7152
7172
|
]),
|
|
7153
7173
|
pivotAdapter([
|
|
7154
7174
|
reshapeWithEncoding
|
|
@@ -7257,12 +7277,12 @@
|
|
|
7257
7277
|
], [
|
|
7258
7278
|
encodingForBar,
|
|
7259
7279
|
buildMeasures,
|
|
7260
|
-
|
|
7280
|
+
pickMeasuresForReshape([
|
|
7261
7281
|
'tooltip',
|
|
7262
7282
|
'label',
|
|
7263
7283
|
'color'
|
|
7264
7284
|
]),
|
|
7265
|
-
|
|
7285
|
+
pickDimensionsForReshape
|
|
7266
7286
|
]),
|
|
7267
7287
|
pivotAdapter([
|
|
7268
7288
|
reshapeWithEncoding
|
|
@@ -7344,12 +7364,12 @@
|
|
|
7344
7364
|
], [
|
|
7345
7365
|
encodingForLine,
|
|
7346
7366
|
buildMeasures,
|
|
7347
|
-
|
|
7367
|
+
pickMeasuresForReshape([
|
|
7348
7368
|
'tooltip',
|
|
7349
7369
|
'label',
|
|
7350
7370
|
'color'
|
|
7351
7371
|
]),
|
|
7352
|
-
|
|
7372
|
+
pickDimensionsForReshape
|
|
7353
7373
|
]),
|
|
7354
7374
|
pivotAdapter([
|
|
7355
7375
|
reshapeWithEncoding
|
|
@@ -7541,12 +7561,12 @@
|
|
|
7541
7561
|
], [
|
|
7542
7562
|
encodingForLine,
|
|
7543
7563
|
buildMeasures,
|
|
7544
|
-
|
|
7564
|
+
pickMeasuresForReshape([
|
|
7545
7565
|
'tooltip',
|
|
7546
7566
|
'label',
|
|
7547
7567
|
'color'
|
|
7548
7568
|
]),
|
|
7549
|
-
|
|
7569
|
+
pickDimensionsForReshape
|
|
7550
7570
|
]),
|
|
7551
7571
|
pivotAdapter([
|
|
7552
7572
|
reshapeWithEncoding
|
|
@@ -7820,7 +7840,9 @@
|
|
|
7820
7840
|
};
|
|
7821
7841
|
const { vseed } = context;
|
|
7822
7842
|
const { dataset } = vseed;
|
|
7823
|
-
const {
|
|
7843
|
+
const { encoding, chartType } = advancedVSeed;
|
|
7844
|
+
const measures = advancedVSeed.reshapeMeasures ?? advancedVSeed.measures ?? [];
|
|
7845
|
+
const dimensions = advancedVSeed.reshapeDimensions ?? advancedVSeed.dimensions ?? [];
|
|
7824
7846
|
if (measures.length > 2) throw new Error('measures can not be more than 2 groups in scatter');
|
|
7825
7847
|
const foldInfoList = [];
|
|
7826
7848
|
const unfoldInfoList = [];
|
|
@@ -7877,7 +7899,9 @@
|
|
|
7877
7899
|
};
|
|
7878
7900
|
const { vseed } = context;
|
|
7879
7901
|
const { dataset } = vseed;
|
|
7880
|
-
const {
|
|
7902
|
+
const { encoding, chartType } = advancedVSeed;
|
|
7903
|
+
const measures = advancedVSeed.reshapeMeasures ?? advancedVSeed.measures ?? [];
|
|
7904
|
+
const dimensions = advancedVSeed.reshapeDimensions ?? advancedVSeed.dimensions ?? [];
|
|
7881
7905
|
const allMeasures = findAllMeasures(measures);
|
|
7882
7906
|
const measureGroups = [];
|
|
7883
7907
|
const depth = measureDepth(measures);
|
|
@@ -7954,12 +7978,12 @@
|
|
|
7954
7978
|
], [
|
|
7955
7979
|
encodingForScatter,
|
|
7956
7980
|
buildMeasuresForScatter,
|
|
7957
|
-
|
|
7981
|
+
pickMeasuresForReshape([
|
|
7958
7982
|
'tooltip',
|
|
7959
7983
|
'label',
|
|
7960
7984
|
'size'
|
|
7961
7985
|
]),
|
|
7962
|
-
|
|
7986
|
+
pickDimensionsForReshape
|
|
7963
7987
|
]),
|
|
7964
7988
|
pivotAdapter([
|
|
7965
7989
|
reshapeWithScatterEncoding
|
|
@@ -8397,7 +8421,7 @@
|
|
|
8397
8421
|
}
|
|
8398
8422
|
};
|
|
8399
8423
|
}
|
|
8400
|
-
const generateRegressionLinePipe = (type, regressionFunction, getOptions)=>(spec, context)=>{
|
|
8424
|
+
const generateRegressionLinePipe = (type, regressionFunction, getOptions = getDefaultRegressionOptions)=>(spec, context)=>{
|
|
8401
8425
|
const result = {
|
|
8402
8426
|
...spec
|
|
8403
8427
|
};
|
|
@@ -8545,9 +8569,13 @@
|
|
|
8545
8569
|
});
|
|
8546
8570
|
return result;
|
|
8547
8571
|
};
|
|
8572
|
+
const getDefaultRegressionOptions = (lineConfig)=>({
|
|
8573
|
+
alpha: lineConfig?.confidenceLevel ?? 0.95
|
|
8574
|
+
});
|
|
8548
8575
|
const linearRegressionLine = generateRegressionLinePipe('linearRegressionLine', regressionLinear);
|
|
8549
8576
|
const lowessRegressionLine = generateRegressionLinePipe('lowessRegressionLine', regressionLowess);
|
|
8550
8577
|
const polynomialRegressionLine = generateRegressionLinePipe('polynomialRegressionLine', regressionPolynomial, (lineConfig)=>({
|
|
8578
|
+
...getDefaultRegressionOptions(lineConfig),
|
|
8551
8579
|
degree: lineConfig.degree ?? 2
|
|
8552
8580
|
}));
|
|
8553
8581
|
const logisticRegressionLine = generateRegressionLinePipe('logisticRegressionLine', regressionLogistic);
|
|
@@ -8786,7 +8814,9 @@
|
|
|
8786
8814
|
};
|
|
8787
8815
|
const { vseed } = context;
|
|
8788
8816
|
const { dataset } = vseed;
|
|
8789
|
-
const {
|
|
8817
|
+
const { encoding, chartType } = advancedVSeed;
|
|
8818
|
+
const measures = advancedVSeed.reshapeMeasures ?? advancedVSeed.measures ?? [];
|
|
8819
|
+
const dimensions = advancedVSeed.reshapeDimensions ?? advancedVSeed.dimensions ?? [];
|
|
8790
8820
|
if (measures.length > 2) throw new Error('measures can not be more than 2 groups in dualAxis');
|
|
8791
8821
|
const foldInfoList = [];
|
|
8792
8822
|
const unfoldInfoList = [];
|
|
@@ -8841,7 +8871,9 @@
|
|
|
8841
8871
|
};
|
|
8842
8872
|
const { vseed } = context;
|
|
8843
8873
|
const { dataset } = vseed;
|
|
8844
|
-
const {
|
|
8874
|
+
const { encoding, chartType } = advancedVSeed;
|
|
8875
|
+
const measures = advancedVSeed.reshapeMeasures ?? advancedVSeed.measures ?? [];
|
|
8876
|
+
const dimensions = advancedVSeed.reshapeDimensions ?? advancedVSeed.dimensions ?? [];
|
|
8845
8877
|
const allMeasures = findAllMeasures(measures);
|
|
8846
8878
|
const datasetList = [];
|
|
8847
8879
|
const datasetReshapeInfo = [];
|
|
@@ -8947,12 +8979,12 @@
|
|
|
8947
8979
|
], [
|
|
8948
8980
|
encodingForDualAxis,
|
|
8949
8981
|
buildMeasuresForDualAxis,
|
|
8950
|
-
|
|
8982
|
+
pickMeasuresForReshape([
|
|
8951
8983
|
'tooltip',
|
|
8952
8984
|
'label',
|
|
8953
8985
|
'color'
|
|
8954
8986
|
]),
|
|
8955
|
-
|
|
8987
|
+
pickDimensionsForReshape
|
|
8956
8988
|
]),
|
|
8957
8989
|
pivotAdapter([
|
|
8958
8990
|
reshapeWithDualEncoding
|
|
@@ -9722,12 +9754,12 @@
|
|
|
9722
9754
|
], [
|
|
9723
9755
|
encodingForPie,
|
|
9724
9756
|
buildMeasures,
|
|
9725
|
-
|
|
9757
|
+
pickMeasuresForReshape([
|
|
9726
9758
|
'tooltip',
|
|
9727
9759
|
'label',
|
|
9728
9760
|
'color'
|
|
9729
9761
|
]),
|
|
9730
|
-
|
|
9762
|
+
pickDimensionsForReshape
|
|
9731
9763
|
]),
|
|
9732
9764
|
pivotAdapter([
|
|
9733
9765
|
reshapeWithEncoding
|
|
@@ -9883,12 +9915,12 @@
|
|
|
9883
9915
|
], [
|
|
9884
9916
|
encodingForPie,
|
|
9885
9917
|
buildMeasures,
|
|
9886
|
-
|
|
9918
|
+
pickMeasuresForReshape([
|
|
9887
9919
|
'tooltip',
|
|
9888
9920
|
'label',
|
|
9889
9921
|
'color'
|
|
9890
9922
|
]),
|
|
9891
|
-
|
|
9923
|
+
pickDimensionsForReshape
|
|
9892
9924
|
]),
|
|
9893
9925
|
pivotAdapter([
|
|
9894
9926
|
reshapeWithEncoding
|
|
@@ -10048,12 +10080,12 @@
|
|
|
10048
10080
|
], [
|
|
10049
10081
|
encodingForRose,
|
|
10050
10082
|
buildMeasures,
|
|
10051
|
-
|
|
10083
|
+
pickMeasuresForReshape([
|
|
10052
10084
|
'tooltip',
|
|
10053
10085
|
'label',
|
|
10054
10086
|
'color'
|
|
10055
10087
|
]),
|
|
10056
|
-
|
|
10088
|
+
pickDimensionsForReshape
|
|
10057
10089
|
]),
|
|
10058
10090
|
pivotAdapter([
|
|
10059
10091
|
reshapeWithEncoding
|
|
@@ -10201,12 +10233,12 @@
|
|
|
10201
10233
|
], [
|
|
10202
10234
|
encodingForRose,
|
|
10203
10235
|
buildMeasures,
|
|
10204
|
-
|
|
10236
|
+
pickMeasuresForReshape([
|
|
10205
10237
|
'tooltip',
|
|
10206
10238
|
'label',
|
|
10207
10239
|
'color'
|
|
10208
10240
|
]),
|
|
10209
|
-
|
|
10241
|
+
pickDimensionsForReshape
|
|
10210
10242
|
]),
|
|
10211
10243
|
pivotAdapter([
|
|
10212
10244
|
reshapeWithEncoding
|
|
@@ -10396,12 +10428,12 @@
|
|
|
10396
10428
|
], [
|
|
10397
10429
|
encodingForRadar,
|
|
10398
10430
|
buildMeasures,
|
|
10399
|
-
|
|
10431
|
+
pickMeasuresForReshape([
|
|
10400
10432
|
'tooltip',
|
|
10401
10433
|
'label',
|
|
10402
10434
|
'color'
|
|
10403
10435
|
]),
|
|
10404
|
-
|
|
10436
|
+
pickDimensionsForReshape
|
|
10405
10437
|
]),
|
|
10406
10438
|
pivotAdapter([
|
|
10407
10439
|
reshapeWithEncoding
|
|
@@ -10611,12 +10643,12 @@
|
|
|
10611
10643
|
], [
|
|
10612
10644
|
encodingForFunnel,
|
|
10613
10645
|
buildMeasures,
|
|
10614
|
-
|
|
10646
|
+
pickMeasuresForReshape([
|
|
10615
10647
|
'tooltip',
|
|
10616
10648
|
'label',
|
|
10617
10649
|
'color'
|
|
10618
10650
|
]),
|
|
10619
|
-
|
|
10651
|
+
pickDimensionsForReshape
|
|
10620
10652
|
]),
|
|
10621
10653
|
pivotAdapter([
|
|
10622
10654
|
reshapeWithEncoding
|
|
@@ -10838,11 +10870,11 @@
|
|
|
10838
10870
|
], [
|
|
10839
10871
|
encodingForHeatmap,
|
|
10840
10872
|
buildMeasures,
|
|
10841
|
-
|
|
10873
|
+
pickMeasuresForReshape([
|
|
10842
10874
|
'tooltip',
|
|
10843
10875
|
'label'
|
|
10844
10876
|
]),
|
|
10845
|
-
|
|
10877
|
+
pickDimensionsForReshape
|
|
10846
10878
|
]),
|
|
10847
10879
|
pivotAdapter([
|
|
10848
10880
|
reshapeWithEncoding
|
|
@@ -11244,7 +11276,9 @@
|
|
|
11244
11276
|
};
|
|
11245
11277
|
const { vseed } = context;
|
|
11246
11278
|
const { dataset, chartType } = vseed;
|
|
11247
|
-
const {
|
|
11279
|
+
const { encoding = {}, config } = advancedVSeed;
|
|
11280
|
+
const measures = advancedVSeed.reshapeMeasures ?? advancedVSeed.measures ?? [];
|
|
11281
|
+
const dimensions = advancedVSeed.reshapeDimensions ?? advancedVSeed.dimensions ?? [];
|
|
11248
11282
|
const uniqDims = T(dimensions, (item)=>item.id);
|
|
11249
11283
|
const whiskers = config?.[chartType]?.whiskers;
|
|
11250
11284
|
let newDatasets = [];
|
|
@@ -11263,8 +11297,8 @@
|
|
|
11263
11297
|
outputNames: {
|
|
11264
11298
|
q1: "__Q1__",
|
|
11265
11299
|
q3: "__Q3__",
|
|
11266
|
-
|
|
11267
|
-
|
|
11300
|
+
lowerWhisker: LowerWhisker,
|
|
11301
|
+
upperWhisker: UpperWhisker,
|
|
11268
11302
|
median: MedianMeasureId,
|
|
11269
11303
|
outliers: OutliersMeasureId
|
|
11270
11304
|
}
|
|
@@ -11290,8 +11324,8 @@
|
|
|
11290
11324
|
colorItemAsId: false
|
|
11291
11325
|
});
|
|
11292
11326
|
res.dataset.forEach((datum)=>{
|
|
11293
|
-
datum[
|
|
11294
|
-
datum[
|
|
11327
|
+
datum[UpperWhisker] = datum[encoding.max[0]];
|
|
11328
|
+
datum[LowerWhisker] = datum[encoding.min[0]];
|
|
11295
11329
|
datum["__Q1__"] = datum[encoding.q1[0]];
|
|
11296
11330
|
datum["__Q3__"] = datum[encoding.q3[0]];
|
|
11297
11331
|
datum[MedianMeasureId] = datum[encoding.median[0]];
|
|
@@ -11321,7 +11355,9 @@
|
|
|
11321
11355
|
};
|
|
11322
11356
|
const { vseed } = context;
|
|
11323
11357
|
const { dataset, chartType } = vseed;
|
|
11324
|
-
const {
|
|
11358
|
+
const { encoding = {}, config } = advancedVSeed;
|
|
11359
|
+
const measures = advancedVSeed.reshapeMeasures ?? advancedVSeed.measures ?? [];
|
|
11360
|
+
const dimensions = advancedVSeed.reshapeDimensions ?? advancedVSeed.dimensions ?? [];
|
|
11325
11361
|
const uniqDims = T(dimensions, (item)=>item.id);
|
|
11326
11362
|
const chartConfig = config?.[chartType];
|
|
11327
11363
|
const whiskers = chartConfig?.whiskers;
|
|
@@ -11352,8 +11388,8 @@
|
|
|
11352
11388
|
outputNames: {
|
|
11353
11389
|
q1: "__Q1__",
|
|
11354
11390
|
q3: "__Q3__",
|
|
11355
|
-
|
|
11356
|
-
|
|
11391
|
+
lowerWhisker: LowerWhisker,
|
|
11392
|
+
upperWhisker: UpperWhisker,
|
|
11357
11393
|
median: MedianMeasureId,
|
|
11358
11394
|
outliers: OutliersMeasureId
|
|
11359
11395
|
}
|
|
@@ -11379,8 +11415,8 @@
|
|
|
11379
11415
|
colorItemAsId: false
|
|
11380
11416
|
});
|
|
11381
11417
|
res.dataset.forEach((datum)=>{
|
|
11382
|
-
datum[
|
|
11383
|
-
datum[
|
|
11418
|
+
datum[UpperWhisker] = datum[encoding.max[0]];
|
|
11419
|
+
datum[LowerWhisker] = datum[encoding.min[0]];
|
|
11384
11420
|
datum["__Q1__"] = datum[encoding.q1[0]];
|
|
11385
11421
|
datum["__Q3__"] = datum[encoding.q3[0]];
|
|
11386
11422
|
datum[MedianMeasureId] = datum[encoding.median[0]];
|
|
@@ -11416,12 +11452,12 @@
|
|
|
11416
11452
|
], [
|
|
11417
11453
|
encodingForBoxplot,
|
|
11418
11454
|
buildMeasures,
|
|
11419
|
-
|
|
11455
|
+
pickMeasuresForReshape([
|
|
11420
11456
|
'tooltip',
|
|
11421
11457
|
'label',
|
|
11422
11458
|
'color'
|
|
11423
11459
|
]),
|
|
11424
|
-
|
|
11460
|
+
pickDimensionsForReshape
|
|
11425
11461
|
]),
|
|
11426
11462
|
pivotAdapter([
|
|
11427
11463
|
reshapeWithBoxplotEncoding
|
|
@@ -11441,10 +11477,10 @@
|
|
|
11441
11477
|
const { datasetReshapeInfo, encoding } = advancedVSeed;
|
|
11442
11478
|
const { unfoldInfo } = datasetReshapeInfo[0];
|
|
11443
11479
|
result.type = 'boxPlot';
|
|
11444
|
-
result.minField =
|
|
11480
|
+
result.minField = LowerWhisker;
|
|
11481
|
+
result.maxField = UpperWhisker;
|
|
11445
11482
|
result.q1Field = "__Q1__";
|
|
11446
11483
|
result.medianField = MedianMeasureId;
|
|
11447
|
-
result.maxField = MaxMeasureId;
|
|
11448
11484
|
result.q3Field = "__Q3__";
|
|
11449
11485
|
result.outliersField = OutliersMeasureId;
|
|
11450
11486
|
result.xField = [
|
|
@@ -11480,12 +11516,20 @@
|
|
|
11480
11516
|
};
|
|
11481
11517
|
};
|
|
11482
11518
|
const boxPlotMeasureKeys = [
|
|
11483
|
-
|
|
11519
|
+
UpperWhisker,
|
|
11484
11520
|
"__Q3__",
|
|
11485
11521
|
MedianMeasureId,
|
|
11486
11522
|
"__Q1__",
|
|
11487
|
-
|
|
11523
|
+
LowerWhisker
|
|
11488
11524
|
];
|
|
11525
|
+
const measureAliasMapping = {
|
|
11526
|
+
[OutliersMeasureId]: intl.i18n`异常点`,
|
|
11527
|
+
[UpperWhisker]: intl.i18n`上边界`,
|
|
11528
|
+
["__Q3__"]: intl.i18n`上四分位数`,
|
|
11529
|
+
[MedianMeasureId]: intl.i18n`中位数`,
|
|
11530
|
+
["__Q1__"]: intl.i18n`下四分位数`,
|
|
11531
|
+
[LowerWhisker]: intl.i18n`下边界`
|
|
11532
|
+
};
|
|
11489
11533
|
const VCHART_OUTLIER_KEY = '__VCHART_BOX_PLOT_OUTLIER_VALUE';
|
|
11490
11534
|
const tooltipBoxplot = (spec, context)=>{
|
|
11491
11535
|
const result = {
|
|
@@ -11517,7 +11561,7 @@
|
|
|
11517
11561
|
const formatter = outerlierMeasure ? createFormatterByMeasure(outerlierMeasure) : defaultFormatter;
|
|
11518
11562
|
tooltipItems.push({
|
|
11519
11563
|
...tooltipItems[0],
|
|
11520
|
-
key: outerlierMeasure?.alias ?? OutliersMeasureId,
|
|
11564
|
+
key: outerlierMeasure?.alias ?? measureAliasMapping[OutliersMeasureId],
|
|
11521
11565
|
value: formatter(datum?.[VCHART_OUTLIER_KEY])
|
|
11522
11566
|
});
|
|
11523
11567
|
return tooltipItems;
|
|
@@ -11529,7 +11573,7 @@
|
|
|
11529
11573
|
return {
|
|
11530
11574
|
...entry,
|
|
11531
11575
|
value: formatter(datum?.[entry.key]),
|
|
11532
|
-
key: mea?.alias ?? entry.key
|
|
11576
|
+
key: mea?.alias ?? measureAliasMapping[entry?.key] ?? entry.key
|
|
11533
11577
|
};
|
|
11534
11578
|
}
|
|
11535
11579
|
return entry;
|
|
@@ -11572,6 +11616,17 @@
|
|
|
11572
11616
|
defaultContent
|
|
11573
11617
|
];
|
|
11574
11618
|
};
|
|
11619
|
+
const boxLegend = (spec, context)=>{
|
|
11620
|
+
const normalLegend = discreteLegend(spec, context);
|
|
11621
|
+
normalLegend.legends = {
|
|
11622
|
+
...normalLegend.legends,
|
|
11623
|
+
data: (data)=>data.map((obj)=>{
|
|
11624
|
+
obj.shape.fill = obj.shape.stroke;
|
|
11625
|
+
return obj;
|
|
11626
|
+
})
|
|
11627
|
+
};
|
|
11628
|
+
return normalLegend;
|
|
11629
|
+
};
|
|
11575
11630
|
const pipeline_boxplot_boxplot = [
|
|
11576
11631
|
initBoxplot,
|
|
11577
11632
|
stackCornerRadius_stackCornerRadius,
|
|
@@ -11583,7 +11638,7 @@
|
|
|
11583
11638
|
yLinear,
|
|
11584
11639
|
label_label,
|
|
11585
11640
|
tooltipBoxplot,
|
|
11586
|
-
colorAdapter(
|
|
11641
|
+
colorAdapter(boxLegend, colorLegend),
|
|
11587
11642
|
verticalCrosshairRect,
|
|
11588
11643
|
colorBarStyleFill(barStyle_barStyle),
|
|
11589
11644
|
annotationPoint_annotationPoint,
|
|
@@ -11893,7 +11948,9 @@
|
|
|
11893
11948
|
};
|
|
11894
11949
|
const { vseed } = context;
|
|
11895
11950
|
const { dataset, chartType } = vseed;
|
|
11896
|
-
const {
|
|
11951
|
+
const { encoding = {}, config } = advancedVSeed;
|
|
11952
|
+
const measures = advancedVSeed.reshapeMeasures ?? advancedVSeed.measures ?? [];
|
|
11953
|
+
const dimensions = advancedVSeed.reshapeDimensions ?? advancedVSeed.dimensions ?? [];
|
|
11897
11954
|
const uniqDims = T(dimensions, (item)=>item.id);
|
|
11898
11955
|
const chartConfig = config?.[chartType];
|
|
11899
11956
|
const binCount = chartConfig?.binCount;
|
|
@@ -11990,7 +12047,9 @@
|
|
|
11990
12047
|
};
|
|
11991
12048
|
const { vseed } = context;
|
|
11992
12049
|
const { dataset, chartType } = vseed;
|
|
11993
|
-
const {
|
|
12050
|
+
const { encoding = {}, config } = advancedVSeed;
|
|
12051
|
+
const measures = advancedVSeed.reshapeMeasures ?? advancedVSeed.measures ?? [];
|
|
12052
|
+
const dimensions = advancedVSeed.reshapeDimensions ?? advancedVSeed.dimensions ?? [];
|
|
11994
12053
|
const colorMeasureId = getColorMeasureId(advancedVSeed, vseed);
|
|
11995
12054
|
const uniqDims = T(dimensions, (item)=>item.id);
|
|
11996
12055
|
const chartConfig = config?.[chartType];
|
|
@@ -12031,9 +12090,9 @@
|
|
|
12031
12090
|
field: valueField,
|
|
12032
12091
|
groupField: [
|
|
12033
12092
|
...encoding.x ?? [],
|
|
12034
|
-
...encoding.color ?? []
|
|
12035
|
-
...rowColumnFields.map((item)=>item.id)
|
|
12093
|
+
...encoding.color ?? []
|
|
12036
12094
|
],
|
|
12095
|
+
facetField: rowColumnFields.map((item)=>item.id),
|
|
12037
12096
|
bins: binCount,
|
|
12038
12097
|
step: binStep,
|
|
12039
12098
|
outputNames: {
|
|
@@ -12105,12 +12164,12 @@
|
|
|
12105
12164
|
], [
|
|
12106
12165
|
encodingForHistogram,
|
|
12107
12166
|
buildMeasures,
|
|
12108
|
-
|
|
12167
|
+
pickMeasuresForReshape([
|
|
12109
12168
|
'tooltip',
|
|
12110
12169
|
'label',
|
|
12111
12170
|
'color'
|
|
12112
12171
|
]),
|
|
12113
|
-
|
|
12172
|
+
pickDimensionsForReshape
|
|
12114
12173
|
]),
|
|
12115
12174
|
pivotAdapter([
|
|
12116
12175
|
reshapeWithHistogramEncoding
|
|
@@ -12159,6 +12218,13 @@
|
|
|
12159
12218
|
}
|
|
12160
12219
|
};
|
|
12161
12220
|
};
|
|
12221
|
+
const getDefaultXFormatterOfHistogram = (advancedVSeed)=>{
|
|
12222
|
+
const { chartType, config } = advancedVSeed;
|
|
12223
|
+
const xConfig = config?.[chartType]?.xAxis;
|
|
12224
|
+
const { autoFormat = true, numFormat = {} } = xConfig;
|
|
12225
|
+
const formatter = createNumFormatter(numFormat);
|
|
12226
|
+
return (value)=>createLinearFormat(value, autoFormat, numFormat, formatter);
|
|
12227
|
+
};
|
|
12162
12228
|
const tooltipHistogram_VCHART_OUTLIER_KEY = '__VCHART_BOX_PLOT_OUTLIER_VALUE';
|
|
12163
12229
|
const tooltipHistogram = (spec, context)=>{
|
|
12164
12230
|
const result = {
|
|
@@ -12171,6 +12237,7 @@
|
|
|
12171
12237
|
enable: true
|
|
12172
12238
|
} } = baseConfig;
|
|
12173
12239
|
const { enable } = tooltip;
|
|
12240
|
+
const defaultXFormatter = getDefaultXFormatterOfHistogram(advancedVSeed);
|
|
12174
12241
|
result.tooltip = {
|
|
12175
12242
|
style: getTooltipStyle(tooltip),
|
|
12176
12243
|
visible: enable,
|
|
@@ -12178,18 +12245,18 @@
|
|
|
12178
12245
|
title: {
|
|
12179
12246
|
visible: false
|
|
12180
12247
|
},
|
|
12181
|
-
content: tooltipHistogram_createMarkContent(encoding.tooltip || [], dimensions, encoding)
|
|
12248
|
+
content: tooltipHistogram_createMarkContent(encoding.tooltip || [], dimensions, encoding, defaultXFormatter)
|
|
12182
12249
|
},
|
|
12183
12250
|
dimension: {
|
|
12184
12251
|
title: {
|
|
12185
12252
|
visible: false
|
|
12186
12253
|
},
|
|
12187
|
-
content: tooltipHistogram_createMarkContent(encoding.tooltip || [], dimensions, encoding)
|
|
12254
|
+
content: tooltipHistogram_createMarkContent(encoding.tooltip || [], dimensions, encoding, defaultXFormatter)
|
|
12188
12255
|
}
|
|
12189
12256
|
};
|
|
12190
12257
|
return result;
|
|
12191
12258
|
};
|
|
12192
|
-
const tooltipHistogram_createMarkContent = (tooltip, dimensions, encoding)=>{
|
|
12259
|
+
const tooltipHistogram_createMarkContent = (tooltip, dimensions, encoding, dimFormatter)=>{
|
|
12193
12260
|
const dims = C(dimensions.filter((item)=>tooltip.includes(item.id)), T((item)=>item.id), T((item)=>item.alias));
|
|
12194
12261
|
const dimContent = dims.map((item)=>({
|
|
12195
12262
|
visible: true,
|
|
@@ -12211,7 +12278,7 @@
|
|
|
12211
12278
|
shapeType: 'rectRound',
|
|
12212
12279
|
key: (datum)=>{
|
|
12213
12280
|
if (!datum) return '';
|
|
12214
|
-
return
|
|
12281
|
+
return `[${dimFormatter(+datum[BinStartMeasureId])}, ${dimFormatter(+datum[BinEndMeasureId])})`;
|
|
12215
12282
|
},
|
|
12216
12283
|
value: (datum)=>{
|
|
12217
12284
|
if (!datum) return '';
|
|
@@ -12224,6 +12291,27 @@
|
|
|
12224
12291
|
defaultContent
|
|
12225
12292
|
];
|
|
12226
12293
|
};
|
|
12294
|
+
const histogramVerticalCrosshairRect = (spec, context)=>{
|
|
12295
|
+
const result = verticalCrosshairRect(spec, context);
|
|
12296
|
+
if (!result.crosshair) return result;
|
|
12297
|
+
const crosshair = result.crosshair;
|
|
12298
|
+
if (!crosshair.xField) return result;
|
|
12299
|
+
const defaultXFormatter = getDefaultXFormatterOfHistogram(context.advancedVSeed);
|
|
12300
|
+
crosshair.xField = {
|
|
12301
|
+
...crosshair.xField || {},
|
|
12302
|
+
label: {
|
|
12303
|
+
...crosshair.xField?.label || {},
|
|
12304
|
+
formatMethod: (text)=>{
|
|
12305
|
+
if (common_isArray(text)) return text;
|
|
12306
|
+
const binRange = `${text}`.split('~');
|
|
12307
|
+
const binStart = defaultXFormatter(+binRange[0]);
|
|
12308
|
+
const binEnd = defaultXFormatter(+binRange[1]);
|
|
12309
|
+
return 1 === binRange.length ? binStart : `[${binStart}, ${binEnd})`;
|
|
12310
|
+
}
|
|
12311
|
+
}
|
|
12312
|
+
};
|
|
12313
|
+
return result;
|
|
12314
|
+
};
|
|
12227
12315
|
const gaussian = (u)=>1 / Math.sqrt(2 * Math.PI) * Math.exp(-0.5 * u * u);
|
|
12228
12316
|
function scott(n, std, dim = 1) {
|
|
12229
12317
|
return n <= 0 || 0 === std ? 0 : std * Math.pow(n, -1 / (dim + 4));
|
|
@@ -12556,6 +12644,36 @@
|
|
|
12556
12644
|
}
|
|
12557
12645
|
});
|
|
12558
12646
|
});
|
|
12647
|
+
const leftAxis = result.axes?.find((v)=>'left' === v.orient);
|
|
12648
|
+
if (leftAxis && lineList.length) result.axes?.push({
|
|
12649
|
+
visible: true,
|
|
12650
|
+
orient: 'right',
|
|
12651
|
+
type: 'linear',
|
|
12652
|
+
base: 10,
|
|
12653
|
+
min: 0,
|
|
12654
|
+
max: 1,
|
|
12655
|
+
domainLine: {
|
|
12656
|
+
...leftAxis.domainLine
|
|
12657
|
+
},
|
|
12658
|
+
grid: {
|
|
12659
|
+
visible: false
|
|
12660
|
+
},
|
|
12661
|
+
tick: {
|
|
12662
|
+
...leftAxis.tick
|
|
12663
|
+
},
|
|
12664
|
+
title: {
|
|
12665
|
+
...leftAxis.title,
|
|
12666
|
+
visible: false
|
|
12667
|
+
},
|
|
12668
|
+
label: {
|
|
12669
|
+
...leftAxis.label,
|
|
12670
|
+
visible: true,
|
|
12671
|
+
formatMethod: (v)=>{
|
|
12672
|
+
const text = common_isArray(v) ? v[0] : v;
|
|
12673
|
+
return `${(100 * text).toFixed(1)}%`;
|
|
12674
|
+
}
|
|
12675
|
+
}
|
|
12676
|
+
});
|
|
12559
12677
|
return result;
|
|
12560
12678
|
};
|
|
12561
12679
|
const histogram = [
|
|
@@ -12569,7 +12687,7 @@
|
|
|
12569
12687
|
label_label,
|
|
12570
12688
|
tooltipHistogram,
|
|
12571
12689
|
colorAdapter(discreteLegend, colorLegend),
|
|
12572
|
-
|
|
12690
|
+
histogramVerticalCrosshairRect,
|
|
12573
12691
|
colorBarStyleFill(barStyle_barStyle),
|
|
12574
12692
|
annotationPoint_annotationPoint,
|
|
12575
12693
|
annotationVerticalLine_annotationVerticalLine,
|
|
@@ -12593,7 +12711,7 @@
|
|
|
12593
12711
|
label_label,
|
|
12594
12712
|
tooltipHistogram,
|
|
12595
12713
|
colorBarStyleFill(barStyle_barStyle),
|
|
12596
|
-
|
|
12714
|
+
histogramVerticalCrosshairRect,
|
|
12597
12715
|
annotationPoint_annotationPoint,
|
|
12598
12716
|
annotationVerticalLine_annotationVerticalLine,
|
|
12599
12717
|
annotationHorizontalLine_annotationHorizontalLine,
|
|
@@ -17103,9 +17221,9 @@
|
|
|
17103
17221
|
const zMeasure = schemas_object({
|
|
17104
17222
|
id: schemas_string(),
|
|
17105
17223
|
alias: schemas_string().optional(),
|
|
17106
|
-
autoFormat: schemas_boolean().
|
|
17107
|
-
numFormat: zNumFormat
|
|
17108
|
-
format: zNumFormat
|
|
17224
|
+
autoFormat: schemas_boolean().optional(),
|
|
17225
|
+
numFormat: zNumFormat.optional(),
|
|
17226
|
+
format: zNumFormat.optional(),
|
|
17109
17227
|
encoding: schemas_enum([
|
|
17110
17228
|
'primaryYAxis',
|
|
17111
17229
|
'secondaryYAxis',
|
|
@@ -17118,7 +17236,16 @@
|
|
|
17118
17236
|
'label',
|
|
17119
17237
|
'tooltip',
|
|
17120
17238
|
'detail',
|
|
17121
|
-
'column'
|
|
17239
|
+
'column',
|
|
17240
|
+
'value',
|
|
17241
|
+
'q1',
|
|
17242
|
+
'q3',
|
|
17243
|
+
'min',
|
|
17244
|
+
'max',
|
|
17245
|
+
'median',
|
|
17246
|
+
'outliers',
|
|
17247
|
+
'x0',
|
|
17248
|
+
'x1'
|
|
17122
17249
|
]).optional(),
|
|
17123
17250
|
parentId: schemas_string().optional()
|
|
17124
17251
|
});
|
|
@@ -18676,6 +18803,8 @@
|
|
|
18676
18803
|
datasetReshapeInfo: zDatasetReshapeInfo,
|
|
18677
18804
|
dimensions: zDimensionTree,
|
|
18678
18805
|
measures: zMeasureTree,
|
|
18806
|
+
reshapeMeasures: zMeasureTree.optional(),
|
|
18807
|
+
reshapeDimensions: zDimensionTree.optional(),
|
|
18679
18808
|
encoding: zEncoding,
|
|
18680
18809
|
config: zConfig,
|
|
18681
18810
|
analysis: zAnalysis,
|