question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding code to transformProps that changes data gets rendered each chart change

See original GitHub issue

This is more of a code quality suggestion for the future / FYI as opposed to a bug that’s currently affecting users. I mentioned this in this PR, transformProps gets run every time the chart or chart controls changes. It seems like transformProps might not be a great place to alter the data because it gets executed before the user has clicked run, so it could change the chart automatically when a control changes in ways that we might not expect.

As an example, in big number when you clear a metric, instead of showing the overlay, we’ll show NaN before the user has clicked RUN because the data gets processed in transformProps so data returned to the chart will be null until the user selects a new metric.

I talked with @kristw about this in person, just wanted to leave this here to give others an FYI of what we found out. Not sure who to tag.

cc: @conglei @kristw

Superset version

master

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
congleicommented, Dec 4, 2018

Yes, indeed it is a bug for this particular workflow 1) users change metric, and the query or dismiss dialog will be shown automaticall 2) users click dismiss, but the value for metric is still the modified value. 3) users change some instant control.

In my opinion, to prevent this issue happen, when users click dismiss, the value of the modified control should be also undoed. Otherwise, the chart will be inconsistent with the control panel.

What do you think?

@michellethomas @mistercrunch @williaster @kristw

0reactions
stale[bot]commented, Apr 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding code to transformProps that changes data gets ...
FYI I'm now working on this issue now. I feel like this issue should be handled in a higher level, so rendering won't...
Read more >
Chart draws again every time I change the state of a component
As @SureshKumar said, the problem was that I create new chart every time I get data in getData() . I fixed it by...
Read more >
Change the data series in a chart - Microsoft Support
Right-click your chart, and then choose Select Data. Select Data Source dialog box · In the Legend Entries (Series) box, click the series...
Read more >
Handling Events | Charts - Google Developers
The chart should expose the method setSelection(selection) to change the selection in the underlying table and select the corresponding data in the chart....
Read more >
Suspense for Data Fetching (Experimental) - React
React 16.6 added a <Suspense> component that lets you “wait” for some code to load and ... Waterfalls are common in code that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found