-
Notifications
You must be signed in to change notification settings - Fork 120
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(xy): occlude points outside of y domain #1475
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also add a vrt that hovers at x = 2
so we show the tooltip is not available at that point? I think adding it to the existing ones is fine since it can test both the point is no visible AND the tooltip is not shown.
Sorry missed this and added in commit 03b6400 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rachel, this is nicely done, compact change and a good set of image tests to lock in the fix 👍 Looks good to me once CI is in green
Wondering if any of the brush or hover events emit granular, point by point details, and if so, whether the hidden points need to be part of the point set passed on to these callbacks or not
The brush event doesn't pass the data points details but only the brush extent in domain coordinates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me but I'm wondering if we want to hide the tooltip for those values or not.
In particular I see the benefit of showing, in the "cursor" tooltip, also values that are outside the current specified domain, but I think we should investigate with the Lens team if we want or not show those values.
Instead, is definitely a requirement to not render the points that are outside the domain, to avoid having points floating around outside the chart area
@rshen91 @nickofthyme I've double-checked with @dej611 and for now it is better to keep the point on the tooltip but remove it from the rendering |
packages/charts/src/chart_types/xy_chart/rendering/rendering.bubble.test.ts
Show resolved
Hide resolved
packages/charts/src/chart_types/xy_chart/rendering/rendering.lines.test.ts
Show resolved
Hide resolved
storybook/stories/test_cases/8_test_points_outside_of_domain.story.tsx
Outdated
Show resolved
Hide resolved
storybook/stories/test_cases/8_test_points_outside_of_domain.story.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes since LGTM
) : ( | ||
<AreaSeries | ||
id="areas" | ||
xScaleType={ScaleType.Linear} | ||
yScaleType={ScaleType.Linear} | ||
xAccessor={0} | ||
yAccessors={[1]} | ||
y0Accessors={[([, y]) => y - 1]} | ||
y0Accessors={showY0Accessor ? [([, y]) => y - 1] : undefined} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
if (isInYDomain) { | ||
indexedGeometryMap.set(pointGeometry, geometryType); | ||
} | ||
indexedGeometryMap.set(pointGeometry, geometryType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼 This is causing vrt changes that need to be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
# [40.0.0](v39.0.2...v40.0.0) (2021-11-18) ### Bug Fixes * **interactions:** remove the option for pixelRatio with png snapshot ([#1431](#1431)) ([eebb069](eebb069)) * **xy:** occlude points outside of y domain ([#1475](#1475)) ([3176f02](3176f02)) ### Features * **annotations:** add annotations to DebugState ([#1434](#1434)) ([c5ea600](c5ea600)) * **heatmap:** add valueShown in heatmap debug state ([#1460](#1460)) ([962e089](962e089)) ### BREAKING CHANGES * **interactions:** The getPNGSnapshot function no longer has an option for pixelRatio
Summary
Points are removed from rendering that are beyond the yDomain. Tooltips will still show the points outside of the domain.
Details
Issues
Fixes #1474
Checklist
:xy
,:partition
):interactions
,:axis
)closes #123
,fixes #123
)dark
,light
,eui-dark
&eui-light