@opendata-ai/openchart-vanilla 7.1.3 → 7.2.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 CHANGED
@@ -5259,7 +5259,7 @@ function renderAnnotations(parent, layout) {
5259
5259
 
5260
5260
  // src/renderers/axes.ts
5261
5261
  import {
5262
- AXIS_TITLE_OFFSET_COMPACT,
5262
+ AXIS_TITLE_GAP,
5263
5263
  estimateTextWidth as estimateTextWidth2,
5264
5264
  getAxisTitleOffset,
5265
5265
  TICK_LABEL_OFFSET
@@ -5304,7 +5304,8 @@ function renderAxis(parent, axis, orientation, layout) {
5304
5304
  label.setAttribute("class", "oc-axis-tick");
5305
5305
  if (axis.tickAngle && Math.abs(axis.tickAngle) > 10) {
5306
5306
  const labelX = tick.position;
5307
- const labelY = area.y + area.height + 6;
5307
+ const xLabelPad = axis.labelPadding ?? layout.theme.spacing.xAxisLabelPadding;
5308
+ const labelY = area.y + area.height + xLabelPad;
5308
5309
  setAttrs2(label, {
5309
5310
  x: labelX,
5310
5311
  y: labelY,
@@ -5313,9 +5314,10 @@ function renderAxis(parent, axis, orientation, layout) {
5313
5314
  transform: `rotate(${axis.tickAngle}, ${labelX}, ${labelY})`
5314
5315
  });
5315
5316
  } else {
5317
+ const xLabelPad = axis.labelPadding ?? layout.theme.spacing.xAxisLabelPadding;
5316
5318
  setAttrs2(label, {
5317
5319
  x: tick.position,
5318
- y: area.y + area.height + 14,
5320
+ y: area.y + area.height + xLabelPad,
5319
5321
  "text-anchor": "middle"
5320
5322
  });
5321
5323
  }
@@ -5474,7 +5476,6 @@ function renderAxis(parent, axis, orientation, layout) {
5474
5476
  transform: `rotate(90, ${titleX}, ${area.y + area.height / 2})`
5475
5477
  });
5476
5478
  } else {
5477
- const AXIS_TITLE_GAP = 8;
5478
5479
  const maxTickLabelWidth = axis.ticks.reduce((max, t) => {
5479
5480
  const w = estimateTextWidth2(
5480
5481
  t.label,
@@ -5484,7 +5485,7 @@ function renderAxis(parent, axis, orientation, layout) {
5484
5485
  return Math.max(max, w);
5485
5486
  }, 0);
5486
5487
  const dynamicOffset = TICK_LABEL_OFFSET + maxTickLabelWidth + AXIS_TITLE_GAP;
5487
- const titleOffset = Math.max(dynamicOffset, AXIS_TITLE_OFFSET_COMPACT);
5488
+ const titleOffset = Math.max(dynamicOffset, getAxisTitleOffset(layout.dimensions.width));
5488
5489
  setAttrs2(axisLabel, {
5489
5490
  x: area.x - titleOffset,
5490
5491
  y: area.y + area.height / 2,
@@ -8692,9 +8693,11 @@ function renderTable(layout, container, opts) {
8692
8693
  if (pagination) {
8693
8694
  wrapper.appendChild(pagination);
8694
8695
  }
8696
+ const footerRow = document.createElement("div");
8697
+ footerRow.className = "oc-table-footer-row";
8695
8698
  const footerChrome = renderChromeBlock(layout, "footer");
8696
8699
  if (footerChrome) {
8697
- wrapper.appendChild(footerChrome);
8700
+ footerRow.appendChild(footerChrome);
8698
8701
  }
8699
8702
  const liveRegion = document.createElement("div");
8700
8703
  liveRegion.className = "oc-table-live-region oc-sr-only";
@@ -8715,7 +8718,6 @@ function renderTable(layout, container, opts) {
8715
8718
  const brandColor = theme ? theme.colors.axis : "#999999";
8716
8719
  const brand = document.createElement("div");
8717
8720
  brand.className = "oc-table-ref";
8718
- brand.style.cssText = "text-align: right; padding: 4px 8px;";
8719
8721
  const brandLink = document.createElement("a");
8720
8722
  brandLink.href = BRAND_URL4;
8721
8723
  brandLink.target = "_blank";
@@ -8723,7 +8725,10 @@ function renderTable(layout, container, opts) {
8723
8725
  brandLink.style.cssText = `font-size: ${BRAND_FONT_SIZE4}px; font-weight: 600; color: ${brandColor}; opacity: 0.55; text-decoration: none; font-family: ${theme ? theme.fonts.family : "sans-serif"};`;
8724
8726
  brandLink.textContent = "tryOpenData.ai";
8725
8727
  brand.appendChild(brandLink);
8726
- wrapper.appendChild(brand);
8728
+ footerRow.appendChild(brand);
8729
+ }
8730
+ if (footerRow.childElementCount > 0) {
8731
+ wrapper.appendChild(footerRow);
8727
8732
  }
8728
8733
  if (opts?.animate && layout.animation?.enabled) {
8729
8734
  const anim = layout.animation;