eleventy-plugin-uncharted 1.0.0-rc.2 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleventy-plugin-uncharted",
3
- "version": "1.0.0-rc.2",
3
+ "version": "1.0.0",
4
4
  "description": "An Eleventy plugin that renders CSS-based charts from CSV data using shortcodes",
5
5
  "main": "eleventy.config.js",
6
6
  "type": "module",
@@ -134,7 +134,7 @@ export function renderBubble(config) {
134
134
  const yAxisStyle = hasNegativeY ? ` style="--zero-position: ${zeroPctY.toFixed(2)}%"` : '';
135
135
  html += `<div class="chart-y-axis"${yAxisStyle}>`;
136
136
  html += `<span class="axis-label">${formatNumber(calcMaxY, fmtY) || calcMaxY}</span>`;
137
- const midLabelY = hasNegativeY ? 0 : Math.round((calcMaxY + calcMinY) / 2);
137
+ const midLabelY = hasNegativeY ? 0 : (calcMaxY + calcMinY) / 2;
138
138
  html += `<span class="axis-label">${formatNumber(midLabelY, fmtY) || midLabelY}</span>`;
139
139
  html += `<span class="axis-label">${formatNumber(calcMinY, fmtY) || calcMinY}</span>`;
140
140
  if (yAxisTitle) {
@@ -90,7 +90,7 @@ export function renderLine(config) {
90
90
  const yAxisStyle = hasNegativeY ? ` style="--zero-position: ${zeroPct.toFixed(2)}%"` : '';
91
91
  html += `<div class="chart-y-axis"${yAxisStyle}>`;
92
92
  html += `<span class="axis-label">${formatNumber(maxValue, yFormat) || maxValue}</span>`;
93
- const midLabelY = hasNegativeY ? 0 : Math.round((maxValue + minValue) / 2);
93
+ const midLabelY = hasNegativeY ? 0 : (maxValue + minValue) / 2;
94
94
  html += `<span class="axis-label">${formatNumber(midLabelY, yFormat) || midLabelY}</span>`;
95
95
  html += `<span class="axis-label">${formatNumber(minValue, yFormat) || minValue}</span>`;
96
96
  if (yAxisTitle) {
@@ -141,7 +141,7 @@ export function renderScatter(config) {
141
141
  const yAxisStyle = hasNegativeY ? ` style="--zero-position-y: ${zeroPctY.toFixed(2)}%"` : '';
142
142
  html += `<div class="chart-y-axis"${yAxisStyle}>`;
143
143
  html += `<span class="axis-label">${formatNumber(calcMaxY, fmtY) || calcMaxY}</span>`;
144
- const midLabelY = hasNegativeY ? 0 : Math.round((calcMaxY + calcMinY) / 2);
144
+ const midLabelY = hasNegativeY ? 0 : (calcMaxY + calcMinY) / 2;
145
145
  html += `<span class="axis-label">${formatNumber(midLabelY, fmtY) || midLabelY}</span>`;
146
146
  html += `<span class="axis-label">${formatNumber(calcMinY, fmtY) || calcMinY}</span>`;
147
147
  html += `<span class="axis-title">${escapeHtml(yAxisTitle)}</span>`;
@@ -209,7 +209,7 @@ export function renderScatter(config) {
209
209
  const xAxisStyle = hasNegativeX ? ` style="--zero-position-x: ${zeroPctX.toFixed(2)}%"` : '';
210
210
  html += `<div class="chart-x-axis"${xAxisStyle}>`;
211
211
  html += `<span class="axis-label">${formatNumber(calcMinX, fmtX) || calcMinX}</span>`;
212
- const midLabelX = hasNegativeX ? 0 : Math.round((calcMaxX + calcMinX) / 2);
212
+ const midLabelX = hasNegativeX ? 0 : (calcMaxX + calcMinX) / 2;
213
213
  html += `<span class="axis-label">${formatNumber(midLabelX, fmtX) || midLabelX}</span>`;
214
214
  html += `<span class="axis-label">${formatNumber(calcMaxX, fmtX) || calcMaxX}</span>`;
215
215
  html += `<span class="axis-title">${escapeHtml(xAxisTitle)}</span>`;
@@ -380,7 +380,7 @@ export function renderTimeseries(config) {
380
380
  const yAxisStyle = hasNegativeY ? ` style="--zero-position: ${zeroPctY.toFixed(2)}%"` : '';
381
381
  html += `<div class="chart-y-axis"${yAxisStyle}>`;
382
382
  html += `<span class="axis-label">${formatNumber(maxValue, yFormat) || maxValue}</span>`;
383
- const midLabelY = hasNegativeY ? 0 : Math.round((maxValue + minValue) / 2);
383
+ const midLabelY = hasNegativeY ? 0 : (maxValue + minValue) / 2;
384
384
  html += `<span class="axis-label">${formatNumber(midLabelY, yFormat) || midLabelY}</span>`;
385
385
  html += `<span class="axis-label">${formatNumber(minValue, yFormat) || minValue}</span>`;
386
386
  if (yAxisTitle) {