tvcharts 0.6.14 → 0.6.16
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/echarts.js +72 -20
- package/dist/echarts.js.map +3 -3
- package/lib/chart/labels/LabelsView.js +16 -16
- package/lib/chart/labels/install.js +4 -3
- package/lib/chart/labels/labelsLayout.js +102 -0
- package/lib/chart/labels/labelsVisual.js +18 -10
- package/lib/chart/linesPlot/linesPlotLayout.js +4 -4
- package/lib/chart/scatter/ScatterSeries.js +0 -2
- package/lib/coord/scaleRawExtentInfo.js +6 -0
- package/lib/util/symbolSize.js +2 -2
- package/package.json +1 -1
- package/types/dist/echarts.d.ts +3 -0
- package/types/dist/shared.d.ts +3 -0
- package/types/src/chart/labels/LabelsSeries.d.ts +2 -0
- package/types/src/chart/labels/LabelsView.d.ts +2 -2
- package/types/src/chart/labels/labelsLayout.d.ts +3 -0
- package/types/src/chart/labels/labelsVisual.d.ts +2 -2
- package/types/src/coord/scaleRawExtentInfo.d.ts +2 -0
- package/types/src/util/types.d.ts +1 -0
package/dist/echarts.js
CHANGED
|
@@ -11871,6 +11871,7 @@ function getSeriesPointData(ecModel, payload = {}) {
|
|
|
11871
11871
|
diffValue
|
|
11872
11872
|
};
|
|
11873
11873
|
});
|
|
11874
|
+
console.log("%c [ seriesPointData ]-835", "font-size:13px; background:pink; color:#bf2c9f;", seriesPointData);
|
|
11874
11875
|
return seriesPointData;
|
|
11875
11876
|
}
|
|
11876
11877
|
function enableHoverEmphasis(el, focus, blurScope) {
|
|
@@ -28574,6 +28575,12 @@ var ScaleRawExtentInfo = class {
|
|
|
28574
28575
|
freeze() {
|
|
28575
28576
|
this.frozen = true;
|
|
28576
28577
|
}
|
|
28578
|
+
getDataRange() {
|
|
28579
|
+
return [this._dataMin, this._dataMax];
|
|
28580
|
+
}
|
|
28581
|
+
getBoundaryGapInner() {
|
|
28582
|
+
return this._boundaryGapInner;
|
|
28583
|
+
}
|
|
28577
28584
|
};
|
|
28578
28585
|
var DETERMINED_MIN_MAX_ATTR = {min: "_determinedMin", max: "_determinedMax"};
|
|
28579
28586
|
var DATA_MIN_MAX_ATTR = {min: "_dataMin", max: "_dataMax"};
|
|
@@ -54926,7 +54933,6 @@ var linesPlotLayout = {
|
|
|
54926
54933
|
return;
|
|
54927
54934
|
}
|
|
54928
54935
|
const data = seriesModel.getData();
|
|
54929
|
-
const pipelineContext = seriesModel.pipelineContext;
|
|
54930
54936
|
const dims = map(coordSys.dimensions, function(dim) {
|
|
54931
54937
|
return data.mapDimension(dim);
|
|
54932
54938
|
}).slice(0, 2);
|
|
@@ -54938,9 +54944,6 @@ var linesPlotLayout = {
|
|
|
54938
54944
|
const isSingle = seriesModel.get("histogramVisible") || seriesModel.get("barVisible");
|
|
54939
54945
|
const symbolByStep = seriesModel.get("symbolByStep");
|
|
54940
54946
|
const xOffset = seriesModel.get("offset") || 0;
|
|
54941
|
-
const symbolVisible = seriesModel.get("symbolVisible");
|
|
54942
|
-
const symbolSize = seriesModel.get("symbolSize");
|
|
54943
|
-
const globalSymbol = seriesModel.get("symbol");
|
|
54944
54947
|
return {
|
|
54945
54948
|
progress(params, lineData) {
|
|
54946
54949
|
const segCount = params.end - params.start;
|
|
@@ -55082,10 +55085,10 @@ LabelsSeriesModel.defaultOption = {
|
|
|
55082
55085
|
var LabelsSeries_default = LabelsSeriesModel;
|
|
55083
55086
|
|
|
55084
55087
|
// src/chart/labels/LabelsView.ts
|
|
55085
|
-
var
|
|
55088
|
+
var LabelsView2 = class extends Chart_default {
|
|
55086
55089
|
constructor() {
|
|
55087
55090
|
super(...arguments);
|
|
55088
|
-
this.type =
|
|
55091
|
+
this.type = LabelsView2.type;
|
|
55089
55092
|
}
|
|
55090
55093
|
render(seriesModel, ecModel, api2) {
|
|
55091
55094
|
const data = seriesModel.getData();
|
|
@@ -55152,9 +55155,9 @@ var ScatterView4 = class extends Chart_default {
|
|
|
55152
55155
|
dispose() {
|
|
55153
55156
|
}
|
|
55154
55157
|
};
|
|
55155
|
-
var
|
|
55156
|
-
|
|
55157
|
-
var LabelsView_default =
|
|
55158
|
+
var LabelsView = LabelsView2;
|
|
55159
|
+
LabelsView.type = "labels";
|
|
55160
|
+
var LabelsView_default = LabelsView;
|
|
55158
55161
|
|
|
55159
55162
|
// src/util/symbolSize.ts
|
|
55160
55163
|
var xCrossMapping = {
|
|
@@ -55270,7 +55273,7 @@ var symbolSizeMapping = {
|
|
|
55270
55273
|
};
|
|
55271
55274
|
function getSymbolSize2(type, size, width) {
|
|
55272
55275
|
const fn = symbolSizeMapping[type]?.[size];
|
|
55273
|
-
return fn ? fn(width) : {w:
|
|
55276
|
+
return fn ? fn(width) : {w: 1, h: 1};
|
|
55274
55277
|
}
|
|
55275
55278
|
var labelFontSizeMapping = {
|
|
55276
55279
|
huge: 22,
|
|
@@ -55304,7 +55307,7 @@ each(labelSymbols, function(type) {
|
|
|
55304
55307
|
var lineSymbols = ["xCross", "lCross"];
|
|
55305
55308
|
var padding = 10;
|
|
55306
55309
|
function changeLabelOffsetBySymbol(symbol, label, shape, oldOffset) {
|
|
55307
|
-
const [offsetX, offsetY] = [0, 0];
|
|
55310
|
+
const [offsetX, offsetY] = oldOffset ?? [0, 0];
|
|
55308
55311
|
switch (symbol) {
|
|
55309
55312
|
case "labelDown":
|
|
55310
55313
|
label.option.offset = [offsetX, offsetY - shape.triangleWidth / 2];
|
|
@@ -55332,12 +55335,12 @@ function changeLabelOffsetBySymbol(symbol, label, shape, oldOffset) {
|
|
|
55332
55335
|
break;
|
|
55333
55336
|
}
|
|
55334
55337
|
}
|
|
55335
|
-
var
|
|
55336
|
-
|
|
55337
|
-
performRawSeries: true,
|
|
55338
|
+
var LabelsVisual = {
|
|
55339
|
+
seriesType: "labels",
|
|
55338
55340
|
reset: function(seriesModel) {
|
|
55339
55341
|
const bandWidth = Math.max(1, Math.round(seriesModel.coordinateSystem.getAxesByScale("ordinal")[0].scale.barSpace * 0.8));
|
|
55340
55342
|
const data = seriesModel.getData();
|
|
55343
|
+
const location = seriesModel.get("location");
|
|
55341
55344
|
const symbolOptions = {};
|
|
55342
55345
|
for (let i = 0; i < SYMBOL_PROPS_WITH_CB2.length; i++) {
|
|
55343
55346
|
const symbolPropName = SYMBOL_PROPS_WITH_CB2[i];
|
|
@@ -55352,7 +55355,6 @@ var LabelsLayout = {
|
|
|
55352
55355
|
const itemModel = data2.getItemModel(idx);
|
|
55353
55356
|
let symbol = itemModel.getShallow("symbol");
|
|
55354
55357
|
let symbolSize = itemModel.getShallow("symbolSize");
|
|
55355
|
-
let symbolRotate = itemModel.getShallow("symbolRotate");
|
|
55356
55358
|
let symbolOffset = itemModel.getShallow("symbolOffset");
|
|
55357
55359
|
let symbolShape = {};
|
|
55358
55360
|
const symbolKeepAspect = itemModel.getShallow("symbolKeepAspect");
|
|
@@ -55364,8 +55366,14 @@ var LabelsLayout = {
|
|
|
55364
55366
|
const text = labelModel.get("formatter");
|
|
55365
55367
|
const isLabel = labelSymbolByType[symbol];
|
|
55366
55368
|
const labelShow = labelModel.get("show");
|
|
55367
|
-
|
|
55368
|
-
|
|
55369
|
+
if (location === "top") {
|
|
55370
|
+
labelModel.option.position = "bottom";
|
|
55371
|
+
} else {
|
|
55372
|
+
labelModel.option.position = isLabel || symbol === "textOutline" ? "inside" : "top";
|
|
55373
|
+
}
|
|
55374
|
+
if (!labelModel.option.fontSize) {
|
|
55375
|
+
labelModel.option.fontSize = getSymbolLabelFontSize(size, bandWidth);
|
|
55376
|
+
}
|
|
55369
55377
|
if (labelShow && text && (isLabel || ["left", "right"].includes(align))) {
|
|
55370
55378
|
const rect = labelModel.getTextRect(text);
|
|
55371
55379
|
if (isLabel) {
|
|
@@ -55396,7 +55404,6 @@ var LabelsLayout = {
|
|
|
55396
55404
|
data2.setItemVisual(idx, {
|
|
55397
55405
|
symbol,
|
|
55398
55406
|
symbolSize,
|
|
55399
|
-
symbolRotate,
|
|
55400
55407
|
symbolOffset,
|
|
55401
55408
|
symbolShape,
|
|
55402
55409
|
symbolKeepAspect,
|
|
@@ -55406,13 +55413,58 @@ var LabelsLayout = {
|
|
|
55406
55413
|
return {dataEach: data.hasItemOption ? dataEach : null};
|
|
55407
55414
|
}
|
|
55408
55415
|
};
|
|
55409
|
-
var labelsVisual_default =
|
|
55416
|
+
var labelsVisual_default = LabelsVisual;
|
|
55417
|
+
|
|
55418
|
+
// src/chart/labels/labelsLayout.ts
|
|
55419
|
+
function getYByLocation(seriesModel) {
|
|
55420
|
+
const location = seriesModel.get("location");
|
|
55421
|
+
if (!["bottom", "top"].includes(location)) {
|
|
55422
|
+
return null;
|
|
55423
|
+
}
|
|
55424
|
+
const yAxis = seriesModel.coordinateSystem.getAxis("y");
|
|
55425
|
+
const scale4 = yAxis.scale;
|
|
55426
|
+
const [, end2] = yAxis.getExtent();
|
|
55427
|
+
const [boundaryGapX, boundaryGapY] = scale4.rawExtentInfo.getBoundaryGapInner();
|
|
55428
|
+
return Math.floor(location === "top" ? end2 * boundaryGapX + 30 : end2 * (1 - boundaryGapY) + 30);
|
|
55429
|
+
}
|
|
55430
|
+
var labelsLayout = {
|
|
55431
|
+
seriesType: "labels",
|
|
55432
|
+
plan: createRenderPlanner(),
|
|
55433
|
+
reset: function(seriesModel) {
|
|
55434
|
+
const data = seriesModel.getData();
|
|
55435
|
+
const coordSys = seriesModel.coordinateSystem;
|
|
55436
|
+
if (!coordSys) {
|
|
55437
|
+
return;
|
|
55438
|
+
}
|
|
55439
|
+
const dims = map(coordSys.dimensions, function(dim) {
|
|
55440
|
+
return data.mapDimension(dim);
|
|
55441
|
+
}).slice(0, 2);
|
|
55442
|
+
const store = data.getStore();
|
|
55443
|
+
const dimIdx0 = data.getDimensionIndex(dims[0]);
|
|
55444
|
+
const dimIdx1 = data.getDimensionIndex(dims[1]);
|
|
55445
|
+
const xOffset = seriesModel.get("offset") || 0;
|
|
55446
|
+
const price = getYByLocation(seriesModel);
|
|
55447
|
+
return {
|
|
55448
|
+
progress(params, labelsData) {
|
|
55449
|
+
const tmpIn = [];
|
|
55450
|
+
const tmpOut = [];
|
|
55451
|
+
for (let i = params.start, offset = 0; i < params.end; i++) {
|
|
55452
|
+
tmpIn[0] = store.get(dimIdx0, i) + xOffset;
|
|
55453
|
+
tmpIn[1] = store.get(dimIdx1, i);
|
|
55454
|
+
const point = coordSys.dataToPoint(tmpIn, null, tmpOut);
|
|
55455
|
+
labelsData.setItemLayout(i, [point[0], price ?? point[1]]);
|
|
55456
|
+
}
|
|
55457
|
+
}
|
|
55458
|
+
};
|
|
55459
|
+
}
|
|
55460
|
+
};
|
|
55461
|
+
var labelsLayout_default = labelsLayout;
|
|
55410
55462
|
|
|
55411
55463
|
// src/chart/labels/install.ts
|
|
55412
55464
|
function install25(registers) {
|
|
55413
55465
|
registers.registerSeriesModel(LabelsSeries_default);
|
|
55414
55466
|
registers.registerChartView(LabelsView_default);
|
|
55415
|
-
registers.registerLayout(
|
|
55467
|
+
registers.registerLayout(labelsLayout_default);
|
|
55416
55468
|
registers.registerVisual(labelsVisual_default);
|
|
55417
55469
|
}
|
|
55418
55470
|
|