Plotly.js: Regression of bar plot axis scaling between 1.51.1 and 1.51.2

Created on 10 Feb 2020  Â·  10Comments  Â·  Source: plotly/plotly.js

@archmoj

https://github.com/plotly/plotly.js/commit/96ef28a76de609ca11adf475adba59a574ce3e59#diff-41fd60f1e6a06a5340748d3f4b3754e6R218-R225

This commit broke (my) bar plots which are updated in chunks. Horizontal axis of the bar plot stopped rescaling correctly between 1.51.1 and 1.51.2.
This has been working for years so this should be considered as a regression.

By removing this if statement it starts working again: https://github.com/plotly/plotly.js/blob/acc9c21c0239b4500b9787ab92203327b3abd033/src/traces/bar/plot.js#L218

New behaviour:
image

Version <= 1.51.1 (or above if-statement removed in 1.51.2):
image

If required, I'll try to construct a simple example to reproduce.

bug ♥ NEEDS SPON$OR

All 10 comments

@brubbel thanks for reporting.
Does this demo illustrate the bug?

It seems so, at first sight.

Related: #4522.

Confirmed: I've Tested the demo with and without the if-statement, and it illustrates the same issue.

I would like to possibly add another test to lock the behaviour.
@brubbel would you mind sharing the data and layout of your figure?
Thanks.

In addition to #4522, I also think this could be related to #4180 as well.

In addition to #4522, I also think this could be related to #4180 as well.
Correction: regression is not related to #4180.

@archmoj
With the latest version (https://cdn.plot.ly/plotly-latest.min.js, v1.54.1), and using your above demo, the problem is solved.
However, it persists when the plot is downloaded using the png button:

image

@brubbel the png behavior is not a regression - going back to v1.51.1 or earlier we see this same behavior that the bars disappear in the png output. We might consider it a bug, but this is a little tricky. Normally for a plot downloaded as an image we disable both rounding positions and shape-rendering: crispEdges, because the same machinery can produce vector output (eps, pdf, svg) and even for raster output it can scale up to higher resolution. In all of those cases this rounding and disabled antialiasing would degrade the output.

But for the default output of the download button - 1:1 scaled raster - it would make sense to carve out an exception and retain the behavior used on interactive plots.

This issue has been tagged with NEEDS SPON$OR

A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort.

Sponsorship range: $5k-$10k

What Sponsorship includes:

  • Completion of this feature to the Sponsor's satisfaction, in a manner coherent with the rest of the Plotly.js library and API
  • Tests for this feature
  • Long-term support (continued support of this feature in the latest version of Plotly.js)
  • Documentation at plotly.com/javascript
  • Possibility of integrating this feature with Plotly Graphing Libraries (Python, R, F#, Julia, MATLAB, etc)
  • Possibility of integrating this feature with Dash
  • Feature announcement on community.plotly.com with shout out to Sponsor (or can remain anonymous)
  • Gratification of advancing the world's most downloaded, interactive scientific graphing libraries (>50M downloads across supported languages)

Please include the link to this issue when contacting us to discuss.

Was this page helpful?
0 / 5 - 0 ratings