@casadi/casadi-viz 0.1.0-dev.0 → 3.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -100,22 +100,22 @@ repository. See `toolchain/README.md` for the tested source-build recipe.
100
100
 
101
101
  ## Native HTML export uses this same viewer
102
102
 
103
- ```sh
104
- npm run build
105
- node scripts/vendor-casadi.mjs /path/to/casadi-worktree
106
- ```
107
-
108
- This copies `dist/standalone.html` into CasADi's embedded resource and records its
109
- package version and SHA-256. Rebuild CasADi afterwards. The template has exactly
110
- two placeholders: `@@GRAPH_DATA@@` and `@@VIZ_CONFIG@@`; C++ fills these without
111
- executing JavaScript or contacting npm.
112
-
113
- The template is generated from the same component used by the npm entry point.
114
- It contains the viewer code and CSS. CasADi's `viz_js` option additionally embeds
115
- the Viz.js runtime; otherwise the existing pinned CDN configuration applies.
116
- No JavaScript toolchain is required for ordinary CasADi builds using the vendored
117
- asset. Maintain viewer source here, regenerate the artifact, and vendor an
118
- explicit version when updating CasADi.
103
+ CasADi's `misc/casadi_viz.html` is a small HTML shell that loads this package
104
+ from unpkg using the producing CasADi major/minor version. Graph data stays embedded in the exported
105
+ HTML; opening it requires internet access to load the viewer and renderer.
106
+ The `viz_js` option can embed a local renderer, but the viewer still loads from
107
+ unpkg. No JavaScript toolchain or vendored viewer bundle is needed to build CasADi.
108
+ CasADi `3.8.x` selects `@casadi/casadi-viz@3.8`, resolving to the latest stable
109
+ `3.8.y` viewer. The two patch numbers are independent. Every viewer patch in
110
+ that line must support graphs and traces from all CasADi `3.8.x` releases.
111
+ Breaking format changes belong to a new compatibility line (for example `3.11`).
112
+ Keep old lines published and backport compatible viewer fixes as needed.
113
+
114
+ The `viewer_url` string option overrides the default module URL, for example
115
+ for a locally served development build. The HTML imports the ESM viewer. Its renderer URL is relative to the resolved
116
+ module URL, so both assets come from the same exact package release even if a
117
+ new patch is published between requests. Explicit graph and trace schema
118
+ versions remain independent of this package compatibility convention.
119
119
 
120
120
  C++ remains responsible for graph extraction, JSON serialization and standalone
121
121
  DOT generation. Interactive DOT assembly and rendering live in this repository.
@@ -125,6 +125,8 @@ DOT generation. Interactive DOT assembly and rendering live in this repository.
125
125
  The package accepts `format: "casadi_viz", version: 1`. The root Function is
126
126
  index 0; `functions[i]` is index `i+1`. Call nodes' `callee` fields index that
127
127
  registry. `include_functions: false` exports keep calls but omit their internals.
128
+ `casadi_version` records the producing CasADi version (for example `"3.8.1"`),
129
+ independently of the bundle schema version. Older exports may omit it.
128
130
  Sparsities are compressed-column arrays; constants are strings in nonzero order.
129
131
  Instruction IDs match CasADi `dump_trace` records. TypeScript declarations describe
130
132
  the fields. Full mathematical metadata remains available independently of the
@@ -163,7 +165,7 @@ fail before packaging.
163
165
 
164
166
  The release job uses npm trusted publishing (OIDC), with provenance. Before the
165
167
  first npm release, arrange package access and configure npm's trusted publisher
166
- for GitHub organization `casadi`, repository `casadi-viz`, workflow `test.yml`,
168
+ for GitHub organization `casadi`, repository `casadi-viz`, workflow `publish.yml`,
167
169
  with direct publishing allowed and no environment restriction. This registry-side
168
170
  configuration has not been performed by the repository setup. See
169
171
  [npm trusted publishing](https://docs.npmjs.com/trusted-publishers/).
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export interface FunctionGraph {
12
12
  edges:{from:number;output:number;to:number;input:number}[];
13
13
  }
14
14
  export interface GraphBundle extends FunctionGraph {
15
+ casadi_version?:string;
15
16
  format:'casadi_viz';view:'function'|'expression';functions:FunctionGraph[];
16
17
  }
17
18
  export interface Viewer {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@casadi/casadi-viz",
3
- "version": "0.1.0-dev.0",
3
+ "version": "3.8.1",
4
4
  "description": "Interactive CasADi expression and Function graphs, with optional evaluation trace replay",
5
5
  "type": "module",
6
6
  "license": "LGPL-3.0-or-later",