-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Support extreme off-plot data points in scatter lines #2060
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
Changes from 3 commits
3130d1c
231883f
4b0b5d3
5ec5dbf
8d3ef29
37b5cdc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,10 @@ | |
1, | ||
2, | ||
3, | ||
1000005, | ||
-1e100, | ||
3, | ||
4, | ||
4, | ||
5, | ||
6, | ||
|
@@ -42,13 +46,18 @@ | |
1, | ||
2, | ||
3, | ||
-3000000, | ||
3e100, | ||
1e12, | ||
-1e11, | ||
4, | ||
5, | ||
6, | ||
7, | ||
8 | ||
], | ||
"type": "scatter" | ||
"type": "scatter", | ||
"mode": "lines" | ||
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. nw has problems with displaying the markers for this trace if you include them: you get the axes and gridlines but no traces drawn at all. If you drop the exponent 100 to 12 or less, it works again. Clipping markers should be easier than lines, but I opted to leave that for another time. If it's only nw that cares, perhaps image-exporter will moot the issue - but it bears a little more investigation -> #2061 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. BTW I modified this mock because, while 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. |
||
} | ||
], | ||
"layout": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,7 +127,7 @@ var matchers = { | |
'to be close to', | ||
arrayToStr(expected.map(arrayToStr)), | ||
msgExtra | ||
].join(' '); | ||
].join('\n'); | ||
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. This way the two arrays always start at the same column, so it's easy to match points and see what failed. |
||
|
||
return { | ||
pass: passed, | ||
|
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.
So, if I understand correctly, this here gets calls for all
line.shape
values?If so, it might be nice to add one or two non-
'linear'
line.shape
traces in theultra_zoom
mock.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.
That's correct. And good call on adding some test cases for other
line.shape
values. I actually might want to think about this a little -spline
is probably going to have to stay untouched, but[hv]+
may have relatively simple ways to make them behave perfectly correctly, which they don't now because we linearly interpolate between the on-screen and extreme points.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.
Spline actually works remarkably well using the linear algorithm - because Catmull-Rom smoothing reaches a steady limit to the curve shape on-screen as the next point moves farther and farther off-screen.
37b5cdc adds special handling for the right-angle line shapes - not too bad, certainly less involved than linear! Test-wise, in the interest of time I only altered ultra-zoom, did not add extra jasmine tests for these, I hope that's OK.
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.
Yeah, image test support should suffice here. 👍