Skip to content
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

Better mapbox trace / layout-layer *below* #4058

Merged
merged 6 commits into from
Jul 19, 2019
Merged

Better mapbox trace / layout-layer *below* #4058

merged 6 commits into from
Jul 19, 2019

Conversation

etpinard
Copy link
Contributor

This PR resolves #4050 and resolves #4049

Commit 8a4e8f1 does most of the work here. Please carefully read the commit message for some rationale and tests.

Commit 853a391 should help users debug. The other commits are cleanup commits.

cc @plotly/plotly_js @nicolaskruchten

... to be consistent with traces/*mapbox/ modules
We now handle below logic (mostly) at the subplot level in
  subplot.fillBelowLookup() and subplot.belowLookup.
  This allows us to handle many edges cases in a cleaner way.

In brief,
  + we collect set trace/layout-layer below value,
    OR find their "smart" default value
  + each trace/layout-layer stash a below state value
  + if new below doesn't match old before, we must remove/add layer
  + if many traces/layout have same below value, we place choroplethmapbox,
    then densitymapbox, scattermapbox and finally layout layers
    in that order.
  + on update, if many traces/layout-layer have same below,
    we must in general remove/add all those layers
    to have the correct ordering

Additional notes:
  - we no longer need to handle below in convert.js routines
  - getBelow is now a trace _module.getBelow method, so that it
    can get called before mapbox-trace object creation
  - new subplot.getMapLayer method to DRY things up
... to Lib.warn users when *below* is invalid.
@etpinard etpinard added this to the v1.49.0 milestone Jul 17, 2019
Copy link
Contributor

@archmoj archmoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etpinard Nicely done.

src/traces/scattermapbox/attributes.js Outdated Show resolved Hide resolved
src/traces/scattermapbox/plot.js Outdated Show resolved Hide resolved
@archmoj
Copy link
Contributor

archmoj commented Jul 19, 2019

💃

@etpinard etpinard merged commit 66eacc3 into master Jul 19, 2019
@etpinard etpinard deleted the better-below branch July 19, 2019 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

below: traces in layout.mapbox.layers scattermapbox below attribute
2 participants