github-actions[bot] commited on
Commit ·
bc4ab71
1
Parent(s): 713d895
Deploy hyper3labs/HyperView-ABO-Catalog from Hyper3Labs/hyperview-spaces@0affea7
Browse files
demo.py
CHANGED
|
@@ -484,6 +484,16 @@ def model_panel_props(layouts: dict[str, str]) -> list[dict[str, Any]]:
|
|
| 484 |
|
| 485 |
|
| 486 |
def build_demo_view(layouts: dict[str, str]) -> hv.ui.View:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 487 |
scatter_panels = []
|
| 488 |
for index, spec in enumerate(MODEL_SPECS):
|
| 489 |
panel_id = f"{spec['key']}-catalog-map"
|
|
@@ -496,16 +506,22 @@ def build_demo_view(layouts: dict[str, str]) -> hv.ui.View:
|
|
| 496 |
layout_dimension=spec["layout_dimension"],
|
| 497 |
reference_panel_id="grid" if index == 0 else scatter_panels[0].id,
|
| 498 |
direction="right" if index == 0 else "below",
|
|
|
|
| 499 |
)
|
| 500 |
)
|
| 501 |
|
| 502 |
return hv.ui.View(
|
|
|
|
| 503 |
*scatter_panels,
|
| 504 |
hv.ui.ExtensionPanel(
|
| 505 |
id="catalog-hierarchy-readout",
|
| 506 |
extension="abo-catalog-readout",
|
| 507 |
panel="catalog-comparison",
|
| 508 |
position="right",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 509 |
props={
|
| 510 |
"models": model_panel_props(layouts),
|
| 511 |
"examples": DEMO_EXAMPLES,
|
|
@@ -532,7 +548,10 @@ def launch_demo(dataset: hv.Dataset, layouts: dict[str, str]) -> hv.Session:
|
|
| 532 |
session.ui.set_selection([], workspace_id=WORKSPACE_ID)
|
| 533 |
print(f"\nHyperView ABO catalog demo is running at {session.url}", flush=True)
|
| 534 |
model_names = " and ".join(spec["display_name"] for spec in MODEL_SPECS)
|
| 535 |
-
print(
|
|
|
|
|
|
|
|
|
|
| 536 |
print(" Press Ctrl+C to stop.\n", flush=True)
|
| 537 |
return session
|
| 538 |
|
|
|
|
| 484 |
|
| 485 |
|
| 486 |
def build_demo_view(layouts: dict[str, str]) -> hv.ui.View:
|
| 487 |
+
samples_panel = hv.ui.Samples(
|
| 488 |
+
id="grid",
|
| 489 |
+
title="Samples",
|
| 490 |
+
position="center",
|
| 491 |
+
layout=hv.ui.PanelLayout(
|
| 492 |
+
width=int(os.environ.get("ABO_SAMPLES_PANEL_WIDTH", "220")),
|
| 493 |
+
min_width=180,
|
| 494 |
+
min_height=360,
|
| 495 |
+
),
|
| 496 |
+
)
|
| 497 |
scatter_panels = []
|
| 498 |
for index, spec in enumerate(MODEL_SPECS):
|
| 499 |
panel_id = f"{spec['key']}-catalog-map"
|
|
|
|
| 506 |
layout_dimension=spec["layout_dimension"],
|
| 507 |
reference_panel_id="grid" if index == 0 else scatter_panels[0].id,
|
| 508 |
direction="right" if index == 0 else "below",
|
| 509 |
+
layout=hv.ui.PanelLayout(min_width=420, min_height=240),
|
| 510 |
)
|
| 511 |
)
|
| 512 |
|
| 513 |
return hv.ui.View(
|
| 514 |
+
samples_panel,
|
| 515 |
*scatter_panels,
|
| 516 |
hv.ui.ExtensionPanel(
|
| 517 |
id="catalog-hierarchy-readout",
|
| 518 |
extension="abo-catalog-readout",
|
| 519 |
panel="catalog-comparison",
|
| 520 |
position="right",
|
| 521 |
+
layout=hv.ui.PanelLayout(
|
| 522 |
+
width=int(os.environ.get("ABO_READOUT_PANEL_WIDTH", "320")),
|
| 523 |
+
min_width=300,
|
| 524 |
+
),
|
| 525 |
props={
|
| 526 |
"models": model_panel_props(layouts),
|
| 527 |
"examples": DEMO_EXAMPLES,
|
|
|
|
| 548 |
session.ui.set_selection([], workspace_id=WORKSPACE_ID)
|
| 549 |
print(f"\nHyperView ABO catalog demo is running at {session.url}", flush=True)
|
| 550 |
model_names = " and ".join(spec["display_name"] for spec in MODEL_SPECS)
|
| 551 |
+
print(
|
| 552 |
+
f" Samples, {model_names} stacked maps, and the guided readout are pinned.",
|
| 553 |
+
flush=True,
|
| 554 |
+
)
|
| 555 |
print(" Press Ctrl+C to stop.\n", flush=True)
|
| 556 |
return session
|
| 557 |
|