eleventy-plugin-uncharted 1.0.0 → 1.0.1

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/README.md CHANGED
@@ -37,6 +37,4 @@ charts:
37
37
  {% chart "sales" %}
38
38
  ```
39
39
 
40
- Chart types: `donut`, `stacked-bar`, `stacked-column`, `dot`, `scatter`
41
-
42
40
  See the [documentation](https://uncharted.seanlunsford.com/) for configuration options, styling, animations, and more.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleventy-plugin-uncharted",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
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",
@@ -161,7 +161,7 @@ export function renderBubble(config) {
161
161
  dotsByCategory.get(dot.x).push({ ...dot, originalIndex: i });
162
162
  });
163
163
 
164
- const fmtSize = _columns?.sizeFormat || {};
164
+ const fmtSize = _columns?.sizeFormat || format || {};
165
165
 
166
166
  // Render dots by category column
167
167
  categories.forEach((category, colIndex) => {
@@ -249,9 +249,8 @@ export function renderBubble(config) {
249
249
  const sizeValues = dots.map(d => d.rawSize).filter(v => v > 0);
250
250
  const minSizeVal = sizeValues.length ? Math.min(...sizeValues) : 0;
251
251
  const maxSizeVal = sizeValues.length ? Math.max(...sizeValues) : 0;
252
- const fmtSizeLegend = _columns?.sizeFormat || {};
253
- const minFormatted = formatNumber(minSizeVal, fmtSizeLegend) || minSizeVal;
254
- const maxFormatted = formatNumber(maxSizeVal, fmtSizeLegend) || maxSizeVal;
252
+ const minFormatted = formatNumber(minSizeVal, fmtSize) || minSizeVal;
253
+ const maxFormatted = formatNumber(maxSizeVal, fmtSize) || maxSizeVal;
255
254
 
256
255
  html += `<div class="chart-size-legend">`;
257
256
  html += `<span class="chart-legend-title">${escapeHtml(sizeTitle)}</span>`;
@@ -157,7 +157,7 @@ export function renderScatter(config) {
157
157
  html += `<div class="dot-area"${dotAreaStyle}>`;
158
158
  html += `<div class="dot-field">`;
159
159
 
160
- const fmtSize = _columns?.sizeFormat || {};
160
+ const fmtSize = _columns?.sizeFormat || format || {};
161
161
  dots.forEach((dot, i) => {
162
162
  const xPct = rangeX > 0 ? ((dot.x - calcMinX) / rangeX) * 100 : 0;
163
163
  const yPct = rangeY > 0 ? ((dot.y - calcMinY) / rangeY) * 100 : 0;
@@ -246,9 +246,8 @@ export function renderScatter(config) {
246
246
  const sizeValues = dots.map(d => d.rawSize).filter(v => v > 0);
247
247
  const minSizeVal = sizeValues.length ? Math.min(...sizeValues) : 0;
248
248
  const maxSizeVal = sizeValues.length ? Math.max(...sizeValues) : 0;
249
- const fmtSizeLegend = _columns?.sizeFormat || {};
250
- const minFormatted = formatNumber(minSizeVal, fmtSizeLegend) || minSizeVal;
251
- const maxFormatted = formatNumber(maxSizeVal, fmtSizeLegend) || maxSizeVal;
249
+ const minFormatted = formatNumber(minSizeVal, fmtSize) || minSizeVal;
250
+ const maxFormatted = formatNumber(maxSizeVal, fmtSize) || maxSizeVal;
252
251
 
253
252
  html += `<div class="chart-size-legend">`;
254
253
  html += `<span class="chart-legend-title">${escapeHtml(sizeTitle)}</span>`;