plotly / plotly/react-plotly.js

How to properly fetch data on relayout (onRelayout)?

Open
#350 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.1k
Forks
138
Avg merge
3d 2h
Merged PRs (30d)
4

Description

I need this functionality and request some assistance to realize it.

At the moment I use the following approach:

  1. when user zoomed plot, onRelayout handler gets fired and starts data loading.
  2. when data is loaded it is passed to the component
  3. new data leads to re-render.

it's works fine, but:

  1. if I catch the moment when component is re-rendering because of the new data and do an aditional zoom operation at the same moment, then I get a strange jump/flickering of my plot for a moment.

It's looks like a race of states.
Inner state which is responsible for zoom transformations changes at the same time with component re-rendering.

I need advice on how to get rid of this bug. Or how to propeply realize this feature, in case if I completely wrong in my approach.

Thanks.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the onRelayout handler and the React Plot component update flow described in the issue. Reproduce the sequence of zooming, loading new data, re-rendering, and zooming again; done means the plot no longer jumps or flickers during that overlapping interaction.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.