headson 0.5.1__tar.gz → 0.5.2__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.

Potentially problematic release.


This version of headson might be problematic. Click here for more details.

Files changed (52) hide show
  1. {headson-0.5.1 → headson-0.5.2}/Cargo.lock +1 -1
  2. {headson-0.5.1 → headson-0.5.2}/Cargo.toml +2 -1
  3. {headson-0.5.1 → headson-0.5.2}/PKG-INFO +3 -37
  4. {headson-0.5.1 → headson-0.5.2}/README.md +2 -36
  5. headson-0.5.2/docs/assets/algorithm.svg +81 -0
  6. {headson-0.5.1 → headson-0.5.2}/pyproject.toml +1 -1
  7. {headson-0.5.1 → headson-0.5.2}/python/Cargo.lock +2 -2
  8. {headson-0.5.1 → headson-0.5.2}/python/Cargo.toml +1 -1
  9. {headson-0.5.1 → headson-0.5.2}/JSONTestSuite/LICENSE +0 -0
  10. {headson-0.5.1 → headson-0.5.2}/JSONTestSuite/README.md +0 -0
  11. {headson-0.5.1 → headson-0.5.2}/LICENSE +0 -0
  12. {headson-0.5.1 → headson-0.5.2}/python/README.md +0 -0
  13. {headson-0.5.1 → headson-0.5.2}/python/headson/__init__.py +0 -0
  14. {headson-0.5.1 → headson-0.5.2}/python/src/lib.rs +0 -0
  15. {headson-0.5.1 → headson-0.5.2}/src/json_ingest/builder.rs +0 -0
  16. {headson-0.5.1 → headson-0.5.2}/src/json_ingest/mod.rs +0 -0
  17. {headson-0.5.1 → headson-0.5.2}/src/json_ingest/samplers/default.rs +0 -0
  18. {headson-0.5.1 → headson-0.5.2}/src/json_ingest/samplers/head.rs +0 -0
  19. {headson-0.5.1 → headson-0.5.2}/src/json_ingest/samplers/mod.rs +0 -0
  20. {headson-0.5.1 → headson-0.5.2}/src/json_ingest/samplers/tail.rs +0 -0
  21. {headson-0.5.1 → headson-0.5.2}/src/lib.rs +0 -0
  22. {headson-0.5.1 → headson-0.5.2}/src/main.rs +0 -0
  23. {headson-0.5.1 → headson-0.5.2}/src/order/build.rs +0 -0
  24. {headson-0.5.1 → headson-0.5.2}/src/order/mod.rs +0 -0
  25. {headson-0.5.1 → headson-0.5.2}/src/order/scoring.rs +0 -0
  26. {headson-0.5.1 → headson-0.5.2}/src/order/snapshots/headson__order__build__tests__order_empty_array_order.snap +0 -0
  27. {headson-0.5.1 → headson-0.5.2}/src/order/snapshots/headson__order__build__tests__order_single_string_array_order.snap +0 -0
  28. {headson-0.5.1 → headson-0.5.2}/src/order/types.rs +0 -0
  29. {headson-0.5.1 → headson-0.5.2}/src/serialization/fileset.rs +0 -0
  30. {headson-0.5.1 → headson-0.5.2}/src/serialization/mod.rs +0 -0
  31. {headson-0.5.1 → headson-0.5.2}/src/serialization/snapshots/headson__serialization__tests__arena_render_empty.snap +0 -0
  32. {headson-0.5.1 → headson-0.5.2}/src/serialization/snapshots/headson__serialization__tests__arena_render_single.snap +0 -0
  33. {headson-0.5.1 → headson-0.5.2}/src/serialization/templates/core.rs +0 -0
  34. {headson-0.5.1 → headson-0.5.2}/src/serialization/templates/js.rs +0 -0
  35. {headson-0.5.1 → headson-0.5.2}/src/serialization/templates/json.rs +0 -0
  36. {headson-0.5.1 → headson-0.5.2}/src/serialization/templates/mod.rs +0 -0
  37. {headson-0.5.1 → headson-0.5.2}/src/serialization/templates/pseudo.rs +0 -0
  38. {headson-0.5.1 → headson-0.5.2}/src/serialization/types.rs +0 -0
  39. {headson-0.5.1 → headson-0.5.2}/src/snapshots/headson__order__tests__order_empty_array_order.snap +0 -0
  40. {headson-0.5.1 → headson-0.5.2}/src/snapshots/headson__order__tests__order_single_string_array_order.snap +0 -0
  41. {headson-0.5.1 → headson-0.5.2}/src/snapshots/headson__order__tests__pq_empty_array_queue.snap +0 -0
  42. {headson-0.5.1 → headson-0.5.2}/src/snapshots/headson__order__tests__pq_single_string_array_queue.snap +0 -0
  43. {headson-0.5.1 → headson-0.5.2}/src/snapshots/headson__queue__tests__pq_empty_array_queue.snap +0 -0
  44. {headson-0.5.1 → headson-0.5.2}/src/snapshots/headson__queue__tests__pq_single_string_array_queue.snap +0 -0
  45. {headson-0.5.1 → headson-0.5.2}/src/snapshots/headson__tree__tests__build_tree_empty.snap +0 -0
  46. {headson-0.5.1 → headson-0.5.2}/src/snapshots/headson__tree__tests__build_tree_single.snap +0 -0
  47. {headson-0.5.1 → headson-0.5.2}/src/utils/graph.rs +0 -0
  48. {headson-0.5.1 → headson-0.5.2}/src/utils/json.rs +0 -0
  49. {headson-0.5.1 → headson-0.5.2}/src/utils/mod.rs +0 -0
  50. {headson-0.5.1 → headson-0.5.2}/src/utils/search.rs +0 -0
  51. {headson-0.5.1 → headson-0.5.2}/src/utils/text.rs +0 -0
  52. {headson-0.5.1 → headson-0.5.2}/src/utils/tree_arena.rs +0 -0
@@ -266,7 +266,7 @@ dependencies = [
266
266
 
267
267
  [[package]]
268
268
  name = "headson"
269
- version = "0.5.1"
269
+ version = "0.5.2"
270
270
  dependencies = [
271
271
  "anyhow",
272
272
  "assert_cmd",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "headson"
3
- version = "0.5.1"
3
+ version = "0.5.2"
4
4
  edition = "2024"
5
5
  description = "Budget‑constrained JSON preview renderer"
6
6
  readme = "README.md"
@@ -15,6 +15,7 @@ include = [
15
15
  "src/**",
16
16
  "Cargo.toml",
17
17
  "README.md",
18
+ "docs/assets/**",
18
19
  "LICENSE*",
19
20
  ]
20
21
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: headson
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Classifier: Programming Language :: Python
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Rust
@@ -167,48 +167,14 @@ print(
167
167
 
168
168
  # Algorithm
169
169
 
170
- ```mermaid
171
- %%{init: {"themeCSS": ".cluster > rect { fill: transparent; stroke: transparent; } .clusterLabel > text { font-size: 16px; font-weight: 600; } .clusterLabel span { padding: 6px 10px; font-size: 16px; font-weight: 600; }"}}%%
172
- flowchart TD
173
- subgraph Deserialization
174
- direction TB
175
- A["Input file(s)"]
176
- A -- Single --> C["Parse into optimized tree (with array pre‑sampling) ¹"]
177
- A -- Multiple --> D["Parse each file and wrap into a fileset object"]
178
- D --> C
179
- end
180
- subgraph Prioritization
181
- direction TB
182
- E["Build priority order ²"]
183
- F["Choose top N nodes ³"]
184
- end
185
- subgraph Serialization
186
- direction TB
187
- G["Render attempt ⁴"]
188
- H["Output preview string"]
189
- end
190
- C --> E
191
- E --> F
192
- F --> G
193
- G --> F
194
- F --> H
195
- %% Color classes for categories
196
- classDef des fill:#eaf2ff,stroke:#3b82f6,stroke-width:1px,color:#0f172a;
197
- classDef prio fill:#ecfdf5,stroke:#10b981,stroke-width:1px,color:#064e3b;
198
- classDef ser fill:#fff1f2,stroke:#f43f5e,stroke-width:1px,color:#7f1d1d;
199
- class A,C,D des;
200
- class E,F prio;
201
- class G,H ser;
202
- style Deserialization fill:transparent,stroke:transparent
203
- style Prioritization fill:transparent,stroke:transparent
204
- style Serialization fill:transparent,stroke:transparent
205
- ```
170
+ ![Algorithm overview](docs/assets/algorithm.svg)
206
171
 
207
172
  ## Footnotes
208
173
  - <sup><b>[1]</b></sup> <b>Optimized tree representation</b>: An arena‑style tree stored in flat, contiguous buffers. Each node records its kind and value plus index ranges into shared child and key arrays. Arrays are ingested in a single pass and may be deterministically pre‑sampled: the first element is always kept; additional elements are selected via a fixed per‑index inclusion test; for kept elements, original indices are stored and full lengths are counted. This enables accurate omission info and internal gap markers later, while minimizing pointer chasing.
209
174
  - <sup><b>[2]</b></sup> <b>Priority order</b>: Nodes are scored so previews surface representative structure and values first. Arrays can favor head/mid/tail coverage (default) or strictly the head; tail preference flips head/tail when configured. Object properties are ordered by key, and strings expand by grapheme with early characters prioritized over very deep expansions.
210
175
  - <sup><b>[3]</b></sup> <b>Choose top N nodes (binary search)</b>: Iteratively picks N so that the rendered preview fits within the character budget, looping between “choose N” and a render attempt to converge quickly.
211
176
  - <sup><b>[4]</b></sup> <b>Render attempt</b>: Serializes the currently included nodes using the selected template. Omission summaries and per-file section headers appear in display templates (pseudo/js); json remains strict. For arrays, display templates may insert internal gap markers between non‑contiguous kept items using original indices.
177
+ - <sup><b>[5]</b></sup> <b>Diagram source</b>: The Algorithm diagram is generated from `docs/diagrams/algorithm.mmd`. Regenerate the SVG with `cargo make diagrams` before releasing.
212
178
 
213
179
  ## License
214
180
 
@@ -152,48 +152,14 @@ print(
152
152
 
153
153
  # Algorithm
154
154
 
155
- ```mermaid
156
- %%{init: {"themeCSS": ".cluster > rect { fill: transparent; stroke: transparent; } .clusterLabel > text { font-size: 16px; font-weight: 600; } .clusterLabel span { padding: 6px 10px; font-size: 16px; font-weight: 600; }"}}%%
157
- flowchart TD
158
- subgraph Deserialization
159
- direction TB
160
- A["Input file(s)"]
161
- A -- Single --> C["Parse into optimized tree (with array pre‑sampling) ¹"]
162
- A -- Multiple --> D["Parse each file and wrap into a fileset object"]
163
- D --> C
164
- end
165
- subgraph Prioritization
166
- direction TB
167
- E["Build priority order ²"]
168
- F["Choose top N nodes ³"]
169
- end
170
- subgraph Serialization
171
- direction TB
172
- G["Render attempt ⁴"]
173
- H["Output preview string"]
174
- end
175
- C --> E
176
- E --> F
177
- F --> G
178
- G --> F
179
- F --> H
180
- %% Color classes for categories
181
- classDef des fill:#eaf2ff,stroke:#3b82f6,stroke-width:1px,color:#0f172a;
182
- classDef prio fill:#ecfdf5,stroke:#10b981,stroke-width:1px,color:#064e3b;
183
- classDef ser fill:#fff1f2,stroke:#f43f5e,stroke-width:1px,color:#7f1d1d;
184
- class A,C,D des;
185
- class E,F prio;
186
- class G,H ser;
187
- style Deserialization fill:transparent,stroke:transparent
188
- style Prioritization fill:transparent,stroke:transparent
189
- style Serialization fill:transparent,stroke:transparent
190
- ```
155
+ ![Algorithm overview](docs/assets/algorithm.svg)
191
156
 
192
157
  ## Footnotes
193
158
  - <sup><b>[1]</b></sup> <b>Optimized tree representation</b>: An arena‑style tree stored in flat, contiguous buffers. Each node records its kind and value plus index ranges into shared child and key arrays. Arrays are ingested in a single pass and may be deterministically pre‑sampled: the first element is always kept; additional elements are selected via a fixed per‑index inclusion test; for kept elements, original indices are stored and full lengths are counted. This enables accurate omission info and internal gap markers later, while minimizing pointer chasing.
194
159
  - <sup><b>[2]</b></sup> <b>Priority order</b>: Nodes are scored so previews surface representative structure and values first. Arrays can favor head/mid/tail coverage (default) or strictly the head; tail preference flips head/tail when configured. Object properties are ordered by key, and strings expand by grapheme with early characters prioritized over very deep expansions.
195
160
  - <sup><b>[3]</b></sup> <b>Choose top N nodes (binary search)</b>: Iteratively picks N so that the rendered preview fits within the character budget, looping between “choose N” and a render attempt to converge quickly.
196
161
  - <sup><b>[4]</b></sup> <b>Render attempt</b>: Serializes the currently included nodes using the selected template. Omission summaries and per-file section headers appear in display templates (pseudo/js); json remains strict. For arrays, display templates may insert internal gap markers between non‑contiguous kept items using original indices.
162
+ - <sup><b>[5]</b></sup> <b>Diagram source</b>: The Algorithm diagram is generated from `docs/diagrams/algorithm.mmd`. Regenerate the SVG with `cargo make diagrams` before releasing.
197
163
 
198
164
  ## License
199
165
 
@@ -0,0 +1,81 @@
1
+ <svg id="my-svg" width="100%" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="max-width: 597.039px; background-color: transparent;" viewBox="-8 -8 597.0390625 811" role="graphics-document document" aria-roledescription="flowchart-v2"><style>#my-svg{font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Arial,'Apple Color Emoji','Segoe UI Emoji',sans-serif;font-size:14px;fill:#000000;}#my-svg .error-icon{fill:#552222;}#my-svg .error-text{fill:#552222;stroke:#552222;}#my-svg .edge-thickness-normal{stroke-width:2px;}#my-svg .edge-thickness-thick{stroke-width:3.5px;}#my-svg .edge-pattern-solid{stroke-dasharray:0;}#my-svg .edge-pattern-dashed{stroke-dasharray:3;}#my-svg .edge-pattern-dotted{stroke-dasharray:2;}#my-svg .marker{fill:#666;stroke:#666;}#my-svg .marker.cross{stroke:#666;}#my-svg svg{font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Arial,'Apple Color Emoji','Segoe UI Emoji',sans-serif;font-size:14px;}#my-svg .label{font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Arial,'Apple Color Emoji','Segoe UI Emoji',sans-serif;color:#000000;}#my-svg .cluster-label text{fill:#333;}#my-svg .cluster-label span,#my-svg p{color:#333;}#my-svg .label text,#my-svg span,#my-svg p{fill:#000000;color:#000000;}#my-svg .node rect,#my-svg .node circle,#my-svg .node ellipse,#my-svg .node polygon,#my-svg .node path{fill:#eee;stroke:#999;stroke-width:1px;}#my-svg .flowchart-label text{text-anchor:middle;}#my-svg .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#my-svg .node .label{text-align:center;}#my-svg .node.clickable{cursor:pointer;}#my-svg .arrowheadPath{fill:#333333;}#my-svg .edgePath .path{stroke:#666;stroke-width:2.0px;}#my-svg .flowchart-link{stroke:#666;fill:none;}#my-svg .edgeLabel{background-color:white;text-align:center;}#my-svg .edgeLabel rect{opacity:0.5;background-color:white;fill:white;}#my-svg .labelBkg{background-color:rgba(255, 255, 255, 0.5);}#my-svg .cluster rect{fill:hsl(0, 0%, 98.9215686275%);stroke:#707070;stroke-width:1px;}#my-svg .cluster text{fill:#333;}#my-svg .cluster span,#my-svg p{color:#333;}#my-svg div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Arial,'Apple Color Emoji','Segoe UI Emoji',sans-serif;font-size:12px;background:hsl(-160, 0%, 93.3333333333%);border:1px solid #707070;border-radius:2px;pointer-events:none;z-index:100;}#my-svg .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#000000;}#my-svg :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#my-svg .des&gt;*{fill:#eaf2ff!important;stroke:#3b82f6!important;stroke-width:1px!important;color:#0f172a!important;}#my-svg .des span{fill:#eaf2ff!important;stroke:#3b82f6!important;stroke-width:1px!important;color:#0f172a!important;}#my-svg .des tspan{fill:#0f172a!important;}#my-svg .prio&gt;*{fill:#ecfdf5!important;stroke:#10b981!important;stroke-width:1px!important;color:#064e3b!important;}#my-svg .prio span{fill:#ecfdf5!important;stroke:#10b981!important;stroke-width:1px!important;color:#064e3b!important;}#my-svg .prio tspan{fill:#064e3b!important;}#my-svg .ser&gt;*{fill:#fff1f2!important;stroke:#f43f5e!important;stroke-width:1px!important;color:#7f1d1d!important;}#my-svg .ser span{fill:#fff1f2!important;stroke:#f43f5e!important;stroke-width:1px!important;color:#7f1d1d!important;}#my-svg .ser tspan{fill:#7f1d1d!important;}</style><g><marker id="my-svg_flowchart-pointEnd" class="marker flowchart" viewBox="0 0 10 10" refX="6" refY="5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"/></marker><marker id="my-svg_flowchart-pointStart" class="marker flowchart" viewBox="0 0 10 10" refX="4.5" refY="5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto"><path d="M 0 5 L 10 10 L 10 0 z" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"/></marker><marker id="my-svg_flowchart-circleEnd" class="marker flowchart" viewBox="0 0 10 10" refX="11" refY="5" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"/></marker><marker id="my-svg_flowchart-circleStart" class="marker flowchart" viewBox="0 0 10 10" refX="-1" refY="5" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"/></marker><marker id="my-svg_flowchart-crossEnd" class="marker cross flowchart" viewBox="0 0 11 11" refX="12" refY="5.2" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><path d="M 1,1 l 9,9 M 10,1 l -9,9" class="arrowMarkerPath" style="stroke-width: 2; stroke-dasharray: 1, 0;"/></marker><marker id="my-svg_flowchart-crossStart" class="marker cross flowchart" viewBox="0 0 11 11" refX="-1" refY="5.2" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><path d="M 1,1 l 9,9 M 10,1 l -9,9" class="arrowMarkerPath" style="stroke-width: 2; stroke-dasharray: 1, 0;"/></marker><g class="root"><g class="clusters"><g class="cluster default flowchart-label" id="Serialization"><rect style="" rx="0" ry="0" x="0" y="442" width="231.734375" height="353"/></g><g class="cluster default flowchart-label" id="Prioritization"><rect style="" rx="0" ry="0" x="251.734375" y="442" width="229.625" height="214"/></g><g class="cluster default flowchart-label" id="Deserialization"><rect style="" rx="0" ry="0" x="197.60546875" y="0" width="383.43359375" height="378"/></g></g><g class="edgePaths"><path d="M335.473,75L326.746,81.917C318.019,88.833,300.564,102.667,291.837,121.667C283.109,140.667,283.109,164.833,283.109,187.417C283.109,210,283.109,231,289.147,246.285C295.184,261.569,307.258,271.139,313.295,275.923L319.333,280.708" id="L-A-C-0" class=" edge-thickness-normal edge-pattern-solid flowchart-link LS-A LE-C" style="fill:none;" marker-end="url(#my-svg_flowchart-pointEnd)"/><path d="M389.73,75L398.457,81.917C407.184,88.833,424.639,102.667,433.366,115.617C442.094,128.567,442.094,140.633,442.094,146.667L442.094,152.7" id="L-A-D-0" class=" edge-thickness-normal edge-pattern-solid flowchart-link LS-A LE-D" style="fill:none;" marker-end="url(#my-svg_flowchart-pointEnd)"/><path d="M442.094,220L442.094,225.333C442.094,230.667,442.094,241.333,436.057,251.451C430.019,261.569,417.945,271.139,411.908,275.923L405.87,280.708" id="L-D-C-0" class=" edge-thickness-normal edge-pattern-solid flowchart-link LS-D LE-C" style="fill:none;" marker-end="url(#my-svg_flowchart-pointEnd)"/><path d="M362.602,346L362.602,351.333C362.602,356.667,362.602,367.333,362.602,378C362.602,388.667,362.602,399.333,362.602,410C362.602,420.667,362.602,431.333,362.602,441.117C362.602,450.9,362.602,459.8,362.602,464.25L362.602,468.7" id="L-C-E-0" class=" edge-thickness-normal edge-pattern-solid flowchart-link LS-C LE-E" style="fill:none;" marker-end="url(#my-svg_flowchart-pointEnd)"/><path d="M362.602,517L362.602,522.333C362.602,527.667,362.602,538.333,362.93,548.119C363.258,557.905,363.915,566.81,364.243,571.262L364.572,575.714" id="L-E-F-0" class=" edge-thickness-normal edge-pattern-solid flowchart-link LS-E LE-F" style="fill:none;" marker-end="url(#my-svg_flowchart-pointEnd)"/><path d="M283.734,581.462L262.438,576.052C241.141,570.641,198.547,559.821,173.784,549.784C149.02,539.747,142.087,530.494,138.621,525.868L135.155,521.241" id="L-F-G-0" class=" edge-thickness-normal edge-pattern-solid flowchart-link LS-F LE-G" style="fill:none;" marker-end="url(#my-svg_flowchart-pointEnd)"/><path d="M99.758,517L95.762,522.333C91.766,527.667,83.773,538.333,113.567,549.884C143.361,561.435,210.942,573.869,244.732,580.086L278.522,586.304" id="L-G-F-0" class=" edge-thickness-normal edge-pattern-solid flowchart-link LS-G LE-F" style="fill:none;" marker-end="url(#my-svg_flowchart-pointEnd)"/><path d="M366.547,624L366.547,629.333C366.547,634.667,366.547,645.333,324.767,656C282.987,666.667,199.427,677.333,157.647,687.117C115.867,696.9,115.867,705.8,115.867,710.25L115.867,714.7" id="L-F-H-0" class=" edge-thickness-normal edge-pattern-solid flowchart-link LS-F LE-H" style="fill:none;" marker-end="url(#my-svg_flowchart-pointEnd)"/></g><g class="edgeLabels"><g class="edgeLabel" transform="translate(283.109375, 189)"><g class="label" transform="translate(-20.0390625, -9.5)"><foreignObject width="40.078125" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">Single</span></div></foreignObject></g></g><g class="edgeLabel" transform="translate(442.09375, 116.5)"><g class="label" transform="translate(-26.875, -9.5)"><foreignObject width="53.75" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">Multiple</span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g></g><g class="nodes"><g class="node default ser flowchart-label" id="flowchart-G-9" data-node="true" data-id="G" transform="translate(115.8671875, 495.5)"><rect class="basic label-container" style="" rx="0" ry="0" x="-68.171875" y="-21.5" width="136.34375" height="43"/><g class="label" style="" transform="translate(-56.171875, -9.5)"><rect/><foreignObject width="112.34375" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">Render attempt ⁴</span></div></foreignObject></g></g><g class="node default ser flowchart-label" id="flowchart-H-10" data-node="true" data-id="H" transform="translate(115.8671875, 741.5)"><rect class="basic label-container" style="" rx="0" ry="0" x="-83.8671875" y="-21.5" width="167.734375" height="43"/><g class="label" style="" transform="translate(-71.8671875, -9.5)"><rect/><foreignObject width="143.734375" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">Output preview string</span></div></foreignObject></g></g><g class="node default prio flowchart-label" id="flowchart-E-7" data-node="true" data-id="E" transform="translate(362.6015625, 495.5)"><rect class="basic label-container" style="" rx="0" ry="0" x="-78.8671875" y="-21.5" width="157.734375" height="43"/><g class="label" style="" transform="translate(-66.8671875, -9.5)"><rect/><foreignObject width="133.734375" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">Build priority order ²</span></div></foreignObject></g></g><g class="node default prio flowchart-label" id="flowchart-F-8" data-node="true" data-id="F" transform="translate(366.546875, 602.5)"><rect class="basic label-container" style="" rx="0" ry="0" x="-82.8125" y="-21.5" width="165.625" height="43"/><g class="label" style="" transform="translate(-70.8125, -9.5)"><rect/><foreignObject width="141.625" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">Choose top N nodes ³</span></div></foreignObject></g></g><g class="node default des flowchart-label" id="flowchart-A-0" data-node="true" data-id="A" transform="translate(362.6015625, 53.5)"><rect class="basic label-container" style="" rx="0" ry="0" x="-49.203125" y="-21.5" width="98.40625" height="43"/><g class="label" style="" transform="translate(-37.203125, -9.5)"><rect/><foreignObject width="74.40625" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">Input file(s)</span></div></foreignObject></g></g><g class="node default des flowchart-label" id="flowchart-C-2" data-node="true" data-id="C" transform="translate(362.6015625, 315)"><rect class="basic label-container" style="" rx="0" ry="0" x="-98.96875" y="-31" width="197.9375" height="62"/><g class="label" style="" transform="translate(-86.96875, -19)"><rect/><foreignObject width="173.9375" height="38"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">Parse into optimized tree<br />(with array pre‑sampling) ¹</span></div></foreignObject></g></g><g class="node default des flowchart-label" id="flowchart-D-4" data-node="true" data-id="D" transform="translate(442.09375, 189)"><rect class="basic label-container" style="" rx="0" ry="0" x="-106.9453125" y="-31" width="213.890625" height="62"/><g class="label" style="" transform="translate(-94.9453125, -19)"><rect/><foreignObject width="189.890625" height="38"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">Parse each file<br />and wrap into a fileset object</span></div></foreignObject></g></g></g></g></g><style>/* Mermaid diagram CSS overrides for good light/dark rendering on GitHub/docs.rs */
2
+ /* Use a GitHub-like sans-serif stack for consistent sizing/flow */
3
+ svg, svg * { font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif; }
4
+
5
+ /* Define light defaults */
6
+ svg { --m-text: #0f172a; /* slate-900 */
7
+ --m-edge: #334155; /* slate-700 */
8
+ --m-label-outline: #ffffff;
9
+ --m-cluster-bg: #f8fafc; /* zinc-50 */
10
+ --m-cluster-border: #e5e7eb; /* zinc-200 */
11
+ --m-cluster-bg-opacity: 0.85;
12
+ --m-cluster-label-bg: #ffffff;
13
+ --m-cluster-label-fg: #0f172a;
14
+ --m-des-fill: #eaf2ff; --m-des-stroke: #3b82f6;
15
+ --m-pri-fill: #ecfdf5; --m-pri-stroke: #10b981;
16
+ --m-ser-fill: #fff1f2; --m-ser-stroke: #f43f5e; }
17
+
18
+ /* Dark mode overrides */
19
+ @media (prefers-color-scheme: dark) {
20
+ svg { --m-text: #e5e7eb; /* zinc-200 */
21
+ --m-edge: #cbd5e1; /* slate-300 */
22
+ --m-label-outline: #0b1220;
23
+ --m-cluster-bg: #0b1220; /* deep slate */
24
+ --m-cluster-border: #1f2937; /* slate-800 */
25
+ --m-cluster-bg-opacity: 0.75;
26
+ --m-cluster-label-bg: #000000;
27
+ --m-cluster-label-fg: #ffffff;
28
+ --m-des-fill: #0b1220; --m-des-stroke: #60a5fa; /* deeper blue bg, soft blue border */
29
+ --m-pri-fill: #052e2b; --m-pri-stroke: #34d399; /* deep teal bg, green border */
30
+ --m-ser-fill: #2a0f12; --m-ser-stroke: #fb7185; /* deep rose bg, rose border */ }
31
+ }
32
+
33
+ /* General text and edges */
34
+ svg text { fill: var(--m-text) !important; }
35
+ svg .edgePath path, svg path { stroke: var(--m-edge) !important; }
36
+ /* Slimmer edges and smaller arrowheads */
37
+ svg .edgePath path { stroke-width: 1.1px !important; }
38
+ svg marker path {
39
+ fill: var(--m-edge) !important;
40
+ stroke: var(--m-edge) !important;
41
+ stroke-width: 1.2px !important;
42
+ transform-box: fill-box;
43
+ transform-origin: 50% 50%;
44
+ transform: scale(0.75);
45
+ }
46
+
47
+ /* Avoid overriding label metrics; let Mermaid compute sizes */
48
+
49
+ /* Node category fills based on classDef in the diagram (des/prio/ser) */
50
+ /* Remove borders from all nodes */
51
+ svg .node rect, svg g.node &gt; rect, svg .label-container &gt; rect { stroke: none !important; }
52
+ svg .des rect { fill: var(--m-des-fill) !important; }
53
+ svg .prio rect { fill: var(--m-pri-fill) !important; }
54
+ svg .ser rect { fill: var(--m-ser-fill) !important; }
55
+
56
+ /* Cluster boxes invisible; labels styled */
57
+ /* Subgraphs: no background or border, only label visible */
58
+ svg g.cluster rect { fill: transparent !important; stroke: transparent !important; }
59
+ /* Subgraph label sizing/styling for both SVG and HTML label renderers */
60
+ svg .clusterLabel &gt; text, svg .cluster-label &gt; text { font-size: 22px !important; font-weight: 700 !important; fill: var(--m-text) !important; }
61
+ /* HTML-based cluster labels (when htmlLabels=true) */
62
+ svg foreignObject .clusterLabel,
63
+ svg foreignObject .cluster-label,
64
+ svg foreignObject div[class*="clusterLabel"],
65
+ svg foreignObject div[class*="cluster-label"] {
66
+ display: inline-block;
67
+ padding: 3px 12px;
68
+ border-radius: 6px;
69
+ background-color: var(--m-cluster-label-bg) !important;
70
+ color: var(--m-cluster-label-fg) !important;
71
+ font-size: 22px !important;
72
+ font-weight: 700 !important;
73
+ /* Mask nearby edges without outlines */
74
+ box-shadow: 0 0 0 6px var(--m-cluster-label-bg);
75
+ }
76
+ </style>
77
+ <!-- moved cluster labels to top layer -->
78
+ <g class="cluster-label" transform="translate(75.7265625, 442)"><foreignObject width="80.28125" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">Serialization</span></div></foreignObject></g>
79
+ <g class="cluster-label" transform="translate(324.234375, 442)"><foreignObject width="84.625" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">Prioritization</span></div></foreignObject></g>
80
+ <g class="cluster-label" transform="translate(340.611328125, 0)"><foreignObject width="97.421875" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">Deserialization</span></div></foreignObject></g>
81
+ </svg>
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "headson"
7
- version = "0.5.1"
7
+ version = "0.5.2"
8
8
  description = "Budget‑constrained JSON preview renderer (Python bindings)"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -169,7 +169,7 @@ dependencies = [
169
169
 
170
170
  [[package]]
171
171
  name = "headson"
172
- version = "0.5.1"
172
+ version = "0.5.2"
173
173
  dependencies = [
174
174
  "anyhow",
175
175
  "clap",
@@ -182,7 +182,7 @@ dependencies = [
182
182
 
183
183
  [[package]]
184
184
  name = "headson-python"
185
- version = "0.5.1"
185
+ version = "0.5.2"
186
186
  dependencies = [
187
187
  "anyhow",
188
188
  "headson",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "headson-python"
3
- version = "0.5.1"
3
+ version = "0.5.2"
4
4
  edition = "2021"
5
5
  publish = false
6
6
  readme = "README.md"
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
File without changes