MCPcopy
hub / github.com/plotly/dash / get_app

Function get_app

tests/integration/multi_page/test_pages_layout.py:9–50  ·  view source on GitHub ↗
(path1="/", path2="/layout2")

Source from the content-addressed store, hash-verified

7
8
9def get_app(path1="/", path2="/layout2"):
10 app = Dash(__name__, use_pages=True)
11
12 # test for storing arbitrary keyword arguments: An `id` prop is defined for every page
13 # test for defining multiple pages within a single file: layout is passed directly to `register_page`
14 # in the following two modules:
15 dash.register_page(
16 "multi_layout1",
17 layout=html.Div("text for multi_layout1", id="text_multi_layout1"),
18 path=path1,
19 title="Supplied Title",
20 description="This is the supplied description",
21 name="Supplied name",
22 image="birds.jpeg",
23 id="multi_layout1",
24 )
25 dash.register_page(
26 "multi_layout2",
27 layout=html.Div("text for multi_layout2", id="text_multi_layout2"),
28 path=path2,
29 id="multi_layout2",
30 )
31
32 app.layout = html.Div(
33 [
34 html.Div(
35 [
36 html.Div(
37 dcc.Link(
38 f"{page['name']} - {page['path']}",
39 id=page["id"],
40 href=page["path"],
41 )
42 )
43 for page in dash.page_registry.values()
44 ]
45 ),
46 dash.page_container,
47 dcc.Location(id="url", refresh=True),
48 ]
49 )
50 return app
51
52
53def test_pala001_layout(dash_duo, clear_pages_state):

Callers 3

test_pala001_layoutFunction · 0.70

Calls 1

DashClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…