jssm 5.122.4 → 5.124.0
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 +6 -6
- package/dist/cdn/viz.js +22 -15
- package/dist/cli/fsl-render.cjs +1 -1
- package/dist/cli/fsl.cjs +1 -1
- package/dist/deno/README.md +6 -6
- package/dist/deno/jssm.js +1 -1
- package/dist/deno/jssm_viz.d.ts +37 -33
- package/dist/jssm.es5.cjs +1 -1
- package/dist/jssm.es5.iife.js +1 -1
- package/dist/jssm.es6.mjs +1 -1
- package/dist/jssm_viz.cjs +1 -1
- package/dist/jssm_viz.iife.cjs +1 -1
- package/dist/jssm_viz.mjs +1 -1
- package/jssm_viz.es5.d.cts +37 -33
- package/jssm_viz.es6.d.ts +37 -33
- package/package.json +1 -1
package/dist/deno/jssm_viz.d.ts
CHANGED
|
@@ -85,6 +85,24 @@ declare function image_for_state<T>(u_jssm: jssm.Machine<T>, state: string): str
|
|
|
85
85
|
* @internal
|
|
86
86
|
*/
|
|
87
87
|
declare function style_for_state<T>(u_jssm: jssm.Machine<T>, state: string): string;
|
|
88
|
+
/**
|
|
89
|
+
* Options for the dot/SVG render entry points.
|
|
90
|
+
*
|
|
91
|
+
* - `hide_state_labels` (default `false`) — when `true`, the rendered dot
|
|
92
|
+
* output omits the `label=` attribute on every state's node line.
|
|
93
|
+
* Graphviz then draws the box without any text inside. Useful for
|
|
94
|
+
* diagrams where shape, color, or layout alone carry the meaning
|
|
95
|
+
* (icon-only diagrams, tutorial graphics, presentation slides).
|
|
96
|
+
* - `footer` — verbatim dot source inserted just before the closing `}`
|
|
97
|
+
* of the generated dot source (e.g. `labelloc="b"; label="caption";`).
|
|
98
|
+
* - `engine` — graphviz layout engine for the SVG render path (e.g.
|
|
99
|
+
* `dot`, `neato`, `circo`); honored by `fsl_to_svg_string`.
|
|
100
|
+
*/
|
|
101
|
+
declare type VizRenderOpts = {
|
|
102
|
+
hide_state_labels?: boolean;
|
|
103
|
+
footer?: string;
|
|
104
|
+
engine?: string;
|
|
105
|
+
};
|
|
88
106
|
/**
|
|
89
107
|
* Render a {@link jssm.Machine} as a graphviz dot string.
|
|
90
108
|
*
|
|
@@ -100,18 +118,18 @@ declare function style_for_state<T>(u_jssm: jssm.Machine<T>, state: string): str
|
|
|
100
118
|
* const dot = machine_to_dot(sm`a -> b;`);
|
|
101
119
|
* // 'digraph G { ... }'
|
|
102
120
|
*
|
|
121
|
+
* // suppress state-name labels (boxes only, no text inside)
|
|
122
|
+
* const dot2 = machine_to_dot(sm`a -> b;`, { hide_state_labels: true });
|
|
123
|
+
*
|
|
103
124
|
* const dot_with_footer = machine_to_dot(sm`a -> b;`, { footer: 'labelloc="b"; label="caption";' });
|
|
104
125
|
* // 'digraph G { ... labelloc="b"; label="caption"; }'
|
|
105
126
|
* ```
|
|
106
127
|
*
|
|
107
128
|
* @param u_jssm The machine to render.
|
|
108
|
-
* @param opts Optional
|
|
109
|
-
* @param opts.footer Optional verbatim dot source inserted just before the closing `}`.
|
|
129
|
+
* @param opts Optional render flags. See {@link VizRenderOpts}.
|
|
110
130
|
* @returns A complete graphviz dot source string.
|
|
111
131
|
*/
|
|
112
|
-
declare function machine_to_dot<T>(u_jssm: jssm.Machine<T>, opts?:
|
|
113
|
-
footer?: string;
|
|
114
|
-
}): string;
|
|
132
|
+
declare function machine_to_dot<T>(u_jssm: jssm.Machine<T>, opts?: VizRenderOpts): string;
|
|
115
133
|
/**
|
|
116
134
|
* Render an FSL string directly to graphviz dot source.
|
|
117
135
|
*
|
|
@@ -119,18 +137,18 @@ declare function machine_to_dot<T>(u_jssm: jssm.Machine<T>, opts?: {
|
|
|
119
137
|
* import { fsl_to_dot } from 'jssm/viz';
|
|
120
138
|
* const dot = fsl_to_dot('a -> b;');
|
|
121
139
|
*
|
|
140
|
+
* // suppress state-name labels
|
|
141
|
+
* const dot2 = fsl_to_dot('a -> b;', { hide_state_labels: true });
|
|
142
|
+
*
|
|
122
143
|
* const dot_with_footer = fsl_to_dot('a -> b;', { footer: 'label="caption";' });
|
|
123
144
|
* // 'digraph G { ... label="caption"; }'
|
|
124
145
|
* ```
|
|
125
146
|
*
|
|
126
147
|
* @param fsl The FSL source.
|
|
127
|
-
* @param opts Optional
|
|
128
|
-
* @param opts.footer Optional verbatim dot source inserted just before the closing `}`.
|
|
148
|
+
* @param opts Optional render flags. See {@link VizRenderOpts}.
|
|
129
149
|
* @returns A complete graphviz dot source string.
|
|
130
150
|
*/
|
|
131
|
-
declare function fsl_to_dot(fsl: string, opts?:
|
|
132
|
-
footer?: string;
|
|
133
|
-
}): string;
|
|
151
|
+
declare function fsl_to_dot(fsl: string, opts?: VizRenderOpts): string;
|
|
134
152
|
/**
|
|
135
153
|
* Render a graphviz dot source string to SVG using `@viz-js/viz`. The
|
|
136
154
|
* underlying viz instance is lazy-initialized on first call and cached for
|
|
@@ -160,51 +178,36 @@ declare function dot_to_svg(dot: string, options?: {
|
|
|
160
178
|
* ```
|
|
161
179
|
*
|
|
162
180
|
* @param fsl The FSL source.
|
|
163
|
-
* @param opts Optional
|
|
164
|
-
* @param opts.footer Optional verbatim dot source inserted just before the closing `}` of the intermediate dot source.
|
|
165
|
-
* @param opts.engine Graphviz layout engine to use (e.g. `'dot'`, `'neato'`, `'circo'`).
|
|
166
|
-
* Unrecognized engine names cause `@viz-js/viz` to throw at render time.
|
|
181
|
+
* @param opts Optional render flags. See {@link VizRenderOpts}.
|
|
167
182
|
* @returns A promise resolving to an SVG XML string.
|
|
168
183
|
*/
|
|
169
|
-
declare function fsl_to_svg_string(fsl: string, opts?:
|
|
170
|
-
footer?: string;
|
|
171
|
-
engine?: string;
|
|
172
|
-
}): Promise<string>;
|
|
184
|
+
declare function fsl_to_svg_string(fsl: string, opts?: VizRenderOpts): Promise<string>;
|
|
173
185
|
/**
|
|
174
186
|
* Render a {@link jssm.Machine} to SVG.
|
|
175
187
|
*
|
|
176
188
|
* @param u_jssm The machine to render.
|
|
177
|
-
* @param opts Optional
|
|
178
|
-
* @param opts.footer Optional verbatim dot source inserted just before the closing `}` of the intermediate dot source.
|
|
189
|
+
* @param opts Optional render flags. See {@link VizRenderOpts}.
|
|
179
190
|
* @returns A promise resolving to an SVG XML string.
|
|
180
191
|
*/
|
|
181
|
-
declare function machine_to_svg_string<T>(u_jssm: jssm.Machine<T>, opts?:
|
|
182
|
-
footer?: string;
|
|
183
|
-
}): Promise<string>;
|
|
192
|
+
declare function machine_to_svg_string<T>(u_jssm: jssm.Machine<T>, opts?: VizRenderOpts): Promise<string>;
|
|
184
193
|
/**
|
|
185
194
|
* Render an FSL string directly to a parsed `SVGSVGElement`.
|
|
186
195
|
*
|
|
187
196
|
* @param fsl The FSL source.
|
|
188
|
-
* @param opts Optional
|
|
189
|
-
* @param opts.footer Optional verbatim dot source inserted just before the closing `}` of the intermediate dot source.
|
|
197
|
+
* @param opts Optional render flags. See {@link VizRenderOpts}.
|
|
190
198
|
* @returns A promise resolving to a parsed `SVGSVGElement`.
|
|
191
199
|
* @throws {JssmError} if no `DOMParser` is available (Node without `configure`).
|
|
192
200
|
*/
|
|
193
|
-
declare function fsl_to_svg_element(fsl: string, opts?:
|
|
194
|
-
footer?: string;
|
|
195
|
-
}): Promise<SVGSVGElement>;
|
|
201
|
+
declare function fsl_to_svg_element(fsl: string, opts?: VizRenderOpts): Promise<SVGSVGElement>;
|
|
196
202
|
/**
|
|
197
203
|
* Render a {@link jssm.Machine} to a parsed `SVGSVGElement`.
|
|
198
204
|
*
|
|
199
205
|
* @param u_jssm The machine to render.
|
|
200
|
-
* @param opts Optional
|
|
201
|
-
* @param opts.footer Optional verbatim dot source inserted just before the closing `}` of the intermediate dot source.
|
|
206
|
+
* @param opts Optional render flags. See {@link VizRenderOpts}.
|
|
202
207
|
* @returns A promise resolving to a parsed `SVGSVGElement`.
|
|
203
208
|
* @throws {JssmError} if no `DOMParser` is available (Node without `configure`).
|
|
204
209
|
*/
|
|
205
|
-
declare function machine_to_svg_element<T>(u_jssm: jssm.Machine<T>, opts?:
|
|
206
|
-
footer?: string;
|
|
207
|
-
}): Promise<SVGSVGElement>;
|
|
210
|
+
declare function machine_to_svg_element<T>(u_jssm: jssm.Machine<T>, opts?: VizRenderOpts): Promise<SVGSVGElement>;
|
|
208
211
|
/**
|
|
209
212
|
* Compatibility wrapper for {@link machine_to_dot}, retained from
|
|
210
213
|
* jssm-viz. Will be removed in the next major.
|
|
@@ -213,6 +216,7 @@ declare function machine_to_svg_element<T>(u_jssm: jssm.Machine<T>, opts?: {
|
|
|
213
216
|
*/
|
|
214
217
|
declare function dot<T>(machine: jssm.Machine<T>): string;
|
|
215
218
|
export { configure, dot, dot_to_svg, fsl_to_dot, fsl_to_svg_string, fsl_to_svg_element, machine_to_dot, machine_to_svg_string, machine_to_svg_element, version, build_time };
|
|
219
|
+
export type { VizRenderOpts };
|
|
216
220
|
/** @internal — test-only access to private helpers. */
|
|
217
221
|
export declare const _test: {
|
|
218
222
|
color8to6: typeof color8to6;
|