@opendata-ai/openchart-engine 6.5.0 → 6.5.2
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 +1 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/annotations/compute.ts +0 -8
- package/src/layout/dimensions.ts +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opendata-ai/openchart-engine",
|
|
3
|
-
"version": "6.5.
|
|
3
|
+
"version": "6.5.2",
|
|
4
4
|
"description": "Headless compiler for openchart: spec validation, data compilation, scales, and layout",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Riley Hilliard",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"typecheck": "tsc --noEmit"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@opendata-ai/openchart-core": "6.5.
|
|
48
|
+
"@opendata-ai/openchart-core": "6.5.2",
|
|
49
49
|
"d3-array": "^3.2.0",
|
|
50
50
|
"d3-format": "^3.1.2",
|
|
51
51
|
"d3-interpolate": "^3.0.0",
|
|
@@ -675,14 +675,6 @@ function nudgeAnnotationFromObstacles(
|
|
|
675
675
|
labelCenterY <= chartArea.y + chartArea.height + fontSize * 3;
|
|
676
676
|
|
|
677
677
|
if (inBounds) {
|
|
678
|
-
// When nudged vertically (directly above/below the data), use a caret
|
|
679
|
-
// instead of a connector line for a cleaner editorial look.
|
|
680
|
-
if (candidateLabel.connector && dx === 0 && dy !== 0) {
|
|
681
|
-
candidateLabel.connector = {
|
|
682
|
-
...candidateLabel.connector,
|
|
683
|
-
style: 'caret',
|
|
684
|
-
};
|
|
685
|
-
}
|
|
686
678
|
annotation.label = candidateLabel;
|
|
687
679
|
return true;
|
|
688
680
|
}
|
package/src/layout/dimensions.ts
CHANGED
|
@@ -191,7 +191,12 @@ export function computeDimensions(
|
|
|
191
191
|
// Reserve right margin for text annotations near the chart's right edge.
|
|
192
192
|
// Without this, annotation text at the last data point clips outside the SVG.
|
|
193
193
|
// Account for anchor direction and offset.dx to avoid over-reserving space.
|
|
194
|
-
|
|
194
|
+
// Skip when annotations are hidden (tooltip-only at compact breakpoints).
|
|
195
|
+
if (
|
|
196
|
+
strategy?.annotationPosition !== 'tooltip-only' &&
|
|
197
|
+
spec.annotations.length > 0 &&
|
|
198
|
+
encoding.x
|
|
199
|
+
) {
|
|
195
200
|
const xField = encoding.x.field;
|
|
196
201
|
// Find the maximum x value in the data
|
|
197
202
|
let maxX: string | number | undefined;
|