@ai-matrx/design-system 0.49.42 → 0.49.44
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/CHANGELOG.md +13 -0
- package/dist/data-table/drill-chart.cjs +7 -3
- package/dist/data-table/drill-chart.cjs.map +1 -1
- package/dist/data-table/drill-chart.d.cts +8 -1
- package/dist/data-table/drill-chart.d.ts +8 -1
- package/dist/data-table/drill-chart.js +7 -3
- package/dist/data-table/drill-chart.js.map +1 -1
- package/dist/data-table/index.cjs +10 -3
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.js +10 -3
- package/dist/data-table/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -32,6 +32,13 @@ interface MatrxDrillChartProps {
|
|
|
32
32
|
note?: ReactNode | undefined;
|
|
33
33
|
className?: string | undefined;
|
|
34
34
|
}
|
|
35
|
+
/** A short axis number: the Measure's own format when it has one, else 1.2k / 3.4M. */
|
|
36
|
+
/**
|
|
37
|
+
* A tick on the value axis: the measure's own words while they fit the axis ("$12", "40 ms"), else the
|
|
38
|
+
* number in compact form ("28M") — the chart's title already names the unit ("Cost (points) by day").
|
|
39
|
+
* A long formatted value ("28,000,000 points") was clipped to ",000,000 points" (lane DRILL-ADOPT walk).
|
|
40
|
+
*/
|
|
41
|
+
declare function drillChartAxisNumber(measure: MatrxDrillMeasure | undefined, value: number): string;
|
|
35
42
|
declare function MatrxDrillChart({ dimensions, measures, question, onQuestionChange, answers, seriesLimit, measure: measureKey, time, ceiling, paths, error, emptyLabel, height, width, note, className, }: MatrxDrillChartProps): React.JSX.Element;
|
|
36
43
|
|
|
37
|
-
export { MatrxDrillChart, MatrxDrillChartAnswers, type MatrxDrillChartProps };
|
|
44
|
+
export { MatrxDrillChart, MatrxDrillChartAnswers, type MatrxDrillChartProps, drillChartAxisNumber };
|
|
@@ -32,6 +32,13 @@ interface MatrxDrillChartProps {
|
|
|
32
32
|
note?: ReactNode | undefined;
|
|
33
33
|
className?: string | undefined;
|
|
34
34
|
}
|
|
35
|
+
/** A short axis number: the Measure's own format when it has one, else 1.2k / 3.4M. */
|
|
36
|
+
/**
|
|
37
|
+
* A tick on the value axis: the measure's own words while they fit the axis ("$12", "40 ms"), else the
|
|
38
|
+
* number in compact form ("28M") — the chart's title already names the unit ("Cost (points) by day").
|
|
39
|
+
* A long formatted value ("28,000,000 points") was clipped to ",000,000 points" (lane DRILL-ADOPT walk).
|
|
40
|
+
*/
|
|
41
|
+
declare function drillChartAxisNumber(measure: MatrxDrillMeasure | undefined, value: number): string;
|
|
35
42
|
declare function MatrxDrillChart({ dimensions, measures, question, onQuestionChange, answers, seriesLimit, measure: measureKey, time, ceiling, paths, error, emptyLabel, height, width, note, className, }: MatrxDrillChartProps): React.JSX.Element;
|
|
36
43
|
|
|
37
|
-
export { MatrxDrillChart, MatrxDrillChartAnswers, type MatrxDrillChartProps };
|
|
44
|
+
export { MatrxDrillChart, MatrxDrillChartAnswers, type MatrxDrillChartProps, drillChartAxisNumber };
|
|
@@ -454,10 +454,13 @@ function formatWith(measure, value) {
|
|
|
454
454
|
if (measure?.format) return measure.format(value);
|
|
455
455
|
return value.toLocaleString(void 0, { maximumFractionDigits: 2 });
|
|
456
456
|
}
|
|
457
|
-
function
|
|
458
|
-
|
|
459
|
-
|
|
457
|
+
function drillChartAxisNumber(measure, value) {
|
|
458
|
+
const compact = new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 }).format(value);
|
|
459
|
+
if (!measure?.format) return compact;
|
|
460
|
+
const said = measure.format(value);
|
|
461
|
+
return said.length <= 7 ? said : compact;
|
|
460
462
|
}
|
|
463
|
+
var axisNumber = drillChartAxisNumber;
|
|
461
464
|
function MatrxDrillChart({
|
|
462
465
|
dimensions,
|
|
463
466
|
measures,
|
|
@@ -694,6 +697,7 @@ export {
|
|
|
694
697
|
MATRX_DRILL_CHART_OTHER,
|
|
695
698
|
MATRX_DRILL_CHART_SERIES_LIMIT,
|
|
696
699
|
MatrxDrillChart,
|
|
700
|
+
drillChartAxisNumber,
|
|
697
701
|
drillChartCellsQuestion,
|
|
698
702
|
drillChartData,
|
|
699
703
|
drillChartDrill,
|