mckinsey / vizro

Vizro is a toolkit for creating modular data visualization applications.
https://vizro.readthedocs.io/en/stable/
Apache License 2.0
2.61k stars 116 forks source link

Tidy demo apps and `examples` folder #267

Closed huong-li-nguyen closed 7 months ago

huong-li-nguyen commented 7 months ago

Description

Screenshot

Dev - Dashboard

Screenshot 2024-01-17 at 08 28 19

Features - Dashboard

Screenshot 2024-01-17 at 09 07 20

Notice

petar-qb commented 7 months ago

I'm just curious..

huong-li-nguyen commented 7 months ago

I'm just curious..

  • What did we decide about adding dict and json examples?
  • Why is the _dev example underscored if it is the default run with the hatch run example?
  • Do we also need to add hatch run example-dev (and still keep this shortcut hatch run example)?
huong-li-nguyen commented 7 months ago

@antonymilne - any idea why the linting fails on the json inside the devcontainer? I didn't change it and somehow the pre-commit hook cannot fix it automatically? I can't fix it locally either πŸ˜…

Do we even need that file if we don't have a code tour anymore?

antonymilne commented 7 months ago

@antonymilne - any idea why the linting fails on the json inside the devcontainer? I didn't change it and somehow the pre-commit hook cannot fix it automatically? I can't fix it locally either πŸ˜…

Do we even need that file if we don't have a code tour anymore?

We should keep this file because it's useful for codespaces in general even without code tour, and actually it's something I'd like to work on more in future.

No idea why it would fail linting all of a sudden, especially because it passes the pre-commit.ci checks on commit [pre-commit.ci] auto fixes from pre-commit.com hooks, which I trust more than our own checks.

The only things I can think of are:

maxschulz-COL commented 7 months ago

While working on the AG Grid yaml docs, I have realised that I think the yaml dev version would also be good. It's also something we do not need to keep in sync, so it is a one time effort. It would be great if you could add that one too.

Like that we can all set our PyCHarm/VSCode run configurations to both scripts, and its super quick to test either implementation and test the examples

huong-li-nguyen commented 7 months ago

While working on the AG Grid yaml docs, I have realised that I think the yaml dev version would also be good. It's also something we do not need to keep in sync, so it is a one time effort. It would be great if you could add that one too.

Like that we can all set our PyCHarm/VSCode run configurations to both scripts, and its super quick to test either implementation and test the examples

The AG-Grid I would expect to be added to the examples-feat dashboard? And then we should have a yaml version there? I can also add a yaml version to dev though. The reason why I initially just added the pydantic version in there was to show how the structure of a basic app would be (so not extra path for assets for example).

But I guess we're mixing dev and basic app again πŸ˜…

maxschulz-COL commented 7 months ago

While working on the AG Grid yaml docs, I have realised that I think the yaml dev version would also be good. It's also something we do not need to keep in sync, so it is a one time effort. It would be great if you could add that one too. Like that we can all set our PyCHarm/VSCode run configurations to both scripts, and its super quick to test either implementation and test the examples

The AG-Grid I would expect to be added to the examples-feat dashboard? And then we should have a yaml version there? I can also add a yaml version to dev though. The reason why I initially just added the pydantic version in there was to show how the structure of a basic app would be (so not extra path for assets for example).

But I guess we're mixing dev and basic app again πŸ˜…

Hm yh, so for me it was independent of the AGGrid. Just as a place to paste a quick yaml config that is based on one registered dataframe (potentially gapminder). Ideally we should have in the python part of that yaml version all datasets registered that are used throughout our examples. Like that a developer can immediately paste any yaml config, and test an isolated example.

wdyt?

huong-li-nguyen commented 7 months ago

While working on the AG Grid yaml docs, I have realised that I think the yaml dev version would also be good. It's also something we do not need to keep in sync, so it is a one time effort. It would be great if you could add that one too. Like that we can all set our PyCHarm/VSCode run configurations to both scripts, and its super quick to test either implementation and test the examples

The AG-Grid I would expect to be added to the examples-feat dashboard? And then we should have a yaml version there? I can also add a yaml version to dev though. The reason why I initially just added the pydantic version in there was to show how the structure of a basic app would be (so not extra path for assets for example). But I guess we're mixing dev and basic app again πŸ˜…

Hm yh, so for me it was independent of the AGGrid. Just as a place to paste a quick yaml config that is based on one registered dataframe (potentially gapminder). Ideally we should have in the python part of that yaml version all datasets registered that are used throughout our examples. Like that a developer can immediately paste any yaml config, and test an isolated example.

wdyt?

I've added the yaml to the dev folder now

maxschulz-COL commented 7 months ago

I've added the yaml to the dev folder now

Which datasets are we registering? For now I guess only gapminder?

huong-li-nguyen commented 7 months ago

I've added the yaml to the dev folder now

Which datasets are we registering? For now I guess only gapminder?

iris for the dev example

huong-li-nguyen commented 7 months ago

I didn't look through the features dashboard in detail because others have already done so, but generally this looks great! Thanks very much for doing it.

  1. I think we should try to simplify the directory structure slightly. Can we change the structure of demo to look like this?
demo
β”œβ”€β”€ app.py
β”œβ”€β”€ assets
β”‚   └── ...
β”œβ”€β”€ jupyter_version
β”‚   └── app.ipynb
└── yaml_version
    β”œβ”€β”€ app.py
    └── dashboard.yaml

So the default folder no longer exists, and I've renamed some folders too. Same changes would apply to features. Then we can change the default app.py to not take user_assets_folder argument any more.

  1. Is it possible to put the images that are top-level inside assets inside assets/images instead? Certainly with app.svg and logo.svg that should work (it's actually the main reason we rolled our own infer_images function rather than use Dash's own one), not sure about favicon though but I think probably not possible for that.
  2. After that let's talk about the best way to make changes to hatch.toml and the tests, because I think the previous setup was tidier and we should still be able to achieve something very similar without such heavy changes.
  3. Do we have a list somewhere of all the other various future ideas/TODOs for demo dashboards, like the stuff I mentioned on slack? Would be good to keep track of it :)

Can do - we can talk about the required changes to hatch.toml later in the call then. I think the separate folders with default / yaml_example made it easy to configure the hatch commands. Not sure how it will look like now?

1 βœ… 2 βœ… 3 - currently broken 4 βœ… https://github.com/McK-Internal/vizro-internal/issues/520

maxschulz-COL commented 7 months ago

I've added the yaml to the dev folder now

Which datasets are we registering? For now I guess only gapminder?

iris for the dev example

Awesome! Could we also register gapminder and gapminder_2007 just for ease of use?