Viz Server¶
Manages the Kedro Viz server lifecycle — starting, stopping, port checking, and readiness polling. Provides custom CSS styling for the Kedro Viz UI and utilities for generating dummy graph structures.
viz
¶
Kedro Viz server management and graph utilities.
Manages the Kedro Viz subprocess lifecycle (start, stop, port checking, readiness polling) and provides custom CSS for UI styling. Also includes a helper to generate dummy graph structures for file-only views.
KedroVizServer
¶
Manages a Kedro Viz server instance.
Source code in src/choregraph/viz.py
is_ready
async
¶
wait_until_ready
async
¶
Wait until the server is ready or timeout is reached.
| PARAMETER | DESCRIPTION |
|---|---|
timeout
|
Maximum time to wait in seconds
TYPE:
|
poll_interval
|
Time between checks in seconds
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if server is ready, False if timeout reached |
Source code in src/choregraph/viz.py
get_custom_css
¶
set_custom_css
¶
switch_project
¶
Sync files from a new room's pipeline to trigger autoreload.
Call :meth:wait_for_switch afterwards to wait for the server to
restart with the new data.
Source code in src/choregraph/viz.py
trigger_reload
¶
Touch a config file in the stable wrapper to trigger autoreload.
Call this after a pipeline run to ensure kedro-viz picks up new output files for previews.
Source code in src/choregraph/viz.py
wait_for_switch
async
¶
Wait for autoreload to restart the server after a switch_project().
Phase 1: wait for the old child to die (port becomes free). Phase 2: wait for the new child to become ready.
Source code in src/choregraph/viz.py
start
¶
Start the Kedro Viz server.
Copies the source pipeline into a stable directory and launches
kedro viz run --autoreload from there. Subsequent room switches
only need :meth:switch_project (no process restart from our side).
| PARAMETER | DESCRIPTION |
|---|---|
project_path
|
Path to the room's pipeline directory.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if server started successfully or is already running, False on failure. |
Source code in src/choregraph/viz.py
486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 | |
generate_dummy_graph
¶
Generates a dummy Kedro Viz graph structure for a list of files. Each file becomes a data node. No edges or tasks.