visualdynamics.report¶
report
¶
Render a Report to one self-contained HTML file.
The whole point is the reader: they open the file in the browser they already have — no install, no network, no third-party code inside the deliverable. Everything interactive is a few hundred lines of our own JavaScript: an orthographic trackball scene that animates mode shapes with the same phase math as the desktop animator, and a zoomable log-magnitude plot with visualdynamics's own axis labels. Data rides along as one JSON payload, already converted to the display unit system, so the file shows exactly what the screen showed.
Functions:
| Name | Description |
|---|---|
render_html |
The report as one HTML document string. |
resolve_references |
{{Object Name.field}} in report text becomes the live value. |
scalogram_channel_options |
The DOF names a scalogram block may draw — for the editor's |
Classes¶
Functions:¶
render_html
¶
render_html(
report: Report,
objects: Mapping[str, Any],
unit_system: UnitSystem | None = None,
edit: bool = False,
channel_js: str | None = None,
links: Sequence[Mapping[str, Any]] | None = None,
selected: int | None = None,
labels: list[tuple[str, str]] | None = None,
) -> str
The report as one HTML document string.
links is the project's link groups: symbolic bindings like
'@basis:Frf' resolve against them, so a report depends on the
project's structure, never on what anyone named their objects.
Reading mode skips blocks whose references cannot resolve —
an unbound template block is a slot to fill, not an error to show a
reader. Edit mode keeps them as cards to rebind, tags every block
with its index, frames the block at selected, and wires one
message to the app over Qt's web channel — which block was
clicked. Every act lives on the application's bar and pane
(2026-09-08); the page carries no insert bars, block toolbars or
editors. Only the app ever loads edit mode; the exported file
carries none of it.
labels, when given, is filled with (label, caption) for every
numbered figure and table in order — what the editor's Reference
menu offers, from the same numbering the page shows.
Source code in src/visualdynamics/report/__init__.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | |
resolve_references
¶
resolve_references(
text: str,
objects: Mapping[str, Any],
us: UnitSystem,
links: Sequence[Mapping[str, Any]] | None = None,
) -> str
{{Object Name.field}} in report text becomes the live value.
The whole point is templates: a summary that says how the data was sampled fills itself in whatever project the template lands in. The name may be a symbolic selector — {{@basis:TimeHistory. sample_rate}} — resolved against the link groups, so the text depends on no one's naming either. A reference that cannot resolve — no such object, or a field the object cannot answer — stays visible as written, the same way an unbound block stays a slot instead of an error.
Source code in src/visualdynamics/report/__init__.py
scalogram_channel_options
¶
The DOF names a scalogram block may draw — for the editor's drop-down (Brandon, 2026-08-29: the figure shows one channel, so the reader chooses which).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
block
|
dict
|
The scalogram plot block. |
required |
objects
|
mapping
|
The report's objects, name to object. |
required |
links
|
sequence
|
The project's link groups, for symbolic source bindings. |
()
|
Returns:
| Type | Description |
|---|---|
list of str
|
The response DOFs the block's |