Skip to content

How to associate the change of "$vuetify.theme.dark" to the change of another variable using vuetify3? #655

Answered by jourdain
tayranmila asked this question in Q&A
Discussion options

You must be logged in to vote

I put the answer here and below for reference

import plotly.express as px

from trame.app import get_server
from trame.ui.vuetify3 import SinglePageWithDrawerLayout
from trame.ui.router import RouterViewLayout
from trame.widgets import router, plotly
from trame.widgets import vuetify3 as vuetify


# -----------------------------------------------------------------------------
# Charts
# -----------------------------------------------------------------------------


def scatter():
    df = px.data.iris()

    template = "plotly"
    if state.theme_mode == "dark":
        template = "plotly_dark"

    fig = px.scatter(
        df,
        x="sepal_width",
        y="sepal_length",
        c…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@tayranmila
Comment options

Answer selected by tayranmila
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants