@opendata-ai/openchart-vanilla 6.1.1 → 6.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendata-ai/openchart-vanilla",
3
- "version": "6.1.1",
3
+ "version": "6.1.2",
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": "6.1.1",
54
- "@opendata-ai/openchart-engine": "6.1.1",
53
+ "@opendata-ai/openchart-core": "6.1.2",
54
+ "@opendata-ai/openchart-engine": "6.1.2",
55
55
  "d3-force": "^3.0.0",
56
56
  "d3-quadtree": "^3.0.1"
57
57
  },
@@ -12,6 +12,7 @@
12
12
  * - Labels and glow skipped during active pan/zoom gestures
13
13
  */
14
14
 
15
+ import { BRAND_FONT_SIZE, BRAND_MIN_WIDTH } from '@opendata-ai/openchart-core';
15
16
  import type { GraphRenderState, PositionedEdge, PositionedNode } from './types';
16
17
 
17
18
  // ---------------------------------------------------------------------------
@@ -33,9 +34,6 @@ const TWO_PI = Math.PI * 2;
33
34
  /** Minimum node radius in screen pixels. Keeps nodes visible when zoomed out. */
34
35
  const MIN_SCREEN_RADIUS = 2.5;
35
36
 
36
- /** Minimum canvas width to render the brand watermark. */
37
- const BRAND_MIN_WIDTH = 120;
38
-
39
37
  // ---------------------------------------------------------------------------
40
38
  // Helpers (exported for testing)
41
39
  // ---------------------------------------------------------------------------
@@ -251,7 +249,7 @@ export class GraphCanvasRenderer {
251
249
  const padding = theme.spacing.padding;
252
250
  const x = w - padding;
253
251
  const y = h - padding;
254
- ctx.font = `600 20px ${theme.fonts.family}`;
252
+ ctx.font = `600 ${BRAND_FONT_SIZE}px ${theme.fonts.family}`;
255
253
  ctx.fillStyle = theme.colors.axis;
256
254
  ctx.globalAlpha = 0.55;
257
255
  ctx.textAlign = 'right';
@@ -27,7 +27,7 @@ import type {
27
27
  TextStyle,
28
28
  TickMarkLayout,
29
29
  } from '@opendata-ai/openchart-core';
30
- import { estimateTextWidth } from '@opendata-ai/openchart-core';
30
+ import { BRAND_FONT_SIZE, BRAND_MIN_WIDTH, estimateTextWidth } from '@opendata-ai/openchart-core';
31
31
 
32
32
  const SVG_NS = 'http://www.w3.org/2000/svg';
33
33
 
@@ -1066,8 +1066,6 @@ function renderLegend(parent: SVGElement, legend: LegendLayout): void {
1066
1066
  // Brand rendering
1067
1067
  // ---------------------------------------------------------------------------
1068
1068
 
1069
- const BRAND_FONT_SIZE = 20;
1070
- const BRAND_MIN_WIDTH = 120;
1071
1069
  const BRAND_URL = 'https://tryopendata.ai';
1072
1070
  const XLINK_NS = 'http://www.w3.org/1999/xlink';
1073
1071
 
@@ -7,6 +7,7 @@
7
7
  */
8
8
 
9
9
  import type { ResolvedColumn, TableLayout, TableRow } from '@opendata-ai/openchart-core';
10
+ import { BRAND_FONT_SIZE } from '@opendata-ai/openchart-core';
10
11
  import { renderCell } from './renderers/table-cells';
11
12
 
12
13
  // ---------------------------------------------------------------------------
@@ -14,7 +15,6 @@ import { renderCell } from './renderers/table-cells';
14
15
  // ---------------------------------------------------------------------------
15
16
 
16
17
  const BRAND_URL = 'https://tryopendata.ai';
17
- const BRAND_FONT_SIZE = 20;
18
18
 
19
19
  // ---------------------------------------------------------------------------
20
20
  // Chrome rendering