context-mapper 0.22.0__tar.gz → 0.23.0__tar.gz
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.
- {context_mapper-0.22.0 → context_mapper-0.23.0}/PKG-INFO +3 -3
- {context_mapper-0.22.0 → context_mapper-0.23.0}/README.md +2 -2
- {context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper/template/app.js +9 -4
- {context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper/template/download.js +5 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper/template/index.html +1 -5
- {context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper/template/style.css +3 -1
- {context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper.egg-info/PKG-INFO +3 -3
- {context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper.egg-info/scm_version.json +2 -2
- {context_mapper-0.22.0 → context_mapper-0.23.0}/tests/test_build.py +1 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/tests/test_mermaid.py +1 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/.github/workflows/ci.yml +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/.github/workflows/pages.yml +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/.github/workflows/publish.yml +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/.gitignore +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/LICENSE +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/docs/screenshot.png +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/example/context-map.style.yml +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/example/context-map.yml +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/pyproject.toml +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/setup.cfg +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper/__init__.py +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper/__main__.py +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper/build.py +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper/graph.py +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper/mermaid.py +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper/serve.py +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper.egg-info/SOURCES.txt +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper.egg-info/dependency_links.txt +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper.egg-info/entry_points.txt +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper.egg-info/requires.txt +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper.egg-info/scm_file_list.json +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper.egg-info/top_level.txt +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/tests/conftest.py +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/tests/test_graph.py +0 -0
- {context_mapper-0.22.0 → context_mapper-0.23.0}/tests/test_serve.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: context-mapper
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.23.0
|
|
4
4
|
Summary: Builds an interactive context map and Mermaid diagrams from a YAML domain model.
|
|
5
5
|
Author-email: Henrique Moody <henriquemoody@gmail.com>
|
|
6
6
|
License-Expression: ISC
|
|
@@ -173,7 +173,7 @@ These can be set under `defaults` and overridden per view:
|
|
|
173
173
|
| Option | Values | What it does |
|
|
174
174
|
| --- | --- | --- |
|
|
175
175
|
| `level` | `context`, `domain` | Bounded contexts inside domain boxes, or one box per domain. |
|
|
176
|
-
| `depth` | number, `99` for all | Hops out from the focus. |
|
|
176
|
+
| `depth` | whole number, `99` for all | Hops out from the focus. |
|
|
177
177
|
| `dir` | `both`, `up`, `down` | Depends on, used by, or both. |
|
|
178
178
|
| `display` | `expanded`, `collapsed`, `contents`, `hidden`, or a map from container id to one of those | How containers first render. A single value applies to every container; a map leaves the rest to their own `defaultDisplay` in the style file. |
|
|
179
179
|
| `hide` | a list of ids | What the view never draws, no matter what: hiding a domain or a cluster takes everything inside it, hiding a bounded context only its own box and arrows. In the whole system that trims domains and clusters; in a domain's view it leaves out bounded contexts; in a cluster's view, members. The focus itself is never hidden. |
|
|
@@ -214,6 +214,6 @@ pages:
|
|
|
214
214
|
- `index.html#focus=foundations`: interactive, the foundations cluster, opened, and what its members touch
|
|
215
215
|
- `index.html#level=domain&focus=orders`: interactive, the Orders domain and its neighbors
|
|
216
216
|
- `index.html#focus=orders&hide.fulfillment=1`: interactive, the Orders domain without the Fulfillment context
|
|
217
|
-
- Other hash options: `depth
|
|
217
|
+
- Other hash options: `depth=<n>`, `dir=both|up|down`, `display.<domain id>=expanded|collapsed|contents|hidden`, `hide.<id>=1|0`
|
|
218
218
|
- `mermaid/checkout.html`: static diagram for Checkout
|
|
219
219
|
- `mermaid/index.html`: all static diagrams
|
|
@@ -144,7 +144,7 @@ These can be set under `defaults` and overridden per view:
|
|
|
144
144
|
| Option | Values | What it does |
|
|
145
145
|
| --- | --- | --- |
|
|
146
146
|
| `level` | `context`, `domain` | Bounded contexts inside domain boxes, or one box per domain. |
|
|
147
|
-
| `depth` | number, `99` for all | Hops out from the focus. |
|
|
147
|
+
| `depth` | whole number, `99` for all | Hops out from the focus. |
|
|
148
148
|
| `dir` | `both`, `up`, `down` | Depends on, used by, or both. |
|
|
149
149
|
| `display` | `expanded`, `collapsed`, `contents`, `hidden`, or a map from container id to one of those | How containers first render. A single value applies to every container; a map leaves the rest to their own `defaultDisplay` in the style file. |
|
|
150
150
|
| `hide` | a list of ids | What the view never draws, no matter what: hiding a domain or a cluster takes everything inside it, hiding a bounded context only its own box and arrows. In the whole system that trims domains and clusters; in a domain's view it leaves out bounded contexts; in a cluster's view, members. The focus itself is never hidden. |
|
|
@@ -185,6 +185,6 @@ pages:
|
|
|
185
185
|
- `index.html#focus=foundations`: interactive, the foundations cluster, opened, and what its members touch
|
|
186
186
|
- `index.html#level=domain&focus=orders`: interactive, the Orders domain and its neighbors
|
|
187
187
|
- `index.html#focus=orders&hide.fulfillment=1`: interactive, the Orders domain without the Fulfillment context
|
|
188
|
-
- Other hash options: `depth
|
|
188
|
+
- Other hash options: `depth=<n>`, `dir=both|up|down`, `display.<domain id>=expanded|collapsed|contents|hidden`, `hide.<id>=1|0`
|
|
189
189
|
- `mermaid/checkout.html`: static diagram for Checkout
|
|
190
190
|
- `mermaid/index.html`: all static diagrams
|
|
@@ -96,7 +96,7 @@ function relations(id) {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
const $ = id => document.getElementById(id);
|
|
99
|
-
const levelSel = $("level"), focusSel = $("focus"),
|
|
99
|
+
const levelSel = $("level"), focusSel = $("focus"), depthIn = $("depth"), dirSel = $("dir");
|
|
100
100
|
|
|
101
101
|
(function fillFocus() {
|
|
102
102
|
const byName = (a, b) => a.name.localeCompare(b.name);
|
|
@@ -216,8 +216,13 @@ if (DIAGRAM.elk) {
|
|
|
216
216
|
}
|
|
217
217
|
mermaid.initialize({ startOnLoad: false, securityLevel: "loose" });
|
|
218
218
|
|
|
219
|
+
// The depth field takes any whole number of hops; anything else — empty,
|
|
220
|
+
// fractional, negative — falls back to the nearest whole hop, at least 1.
|
|
221
|
+
const clampDepth = raw => Math.max(1, Math.trunc(Number(raw) || 1));
|
|
222
|
+
|
|
219
223
|
function state() {
|
|
220
|
-
|
|
224
|
+
depthIn.value = clampDepth(depthIn.value); // the field snaps to what it stands for
|
|
225
|
+
return { level: levelSel.value, focus: focusSel.value, depth: Number(depthIn.value), dir: dirSel.value,
|
|
221
226
|
display: displayModes(), hide: new Set(hiddenContexts) };
|
|
222
227
|
}
|
|
223
228
|
|
|
@@ -225,7 +230,7 @@ function readHash() {
|
|
|
225
230
|
const p = new URLSearchParams(location.hash.slice(1));
|
|
226
231
|
levelSel.value = p.get("level") === "domain" ? "domain" : "context";
|
|
227
232
|
focusSel.value = p.has("focus") && (owner[p.get("focus")] || clusterById[p.get("focus")]) ? p.get("focus") : "";
|
|
228
|
-
|
|
233
|
+
depthIn.value = clampDepth(p.get("depth"));
|
|
229
234
|
dirSel.value = p.get("dir") || "both";
|
|
230
235
|
Object.entries(displaySels).forEach(([id, sel]) => {
|
|
231
236
|
const m = p.get("display." + id);
|
|
@@ -622,7 +627,7 @@ $("panel").addEventListener("click", ev => {
|
|
|
622
627
|
const go = ev.target.closest("[data-go]");
|
|
623
628
|
if (go) { focusSel.value = go.dataset.go; render(); }
|
|
624
629
|
});
|
|
625
|
-
[levelSel, focusSel,
|
|
630
|
+
[levelSel, focusSel, depthIn, dirSel].forEach(el => el.addEventListener("change", render));
|
|
626
631
|
// A container's select takes over from a hide the moment it is touched.
|
|
627
632
|
Object.entries(displaySels).forEach(([id, sel]) => sel.addEventListener("change", () => {
|
|
628
633
|
hiddenContexts.delete(id);
|
|
@@ -31,6 +31,11 @@ function standaloneSvg(svg) {
|
|
|
31
31
|
clone.setAttribute("width", Math.round(width));
|
|
32
32
|
clone.setAttribute("height", Math.round(height));
|
|
33
33
|
clone.removeAttribute("style");
|
|
34
|
+
// The font the labels show on the page is the page's own — Mermaid writes
|
|
35
|
+
// no font-family into the drawing — and the page's stylesheet doesn't
|
|
36
|
+
// travel with the file. Bake in the family the live diagram computes, so
|
|
37
|
+
// the download keeps what the screen shows.
|
|
38
|
+
clone.style.fontFamily = getComputedStyle(svg).fontFamily;
|
|
34
39
|
// The page paints the diagram's background; a file of its own needs one of
|
|
35
40
|
// its own, the same color, or a dark slide or a dark-mode README turns it
|
|
36
41
|
// into dark text on a dark page. The viewBox need not start at 0, so the
|
|
@@ -22,11 +22,7 @@
|
|
|
22
22
|
<select id="focus"><option value="">Whole system</option></select>
|
|
23
23
|
</label>
|
|
24
24
|
<label>Depth
|
|
25
|
-
<
|
|
26
|
-
<option value="1">1 hop</option>
|
|
27
|
-
<option value="2">2 hops</option>
|
|
28
|
-
<option value="99">All</option>
|
|
29
|
-
</select>
|
|
25
|
+
<input type="number" id="depth" min="1" step="1" value="1">
|
|
30
26
|
</label>
|
|
31
27
|
<label>Direction
|
|
32
28
|
<select id="dir">
|
|
@@ -13,8 +13,10 @@ header h1 { font-size: 18px; margin: 0 8px 0 0; }
|
|
|
13
13
|
#links a:hover { text-decoration: underline; }
|
|
14
14
|
#links a + a::before { content: "·"; display: inline-block; margin: 0 8px; color: var(--muted); }
|
|
15
15
|
label { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
|
|
16
|
-
select, button { font: inherit; padding: 4px 8px; border: 1px solid #b0b0b0; border-radius: 6px; background: #fff; color: var(--ink); }
|
|
16
|
+
select, input, button { font: inherit; padding: 4px 8px; border: 1px solid #b0b0b0; border-radius: 6px; background: #fff; color: var(--ink); }
|
|
17
17
|
button { cursor: pointer; }
|
|
18
|
+
/* The depth field sits among the selects in the header: same look, sized for a hop count. */
|
|
19
|
+
#depth { width: 5.5em; }
|
|
18
20
|
main { display: grid; grid-template-columns: 1fr 320px; height: calc(100vh - 58px); }
|
|
19
21
|
#graph { min-height: 400px; overflow: auto; padding: 16px; }
|
|
20
22
|
#graph svg { max-width: 100%; height: auto; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: context-mapper
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.23.0
|
|
4
4
|
Summary: Builds an interactive context map and Mermaid diagrams from a YAML domain model.
|
|
5
5
|
Author-email: Henrique Moody <henriquemoody@gmail.com>
|
|
6
6
|
License-Expression: ISC
|
|
@@ -173,7 +173,7 @@ These can be set under `defaults` and overridden per view:
|
|
|
173
173
|
| Option | Values | What it does |
|
|
174
174
|
| --- | --- | --- |
|
|
175
175
|
| `level` | `context`, `domain` | Bounded contexts inside domain boxes, or one box per domain. |
|
|
176
|
-
| `depth` | number, `99` for all | Hops out from the focus. |
|
|
176
|
+
| `depth` | whole number, `99` for all | Hops out from the focus. |
|
|
177
177
|
| `dir` | `both`, `up`, `down` | Depends on, used by, or both. |
|
|
178
178
|
| `display` | `expanded`, `collapsed`, `contents`, `hidden`, or a map from container id to one of those | How containers first render. A single value applies to every container; a map leaves the rest to their own `defaultDisplay` in the style file. |
|
|
179
179
|
| `hide` | a list of ids | What the view never draws, no matter what: hiding a domain or a cluster takes everything inside it, hiding a bounded context only its own box and arrows. In the whole system that trims domains and clusters; in a domain's view it leaves out bounded contexts; in a cluster's view, members. The focus itself is never hidden. |
|
|
@@ -214,6 +214,6 @@ pages:
|
|
|
214
214
|
- `index.html#focus=foundations`: interactive, the foundations cluster, opened, and what its members touch
|
|
215
215
|
- `index.html#level=domain&focus=orders`: interactive, the Orders domain and its neighbors
|
|
216
216
|
- `index.html#focus=orders&hide.fulfillment=1`: interactive, the Orders domain without the Fulfillment context
|
|
217
|
-
- Other hash options: `depth
|
|
217
|
+
- Other hash options: `depth=<n>`, `dir=both|up|down`, `display.<domain id>=expanded|collapsed|contents|hidden`, `hide.<id>=1|0`
|
|
218
218
|
- `mermaid/checkout.html`: static diagram for Checkout
|
|
219
219
|
- `mermaid/index.html`: all static diagrams
|
|
@@ -227,6 +227,7 @@ def test_the_interactive_page_can_download_the_diagram(tmp_path):
|
|
|
227
227
|
assert '<option value="svg">SVG</option>' in text
|
|
228
228
|
assert '<button id="download">Download</button>' in text
|
|
229
229
|
assert "function downloadDiagram" in text # the shared export script, spliced in
|
|
230
|
+
assert "getComputedStyle(svg).fontFamily" in text # the page's font travels with the file
|
|
230
231
|
assert "/*__DOWNLOAD__*/" not in text # never left behind
|
|
231
232
|
|
|
232
233
|
|
|
@@ -535,6 +535,7 @@ def test_build_writes_the_download_links_into_the_page(tmp_path, example_data, e
|
|
|
535
535
|
assert 'data-download="png"' in page
|
|
536
536
|
assert 'data-download="svg"' in page
|
|
537
537
|
assert "function downloadDiagram" in page # the shared export script, spliced in
|
|
538
|
+
assert "getComputedStyle(svg).fontFamily" in page # the page's font travels with the file
|
|
538
539
|
assert "__DOWNLOAD__" not in page # never left behind
|
|
539
540
|
assert 'downloadDiagram(svg, a.dataset.download, "overview")' in page
|
|
540
541
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
{context_mapper-0.22.0 → context_mapper-0.23.0}/src/context_mapper.egg-info/scm_file_list.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|