@apia/charts 2.0.8 → 2.0.10

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.
@@ -16,7 +16,7 @@ type TChartData = {
16
16
  chartId?: string;
17
17
  aspectRatio?: number;
18
18
  };
19
- declare const ChartComponent: (props?: TChartData) => react.JSX.Element;
19
+ declare const ChartComponent: (props: TChartData) => react.JSX.Element;
20
20
 
21
21
  export { ChartComponent, type TChartData };
22
22
  //# sourceMappingURL=ChartComponent.d.ts.map
@@ -19,26 +19,30 @@ Chart.register(
19
19
  ArcElement,
20
20
  LineController
21
21
  );
22
- const ChartComponent = (props = {
23
- chartData: { datasets: [{ data: [{ x: 0, y: 0 }] }] },
24
- type: "bar",
25
- indexAxis: "x",
26
- showLegend: true,
27
- showValues: true,
28
- showXAxisValues: true,
29
- showYAxisValues: true,
30
- showTable: true,
31
- xAxisTitle: "",
32
- yAxisTitle: "",
33
- aspectRatio: 2.5
34
- }) => {
22
+ const ChartComponent = (props) => {
23
+ const actualProps = Object.assign(
24
+ {
25
+ chartData: { datasets: [{ data: [{ x: 0, y: 0 }] }] },
26
+ type: "bar",
27
+ indexAxis: "x",
28
+ showLegend: true,
29
+ showValues: true,
30
+ showXAxisValues: true,
31
+ showYAxisValues: true,
32
+ showTable: true,
33
+ xAxisTitle: "",
34
+ yAxisTitle: "",
35
+ aspectRatio: 2.5
36
+ },
37
+ props
38
+ );
35
39
  const { theme } = useThemeUI();
36
40
  if (!theme.layout)
37
41
  console.error("The layout property is missing in the current theme");
38
42
  const data = useMemo(() => {
39
43
  const charts = theme.layout?.charts ?? {};
40
44
  return {
41
- datasets: (props.type === "waterfall" ? arrayOrArray(props.chartData.datasets).map((dataset) => {
45
+ datasets: (actualProps.type === "waterfall" ? arrayOrArray(actualProps.chartData.datasets).map((dataset) => {
42
46
  let sum = 0;
43
47
  const newData = dataset.data.map((dataValue) => {
44
48
  if (typeof dataValue === "number") {
@@ -53,10 +57,10 @@ const ChartComponent = (props = {
53
57
  ...dataset,
54
58
  data: newData
55
59
  };
56
- }) : props.chartData.datasets).map((dataset, datasetIndex) => {
57
- const isSingle = arrayOrArray(props.chartData.datasets).every(
60
+ }) : actualProps.chartData.datasets).map((dataset, datasetIndex) => {
61
+ const isSingle = arrayOrArray(actualProps.chartData.datasets).every(
58
62
  (dataset2) => arrayOrArray(dataset2.data).length === 1
59
- ) || props.type === "pie";
63
+ ) || actualProps.type === "pie";
60
64
  return {
61
65
  ...dataset,
62
66
  backgroundColor: dataset.backgroundColor.map((color, i) => {
@@ -72,7 +76,7 @@ const ChartComponent = (props = {
72
76
  };
73
77
  if (typeof currentBackgroundStylescheme.schema === "object" && currentBackgroundStylescheme.schema) {
74
78
  if (isSingle) {
75
- if (props.type === "pie") {
79
+ if (actualProps.type === "pie") {
76
80
  schemaArray = Object.values(
77
81
  currentBackgroundStylescheme.schema
78
82
  ).map((varColor) => {
@@ -140,19 +144,19 @@ const ChartComponent = (props = {
140
144
  )
141
145
  };
142
146
  }),
143
- labels: props.chartData.labels
147
+ labels: actualProps.chartData.labels
144
148
  };
145
149
  }, [
146
- props.chartData.datasets,
147
- props.chartData.labels,
148
- props.type,
150
+ actualProps.chartData.datasets,
151
+ actualProps.chartData.labels,
152
+ actualProps.type,
149
153
  theme.colors,
150
154
  theme.layout
151
155
  ]);
152
156
  const options = useMemo(() => {
153
157
  return {
154
158
  plugins: {
155
- legend: { position: "right", display: props.showLegend },
159
+ legend: { position: "right", display: actualProps.showLegend },
156
160
  tooltip: {
157
161
  callbacks: {
158
162
  label(tooltipItem) {
@@ -164,76 +168,76 @@ const ChartComponent = (props = {
164
168
  YValue = `${realValue}`;
165
169
  }
166
170
  let finalString = "";
167
- if (props.showLegend || props.type === "pie") {
171
+ if (actualProps.showLegend || actualProps.type === "pie") {
168
172
  finalString += XLabel;
169
- if (props.showValues) {
173
+ if (actualProps.showValues) {
170
174
  finalString += ": " + YValue;
171
175
  }
172
- } else if (props.showValues) {
176
+ } else if (actualProps.showValues) {
173
177
  finalString += YValue;
174
178
  }
175
179
  return finalString;
176
180
  },
177
181
  title(tooltipItems) {
178
- if (props.type !== "pie" && !props.showXAxisValues && props.indexAxis === "x" || props.type !== "pie" && !props.showYAxisValues && props.indexAxis === "y" || props.type === "pie" && !props.showLegend) {
182
+ if (actualProps.type !== "pie" && !actualProps.showXAxisValues && actualProps.indexAxis === "x" || actualProps.type !== "pie" && !actualProps.showYAxisValues && actualProps.indexAxis === "y" || actualProps.type === "pie" && !actualProps.showLegend) {
179
183
  return "";
180
184
  }
181
185
  return tooltipItems[0].label;
182
186
  }
183
187
  },
184
- enabled: (props.indexAxis === "y" ? props.showYAxisValues : props.showXAxisValues) || props.showValues || props.showLegend
188
+ enabled: (actualProps.indexAxis === "y" ? actualProps.showYAxisValues : actualProps.showXAxisValues) || actualProps.showValues || actualProps.showLegend
185
189
  }
186
190
  },
187
- aspectRatio: props.aspectRatio,
188
- indexAxis: props.indexAxis,
191
+ aspectRatio: actualProps.aspectRatio,
192
+ indexAxis: actualProps.indexAxis,
189
193
  scales: {
190
194
  x: {
191
- display: props.type !== "pie",
195
+ display: actualProps.type !== "pie",
192
196
  title: {
193
- display: props.showXAxisValues,
194
- text: props.indexAxis === "y" ? props.yAxisTitle : props.xAxisTitle
197
+ display: actualProps.showXAxisValues,
198
+ text: actualProps.indexAxis === "y" ? actualProps.yAxisTitle : actualProps.xAxisTitle
195
199
  },
196
200
  ticks: {
197
- display: !!props.showXAxisValues
201
+ display: !!actualProps.showXAxisValues
198
202
  },
199
203
  grid: {
200
- display: props.showTable
204
+ display: actualProps.showTable
201
205
  }
202
206
  },
203
207
  y: {
204
- axis: props.indexAxis === "y" ? "x" : "y",
205
- display: props.type !== "pie",
208
+ axis: actualProps.indexAxis === "y" ? "x" : "y",
209
+ display: actualProps.type !== "pie",
206
210
  title: {
207
- display: props.showYAxisValues,
208
- text: props.indexAxis === "y" ? props.xAxisTitle : props.yAxisTitle
211
+ display: actualProps.showYAxisValues,
212
+ text: actualProps.indexAxis === "y" ? actualProps.xAxisTitle : actualProps.yAxisTitle
209
213
  },
210
214
  ticks: {
211
- display: !!props.showYAxisValues
215
+ display: !!actualProps.showYAxisValues
212
216
  },
213
217
  grid: {
214
- display: props.showTable
218
+ display: actualProps.showTable
215
219
  }
216
220
  }
217
221
  }
218
222
  };
219
223
  }, [
220
- props.aspectRatio,
221
- props.indexAxis,
222
- props.showLegend,
223
- props.showTable,
224
- props.showValues,
225
- props.showXAxisValues,
226
- props.showYAxisValues,
227
- props.type,
228
- props.xAxisTitle,
229
- props.yAxisTitle
224
+ actualProps.aspectRatio,
225
+ actualProps.indexAxis,
226
+ actualProps.showLegend,
227
+ actualProps.showTable,
228
+ actualProps.showValues,
229
+ actualProps.showXAxisValues,
230
+ actualProps.showYAxisValues,
231
+ actualProps.type,
232
+ actualProps.xAxisTitle,
233
+ actualProps.yAxisTitle
230
234
  ]);
231
235
  return /* @__PURE__ */ jsx(
232
236
  Chart$1,
233
237
  {
234
- id: props.id ?? void 0,
235
- className: props.chartId ?? "",
236
- type: props.type === "waterfall" ? "bar" : props.type,
238
+ id: actualProps.id ?? void 0,
239
+ className: actualProps.chartId ?? "",
240
+ type: actualProps.type === "waterfall" ? "bar" : actualProps.type,
237
241
  options,
238
242
  data
239
243
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ChartComponent.js","sources":["../../../src/charts/chartJsRenderer/ChartComponent.tsx"],"sourcesContent":["import { arrayOrArray, getValueByPath } from '@apia/util';\r\nimport {\r\n ChartData,\r\n ChartOptions,\r\n Chart as ChartJS,\r\n CategoryScale,\r\n LinearScale,\r\n PointElement,\r\n LineElement,\r\n Title,\r\n Tooltip,\r\n Legend,\r\n BarController,\r\n BarElement,\r\n PieController,\r\n ArcElement,\r\n ChartTypeRegistry,\r\n TooltipItem,\r\n LineController,\r\n} from 'chart.js';\r\nimport { useMemo } from 'react';\r\nimport { Chart } from 'react-chartjs-2';\r\nimport { ColorModesScale, ThemeUIStyleObject, useThemeUI } from '@apia/theme';\r\nimport { IChartStylesSchemes } from '../types';\r\n\r\nChartJS.register(\r\n CategoryScale,\r\n LinearScale,\r\n PointElement,\r\n LineElement,\r\n Title,\r\n Tooltip,\r\n Legend,\r\n BarController,\r\n BarElement,\r\n PieController,\r\n ArcElement,\r\n LineController,\r\n);\r\n\r\nexport type TChartData = {\r\n chartData: ChartData;\r\n showLegend?: boolean;\r\n showValues?: boolean;\r\n showXAxisValues?: boolean;\r\n showYAxisValues?: boolean;\r\n showTable?: boolean;\r\n type:\r\n | 'bar'\r\n | 'line'\r\n | 'scatter'\r\n | 'bubble'\r\n | 'pie'\r\n | 'doughnut'\r\n | 'polarArea'\r\n | 'radar'\r\n | 'waterfall';\r\n indexAxis?: 'x' | 'y';\r\n xAxisTitle?: string;\r\n yAxisTitle?: string;\r\n id?: string;\r\n chartId?: string;\r\n aspectRatio?: number;\r\n};\r\n\r\nexport type TDataset = {\r\n backgroundColor?: string | string[];\r\n borderColor?: string | string[];\r\n borderWidth?: number;\r\n label?: string;\r\n data: number[] | [number, number][];\r\n}[];\r\n\r\nexport const ChartComponent = (\r\n props: TChartData = {\r\n chartData: { datasets: [{ data: [{ x: 0, y: 0 }] }] },\r\n type: 'bar',\r\n indexAxis: 'x',\r\n showLegend: true,\r\n showValues: true,\r\n showXAxisValues: true,\r\n showYAxisValues: true,\r\n showTable: true,\r\n xAxisTitle: '',\r\n yAxisTitle: '',\r\n aspectRatio: 2.5,\r\n },\r\n) => {\r\n const { theme } = useThemeUI();\r\n\r\n if (!theme.layout)\r\n console.error('The layout property is missing in the current theme');\r\n\r\n const data: ChartData = useMemo(() => {\r\n const charts = ((theme.layout as Record<string, ThemeUIStyleObject>)\r\n ?.charts ?? {}) as IChartStylesSchemes;\r\n return {\r\n datasets: (props.type === 'waterfall'\r\n ? arrayOrArray(props.chartData.datasets).map((dataset) => {\r\n let sum = 0;\r\n const newData = dataset.data.map<[number, number]>((dataValue) => {\r\n if (typeof dataValue === 'number') {\r\n const currentValue = sum;\r\n sum += dataValue;\r\n return [currentValue, sum] as [number, number];\r\n } else {\r\n return dataValue as [number, number];\r\n }\r\n });\r\n\r\n return {\r\n ...dataset,\r\n data: newData,\r\n };\r\n })\r\n : props.chartData.datasets\r\n ).map((dataset, datasetIndex) => {\r\n const isSingle =\r\n arrayOrArray(props.chartData.datasets).every(\r\n (dataset) => arrayOrArray(dataset.data).length === 1,\r\n ) || props.type === 'pie';\r\n\r\n return {\r\n ...dataset,\r\n backgroundColor: (\r\n dataset.backgroundColor as string[] | string[][]\r\n ).map((color, i) => {\r\n let schemaArray: string[] = [];\r\n if (typeof color === 'string') {\r\n if (color in charts) {\r\n const currentBackgroundStylescheme: {\r\n schema: Record<string, string>;\r\n } = {\r\n schema: getValueByPath(\r\n theme.colors as ColorModesScale,\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\r\n charts[color.toLowerCase()]?.schema as string,\r\n ) as Record<string, string>,\r\n };\r\n\r\n if (\r\n typeof currentBackgroundStylescheme.schema === 'object' &&\r\n currentBackgroundStylescheme.schema\r\n ) {\r\n if (isSingle) {\r\n if (props.type === 'pie') {\r\n schemaArray = Object.values(\r\n currentBackgroundStylescheme.schema,\r\n ).map((varColor) => {\r\n return window\r\n .getComputedStyle(document.documentElement)\r\n .getPropertyValue(varColor.slice(4, -1));\r\n });\r\n } else {\r\n schemaArray = new Array<string>(6)\r\n .fill(\r\n Object.values(currentBackgroundStylescheme.schema)[\r\n datasetIndex % 6\r\n ],\r\n )\r\n .map((varColor) => {\r\n return window\r\n .getComputedStyle(document.documentElement)\r\n .getPropertyValue(varColor.slice(4, -1));\r\n });\r\n }\r\n } else {\r\n schemaArray = new Array<string>(6).fill(\r\n Object.values(currentBackgroundStylescheme.schema).map(\r\n (varColor) => {\r\n return window\r\n .getComputedStyle(document.documentElement)\r\n .getPropertyValue(varColor.slice(4, -1));\r\n },\r\n )[datasetIndex % 6],\r\n );\r\n }\r\n }\r\n } else {\r\n schemaArray = [color, color, color, color, color, color];\r\n }\r\n } else {\r\n return color[datasetIndex % color.length];\r\n }\r\n\r\n return schemaArray[i % 6];\r\n }),\r\n borderColor: (dataset.borderColor as string[] | string[][]).map(\r\n (color, i) => {\r\n let schemaBorderArray: string[] = [];\r\n if (typeof color === 'string') {\r\n if (color in charts) {\r\n const currentBorderStylescheme: {\r\n schema: Record<string, string>;\r\n } = {\r\n schema: getValueByPath(\r\n theme.colors as ColorModesScale,\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\r\n charts[color.toLowerCase()]?.schema as string,\r\n ) as Record<string, string>,\r\n };\r\n\r\n if (\r\n typeof currentBorderStylescheme.schema === 'object' &&\r\n currentBorderStylescheme.schema\r\n ) {\r\n schemaBorderArray = Object.values(\r\n currentBorderStylescheme.schema,\r\n ).map((varColor) => {\r\n return window\r\n .getComputedStyle(document.documentElement)\r\n .getPropertyValue(varColor.slice(4, -1));\r\n });\r\n }\r\n } else {\r\n schemaBorderArray = [\r\n color,\r\n color,\r\n color,\r\n color,\r\n color,\r\n color,\r\n ];\r\n }\r\n } else {\r\n return color[datasetIndex % color.length];\r\n }\r\n return schemaBorderArray[i % 6];\r\n },\r\n ),\r\n };\r\n }),\r\n labels: props.chartData.labels,\r\n };\r\n }, [\r\n props.chartData.datasets,\r\n props.chartData.labels,\r\n props.type,\r\n theme.colors,\r\n theme.layout,\r\n ]);\r\n\r\n const options: ChartOptions = useMemo(() => {\r\n return {\r\n plugins: {\r\n legend: { position: 'right', display: props.showLegend },\r\n tooltip: {\r\n callbacks: {\r\n label(tooltipItem: TooltipItem<keyof ChartTypeRegistry>) {\r\n const XLabel = tooltipItem.dataset.label ?? '';\r\n let YValue = tooltipItem.formattedValue;\r\n if (isNaN(parseFloat(YValue))) {\r\n const arrayValue: [number, number] = tooltipItem.raw as [\r\n number,\r\n number,\r\n ];\r\n const realValue = arrayValue[1] - arrayValue[0];\r\n YValue = `${realValue}`;\r\n }\r\n let finalString = '';\r\n if (props.showLegend || props.type === 'pie') {\r\n finalString += XLabel;\r\n if (props.showValues) {\r\n finalString += ': ' + YValue;\r\n }\r\n } else if (props.showValues) {\r\n finalString += YValue;\r\n }\r\n return finalString;\r\n },\r\n title(tooltipItems: TooltipItem<keyof ChartTypeRegistry>[]) {\r\n if (\r\n (props.type !== 'pie' &&\r\n !props.showXAxisValues &&\r\n props.indexAxis === 'x') ||\r\n (props.type !== 'pie' &&\r\n !props.showYAxisValues &&\r\n props.indexAxis === 'y') ||\r\n (props.type === 'pie' && !props.showLegend)\r\n ) {\r\n return '';\r\n }\r\n return tooltipItems[0].label;\r\n },\r\n },\r\n enabled:\r\n (props.indexAxis === 'y'\r\n ? props.showYAxisValues\r\n : props.showXAxisValues) ||\r\n props.showValues ||\r\n props.showLegend,\r\n },\r\n },\r\n aspectRatio: props.aspectRatio,\r\n indexAxis: props.indexAxis,\r\n scales: {\r\n x: {\r\n display: props.type !== 'pie',\r\n title: {\r\n display: props.showXAxisValues,\r\n text: props.indexAxis === 'y' ? props.yAxisTitle : props.xAxisTitle,\r\n },\r\n ticks: {\r\n display: !!props.showXAxisValues,\r\n },\r\n grid: {\r\n display: props.showTable,\r\n },\r\n },\r\n y: {\r\n axis: (props.indexAxis === 'y' ? 'x' : 'y') as 'x' | 'y' | 'r',\r\n display: props.type !== 'pie',\r\n title: {\r\n display: props.showYAxisValues,\r\n text: props.indexAxis === 'y' ? props.xAxisTitle : props.yAxisTitle,\r\n },\r\n ticks: {\r\n display: !!props.showYAxisValues,\r\n },\r\n grid: {\r\n display: props.showTable,\r\n },\r\n },\r\n },\r\n };\r\n }, [\r\n props.aspectRatio,\r\n props.indexAxis,\r\n props.showLegend,\r\n props.showTable,\r\n props.showValues,\r\n props.showXAxisValues,\r\n props.showYAxisValues,\r\n props.type,\r\n props.xAxisTitle,\r\n props.yAxisTitle,\r\n ]);\r\n\r\n return (\r\n <Chart\r\n id={props.id ?? undefined}\r\n className={props.chartId ?? ''}\r\n type={props.type === 'waterfall' ? 'bar' : props.type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A,MAChB,SAAA,EAAW,MAAM,OAAW,IAAA,EAAA;AAAA,MAC5B,IAAM,EAAA,KAAA,CAAM,IAAS,KAAA,WAAA,GAAc,QAAQ,KAAM,CAAA,IAAA;AAAA,MACjD,OAAA;AAAA,MACA,IAAA;AAAA,KAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ChartComponent.js","sources":["../../../src/charts/chartJsRenderer/ChartComponent.tsx"],"sourcesContent":["import { arrayOrArray, getValueByPath } from '@apia/util';\r\nimport {\r\n ChartData,\r\n ChartOptions,\r\n Chart as ChartJS,\r\n CategoryScale,\r\n LinearScale,\r\n PointElement,\r\n LineElement,\r\n Title,\r\n Tooltip,\r\n Legend,\r\n BarController,\r\n BarElement,\r\n PieController,\r\n ArcElement,\r\n ChartTypeRegistry,\r\n TooltipItem,\r\n LineController,\r\n} from 'chart.js';\r\nimport { useMemo } from 'react';\r\nimport { Chart } from 'react-chartjs-2';\r\nimport { ColorModesScale, ThemeUIStyleObject, useThemeUI } from '@apia/theme';\r\nimport { IChartStylesSchemes } from '../types';\r\n\r\nChartJS.register(\r\n CategoryScale,\r\n LinearScale,\r\n PointElement,\r\n LineElement,\r\n Title,\r\n Tooltip,\r\n Legend,\r\n BarController,\r\n BarElement,\r\n PieController,\r\n ArcElement,\r\n LineController,\r\n);\r\n\r\nexport type TChartData = {\r\n chartData: ChartData;\r\n showLegend?: boolean;\r\n showValues?: boolean;\r\n showXAxisValues?: boolean;\r\n showYAxisValues?: boolean;\r\n showTable?: boolean;\r\n type:\r\n | 'bar'\r\n | 'line'\r\n | 'scatter'\r\n | 'bubble'\r\n | 'pie'\r\n | 'doughnut'\r\n | 'polarArea'\r\n | 'radar'\r\n | 'waterfall';\r\n indexAxis?: 'x' | 'y';\r\n xAxisTitle?: string;\r\n yAxisTitle?: string;\r\n id?: string;\r\n chartId?: string;\r\n aspectRatio?: number;\r\n};\r\n\r\nexport type TDataset = {\r\n backgroundColor?: string | string[];\r\n borderColor?: string | string[];\r\n borderWidth?: number;\r\n label?: string;\r\n data: number[] | [number, number][];\r\n}[];\r\n\r\nexport const ChartComponent = (props: TChartData) => {\r\n const actualProps: TChartData = Object.assign(\r\n {\r\n chartData: { datasets: [{ data: [{ x: 0, y: 0 }] }] },\r\n type: 'bar',\r\n indexAxis: 'x',\r\n showLegend: true,\r\n showValues: true,\r\n showXAxisValues: true,\r\n showYAxisValues: true,\r\n showTable: true,\r\n xAxisTitle: '',\r\n yAxisTitle: '',\r\n aspectRatio: 2.5,\r\n },\r\n props,\r\n );\r\n const { theme } = useThemeUI();\r\n\r\n if (!theme.layout)\r\n console.error('The layout property is missing in the current theme');\r\n\r\n const data: ChartData = useMemo(() => {\r\n const charts = ((theme.layout as Record<string, ThemeUIStyleObject>)\r\n ?.charts ?? {}) as IChartStylesSchemes;\r\n return {\r\n datasets: (actualProps.type === 'waterfall'\r\n ? arrayOrArray(actualProps.chartData.datasets).map((dataset) => {\r\n let sum = 0;\r\n const newData = dataset.data.map<[number, number]>((dataValue) => {\r\n if (typeof dataValue === 'number') {\r\n const currentValue = sum;\r\n sum += dataValue;\r\n return [currentValue, sum] as [number, number];\r\n } else {\r\n return dataValue as [number, number];\r\n }\r\n });\r\n\r\n return {\r\n ...dataset,\r\n data: newData,\r\n };\r\n })\r\n : actualProps.chartData.datasets\r\n ).map((dataset, datasetIndex) => {\r\n const isSingle =\r\n arrayOrArray(actualProps.chartData.datasets).every(\r\n (dataset) => arrayOrArray(dataset.data).length === 1,\r\n ) || actualProps.type === 'pie';\r\n\r\n return {\r\n ...dataset,\r\n backgroundColor: (\r\n dataset.backgroundColor as string[] | string[][]\r\n ).map((color, i) => {\r\n let schemaArray: string[] = [];\r\n if (typeof color === 'string') {\r\n if (color in charts) {\r\n const currentBackgroundStylescheme: {\r\n schema: Record<string, string>;\r\n } = {\r\n schema: getValueByPath(\r\n theme.colors as ColorModesScale,\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\r\n charts[color.toLowerCase()]?.schema as string,\r\n ) as Record<string, string>,\r\n };\r\n\r\n if (\r\n typeof currentBackgroundStylescheme.schema === 'object' &&\r\n currentBackgroundStylescheme.schema\r\n ) {\r\n if (isSingle) {\r\n if (actualProps.type === 'pie') {\r\n schemaArray = Object.values(\r\n currentBackgroundStylescheme.schema,\r\n ).map((varColor) => {\r\n return window\r\n .getComputedStyle(document.documentElement)\r\n .getPropertyValue(varColor.slice(4, -1));\r\n });\r\n } else {\r\n schemaArray = new Array<string>(6)\r\n .fill(\r\n Object.values(currentBackgroundStylescheme.schema)[\r\n datasetIndex % 6\r\n ],\r\n )\r\n .map((varColor) => {\r\n return window\r\n .getComputedStyle(document.documentElement)\r\n .getPropertyValue(varColor.slice(4, -1));\r\n });\r\n }\r\n } else {\r\n schemaArray = new Array<string>(6).fill(\r\n Object.values(currentBackgroundStylescheme.schema).map(\r\n (varColor) => {\r\n return window\r\n .getComputedStyle(document.documentElement)\r\n .getPropertyValue(varColor.slice(4, -1));\r\n },\r\n )[datasetIndex % 6],\r\n );\r\n }\r\n }\r\n } else {\r\n schemaArray = [color, color, color, color, color, color];\r\n }\r\n } else {\r\n return color[datasetIndex % color.length];\r\n }\r\n\r\n return schemaArray[i % 6];\r\n }),\r\n borderColor: (dataset.borderColor as string[] | string[][]).map(\r\n (color, i) => {\r\n let schemaBorderArray: string[] = [];\r\n if (typeof color === 'string') {\r\n if (color in charts) {\r\n const currentBorderStylescheme: {\r\n schema: Record<string, string>;\r\n } = {\r\n schema: getValueByPath(\r\n theme.colors as ColorModesScale,\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\r\n charts[color.toLowerCase()]?.schema as string,\r\n ) as Record<string, string>,\r\n };\r\n\r\n if (\r\n typeof currentBorderStylescheme.schema === 'object' &&\r\n currentBorderStylescheme.schema\r\n ) {\r\n schemaBorderArray = Object.values(\r\n currentBorderStylescheme.schema,\r\n ).map((varColor) => {\r\n return window\r\n .getComputedStyle(document.documentElement)\r\n .getPropertyValue(varColor.slice(4, -1));\r\n });\r\n }\r\n } else {\r\n schemaBorderArray = [\r\n color,\r\n color,\r\n color,\r\n color,\r\n color,\r\n color,\r\n ];\r\n }\r\n } else {\r\n return color[datasetIndex % color.length];\r\n }\r\n return schemaBorderArray[i % 6];\r\n },\r\n ),\r\n };\r\n }),\r\n labels: actualProps.chartData.labels,\r\n };\r\n }, [\r\n actualProps.chartData.datasets,\r\n actualProps.chartData.labels,\r\n actualProps.type,\r\n theme.colors,\r\n theme.layout,\r\n ]);\r\n\r\n const options: ChartOptions = useMemo(() => {\r\n return {\r\n plugins: {\r\n legend: { position: 'right', display: actualProps.showLegend },\r\n tooltip: {\r\n callbacks: {\r\n label(tooltipItem: TooltipItem<keyof ChartTypeRegistry>) {\r\n const XLabel = tooltipItem.dataset.label ?? '';\r\n let YValue = tooltipItem.formattedValue;\r\n if (isNaN(parseFloat(YValue))) {\r\n const arrayValue: [number, number] = tooltipItem.raw as [\r\n number,\r\n number,\r\n ];\r\n const realValue = arrayValue[1] - arrayValue[0];\r\n YValue = `${realValue}`;\r\n }\r\n let finalString = '';\r\n if (actualProps.showLegend || actualProps.type === 'pie') {\r\n finalString += XLabel;\r\n if (actualProps.showValues) {\r\n finalString += ': ' + YValue;\r\n }\r\n } else if (actualProps.showValues) {\r\n finalString += YValue;\r\n }\r\n return finalString;\r\n },\r\n title(tooltipItems: TooltipItem<keyof ChartTypeRegistry>[]) {\r\n if (\r\n (actualProps.type !== 'pie' &&\r\n !actualProps.showXAxisValues &&\r\n actualProps.indexAxis === 'x') ||\r\n (actualProps.type !== 'pie' &&\r\n !actualProps.showYAxisValues &&\r\n actualProps.indexAxis === 'y') ||\r\n (actualProps.type === 'pie' && !actualProps.showLegend)\r\n ) {\r\n return '';\r\n }\r\n return tooltipItems[0].label;\r\n },\r\n },\r\n enabled:\r\n (actualProps.indexAxis === 'y'\r\n ? actualProps.showYAxisValues\r\n : actualProps.showXAxisValues) ||\r\n actualProps.showValues ||\r\n actualProps.showLegend,\r\n },\r\n },\r\n aspectRatio: actualProps.aspectRatio,\r\n indexAxis: actualProps.indexAxis,\r\n scales: {\r\n x: {\r\n display: actualProps.type !== 'pie',\r\n title: {\r\n display: actualProps.showXAxisValues,\r\n text:\r\n actualProps.indexAxis === 'y'\r\n ? actualProps.yAxisTitle\r\n : actualProps.xAxisTitle,\r\n },\r\n ticks: {\r\n display: !!actualProps.showXAxisValues,\r\n },\r\n grid: {\r\n display: actualProps.showTable,\r\n },\r\n },\r\n y: {\r\n axis: (actualProps.indexAxis === 'y' ? 'x' : 'y') as 'x' | 'y' | 'r',\r\n display: actualProps.type !== 'pie',\r\n title: {\r\n display: actualProps.showYAxisValues,\r\n text:\r\n actualProps.indexAxis === 'y'\r\n ? actualProps.xAxisTitle\r\n : actualProps.yAxisTitle,\r\n },\r\n ticks: {\r\n display: !!actualProps.showYAxisValues,\r\n },\r\n grid: {\r\n display: actualProps.showTable,\r\n },\r\n },\r\n },\r\n };\r\n }, [\r\n actualProps.aspectRatio,\r\n actualProps.indexAxis,\r\n actualProps.showLegend,\r\n actualProps.showTable,\r\n actualProps.showValues,\r\n actualProps.showXAxisValues,\r\n actualProps.showYAxisValues,\r\n actualProps.type,\r\n actualProps.xAxisTitle,\r\n actualProps.yAxisTitle,\r\n ]);\r\n\r\n return (\r\n <Chart\r\n id={actualProps.id ?? undefined}\r\n className={actualProps.chartId ?? ''}\r\n type={actualProps.type === 'waterfall' ? 'bar' : actualProps.type}\r\n options={options}\r\n data={data}\r\n />\r\n );\r\n};\r\n"],"names":["ChartJS","dataset","Chart"],"mappings":";;;;;;;AAyBAA,KAAQ,CAAA,QAAA;AAAA,EACN,aAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,aAAA;AAAA,EACA,UAAA;AAAA,EACA,aAAA;AAAA,EACA,UAAA;AAAA,EACA,cAAA;AACF,CAAA,CAAA;AAm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@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apia/charts",
3
- "version": "2.0.8",
3
+ "version": "2.0.10",
4
4
  "sideEffects": false,
5
5
  "author": "Felipe Arzuaga <felipearax.2012@gmail.com>",
6
6
  "main": "dist/index.js",
@@ -13,7 +13,7 @@
13
13
  "libWatch": "rollup --watch --config ../../config/rollup.common.mjs --environment MODE:development,ENTRY:index.ts,WATCH:true"
14
14
  },
15
15
  "dependencies": {
16
- "@apia/components": "^2.0.8",
16
+ "@apia/components": "^2.0.10",
17
17
  "@apia/icons": "^2.0.8",
18
18
  "@apia/theme": "^2.0.8",
19
19
  "@apia/util": "^2.0.8",
@@ -52,5 +52,5 @@
52
52
  "access": "public",
53
53
  "registry": "https://registry.npmjs.org/"
54
54
  },
55
- "gitHead": "7081b9e9d30efe218f23e835d29737aab3c89824"
55
+ "gitHead": "7c24cfee81e9960f174af5ede68e8f9f514db1d9"
56
56
  }