dsh-model-everything 0.5.0 → 0.5.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.
Files changed (62) hide show
  1. package/README.en-US.md +12 -0
  2. package/README.md +4 -0
  3. package/lib/client.js +2437 -216
  4. package/lib/render/channels.js +243 -0
  5. package/lib/render/collapse.js +12 -20
  6. package/lib/render/components.js +99 -0
  7. package/lib/render/coords.js +288 -0
  8. package/lib/render/cycle-break.js +147 -0
  9. package/lib/render/dummy.js +43 -0
  10. package/lib/render/from-mermaid.js +34 -10
  11. package/lib/render/from-plantuml.js +318 -46
  12. package/lib/render/layer.js +91 -0
  13. package/lib/render/layout.js +27 -11
  14. package/lib/render/network-simplex.js +272 -0
  15. package/lib/render/order.js +122 -0
  16. package/lib/render/paint.js +764 -67
  17. package/lib/render/place.js +393 -121
  18. package/lib/render/route.js +225 -0
  19. package/lib/render/svg.js +143 -21
  20. package/lib/render/symbol.js +108 -0
  21. package/lib/render/text.js +74 -0
  22. package/lib/render/wrap.js +87 -0
  23. package/lib/types/render/channels.d.ts +63 -0
  24. package/lib/types/render/components.d.ts +57 -0
  25. package/lib/types/render/coords.d.ts +64 -0
  26. package/lib/types/render/cycle-break.d.ts +45 -0
  27. package/lib/types/render/dummy.d.ts +32 -0
  28. package/lib/types/render/from-plantuml.d.ts +12 -6
  29. package/lib/types/render/layer.d.ts +28 -0
  30. package/lib/types/render/layout.d.ts +43 -11
  31. package/lib/types/render/model.d.ts +17 -0
  32. package/lib/types/render/network-simplex.d.ts +54 -0
  33. package/lib/types/render/order.d.ts +27 -0
  34. package/lib/types/render/paint.d.ts +42 -9
  35. package/lib/types/render/place.d.ts +35 -19
  36. package/lib/types/render/route.d.ts +77 -0
  37. package/lib/types/render/svg.d.ts +1 -1
  38. package/lib/types/render/symbol.d.ts +73 -0
  39. package/lib/types/render/text.d.ts +38 -0
  40. package/lib/types/render/wrap.d.ts +27 -0
  41. package/package.json +148 -148
  42. package/skills/model-everything-diagram/SKILL.md +84 -82
  43. package/src/render/channels.ts +309 -0
  44. package/src/render/collapse.ts +150 -155
  45. package/src/render/components.ts +126 -0
  46. package/src/render/coords.ts +328 -0
  47. package/src/render/cycle-break.ts +164 -0
  48. package/src/render/dummy.ts +65 -0
  49. package/src/render/from-mermaid.ts +261 -236
  50. package/src/render/from-plantuml.ts +469 -178
  51. package/src/render/layer.ts +98 -0
  52. package/src/render/layout.ts +101 -62
  53. package/src/render/model.ts +86 -67
  54. package/src/render/network-simplex.ts +290 -0
  55. package/src/render/order.ts +139 -0
  56. package/src/render/paint.ts +1006 -290
  57. package/src/render/place.ts +527 -234
  58. package/src/render/route.ts +269 -0
  59. package/src/render/svg.ts +270 -127
  60. package/src/render/symbol.ts +137 -0
  61. package/src/render/text.ts +86 -0
  62. package/src/render/wrap.ts +103 -0
package/README.en-US.md CHANGED
@@ -91,6 +91,18 @@ because a layered diagram whose members float outside their package is not showi
91
91
  boundary folds it into one box and clicking again unfolds it; folding is a transform on the model, not a mode of
92
92
  the painter, so the edges re-aim at the box.
93
93
 
94
+ **An edge goes around a component, never through one.** A clear edge is a straight line; as soon as a box sits
95
+ between the two ends, the edge is routed on a **sparse grid** - one candidate line just outside each side of every
96
+ box, then A* over that small graph with a bend penalty. It is the same construction Graphviz (a visibility graph),
97
+ ELK and yFiles (an orthogonal router) and mxGraph use: no pixel grid, O(boxes) candidate lines, and the cost of a
98
+ bend counted so a route does not zig-zag to save a few points. When the search cannot finish, the straight line
99
+ stays: losing an edge is worse than a detour.
100
+
101
+ **Text is measured before a box is placed.** A `<br>` or `<br/>` in a label is a hard break and a long label wraps;
102
+ a box is sized from the lines it actually draws, and a row is as tall as its tallest box. An edge label walks along
103
+ its own edge and steps aside when the line is occupied - the same idea as Graphviz making a label a dummy node the
104
+ layout must leave room for. **Text first, geometry second**, so overflow is not a matter of luck.
105
+
94
106
  **A line it cannot draw is refused with its line number.** Sequence diagrams, class diagrams, Gantt charts, the
95
107
  `click`/`classDef` directives and PlantUML's `actor`/`note` are all refused by line. A sequence diagram that
96
108
  quietly lost its lifelines looks complete, and that is worse than no drawing.
package/README.md CHANGED
@@ -74,6 +74,10 @@ DeepSeek Harness 原生插件。把设计与代码里**关于行为的断言**
74
74
 
75
75
  **父子分组是一等公民。** Mermaid 的 `subgraph` 与 PlantUML 的 `package` 都读成边界,边界可以嵌套,布局按「组内竖排、父组包住子组」来算——因为一个成员飘在包外面的分层图,并没有在表达包含关系。点一个边界就把它折成一个盒子,再点展开;折叠是模型变换,不是绘制模式,所以连线会跟着改指到盒子上。
76
76
 
77
+ **连线绕开组件,穿过组件的不画。** 直连没有障碍时就是一条直线;一旦有盒子挡在中间,改走**稀疏网格**——候选坐标取每个盒子四边外一点点,构成一张很小的图,再用 A\* 找最短路,并对**拐弯计费**。这是 Graphviz(visibility graph)、ELK / yFiles(orthogonal router)、mxGraph 共用的做法:不做像素网格,用盒子边界构造 O(盒子数) 的候选线,成本才是可接受的。搜索失败时保留直线,丢一条边比绕远路更糟。
78
+
79
+ **排版先量文字,再定盒子。** 标签里的 `<br>` / `<br/>` 是硬换行,过长的标签自动折行;盒子尺寸由它实际要画的那几行决定,行高取该行最高的盒子。边标签会沿自己的边找位置,找不到就退到边的一侧——和 Graphviz 把一个标签当虚拟节点、为它留位是同一个思路:**文字先量,几何后算**。盒子按文字定宽,所以溢出不靠运气。
80
+
77
81
  **画不了的行会说清楚。** 序列表、类图、甘特图、`click`/`classDef` 这类指令,以及 PlantUML 的 `actor`/`note`,一律按行号拒绝。悄悄丢掉生命线的时序图看起来是完整的,这比不画更糟。
78
82
 
79
83
  **深浅色跟着页面走。** 背景亮度决定用深色板还是浅色板,四套配色可选(`default`、`github`、`high-contrast`、`print`);底色画在 SVG 里,所以外层换皮肤也改不了图的对比度。右栏还有一个白板标签页:贴源码就出图,不依赖任何工具结果。