-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Demo] Replace KPI cards with dynamic figure functions (#648)
- Loading branch information
1 parent
369af7c
commit 208af57
Showing
9 changed files
with
315 additions
and
209 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
vizro-core/changelog.d/20240826_111009_huong_li_nguyen_replace_kpi_cards.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!-- | ||
A new scriv changelog fragment. | ||
Uncomment the section that is right (remove the HTML comment wrapper). | ||
--> | ||
|
||
<!-- | ||
### Highlights ✨ | ||
- A bullet item for the Highlights ✨ category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1)) | ||
--> | ||
<!-- | ||
### Removed | ||
- A bullet item for the Removed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1)) | ||
--> | ||
<!-- | ||
### Added | ||
- A bullet item for the Added category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1)) | ||
--> | ||
<!-- | ||
### Changed | ||
- A bullet item for the Changed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1)) | ||
--> | ||
<!-- | ||
### Deprecated | ||
- A bullet item for the Deprecated category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1)) | ||
--> | ||
<!-- | ||
### Fixed | ||
- A bullet item for the Fixed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1)) | ||
--> | ||
<!-- | ||
### Security | ||
- A bullet item for the Security category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1)) | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,40 @@ | ||
# KPI dashboard | ||
# KPI Dashboard | ||
|
||
This dashboard provides an example of a Key Performance Indicator (KPI) dashboard, designed to help users get started and extend further. | ||
It uses fictional budget data to demonstrate the capabilities of Vizro using real world applications. | ||
This dashboard provides an example of a Key Performance Indicator (KPI) dashboard, designed to help users get started | ||
and extend further. It uses fictional budget data to demonstrate the capabilities of Vizro using real world applications. | ||
|
||
Special thanks to the [#RWFD Real World Fake Data initiative](https://opendatainitiative.io/), a community project that | ||
**Created by:** [Huong Li Nguyen](https://github.com/huong-li-nguyen) | ||
|
||
--- | ||
|
||
### 🗓️ Data | ||
|
||
Special thanks to the [#RWFD Real World Fake Data initiative](https://data.world/markbradbourne/rwfd-real-world-fake-data), a community project that | ||
provides high-quality fake data for creating realistic dashboard examples for real-world applications. | ||
|
||
Note: The data has been additionally edited for the purpose of this example. | ||
**Note:** The data has been additionally edited for the purpose of this example. | ||
|
||
### 📊 Plotly resources | ||
|
||
- [Bar charts](https://plotly.com/python/bar-charts/) | ||
- [Pie charts](https://plotly.com/python/pie-charts/) | ||
- [Choropleth maps](https://plotly.com/python/choropleth-maps/) | ||
- [Unstacked area charts](https://plotly.com/python/filled-area-plots/) | ||
|
||
<img src="./assets/images/kpi_dashboard.gif" alt="Gif to KPI dashboard"> | ||
### 🚀 Vizro features applied | ||
|
||
- [Vizro tutorial on pages, layouts and dashboards](https://vizro.readthedocs.io/en/stable/pages/tutorials/explore-components/) | ||
- [Custom components](https://vizro.readthedocs.io/en/stable/pages/user-guides/custom-components/) | ||
- [Custom charts](https://vizro.readthedocs.io/en/stable/pages/user-guides/custom-charts/) | ||
- [Custom CSS](https://vizro.readthedocs.io/en/stable/pages/user-guides/assets/) | ||
|
||
### 🖥️ App demo | ||
|
||
<img src="./images/kpi-dashboard.gif" alt="Gif to KPI dashboard" width="600"> | ||
|
||
--- | ||
|
||
## How to run the example locally | ||
|
||
1. If you have `hatch` set up, run the example with the command `hatch run example kpi`. Otherwise, run the `app.py` file with your environment activated where `vizro` is installed. | ||
1. Run the `app.py` file with your environment activated where `vizro` is installed. | ||
2. You should now be able to access the app locally via http://127.0.0.1:8050/. | ||
|
||
## Possible future iterations | ||
|
||
- Enable selection of year filter | ||
- Enable current year vs. past year comparison | ||
- Enable dynamic KPI Cards | ||
- Bar - Enable drill-downs from Issue to Sub-issue and Product to Sub-product | ||
- Bar - Reformat numbers with commas in bar chart | ||
- Bar - Left-align y-axis labels | ||
- Bar - Shorten labels | ||
- Line - Customize function to always show selected year vs. past year | ||
- Table-view - Check why date format does not work on `Date Received` | ||
- Table-view - Add icons to `On time?` column | ||
- Table-view - Improve speed by applying cache or overcome limitation that entire data set is loaded in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.