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

fix: detect style changes from dashboard for re-rendering visualization #1667

Merged
merged 3 commits into from
Mar 22, 2021

Conversation

jenniferarnesen
Copy link
Collaborator

Key features

  1. Visualizations in dashboard were not rerendering to fit the item size in the following situations:
  • item fullscreen
  • edit item resize
  • change screen width (e.g., switch to/from small screen)

Description

Dashboard and Data Visualizer apps have different approaches regarding visualization size and resizing. DV vis containers have display flex and use a counter that updates when the window is resized, to trigger a re-render of the visualization. In Dashboard, the container has a set width and height, which change on any of the above resizing scenarios. It does not use a counter.

The new effect will end up being specific to dashboard, while the existing effect that responds to renderCounter will be specific to DV. A future improvement would possibly be to use the same mechanisms for both apps. But playing it safe for now, since we are in a hard freeze.

Screenshots

(the video clips off the legend at the bottom, but it is actually visible)

dashboard.fs.mov

Copy link
Member

@edoardo edoardo left a comment

Choose a reason for hiding this comment

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

I suppose for DV the style effect doesn't matter as the renderCounter one is used.

@jenniferarnesen
Copy link
Collaborator Author

I suppose for DV the style effect doesn't matter as the renderCounter one is used.

@edoardo I switched back to separate effects. Realized the problem was that I was using prevStyle.width instead of prevStyle.current.width. Oops...

@jenniferarnesen jenniferarnesen merged commit ee6a7d0 into master Mar 22, 2021
@jenniferarnesen jenniferarnesen deleted the fix/resize-for-dashboard branch March 22, 2021 18:53
dhis2-bot added a commit that referenced this pull request Mar 22, 2021
## [35.20.22](v35.20.21...v35.20.22) (2021-03-22)

### Bug Fixes

* detect style changes from dashboard for re-rendering visualization ([#1667](#1667)) ([ee6a7d0](ee6a7d0))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 35.20.22 🎉

The release is available on:

Your semantic-release bot 📦🚀

jenniferarnesen added a commit that referenced this pull request Mar 23, 2021
…on (#1667)

Key features:
Visualizations in dashboard were not rerendering to fit the item size in the following situations:
* item fullscreen
* edit item resize
* change screen width (e.g., switch to/from small screen)

Description
Dashboard and Data Visualizer apps have different approaches regarding visualization size and resizing. DV vis containers have display flex and use a counter that updates when the window is resized, to trigger a re-render of the visualization. In Dashboard, the container has a set width and height, which change on any of the above resizing scenarios. It does not use a counter.

The new effect will end up being specific to dashboard, while the existing effect that responds to renderCounter will be specific to DV. A future improvement would possibly be to use the same mechanisms for both apps. But playing it safe for now, since we are in a hard freeze.
janhenrikoverland pushed a commit that referenced this pull request Mar 31, 2021
…on (#1667)

Key features:
Visualizations in dashboard were not rerendering to fit the item size in the following situations:
* item fullscreen
* edit item resize
* change screen width (e.g., switch to/from small screen)

Description
Dashboard and Data Visualizer apps have different approaches regarding visualization size and resizing. DV vis containers have display flex and use a counter that updates when the window is resized, to trigger a re-render of the visualization. In Dashboard, the container has a set width and height, which change on any of the above resizing scenarios. It does not use a counter.

The new effect will end up being specific to dashboard, while the existing effect that responds to renderCounter will be specific to DV. A future improvement would possibly be to use the same mechanisms for both apps. But playing it safe for now, since we are in a hard freeze.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants