@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/dist/index.js CHANGED
@@ -119,6 +119,7 @@ var GLOW_ALPHA = 0.15;
119
119
  var CULL_MARGIN = 50;
120
120
  var TWO_PI = Math.PI * 2;
121
121
  var MIN_SCREEN_RADIUS = 2.5;
122
+ var BRAND_MIN_WIDTH = 120;
122
123
  function labelThreshold(zoom) {
123
124
  const t = Math.max(0, Math.min(1, (zoom - 0.2) / 1.8));
124
125
  return 1 - t;
@@ -246,7 +247,7 @@ var GraphCanvasRenderer = class {
246
247
  // Brand rendering
247
248
  // -------------------------------------------------------------------------
248
249
  drawBrand(ctx, w, h, theme) {
249
- if (w < 120) return;
250
+ if (w < BRAND_MIN_WIDTH) return;
250
251
  const { dpr } = this;
251
252
  ctx.save();
252
253
  ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
@@ -255,7 +256,7 @@ var GraphCanvasRenderer = class {
255
256
  const y = h - padding;
256
257
  ctx.font = `600 20px ${theme.fonts.family}`;
257
258
  ctx.fillStyle = theme.colors.axis;
258
- ctx.globalAlpha = 0.5;
259
+ ctx.globalAlpha = 0.55;
259
260
  ctx.textAlign = "right";
260
261
  ctx.textBaseline = "alphabetic";
261
262
  ctx.fillText("OpenData", x, y);
@@ -2740,7 +2741,7 @@ function renderLegend(parent, legend) {
2740
2741
  parent.appendChild(g);
2741
2742
  }
2742
2743
  var BRAND_FONT_SIZE = 20;
2743
- var BRAND_MIN_WIDTH = 120;
2744
+ var BRAND_MIN_WIDTH2 = 120;
2744
2745
  var BRAND_URL = "https://tryopendata.ai";
2745
2746
  var XLINK_NS = "http://www.w3.org/1999/xlink";
2746
2747
  function brandPosition(layout) {
@@ -2759,7 +2760,7 @@ function brandPosition(layout) {
2759
2760
  return { openX, dataX, y, fill: layout.theme.colors.axis };
2760
2761
  }
2761
2762
  function renderBrandOpen(parent, layout) {
2762
- if (layout.dimensions.width < BRAND_MIN_WIDTH) return;
2763
+ if (layout.dimensions.width < BRAND_MIN_WIDTH2) return;
2763
2764
  const { openX, y, fill } = brandPosition(layout);
2764
2765
  const a = createSVGElement("a");
2765
2766
  a.setAttribute("href", BRAND_URL);
@@ -2783,7 +2784,7 @@ function renderBrandOpen(parent, layout) {
2783
2784
  parent.appendChild(a);
2784
2785
  }
2785
2786
  function renderBrandData(parent, layout) {
2786
- if (layout.dimensions.width < BRAND_MIN_WIDTH) return;
2787
+ if (layout.dimensions.width < BRAND_MIN_WIDTH2) return;
2787
2788
  const { dataX, y, fill } = brandPosition(layout);
2788
2789
  const a = createSVGElement("a");
2789
2790
  a.setAttribute("href", BRAND_URL);
@@ -4675,7 +4676,7 @@ function renderTable(layout, container) {
4675
4676
  brandLink.href = "https://tryopendata.ai";
4676
4677
  brandLink.target = "_blank";
4677
4678
  brandLink.rel = "noopener";
4678
- brandLink.style.cssText = `font-size: 20px; color: ${brandColor}; opacity: 0.55; text-decoration: none; font-family: ${theme ? theme.fonts.family : "sans-serif"};`;
4679
+ 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"};`;
4679
4680
  brandLink.textContent = "OpenData";
4680
4681
  brand.appendChild(brandLink);
4681
4682
  wrapper.appendChild(brand);