@opendata-ai/openchart-vanilla 2.3.1 → 2.3.4

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": "2.3.1",
3
+ "version": "2.3.4",
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",
@@ -46,8 +46,8 @@
46
46
  "typecheck": "tsc --noEmit"
47
47
  },
48
48
  "dependencies": {
49
- "@opendata-ai/openchart-core": "2.3.1",
50
- "@opendata-ai/openchart-engine": "2.3.1",
49
+ "@opendata-ai/openchart-core": "2.3.4",
50
+ "@opendata-ai/openchart-engine": "2.3.4",
51
51
  "d3-force": "^3.0.0",
52
52
  "d3-quadtree": "^3.0.1"
53
53
  },
@@ -33,6 +33,9 @@ const TWO_PI = Math.PI * 2;
33
33
  /** Minimum node radius in screen pixels. Keeps nodes visible when zoomed out. */
34
34
  const MIN_SCREEN_RADIUS = 2.5;
35
35
 
36
+ /** Minimum canvas width to render the brand watermark. */
37
+ const BRAND_MIN_WIDTH = 120;
38
+
36
39
  // ---------------------------------------------------------------------------
37
40
  // Helpers (exported for testing)
38
41
  // ---------------------------------------------------------------------------
@@ -241,7 +244,7 @@ export class GraphCanvasRenderer {
241
244
  h: number,
242
245
  theme: GraphRenderState['theme'],
243
246
  ): void {
244
- if (w < 120) return;
247
+ if (w < BRAND_MIN_WIDTH) return;
245
248
  const { dpr } = this;
246
249
  ctx.save();
247
250
  ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
@@ -250,7 +253,7 @@ export class GraphCanvasRenderer {
250
253
  const y = h - padding;
251
254
  ctx.font = `600 20px ${theme.fonts.family}`;
252
255
  ctx.fillStyle = theme.colors.axis;
253
- ctx.globalAlpha = 0.5;
256
+ ctx.globalAlpha = 0.55;
254
257
  ctx.textAlign = 'right';
255
258
  ctx.textBaseline = 'alphabetic';
256
259
  ctx.fillText('OpenData', x, y);
@@ -354,7 +354,7 @@ export function renderTable(layout: TableLayout, container: HTMLElement): HTMLEl
354
354
  brandLink.href = 'https://tryopendata.ai';
355
355
  brandLink.target = '_blank';
356
356
  brandLink.rel = 'noopener';
357
- brandLink.style.cssText = `font-size: 20px; color: ${brandColor}; opacity: 0.55; text-decoration: none; font-family: ${theme ? theme.fonts.family : 'sans-serif'};`;
357
+ brandLink.style.cssText = `font-size: 20px; font-weight: 600; color: ${brandColor}; opacity: 0.55; text-decoration: none; font-family: ${theme ? theme.fonts.family : 'sans-serif'};`;
358
358
  brandLink.textContent = 'OpenData';
359
359
  brand.appendChild(brandLink);
360
360
  wrapper.appendChild(brand);