Plotly.js: scattergl fill - autorange and restyle

Created on 9 Feb 2018  路  5Comments  路  Source: plotly/plotly.js

scattergl doesn't match the scatter svg autorange behavior with fill: for example, fill: 'tozeroy' like in the gl2d_axes_labels2 mock should trigger the y axis to autorange to zero, and the x axis to autorange tightly rather than padded, despite the markers.

Also: open the same mock and Plotly.restyle(gd, {fill: 'none'}) - the fill will not disappear, though if you add a fill to a plot that doesn't have one, it will appear.

bug

Most helpful comment

@dfcreative I found a pretty bad typo in the scattergl calc step where the marker options container is refered to options.markers here, here, here and here instead of options.markers as set here.

This means that Axis.expand never got the correct size values here and the autorange computation for scattergl were plain wrong. See image diffs in commit https://github.com/plotly/plotly.js/commit/58c29724b7daa7211830245af2645f256401310a .

In short, I'll spend some time during to clean up the scattergl calc, by hopefully reusing as much of Scatter.calc as possible.

All 5 comments

Also: open the same mock and Plotly.restyle(gd, {fill: 'none'}) - the fill will not disappear, though if you add a fill to a plot that doesn't have one, it will appear.

cc @dfcreative


scattergl probably suffers from other autorange bugs and/or discrepancies.

Plotly.restyle(gd, {fill: 'none'}) - the fill will not disappear

this one is fixed via https://github.com/plotly/plotly.js/pull/2377. The autorange issues prevail.

@dfcreative I found a pretty bad typo in the scattergl calc step where the marker options container is refered to options.markers here, here, here and here instead of options.markers as set here.

This means that Axis.expand never got the correct size values here and the autorange computation for scattergl were plain wrong. See image diffs in commit https://github.com/plotly/plotly.js/commit/58c29724b7daa7211830245af2645f256401310a .

In short, I'll spend some time during to clean up the scattergl calc, by hopefully reusing as much of Scatter.calc as possible.

done in #2404

Was this page helpful?
0 / 5 - 0 ratings