MCPcopy
hub / github.com/apache/echarts / markAreaTransform

Function markAreaTransform

src/component/marker/MarkAreaView.ts:64–100  ·  view source on GitHub ↗
(
    seriesModel: SeriesModel,
    coordSys: CoordinateSystem,
    maModel: MarkAreaModel,
    item: MarkArea2DDataItemOption
)

Source from the content-addressed store, hash-verified

62};
63
64const markAreaTransform = function (
65 seriesModel: SeriesModel,
66 coordSys: CoordinateSystem,
67 maModel: MarkAreaModel,
68 item: MarkArea2DDataItemOption
69): MarkAreaMergedItemOption {
70 // item may be null
71 const item0 = item[0];
72 const item1 = item[1];
73 if (!item0 || !item1) {
74 return;
75 }
76
77 const lt = markerHelper.dataTransform(seriesModel, item0);
78 const rb = markerHelper.dataTransform(seriesModel, item1);
79
80 // FIXME make sure lt is less than rb
81 const ltCoord = lt.coord;
82 const rbCoord = rb.coord;
83 ltCoord[0] = retrieve(ltCoord[0], -Infinity);
84 ltCoord[1] = retrieve(ltCoord[1], -Infinity);
85
86 rbCoord[0] = retrieve(rbCoord[0], Infinity);
87 rbCoord[1] = retrieve(rbCoord[1], Infinity);
88
89 // Merge option into one
90 const result: MarkAreaMergedItemOption = mergeAll([{}, lt, rb]);
91
92 result.coord = [
93 lt.coord, rb.coord
94 ];
95 result.x0 = lt.x;
96 result.y0 = lt.y;
97 result.x1 = rb.x;
98 result.y1 = rb.y;
99 return result;
100};
101
102function isInfinity(val: ScaleDataValue) {
103 return !isNaN(val as number) && !isFinite(val as number);

Callers

nothing calls this directly

Calls 1

retrieveFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…