@opendata-ai/openchart-vanilla 2.13.1 → 6.0.0
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/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/styles.css +4 -1
- package/package.json +3 -3
- package/src/svg-renderer.ts +10 -2
package/dist/styles.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opendata-ai/openchart-vanilla",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Vanilla JS renderer for openchart: SVG charts, HTML tables, force-directed graphs",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Riley Hilliard",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@floating-ui/dom": "^1.7.6",
|
|
53
|
-
"@opendata-ai/openchart-core": "
|
|
54
|
-
"@opendata-ai/openchart-engine": "
|
|
53
|
+
"@opendata-ai/openchart-core": "6.0.0",
|
|
54
|
+
"@opendata-ai/openchart-engine": "6.0.0",
|
|
55
55
|
"d3-force": "^3.0.0",
|
|
56
56
|
"d3-quadtree": "^3.0.1"
|
|
57
57
|
},
|
package/src/svg-renderer.ts
CHANGED
|
@@ -80,7 +80,15 @@ function applyTextStyle(el: SVGElement, style: TextStyle): void {
|
|
|
80
80
|
el.setAttribute('text-anchor', style.textAnchor);
|
|
81
81
|
}
|
|
82
82
|
if (style.dominantBaseline) {
|
|
83
|
-
|
|
83
|
+
// WebKit/iOS Safari has a getBBox() bug with dominant-baseline: hanging
|
|
84
|
+
// where the bounding box extends above y=0, causing the SVG's default
|
|
85
|
+
// overflow:hidden to clip the text. Use a dy offset instead, which
|
|
86
|
+
// achieves the same visual positioning without the bbox issue.
|
|
87
|
+
if (style.dominantBaseline === 'hanging') {
|
|
88
|
+
el.setAttribute('dy', `${style.fontSize * 0.8}px`);
|
|
89
|
+
} else {
|
|
90
|
+
el.setAttribute('dominant-baseline', style.dominantBaseline);
|
|
91
|
+
}
|
|
84
92
|
}
|
|
85
93
|
if (style.fontVariant) {
|
|
86
94
|
el.setAttribute('font-variant', style.fontVariant);
|
|
@@ -1023,10 +1031,10 @@ function renderBrand(parent: SVGElement, layout: ChartLayout): void {
|
|
|
1023
1031
|
setAttrs(text, {
|
|
1024
1032
|
x: rightEdge,
|
|
1025
1033
|
y: chromeY,
|
|
1034
|
+
dy: BRAND_FONT_SIZE * 0.8,
|
|
1026
1035
|
'font-family': layout.theme.fonts.family,
|
|
1027
1036
|
'font-size': BRAND_FONT_SIZE,
|
|
1028
1037
|
'text-anchor': 'end',
|
|
1029
|
-
'dominant-baseline': 'hanging',
|
|
1030
1038
|
'fill-opacity': 0.55,
|
|
1031
1039
|
});
|
|
1032
1040
|
(text as SVGElement & ElementCSSInlineStyle).style.setProperty('fill', fill);
|