Skip to content

Commit f526ea5

Browse files
committed
remove unused functions
1 parent 04ee83f commit f526ea5

2 files changed

Lines changed: 0 additions & 80 deletions

File tree

ml_peg/app/utils/build_components.py

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -455,60 +455,6 @@ def build_plot_download_controls(graph_id: str) -> Div:
455455
)
456456

457457

458-
def build_image_download_controls(image_id: str, uris: dict) -> Div:
459-
"""
460-
Build download controls for a pre-rendered image (PNG/SVG/JSON).
461-
462-
Parameters
463-
----------
464-
image_id
465-
Unique identifier for the image (used as pattern-match index).
466-
uris
467-
Mapping of format keys (``"png"``, ``"svg"``, ``"json"``) to data URIs.
468-
469-
Returns
470-
-------
471-
Div
472-
Download controls and hidden components.
473-
"""
474-
options = [{"label": k.upper(), "value": k} for k in uris]
475-
return Div(
476-
[
477-
Dropdown(
478-
id={"type": "image-download-format", "index": image_id},
479-
className="download-format plot-download-format",
480-
options=options,
481-
value=options[0]["value"] if options else "png",
482-
clearable=False,
483-
searchable=False,
484-
style={"width": "76px", "height": "30px", "fontSize": "12px"},
485-
),
486-
Button(
487-
"Download plot",
488-
id={"type": "image-download-button", "index": image_id},
489-
className="download-button plot-download-button",
490-
n_clicks=0,
491-
style={"width": "112px"},
492-
),
493-
Download(id={"type": "image-download", "index": image_id}),
494-
Store(
495-
id={"type": "image-download-target", "index": image_id},
496-
storage_type="memory",
497-
data=uris,
498-
),
499-
],
500-
style={
501-
"display": "flex",
502-
"flexDirection": "row",
503-
"alignItems": "flex-end",
504-
"gap": "8px",
505-
"flexShrink": "0",
506-
"marginTop": "12px",
507-
"marginBottom": "0px",
508-
},
509-
)
510-
511-
512458
def build_faqs() -> Div:
513459
"""
514460
Build FAQ section with collapsible dropdowns from YAML file.

ml_peg/app/utils/register_callbacks.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,32 +1145,6 @@ def register_plot_download_callbacks() -> None:
11451145
)
11461146

11471147

1148-
def register_image_download_callbacks() -> None:
1149-
"""
1150-
Register one generic image download callback once per Dash app.
1151-
1152-
The image payloads are already stored in the browser as data URIs. Keeping
1153-
this callback client-side avoids posting large phonon dispersion images back
1154-
to Dash, which can exceed request-size limits.
1155-
"""
1156-
app = dash.get_app()
1157-
output = Output({"type": "image-download", "index": MATCH}, "data")
1158-
if str(output) in app.callback_map:
1159-
return
1160-
1161-
app.clientside_callback(
1162-
ClientsideFunction(
1163-
namespace="image_download",
1164-
function_name="downloadImage",
1165-
),
1166-
output,
1167-
Input({"type": "image-download-button", "index": MATCH}, "n_clicks"),
1168-
State({"type": "image-download-format", "index": MATCH}, "value"),
1169-
State({"type": "image-download-target", "index": MATCH}, "data"),
1170-
prevent_initial_call=True,
1171-
)
1172-
1173-
11741148
def register_download_callbacks(table_id: str) -> None:
11751149
"""
11761150
Register minimal table download callbacks for CSV, PNG, and SVG.

0 commit comments

Comments
 (0)