-
Notifications
You must be signed in to change notification settings - Fork 155
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 plain text component #1061
base: main
Are you sure you want to change the base?
Conversation
View the example dashboards of the current commit live on PyCafe ☕ 🚀Updated on: 2025-03-11 13:34:04 UTC Compare the examples using the commit's wheel file vs the latest released version: vizro-core/examples/scratch_devView with commit's wheel vs View with latest release vizro-core/examples/dev/View with commit's wheel vs View with latest release vizro-core/examples/visual-vocabulary/View with commit's wheel vs View with latest release vizro-core/examples/tutorial/View with commit's wheel vs View with latest release vizro-ai/examples/dashboard_ui/ |
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.
Very clean! Congrats @nadijagraca 🚀
I have a few comments, but this PR looks great in general.
<!-- | ||
### 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)) |
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.
Let's add an input here.
("""# Header""", "# Header"), | ||
("""_This **tests** emphasis_""", "_This **tests** emphasis_"), | ||
("""> This tests blockquotes""", "> This tests blockquotes"), | ||
("""* This tests list items""", "* This tests list items"), | ||
("Text to test card", "Text to test card"), | ||
("", ""), | ||
( | ||
"""""", | ||
"", | ||
), | ||
("""Code block: ```python print(1)```""", "Code block: ```python print(1)```"), | ||
("""[Example page](/test_page)""", "[Example page](/test_page)"), |
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.
Is there any difference between test_text
and expected
?
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.
Good question. Ar we trying to test various situation where it might be altered but isn't?
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.
Yes, this tests that Markdown does not modify the input string.
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.
Nice and clean ⭐
Since this is such a small component, can we add the docs in the same PR?
from vizro.models._models_utils import _log_call | ||
|
||
|
||
class Markdown(VizroBaseModel): |
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.
@antonymilne Do we really want to call the model Markdown
? Wouldn't vm.Text
be more declarative?
("""# Header""", "# Header"), | ||
("""_This **tests** emphasis_""", "_This **tests** emphasis_"), | ||
("""> This tests blockquotes""", "> This tests blockquotes"), | ||
("""* This tests list items""", "* This tests list items"), | ||
("Text to test card", "Text to test card"), | ||
("", ""), | ||
( | ||
"""""", | ||
"", | ||
), | ||
("""Code block: ```python print(1)```""", "Code block: ```python print(1)```"), | ||
("""[Example page](/test_page)""", "[Example page](/test_page)"), |
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.
Good question. Ar we trying to test various situation where it might be altered but isn't?
Description
Added a new
vm.Markdown
model, allowing users to add plain text to their dashboard layout.Screenshot
Notice
I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":