Skip to content

Resize doesn't accept id string #2197

Closed
@alexcjohnson

Description

@alexcjohnson

dynamic sizing requires you to explicitly attach a resize handler:

window.onresize = function() { Plotly.Plots.resize(gd); };

This works fine if you pass the plot div element gd, but (unlike the rest of the API) you cannot use an id 'myGraph' or you'll get an error:

Uncaught (in promise) TypeError:
  Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.

cc @VeraZab

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions