@r0kshan/cairn 1.0.0-RC15 → 1.0.0-RC17
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 +8 -7
- package/bin/cairn.mjs +1749 -272
- package/dist/cairn.mjs +1798 -242
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -34,6 +34,7 @@ Furthermore, complexe software architecture with many flows and component genera
|
|
|
34
34
|
| **Typed diagrams with validation.** | Each view defines its element kinds and rules; `cairn validate` reports syntax, schema, and completeness issues as source-located, coded diagnostics, with a JSON mode for CI. |
|
|
35
35
|
| **Flow matrix.** | `cairn matrix` exports the flow matrix as CSV, Markdown, or SVG — from any view, with the columns that view can fill. In infrastructure it splits protocol from port and annotates endpoints that sit in a network zone; headers localise via `style { lang: fr }`. The same table is available to embedders through `compile(source, { matrix: true })`. |
|
|
36
36
|
| **Author-controlled positioning.** | Layout is automatic, with three opt-in overrides for when it gets a diagram wrong: `order: 2` sequences a top-level element along the disposition's own reading direction (left to right in `wide`, top to bottom in `tall`) and sorts siblings inside a container, `A.right -> B.left` pins which side of an element a flow leaves and arrives on, and the arrow glyph carries the line style (`->` solid, `-->` dashed, `..>` dotted). |
|
|
37
|
+
| **Playground drag-to-adjust.** | When the automatic layout needs a correction, the [playground](https://cairn-psi-five.vercel.app/) lets you drag elements, flow labels, a single route segment, or a flow's endpoint onto another side. Every drag is written back into the source as the matching hint — `offset:`, `label-offset:`, `segment-offset:`, `ID.side` — so the adjustment stays versionable text and re-renders identically from the CLI. |
|
|
37
38
|
| **Enterprise-view extras.** | Business objects on flows, an auto-generated legend, and a numbered-flow table via `flow-text: numbered`. |
|
|
38
39
|
| **French or English output.** | `style { lang: fr }` localizes band titles, legend, and matrix headers while keeping keywords English for portable sources (open to adding other languages if you find this usefull) |
|
|
39
40
|
| **In-built themes and customizable colours** | Whether using the default or a chosen in-built theme, element colours can be overriden for all elements of a given kind in the `style` block |
|
|
@@ -64,7 +65,7 @@ As a result here's a comparaison of the same diagram done with D2 (ELK Layout) v
|
|
|
64
65
|
|
|
65
66
|
## Usage
|
|
66
67
|
|
|
67
|
-
Either use the cli or the [ playground](https://cairn-psi-five.vercel.app/).
|
|
68
|
+
Either use the cli or the [ playground](https://cairn-psi-five.vercel.app/) (elements are and labels are manually draggable with DSL updated automatically with corresponding offsets).
|
|
68
69
|
|
|
69
70
|
## Preview
|
|
70
71
|
|
|
@@ -75,8 +76,8 @@ Every image below is rendered by cairn CLI from a `.cairn` source in [`examples/
|
|
|
75
76
|
### Logicial view diagram examples from small to large
|
|
76
77
|
|
|
77
78
|
<p align="center"><img src="examples/small.svg" alt="Small logical view" width="760"></p>
|
|
78
|
-
<p align="center"><img src="examples/
|
|
79
|
-
<p align="center"><img src="examples/large.svg" alt="
|
|
79
|
+
<p align="center"><img src="examples/logical-security.svg" alt="Medium logical view with security capabilities" width="760"></p>
|
|
80
|
+
<p align="center"><img src="examples/large.svg" alt="Large logical view" width="760"></p>
|
|
80
81
|
|
|
81
82
|
### Application view diagram examples from small to large
|
|
82
83
|
|
|
@@ -134,7 +135,7 @@ Colours are resolved at three levels — most specific wins. From lowest to high
|
|
|
134
135
|
|
|
135
136
|
Flows can also be coloured inline:
|
|
136
137
|
```cairn
|
|
137
|
-
COM_CTR -> OBS
|
|
138
|
+
COM_CTR -> OBS "Alerts…" { label: above stroke: dashed #a33 text: #a33 }
|
|
138
139
|
```
|
|
139
140
|
|
|
140
141
|
See [`examples/colors-custom.cairn`](examples/colors-custom.cairn) for a full example:
|
|
@@ -207,9 +208,9 @@ style {
|
|
|
207
208
|
flow-label: above # on-line (default) | above | below
|
|
208
209
|
}
|
|
209
210
|
|
|
210
|
-
AGENT -> RECEIVE
|
|
211
|
-
ASSIGN -> SETTLE
|
|
212
|
-
TRACE -> STORE
|
|
211
|
+
AGENT -> RECEIVE "File a claim" # above, from the style block
|
|
212
|
+
ASSIGN -> SETTLE "Request settlement" { label: below } # overridden per flow
|
|
213
|
+
TRACE -> STORE "Archive the trace" { label: on-line } # back to the default
|
|
213
214
|
```
|
|
214
215
|
|
|
215
216
|
<p align="center"><img src="examples/placement/flow-label.svg" alt="Flow label positions" width="760"></p>
|