@pyreon/charts 0.6.0
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/LICENSE +21 -0
- package/README.md +159 -0
- package/lib/analysis/index.js.html +5406 -0
- package/lib/analysis/manual.js.html +5406 -0
- package/lib/charts-Ckh2qxB5.js +17571 -0
- package/lib/charts-Ckh2qxB5.js.map +1 -0
- package/lib/components-BcPePBeS.js +13688 -0
- package/lib/components-BcPePBeS.js.map +1 -0
- package/lib/core-9w0g6EOI.js +200 -0
- package/lib/core-9w0g6EOI.js.map +1 -0
- package/lib/createSeriesData-DOHScdgk.js +412 -0
- package/lib/createSeriesData-DOHScdgk.js.map +1 -0
- package/lib/customGraphicKeyframeAnimation-CvkEkSt_.js +8524 -0
- package/lib/customGraphicKeyframeAnimation-CvkEkSt_.js.map +1 -0
- package/lib/graphic-CPJ2K90a.js +10771 -0
- package/lib/graphic-CPJ2K90a.js.map +1 -0
- package/lib/index.js +309 -0
- package/lib/index.js.map +1 -0
- package/lib/manual.js +334 -0
- package/lib/manual.js.map +1 -0
- package/lib/parseGeoJson-BlBe5Vig.js +18498 -0
- package/lib/parseGeoJson-BlBe5Vig.js.map +1 -0
- package/lib/renderers-Dytryvoy.js +2044 -0
- package/lib/renderers-Dytryvoy.js.map +1 -0
- package/lib/types/charts.d.ts +7968 -0
- package/lib/types/charts.d.ts.map +1 -0
- package/lib/types/components.d.ts +4074 -0
- package/lib/types/components.d.ts.map +1 -0
- package/lib/types/core.d.ts +98 -0
- package/lib/types/core.d.ts.map +1 -0
- package/lib/types/createSeriesData.d.ts +325 -0
- package/lib/types/createSeriesData.d.ts.map +1 -0
- package/lib/types/customGraphicKeyframeAnimation.d.ts +3531 -0
- package/lib/types/customGraphicKeyframeAnimation.d.ts.map +1 -0
- package/lib/types/graphic.d.ts +4043 -0
- package/lib/types/graphic.d.ts.map +1 -0
- package/lib/types/index.d.ts +255 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index2.d.ts +2221 -0
- package/lib/types/index2.d.ts.map +1 -0
- package/lib/types/manual.d.ts +279 -0
- package/lib/types/manual.d.ts.map +1 -0
- package/lib/types/manual2.d.ts +2238 -0
- package/lib/types/manual2.d.ts.map +1 -0
- package/lib/types/parseGeoJson.d.ts +8695 -0
- package/lib/types/parseGeoJson.d.ts.map +1 -0
- package/lib/types/renderers.d.ts +995 -0
- package/lib/types/renderers.d.ts.map +1 -0
- package/package.json +58 -0
- package/src/chart-component.tsx +53 -0
- package/src/index.ts +64 -0
- package/src/loader.ts +222 -0
- package/src/manual.ts +36 -0
- package/src/tests/charts.test.tsx +363 -0
- package/src/types.ts +118 -0
- package/src/use-chart.ts +136 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { A as ZRImage, An as isArray, C as ZRText, E as Rect, Gn as merge, Kt as vector_exports, Ln as isObject, Nn as isFunction, On as indexOf, Qt as BoundingRect, S as Group, Sn as each, Tn as filter, Wn as map, Xn as reduce, bn as defaults, ct as color_exports, d as zrender_exports, gn as clone, hn as bind, kn as inherits, lr as __exportAll, n as brushSingle, on as matrix_exports, pn as env, qn as mixin, qt as truncateText, rr as util_exports$1, sr as setPlatformAPI, v as encodeHTML, wn as extend, x as CompoundPath, yn as curry, zn as isString } from "./graphic-CPJ2K90a.js";
|
|
2
|
+
import { $ as registerTransform, $i as parsePercent, $t as capitalFirst, A as PRIORITY, B as getMap, Bi as asc, Br as LinearGradient, Cr as resizePath, Et as SeriesModel, F as disconnect, G as registerLayout, Gi as getPrecisionSafe, Gr as Polygon, H as registerAction, Hi as getPercentWithPrecision, Hr as BezierCurve, I as dispose, Ir as updateProps, J as registerPostInit, Ji as linearMap, Jr as Ellipse, Jt as getLayoutRect, K as registerLoading, Ki as isNumeric, Kn as Model, Kr as Ring, L as getCoordinateSystemDimensions, Lr as IncrementalDisplayable, M as dataTool, Mr as initProps, N as dependencies, O as AxisModelCommonMixin, P as disConnect, Q as registerTheme, Qi as parseDate, Qt as addCommas, R as getInstanceByDom, Sr as registerShape, St as createSymbol, Tn as SeriesData, U as registerCoordinateSystem, Ui as getPixelPrecision, Ur as Line, V as init, Vr as Arc, W as registerCustomSeries, Wi as getPrecision, Wr as Polyline, X as registerPreprocessor, Xi as nice, Xn as createTextStyle$1, Y as registerPostUpdate, Yr as Circle, Z as registerProcessor, Zi as numericToNumber, _n as getStackedDimension, a as Axis, aa as remRadian, an as normalizeCssArray, ar as clipPointsByRect, br as makePath, c as createScaleByModel, cn as getTextRect, dr as extendPath, ei as enableHoverEmphasis, et as registerUpdateLifecycle, fi as getECData, fr as extendShape, gn as enableDataStack, ht as throttle, ia as reformIntervals, in as getTooltipMarker, j as connect, k as use, ln as format, m as niceScaleExtent, mr as getTransform, na as quantity, nn as formatTpl, nt as setCanvasCreator, oa as round, on as toCamelCase, or as clipRectByRect, pn as registerLocale, pr as getShapeClass, q as registerMap, qi as isRadianAroundZero, qr as Sector, ra as quantityExponent, rt as version, sr as createIcon, t as parseGeoJSON, ta as quantile, tn as formatTime, tt as registerVisual, un as roundTime, ut as ComponentView, vn as isDimensionStacked, xr as mergePath, yr as makeImage, yt as ChartView, z as getInstanceById, zi as MAX_SAFE_INTEGER, zr as RadialGradient, zt as ComponentModel } from "./parseGeoJson-BlBe5Vig.js";
|
|
3
|
+
import { n as createDimensions, t as createSeriesData } from "./createSeriesData-DOHScdgk.js";
|
|
4
|
+
|
|
5
|
+
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/export/api/helper.js
|
|
6
|
+
/**
|
|
7
|
+
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* This module exposes helper functions for developing extensions.
|
|
11
|
+
*/
|
|
12
|
+
var helper_exports = /* @__PURE__ */ __exportAll({
|
|
13
|
+
createDimensions: () => createDimensions,
|
|
14
|
+
createList: () => createList,
|
|
15
|
+
createScale: () => createScale,
|
|
16
|
+
createSymbol: () => createSymbol,
|
|
17
|
+
createTextStyle: () => createTextStyle,
|
|
18
|
+
dataStack: () => dataStack,
|
|
19
|
+
enableHoverEmphasis: () => enableHoverEmphasis,
|
|
20
|
+
getECData: () => getECData,
|
|
21
|
+
getLayoutRect: () => getLayoutRect,
|
|
22
|
+
mixinAxisModelCommonMethods: () => mixinAxisModelCommonMethods
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* Create a multi dimension List structure from seriesModel.
|
|
26
|
+
*/
|
|
27
|
+
function createList(seriesModel) {
|
|
28
|
+
return createSeriesData(null, seriesModel);
|
|
29
|
+
}
|
|
30
|
+
var dataStack = {
|
|
31
|
+
isDimensionStacked,
|
|
32
|
+
enableDataStack,
|
|
33
|
+
getStackedDimension
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Create scale
|
|
37
|
+
* @param {Array.<number>} dataExtent
|
|
38
|
+
* @param {Object|module:echarts/Model} option If `optoin.type`
|
|
39
|
+
* is secified, it can only be `'value'` currently.
|
|
40
|
+
*/
|
|
41
|
+
function createScale(dataExtent, option) {
|
|
42
|
+
var axisModel = option;
|
|
43
|
+
if (!(option instanceof Model)) axisModel = new Model(option);
|
|
44
|
+
var scale = createScaleByModel(axisModel);
|
|
45
|
+
scale.setExtent(dataExtent[0], dataExtent[1]);
|
|
46
|
+
niceScaleExtent(scale, axisModel);
|
|
47
|
+
return scale;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Mixin common methods to axis model,
|
|
51
|
+
*
|
|
52
|
+
* Include methods
|
|
53
|
+
* `getFormattedLabels() => Array.<string>`
|
|
54
|
+
* `getCategories() => Array.<string>`
|
|
55
|
+
* `getMin(origin: boolean) => number`
|
|
56
|
+
* `getMax(origin: boolean) => number`
|
|
57
|
+
* `getNeedCrossZero() => boolean`
|
|
58
|
+
*/
|
|
59
|
+
function mixinAxisModelCommonMethods(Model) {
|
|
60
|
+
mixin(Model, AxisModelCommonMixin);
|
|
61
|
+
}
|
|
62
|
+
function createTextStyle(textStyleModel, opts) {
|
|
63
|
+
opts = opts || {};
|
|
64
|
+
return createTextStyle$1(textStyleModel, null, null, opts.state !== "normal");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/export/api/number.js
|
|
69
|
+
var number_exports = /* @__PURE__ */ __exportAll({
|
|
70
|
+
MAX_SAFE_INTEGER: () => MAX_SAFE_INTEGER,
|
|
71
|
+
asc: () => asc,
|
|
72
|
+
getPercentWithPrecision: () => getPercentWithPrecision,
|
|
73
|
+
getPixelPrecision: () => getPixelPrecision,
|
|
74
|
+
getPrecision: () => getPrecision,
|
|
75
|
+
getPrecisionSafe: () => getPrecisionSafe,
|
|
76
|
+
isNumeric: () => isNumeric,
|
|
77
|
+
isRadianAroundZero: () => isRadianAroundZero,
|
|
78
|
+
linearMap: () => linearMap,
|
|
79
|
+
nice: () => nice,
|
|
80
|
+
numericToNumber: () => numericToNumber,
|
|
81
|
+
parseDate: () => parseDate,
|
|
82
|
+
parsePercent: () => parsePercent,
|
|
83
|
+
quantile: () => quantile,
|
|
84
|
+
quantity: () => quantity,
|
|
85
|
+
quantityExponent: () => quantityExponent,
|
|
86
|
+
reformIntervals: () => reformIntervals,
|
|
87
|
+
remRadian: () => remRadian,
|
|
88
|
+
round: () => round
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/export/api/time.js
|
|
93
|
+
var time_exports = /* @__PURE__ */ __exportAll({
|
|
94
|
+
format: () => format,
|
|
95
|
+
parse: () => parseDate,
|
|
96
|
+
roundTime: () => roundTime
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/export/api/graphic.js
|
|
101
|
+
var graphic_exports = /* @__PURE__ */ __exportAll({
|
|
102
|
+
Arc: () => Arc,
|
|
103
|
+
BezierCurve: () => BezierCurve,
|
|
104
|
+
BoundingRect: () => BoundingRect,
|
|
105
|
+
Circle: () => Circle,
|
|
106
|
+
CompoundPath: () => CompoundPath,
|
|
107
|
+
Ellipse: () => Ellipse,
|
|
108
|
+
Group: () => Group,
|
|
109
|
+
Image: () => ZRImage,
|
|
110
|
+
IncrementalDisplayable: () => IncrementalDisplayable,
|
|
111
|
+
Line: () => Line,
|
|
112
|
+
LinearGradient: () => LinearGradient,
|
|
113
|
+
Polygon: () => Polygon,
|
|
114
|
+
Polyline: () => Polyline,
|
|
115
|
+
RadialGradient: () => RadialGradient,
|
|
116
|
+
Rect: () => Rect,
|
|
117
|
+
Ring: () => Ring,
|
|
118
|
+
Sector: () => Sector,
|
|
119
|
+
Text: () => ZRText,
|
|
120
|
+
clipPointsByRect: () => clipPointsByRect,
|
|
121
|
+
clipRectByRect: () => clipRectByRect,
|
|
122
|
+
createIcon: () => createIcon,
|
|
123
|
+
extendPath: () => extendPath,
|
|
124
|
+
extendShape: () => extendShape,
|
|
125
|
+
getShapeClass: () => getShapeClass,
|
|
126
|
+
getTransform: () => getTransform,
|
|
127
|
+
initProps: () => initProps,
|
|
128
|
+
makeImage: () => makeImage,
|
|
129
|
+
makePath: () => makePath,
|
|
130
|
+
mergePath: () => mergePath,
|
|
131
|
+
registerShape: () => registerShape,
|
|
132
|
+
resizePath: () => resizePath,
|
|
133
|
+
updateProps: () => updateProps
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/export/api/format.js
|
|
138
|
+
var format_exports = /* @__PURE__ */ __exportAll({
|
|
139
|
+
addCommas: () => addCommas,
|
|
140
|
+
capitalFirst: () => capitalFirst,
|
|
141
|
+
encodeHTML: () => encodeHTML,
|
|
142
|
+
formatTime: () => formatTime,
|
|
143
|
+
formatTpl: () => formatTpl,
|
|
144
|
+
getTextRect: () => getTextRect,
|
|
145
|
+
getTooltipMarker: () => getTooltipMarker,
|
|
146
|
+
normalizeCssArray: () => normalizeCssArray,
|
|
147
|
+
toCamelCase: () => toCamelCase,
|
|
148
|
+
truncateText: () => truncateText
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/export/api/util.js
|
|
153
|
+
var util_exports = /* @__PURE__ */ __exportAll({
|
|
154
|
+
bind: () => bind,
|
|
155
|
+
clone: () => clone,
|
|
156
|
+
curry: () => curry,
|
|
157
|
+
defaults: () => defaults,
|
|
158
|
+
each: () => each,
|
|
159
|
+
extend: () => extend,
|
|
160
|
+
filter: () => filter,
|
|
161
|
+
indexOf: () => indexOf,
|
|
162
|
+
inherits: () => inherits,
|
|
163
|
+
isArray: () => isArray,
|
|
164
|
+
isFunction: () => isFunction,
|
|
165
|
+
isObject: () => isObject,
|
|
166
|
+
isString: () => isString,
|
|
167
|
+
map: () => map,
|
|
168
|
+
merge: () => merge,
|
|
169
|
+
reduce: () => reduce
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/export/api.js
|
|
174
|
+
/**
|
|
175
|
+
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
176
|
+
*/
|
|
177
|
+
function extendComponentModel(proto) {
|
|
178
|
+
var Model = ComponentModel.extend(proto);
|
|
179
|
+
ComponentModel.registerClass(Model);
|
|
180
|
+
return Model;
|
|
181
|
+
}
|
|
182
|
+
function extendComponentView(proto) {
|
|
183
|
+
var View = ComponentView.extend(proto);
|
|
184
|
+
ComponentView.registerClass(View);
|
|
185
|
+
return View;
|
|
186
|
+
}
|
|
187
|
+
function extendSeriesModel(proto) {
|
|
188
|
+
var Model = SeriesModel.extend(proto);
|
|
189
|
+
SeriesModel.registerClass(Model);
|
|
190
|
+
return Model;
|
|
191
|
+
}
|
|
192
|
+
function extendChartView(proto) {
|
|
193
|
+
var View = ChartView.extend(proto);
|
|
194
|
+
ChartView.registerClass(View);
|
|
195
|
+
return View;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
//#endregion
|
|
199
|
+
export { Axis, ChartView, ComponentModel, ComponentView, SeriesData as List, Model, PRIORITY, SeriesModel, color_exports as color, connect, dataTool, dependencies, disConnect, disconnect, dispose, env, extendChartView, extendComponentModel, extendComponentView, extendSeriesModel, format_exports as format, getCoordinateSystemDimensions, getInstanceByDom, getInstanceById, getMap, graphic_exports as graphic, helper_exports as helper, init, brushSingle as innerDrawElementOnCanvas, matrix_exports as matrix, number_exports as number, parseGeoJSON, parseGeoJSON as parseGeoJson, registerAction, registerCoordinateSystem, registerCustomSeries, registerLayout, registerLoading, registerLocale, registerMap, registerPostInit, registerPostUpdate, registerPreprocessor, registerProcessor, registerTheme, registerTransform, registerUpdateLifecycle, registerVisual, setCanvasCreator, setPlatformAPI, throttle, time_exports as time, use, util_exports as util, vector_exports as vector, version, util_exports$1 as zrUtil, zrender_exports as zrender };
|
|
200
|
+
//# sourceMappingURL=core-9w0g6EOI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-9w0g6EOI.js","names":["axisHelper.createScaleByModel","innerCreateTextStyle"],"sources":["../../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/export/api/helper.js","../../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/export/api/number.js","../../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/export/api/time.js","../../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/export/api/graphic.js","../../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/export/api/format.js","../../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/export/api/util.js","../../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/export/api.js"],"sourcesContent":["\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * This module exposes helper functions for developing extensions.\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport createSeriesData from '../../chart/helper/createSeriesData.js';\n// import createGraphFromNodeEdge from './chart/helper/createGraphFromNodeEdge.js';\nimport * as axisHelper from '../../coord/axisHelper.js';\nimport { AxisModelCommonMixin } from '../../coord/axisModelCommonMixin.js';\nimport Model from '../../model/Model.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport { enableDataStack, isDimensionStacked, getStackedDimension } from '../../data/helper/dataStackHelper.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createTextStyle as innerCreateTextStyle } from '../../label/labelStyle.js';\n/**\n * Create a multi dimension List structure from seriesModel.\n */\nexport function createList(seriesModel) {\n return createSeriesData(null, seriesModel);\n}\n// export function createGraph(seriesModel) {\n// let nodes = seriesModel.get('data');\n// let links = seriesModel.get('links');\n// return createGraphFromNodeEdge(nodes, links, seriesModel);\n// }\nexport { getLayoutRect };\nexport { createDimensions } from '../../data/helper/createDimensions.js';\nexport var dataStack = {\n isDimensionStacked: isDimensionStacked,\n enableDataStack: enableDataStack,\n getStackedDimension: getStackedDimension\n};\n/**\n * Create a symbol element with given symbol configuration: shape, x, y, width, height, color\n * @param {string} symbolDesc\n * @param {number} x\n * @param {number} y\n * @param {number} w\n * @param {number} h\n * @param {string} color\n */\nexport { createSymbol } from '../../util/symbol.js';\n/**\n * Create scale\n * @param {Array.<number>} dataExtent\n * @param {Object|module:echarts/Model} option If `optoin.type`\n * is secified, it can only be `'value'` currently.\n */\nexport function createScale(dataExtent, option) {\n var axisModel = option;\n if (!(option instanceof Model)) {\n axisModel = new Model(option);\n // FIXME\n // Currently AxisModelCommonMixin has nothing to do with the\n // the requirements of `axisHelper.createScaleByModel`. For\n // example the methods `getCategories` and `getOrdinalMeta`\n // are required for `'category'` axis, and ecModel is required\n // for `'time'` axis. But occasionally echarts-gl happened\n // to only use `'value'` axis.\n // zrUtil.mixin(axisModel, AxisModelCommonMixin);\n }\n var scale = axisHelper.createScaleByModel(axisModel);\n scale.setExtent(dataExtent[0], dataExtent[1]);\n axisHelper.niceScaleExtent(scale, axisModel);\n return scale;\n}\n/**\n * Mixin common methods to axis model,\n *\n * Include methods\n * `getFormattedLabels() => Array.<string>`\n * `getCategories() => Array.<string>`\n * `getMin(origin: boolean) => number`\n * `getMax(origin: boolean) => number`\n * `getNeedCrossZero() => boolean`\n */\nexport function mixinAxisModelCommonMethods(Model) {\n zrUtil.mixin(Model, AxisModelCommonMixin);\n}\nexport { getECData };\nexport { enableHoverEmphasis } from '../../util/states.js';\nexport function createTextStyle(textStyleModel, opts) {\n opts = opts || {};\n return innerCreateTextStyle(textStyleModel, null, null, opts.state !== 'normal');\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport { linearMap, round, asc, getPrecision, getPrecisionSafe, getPixelPrecision, getPercentWithPrecision, parsePercent, MAX_SAFE_INTEGER, remRadian, isRadianAroundZero, parseDate, quantity, quantityExponent, nice, quantile, reformIntervals, isNumeric, numericToNumber } from '../../util/number.js';","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport { parseDate as parse } from '../../util/number.js';\nexport { format, roundTime } from '../../util/time.js';","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport { extendShape, extendPath, makePath, makeImage, mergePath, resizePath, createIcon, updateProps, initProps, getTransform, clipPointsByRect, clipRectByRect, registerShape, getShapeClass, Group, Image, Text, Circle, Ellipse, Sector, Ring, Polygon, Polyline, Rect, Line, BezierCurve, Arc, IncrementalDisplayable, CompoundPath, LinearGradient, RadialGradient, BoundingRect } from '../../util/graphic.js';","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport { addCommas, toCamelCase, normalizeCssArray, encodeHTML, formatTpl, getTooltipMarker, formatTime, capitalFirst, truncateText, getTextRect } from '../../util/format.js';","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport { map, each, indexOf, inherits, reduce, filter, bind, curry, isArray, isString, isObject, isFunction, extend, defaults, clone, merge } from 'zrender/lib/core/util.js';","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// These APIs are for more advanced usages\n// For example extend charts and components, creating graphic elements, formatting.\nimport ComponentModel from '../model/Component.js';\nimport ComponentView from '../view/Component.js';\nimport SeriesModel from '../model/Series.js';\nimport ChartView from '../view/Chart.js';\nimport SeriesData from '../data/SeriesData.js';\nimport * as zrender_1 from 'zrender/lib/zrender.js';\nexport { zrender_1 as zrender };\nimport * as matrix_1 from 'zrender/lib/core/matrix.js';\nexport { matrix_1 as matrix };\nimport * as vector_1 from 'zrender/lib/core/vector.js';\nexport { vector_1 as vector };\nimport * as zrUtil_1 from 'zrender/lib/core/util.js';\nexport { zrUtil_1 as zrUtil };\nimport * as color_1 from 'zrender/lib/tool/color.js';\nexport { color_1 as color };\nexport { throttle } from '../util/throttle.js';\nimport * as helper_1 from './api/helper.js';\nexport { helper_1 as helper };\nexport { use } from '../extension.js';\nexport { setPlatformAPI } from 'zrender/lib/core/platform.js';\n// --------------------- Helper Methods ---------------------\nexport { default as parseGeoJSON } from '../coord/geo/parseGeoJson.js';\nexport { default as parseGeoJson } from '../coord/geo/parseGeoJson.js';\nimport * as number_1 from './api/number.js';\nexport { number_1 as number };\nimport * as time_1 from './api/time.js';\nexport { time_1 as time };\nimport * as graphic_1 from './api/graphic.js';\nexport { graphic_1 as graphic };\nimport * as format_1 from './api/format.js';\nexport { format_1 as format };\nimport * as util_1 from './api/util.js';\nexport { util_1 as util };\nexport { default as env } from 'zrender/lib/core/env.js';\n// --------------------- Export for Extension Usage ---------------------\n// export {SeriesData};\nexport { SeriesData as List }; // TODO: Compatitable with exists echarts-gl code\nexport { default as Model } from '../model/Model.js';\nexport { default as Axis } from '../coord/Axis.js';\nexport { ComponentModel, ComponentView, SeriesModel, ChartView };\n// Only for GL\nexport { brushSingle as innerDrawElementOnCanvas } from 'zrender/lib/canvas/graphic.js';\n// --------------------- Deprecated Extension Methods ---------------------\n// Should use `ComponentModel.extend` or `class XXXX extend ComponentModel` to create class.\n// Then use `registerComponentModel` in `install` parameter when `use` this extension. For example:\n// class Bar3DModel extends ComponentModel {}\n// export function install(registers) { registers.registerComponentModel(Bar3DModel); }\n// echarts.use(install);\nexport function extendComponentModel(proto) {\n var Model = ComponentModel.extend(proto);\n ComponentModel.registerClass(Model);\n return Model;\n}\nexport function extendComponentView(proto) {\n var View = ComponentView.extend(proto);\n ComponentView.registerClass(View);\n return View;\n}\nexport function extendSeriesModel(proto) {\n var Model = SeriesModel.extend(proto);\n SeriesModel.registerClass(Model);\n return Model;\n}\nexport function extendChartView(proto) {\n var View = ChartView.extend(proto);\n ChartView.registerClass(View);\n return View;\n}"],"x_google_ignoreList":[0,1,2,3,4,5,6],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,SAAgB,WAAW,aAAa;AACtC,QAAO,iBAAiB,MAAM,YAAY;;AAS5C,IAAW,YAAY;CACD;CACH;CACI;CACtB;;;;;;;AAiBD,SAAgB,YAAY,YAAY,QAAQ;CAC9C,IAAI,YAAY;AAChB,KAAI,EAAE,kBAAkB,OACtB,aAAY,IAAI,MAAM,OAAO;CAU/B,IAAI,QAAQA,mBAA8B,UAAU;AACpD,OAAM,UAAU,WAAW,IAAI,WAAW,GAAG;AAC7C,iBAA2B,OAAO,UAAU;AAC5C,QAAO;;;;;;;;;;;;AAYT,SAAgB,4BAA4B,OAAO;AACjD,OAAa,OAAO,qBAAqB;;AAI3C,SAAgB,gBAAgB,gBAAgB,MAAM;AACpD,QAAO,QAAQ,EAAE;AACjB,QAAOC,kBAAqB,gBAAgB,MAAM,MAAM,KAAK,UAAU,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AMhClF,SAAgB,qBAAqB,OAAO;CAC1C,IAAI,QAAQ,eAAe,OAAO,MAAM;AACxC,gBAAe,cAAc,MAAM;AACnC,QAAO;;AAET,SAAgB,oBAAoB,OAAO;CACzC,IAAI,OAAO,cAAc,OAAO,MAAM;AACtC,eAAc,cAAc,KAAK;AACjC,QAAO;;AAET,SAAgB,kBAAkB,OAAO;CACvC,IAAI,QAAQ,YAAY,OAAO,MAAM;AACrC,aAAY,cAAc,MAAM;AAChC,QAAO;;AAET,SAAgB,gBAAgB,OAAO;CACrC,IAAI,OAAO,UAAU,OAAO,MAAM;AAClC,WAAU,cAAc,KAAK;AAC7B,QAAO"}
|
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import { An as isArray, Ln as isObject, Nn as isFunction, Sn as each, Wn as map, Zn as retrieve, bn as defaults, vn as createHashMap, wn as extend, yn as curry, zn as isString } from "./graphic-CPJ2K90a.js";
|
|
2
|
+
import { An as CtorInt32Array, Di as normalizeToArray, Dn as createDimNameMap, En as SeriesDataSchema, Fn as createSourceFromSeriesDataOption, In as isSourceInstance, Ln as BE_ORDINAL, Mn as SeriesDimensionDefine, Nn as getDimensionTypeByAxis, On as ensureSourceDimNameMap, Rn as guessOrdinal, Tn as SeriesData, Un as SOURCE_FORMAT_ORIGINAL, Wn as VISUAL_DIMENSIONS, gn as enableDataStack, hi as SINGLE_REFERRING, kn as shouldOmitUnusedDimensions, yi as getDataItemValue, yn as CoordinateSystemManager, zn as makeSeriesEncodeForAxisCoordSys } from "./parseGeoJson-BlBe5Vig.js";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/data/helper/createDimensions.js
|
|
5
|
+
/**
|
|
6
|
+
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* For outside usage compat (like echarts-gl are using it).
|
|
10
|
+
*/
|
|
11
|
+
function createDimensions(source, opt) {
|
|
12
|
+
return prepareSeriesDataSchema(source, opt).dimensions;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* This method builds the relationship between:
|
|
16
|
+
* + "what the coord sys or series requires (see `coordDimensions`)",
|
|
17
|
+
* + "what the user defines (in `encode` and `dimensions`, see `opt.dimensionsDefine` and `opt.encodeDefine`)"
|
|
18
|
+
* + "what the data source provids (see `source`)".
|
|
19
|
+
*
|
|
20
|
+
* Some guess strategy will be adapted if user does not define something.
|
|
21
|
+
* If no 'value' dimension specified, the first no-named dimension will be
|
|
22
|
+
* named as 'value'.
|
|
23
|
+
*
|
|
24
|
+
* @return The results are always sorted by `storeDimIndex` asc.
|
|
25
|
+
*/
|
|
26
|
+
function prepareSeriesDataSchema(source, opt) {
|
|
27
|
+
if (!isSourceInstance(source)) source = createSourceFromSeriesDataOption(source);
|
|
28
|
+
opt = opt || {};
|
|
29
|
+
var sysDims = opt.coordDimensions || [];
|
|
30
|
+
var dimsDef = opt.dimensionsDefine || source.dimensionsDefine || [];
|
|
31
|
+
var coordDimNameMap = createHashMap();
|
|
32
|
+
var resultList = [];
|
|
33
|
+
var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimensionsCount);
|
|
34
|
+
var omitUnusedDimensions = opt.canOmitUnusedDimensions && shouldOmitUnusedDimensions(dimCount);
|
|
35
|
+
var isUsingSourceDimensionsDef = dimsDef === source.dimensionsDefine;
|
|
36
|
+
var dataDimNameMap = isUsingSourceDimensionsDef ? ensureSourceDimNameMap(source) : createDimNameMap(dimsDef);
|
|
37
|
+
var encodeDef = opt.encodeDefine;
|
|
38
|
+
if (!encodeDef && opt.encodeDefaulter) encodeDef = opt.encodeDefaulter(source, dimCount);
|
|
39
|
+
var encodeDefMap = createHashMap(encodeDef);
|
|
40
|
+
var indicesMap = new CtorInt32Array(dimCount);
|
|
41
|
+
for (var i = 0; i < indicesMap.length; i++) indicesMap[i] = -1;
|
|
42
|
+
function getResultItem(dimIdx) {
|
|
43
|
+
var idx = indicesMap[dimIdx];
|
|
44
|
+
if (idx < 0) {
|
|
45
|
+
var dimDefItemRaw = dimsDef[dimIdx];
|
|
46
|
+
var dimDefItem = isObject(dimDefItemRaw) ? dimDefItemRaw : { name: dimDefItemRaw };
|
|
47
|
+
var resultItem = new SeriesDimensionDefine();
|
|
48
|
+
var userDimName = dimDefItem.name;
|
|
49
|
+
if (userDimName != null && dataDimNameMap.get(userDimName) != null) resultItem.name = resultItem.displayName = userDimName;
|
|
50
|
+
dimDefItem.type != null && (resultItem.type = dimDefItem.type);
|
|
51
|
+
dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);
|
|
52
|
+
indicesMap[dimIdx] = resultList.length;
|
|
53
|
+
resultItem.storeDimIndex = dimIdx;
|
|
54
|
+
resultList.push(resultItem);
|
|
55
|
+
return resultItem;
|
|
56
|
+
}
|
|
57
|
+
return resultList[idx];
|
|
58
|
+
}
|
|
59
|
+
if (!omitUnusedDimensions) for (var i = 0; i < dimCount; i++) getResultItem(i);
|
|
60
|
+
encodeDefMap.each(function(dataDimsRaw, coordDim) {
|
|
61
|
+
var dataDims = normalizeToArray(dataDimsRaw).slice();
|
|
62
|
+
if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) {
|
|
63
|
+
encodeDefMap.set(coordDim, false);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
var validDataDims = encodeDefMap.set(coordDim, []);
|
|
67
|
+
each(dataDims, function(resultDimIdxOrName, idx) {
|
|
68
|
+
var resultDimIdx = isString(resultDimIdxOrName) ? dataDimNameMap.get(resultDimIdxOrName) : resultDimIdxOrName;
|
|
69
|
+
if (resultDimIdx != null && resultDimIdx < dimCount) {
|
|
70
|
+
validDataDims[idx] = resultDimIdx;
|
|
71
|
+
applyDim(getResultItem(resultDimIdx), coordDim, idx);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
var availDimIdx = 0;
|
|
76
|
+
each(sysDims, function(sysDimItemRaw) {
|
|
77
|
+
var coordDim;
|
|
78
|
+
var sysDimItemDimsDef;
|
|
79
|
+
var sysDimItemOtherDims;
|
|
80
|
+
var sysDimItem;
|
|
81
|
+
if (isString(sysDimItemRaw)) {
|
|
82
|
+
coordDim = sysDimItemRaw;
|
|
83
|
+
sysDimItem = {};
|
|
84
|
+
} else {
|
|
85
|
+
sysDimItem = sysDimItemRaw;
|
|
86
|
+
coordDim = sysDimItem.name;
|
|
87
|
+
var ordinalMeta = sysDimItem.ordinalMeta;
|
|
88
|
+
sysDimItem.ordinalMeta = null;
|
|
89
|
+
sysDimItem = extend({}, sysDimItem);
|
|
90
|
+
sysDimItem.ordinalMeta = ordinalMeta;
|
|
91
|
+
sysDimItemDimsDef = sysDimItem.dimsDef;
|
|
92
|
+
sysDimItemOtherDims = sysDimItem.otherDims;
|
|
93
|
+
sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex = sysDimItem.dimsDef = sysDimItem.otherDims = null;
|
|
94
|
+
}
|
|
95
|
+
var dataDims = encodeDefMap.get(coordDim);
|
|
96
|
+
if (dataDims === false) return;
|
|
97
|
+
dataDims = normalizeToArray(dataDims);
|
|
98
|
+
if (!dataDims.length) for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {
|
|
99
|
+
while (availDimIdx < dimCount && getResultItem(availDimIdx).coordDim != null) availDimIdx++;
|
|
100
|
+
availDimIdx < dimCount && dataDims.push(availDimIdx++);
|
|
101
|
+
}
|
|
102
|
+
each(dataDims, function(resultDimIdx, coordDimIndex) {
|
|
103
|
+
var resultItem = getResultItem(resultDimIdx);
|
|
104
|
+
if (isUsingSourceDimensionsDef && sysDimItem.type != null) resultItem.type = sysDimItem.type;
|
|
105
|
+
applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);
|
|
106
|
+
if (resultItem.name == null && sysDimItemDimsDef) {
|
|
107
|
+
var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];
|
|
108
|
+
!isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = { name: sysDimItemDimsDefItem });
|
|
109
|
+
resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;
|
|
110
|
+
resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;
|
|
111
|
+
}
|
|
112
|
+
sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
function applyDim(resultItem, coordDim, coordDimIndex) {
|
|
116
|
+
if (VISUAL_DIMENSIONS.get(coordDim) != null) resultItem.otherDims[coordDim] = coordDimIndex;
|
|
117
|
+
else {
|
|
118
|
+
resultItem.coordDim = coordDim;
|
|
119
|
+
resultItem.coordDimIndex = coordDimIndex;
|
|
120
|
+
coordDimNameMap.set(coordDim, true);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
var generateCoord = opt.generateCoord;
|
|
124
|
+
var generateCoordCount = opt.generateCoordCount;
|
|
125
|
+
var fromZero = generateCoordCount != null;
|
|
126
|
+
generateCoordCount = generateCoord ? generateCoordCount || 1 : 0;
|
|
127
|
+
var extra = generateCoord || "value";
|
|
128
|
+
function ifNoNameFillWithCoordName(resultItem) {
|
|
129
|
+
if (resultItem.name == null) resultItem.name = resultItem.coordDim;
|
|
130
|
+
}
|
|
131
|
+
if (!omitUnusedDimensions) for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {
|
|
132
|
+
var resultItem = getResultItem(resultDimIdx);
|
|
133
|
+
if (resultItem.coordDim == null) {
|
|
134
|
+
resultItem.coordDim = genCoordDimName(extra, coordDimNameMap, fromZero);
|
|
135
|
+
resultItem.coordDimIndex = 0;
|
|
136
|
+
if (!generateCoord || generateCoordCount <= 0) resultItem.isExtraCoord = true;
|
|
137
|
+
generateCoordCount--;
|
|
138
|
+
}
|
|
139
|
+
ifNoNameFillWithCoordName(resultItem);
|
|
140
|
+
if (resultItem.type == null && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must || resultItem.isExtraCoord && (resultItem.otherDims.itemName != null || resultItem.otherDims.seriesName != null))) resultItem.type = "ordinal";
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
each(resultList, function(resultItem) {
|
|
144
|
+
ifNoNameFillWithCoordName(resultItem);
|
|
145
|
+
});
|
|
146
|
+
resultList.sort(function(item0, item1) {
|
|
147
|
+
return item0.storeDimIndex - item1.storeDimIndex;
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
removeDuplication(resultList);
|
|
151
|
+
return new SeriesDataSchema({
|
|
152
|
+
source,
|
|
153
|
+
dimensions: resultList,
|
|
154
|
+
fullDimensionCount: dimCount,
|
|
155
|
+
dimensionOmitted: omitUnusedDimensions
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
function removeDuplication(result) {
|
|
159
|
+
var duplicationMap = createHashMap();
|
|
160
|
+
for (var i = 0; i < result.length; i++) {
|
|
161
|
+
var dim = result[i];
|
|
162
|
+
var dimOriginalName = dim.name;
|
|
163
|
+
var count = duplicationMap.get(dimOriginalName) || 0;
|
|
164
|
+
if (count > 0) dim.name = dimOriginalName + (count - 1);
|
|
165
|
+
count++;
|
|
166
|
+
duplicationMap.set(dimOriginalName, count);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function getDimCount(source, sysDims, dimsDef, optDimCount) {
|
|
170
|
+
var dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);
|
|
171
|
+
each(sysDims, function(sysDimItem) {
|
|
172
|
+
var sysDimItemDimsDef;
|
|
173
|
+
if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) dimCount = Math.max(dimCount, sysDimItemDimsDef.length);
|
|
174
|
+
});
|
|
175
|
+
return dimCount;
|
|
176
|
+
}
|
|
177
|
+
function genCoordDimName(name, map, fromZero) {
|
|
178
|
+
if (fromZero || map.hasKey(name)) {
|
|
179
|
+
var i = 0;
|
|
180
|
+
while (map.hasKey(name + i)) i++;
|
|
181
|
+
name += i;
|
|
182
|
+
}
|
|
183
|
+
map.set(name, true);
|
|
184
|
+
return name;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
//#endregion
|
|
188
|
+
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/model/referHelper.js
|
|
189
|
+
/**
|
|
190
|
+
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
191
|
+
*/
|
|
192
|
+
/**
|
|
193
|
+
* Helper for model references.
|
|
194
|
+
* There are many manners to refer axis/coordSys.
|
|
195
|
+
*/
|
|
196
|
+
/**
|
|
197
|
+
* @class
|
|
198
|
+
* For example:
|
|
199
|
+
* {
|
|
200
|
+
* coordSysName: 'cartesian2d',
|
|
201
|
+
* coordSysDims: ['x', 'y', ...],
|
|
202
|
+
* axisMap: HashMap({
|
|
203
|
+
* x: xAxisModel,
|
|
204
|
+
* y: yAxisModel
|
|
205
|
+
* }),
|
|
206
|
+
* categoryAxisMap: HashMap({
|
|
207
|
+
* x: xAxisModel,
|
|
208
|
+
* y: undefined
|
|
209
|
+
* }),
|
|
210
|
+
* // The index of the first category axis in `coordSysDims`.
|
|
211
|
+
* // `null/undefined` means no category axis exists.
|
|
212
|
+
* firstCategoryDimIndex: 1,
|
|
213
|
+
* // To replace user specified encode.
|
|
214
|
+
* }
|
|
215
|
+
*/
|
|
216
|
+
var CoordSysInfo = function() {
|
|
217
|
+
function CoordSysInfo(coordSysName) {
|
|
218
|
+
this.coordSysDims = [];
|
|
219
|
+
this.axisMap = createHashMap();
|
|
220
|
+
this.categoryAxisMap = createHashMap();
|
|
221
|
+
this.coordSysName = coordSysName;
|
|
222
|
+
}
|
|
223
|
+
return CoordSysInfo;
|
|
224
|
+
}();
|
|
225
|
+
function getCoordSysInfoBySeries(seriesModel) {
|
|
226
|
+
var coordSysName = seriesModel.get("coordinateSystem");
|
|
227
|
+
var result = new CoordSysInfo(coordSysName);
|
|
228
|
+
var fetch = fetchers[coordSysName];
|
|
229
|
+
if (fetch) {
|
|
230
|
+
fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);
|
|
231
|
+
return result;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
var fetchers = {
|
|
235
|
+
cartesian2d: function(seriesModel, result, axisMap, categoryAxisMap) {
|
|
236
|
+
var xAxisModel = seriesModel.getReferringComponents("xAxis", SINGLE_REFERRING).models[0];
|
|
237
|
+
var yAxisModel = seriesModel.getReferringComponents("yAxis", SINGLE_REFERRING).models[0];
|
|
238
|
+
if (process.env.NODE_ENV !== "production") {
|
|
239
|
+
if (!xAxisModel) throw new Error("xAxis \"" + retrieve(seriesModel.get("xAxisIndex"), seriesModel.get("xAxisId"), 0) + "\" not found");
|
|
240
|
+
if (!yAxisModel) throw new Error("yAxis \"" + retrieve(seriesModel.get("xAxisIndex"), seriesModel.get("yAxisId"), 0) + "\" not found");
|
|
241
|
+
}
|
|
242
|
+
result.coordSysDims = ["x", "y"];
|
|
243
|
+
axisMap.set("x", xAxisModel);
|
|
244
|
+
axisMap.set("y", yAxisModel);
|
|
245
|
+
if (isCategory(xAxisModel)) {
|
|
246
|
+
categoryAxisMap.set("x", xAxisModel);
|
|
247
|
+
result.firstCategoryDimIndex = 0;
|
|
248
|
+
}
|
|
249
|
+
if (isCategory(yAxisModel)) {
|
|
250
|
+
categoryAxisMap.set("y", yAxisModel);
|
|
251
|
+
result.firstCategoryDimIndex ??= 1;
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
singleAxis: function(seriesModel, result, axisMap, categoryAxisMap) {
|
|
255
|
+
var singleAxisModel = seriesModel.getReferringComponents("singleAxis", SINGLE_REFERRING).models[0];
|
|
256
|
+
if (process.env.NODE_ENV !== "production") {
|
|
257
|
+
if (!singleAxisModel) throw new Error("singleAxis should be specified.");
|
|
258
|
+
}
|
|
259
|
+
result.coordSysDims = ["single"];
|
|
260
|
+
axisMap.set("single", singleAxisModel);
|
|
261
|
+
if (isCategory(singleAxisModel)) {
|
|
262
|
+
categoryAxisMap.set("single", singleAxisModel);
|
|
263
|
+
result.firstCategoryDimIndex = 0;
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
polar: function(seriesModel, result, axisMap, categoryAxisMap) {
|
|
267
|
+
var polarModel = seriesModel.getReferringComponents("polar", SINGLE_REFERRING).models[0];
|
|
268
|
+
var radiusAxisModel = polarModel.findAxisModel("radiusAxis");
|
|
269
|
+
var angleAxisModel = polarModel.findAxisModel("angleAxis");
|
|
270
|
+
if (process.env.NODE_ENV !== "production") {
|
|
271
|
+
if (!angleAxisModel) throw new Error("angleAxis option not found");
|
|
272
|
+
if (!radiusAxisModel) throw new Error("radiusAxis option not found");
|
|
273
|
+
}
|
|
274
|
+
result.coordSysDims = ["radius", "angle"];
|
|
275
|
+
axisMap.set("radius", radiusAxisModel);
|
|
276
|
+
axisMap.set("angle", angleAxisModel);
|
|
277
|
+
if (isCategory(radiusAxisModel)) {
|
|
278
|
+
categoryAxisMap.set("radius", radiusAxisModel);
|
|
279
|
+
result.firstCategoryDimIndex = 0;
|
|
280
|
+
}
|
|
281
|
+
if (isCategory(angleAxisModel)) {
|
|
282
|
+
categoryAxisMap.set("angle", angleAxisModel);
|
|
283
|
+
result.firstCategoryDimIndex ??= 1;
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
geo: function(seriesModel, result, axisMap, categoryAxisMap) {
|
|
287
|
+
result.coordSysDims = ["lng", "lat"];
|
|
288
|
+
},
|
|
289
|
+
parallel: function(seriesModel, result, axisMap, categoryAxisMap) {
|
|
290
|
+
var ecModel = seriesModel.ecModel;
|
|
291
|
+
var parallelModel = ecModel.getComponent("parallel", seriesModel.get("parallelIndex"));
|
|
292
|
+
var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice();
|
|
293
|
+
each(parallelModel.parallelAxisIndex, function(axisIndex, index) {
|
|
294
|
+
var axisModel = ecModel.getComponent("parallelAxis", axisIndex);
|
|
295
|
+
var axisDim = coordSysDims[index];
|
|
296
|
+
axisMap.set(axisDim, axisModel);
|
|
297
|
+
if (isCategory(axisModel)) {
|
|
298
|
+
categoryAxisMap.set(axisDim, axisModel);
|
|
299
|
+
if (result.firstCategoryDimIndex == null) result.firstCategoryDimIndex = index;
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
},
|
|
303
|
+
matrix: function(seriesModel, result, axisMap, categoryAxisMap) {
|
|
304
|
+
var matrixModel = seriesModel.getReferringComponents("matrix", SINGLE_REFERRING).models[0];
|
|
305
|
+
if (process.env.NODE_ENV !== "production") {
|
|
306
|
+
if (!matrixModel) throw new Error("matrix coordinate system should be specified.");
|
|
307
|
+
}
|
|
308
|
+
result.coordSysDims = ["x", "y"];
|
|
309
|
+
var xModel = matrixModel.getDimensionModel("x");
|
|
310
|
+
var yModel = matrixModel.getDimensionModel("y");
|
|
311
|
+
axisMap.set("x", xModel);
|
|
312
|
+
axisMap.set("y", yModel);
|
|
313
|
+
categoryAxisMap.set("x", xModel);
|
|
314
|
+
categoryAxisMap.set("y", yModel);
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
function isCategory(axisModel) {
|
|
318
|
+
return axisModel.get("type") === "category";
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
//#endregion
|
|
322
|
+
//#region ../../node_modules/.bun/echarts@6.0.0/node_modules/echarts/lib/chart/helper/createSeriesData.js
|
|
323
|
+
/**
|
|
324
|
+
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
325
|
+
*/
|
|
326
|
+
function getCoordSysDimDefs(seriesModel, coordSysInfo) {
|
|
327
|
+
var coordSysName = seriesModel.get("coordinateSystem");
|
|
328
|
+
var registeredCoordSys = CoordinateSystemManager.get(coordSysName);
|
|
329
|
+
var coordSysDimDefs;
|
|
330
|
+
if (coordSysInfo && coordSysInfo.coordSysDims) coordSysDimDefs = map(coordSysInfo.coordSysDims, function(dim) {
|
|
331
|
+
var dimInfo = { name: dim };
|
|
332
|
+
var axisModel = coordSysInfo.axisMap.get(dim);
|
|
333
|
+
if (axisModel) dimInfo.type = getDimensionTypeByAxis(axisModel.get("type"));
|
|
334
|
+
return dimInfo;
|
|
335
|
+
});
|
|
336
|
+
if (!coordSysDimDefs) coordSysDimDefs = registeredCoordSys && (registeredCoordSys.getDimensionsInfo ? registeredCoordSys.getDimensionsInfo() : registeredCoordSys.dimensions.slice()) || ["x", "y"];
|
|
337
|
+
return coordSysDimDefs;
|
|
338
|
+
}
|
|
339
|
+
function injectOrdinalMeta(dimInfoList, createInvertedIndices, coordSysInfo) {
|
|
340
|
+
var firstCategoryDimIndex;
|
|
341
|
+
var hasNameEncode;
|
|
342
|
+
coordSysInfo && each(dimInfoList, function(dimInfo, dimIndex) {
|
|
343
|
+
var coordDim = dimInfo.coordDim;
|
|
344
|
+
var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);
|
|
345
|
+
if (categoryAxisModel) {
|
|
346
|
+
if (firstCategoryDimIndex == null) firstCategoryDimIndex = dimIndex;
|
|
347
|
+
dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();
|
|
348
|
+
if (createInvertedIndices) dimInfo.createInvertedIndices = true;
|
|
349
|
+
}
|
|
350
|
+
if (dimInfo.otherDims.itemName != null) hasNameEncode = true;
|
|
351
|
+
});
|
|
352
|
+
if (!hasNameEncode && firstCategoryDimIndex != null) dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;
|
|
353
|
+
return firstCategoryDimIndex;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Caution: there are side effects to `sourceManager` in this method.
|
|
357
|
+
* Should better only be called in `Series['getInitialData']`.
|
|
358
|
+
*/
|
|
359
|
+
function createSeriesData(sourceRaw, seriesModel, opt) {
|
|
360
|
+
opt = opt || {};
|
|
361
|
+
var sourceManager = seriesModel.getSourceManager();
|
|
362
|
+
var source;
|
|
363
|
+
var isOriginalSource = false;
|
|
364
|
+
if (sourceRaw) {
|
|
365
|
+
isOriginalSource = true;
|
|
366
|
+
source = createSourceFromSeriesDataOption(sourceRaw);
|
|
367
|
+
} else {
|
|
368
|
+
source = sourceManager.getSource();
|
|
369
|
+
isOriginalSource = source.sourceFormat === SOURCE_FORMAT_ORIGINAL;
|
|
370
|
+
}
|
|
371
|
+
var coordSysInfo = getCoordSysInfoBySeries(seriesModel);
|
|
372
|
+
var coordSysDimDefs = getCoordSysDimDefs(seriesModel, coordSysInfo);
|
|
373
|
+
var useEncodeDefaulter = opt.useEncodeDefaulter;
|
|
374
|
+
var encodeDefaulter = isFunction(useEncodeDefaulter) ? useEncodeDefaulter : useEncodeDefaulter ? curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel) : null;
|
|
375
|
+
var createDimensionOptions = {
|
|
376
|
+
coordDimensions: coordSysDimDefs,
|
|
377
|
+
generateCoord: opt.generateCoord,
|
|
378
|
+
encodeDefine: seriesModel.getEncode(),
|
|
379
|
+
encodeDefaulter,
|
|
380
|
+
canOmitUnusedDimensions: !isOriginalSource
|
|
381
|
+
};
|
|
382
|
+
var schema = prepareSeriesDataSchema(source, createDimensionOptions);
|
|
383
|
+
var firstCategoryDimIndex = injectOrdinalMeta(schema.dimensions, opt.createInvertedIndices, coordSysInfo);
|
|
384
|
+
var store = !isOriginalSource ? sourceManager.getSharedDataStore(schema) : null;
|
|
385
|
+
var stackCalculationInfo = enableDataStack(seriesModel, {
|
|
386
|
+
schema,
|
|
387
|
+
store
|
|
388
|
+
});
|
|
389
|
+
var data = new SeriesData(schema, seriesModel);
|
|
390
|
+
data.setCalculationInfo(stackCalculationInfo);
|
|
391
|
+
var dimValueGetter = firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source) ? function(itemOpt, dimName, dataIndex, dimIndex) {
|
|
392
|
+
return dimIndex === firstCategoryDimIndex ? dataIndex : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);
|
|
393
|
+
} : null;
|
|
394
|
+
data.hasItemOption = false;
|
|
395
|
+
data.initData(isOriginalSource ? source : store, null, dimValueGetter);
|
|
396
|
+
return data;
|
|
397
|
+
}
|
|
398
|
+
function isNeedCompleteOrdinalData(source) {
|
|
399
|
+
if (source.sourceFormat === "original") {
|
|
400
|
+
var sampleItem = firstDataNotNull(source.data || []);
|
|
401
|
+
return !isArray(getDataItemValue(sampleItem));
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
function firstDataNotNull(arr) {
|
|
405
|
+
var i = 0;
|
|
406
|
+
while (i < arr.length && arr[i] == null) i++;
|
|
407
|
+
return arr[i];
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
//#endregion
|
|
411
|
+
export { createDimensions as n, prepareSeriesDataSchema as r, createSeriesData as t };
|
|
412
|
+
//# sourceMappingURL=createSeriesData-DOHScdgk.js.map
|