Skip to content

Commit 5465b63

Browse files
committed
more fixes
Signed-off-by: Thijs Baaijen <[email protected]>
1 parent a6c9ad3 commit 5465b63

File tree

4 files changed

+31
-32
lines changed

4 files changed

+31
-32
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ dev = [
4646
"pre-commit>=4",
4747
# Visualization (make sure these stay equalivalent to the 'visualizer' group)
4848
"dash>=3.0.0",
49-
"dash-bootstrap-components>=2.0.0",
49+
"dash-bootstrap-components>=2.0.3",
5050
"dash-cytoscape>=1.0.2",
5151
]
5252

src/power_grid_model_ds/_core/visualizer/callbacks/header.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
@callback(
12-
Output("right-col-content", "children"),
12+
Output("header-right-col", "children"),
1313
[
1414
Input("btn-legend", "n_clicks"),
1515
Input("btn-search", "n_clicks"),

src/power_grid_model_ds/_core/visualizer/layout/header.py

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,44 @@
99
from power_grid_model_ds._core.visualizer.layout.header_legenda import LEGENDA_ELEMENTS, LEGENDA_STYLE
1010
from power_grid_model_ds._core.visualizer.layout.header_search import SEARCH_ELEMENTS
1111

12-
_CONTENT_COLUMN_STYLE = {
12+
_LEFT_COLUMN_HTML = dbc.Col(
13+
[
14+
dbc.Button("Legend", id="btn-legend", className="me-2 btn-outline-primary"),
15+
dbc.Button("Search", id="btn-search", className="me-2 btn-outline-primary"),
16+
dbc.Button("Config", id="btn-config", className="me-2 btn-outline-primary"),
17+
],
18+
id="header-left-col",
19+
width=5,
20+
style={
21+
"display": "flex",
22+
"align-items": "center",
23+
"justify-content": "center",
24+
"border-right": "1px solid white",
25+
},
26+
)
27+
28+
29+
_RIGHT_COLUMN_STYLE = {
1330
"display": "flex",
1431
"align-items": "center",
1532
"width": "100%",
1633
}
1734

1835

19-
CONFIG_DIV = html.Div(CONFIG_ELEMENTS, style=_CONTENT_COLUMN_STYLE | {"justify-content": "space-between"})
20-
SEARCH_DIV = html.Div(SEARCH_ELEMENTS, style=_CONTENT_COLUMN_STYLE | {"justify-content": "center"})
21-
LEGENDA_DIV = html.Div(LEGENDA_ELEMENTS, style=_CONTENT_COLUMN_STYLE | LEGENDA_STYLE)
36+
CONFIG_DIV = html.Div(CONFIG_ELEMENTS, style=_RIGHT_COLUMN_STYLE | {"justify-content": "space-between"})
37+
SEARCH_DIV = html.Div(SEARCH_ELEMENTS, style=_RIGHT_COLUMN_STYLE | {"justify-content": "center"})
38+
LEGENDA_DIV = html.Div(LEGENDA_ELEMENTS, style=_RIGHT_COLUMN_STYLE | LEGENDA_STYLE)
2239

40+
_RIGHT_COLUMN_HTML = dbc.Col(
41+
[LEGENDA_DIV, SEARCH_DIV, CONFIG_DIV],
42+
id="header-right-col",
43+
width=7,
44+
)
2345

2446
HEADER_HTML = dbc.Row(
2547
[
26-
dbc.Col(
27-
[
28-
dbc.Button("Legend", id="btn-legend", color="primary", className="me-2"),
29-
dbc.Button("Search", id="btn-search", color="secondary", className="me-2"),
30-
dbc.Button("Config", id="btn-config", color="success", className="me-2"),
31-
],
32-
width=5,
33-
style={
34-
"display": "flex",
35-
"align-items": "center",
36-
"justify-content": "center",
37-
"border-right": "1px solid white",
38-
},
39-
),
40-
dbc.Col(
41-
[LEGENDA_DIV, SEARCH_DIV, CONFIG_DIV],
42-
id="right-col-content",
43-
width=7,
44-
style={
45-
"display": "flex",
46-
"align-items": "center",
47-
"justify-content": "space-between",
48-
# "width": "100%",
49-
},
50-
),
48+
_LEFT_COLUMN_HTML,
49+
_RIGHT_COLUMN_HTML,
5150
],
5251
style={
5352
"background-color": "#343a40",

src/power_grid_model_ds/_core/visualizer/layout/header_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class LayoutOptions(Enum):
5353
placeholder="Select layout",
5454
value=LayoutOptions.BREADTHFIRST.value,
5555
clearable=False,
56-
options=[{"label": option.name, "value": option.value} for option in LayoutOptions],
56+
options=[{"label": option.value, "value": option.value} for option in LayoutOptions],
5757
style={"width": "200px"},
5858
),
5959
style={"margin": "0 20px 0 10px", "color": "black"},

0 commit comments

Comments
 (0)