Plate-graph renderers¶
plate_render
¶
Render plate graphs as tables, Mermaid, Graphviz, TikZ, or daft output.
Each renderer consumes only PlateGraph and does not inspect the source AST.
render_table
¶
render_table(graph: PlateGraph)
Return a rich.table.Table describing graph.
The caller is responsible for printing it (Console.print for
the plain prompt; RichLog.write for the Textual TUI).
| PARAMETER | DESCRIPTION |
|---|---|
graph
|
The plate graph to tabulate.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Table
|
One row per node, with its kind, family, plates, and parents. |
Source code in src/quivers/analysis/plate_render.py
render_table_plain
¶
render_table_plain(graph: PlateGraph) -> str
Plain-text rendering of the table, for non-Rich callers.
Used by :plate from qvr repl --plain and from the Jupyter
kernel.
| PARAMETER | DESCRIPTION |
|---|---|
graph
|
The plate graph to tabulate.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The table as aligned plain text. |
Source code in src/quivers/analysis/plate_render.py
render_mermaid
¶
render_mermaid(graph: PlateGraph) -> str
Return Mermaid graph TD source for graph.
Each plate becomes a subgraph cluster. Each node is
drawn as a circle (( )) if latent, a double-circle
((( ))) if observed, an octagon ({{ }}) if
marginalized, and a hexagon (([ ])) if deterministic.
Edges follow the graph's edges field.
Mermaid lacks a native plate / nested-plate primitive; the subgraph blocks approximate it well enough that GitHub-rendered markdown and mermaid.live both display the structure.
| PARAMETER | DESCRIPTION |
|---|---|
graph
|
The plate graph to draw.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Mermaid |
Source code in src/quivers/analysis/plate_render.py
render_dot
¶
render_dot(graph: PlateGraph) -> str
Return Graphviz DOT source. Plates become cluster_*
subgraphs; nodes carry shape attributes based on kind.
| PARAMETER | DESCRIPTION |
|---|---|
graph
|
The plate graph to draw.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Graphviz DOT source. |
Source code in src/quivers/analysis/plate_render.py
render_tikz
¶
render_tikz(graph: PlateGraph) -> str
Return a LaTeX snippet using tikz and the bayesnet
package conventions. Computes positions by laying nodes out
in columns (one per depth level) and rows (one per plate
stack); good enough for diagrams up to ~20 nodes.
| PARAMETER | DESCRIPTION |
|---|---|
graph
|
The plate graph to draw.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
A LaTeX |
Source code in src/quivers/analysis/plate_render.py
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 | |
render_daft
¶
render_daft(graph: PlateGraph) -> str
Return a Python script that uses daft to render the
plate diagram. The script defines a build_pgm() function
returning a daft.PGM instance, ready for the user to
render() and save.
| PARAMETER | DESCRIPTION |
|---|---|
graph
|
The plate graph to draw.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Python source defining |
Source code in src/quivers/analysis/plate_render.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | |