@edubeam/plot 0.0.0-stage → 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 +88 -0
- package/LICENSE +674 -0
- package/README.md +386 -2
- package/dist/components/DiagramStack.vue.d.ts +18 -0
- package/dist/components/StructurePlot.vue.d.ts +18 -0
- package/dist/components/texts.d.ts +24 -0
- package/dist/components/theme.d.ts +16 -0
- package/dist/components/types.d.ts +117 -0
- package/dist/core/fromSolver.d.ts +12 -0
- package/dist/core/layout.d.ts +23 -0
- package/dist/core/model.d.ts +135 -0
- package/dist/core/polynomial.d.ts +72 -0
- package/dist/core/readout.d.ts +48 -0
- package/dist/core/scene.d.ts +248 -0
- package/dist/core/stack.d.ts +56 -0
- package/dist/core/structure.d.ts +86 -0
- package/dist/core/supports.d.ts +50 -0
- package/dist/core/svg.d.ts +50 -0
- package/dist/core/units.d.ts +30 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +3257 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +6 -0
- package/package.json +90 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@edubeam/plot` are listed here. The project follows [Semantic Versioning](https://semver.org).
|
|
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
|
+
|
|
60
|
+
## 0.1.0 (2026-11-18)
|
|
61
|
+
|
|
62
|
+
The first release.
|
|
63
|
+
|
|
64
|
+
- **`StructurePlot`** draws a plane frame, beam or truss solved by @edubeam/fem.
|
|
65
|
+
- It draws members, hinges, supports for every DOF combination (rotated supports included), loads, reactions, the
|
|
66
|
+
N, V and M diagrams, and the deformed shape.
|
|
67
|
+
- It fits itself to the width of its box at real pixel size, and makes room for every label it keeps.
|
|
68
|
+
- Independent layers (`nodes`, `nodeLabels`, `dimensions`, `members`, `supports`, `loads`, `reactions`, `N`, `V`,
|
|
69
|
+
`M`, `w`), with `reserve`, let a figure build up in stages without moving.
|
|
70
|
+
- A compact mode is for thumbnails.
|
|
71
|
+
- Values sit at the tips of their ordinates, upright or along the ordinate (`resultLabelMode`), with collision
|
|
72
|
+
handling.
|
|
73
|
+
- Truss bar forces show along their bars, by sign.
|
|
74
|
+
- Optional hover readout.
|
|
75
|
+
- **`DiagramStack`** draws the stacked textbook figure: a beam with its loads above its V(x), M(x) and w(x) on one x
|
|
76
|
+
axis.
|
|
77
|
+
- A reading cursor snaps to steps and shows both values.
|
|
78
|
+
- `v-model:load-at` adds a point load the reader can drag, with the pointer or the keyboard.
|
|
79
|
+
- Rows keep a fixed scale with `ranges`, and shrink to fit `maxHeight`.
|
|
80
|
+
- **Exact results.** `modelFromSolver` stores each member's results as piecewise polynomials, split at point loads,
|
|
81
|
+
in a plain, JSON-serialisable `PlotModel`. Extremes are found exactly, and curves are drawn as exact Béziers.
|
|
82
|
+
- **Types and plugin.** `StructurePlotProps`, `DiagramStackProps` and their emit types are exported for typed
|
|
83
|
+
wrappers. `app.use(EduBeamPlot)` registers both components globally. Declarations resolve under bundler, node16 and
|
|
84
|
+
nodenext module resolution.
|
|
85
|
+
- **Theming** through CSS custom properties, with system-colour fallbacks, so a page's light and dark themes apply.
|
|
86
|
+
- **Server rendering, accessibility and scrolling.** It renders on the server, has accessible names and a keyboard
|
|
87
|
+
slider for the draggable load, and respects `prefers-reduced-motion`. A static plot never captures scrolling or
|
|
88
|
+
taps.
|