-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Make polar be more graceful on non sense inputs #3021
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 1 commit
7f0fc26
8589d99
a8838da
35d1351
b3fc904
d9d626a
cb5b336
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 |
---|---|---|
|
@@ -13,6 +13,9 @@ var doubleClick = require('../assets/double_click'); | |
var drag = require('../assets/drag'); | ||
var delay = require('../assets/delay'); | ||
|
||
var customAssertions = require('../assets/custom_assertions'); | ||
var assertNodeDisplay = customAssertions.assertNodeDisplay; | ||
|
||
describe('Test legacy polar plots logs:', function() { | ||
var gd; | ||
|
||
|
@@ -628,6 +631,35 @@ describe('Test relayout on polar subplots:', function() { | |
.catch(failTest) | ||
.then(done); | ||
}); | ||
|
||
it('should not attempt to draw radial axis when *polar.hole* is set to 1', function(done) { | ||
var gd = createGraphDiv(); | ||
|
||
var queries = [ | ||
'.radial-axis', '.radial-grid', '.radial-line > line', | ||
'.radialdrag', '.radialdrag-inner' | ||
]; | ||
|
||
function _assert(msg, showing) { | ||
var exp = showing ? null : 'none'; | ||
var sp3 = d3.select(gd).select('.polarlayer > .polar'); | ||
queries.forEach(function(q) { | ||
assertNodeDisplay(sp3.selectAll(q), [exp], msg + ' ' + q); | ||
}); | ||
} | ||
|
||
Plotly.plot(gd, [{ | ||
type: 'scatterpolar', | ||
r: ['a', 'b', 'c'] | ||
}]) | ||
.then(function() { _assert('base', true); }) | ||
.then(function() { return Plotly.relayout(gd, 'polar.hole', 1); }) | ||
.then(function() { _assert('hole=1', false); }) | ||
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. So it doesn't fail... does it work? ie draws all data on the rim regardless of radial value (within the radial range)? Do you want to include this in a mock? 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. Here's where angular drag still drag still works.
it shows no data points.
done in cb5b336 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 comment is nonblocking (perhaps add to #2255 if you don't want to address it here): With 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.
Ah I see. Good point.
I'll wait until someone complains about it (maybe @nicolaskruchten ?) before addressing this. Now in -> #2255 (comment) |
||
.then(function() { return Plotly.relayout(gd, 'polar.hole', 0.2); }) | ||
.then(function() { _assert('hole=0.2', true); }) | ||
.catch(failTest) | ||
.then(done); | ||
}); | ||
}); | ||
|
||
describe('Test polar interactions:', function() { | ||
|
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.
Recall that
updateElement
isplotly.js/src/plots/polar/polar.js
Lines 1347 to 1355 in 7f0fc26