extend.visual contains all visualization, rendering, and
diagram generation code. Modules here produce visual output
(PNG, HTML charts, Mermaid diagrams) but do NOT handle data
persistence or business logic.
Separation of concerns: Core modules (ObjDecisionSwitch,
ObjFeatureStore, ObjWorkflow) handle evaluation and data.
Visual modules handle rendering and presentation. Edit modules
handle CRUD and persistence.
factory.core/
├── ObjDecisionSwitch.py ← Core: evaluate, compute
├── extend.edit/
│ └── ObjDecisionSwitchEdit.py ← CRUD: simulate, verify, load/save
└── extend.visual/
├── ObjVisual.py ← Rendering engine (static)
├── ObjDecisionSwitchVisual.py ← Decision tree diagrams + email
├── ObjWorkflowVisual.py ← Workflow DAG diagrams
└── ObjFeatureStoreVisual.py ← Feature lineage diagrams
The unified rendering backend. All PNG generation goes through
this module. Static methods — no DB, no ObjData inheritance.
| Method | Input | Output | Engine |
|---|---|---|---|
render_mermaid() |
Mermaid text | PNG path | mmdc (Mermaid CLI) |
render_piper() |
Piper flow text | PNG path | processpiper |
render_plotly_sankey() |
labels, sources, targets, values | PNG path | plotly + kaleido |
render_plotly_bar() |
labels, values | PNG path | plotly + kaleido |
lighten() |
hex colour | lighter hex | pure computation |
When to use: Any time code needs to convert a diagram/chart
definition into a PNG image file. Never call mmdc, processpiper,
or plotly directly — always go through ObjVisual.
When NOT to add here: Business logic, data queries, email
sending, template rendering. Those belong in the domain-specific
Visual module or in ObjTemplate.
Generates visual representations of workflow DAGs.
| Method | Output | Uses |
|---|---|---|
visualise() |
Mermaid state diagram text | ObjVisual.render_mermaid |
visualise_piper() |
Piper BPMN swim lane PNG | ObjVisual.render_piper |
export_to_piper() |
Piper dict format | Direct |
What belongs here: Anything that reads def_workflow /
def_workflows and produces a visual. Workflow node layout,
lane assignment, theme matching, connection routing.
What does NOT belong here: Workflow execution, node
registration, simulation. Those are in ObjWorkflow.py and
ObjWorkflowSimul.py.
The largest visual module. Handles decision tree rendering,
email reports, and all export formats.
| Category | Methods |
|---|---|
| Diagrams | diagram(), diagram_terminal(), diagram_sankey(), generate_sankey_mermaid(), generate_sankey_plotly() |
send_email(), _build_*_section(), _generate_*_review() |
|
| Export | save_pmml(), load_pmml(), save_csv(), load_csv(), save_excel() |
| SQL | generate_sql_statement(), _build_sql_case(), map_operator_to_sql() |
| Analysis | compute_outcome_distribution(), _compute_output_table() |
What belongs here: Any visualization or export of decision
tree data. Mermaid diagrams, Plotly sankeys, email reports with
bar charts, PMML/CSV/Excel export, SQL CASE generation.
What does NOT belong here: Tree evaluation (evaluate,
compute_decision), simulation (simulate), tree loading
(read). Those are in ObjDecisionSwitch.py and
ObjDecisionSwitchEdit.py.
Lightweight visual module for feature store lineage.
| Method | Output |
|---|---|
generate_lineage_mermaid() |
Mermaid flowchart text |
update_feature_lineage_diagrams() |
Batch diagram updates |
display_compute_summary() |
Rich terminal display |
What belongs here: Lineage visualization, compute summary
display, diagram generation from def_feature_lineage.
What does NOT belong here: Feature computation, analytics,
usage tracking, quality assessment. Those are in
ObjFeatureStore.py and ObjFeatureStoreEdit.py.
When adding a new visual module to extend.visual:
Obj<Domain>Visual.py (e.g. ObjScorecardVisual.py)ObjScorecard)pick_readable()send_email() pattern from ObjDecisionSwitchVisual| Package | Purpose | Example |
|---|---|---|
extend.visual |
Diagrams, charts, email reports | ObjVisual, ObjWorkflowVisual |
extend.edit |
CRUD, load/save, simulation | ObjWorkflowEdit, ObjFeatureStoreEdit |
extend.delegate |
Object mixins (debug, patch, system) | ObjDebug, ObjPatch, ObjSystem |
ObjVisual (no deps — static utility)
↑
ObjWorkflowVisual (inherits ObjWorkflow)
ObjDecisionSwitchVisual (inherits ObjDecisionSwitch)
ObjFeatureStoreVisual (inherits ObjFeatureStore)
↑
ObjBOP (uses Visual modules for BOP generation)