Skip to content

Commit bba1e51

Browse files
authored
Merge branch 'main' into development
2 parents 3a18789 + a3fa53f commit bba1e51

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
- Added the hint that for the api example the example records need to be run first to create the run.
99
- Added links to GitHub pages in the web-based UI for help and more details on the method.
1010

11+
## Parallel Coordinates
12+
- Set the margin of the graph so it gets dynamically computed depending on the length of the labels.
13+
1114
## New SMAC version compatibility
1215
- The smac3v2 converter can now also handle the output of the new smac version
1316

deepcave/plugins/hyperparameter/parallel_coordinates.py

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,17 @@ def get_output_layout(register: Callable) -> dcc.Graph:
337337
dcc.Graph
338338
The layouts for the output block.
339339
"""
340-
return dcc.Graph(
341-
register("graph", "figure"),
342-
style={"height": config.FIGURE_HEIGHT},
343-
config={"toImageButtonOptions": {"scale": config.FIGURE_DOWNLOAD_SCALE}},
340+
return html.Div(
341+
dcc.Graph(
342+
register("graph", "figure"),
343+
config={"toImageButtonOptions": {"scale": config.FIGURE_DOWNLOAD_SCALE}},
344+
style={"width": "1200px", "height": "800px"},
345+
),
346+
style={
347+
"overflowX": "scroll",
348+
"overflowY": "scroll",
349+
"height": "500px",
350+
},
344351
)
345352

346353
@staticmethod
@@ -430,17 +437,26 @@ def load_outputs(run, inputs, outputs) -> go.Figure: # type: ignore
430437
colorscale="aggrnyl",
431438
)
432439

440+
# Margin size is dynamically computed depending on the length of the labels
441+
char_width_px = 8
442+
max_label_length = max([len(label) for label in data.keys()])
443+
top_margin = max_label_length * char_width_px
444+
left_margin = max_label_length * char_width_px
445+
433446
figure = go.Figure(
434447
data=go.Parcoords(
435448
line=line,
436449
dimensions=list([d for d in data.values()]),
437-
labelangle=45,
450+
labelangle=30,
438451
),
439452
layout=dict(
440-
margin=dict(t=150, b=50, l=100, r=0),
453+
margin=dict(t=top_margin, b=50, l=left_margin, r=0),
441454
font=dict(size=config.FIGURE_FONT_SIZE),
442455
),
443456
)
457+
458+
figure.update_layout(width=max(1000, len(list([d for d in data.values()])) * 100))
459+
444460
save_image(figure, "parallel_coordinates.pdf")
445461

446462
return figure

0 commit comments

Comments
 (0)