umlimator 0.16.0 → 0.16.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 +2 -2
- package/lib/umlimator.d.ts +1 -1
- package/lib/umlimator.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ drill-down, a data pipeline, an AI agent's skills, and host pages for embedding,
|
|
|
65
65
|
npm install umlimator
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
Or from GitHub, at a tag or any commit: `"umlimator": "github:zintaen/umlimator#v0.16.
|
|
68
|
+
Or from GitHub, at a tag or any commit: `"umlimator": "github:zintaen/umlimator#v0.16.1"`. npm 12 refuses git
|
|
69
69
|
dependencies unless the project opts in, so that also needs `allow-git=root` in the `.npmrc` next to `package.json`.
|
|
70
70
|
|
|
71
71
|
## Embed
|
|
@@ -299,7 +299,7 @@ jobs:
|
|
|
299
299
|
runs-on: ubuntu-latest
|
|
300
300
|
steps:
|
|
301
301
|
- uses: actions/checkout@v4
|
|
302
|
-
- uses: zintaen/umlimator@v0.16.
|
|
302
|
+
- uses: zintaen/umlimator@v0.16.1
|
|
303
303
|
with:
|
|
304
304
|
models: "docs/*.json" # optional: where the models are (default: every .json that is a map model)
|
|
305
305
|
```
|
package/lib/umlimator.d.ts
CHANGED
|
@@ -344,7 +344,7 @@ export function history(model: MapModel, limit?: number): History;
|
|
|
344
344
|
export function layout(model: MapModel, viewId: string, options?: { repair?: boolean; measure?: (text: string, px: number) => number; expand?: string[] }): Geometry & { unfolded?: string[] };
|
|
345
345
|
/** A model's own problem. path says where: "views[2].nodeIds[4]". Errors draw as holes or not at all (missing,
|
|
346
346
|
* repeated or dangling ids, a box inside itself); warnings draw other than they say (an unknown kind, weight or side,
|
|
347
|
-
* a view a card opens that the host has not loaded yet). The JSON Schema is umlimator/schema.json. */
|
|
347
|
+
* a view a card opens that the host has not loaded yet, a line from a card or box to itself, which is not drawn). The JSON Schema is umlimator/schema.json. */
|
|
348
348
|
export interface Problem { level: 'error' | 'warning'; path: string; message: string }
|
|
349
349
|
export function validate(model: MapModel): Problem[];
|
|
350
350
|
/** One issue of the layout check: its message, as the page's check words it, and the cards, lines and boxes it is about
|
package/lib/umlimator.js
CHANGED
|
@@ -2644,7 +2644,7 @@ export function check(model, viewId, options = {}) {
|
|
|
2644
2644
|
const WIRE_KINDS = ['calls', 'feeds', 'triggers', 'state', 'guard'], SIDES = ['left', 'right', 'top', 'bottom'];
|
|
2645
2645
|
/** A model's own problems, before anything is drawn: errors draw as holes or not at all (ids that are missing,
|
|
2646
2646
|
* repeated or name nothing, boxes inside themselves); warnings draw other than they say (an unknown kind or weight,
|
|
2647
|
-
* a side that is not one, a view opened before the host has loaded it). Each says where: `views[2].nodeIds[4]`. */
|
|
2647
|
+
* a side that is not one, a view opened before the host has loaded it, a line to itself, which is not drawn). Each says where: `views[2].nodeIds[4]`. */
|
|
2648
2648
|
export function validate(model) {
|
|
2649
2649
|
const out = [], err = (path, message) => out.push({ level: 'error', path, message }), warn = (path, message) => out.push({ level: 'warning', path, message });
|
|
2650
2650
|
const arr = x => (Array.isArray(x) ? x : []), m = model && typeof model === 'object' ? model : {}, views = arr(m.views).filter(v => v && typeof v === 'object');
|
|
@@ -2676,6 +2676,7 @@ export function validate(model) {
|
|
|
2676
2676
|
const line = (e, at, ends) => {
|
|
2677
2677
|
if (!e || typeof e !== 'object') return err(at, 'a line is an object with from and to');
|
|
2678
2678
|
['from', 'to'].forEach(k => { if (!ends.has(e[k])) err(`${at}.${k}`, `"${e[k]}" is neither a card nor a box`); });
|
|
2679
|
+
if (e.from != null && e.from === e.to) warn(at, `a line from "${e.from}" to itself: not drawn`); // a self-loop (risks.md F1); typed views will draw one
|
|
2679
2680
|
if (e.kind != null && !WIRE_KINDS.includes(e.kind)) warn(at + '.kind', `unknown line kind "${e.kind}": drawn as calls`);
|
|
2680
2681
|
if (e.weight != null && ![1, 2, 3].includes(e.weight)) warn(at + '.weight', `weight ${JSON.stringify(e.weight)} is not 1, 2 or 3: drawn as 1`);
|
|
2681
2682
|
['fromSide', 'toSide'].forEach(k => { if (e[k] != null && !SIDES.includes(e[k])) warn(`${at}.${k}`, `"${e[k]}" is not left, right, top or bottom: ignored`); });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "umlimator",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"description": "Embeddable, layered architecture maps: layout, orthogonal routing and an interactive canvas in one ES module.",
|
|
5
5
|
"keywords": ["architecture", "diagram", "c4", "map", "svg", "layout", "orthogonal-routing", "drill-down"],
|
|
6
6
|
"homepage": "https://zintaen.github.io/umlimator/",
|