Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/component/marker/MarkAreaView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const markAreaTransform = function (
return result;
};

function isInifinity(val: ScaleDataValue) {
function isInfinity(val: ScaleDataValue) {
return !isNaN(val as number) && !isFinite(val as number);
}

Expand All @@ -103,7 +103,7 @@ function ifMarkAreaHasOnlyDim(
coordSys: CoordinateSystem
) {
const otherDimIndex = 1 - dimIndex;
return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex]);
return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex]);
}

function markAreaFilter(coordSys: CoordinateSystem, item: MarkAreaMergedItemOption) {
Expand Down Expand Up @@ -164,7 +164,7 @@ function getSingleMarkerEndPoint(
else {
// Chart like bar may have there own marker positioning logic
if (seriesModel.getMarkerPosition) {
// Use the getMarkerPoisition
// Use the getMarkerPosition
point = seriesModel.getMarkerPosition(
data.getValues(dims, idx)
);
Expand All @@ -182,10 +182,10 @@ function getSingleMarkerEndPoint(
const yAxis = coordSys.getAxis('y') as Axis2D;
const x = data.get(dims[0], idx) as number;
const y = data.get(dims[1], idx) as number;
if (isInifinity(x)) {
if (isInfinity(x)) {
point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]);
}
else if (isInifinity(y)) {
else if (isInfinity(y)) {
point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]);
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/component/marker/MarkLineView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const markLineTransform = function (
return normalizedItem;
};

function isInifinity(val: ScaleDataValue) {
function isInfinity(val: ScaleDataValue) {
return !isNaN(val as number) && !isFinite(val as number);
}

Expand All @@ -167,7 +167,7 @@ function ifMarkLineHasOnlyDim(
) {
const otherDimIndex = 1 - dimIndex;
const dimName = coordSys.dimensions[dimIndex];
return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex])
return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex])
&& fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);
}

Expand Down Expand Up @@ -215,7 +215,7 @@ function updateSingleMarkerEndLayout(
else {
// Chart like bar may have there own marker positioning logic
if (seriesModel.getMarkerPosition) {
// Use the getMarkerPoisition
// Use the getMarkerPosition
point = seriesModel.getMarkerPosition(
data.getValues(data.dimensions, idx)
);
Expand All @@ -240,10 +240,10 @@ function updateSingleMarkerEndLayout(
const xAxis = coordSys.getAxis('x') as Axis2D;
const yAxis = coordSys.getAxis('y') as Axis2D;
const dims = coordSys.dimensions;
if (isInifinity(data.get(dims[0], idx))) {
if (isInfinity(data.get(dims[0], idx))) {
point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]);
}
else if (isInifinity(data.get(dims[1], idx))) {
else if (isInfinity(data.get(dims[1], idx))) {
point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/component/marker/MarkPointView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function updateMarkerLayout(
}
// Chart like bar may have there own marker positioning logic
else if (seriesModel.getMarkerPosition) {
// Use the getMarkerPoisition
// Use the getMarkerPosition
point = seriesModel.getMarkerPosition(
mpData.getValues(mpData.dimensions, idx)
);
Expand Down
4 changes: 2 additions & 2 deletions src/component/marker/markerHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export function dataFilter(
},
item: MarkerPositionOption
) {
// Alwalys return true if there is no coordSys
// Always return true if there is no coordSys
return (coordSys && coordSys.containData && item.coord && !hasXOrY(item))
? coordSys.containData(item.coord) : true;
}
Expand All @@ -204,7 +204,7 @@ export function zoneFilter(
item1: MarkerPositionOption,
item2: MarkerPositionOption
) {
// Alwalys return true if there is no coordSys
// Always return true if there is no coordSys
return (coordSys && coordSys.containZone && item1.coord && item2.coord && !hasXOrY(item1) && !hasXOrY(item2))
? coordSys.containZone(item1.coord, item2.coord) : true;
}
Expand Down