Skip to content

Coloraxis not properly updated #167

Description

@tconkling

In this codepen example, I have a simple scatterplot with a single data point, and a "coloraxis" marker.

When the datapoint's marker is updated, the coloraxis is not properly updated. Specifically, when the datapoint marker color is incremented or decremented, the coloraxis does not rescale as you'd expect.

For example, when the chart is initialized, the datapoint's color is initialized to 5. The color axis values range from 4-6, as you'd expect:

image

The Data.color++ and Data.color-- buttons increment and decrement the datapoint's color value. But this results in the coloraxis expanding to encompass the datapoint's color value from previous renders. Here, I've incremented and decremented the color a bunch of times, and the color axis' values now range from 0-12:

image

If I force the component to unload and reload (by passing a new React key param to the <Plot/> each time render is called), the issue is fixed. (Also, if I download the plot as a PNG, that PNG looks correct.)

Activity

  1. tconkling commented on Nov 6, 2019

    @tconkling
    Author

    Oh - in the attached Codepen project, I'm using react-plotly.js@2.2.0 because using 2.4.0 results in an error about "createPlotlyComponent" not being a function. But I can reproduce this in my own project, which does use 2.4.0.

  2. nicolaskruchten commented on Nov 6, 2019

    @nicolaskruchten
    Contributor

    Thanks for the bug report! I've filed an issue in the underlying repo which will need to be addressed for this to work: plotly/plotly.js#4337

  3. oeph commented on Mar 2, 2020

    @oeph

    This should be fixed with the latest plotly.js version, so I guess this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions