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

Make nvd3 refresh smoother on dashboard #1618

Merged
merged 1 commit into from
Nov 18, 2016

Conversation

the-dcruz
Copy link
Contributor

Issue

Currently, refreshing nvd3 visualizations is not very pleasant to look at especially when set to refresh every 10 seconds:
old_refresh

The problem is that upon render, the entire slice container is emptied which means the whole chart must render from scratch instead of just adjusting to new data.

Solution

If we leave the chart intact upon refesh, nvd3 will automatically update the entire chart smoothly.

Notice the bars and x-axis shift in this example.
new_fresh

@mistercrunch

@ascott
Copy link

ascott commented Nov 17, 2016

would be great to check the other nvd3 viz's work with this change:

  • BubbleViz
  • line
  • pie
    -boxplot

otherwise, LGTM!

@the-dcruz
Copy link
Contributor Author

more_graphs

@@ -73,6 +73,7 @@ function query(forceUpdate, pushState) {
// update the url after prepForm() fix the field ids
history.pushState({}, document.title, slice.querystring());
}
slice.container.html('');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this line because I noticed some strange behavior in box-plot and pie charts when I changed major parts of the query such as the the dimension I was grouping by.

Example of strange behavior:

  • Pie chart not resizing properly when hovered.

On a dashboard, the same query would always be firing from each slice so it shouldn't be an issue.

@the-dcruz
Copy link
Contributor Author

@ascott I've checked all the nvd3 visualizations and they're rendering and refreshing as expected

@ascott
Copy link

ascott commented Nov 18, 2016

thanks @the-dcruz!

@ascott ascott merged commit e546746 into apache:master Nov 18, 2016
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.14.0 labels Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants