@carto/ps-react-ui 4.12.0 → 4.12.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.
Files changed (38) hide show
  1. package/dist/{echart-BMPpj7n_.js → echart-Bdvbfx9s.js} +2 -2
  2. package/dist/echart-Bdvbfx9s.js.map +1 -0
  3. package/dist/{option-builders-F-c9ELi1.js → option-builders-DPeoyQaM.js} +41 -33
  4. package/dist/option-builders-DPeoyQaM.js.map +1 -0
  5. package/dist/types/widgets/utils/chart-config/index.d.ts +1 -1
  6. package/dist/types/widgets-v2/pie/skeleton.d.ts +9 -0
  7. package/dist/widgets/bar.js +1 -1
  8. package/dist/widgets/histogram.js +1 -1
  9. package/dist/widgets/pie.js +1 -1
  10. package/dist/widgets/scatterplot.js +5 -5
  11. package/dist/widgets/timeseries.js +1 -1
  12. package/dist/widgets/utils.js +1 -1
  13. package/dist/widgets-v2/bar.js +64 -64
  14. package/dist/widgets-v2/bar.js.map +1 -1
  15. package/dist/widgets-v2/echart.js +1 -1
  16. package/dist/widgets-v2/histogram.js +89 -89
  17. package/dist/widgets-v2/histogram.js.map +1 -1
  18. package/dist/widgets-v2/pie.js +149 -95
  19. package/dist/widgets-v2/pie.js.map +1 -1
  20. package/dist/widgets-v2/scatterplot.js +153 -157
  21. package/dist/widgets-v2/scatterplot.js.map +1 -1
  22. package/dist/widgets-v2/timeseries.js +74 -74
  23. package/dist/widgets-v2/timeseries.js.map +1 -1
  24. package/dist/widgets-v2.js +2 -2
  25. package/package.json +1 -1
  26. package/src/widgets/utils/chart-config/index.ts +1 -0
  27. package/src/widgets/utils/chart-config/option-builders.test.ts +34 -0
  28. package/src/widgets/utils/chart-config/option-builders.ts +21 -0
  29. package/src/widgets-v2/bar/options.ts +3 -2
  30. package/src/widgets-v2/echart/edge-label-clamp.ts +7 -4
  31. package/src/widgets-v2/histogram/options.ts +3 -2
  32. package/src/widgets-v2/pie/skeleton.test.tsx +6 -3
  33. package/src/widgets-v2/pie/skeleton.tsx +69 -7
  34. package/src/widgets-v2/scatterplot/options.ts +3 -6
  35. package/src/widgets-v2/timeseries/options.ts +3 -2
  36. package/dist/echart-BMPpj7n_.js.map +0 -1
  37. package/dist/option-builders-F-c9ELi1.js.map +0 -1
  38. package/dist/types/widgets/utils/chart-config/option-builders.d.ts +0 -124
@@ -1 +0,0 @@
1
- {"version":3,"file":"option-builders-F-c9ELi1.js","sources":["../src/widgets/utils/chart-config/option-builders.ts"],"sourcesContent":["import type { Theme } from '@mui/material'\nimport type { LegendComponentOption } from 'echarts'\nimport type {\n CallbackDataParams,\n TopLevelFormatterParams,\n} from 'echarts/types/dist/shared'\n\n/**\n * Shared EChart configuration builders for chart widgets\n */\n\n/**\n * Rounds a value up to the nearest \"nice\" number.\n * A nice number is a multiple of 10^floor(log10(value)).\n *\n * Examples: 547 → 600, 200 → 200, 1200 → 2000, 18 → 20, 5 → 5, -547 → -500\n */\nexport function niceNum(value: number): number {\n if (value === 0) return 0\n const absValue = Math.abs(value)\n const base = Math.pow(10, Math.floor(Math.log10(absValue)))\n const rounded = Math.ceil(absValue / base) * base\n return value < 0 ? -rounded : rounded\n}\n\n/**\n * Builds standard legend configuration for chart widgets\n *\n * @param params - Legend configuration parameters\n * @param params.hasLegend - Whether to show the legend\n * @param params.labelFormatter - Optional formatter for legend item names\n * @returns Legend configuration object\n */\nexport function buildLegendConfig({\n hasLegend,\n labelFormatter,\n}: {\n hasLegend: boolean\n labelFormatter?: (value: string | number) => string | number\n}): LegendComponentOption {\n return {\n show: hasLegend,\n icon: 'circle' as const,\n left: 0,\n bottom: 0,\n orient: 'horizontal',\n type: 'scroll',\n ...(labelFormatter && {\n formatter: (name: string) => String(labelFormatter(name)),\n }),\n }\n}\n\n/**\n * Builds standard grid configuration with legend-aware spacing\n *\n * @param hasLegend - Whether the chart has a legend\n * @param theme - MUI theme for spacing\n * @param additionalConfig - Additional grid configuration to merge\n * @returns Grid configuration object\n */\nexport function buildGridConfig(hasLegend: boolean, theme: Theme) {\n return {\n ...(!hasLegend && { bottom: parseInt(theme.spacing(3)) }),\n ...(hasLegend && { bottom: parseInt(theme.spacing(7)) }),\n }\n}\n\n/**\n * Creates a tooltip position calculator that handles overflow\n * Used by bar, histogram, and scatterplot widgets\n *\n * @param theme - MUI theme for spacing\n * @returns Tooltip position function\n */\nexport function createTooltipPositioner(theme: Theme) {\n return function (\n point: [number, number],\n _params: unknown,\n _dom: unknown,\n _rect: unknown,\n size: { contentSize: [number, number]; viewSize: [number, number] },\n ) {\n const position = { top: parseInt(theme.spacing(0.5)) } as Record<\n string,\n number\n >\n\n // Position tooltip left or right based on available space\n if (size.contentSize[0] < size.viewSize[0] - point[0]) {\n position.left = point[0]\n } else {\n position.right = size.viewSize[0] - point[0]\n }\n\n return position\n }\n}\n\n/**\n * Creates an axis label formatter for ECharts\n * Used to format numeric axis labels with a widget formatter\n *\n * @param formatter - Optional formatter function from widget config\n * @returns Axis label formatter function or undefined\n */\nexport function createAxisLabelFormatter(\n formatter?: (value: number) => string,\n) {\n if (!formatter) return undefined\n return (value: number) => formatter(value)\n}\n\n/**\n * Applies labelFormatter to xAxis configuration\n * Applies to any xAxis regardless of axis type (category, value, etc.)\n *\n * @param xAxis - Existing xAxis configuration\n * @param labelFormatter - Optional labelFormatter function from widget config\n * @returns Updated xAxis configuration\n */\nexport function applyXAxisFormatter(\n xAxis: unknown,\n formatter?: (value: string | number) => string | number,\n) {\n const xAxisIsObject = xAxis && !Array.isArray(xAxis)\n const xAxisTyped = xAxis as { type?: string; axisLabel?: unknown }\n\n const axisFormatter =\n formatter && xAxisIsObject\n ? (value: string | number) => String(formatter(value))\n : undefined\n\n return {\n ...xAxisTyped,\n axisLabel: {\n ...(typeof xAxisTyped.axisLabel === 'object' && xAxisTyped.axisLabel\n ? xAxisTyped.axisLabel\n : {}),\n formatter: axisFormatter,\n },\n }\n}\n\n/**\n * Applies formatter to yAxis configuration\n * Only applies to single axis objects (not arrays) with type 'value'\n *\n * @param yAxis - Existing yAxis configuration\n * @param formatter - Optional formatter function from widget config\n * @returns Updated yAxis configuration or undefined if no changes needed\n */\nexport function applyYAxisFormatter(\n yAxis: unknown,\n formatter?: (value: number) => string,\n) {\n let axisFormatter = createAxisLabelFormatter(formatter)\n\n const yAxisIsObject = yAxis && !Array.isArray(yAxis)\n const yAxisTyped = yAxis as { type?: string; axisLabel?: unknown }\n\n if (!yAxisIsObject || yAxisTyped.type !== 'value') {\n axisFormatter = undefined\n }\n\n return {\n ...yAxisTyped,\n axisLabel: {\n ...(typeof yAxisTyped.axisLabel === 'object' && yAxisTyped.axisLabel\n ? yAxisTyped.axisLabel\n : {}),\n formatter: axisFormatter,\n },\n }\n}\n\n/**\n * Creates a tooltip formatter for ECharts\n * Formats numeric values in tooltip using widget formatter\n * Handles both axis trigger (array) and item trigger (object) modes\n *\n * @param formatter - Optional formatter function from widget config\n * @returns Tooltip formatter function or undefined\n */\nexport function createTooltipFormatter(\n callback: (\n item: CallbackDataParams,\n items: CallbackDataParams[],\n ) => {\n name: string\n seriesName: string\n marker: string\n value: string | number\n },\n) {\n return (params: TopLevelFormatterParams) => {\n // Handle both array (axis trigger) and object (item trigger)\n const items = Array.isArray(params) ? params : [params]\n\n const tooltip = (name: string, callback: string) =>\n `<div style=\"margin: 0px 0 0;line-height:1;\">${name ? `<div style=\"font-size:11px;color:#FFFFFF;font-weight:400;line-height:1; margin-bottom: 10px\">${name}</div>` : ''}<div style=\"margin: 0;line-height:1;\">${callback}</div><div style=\"clear:both\"></div></div>`\n\n const values = items.map((item) => {\n const { name, seriesName, marker, value } = callback(item, items)\n return {\n name,\n seriesName,\n marker,\n value,\n }\n })\n\n const name = values[0]?.name ?? ''\n // Show margin if name exists or there are multiple items\n const showMargin = name || items.length > 1\n const marginStyle = showMargin\n ? 'margin: 10px 0 0;line-height:1;'\n : 'margin: 0;line-height:1;'\n\n const formattedValues = values.map(\n ({ seriesName, marker, value }) =>\n `<div style=\"${marginStyle}\"><div style=\"margin: 0px 0 0;line-height:1;\">${marker}${seriesName ? `<span style=\"font-size:11px;color:#FFFFFF;font-weight:400;margin-left:2px;margin-right:10px\">${seriesName}</span>` : ''}<span style=\"float:right;margin-left:10px;font-size:11px;color:#FFFFFF;font-weight:900\">${value}</span></div></div>`,\n )\n\n return tooltip(name, formattedValues.join(''))\n }\n}\n\n/**\n * Builds a series `label` config that applies formatter to the data value\n * extracted from a dataset row using ECharts encode/dimensionNames.\n *\n * Does not set `show` — labels remain hidden by default per ECharts defaults.\n *\n * @param formatter - Optional numeric value formatter\n * @param encodeKey - The encode dimension key to extract ('y' for vertical charts, 'x' for horizontal)\n */\nexport function buildSeriesLabelConfig(\n formatter?: (value: number) => string,\n encodeKey = 'y',\n): { label: { formatter: (params: CallbackDataParams) => string } } | object {\n if (!formatter) return {}\n\n return {\n label: {\n formatter: (params: CallbackDataParams) => {\n const encodeIndex = params.encode?.[encodeKey]?.[0]\n if (encodeIndex === undefined) return ''\n const dimName = params.dimensionNames?.[encodeIndex]\n const row = params.value as Record<string, string | number>\n const value = dimName ? row[dimName] : undefined\n return typeof value === 'number'\n ? formatter(value)\n : String(value ?? '')\n },\n },\n }\n}\n\n/**\n * Builds a series `label` config that applies formatter to a raw numeric value.\n * Used by histogram where series data is number[] (not datasets).\n *\n * Does not set `show` — labels remain hidden by default per ECharts defaults.\n *\n * @param formatter - Optional numeric value formatter\n */\nexport function buildHistogramSeriesLabelConfig(\n formatter?: (value: number) => string,\n): { label: { formatter: (params: CallbackDataParams) => string } } | object {\n if (!formatter) return {}\n\n return {\n label: {\n formatter: (params: CallbackDataParams) => {\n const value = params.value as number\n return typeof value === 'number'\n ? formatter(value)\n : String(value ?? '')\n },\n },\n }\n}\n"],"names":["niceNum","value","absValue","Math","abs","base","pow","floor","log10","rounded","ceil","buildLegendConfig","hasLegend","labelFormatter","show","icon","left","bottom","orient","type","formatter","name","String","buildGridConfig","theme","parseInt","spacing","createTooltipPositioner","point","_params","_dom","_rect","size","position","top","contentSize","viewSize","right","createAxisLabelFormatter","applyXAxisFormatter","xAxis","xAxisIsObject","Array","isArray","xAxisTyped","axisFormatter","undefined","axisLabel","applyYAxisFormatter","yAxis","yAxisIsObject","yAxisTyped","createTooltipFormatter","callback","params","items","tooltip","values","map","item","seriesName","marker","marginStyle","length","formattedValues","join","buildSeriesLabelConfig","encodeKey","label","encodeIndex","encode","dimName","dimensionNames","row","buildHistogramSeriesLabelConfig"],"mappings":"AAiBO,SAASA,EAAQC,GAAuB;AAC7C,MAAIA,MAAU,EAAG,QAAO;AACxB,QAAMC,IAAWC,KAAKC,IAAIH,CAAK,GACzBI,IAAOF,KAAKG,IAAI,IAAIH,KAAKI,MAAMJ,KAAKK,MAAMN,CAAQ,CAAC,CAAC,GACpDO,IAAUN,KAAKO,KAAKR,IAAWG,CAAI,IAAIA;AAC7C,SAAOJ,IAAQ,IAAI,CAACQ,IAAUA;AAChC;AAUO,SAASE,EAAkB;AAAA,EAChCC,WAAAA;AAAAA,EACAC,gBAAAA;AAIF,GAA0B;AACxB,SAAO;AAAA,IACLC,MAAMF;AAAAA,IACNG,MAAM;AAAA,IACNC,MAAM;AAAA,IACNC,QAAQ;AAAA,IACRC,QAAQ;AAAA,IACRC,MAAM;AAAA,IACN,GAAIN,KAAkB;AAAA,MACpBO,WAAWA,CAACC,MAAiBC,OAAOT,EAAeQ,CAAI,CAAC;AAAA,IAAA;AAAA,EAC1D;AAEJ;AAUO,SAASE,EAAgBX,GAAoBY,GAAc;AAChE,SAAO;AAAA,IACL,GAAI,CAACZ,KAAa;AAAA,MAAEK,QAAQQ,SAASD,EAAME,QAAQ,CAAC,CAAC;AAAA,IAAA;AAAA,IACrD,GAAId,KAAa;AAAA,MAAEK,QAAQQ,SAASD,EAAME,QAAQ,CAAC,CAAC;AAAA,IAAA;AAAA,EAAE;AAE1D;AASO,SAASC,EAAwBH,GAAc;AACpD,SAAO,SACLI,GACAC,GACAC,GACAC,GACAC,GACA;AACA,UAAMC,IAAW;AAAA,MAAEC,KAAKT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,EACdtD,GAC2E;AAC3E,SAAKA,IAEE;AAAA,IACLgD,OAAO;AAAA,MACLhD,WAAWA,CAACkC,MAA+B;AACzC,cAAMrD,IAAQqD,EAAOrD;AACrB,eAAO,OAAOA,KAAU,WACpBmB,EAAUnB,CAAK,IACfqB,OAAOrB,KAAS,EAAE;AAAA,MACxB;AAAA,IAAA;AAAA,EACF,IAVqB,CAAA;AAYzB;"}
@@ -1,124 +0,0 @@
1
- import { Theme } from '@mui/material';
2
- import { LegendComponentOption } from 'echarts';
3
- import { CallbackDataParams, TopLevelFormatterParams } from 'echarts/types/dist/shared';
4
- /**
5
- * Shared EChart configuration builders for chart widgets
6
- */
7
- /**
8
- * Rounds a value up to the nearest "nice" number.
9
- * A nice number is a multiple of 10^floor(log10(value)).
10
- *
11
- * Examples: 547 → 600, 200 → 200, 1200 → 2000, 18 → 20, 5 → 5, -547 → -500
12
- */
13
- export declare function niceNum(value: number): number;
14
- /**
15
- * Builds standard legend configuration for chart widgets
16
- *
17
- * @param params - Legend configuration parameters
18
- * @param params.hasLegend - Whether to show the legend
19
- * @param params.labelFormatter - Optional formatter for legend item names
20
- * @returns Legend configuration object
21
- */
22
- export declare function buildLegendConfig({ hasLegend, labelFormatter, }: {
23
- hasLegend: boolean;
24
- labelFormatter?: (value: string | number) => string | number;
25
- }): LegendComponentOption;
26
- /**
27
- * Builds standard grid configuration with legend-aware spacing
28
- *
29
- * @param hasLegend - Whether the chart has a legend
30
- * @param theme - MUI theme for spacing
31
- * @param additionalConfig - Additional grid configuration to merge
32
- * @returns Grid configuration object
33
- */
34
- export declare function buildGridConfig(hasLegend: boolean, theme: Theme): {
35
- bottom?: number | undefined;
36
- };
37
- /**
38
- * Creates a tooltip position calculator that handles overflow
39
- * Used by bar, histogram, and scatterplot widgets
40
- *
41
- * @param theme - MUI theme for spacing
42
- * @returns Tooltip position function
43
- */
44
- export declare function createTooltipPositioner(theme: Theme): (point: [number, number], _params: unknown, _dom: unknown, _rect: unknown, size: {
45
- contentSize: [number, number];
46
- viewSize: [number, number];
47
- }) => Record<string, number>;
48
- /**
49
- * Creates an axis label formatter for ECharts
50
- * Used to format numeric axis labels with a widget formatter
51
- *
52
- * @param formatter - Optional formatter function from widget config
53
- * @returns Axis label formatter function or undefined
54
- */
55
- export declare function createAxisLabelFormatter(formatter?: (value: number) => string): ((value: number) => string) | undefined;
56
- /**
57
- * Applies labelFormatter to xAxis configuration
58
- * Applies to any xAxis regardless of axis type (category, value, etc.)
59
- *
60
- * @param xAxis - Existing xAxis configuration
61
- * @param labelFormatter - Optional labelFormatter function from widget config
62
- * @returns Updated xAxis configuration
63
- */
64
- export declare function applyXAxisFormatter(xAxis: unknown, formatter?: (value: string | number) => string | number): {
65
- axisLabel: {
66
- formatter: ((value: string | number) => string) | undefined;
67
- };
68
- type?: string;
69
- };
70
- /**
71
- * Applies formatter to yAxis configuration
72
- * Only applies to single axis objects (not arrays) with type 'value'
73
- *
74
- * @param yAxis - Existing yAxis configuration
75
- * @param formatter - Optional formatter function from widget config
76
- * @returns Updated yAxis configuration or undefined if no changes needed
77
- */
78
- export declare function applyYAxisFormatter(yAxis: unknown, formatter?: (value: number) => string): {
79
- axisLabel: {
80
- formatter: ((value: number) => string) | undefined;
81
- };
82
- type?: string;
83
- };
84
- /**
85
- * Creates a tooltip formatter for ECharts
86
- * Formats numeric values in tooltip using widget formatter
87
- * Handles both axis trigger (array) and item trigger (object) modes
88
- *
89
- * @param formatter - Optional formatter function from widget config
90
- * @returns Tooltip formatter function or undefined
91
- */
92
- export declare function createTooltipFormatter(callback: (item: CallbackDataParams, items: CallbackDataParams[]) => {
93
- name: string;
94
- seriesName: string;
95
- marker: string;
96
- value: string | number;
97
- }): (params: TopLevelFormatterParams) => string;
98
- /**
99
- * Builds a series `label` config that applies formatter to the data value
100
- * extracted from a dataset row using ECharts encode/dimensionNames.
101
- *
102
- * Does not set `show` — labels remain hidden by default per ECharts defaults.
103
- *
104
- * @param formatter - Optional numeric value formatter
105
- * @param encodeKey - The encode dimension key to extract ('y' for vertical charts, 'x' for horizontal)
106
- */
107
- export declare function buildSeriesLabelConfig(formatter?: (value: number) => string, encodeKey?: string): {
108
- label: {
109
- formatter: (params: CallbackDataParams) => string;
110
- };
111
- } | object;
112
- /**
113
- * Builds a series `label` config that applies formatter to a raw numeric value.
114
- * Used by histogram where series data is number[] (not datasets).
115
- *
116
- * Does not set `show` — labels remain hidden by default per ECharts defaults.
117
- *
118
- * @param formatter - Optional numeric value formatter
119
- */
120
- export declare function buildHistogramSeriesLabelConfig(formatter?: (value: number) => string): {
121
- label: {
122
- formatter: (params: CallbackDataParams) => string;
123
- };
124
- } | object;