@massimo-cassandro/minimo 1.31.1 → 1.31.2

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.
@@ -149,7 +149,7 @@ const default_params = {
149
149
  Null per nessuna eleborazione.
150
150
  La funzione di default assume che il valore sia di tipo numerico
151
151
  */
152
- labelYFormatter: etiValue => Math.ceil(etiValue / 1e3)
152
+ labelYFormatter: etiValue => (Math.ceil(etiValue / 1e3) || 0) // `|| 0` normalizza -0 (altrimenti mostrato come "-0")
153
153
  .toLocaleString('it-IT', {
154
154
  minimumFractionDigits: 0,
155
155
  maximumFractionDigits: 0
@@ -150,7 +150,7 @@ const default_params = {
150
150
  Null per nessuna eleborazione.
151
151
  La funzione di default assume che il valore sia di tipo numerico
152
152
  */
153
- labelYFormatter: etiValue => Math.ceil(etiValue / 1e3)
153
+ labelYFormatter: etiValue => (Math.ceil(etiValue / 1e3) || 0) // `|| 0` normalizza -0 (altrimenti mostrato come "-0")
154
154
  .toLocaleString('it-IT', {
155
155
  minimumFractionDigits: 0,
156
156
  maximumFractionDigits: 0
@@ -375,6 +375,15 @@ async function cartesianAxisHorizontal(chartInstance, {
375
375
  chart_area.bottom + ticksLength + 2 // 2 è un distanziatore tra l'etichetta e la linea
376
376
  );
377
377
 
378
+ // eventuale correzione ultima etichetta (evita che esca dal margine destro dell'svg)
379
+ if(stepIdx === stepY_count) {
380
+ const labelX2 = labelEl.bbox().x2;
381
+
382
+ if(labelX2 > width - padding) {
383
+ labelEl.dx(-(labelX2 - width + padding/2));
384
+ }
385
+ }
386
+
378
387
  // =>> griglia verticale (ortogonale all'asse valori)
379
388
  // viene omessa solo la linea che coincide con l'asse categorie (la linea dello zero)
380
389
  if(showYgrid && Math.abs(x - zero_x) > 0.01) {
@@ -165,7 +165,7 @@ const default_params = {
165
165
  Null per nessuna eleborazione.
166
166
  La funzione di default assume che il valore sia di tipo numerico
167
167
  */
168
- labelYFormatter: etiValue => Math.ceil(etiValue / 1e3)
168
+ labelYFormatter: etiValue => (Math.ceil(etiValue / 1e3) || 0) // `|| 0` normalizza -0 (altrimenti mostrato come "-0")
169
169
  .toLocaleString('it-IT', {
170
170
  minimumFractionDigits: 0,
171
171
  maximumFractionDigits: 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massimo-cassandro/minimo",
3
- "version": "1.31.1",
3
+ "version": "1.31.2",
4
4
  "description": "Light css framework & utilities",
5
5
  "type": "module",
6
6
  "main": "./index.js",