@x-cmd/draw 0.5.12 → 0.5.13
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/dist/render/arch3d.js +11 -2
- package/package.json +1 -1
package/dist/render/arch3d.js
CHANGED
|
@@ -94,7 +94,12 @@ export function renderArch3d(scene, opts = {}) {
|
|
|
94
94
|
`font-family="ui-sans-serif,-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif" ` +
|
|
95
95
|
`role="img" aria-label="3D architecture diagram">` +
|
|
96
96
|
style() +
|
|
97
|
-
`<g id="am"
|
|
97
|
+
`<g id="am">` +
|
|
98
|
+
// 底色:这张图本来就是暗的(配色写死)⇒ 自己铺一块底,
|
|
99
|
+
// 不然存成 SVG 或者转成 PNG 时,白字落在透明底上 ⇒ 看不见 ✗
|
|
100
|
+
`<rect class="a3d-bg" x="${r2(vb.x)}" y="${r2(vb.y)}" width="${r2(vb.w)}" height="${r2(vb.h)}" fill="var(--d-card)"/>` +
|
|
101
|
+
body +
|
|
102
|
+
`</g>` +
|
|
98
103
|
`</svg>`);
|
|
99
104
|
}
|
|
100
105
|
/** 场景里所有节点的提示文案(悬停用) */
|
|
@@ -291,6 +296,10 @@ export function renderArch3dFlat(scene, opts = {}) {
|
|
|
291
296
|
`font-family="ui-sans-serif,-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif" ` +
|
|
292
297
|
`role="img" aria-label="3D architecture diagram (flat)">` +
|
|
293
298
|
style() +
|
|
294
|
-
`<g id="am"
|
|
299
|
+
`<g id="am">` +
|
|
300
|
+
// 底色:同三维那版(暗色场景 ⇒ 自己铺底,转成 PNG 才看得见字)
|
|
301
|
+
`<rect class="a3d-bg" x="${r2(-40)}" y="${r2(baseY - 40)}" width="${r2(totalW + 80)}" height="${r2(totalH + 100)}" fill="var(--d-card)"/>` +
|
|
302
|
+
parts.join('') +
|
|
303
|
+
`</g>` +
|
|
295
304
|
`</svg>`);
|
|
296
305
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x-cmd/draw",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.13",
|
|
4
4
|
"description": "SVG chart rendering as a service, a library, and a CLI — pie/bar/hbar/line/area/radar/gauge/scatter/combo/sankey/qr, same params everywhere",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|