-
Notifications
You must be signed in to change notification settings - Fork 129
fix(xy): occlude points outside of y domain #1475
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
Merged
Merged
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
fdae714
fix: occlude points outside of domain
rshen91 0220094
test: update vrts for cases with y0accessor for area and line
rshen91 3c4c585
test: code review changes
rshen91 03b6400
test: add test to show out of domain point does not get tooltip
rshen91 fef72c8
test: move to test cases
rshen91 9f64e48
fix: allow null values to the tooltip
rshen91 d03937c
test: unit tests
rshen91 9a92bd5
fix: show values in tooltip if out of domain
rshen91 feb4f61
Merge remote-tracking branch 'upstream/master' into points-outside-do…
rshen91 b415d90
test: update unit tests
rshen91 176abe4
fix: code review changes
rshen91 6cb73ea
fix: fix test cases stories
rshen91 8ae91e7
fix: remove minInterval from yAxis domain
rshen91 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+25 KB
...ries-test-cases-test-points-outside-of-domain-visually-looks-correct-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-115 Bytes
(100%)
...s-scales-stories-positive-values-should-render-values-with-log-limit-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+29.7 KB
...ould-not-display-tooltip-over-point-outside-of-domain-even-more-left-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+25 KB
...ain-should-render-area-chart-with-points-outside-of-domain-correclty-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+33.3 KB
...-chart-with-points-outside-of-the-domain-with-y-0-accessor-correctly-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24.6 KB
...ain-should-render-line-chart-with-points-outside-of-domain-correctly-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
storybook/stories/test_cases/8_test_points_outside_of_domain.story.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| import { boolean, select } from '@storybook/addon-knobs'; | ||
| import React from 'react'; | ||
|
|
||
| import { AreaSeries, LineSeries, Axis, Chart, Position, ScaleType, Settings } from '@elastic/charts'; | ||
| import { KIBANA_METRICS } from '@elastic/charts/src/utils/data_samples/test_dataset_kibana'; | ||
|
|
||
| import { useBaseTheme } from '../../use_base_theme'; | ||
|
|
||
| export const Example = () => { | ||
| const typeOfSeries = select('series type', ['line', 'area'], 'area'); | ||
| const showY0Accessor = typeOfSeries === 'area' ? boolean('show y0Accessor', false) : null; | ||
|
|
||
| const data = [ | ||
| [1, 1], | ||
| [2, -3], | ||
| [3, 3], | ||
| [4, 4], | ||
| [5, 5], | ||
| [6, 4], | ||
| [7, -3], | ||
| [8, 2], | ||
| [9, 1], | ||
| ]; | ||
| return ( | ||
| <Chart> | ||
| <Settings baseTheme={useBaseTheme()} /> | ||
| <Axis id="bottom" title="index" position={Position.Bottom} /> | ||
| <Axis | ||
| id="left" | ||
| title={KIBANA_METRICS.metrics.kibana_os_load[0].metric.title} | ||
| position={Position.Left} | ||
| tickFormat={(d) => Number(d).toFixed(2)} | ||
| domain={{ | ||
| min: -2, | ||
| max: NaN, | ||
| minInterval: 1, | ||
markov00 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }} | ||
| /> | ||
| {typeOfSeries === 'line' ? ( | ||
| <LineSeries | ||
| id="lines" | ||
| xScaleType={ScaleType.Linear} | ||
| yScaleType={ScaleType.Linear} | ||
| xAccessor={0} | ||
| yAccessors={[1]} | ||
| data={data} | ||
| /> | ||
| ) : ( | ||
| <AreaSeries | ||
| id="areas" | ||
| xScaleType={ScaleType.Linear} | ||
| yScaleType={ScaleType.Linear} | ||
| xAccessor={0} | ||
| yAccessors={[1]} | ||
| y0Accessors={showY0Accessor ? [([, y]) => y - 1] : undefined} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍🏼 |
||
| data={data} | ||
| /> | ||
| )} | ||
| </Chart> | ||
| ); | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.