-
Notifications
You must be signed in to change notification settings - Fork 147
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
[Feat] Add new dcc.Loading features in dash 2.17 #487
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all, congratulations @AnnMarieW on getting these features into Dash! 🚀 ⭐ From a visual perspective, I think they can improve the loading spinners significantly.
I left a couple of comments as one big visual advantage of the new loading spinner feature doesn't really come across in Vizro. That's an issue on our side though. I'll double-check with @antonymilne if this might change in the future.
The other visual advantage of reducing the flickering - I would love to understand better as from the current Vizro demo examples it seems to flicker a bit more, but I think it's because we need to fine-tune the ms for delay_show
?
Hello @AnnMarieW! Thanks very much for making the Github issue and raising this PR. And many congratulations on plotly/dash#2760! It's a really amazing PR ⭐ @huong-li-nguyen Following on from the slack conversation and just to make sure we're all on the same page here, because I had to remind myself of some previous work I'd done to stop graphs flickering (#166) and what our current scheme is... There's currently two times when
So even though
Just for the record, some other things that might be useful from plotly/dash#2760 which @AnnMarieW didn't change here would be:
|
@antonymilne, it's good that you mentioned it. The second case was not on my mind anymore 😄 In that case, the On I've looked into our previous discussion before the PR review and also thought that |
Co-authored-by: Li Nguyen <[email protected]>
Co-authored-by: Li Nguyen <[email protected]>
And regarding the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defining delay_show
and delay_hide
now works nicely for our demos - thanks @AnnMarieW! EDIT: @petar-qb noticed some unwanted behaviour on some other occasions though, so it might be worth removing these two properties for now, but you can definitely go ahead with the changes suggested in the overlay_style
:)
Approved from my side :) Could you add the opacity in as suggested? It's not visible in the demos, but it will be whenever a filter/parameter takes a long time!
The other potential remaining things:
- Fix unit tests - I think you just need to bring over your changes to the unit tests as well, as the components are tested for equality.
- Ignore all of the vizro-ai related tests (they currently don't run through, I'll take them out for your PR to merge, whenever it's ready 👍 )
First of all, @AnnMarieW congrats for the great Dash contribution, and also a big thank you for the Vizro contribution ❤️. Regarding this PR, I like the Also, I've tried a lot of So as I understood, these are the goals we want to achieve by utilising the
So, if
So, the same effect is keep popping up even if I change What do you think? @AnnMarieW @antonymilne @huong-li-nguyen |
Hi @petar-qb Yes, you are correct with the objectives of the Taking the Viro demo site as an example, currently, the loading spinner is displayed on every user interaction. Since the dataset is small, the spinner is displayed for less than one second in most cases. Adding Adding the It is tricky to get right, and it also depends a lot on the app and the preferences of the users. I agree that it might be best to let people add it as a custom component. Would you like me to close this PR now? |
Hey @AnnMarieW , I've talked with both @antonymilne and @petar-qb. You can still go ahead with the PR and add the As Petar said, let's not define delay_show/delay_hide for now 👍 |
Co-authored-by: Li Nguyen <[email protected]>
Co-authored-by: Li Nguyen <[email protected]>
Co-authored-by: Li Nguyen <[email protected]>
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one place where you would have to additionally change the dependency for the integration tests to pass:
https://github.com/mckinsey/vizro/blob/main/vizro-core/hatch.toml#L91
Just change it to dash==2.17.0
on that line :)
vizro-core/changelog.d/20240523_085359_amward_update_dcc_loading.md
Outdated
Show resolved
Hide resolved
…ng.md Co-authored-by: Li Nguyen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for this @AnnMarieW and for all the careful reviewing @huong-li-nguyen and @petar-qb 🙏
Hey everyone, I think adding the opacity is a nice addition and will make the transition between "loading" and "ready" smoother. However, there is still a flicker when the loading time is very short. Could you please try one more thing before closing this? I just tried setting the And of course if you prefer not to add this, I'm still delighted about the addition of the new loading overlay style 🙂 |
Hey @AnnMarieW. I tried it out and got that the "initial page load" flickers equally as it flickers without setting the Since we don't know the performance of users apps built using Vizro (since it depends on many factors), I wouldn't hardcode any delay, and just push the overlay argument. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AnnMarieW thanks again for your contribution! 🥇
I pushed some unit tests to make the CI 🟢 and the PR is now ready to go.
Description
Closes #486
This PR is a quick demo of a couple new features in dcc.Loading available in dash 2.17. This is just to make it easier to see how it it might work in Vizro apps.
It adds
delay_show=500
to reduce the flickering on short loading timesoverlay_style={"visibility": "visible", "filter": "blur(2px)"}
as an example of styling the background.I'm interested to hear what you think!
Notice
I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":