Skip to content

Commit

Permalink
fix(pointmove): 修复 pointmove 事件的两个问题 (#6136)
Browse files Browse the repository at this point in the history
Co-authored-by: wb-xcf804241 <wb-xcf804241@alibaba-inc.com>
  • Loading branch information
ai-qing-hai and wb-xcf804241 authored Mar 18, 2024
1 parent e36ce30 commit 3dfb9e7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/interaction/elementPointMove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,12 @@ export function ElementPointMove(
const createPoints = (element) => {
const { attributes, markType, __data__: data } = element;
const { stroke: fill } = attributes;
const { points, seriesTitle, color, title, seriesX } = data;
const { points, seriesTitle, color, title, seriesX, y1 } = data;
// Transpose Currently only do mark interval;
if (isTranspose && markType !== 'interval') return;

const { scale, coordinate } = newState?.view || view;
const { color: scaleColor, y: scaleY } = scale;
const { color: scaleColor, y: scaleY, x: scaleX } = scale;
const center = coordinate.getCenter();

pointsGroup.removeChildren();
Expand Down Expand Up @@ -324,7 +324,8 @@ export function ElementPointMove(

if (['line', 'area'].includes(markType)) {
points.forEach((p, index) => {
const title = seriesTitle[index];
const title = scaleX.invert(seriesX[index]);

// Area points have bottom point.
if (!title) return;

Expand Down Expand Up @@ -545,8 +546,8 @@ export function ElementPointMove(
points[1],
);
const lastPercent = coordinate.invert([newXOut, newYOut])[1];
const nextPercent = coordinate.invert(points[3])[1];
const percent = nextPercent - lastPercent;
const percent = y1 - lastPercent;

if (percent < 0) return;
const newPath = getThetaPath(
center,
Expand Down

0 comments on commit 3dfb9e7

Please sign in to comment.