Skip to content

Commit

Permalink
Merge pull request #37 from AnnMarieW/fix-34
Browse files Browse the repository at this point in the history
fixed ThemeSwitchAIO id
  • Loading branch information
AnnMarieW authored Jul 29, 2024
2 parents b3955f7 + 3607973 commit cfc5db1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion examples/demo_theme_change_4_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def make_figures(template):
),
className="border",
)
print(graph1)
graph2 = dcc.Graph(
figure=px.scatter(
gapminder,
Expand Down
9 changes: 7 additions & 2 deletions src/aio/aio_theme_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ class ids:
"subcomponent": "store",
"aio_id": aio_id,
}
assetsPath = lambda aio_id: {
"component": "ThemeSwitchAIO",
"subcomponent": "assetsPath",
"aio_id": aio_id,
}

ids = ids

Expand Down Expand Up @@ -96,7 +101,7 @@ def __init__(
],
),
dcc.Store(id=self.ids.store(aio_id), data=themes),
dcc.Store(id='assets-url-path-store', data=app.config.assets_url_path)
dcc.Store(id=self.ids.assetsPath(aio_id), data=app.config.assets_url_path)
]
)

Expand All @@ -105,5 +110,5 @@ def __init__(
Output(ids.store(MATCH), "id"),
Input(ids.switch(MATCH), "value"),
Input(ids.store(MATCH), "data"),
State("assets-url-path-store", "data"),
State(ids.assetsPath(MATCH), "data"),
)

0 comments on commit cfc5db1

Please sign in to comment.