-
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.
- Loading branch information
1 parent
b46c433
commit f7750d4
Showing
5 changed files
with
110 additions
and
29 deletions.
There are no files selected for viewing
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
47 changes: 47 additions & 0 deletions
47
...ore/changelog.d/20240708_185435_huong_li_nguyen_enable_dynamic_option_height.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,47 @@ | ||
<!-- | ||
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 | ||
|
||
- Update `optionHeight` of `vm.Dropdown` dynamically based on character length. ([#574](https://github.com/mckinsey/vizro/pull/574)) | ||
|
||
<!-- | ||
### 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,38 +1,38 @@ | ||
"""Dev app to try things out.""" | ||
|
||
import numpy as np | ||
import vizro.models as vm | ||
import vizro.plotly.express as px | ||
from vizro import Vizro | ||
|
||
page_1 = vm.Page(title="Page 1", components=[vm.Card(text="Placeholder")]) | ||
page_2 = vm.Page(title="Page 2", components=[vm.Card(text="Placeholder")]) | ||
page_3 = vm.Page(title="Page 3", components=[vm.Card(text="Placeholder")]) | ||
page_4 = vm.Page(title="Page 4", components=[vm.Card(text="Placeholder")]) | ||
page_5 = vm.Page(title="Page 5", components=[vm.Card(text="Placeholder")]) | ||
page_6 = vm.Page(title="Page 6", components=[vm.Card(text="Placeholder")]) | ||
page_7 = vm.Page(title="Page 7", components=[vm.Card(text="Placeholder")]) | ||
page_8 = vm.Page(title="Page 8", components=[vm.Card(text="Placeholder")]) | ||
page_9 = vm.Page(title="Page 9", components=[vm.Card(text="Placeholder")]) | ||
page_10 = vm.Page(title="Page 10", components=[vm.Card(text="Placeholder")]) | ||
df = px.data.iris() | ||
df["species_one_long"] = np.where( | ||
df["species"] == "setosa", "setosa is one common species you can select in the iris dataset.", df["species"] | ||
) | ||
df["species_long"] = df["species"] + " is one common species you can select in the iris dataset." | ||
df["species_very_long"] = ( | ||
df["species"] | ||
+ " is one common species you can select in the iris dataset is one common species you can select in the iris data." | ||
) | ||
|
||
dashboard = vm.Dashboard( | ||
pages=[page_1, page_2, page_3, page_4, page_5, page_6, page_7, page_8, page_9, page_10], | ||
navigation=vm.Navigation( | ||
nav_selector=vm.NavBar( | ||
items=[ | ||
vm.NavLink(label="Page 1", pages=["Page 1"], icon="Home"), | ||
vm.NavLink(label="Page 1", pages=["Page 2"], icon="Home"), | ||
vm.NavLink(label="Page 1", pages=["Page 3"], icon="Home"), | ||
vm.NavLink(label="Page 1", pages=["Page 4"], icon="Home"), | ||
vm.NavLink(label="Page 1", pages=["Page 5"], icon="Home"), | ||
vm.NavLink(label="Page 1", pages=["Page 6"], icon="Home"), | ||
vm.NavLink(label="Page 1", pages=["Page 7"], icon="Home"), | ||
vm.NavLink(label="Page 1", pages=["Page 8"], icon="Home"), | ||
vm.NavLink(label="Page 1", pages=["Page 9"], icon="Home"), | ||
vm.NavLink(label="Page 1", pages=["Page 10"], icon="Home"), | ||
] | ||
) | ||
), | ||
page = vm.Page( | ||
title="", | ||
components=[ | ||
vm.Graph( | ||
id="graph_1", | ||
figure=px.scatter(df, title="Title", x="sepal_width", y="sepal_length", color="species"), | ||
), | ||
], | ||
controls=[ | ||
vm.Filter(column="species"), | ||
vm.Filter(column="species_long"), | ||
vm.Filter(column="species_one_long"), | ||
vm.Filter(column="species_very_long"), | ||
], | ||
) | ||
|
||
|
||
dashboard = vm.Dashboard(pages=[page]) | ||
|
||
if __name__ == "__main__": | ||
Vizro().build(dashboard).run() |
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
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