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

'heatmapgl' with xaxis: { scaleanchor: 'y' } regression in 1.58.0 #5474

Closed
wbrgss opened this issue Feb 5, 2021 · 0 comments · Fixed by #5476
Closed

'heatmapgl' with xaxis: { scaleanchor: 'y' } regression in 1.58.0 #5474

wbrgss opened this issue Feb 5, 2021 · 0 comments · Fixed by #5476
Assignees
Labels
bug something broken regression this used to work

Comments

@wbrgss
Copy link
Contributor

wbrgss commented Feb 5, 2021

Codepen here (graph renders, but console error present in browser Dev Tools [not CodePen console])

With v1.58.0 and above, the heatmapgl trace in combination with layout.xaxis.scaleanchor = 'y' will result in the following console error:

Uncaught TypeError: Cannot read property 'h' of undefined
   at finalRatios (plotly-latest.js:130572)
    at enforce (plotly-latest.js:130607)
    at Scene2D.proto.plot (plotly-latest.js:141341)
    at Object.plot (plotly-latest.js:140826)
    at exports.drawData (plotly-latest.js:123232)
    at Object.lib.syncOrAsync (plotly-latest.js:112023)
    at Object.plot (plotly-latest.js:117778)
    at Object.newPlot (plotly-latest.js:118048)
    at pen.js?key=pen.js-7e54a372-bf12-b3ca-2352-8ef41ae0d8f6:16

It looks like the height h is not defined in the yRatio calculation here and this causes the error.

Also, probably because of the undefined height in a ratio calculation, the way a heatmap is rendered is different in a div without a defined width (or perhaps other dimensions?) before and after 1.58.0:

Plotly.js v1.57.1 ('equal' aspect ratio) Plotly.js v1.58.0 ('oblong' aspect ratio)
image image

This is more of a problem for Dash, because it's a render-blocking error.

image

Dash app (may require login)

Click for Python Dash code
import dash
import dash_core_components as dcc

app = dash.Dash(__name__)

layout = dict(xaxis=dict(scaleanchor='y'))
webgl_heatmap_fig = dict(
    data=[
        dict(
            z=[
                [1, 2, 3],
                [4, 5, 6],
                [7, 8, 9]
            ],
            type='heatmapgl'
        )
    ],
    layout=layout
)

app.layout = dcc.Graph(figure=webgl_heatmap_fig)

if __name__ == '__main__':
    app.run_server(debug=True)

cc @plotly/plotly_js

@wbrgss wbrgss added bug something broken regression this used to work dash labels Feb 5, 2021
@alexcjohnson alexcjohnson self-assigned this Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken regression this used to work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants