Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pointmove): 修复 pointmove 事件的两个问题 #6136

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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