Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/mckinsey/vizro into qa/comp…
Browse files Browse the repository at this point in the history
…onent_library_tests
  • Loading branch information
l0uden committed Nov 20, 2024
2 parents 2b48abc + c46383c commit bbe76f4
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 30 deletions.
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))
-->
40 changes: 36 additions & 4 deletions vizro-core/examples/scratch_dev/app.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,47 @@
"""Dev app to try things out."""

import pandas as pd
import vizro.models as vm
import vizro.plotly.express as px
from vizro import Vizro
from vizro._themes._color_values import COLORS
import dash_bootstrap_components as dbc
from dash import html

from typing import Literal

from dash import html

import vizro.models as vm
from vizro import Vizro


class Tooltip(vm.VizroBaseModel):
type: Literal["tooltip"] = "tooltip"
text: str = "This is a tooltip"

def build(self):
return html.Div(
[
dbc.Button("Button", id=f"{self.id}-tooltip-target"),
dbc.Tooltip(
self.text,
target=f"{self.id}-tooltip-target",
is_open=True,
),
]
)


vm.Page.add_type("components", Tooltip)

page = vm.Page(
title="Button Styling",
layout=vm.Layout(grid=[[0, 1]]),
title="Custom Component",
components=[
vm.Button(),
vm.Button(text="Take me home", href="/"),
Tooltip(text="Tooltip label"),
Tooltip(
text="Max. width of tooltip should not exceed 180px - this instance should be used for multiple lines of text for increased legibility."
),
],
)

Expand Down
25 changes: 0 additions & 25 deletions vizro-core/src/vizro/static/css/tooltip.css

This file was deleted.

2 changes: 1 addition & 1 deletion vizro-core/src/vizro/static/css/vizro-bootstrap.min.css

Large diffs are not rendered by default.

0 comments on commit bbe76f4

Please sign in to comment.