-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Set enabled:false when filter target array is empty #3766
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
Conversation
- see #2908 for more info, - this fixes many potential problems downstream
@@ -138,10 +138,16 @@ exports.supplyDefaults = function(transformIn) { | |||
var enabled = coerce('enabled'); | |||
|
|||
if(enabled) { | |||
var target = coerce('target'); | |||
|
|||
if(Lib.isArrayOrTypedArray(target) && target.length === 0) { |
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.
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.
Good call. Thanks for the review!
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.
@archmoj this turned out to be a bit more of a project than anticipated.
See 3a5a4c2 - which makes things work for all trace types except scattercarpet
and in some world-calendar scenario. I'll try to get those two cases fixed before 1.48.0
, but in the meantime here's "a good chuck" of the solution.
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.
... after transform _module.calc loop - that way filter transforms that remove all data coordinates don't result in errors - of all the mocks listed in mock_lists.js, only 'scattercarpet' and 'world-cals' still error out (wip)
@etpinard you mentioned a possible conflict on |
and the fix is in 84c3606 |
Looks very good. |
It is handled as it results in |
Could you please provide a codepen example for that? |
|
Thanks. Now could you please check this one. |
I think so. It's not great, but I think traces with |
Excellent. |
closes #2908 - by implementing #2908 (comment)
cc @plotly/plotly_js
before/after example: https://codepen.io/etpinard/pen/wYdppB / https://codepen.io/etpinard/pen/WWOVBV