@edubeam/plot 0.1.0 → 0.2.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/CHANGELOG.md CHANGED
@@ -2,6 +2,61 @@
2
2
 
3
3
  All notable changes to `@edubeam/plot` are listed here. The project follows [Semantic Versioning](https://semver.org).
4
4
 
5
+ ## 0.2.0 (2026-11-19)
6
+
7
+ - **Translatable screen-reader texts**: `PLOT_TEXTS` (an injection key) lets an app give the figure's accessible
8
+ name and the movable load's slider texts in its own language, `app.provide(PLOT_TEXTS, { structure: (layers) => … })`,
9
+ or a ref of them to follow a language switch. English stays the default, and a `title` prop still wins.
10
+ `temperature` sets the temperature load's symbols on the figure (`temperatureSymbols` in `structureSvg`):
11
+ `ΔT` and `ΔTb − ΔTt` unless given, `ΔTs` and `ΔTd − ΔTh` in the Czech app.
12
+ - **Bottom fibres**: every member has the app's thin dashed line beside it, on its local +z side, so a drawing
13
+ shows which face a positive bending moment stretches. It belongs to the `members` layer.
14
+ - **Support symbols as the EduBeam app draws them**, stroke for stroke: a pin is a bare triangle, a roller the
15
+ triangle on its track, a clamp a wall with seven hatch strokes, a slider two hatched rails, and the
16
+ rotation-only support the app's cross with its corner strokes. Supports still turn away from their members.
17
+ - **Reactions as an exercise's unknowns**: `reactionLabels: 'names'` (a `StructurePlot` prop and a
18
+ `structureSvg` option) draws an arrow for every restrained direction, pointing the way it counts as positive
19
+ (along the node's x, up, counter-clockwise), named A_x, A_z and M_A, in italic with real subscripts, instead of sized. It needs
20
+ no results, so an unsolved model can be an exercise sheet. Names are placed before node labels.
21
+ - `reserveReactionLabels` (a prop, a `structureSvg` option and a `layoutStructure` argument) makes room for both
22
+ reaction label styles, so an exercise that turns into its solution keeps its drawing where it is.
23
+ - Labels can carry a subscript (`sub` on scene text), drawn as a smaller, lower `tspan` with a halo of its own.
24
+ - Dimension lines mark each stop with the oblique stroke of a technical drawing.
25
+ - A fixing moment's name at a wall goes up and away from the beam and its loads, and arrow heads keep labels
26
+ off them as their shafts do.
27
+ - **Reactions are bare numbers**, like the diagram values and as the EduBeam app writes them: a figure gives
28
+ units with what is given (loads, settlements, temperature changes), not with results. Before, a reaction read
29
+ "36 kN" next to a moment diagram reading "54".
30
+ - **`structureSvg(model, options)`** writes a plot as a standalone `.svg` file: plain colours (`PRINT_COLORS`,
31
+ or your own), no CSS custom properties, label halos as separate text, so Word, Inkscape, LaTeX tool chains
32
+ and cairosvg draw it as the page does. `layoutStructure` is the shared layout behind it and `StructurePlot`.
33
+ - **Chain dimensions**: the `dimensions` layer gives every span between nodes and point loads along x, and
34
+ every storey along z, with the overall size on a second line, as an exercise sheet does.
35
+ - A load's or a reaction's value is placed before any diagram's numbers, so it can no longer be pushed out
36
+ by the labels of a reserved result (a point load's "20 kN" over a step in V disappeared).
37
+ - A step in V or N over a support shows both its values (the joint rule that writes a rigid corner's moment
38
+ once no longer swallows a shear step of equal size), and a symmetric structure's largest deflection is
39
+ labelled in every span where it occurs.
40
+ - Labels keep off the diagram on show (a load's value moves along its band, a constant diagram's value to a
41
+ quarter point) without the fit ever depending on which diagram that is; curved outlines are followed
42
+ exactly. Node labels clear the arc of a fixing or nodal moment; settlement, nodal moment and reaction
43
+ values have alternative places.
44
+ - Floating-point noise is rounded away before formatting: a reaction of 8749.999… N reads 8.75 kN.
45
+ - `structureSvg` takes `reserve` and `reserveLabelModes`, so the files of a build-up line up as overlays.
46
+ - More types are exported: `TextPlacement`, `ResolveOptions`, `Bounds`, `SceneText`, `ResolvedPath`,
47
+ `ResolvedText`, `ResolvedCircle`.
48
+ - Every non-zero end of a diagram now carries its value, as a textbook labels it; before, a member end was
49
+ numbered only where it was that member's extreme, so e.g. a cantilever's tip shear went unlabelled.
50
+ - The hover readout marks the value where it is drawn: a dot at the tip of each shown diagram's ordinate
51
+ (both tips across a step) or on the deformed shape, joined to the member point. The pointer also picks up
52
+ a member from anywhere over its diagram.
53
+ - Labels of result layers shown one at a time (reserved but hidden) no longer push out the labels of the
54
+ layer on show.
55
+ - A nodal load whose arrow would lie along a member at its node, such as a load at a truss's bottom chord
56
+ under a vertical, hangs off the node on the free side instead.
57
+ - With `animate` off, paths no longer carry the draw-on dash styling at all.
58
+ - `readoutMarks` and `isBarStructure` are exported.
59
+
5
60
  ## 0.1.0 (2026-11-18)
6
61
 
7
62
  The first release.
@@ -1,4 +1,3 @@
1
- import { type ResultLabelMode } from '../core/structure.js';
2
1
  import { type Readout } from '../core/readout.js';
3
2
  import type { StructurePlotProps } from './types.js';
4
3
  declare const __VLS_export: import("vue").DefineComponent<StructurePlotProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -8,7 +7,7 @@ declare const __VLS_export: import("vue").DefineComponent<StructurePlotProps, {}
8
7
  }>, {
9
8
  compact: boolean;
10
9
  momentOnTensionSide: boolean;
11
- resultLabelMode: ResultLabelMode;
10
+ resultLabelMode: import("../index.js").ResultLabelMode;
12
11
  loadCase: number;
13
12
  revision: number;
14
13
  padding: number;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The few words the components say for themselves, to screen readers: the figure's accessible name,
3
+ * a diagram stack's, and the movable load's slider. English unless an app provides its own:
4
+ * `app.provide(PLOT_TEXTS, { structure: (layers) => … })`, or a ref of such an object to follow a
5
+ * language switch. A page's `title` prop still wins over `structure`.
6
+ */
7
+ import { type ComputedRef, type InjectionKey, type Ref } from 'vue';
8
+ import { type PlotLayer, type TemperatureSymbols } from '../core/structure.js';
9
+ export interface PlotTexts {
10
+ /** A structure plot's accessible name, from the layers it shows, in paint order. */
11
+ readonly structure: (shown: readonly PlotLayer[]) => string;
12
+ /** A diagram stack's accessible name, from the rows it shows beneath the beam. */
13
+ readonly stack: (rows: readonly ('N' | 'V' | 'M' | 'w')[]) => string;
14
+ /** The temperature load's symbols drawn on a figure, as the app the figure belongs to writes them. */
15
+ readonly temperature: TemperatureSymbols;
16
+ /** The movable load's slider, named after the load's own label ("20 kN"). */
17
+ readonly loadHandle: (load: string) => string;
18
+ /** The slider's position in words, the distance already formatted ("3.20"). */
19
+ readonly loadPosition: (metres: string) => string;
20
+ }
21
+ export declare const DEFAULT_PLOT_TEXTS: PlotTexts;
22
+ export declare const PLOT_TEXTS: InjectionKey<Partial<PlotTexts> | Ref<Partial<PlotTexts>>>;
23
+ /** The texts in effect: the app's where it gives them, English for the rest. */
24
+ export declare const usePlotTexts: () => ComputedRef<PlotTexts>;
@@ -9,8 +9,8 @@ export declare const DEFAULT_COLORS: PlotColors;
9
9
  /** Custom properties for the root element: the defaults, with any colour the caller overrides. */
10
10
  export declare const toneVars: (colors?: Partial<PlotColors>) => Record<string, string>;
11
11
  /**
12
- * Inlined into each SVG rather than shipped as a stylesheet, so a plot needs no CSS import, renders
13
- * the same on the server and stays styled when saved as a file. Every class is `ebp-` prefixed;
14
- * a page can restyle them, e.g. to change the timing.
12
+ * Inlined into each SVG rather than shipped as a stylesheet, so a plot needs no CSS import and
13
+ * renders the same on the server. Its colours stay CSS custom properties of the page: for a file,
14
+ * use `structureSvg`. Every class is `ebp-` prefixed; a page can restyle them, e.g. the timing.
15
15
  */
16
16
  export declare const PLOT_CSS: string;
@@ -5,7 +5,7 @@ import type { Solver } from '@edubeam/fem';
5
5
  import type { PlotModel } from '../core/model.js';
6
6
  import type { Readout } from '../core/readout.js';
7
7
  import type { StackRow } from '../core/stack.js';
8
- import type { PlotLayer, ResultLabelMode, ResultLayer } from '../core/structure.js';
8
+ import type { PlotLayer, ReactionLabels, ResultLabelMode, ResultLayer } from '../core/structure.js';
9
9
  import type { Units } from '../core/units.js';
10
10
  import type { PlotColors } from './theme.js';
11
11
  export interface StructurePlotProps {
@@ -41,11 +41,21 @@ export interface StructurePlotProps {
41
41
  momentOnTensionSide?: boolean;
42
42
  /** Values upright, or turned to run along their ordinate across the member (`axis`), as in the app. */
43
43
  resultLabelMode?: ResultLabelMode;
44
+ /**
45
+ * `names` draws the reactions as the unknowns of an exercise: an arrow for every restrained
46
+ * direction, pointing the way it counts as positive, named (A with subscript x) instead of sized.
47
+ */
48
+ reactionLabels?: ReactionLabels;
44
49
  /**
45
50
  * Label styles to make room for besides the current one, so switching `resultLabelMode` moves
46
51
  * only the labels, not the drawing - as `reserve` does for layers.
47
52
  */
48
53
  reserveLabelModes?: readonly ResultLabelMode[];
54
+ /**
55
+ * Reaction label styles to make room for besides `reactionLabels`, so an exercise that turns into
56
+ * its solution (`'names'` to `'values'`) keeps its drawing where it is.
57
+ */
58
+ reserveReactionLabels?: readonly ReactionLabels[];
49
59
  /** Fade layers in and draw members on. Always off under prefers-reduced-motion. */
50
60
  animate?: boolean;
51
61
  /** Read values off the members under the pointer. Off, the plot takes no pointer input at all. */
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Laying a structure out in a box: the one routine behind both `StructurePlot` and `structureSvg`,
3
+ * so a figure on a page and the same figure saved as a file are drawn alike.
4
+ */
5
+ import type { PlotModel } from './model.js';
6
+ import { type Fit, type FitBox, type ResolvedScene, type SceneItem } from './scene.js';
7
+ import { type PlotLayer, type ReactionLabels, type ResultLabelMode, type StructureSceneOptions } from './structure.js';
8
+ export interface StructureLayout {
9
+ readonly fit: Fit;
10
+ readonly items: readonly SceneItem[];
11
+ readonly resolved: ResolvedScene;
12
+ }
13
+ /** Results shown one at a time make room for each other's labels but never fight over places. */
14
+ export declare const alternativeResultGroups: (shown: ReadonlySet<PlotLayer>) => ReadonlySet<string>;
15
+ /**
16
+ * Fit with every label, see which survive, then fit again on those: a label that is dropped for
17
+ * crowding does not shrink the structure. The last pass may bring back any label that now fits.
18
+ *
19
+ * `options.layers` are the layers laid out (everything that may be shown); `shown` those on show.
20
+ * `labelModes` are the label styles to make room for, so switching between them moves nothing;
21
+ * `reactionLabels` the same for the reactions' names and values (an exercise and its solution).
22
+ */
23
+ export declare const layoutStructure: (model: PlotModel, options: Omit<StructureSceneOptions, "scale">, box: FitBox, shown?: ReadonlySet<PlotLayer>, labelModes?: readonly ResultLabelMode[], reactionLabels?: readonly ReactionLabels[]) => StructureLayout;
@@ -3,7 +3,7 @@
3
3
  * values where a point load or a support makes a step.
4
4
  */
5
5
  import { type MemberResults, type PlotModel } from './model.js';
6
- import { type Transform } from './scene.js';
6
+ import { type Tone, type Transform } from './scene.js';
7
7
  import { type Units } from './units.js';
8
8
  /** Either side of a point; the two are equal where the result is continuous. */
9
9
  export interface SidedValue {
@@ -19,13 +19,30 @@ export interface Readout {
19
19
  readonly px: number;
20
20
  readonly py: number;
21
21
  readonly values: Readonly<Record<ReadoutQuantity, SidedValue>>;
22
+ /** Displacement along the member's local x there, m. */
23
+ readonly u: number;
22
24
  }
23
25
  /** The results at x, snapping to a break within `snap` metres so a step shows both its values. */
24
26
  export declare const readMember: (results: MemberResults, x: number, snap?: number) => {
25
27
  x: number;
28
+ u: number;
26
29
  values: Record<ReadoutQuantity, SidedValue>;
27
30
  };
28
31
  /** The member nearest the screen point (px, py), within `reach` px, and its results there. */
29
32
  export declare const readoutAt: (model: PlotModel, t: Transform, px: number, py: number, reach: number) => Readout | null;
33
+ /** Where a read value sits on the drawing: on its diagram's outline, or on the deformed shape. */
34
+ export interface ReadoutMark {
35
+ readonly tone: Tone;
36
+ /** The member point, px. */
37
+ readonly from: readonly [number, number];
38
+ /** The ordinate's tip (or the displaced point), px. */
39
+ readonly to: readonly [number, number];
40
+ }
41
+ /**
42
+ * The points on the drawn results that a readout's values belong to: the tip of each shown
43
+ * diagram's ordinate (both tips across a step), and the point on the deformed shape. `k` is px
44
+ * per SI unit, `side` the side each diagram is drawn on (see `diagramScales`, `diagramSide`).
45
+ */
46
+ export declare const readoutMarks: (model: PlotModel, t: Transform, r: Readout, shown: readonly ReadoutQuantity[], k: Readonly<Record<ReadoutQuantity, number>>, side: Readonly<Record<"N" | "V" | "M", 1 | -1>>) => ReadoutMark[];
30
47
  /** "M = 54 kNm", or "V = 13.3 → −6.7 kN" across a step. */
31
48
  export declare const formatReadout: (r: Readout, q: ReadoutQuantity, units: Units, format?: Intl.NumberFormat) => string;
@@ -66,6 +66,11 @@ export interface ScenePath extends SceneBase {
66
66
  readonly cap?: 'round' | 'butt';
67
67
  /** A label may not cover this line (the members). */
68
68
  readonly obstacle?: boolean;
69
+ /**
70
+ * Only the labels of other, always-on layers (loads, reactions) may not cover this line: a
71
+ * diagram's outline, which its own numbers sit against.
72
+ */
73
+ readonly shield?: boolean;
69
74
  /** Drawn on from start to end when it appears; the number staggers members one after another. */
70
75
  readonly draw?: number;
71
76
  }
@@ -99,6 +104,8 @@ export interface SceneText extends SceneBase {
99
104
  readonly weight?: number;
100
105
  /** Font size, px; the plot's own when left out. */
101
106
  readonly size?: number;
107
+ /** Written after `text`, smaller and lower: the x of A_x. */
108
+ readonly sub?: string;
102
109
  /** Other places to try, in order, when the first is taken. */
103
110
  readonly alternatives?: readonly TextPlacement[];
104
111
  }
@@ -122,8 +129,12 @@ export interface Transform {
122
129
  }
123
130
  export declare const project: (t: Transform, a: Anchor) => [number, number];
124
131
  export declare const textWidth: (text: string, size: number) => number;
132
+ /** A subscript's size, as a share of its text's */
133
+ export declare const SUB_SCALE = 0.75;
134
+ /** How far a subscript drops below the baseline, as a share of its text's size */
135
+ export declare const SUB_DROP = 0.28;
125
136
  /** The text's box around its anchor, before any rotation, in px. */
126
- export declare const textBox: (text: string, size: number, align: TextAlign, baseline: TextBaseline) => {
137
+ export declare const textBox: (text: string, size: number, align: TextAlign, baseline: TextBaseline, sub?: string) => {
127
138
  x0: number;
128
139
  x1: number;
129
140
  y0: number;
@@ -185,6 +196,7 @@ export interface ResolvedText {
185
196
  readonly italic?: boolean;
186
197
  readonly weight?: number;
187
198
  readonly size?: number;
199
+ readonly sub?: string;
188
200
  }
189
201
  export interface ResolvedCircle {
190
202
  readonly group: string;
@@ -213,6 +225,17 @@ export interface ResolveOptions {
213
225
  };
214
226
  /** Labels that must be left out whatever room there is. */
215
227
  readonly exclude?: ReadonlySet<SceneText>;
228
+ /**
229
+ * Groups that are never shown together (one result diagram at a time): their labels are placed
230
+ * after everything else and give way to it, but not to each other, so a hidden diagram's numbers
231
+ * never push out a load's value or the numbers of the diagram on show.
232
+ */
233
+ readonly alternativeGroups?: ReadonlySet<string>;
234
+ /**
235
+ * The groups whose `shield` lines count (the diagrams on show); all of them when left out. A
236
+ * hidden diagram does not keep a load's value off the place it would take.
237
+ */
238
+ readonly shields?: ReadonlySet<string>;
216
239
  }
217
240
  /**
218
241
  * Which labels to draw. By priority, a label is kept unless it would overlap one already kept,
@@ -2,18 +2,25 @@
2
2
  * The drawing of a whole structure as scene items, in the hand of the EduBeam website's figures
3
3
  * (HeroFigure, BuildSteps): ink members with round caps, outlined supports, orange loads, purple
4
4
  * reactions clear of the supports, diagrams as an outline with ordinates across the member, and
5
- * numbers only where a reader looks for them - extremes and corners.
5
+ * numbers where a reader looks for them - member ends, steps, extremes and corners.
6
6
  *
7
7
  * Sign rules follow the EduBeam app: N and V positive away from the member's local +z side, M on
8
8
  * the tension side, so a sagging moment hangs below a beam drawn left to right.
9
9
  */
10
- import { type InternalForce, type MemberFrame, type PlotModel } from './model.js';
10
+ import { type InternalForce, type MemberFrame, type MemberResults, type PlotModel } from './model.js';
11
11
  import { type Anchor, type SceneItem, type TextPlacement } from './scene.js';
12
12
  import { type Units } from './units.js';
13
13
  /** What the caller switches on and off. Results are named by their symbol. */
14
14
  export type PlotLayer = 'nodes' | 'nodeLabels' | 'dimensions' | 'members' | 'supports' | 'loads' | 'reactions' | 'N' | 'V' | 'M' | 'w';
15
15
  /** Every layer, in paint order: results under the structure, nodes on top as BuildSteps draws them. */
16
16
  export declare const PLOT_LAYERS: readonly PlotLayer[];
17
+ export interface TemperatureSymbols {
18
+ /** The uniform change, along the axis */
19
+ readonly uniform: string;
20
+ /** The difference across the depth, bottom minus top */
21
+ readonly gradient: string;
22
+ }
23
+ export declare const DEFAULT_TEMPERATURE_SYMBOLS: TemperatureSymbols;
17
24
  export declare const RESULT_LAYERS: readonly ["N", "V", "M", "w"];
18
25
  export type ResultLayer = (typeof RESULT_LAYERS)[number];
19
26
  export interface StructureSceneOptions {
@@ -23,6 +30,8 @@ export interface StructureSceneOptions {
23
30
  readonly compact: boolean;
24
31
  readonly units: Units;
25
32
  readonly numberFormat?: Intl.NumberFormat;
33
+ /** The temperature load's symbols, which apps write differently: the Czech EduBeam has ΔTs and ΔTd − ΔTh. */
34
+ readonly temperatureSymbols?: TemperatureSymbols;
26
35
  /** Current scale in px per metre: spaces ordinates and load arrows evenly on screen. */
27
36
  readonly scale: number;
28
37
  /** Largest diagram ordinate, px. */
@@ -37,8 +46,16 @@ export interface StructureSceneOptions {
37
46
  readonly fontSize?: number;
38
47
  /** Values upright (`horizontal`) or turned to run along their ordinate (`axis`), as in the app. */
39
48
  readonly resultLabelMode?: ResultLabelMode;
49
+ /**
50
+ * `values` (the default) draws each reaction the way it acts, with its size. `names` draws the
51
+ * unknowns of an exercise instead: an arrow for every restrained direction, pointing the way it
52
+ * counts as positive (along the node's x, up, counter-clockwise), named `A` with subscript `x`,
53
+ * `z`, or `M` with subscript `A`. It needs no results.
54
+ */
55
+ readonly reactionLabels?: ReactionLabels;
40
56
  }
41
57
  export type ResultLabelMode = 'axis' | 'horizontal';
58
+ export type ReactionLabels = 'values' | 'names';
42
59
  /** Ordinates are this far apart on screen, as in the app and the website's figures. */
43
60
  export declare const HATCH_SPACING_PX = 7;
44
61
  type Vec = {
@@ -54,6 +71,8 @@ export declare const diagramSide: (q: InternalForce, momentOnTensionSide: boolea
54
71
  * outward along the same ordinate - it never leaves its tip.
55
72
  */
56
73
  export declare const tipPlacements: (tip: Anchor, out: Vec, mode: ResultLabelMode, gaps?: number[]) => TextPlacement[];
74
+ /** Every member carries one constant normal force and no member loads: a truss, read bar by bar. */
75
+ export declare const isBarStructure: (model: PlotModel, results: Readonly<Record<string, MemberResults>>) => boolean;
57
76
  /** px per SI unit for each result, from the largest value anywhere in the structure. */
58
77
  export declare const diagramScales: (model: PlotModel, options: Pick<StructureSceneOptions, "diagramSize" | "deformedSize" | "diagramScale">) => Record<ResultLayer, number>;
59
78
  export declare const memberFrames: (model: PlotModel) => Map<string, MemberFrame>;
@@ -0,0 +1,50 @@
1
+ import type { PlotModel } from './model.js';
2
+ import { type Tone } from './scene.js';
3
+ import { type PlotLayer, type ReactionLabels, type ResultLabelMode, type TemperatureSymbols } from './structure.js';
4
+ import { type Units } from './units.js';
5
+ /** Concrete colours for a file that has no page around it: the EduBeam app's, on white. */
6
+ export declare const PRINT_COLORS: Readonly<Record<Tone | 'paper', string>>;
7
+ export interface StructureSvgOptions {
8
+ /** Layers to draw. Default: members, supports, loads, reactions and the result `StructurePlot` picks. */
9
+ readonly layers?: readonly PlotLayer[];
10
+ /**
11
+ * Layers to make room for besides `layers`, as `StructurePlot`'s `reserve`: give every stage of a
12
+ * build-up the last stage's layers, and the files line up when laid over each other (Beamer overlays).
13
+ */
14
+ readonly reserve?: readonly PlotLayer[];
15
+ /** Label styles to make room for besides `resultLabelMode`. */
16
+ readonly reserveLabelModes?: readonly ResultLabelMode[];
17
+ /** Reaction label styles to make room for besides `reactionLabels`, so a sheet and its key line up. */
18
+ readonly reserveReactionLabels?: readonly ReactionLabels[];
19
+ /** Width of the drawing, px (the SVG's user units). Default 640. */
20
+ readonly width?: number;
21
+ /** Fixed height, px; by default the height follows the drawing, up to `maxHeight`. */
22
+ readonly height?: number;
23
+ readonly maxHeight?: number;
24
+ readonly padding?: number;
25
+ readonly fontSize?: number;
26
+ /** Any font stack the program opening the file knows. */
27
+ readonly fontFamily?: string;
28
+ readonly compact?: boolean;
29
+ readonly units?: Partial<Units>;
30
+ readonly numberFormat?: Intl.NumberFormat;
31
+ /** The temperature load's symbols, `ΔT` and `ΔTb − ΔTt` unless given */
32
+ readonly temperatureSymbols?: TemperatureSymbols;
33
+ readonly colors?: Partial<Record<Tone | 'paper', string>>;
34
+ readonly diagramSize?: number;
35
+ readonly deformedSize?: number;
36
+ readonly momentOnTensionSide?: boolean;
37
+ readonly resultLabelMode?: ResultLabelMode;
38
+ /** `names` draws the reactions as an exercise's unknowns, as `StructurePlot`'s `reactionLabels`. */
39
+ readonly reactionLabels?: ReactionLabels;
40
+ /** Paint the background in `paper`; off leaves it transparent. Default on. */
41
+ readonly background?: boolean;
42
+ /** Accessible name, written as the SVG's `<title>`. */
43
+ readonly title?: string;
44
+ }
45
+ /**
46
+ * The plot of a model as the text of a standalone `.svg` file, laid out as `StructurePlot` lays it
47
+ * out. Labels carry their halo as a separate text drawn underneath, for programs that ignore
48
+ * `paint-order`.
49
+ */
50
+ export declare const structureSvg: (model: PlotModel, options?: StructureSvgOptions) => string;
package/dist/index.d.ts CHANGED
@@ -3,12 +3,15 @@ export { default as DiagramStack } from './components/DiagramStack.vue.js';
3
3
  export { DEFAULT_COLORS, PLOT_CSS, toneVars, type PlotColors } from './components/theme.js';
4
4
  export type { DiagramStackEmits, DiagramStackProps, StackReadout, StructurePlotEmits, StructurePlotProps, } from './components/types.js';
5
5
  export { EduBeamPlot } from './plugin.js';
6
+ export { DEFAULT_PLOT_TEXTS, PLOT_TEXTS, usePlotTexts, type PlotTexts } from './components/texts.js';
6
7
  export { modelFromSolver, type FromSolverOptions } from './core/fromSolver.js';
8
+ export { layoutStructure, alternativeResultGroups, type StructureLayout } from './core/layout.js';
9
+ export { structureSvg, PRINT_COLORS, type StructureSvgOptions } from './core/svg.js';
7
10
  export * from './core/model.js';
8
11
  export * from './core/polynomial.js';
9
12
  export * from './core/units.js';
10
13
  export { supportKind, supportPlacement, supportGlyph, glyphReach, type SupportKind, type SupportPlacement, type GlyphPart, } from './core/supports.js';
11
- export { buildStructureScene, defaultResultLayer, diagramScales, diagramSide, memberFrames, HATCH_SPACING_PX, PLOT_LAYERS, RESULT_LAYERS, type PlotLayer, type ResultLabelMode, type ResultLayer, type StructureSceneOptions, tipPlacements, } from './core/structure.js';
12
- export { fitScene, placeLabels, resolveScene, sceneBounds, project, type Anchor, type Fit, type FitBox, type SceneItem, type ResolvedScene, type Transform, type Tone, } from './core/scene.js';
13
- export { readMember, readoutAt, formatReadout, type Readout, type ReadoutQuantity, type SidedValue, } from './core/readout.js';
14
+ export { buildStructureScene, defaultResultLayer, diagramScales, diagramSide, isBarStructure, memberFrames, HATCH_SPACING_PX, DEFAULT_TEMPERATURE_SYMBOLS, PLOT_LAYERS, RESULT_LAYERS, type PlotLayer, type TemperatureSymbols, type ReactionLabels, type ResultLabelMode, type ResultLayer, type StructureSceneOptions, tipPlacements, } from './core/structure.js';
15
+ export { fitScene, placeLabels, resolveScene, sceneBounds, project, type Anchor, type Fit, type FitBox, type SceneItem, type ResolvedScene, type ResolvedPath, type ResolvedText, type ResolvedCircle, type ResolveOptions, type SceneText, type Bounds, type TextPlacement, type Transform, type Tone, } from './core/scene.js';
16
+ export { readMember, readoutAt, readoutMarks, formatReadout, type Readout, type ReadoutMark, type ReadoutQuantity, type SidedValue, } from './core/readout.js';
14
17
  export { beamLine, lineDiagram, lineModel, pointLoadAt, rowOutline, rowOrdinates, rowRange, rowPeaks, rowBreaks, type BeamLine, type LineMember, type RowPeak, type StackRow, } from './core/stack.js';