@beweco/aurora-ui 0.6.65 → 0.6.66
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.cjs.js +21 -1
- package/dist/index.esm.js +21 -1
- package/dist/types/components/violin-plot/ViolinPlot.d.ts.map +1 -1
- package/dist/types/components/violin-plot/ViolinPlot.types.d.ts +2 -0
- package/dist/types/components/violin-plot/ViolinPlot.types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -6445,10 +6445,17 @@ var COLOR_BODY = "#c7d2fe";
|
|
|
6445
6445
|
var COLOR_STROKE = "#4338ca";
|
|
6446
6446
|
var COLOR_MEDIAN = "#1e3a8a";
|
|
6447
6447
|
var COLOR_AXIS = "#6b7280";
|
|
6448
|
+
/** Desplazamiento vertical del rótulo del grupo bajo el eje X. */
|
|
6449
|
+
var GROUP_LABEL_DY = 16;
|
|
6450
|
+
/** Desplazamiento vertical de la línea `n=` (bajo el rótulo del grupo). */
|
|
6451
|
+
var SAMPLE_SIZE_DY = 30;
|
|
6452
|
+
/** Aire por debajo de la línea `n=` que la superficie de hover también cubre. */
|
|
6453
|
+
var HOVER_PADDING = 4;
|
|
6448
6454
|
var defaultTranslations$1 = {
|
|
6449
6455
|
emptyState: "Sin datos de distribución",
|
|
6450
6456
|
sampleSizeLabel: "n",
|
|
6451
6457
|
outliersLabel: "outliers",
|
|
6458
|
+
pointsLabel: "puntos",
|
|
6452
6459
|
};
|
|
6453
6460
|
function formatTick(value, factor, unit) {
|
|
6454
6461
|
var scaled = value * factor;
|
|
@@ -6496,9 +6503,22 @@ function ViolinPlot(_a) {
|
|
|
6496
6503
|
var fmt = formatValue !== null && formatValue !== void 0 ? formatValue : (function (v) { return formatTick(v, factor, unit); });
|
|
6497
6504
|
var columnWidth = (VIEW_WIDTH - marginLeft - MARGIN.right) / groups.length;
|
|
6498
6505
|
var axisTitle = unit ? "".concat(valueLabel, " (").concat(unit, ")") : valueLabel;
|
|
6506
|
+
/**
|
|
6507
|
+
* Texto del tooltip de columna (TECH-1768): de qué grupo es y cuántos puntos tiene.
|
|
6508
|
+
*
|
|
6509
|
+
* El `nExcluded` va en el MISMO tooltip cuando lo hay: sin él, `n` se leería como "puntos
|
|
6510
|
+
* dibujados" y no lo son — los outliers recortados están contados en `n` pero fuera del lienzo,
|
|
6511
|
+
* y la diferencia importa justo en los grupos con cola larga.
|
|
6512
|
+
*/
|
|
6513
|
+
var tooltipFor = function (group) {
|
|
6514
|
+
var base = "".concat(group.label, " \u00B7 ").concat(group.n, " ").concat(t.pointsLabel);
|
|
6515
|
+
return group.nExcluded > 0
|
|
6516
|
+
? "".concat(base, " \u00B7 \u2212").concat(group.nExcluded, " ").concat(t.outliersLabel)
|
|
6517
|
+
: base;
|
|
6518
|
+
};
|
|
6499
6519
|
return (jsxRuntime.jsxs("svg", { viewBox: "0 0 ".concat(VIEW_WIDTH, " ").concat(height), width: "100%", role: "img", "aria-label": valueLabel, children: [[0, maxValue / 2, maxValue].map(function (v) { return (jsxRuntime.jsxs("g", { children: [jsxRuntime.jsx("line", { x1: marginLeft, x2: VIEW_WIDTH - MARGIN.right, y1: valueToY(v), y2: valueToY(v), stroke: "#e5e7eb", strokeDasharray: "3 3" }), jsxRuntime.jsx("text", { x: marginLeft - 6, y: valueToY(v) + 4, textAnchor: "end", fontSize: 11, fill: COLOR_AXIS, children: fmt(v) })] }, v)); }), jsxRuntime.jsx("text", { transform: "translate(12 ".concat(plotTop + plotHeight / 2, ") rotate(-90)"), textAnchor: "middle", fontSize: 12, fill: COLOR_AXIS, children: axisTitle }), groupLabel ? (jsxRuntime.jsx("text", { x: marginLeft + (VIEW_WIDTH - marginLeft - MARGIN.right) / 2, y: height - 6, textAnchor: "middle", fontSize: 12, fill: COLOR_AXIS, children: groupLabel })) : null, groups.map(function (group, i) {
|
|
6500
6520
|
var centerX = marginLeft + columnWidth * (i + 0.5);
|
|
6501
|
-
return (jsxRuntime.jsxs("g", { children: [shouldFallback(group, minSampleForViolin) ? (jsxRuntime.jsx(ViolinFallback, { group: group, centerX: centerX, valueToY: valueToY })) : (jsxRuntime.jsx(ViolinBody, { group: group, centerX: centerX, valueToY: valueToY })), jsxRuntime.jsx("text", { x: centerX, y: plotBottom +
|
|
6521
|
+
return (jsxRuntime.jsxs("g", { children: [jsxRuntime.jsx("title", { children: tooltipFor(group) }), jsxRuntime.jsx("rect", { x: centerX - columnWidth / 2, y: plotTop, width: columnWidth, height: plotBottom - plotTop + SAMPLE_SIZE_DY + HOVER_PADDING, fill: "transparent", pointerEvents: "all" }), shouldFallback(group, minSampleForViolin) ? (jsxRuntime.jsx(ViolinFallback, { group: group, centerX: centerX, valueToY: valueToY })) : (jsxRuntime.jsx(ViolinBody, { group: group, centerX: centerX, valueToY: valueToY })), jsxRuntime.jsx("text", { x: centerX, y: plotBottom + GROUP_LABEL_DY, textAnchor: "middle", fontSize: 12, fill: COLOR_AXIS, children: group.label }), jsxRuntime.jsxs("text", { x: centerX, y: plotBottom + SAMPLE_SIZE_DY, textAnchor: "middle", fontSize: 10, fill: COLOR_AXIS, children: [t.sampleSizeLabel, "=", group.n, group.nExcluded > 0
|
|
6502
6522
|
? " \u00B7 \u2212".concat(group.nExcluded, " ").concat(t.outliersLabel)
|
|
6503
6523
|
: ""] })] }, group.label));
|
|
6504
6524
|
})] }));
|
package/dist/index.esm.js
CHANGED
|
@@ -6446,10 +6446,17 @@ var COLOR_BODY = "#c7d2fe";
|
|
|
6446
6446
|
var COLOR_STROKE = "#4338ca";
|
|
6447
6447
|
var COLOR_MEDIAN = "#1e3a8a";
|
|
6448
6448
|
var COLOR_AXIS = "#6b7280";
|
|
6449
|
+
/** Desplazamiento vertical del rótulo del grupo bajo el eje X. */
|
|
6450
|
+
var GROUP_LABEL_DY = 16;
|
|
6451
|
+
/** Desplazamiento vertical de la línea `n=` (bajo el rótulo del grupo). */
|
|
6452
|
+
var SAMPLE_SIZE_DY = 30;
|
|
6453
|
+
/** Aire por debajo de la línea `n=` que la superficie de hover también cubre. */
|
|
6454
|
+
var HOVER_PADDING = 4;
|
|
6449
6455
|
var defaultTranslations$1 = {
|
|
6450
6456
|
emptyState: "Sin datos de distribución",
|
|
6451
6457
|
sampleSizeLabel: "n",
|
|
6452
6458
|
outliersLabel: "outliers",
|
|
6459
|
+
pointsLabel: "puntos",
|
|
6453
6460
|
};
|
|
6454
6461
|
function formatTick(value, factor, unit) {
|
|
6455
6462
|
var scaled = value * factor;
|
|
@@ -6497,9 +6504,22 @@ function ViolinPlot(_a) {
|
|
|
6497
6504
|
var fmt = formatValue !== null && formatValue !== void 0 ? formatValue : (function (v) { return formatTick(v, factor, unit); });
|
|
6498
6505
|
var columnWidth = (VIEW_WIDTH - marginLeft - MARGIN.right) / groups.length;
|
|
6499
6506
|
var axisTitle = unit ? "".concat(valueLabel, " (").concat(unit, ")") : valueLabel;
|
|
6507
|
+
/**
|
|
6508
|
+
* Texto del tooltip de columna (TECH-1768): de qué grupo es y cuántos puntos tiene.
|
|
6509
|
+
*
|
|
6510
|
+
* El `nExcluded` va en el MISMO tooltip cuando lo hay: sin él, `n` se leería como "puntos
|
|
6511
|
+
* dibujados" y no lo son — los outliers recortados están contados en `n` pero fuera del lienzo,
|
|
6512
|
+
* y la diferencia importa justo en los grupos con cola larga.
|
|
6513
|
+
*/
|
|
6514
|
+
var tooltipFor = function (group) {
|
|
6515
|
+
var base = "".concat(group.label, " \u00B7 ").concat(group.n, " ").concat(t.pointsLabel);
|
|
6516
|
+
return group.nExcluded > 0
|
|
6517
|
+
? "".concat(base, " \u00B7 \u2212").concat(group.nExcluded, " ").concat(t.outliersLabel)
|
|
6518
|
+
: base;
|
|
6519
|
+
};
|
|
6500
6520
|
return (jsxs("svg", { viewBox: "0 0 ".concat(VIEW_WIDTH, " ").concat(height), width: "100%", role: "img", "aria-label": valueLabel, children: [[0, maxValue / 2, maxValue].map(function (v) { return (jsxs("g", { children: [jsx("line", { x1: marginLeft, x2: VIEW_WIDTH - MARGIN.right, y1: valueToY(v), y2: valueToY(v), stroke: "#e5e7eb", strokeDasharray: "3 3" }), jsx("text", { x: marginLeft - 6, y: valueToY(v) + 4, textAnchor: "end", fontSize: 11, fill: COLOR_AXIS, children: fmt(v) })] }, v)); }), jsx("text", { transform: "translate(12 ".concat(plotTop + plotHeight / 2, ") rotate(-90)"), textAnchor: "middle", fontSize: 12, fill: COLOR_AXIS, children: axisTitle }), groupLabel ? (jsx("text", { x: marginLeft + (VIEW_WIDTH - marginLeft - MARGIN.right) / 2, y: height - 6, textAnchor: "middle", fontSize: 12, fill: COLOR_AXIS, children: groupLabel })) : null, groups.map(function (group, i) {
|
|
6501
6521
|
var centerX = marginLeft + columnWidth * (i + 0.5);
|
|
6502
|
-
return (jsxs("g", { children: [shouldFallback(group, minSampleForViolin) ? (jsx(ViolinFallback, { group: group, centerX: centerX, valueToY: valueToY })) : (jsx(ViolinBody, { group: group, centerX: centerX, valueToY: valueToY })), jsx("text", { x: centerX, y: plotBottom +
|
|
6522
|
+
return (jsxs("g", { children: [jsx("title", { children: tooltipFor(group) }), jsx("rect", { x: centerX - columnWidth / 2, y: plotTop, width: columnWidth, height: plotBottom - plotTop + SAMPLE_SIZE_DY + HOVER_PADDING, fill: "transparent", pointerEvents: "all" }), shouldFallback(group, minSampleForViolin) ? (jsx(ViolinFallback, { group: group, centerX: centerX, valueToY: valueToY })) : (jsx(ViolinBody, { group: group, centerX: centerX, valueToY: valueToY })), jsx("text", { x: centerX, y: plotBottom + GROUP_LABEL_DY, textAnchor: "middle", fontSize: 12, fill: COLOR_AXIS, children: group.label }), jsxs("text", { x: centerX, y: plotBottom + SAMPLE_SIZE_DY, textAnchor: "middle", fontSize: 10, fill: COLOR_AXIS, children: [t.sampleSizeLabel, "=", group.n, group.nExcluded > 0
|
|
6503
6523
|
? " \u00B7 \u2212".concat(group.nExcluded, " ").concat(t.outliersLabel)
|
|
6504
6524
|
: ""] })] }, group.label));
|
|
6505
6525
|
})] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViolinPlot.d.ts","sourceRoot":"","sources":["../../../../src/components/violin-plot/ViolinPlot.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEX,eAAe,EAEf,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"ViolinPlot.d.ts","sourceRoot":"","sources":["../../../../src/components/violin-plot/ViolinPlot.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEX,eAAe,EAEf,MAAM,oBAAoB,CAAC;AAsC5B;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,EAC1B,MAAM,EACN,UAAU,EACV,UAAU,EACV,QAAiB,EACjB,WAAW,EACX,MAAY,EACZ,kBAAuB,EACvB,YAAiB,GACjB,EAAE,eAAe,2CA2LjB;AA2DD,eAAe,UAAU,CAAC"}
|
|
@@ -34,6 +34,8 @@ export interface ViolinPlotTranslations {
|
|
|
34
34
|
sampleSizeLabel?: string;
|
|
35
35
|
/** Sufijo del conteo de outliers excluidos (`· −12 outliers`). */
|
|
36
36
|
outliersLabel?: string;
|
|
37
|
+
/** Sustantivo del tooltip de columna (`Onboarding · 248 puntos`). */
|
|
38
|
+
pointsLabel?: string;
|
|
37
39
|
}
|
|
38
40
|
export interface ViolinPlotProps {
|
|
39
41
|
groups: ViolinGroup[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViolinPlot.types.d.ts","sourceRoot":"","sources":["../../../../src/components/violin-plot/ViolinPlot.types.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,WAAW,SAAS;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACd;AAED,wEAAwE;AACxE,MAAM,MAAM,QAAQ,GAAG,GAAG,GAAG,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,CAAC;AAExD;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACtC,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ViolinPlot.types.d.ts","sourceRoot":"","sources":["../../../../src/components/violin-plot/ViolinPlot.types.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,WAAW,SAAS;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACd;AAED,wEAAwE;AACxE,MAAM,MAAM,QAAQ,GAAG,GAAG,GAAG,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,CAAC;AAExD;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACtC,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC/B,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,sBAAsB,CAAC;CACtC"}
|