From eb883fa96721f0664d9ad412a4d2c2bf01b559de Mon Sep 17 00:00:00 2001 From: Dvermetten Date: Tue, 21 Apr 2026 11:56:34 +0200 Subject: [PATCH 1/3] Update UI of the table --- docs/index.html | 164 ++++++++++++++++++++++--- docs/javascript.html | 140 +++++++++++++++++++--- docs/problems.html | 25 +++- docs/table_styles.css | 273 +++++++++++++++++++++++++++++++++++++++--- yaml_to_html.py | 52 +++++++- 5 files changed, 594 insertions(+), 60 deletions(-) diff --git a/docs/index.html b/docs/index.html index c544e1f..d39b48e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -24,7 +24,20 @@

OPL – Optimisation problem library

Submit problems and corrections on GitHub with pull requests / issues, through the Google form, or by email: koen.van.der.blom@cwi.nl

- + +
+
+
Visible columns
+
+ + +
+
+ +
+
+
+
@@ -1215,46 +1228,161 @@

OPL – Optimisation problem library

name
name textual description suite/generator/single objectives dimensionality variable type constraints dynamic noise multi-fidelity source (real-world/artificial) reference implementation
+ + + +
+

Problem details

+

Click a table row to inspect full details.

+
+
+ diff --git a/docs/javascript.html b/docs/javascript.html index a194ca7..73f9e58 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -1,44 +1,150 @@ diff --git a/docs/problems.html b/docs/problems.html index 4c2be02..768796d 100644 --- a/docs/problems.html +++ b/docs/problems.html @@ -1,4 +1,17 @@ - + +
+
+
Visible columns
+
+ + +
+
+ +
+
+
+
@@ -1188,4 +1201,12 @@ -
namehttps://gitlab.com/verel/pubo-importance-benchmark
name textual description suite/generator/single objectives dimensionality variable type constraints dynamic noise multi-fidelity source (real-world/artificial) reference implementation
\ No newline at end of file +name textual description suite/generator/single objectives dimensionality variable type constraints dynamic noise multi-fidelity source (real-world/artificial) reference implementation + + + +
+

Problem details

+

Click a table row to inspect full details.

+
+
diff --git a/docs/table_styles.css b/docs/table_styles.css index 05418c8..439f38c 100644 --- a/docs/table_styles.css +++ b/docs/table_styles.css @@ -1,35 +1,274 @@ -/* Apply to everything */ +:root { + --opl-bg: #f5f7fb; + --opl-surface: #ffffff; + --opl-text: #12263a; + --opl-muted: #607389; + --opl-border: #d7e1ec; + --opl-accent: #0f6c8b; + --opl-accent-soft: #eaf4fa; + --opl-heading: "Segoe UI", "Trebuchet MS", sans-serif; + --opl-body: "Tahoma", "Verdana", sans-serif; +} + * { - font-family: sans-serif; + box-sizing: border-box; } body { margin: 1vw; - background-color: WhiteSmoke; + font-family: var(--opl-body); + color: var(--opl-text); + background: + radial-gradient(circle at 4% 2%, #e6edf7 0, #e6edf700 34%), + radial-gradient(circle at 92% 4%, #ecf3df 0, #ecf3df00 38%), + var(--opl-bg); +} + +h2 { + font-family: var(--opl-heading); + letter-spacing: 0.01em; +} + +.table-shell { + margin-top: 1rem; + border: 1px solid var(--opl-border); + border-radius: 16px; + background: var(--opl-surface); + box-shadow: 0 14px 30px rgba(17, 37, 61, 0.08); + overflow: hidden; +} + +.table-toolbar { + display: grid; + gap: 0.65rem; + padding: 0.9rem 1rem; + border-bottom: 1px solid var(--opl-border); + background: linear-gradient(90deg, #f7fafc, #edf6fb); +} + +.toolbar-title { + font-size: 0.78rem; + text-transform: uppercase; + letter-spacing: 0.08em; + font-weight: 700; + color: var(--opl-muted); +} + +.toolbar-actions { + display: flex; + flex-wrap: wrap; + gap: 0.45rem; +} + +.toolbar-btn { + border: 1px solid #b8c8df; + background: #fff; + color: #1b3249; + border-radius: 8px; + padding: 0.36rem 0.62rem; + font-size: 0.8rem; + font-weight: 600; + cursor: pointer; + transition: all 120ms ease; +} + +.toolbar-btn:hover { + background: #eff6fb; + border-color: #94adc9; +} + +.toolbar-btn:active { + transform: translateY(1px); +} + +.column-controls { + display: flex; + flex-wrap: wrap; + gap: 0.45rem; +} + +.column-chip { + display: inline-flex; + align-items: center; + gap: 0.4rem; + padding: 0.35rem 0.65rem; + border-radius: 999px; + border: 1px solid var(--opl-border); + background: #fff; + font-size: 0.82rem; + cursor: pointer; + user-select: none; + transition: all 120ms ease; +} + +.column-chip:hover { + border-color: #b8c8df; + background: #f7fbfd; +} + +.column-chip.is-off { + color: var(--opl-muted); + background: #f1f5f9; +} + +.column-chip input { + accent-color: var(--opl-accent); +} + +.table-wrap { + overflow-x: auto; + padding: 0.45rem; +} + +#problems { + width: 100%; + min-width: 980px; + border-collapse: separate; + border-spacing: 0; +} + +#problems thead th { + background: #f9fcff; + color: #1d324a; + border-bottom: 1px solid var(--opl-border); + font-weight: 700; + white-space: nowrap; +} + +#problems td { + vertical-align: top; + line-height: 1.4; +} + +#problems th:first-child { + position: sticky; + left: 0; + z-index: 5; + background: #f9fcff; + box-shadow: 1px 0 0 0 var(--opl-border); +} + +#problems td:first-child { + position: sticky; + left: 0; + z-index: 2; + background: #fcfeff; + box-shadow: 1px 0 0 0 var(--opl-border); +} + +#problems tbody tr:nth-of-type(odd) td { + background: #fcfeff; +} + +#problems tbody tr:nth-of-type(even) td { + background: #f8fbfe; +} + +#problems tbody tr:hover td { + background: var(--opl-accent-soft); +} + +#problems tbody tr:hover td:first-child { + background: #deedf6; +} + +#problems tbody tr.is-active td { + background: #dceefa; } -input[type=text] { - background-color: #3CBC8D; - color: white; +#problems tbody tr.is-active td:first-child { + background: #cce5f5; } -.styled-table { - font-size: 0.9em; - box-shadow: 0 0 20px rgba(0, 0, 0, 0.15); +#problems a { + color: #085f75; } -.styled-table thead tr { - background-color: AntiqueWhite; +#problems thead input { + width: 100%; + padding: 0.35rem 0.45rem; + border-radius: 6px; + border: 1px solid var(--opl-border); + background: #fff; + color: var(--opl-text); } -.styled-table tbody tr:nth-of-type(odd) { - background-color: SeaShell; +.details-shell { + margin-top: 0.9rem; + padding: 0.9rem 1rem; + border: 1px solid var(--opl-border); + border-radius: 14px; + background: var(--opl-surface); + box-shadow: 0 10px 24px rgba(17, 37, 61, 0.06); } -.styled-table tbody tr:nth-of-type(even) { - background-color: Snow; +.details-title { + margin: 0 0 0.3rem; + font-family: var(--opl-heading); + font-size: 1.02rem; } -.styled-table tbody tr:hover { - filter: brightness(.975); +.details-hint { + margin: 0 0 0.75rem; + color: var(--opl-muted); + font-size: 0.88rem; +} + +.details-grid { + margin: 0; + display: grid; + grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); + gap: 0.6rem; +} + +.detail-item { + margin: 0; + border: 1px solid var(--opl-border); + border-radius: 10px; + padding: 0.55rem 0.65rem; + background: #fbfdff; +} + +.detail-item dt { + margin: 0; + color: #23415e; + font-size: 0.74rem; + text-transform: uppercase; + letter-spacing: 0.04em; + font-weight: 700; +} + +.detail-item dd { + margin: 0.35rem 0 0; + color: var(--opl-text); + font-size: 0.86rem; + line-height: 1.4; + overflow-wrap: anywhere; +} + +.details-empty { + color: var(--opl-muted); + font-style: italic; +} + +@media (max-width: 900px) { + body { + margin: 0.6rem; + } + + .table-toolbar { + padding: 0.8rem; + } + + .column-chip { + font-size: 0.76rem; + } + + .details-shell { + padding: 0.8rem; + } + + .details-grid { + grid-template-columns: 1fr; + } } diff --git a/yaml_to_html.py b/yaml_to_html.py index a9a219f..1bef2dd 100755 --- a/yaml_to_html.py +++ b/yaml_to_html.py @@ -3,6 +3,7 @@ import pandas as pd import yaml import shutil +from html import escape import re @@ -30,8 +31,8 @@ def repl(m): html_index = f"{html_dir}index.html" # Load data -with open(yaml_file) as in_file: - data = pd.json_normalize(yaml.safe_load(in_file)) +with open(yaml_file) as yaml_input: + data = pd.json_normalize(yaml.safe_load(yaml_input)) # Choose desired columns all_columns = False @@ -68,12 +69,51 @@ def repl(m): idx = table.index('') final_table = table[:idx] + "" + " ".join([""+ i +"" for i in data.columns])+" " + table[idx:] +default_hidden_columns = {"textual description", "reference", "implementation"} + +column_toggles = "".join( + [ + ( + f'' + ) + for i, col in enumerate(data.columns) + ] +) + +modern_table_block = f""" +
+
+
Visible columns
+
+ + +
+
+ {column_toggles} +
+
+
+ {final_table} +
+
+ +
+

Problem details

+

Click a table row to inspect full details.

+
+
+""" + # Write table to file with open(html_table, "w") as table_file: - table_file.write(final_table) + table_file.write(modern_table_block) # Merge table and scripts into HTML page with open(html_index, "wb") as output_file: - for in_file in [html_header, html_table, html_scripts, html_footer]: - with open(in_file, "rb") as in_file: - shutil.copyfileobj(in_file, output_file) + for part_path in [html_header, html_table, html_scripts, html_footer]: + with open(part_path, "rb") as part_file: + shutil.copyfileobj(part_file, output_file) From 5d1c6b9910a103c86c98c191c89a51de62313de9 Mon Sep 17 00:00:00 2001 From: Dvermetten Date: Tue, 21 Apr 2026 12:30:15 +0200 Subject: [PATCH 2/3] Remove gradient because Koen doesn't like it --- docs/table_styles.css | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/table_styles.css b/docs/table_styles.css index 439f38c..e352e97 100644 --- a/docs/table_styles.css +++ b/docs/table_styles.css @@ -19,8 +19,6 @@ body { font-family: var(--opl-body); color: var(--opl-text); background: - radial-gradient(circle at 4% 2%, #e6edf7 0, #e6edf700 34%), - radial-gradient(circle at 92% 4%, #ecf3df 0, #ecf3df00 38%), var(--opl-bg); } From ec7576dcec93d21a3b04fc7f4082532479e306c2 Mon Sep 17 00:00:00 2001 From: Dvermetten Date: Tue, 21 Apr 2026 14:01:54 +0200 Subject: [PATCH 3/3] Further separation of html from conversion script --- docs/index.html | 1 - docs/problems.html | 1 - docs/table_styles.css | 8 ++++++++ docs/table_template.html | 21 +++++++++++++++++++++ yaml_to_html.py | 36 +++++++++++------------------------- 5 files changed, 40 insertions(+), 27 deletions(-) create mode 100644 docs/table_template.html diff --git a/docs/index.html b/docs/index.html index d39b48e..26a801d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -24,7 +24,6 @@

OPL – Optimisation problem library

Submit problems and corrections on GitHub with pull requests / issues, through the Google form, or by email: koen.van.der.blom@cwi.nl

-
Visible columns
diff --git a/docs/problems.html b/docs/problems.html index 768796d..d3040ea 100644 --- a/docs/problems.html +++ b/docs/problems.html @@ -1,4 +1,3 @@ -
Visible columns
diff --git a/docs/table_styles.css b/docs/table_styles.css index e352e97..1c53f6d 100644 --- a/docs/table_styles.css +++ b/docs/table_styles.css @@ -8,6 +8,7 @@ --opl-accent-soft: #eaf4fa; --opl-heading: "Segoe UI", "Trebuchet MS", sans-serif; --opl-body: "Tahoma", "Verdana", sans-serif; + --opl-table-font-size: 0.86rem; } * { @@ -123,6 +124,7 @@ h2 { min-width: 980px; border-collapse: separate; border-spacing: 0; + font-size: var(--opl-table-font-size); } #problems thead th { @@ -136,6 +138,11 @@ h2 { #problems td { vertical-align: top; line-height: 1.4; + font-size: inherit; +} + +#problems td * { + font-size: inherit; } #problems th:first-child { @@ -189,6 +196,7 @@ h2 { border: 1px solid var(--opl-border); background: #fff; color: var(--opl-text); + font-size: inherit; } .details-shell { diff --git a/docs/table_template.html b/docs/table_template.html new file mode 100644 index 0000000..270d61f --- /dev/null +++ b/docs/table_template.html @@ -0,0 +1,21 @@ +
+
+
Visible columns
+
+ + +
+
+ __COLUMN_TOGGLES__ +
+
+
+ __TABLE__ +
+
+ +
+

Problem details

+

Click a table row to inspect full details.

+
+
diff --git a/yaml_to_html.py b/yaml_to_html.py index 1bef2dd..87e8cce 100755 --- a/yaml_to_html.py +++ b/yaml_to_html.py @@ -29,6 +29,7 @@ def repl(m): html_scripts = f"{html_dir}javascript.html" html_footer = f"{html_dir}footer.html" html_index = f"{html_dir}index.html" +html_table_template = f"{html_dir}table_template.html" # Load data with open(yaml_file) as yaml_input: @@ -84,33 +85,18 @@ def repl(m): ] ) -modern_table_block = f""" -
-
-
Visible columns
-
- - -
-
- {column_toggles} -
-
-
- {final_table} -
-
- -
-

Problem details

-

Click a table row to inspect full details.

-
-
-""" +with open(html_table_template, encoding="utf-8") as template_file: + table_template = template_file.read() + +table_markup = ( + table_template + .replace("__COLUMN_TOGGLES__", column_toggles) + .replace("__TABLE__", final_table) +) # Write table to file -with open(html_table, "w") as table_file: - table_file.write(modern_table_block) +with open(html_table, "w", encoding="utf-8") as table_file: + table_file.write(table_markup) # Merge table and scripts into HTML page with open(html_index, "wb") as output_file: