@classic-homes/charts-react 0.6.0 → 0.7.0

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 CHANGED
@@ -880,6 +880,7 @@ var LineChart = React6.forwardRef(
880
880
  showDataTable,
881
881
  exportable,
882
882
  patterns,
883
+ selected,
883
884
  onClick,
884
885
  onHover,
885
886
  class: className,
@@ -914,16 +915,21 @@ var LineChart = React6.forwardRef(
914
915
  const series = data.series.map((source, index) => ({
915
916
  name: source.name,
916
917
  type: "line",
917
- data: (0, import_charts_core6.withForecastPoints)(
918
- (0, import_charts_core6.withPointLabels)(plotted[index].data, source.labels, formatters.label, {
919
- position: "top"
920
- }),
921
- source,
922
- showDataPoints ? 6 : 0
918
+ data: (0, import_charts_core6.withSelectedPoints)(
919
+ (0, import_charts_core6.withForecastPoints)(
920
+ (0, import_charts_core6.withPointLabels)(plotted[index].data, source.labels, formatters.label, {
921
+ position: "top"
922
+ }),
923
+ source,
924
+ showDataPoints ? 6 : 0
925
+ ),
926
+ data.categories,
927
+ selected,
928
+ { pointSize: showDataPoints ? 6 : 0, ringColor: chartColors.surface }
923
929
  ),
924
930
  smooth,
925
- // Forecast points show even when the others are hidden (size 0)
926
- showSymbol: showSymbol || (0, import_charts_core6.forecastStart)(source) !== void 0,
931
+ // Forecast and selected points show even when the others are hidden (size 0)
932
+ showSymbol: showSymbol || (0, import_charts_core6.forecastStart)(source) !== void 0 || (0, import_charts_core6.selectionShowsSymbols)(selected),
927
933
  symbolSize: showDataPoints ? 6 : 0,
928
934
  connectNulls,
929
935
  stack: stacked ? "Total" : void 0,
@@ -1020,6 +1026,7 @@ var LineChart = React6.forwardRef(
1020
1026
  );
1021
1027
  }, [
1022
1028
  data,
1029
+ selected,
1023
1030
  isEmpty,
1024
1031
  showTooltip,
1025
1032
  showLegend,
@@ -1060,7 +1067,10 @@ var LineChart = React6.forwardRef(
1060
1067
  onCreated: onReady
1061
1068
  });
1062
1069
  const format = (0, import_charts_core6.resolveValueFormatter)(valueFormat, locale);
1063
- const accessibilityDescription = description || (!isEmpty ? (0, import_charts_core6.generateLineChartDescription)(title, data, format) : void 0);
1070
+ const accessibilityDescription = (0, import_charts_core6.withSelectionDescription)(
1071
+ description || (!isEmpty ? (0, import_charts_core6.generateLineChartDescription)(title, data, format) : void 0),
1072
+ selected
1073
+ );
1064
1074
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1065
1075
  ChartContainer,
1066
1076
  {
@@ -1146,6 +1156,7 @@ var BarChart = React7.forwardRef(
1146
1156
  showDataTable,
1147
1157
  exportable,
1148
1158
  patterns,
1159
+ selected,
1149
1160
  onClick,
1150
1161
  onHover,
1151
1162
  class: className,
@@ -1200,12 +1211,17 @@ var BarChart = React7.forwardRef(
1200
1211
  data.series.map((source, index) => ({
1201
1212
  name: source.name,
1202
1213
  type: "bar",
1203
- data: (0, import_charts_core7.withForecastBars)(
1204
- (0, import_charts_core7.withPointLabels)(plotted[index].data, source.labels, formatters.label, {
1205
- position: labelPosition
1206
- }),
1207
- source,
1208
- source.color || chartColors.series[index % chartColors.series.length]
1214
+ data: (0, import_charts_core7.withSelectedBars)(
1215
+ (0, import_charts_core7.withForecastBars)(
1216
+ (0, import_charts_core7.withPointLabels)(plotted[index].data, source.labels, formatters.label, {
1217
+ position: labelPosition
1218
+ }),
1219
+ source,
1220
+ source.color || chartColors.series[index % chartColors.series.length]
1221
+ ),
1222
+ data.categories,
1223
+ selected,
1224
+ (0, import_charts_core7.isGhostSeries)(source) ? import_charts_core7.GHOST_BAR_OPACITY : 1
1209
1225
  ),
1210
1226
  stack: stackIds[index],
1211
1227
  itemStyle: {
@@ -1289,6 +1305,7 @@ var BarChart = React7.forwardRef(
1289
1305
  );
1290
1306
  }, [
1291
1307
  data,
1308
+ selected,
1292
1309
  isEmpty,
1293
1310
  showTooltip,
1294
1311
  showLegend,
@@ -1327,7 +1344,10 @@ var BarChart = React7.forwardRef(
1327
1344
  onCreated: onReady
1328
1345
  });
1329
1346
  const format = (0, import_charts_core7.resolveValueFormatter)(valueFormat, locale);
1330
- const accessibilityDescription = description || (!isEmpty ? (0, import_charts_core7.generateBarChartDescription)(title, data, format) : void 0);
1347
+ const accessibilityDescription = (0, import_charts_core7.withSelectionDescription)(
1348
+ description || (!isEmpty ? (0, import_charts_core7.generateBarChartDescription)(title, data, format) : void 0),
1349
+ selected
1350
+ );
1331
1351
  const resolvedHeight = isHorizontal ? (0, import_charts_core7.resolveChartHeight)(height, data?.categories?.length ?? 0, {
1332
1352
  rowHeight,
1333
1353
  minHeight,
@@ -1404,6 +1424,7 @@ var PieChart = React8.forwardRef(
1404
1424
  showDataTable,
1405
1425
  exportable,
1406
1426
  patterns,
1427
+ selected,
1407
1428
  onClick,
1408
1429
  class: className,
1409
1430
  ...props
@@ -1453,12 +1474,15 @@ var PieChart = React8.forwardRef(
1453
1474
  type: "pie",
1454
1475
  radius: innerRadius ? [innerRadius, "70%"] : "70%",
1455
1476
  center: (0, import_charts_core8.legendCenter)(legendConfig, showLegend && !customLegend, ["50%", "45%"]),
1456
- data: data.map((item) => ({
1457
- name: item.name,
1458
- value: item.value,
1459
- itemStyle: item.color ? { color: item.color } : void 0,
1460
- label: (0, import_charts_core8.pointLabel)(item.label, labelFormatter, { position: labelPosition })
1461
- })),
1477
+ data: (0, import_charts_core8.withSelectedSlices)(
1478
+ data.map((item) => ({
1479
+ name: item.name,
1480
+ value: item.value,
1481
+ itemStyle: item.color ? { color: item.color } : void 0,
1482
+ label: (0, import_charts_core8.pointLabel)(item.label, labelFormatter, { position: labelPosition })
1483
+ })),
1484
+ selected
1485
+ ),
1462
1486
  label: (0, import_charts_core8.buildDataLabel)(
1463
1487
  {
1464
1488
  show: true,
@@ -1482,6 +1506,7 @@ var PieChart = React8.forwardRef(
1482
1506
  );
1483
1507
  }, [
1484
1508
  data,
1509
+ selected,
1485
1510
  isEmpty,
1486
1511
  showTooltip,
1487
1512
  showLegend,
@@ -1507,7 +1532,10 @@ var PieChart = React8.forwardRef(
1507
1532
  onReady: legend.attach,
1508
1533
  onCreated: onReady
1509
1534
  });
1510
- const accessibilityDescription = description || (!isEmpty ? (0, import_charts_core8.generatePieChartDescription)(title, data, false) : void 0);
1535
+ const accessibilityDescription = (0, import_charts_core8.withSelectionDescription)(
1536
+ description || (!isEmpty ? (0, import_charts_core8.generatePieChartDescription)(title, data, false) : void 0),
1537
+ selected
1538
+ );
1511
1539
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1512
1540
  ChartContainer,
1513
1541
  {
@@ -1593,6 +1621,8 @@ var AreaChart = React9.forwardRef(
1593
1621
  showDataTable,
1594
1622
  exportable,
1595
1623
  patterns,
1624
+ showDataPoints = false,
1625
+ selected,
1596
1626
  onClick,
1597
1627
  onHover,
1598
1628
  class: className,
@@ -1622,18 +1652,25 @@ var AreaChart = React9.forwardRef(
1622
1652
  });
1623
1653
  const plotted = isPercent ? (0, import_charts_core9.toPercentStack)(data.series) : data.series;
1624
1654
  const getLabel = (0, import_charts_core9.seriesLabelLookup)(data.series);
1625
- const showSymbol = showLabels || (0, import_charts_core9.hasPointLabels)(data.series);
1655
+ const showSymbol = showDataPoints || showLabels || (0, import_charts_core9.hasPointLabels)(data.series);
1656
+ const pointSize = showDataPoints ? 6 : showSymbol ? 4 : 0;
1626
1657
  const legendBottom = builtInLegend && (legendConfig?.position ?? "bottom") === "bottom";
1627
1658
  const series = data.series.map((source, index) => {
1628
1659
  const base = source.color || chartColors.series[index % chartColors.series.length];
1629
1660
  return {
1630
1661
  name: source.name,
1631
1662
  type: "line",
1632
- data: (0, import_charts_core9.withForecastPoints)(
1633
- (0, import_charts_core9.withPointLabels)(plotted[index].data, source.labels, formatters.label, {
1634
- position: "top"
1635
- }),
1636
- source
1663
+ data: (0, import_charts_core9.withSelectedPoints)(
1664
+ (0, import_charts_core9.withForecastPoints)(
1665
+ (0, import_charts_core9.withPointLabels)(plotted[index].data, source.labels, formatters.label, {
1666
+ position: "top"
1667
+ }),
1668
+ source,
1669
+ pointSize
1670
+ ),
1671
+ data.categories,
1672
+ selected,
1673
+ { pointSize, ringColor: chartColors.surface }
1637
1674
  ),
1638
1675
  smooth,
1639
1676
  connectNulls,
@@ -1654,8 +1691,9 @@ var AreaChart = React9.forwardRef(
1654
1691
  emphasis: {
1655
1692
  focus: "series"
1656
1693
  },
1657
- // Forecast points show even when the others are hidden (size 0)
1658
- ...(0, import_charts_core9.forecastStart)(source) === void 0 ? { showSymbol } : { showSymbol: true, symbolSize: showSymbol ? 4 : 0 }
1694
+ // Forecast and selected points show even when the others are hidden (size 0)
1695
+ showSymbol: showSymbol || (0, import_charts_core9.forecastStart)(source) !== void 0 || (0, import_charts_core9.selectionShowsSymbols)(selected),
1696
+ symbolSize: pointSize
1659
1697
  };
1660
1698
  });
1661
1699
  return (0, import_charts_core9.mergeChartOption)(
@@ -1737,6 +1775,8 @@ var AreaChart = React9.forwardRef(
1737
1775
  );
1738
1776
  }, [
1739
1777
  data,
1778
+ selected,
1779
+ showDataPoints,
1740
1780
  isEmpty,
1741
1781
  showTooltip,
1742
1782
  showLegend,
@@ -1776,7 +1816,10 @@ var AreaChart = React9.forwardRef(
1776
1816
  onCreated: onReady
1777
1817
  });
1778
1818
  const format = (0, import_charts_core9.resolveValueFormatter)(valueFormat, locale);
1779
- const accessibilityDescription = description || (!isEmpty ? (0, import_charts_core9.generateAreaChartDescription)(title, data, format) : void 0);
1819
+ const accessibilityDescription = (0, import_charts_core9.withSelectionDescription)(
1820
+ description || (!isEmpty ? (0, import_charts_core9.generateAreaChartDescription)(title, data, format) : void 0),
1821
+ selected
1822
+ );
1780
1823
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1781
1824
  ChartContainer,
1782
1825
  {
@@ -2117,6 +2160,7 @@ var DonutChart = React11.forwardRef(
2117
2160
  showDataTable,
2118
2161
  exportable,
2119
2162
  patterns,
2163
+ selected,
2120
2164
  onClick,
2121
2165
  class: className,
2122
2166
  ...props
@@ -2213,12 +2257,15 @@ var DonutChart = React11.forwardRef(
2213
2257
  radius: [innerRadius, "70%"],
2214
2258
  center: pieCenter,
2215
2259
  avoidLabelOverlap: true,
2216
- data: data.map((item) => ({
2217
- name: item.name,
2218
- value: item.value,
2219
- itemStyle: item.color ? { color: item.color } : void 0,
2220
- label: (0, import_charts_core11.pointLabel)(item.label, labelFormatter, { position: labelPosition })
2221
- })),
2260
+ data: (0, import_charts_core11.withSelectedSlices)(
2261
+ data.map((item) => ({
2262
+ name: item.name,
2263
+ value: item.value,
2264
+ itemStyle: item.color ? { color: item.color } : void 0,
2265
+ label: (0, import_charts_core11.pointLabel)(item.label, labelFormatter, { position: labelPosition })
2266
+ })),
2267
+ selected
2268
+ ),
2222
2269
  label: (0, import_charts_core11.buildDataLabel)(
2223
2270
  {
2224
2271
  show: true,
@@ -2245,6 +2292,7 @@ var DonutChart = React11.forwardRef(
2245
2292
  );
2246
2293
  }, [
2247
2294
  data,
2295
+ selected,
2248
2296
  isEmpty,
2249
2297
  showTooltip,
2250
2298
  showLegend,
@@ -2273,7 +2321,10 @@ var DonutChart = React11.forwardRef(
2273
2321
  onReady: legend.attach,
2274
2322
  onCreated: onReady
2275
2323
  });
2276
- const accessibilityDescription = description || (!isEmpty ? (0, import_charts_core11.generatePieChartDescription)(title, data, true) : void 0);
2324
+ const accessibilityDescription = (0, import_charts_core11.withSelectionDescription)(
2325
+ description || (!isEmpty ? (0, import_charts_core11.generatePieChartDescription)(title, data, true) : void 0),
2326
+ selected
2327
+ );
2277
2328
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2278
2329
  ChartContainer,
2279
2330
  {
package/dist/index.js CHANGED
@@ -456,7 +456,10 @@ import {
456
456
  withPointLabels,
457
457
  withGhostSeries,
458
458
  withReferenceMarks,
459
- withZoomInset
459
+ withZoomInset,
460
+ selectionShowsSymbols,
461
+ withSelectedPoints,
462
+ withSelectionDescription
460
463
  } from "@classic-homes/charts-core";
461
464
 
462
465
  // src/lib/events.ts
@@ -863,6 +866,7 @@ var LineChart = React6.forwardRef(
863
866
  showDataTable,
864
867
  exportable,
865
868
  patterns,
869
+ selected,
866
870
  onClick,
867
871
  onHover,
868
872
  class: className,
@@ -897,16 +901,21 @@ var LineChart = React6.forwardRef(
897
901
  const series = data.series.map((source, index) => ({
898
902
  name: source.name,
899
903
  type: "line",
900
- data: withForecastPoints(
901
- withPointLabels(plotted[index].data, source.labels, formatters.label, {
902
- position: "top"
903
- }),
904
- source,
905
- showDataPoints ? 6 : 0
904
+ data: withSelectedPoints(
905
+ withForecastPoints(
906
+ withPointLabels(plotted[index].data, source.labels, formatters.label, {
907
+ position: "top"
908
+ }),
909
+ source,
910
+ showDataPoints ? 6 : 0
911
+ ),
912
+ data.categories,
913
+ selected,
914
+ { pointSize: showDataPoints ? 6 : 0, ringColor: chartColors.surface }
906
915
  ),
907
916
  smooth,
908
- // Forecast points show even when the others are hidden (size 0)
909
- showSymbol: showSymbol || forecastStart(source) !== void 0,
917
+ // Forecast and selected points show even when the others are hidden (size 0)
918
+ showSymbol: showSymbol || forecastStart(source) !== void 0 || selectionShowsSymbols(selected),
910
919
  symbolSize: showDataPoints ? 6 : 0,
911
920
  connectNulls,
912
921
  stack: stacked ? "Total" : void 0,
@@ -1003,6 +1012,7 @@ var LineChart = React6.forwardRef(
1003
1012
  );
1004
1013
  }, [
1005
1014
  data,
1015
+ selected,
1006
1016
  isEmpty,
1007
1017
  showTooltip,
1008
1018
  showLegend,
@@ -1043,7 +1053,10 @@ var LineChart = React6.forwardRef(
1043
1053
  onCreated: onReady
1044
1054
  });
1045
1055
  const format = resolveValueFormatter(valueFormat, locale);
1046
- const accessibilityDescription = description || (!isEmpty ? generateLineChartDescription(title, data, format) : void 0);
1056
+ const accessibilityDescription = withSelectionDescription(
1057
+ description || (!isEmpty ? generateLineChartDescription(title, data, format) : void 0),
1058
+ selected
1059
+ );
1047
1060
  return /* @__PURE__ */ jsx7(
1048
1061
  ChartContainer,
1049
1062
  {
@@ -1111,7 +1124,11 @@ import {
1111
1124
  withGhostSeries as withGhostSeries2,
1112
1125
  withPointLabels as withPointLabels2,
1113
1126
  withReferenceMarks as withReferenceMarks2,
1114
- withZoomInset as withZoomInset2
1127
+ withZoomInset as withZoomInset2,
1128
+ GHOST_BAR_OPACITY,
1129
+ isGhostSeries,
1130
+ withSelectedBars,
1131
+ withSelectionDescription as withSelectionDescription2
1115
1132
  } from "@classic-homes/charts-core";
1116
1133
  import { jsx as jsx8 } from "react/jsx-runtime";
1117
1134
  echarts4.use([
@@ -1162,6 +1179,7 @@ var BarChart = React7.forwardRef(
1162
1179
  showDataTable,
1163
1180
  exportable,
1164
1181
  patterns,
1182
+ selected,
1165
1183
  onClick,
1166
1184
  onHover,
1167
1185
  class: className,
@@ -1216,12 +1234,17 @@ var BarChart = React7.forwardRef(
1216
1234
  data.series.map((source, index) => ({
1217
1235
  name: source.name,
1218
1236
  type: "bar",
1219
- data: withForecastBars(
1220
- withPointLabels2(plotted[index].data, source.labels, formatters.label, {
1221
- position: labelPosition
1222
- }),
1223
- source,
1224
- source.color || chartColors.series[index % chartColors.series.length]
1237
+ data: withSelectedBars(
1238
+ withForecastBars(
1239
+ withPointLabels2(plotted[index].data, source.labels, formatters.label, {
1240
+ position: labelPosition
1241
+ }),
1242
+ source,
1243
+ source.color || chartColors.series[index % chartColors.series.length]
1244
+ ),
1245
+ data.categories,
1246
+ selected,
1247
+ isGhostSeries(source) ? GHOST_BAR_OPACITY : 1
1225
1248
  ),
1226
1249
  stack: stackIds[index],
1227
1250
  itemStyle: {
@@ -1305,6 +1328,7 @@ var BarChart = React7.forwardRef(
1305
1328
  );
1306
1329
  }, [
1307
1330
  data,
1331
+ selected,
1308
1332
  isEmpty,
1309
1333
  showTooltip,
1310
1334
  showLegend,
@@ -1343,7 +1367,10 @@ var BarChart = React7.forwardRef(
1343
1367
  onCreated: onReady
1344
1368
  });
1345
1369
  const format = resolveValueFormatter2(valueFormat, locale);
1346
- const accessibilityDescription = description || (!isEmpty ? generateBarChartDescription(title, data, format) : void 0);
1370
+ const accessibilityDescription = withSelectionDescription2(
1371
+ description || (!isEmpty ? generateBarChartDescription(title, data, format) : void 0),
1372
+ selected
1373
+ );
1347
1374
  const resolvedHeight = isHorizontal ? resolveChartHeight(height, data?.categories?.length ?? 0, {
1348
1375
  rowHeight,
1349
1376
  minHeight,
@@ -1398,7 +1425,9 @@ import {
1398
1425
  mergeChartOption as mergeChartOption3,
1399
1426
  pointLabel,
1400
1427
  resolveValueFormatter as resolveValueFormatter3,
1401
- sliceTable
1428
+ sliceTable,
1429
+ withSelectedSlices,
1430
+ withSelectionDescription as withSelectionDescription3
1402
1431
  } from "@classic-homes/charts-core";
1403
1432
  import { jsx as jsx9 } from "react/jsx-runtime";
1404
1433
  echarts5.use([EChartsPieChart, TooltipComponent3, LegendComponent3, TitleComponent3, CanvasRenderer4]);
@@ -1434,6 +1463,7 @@ var PieChart = React8.forwardRef(
1434
1463
  showDataTable,
1435
1464
  exportable,
1436
1465
  patterns,
1466
+ selected,
1437
1467
  onClick,
1438
1468
  class: className,
1439
1469
  ...props
@@ -1483,12 +1513,15 @@ var PieChart = React8.forwardRef(
1483
1513
  type: "pie",
1484
1514
  radius: innerRadius ? [innerRadius, "70%"] : "70%",
1485
1515
  center: legendCenter(legendConfig, showLegend && !customLegend, ["50%", "45%"]),
1486
- data: data.map((item) => ({
1487
- name: item.name,
1488
- value: item.value,
1489
- itemStyle: item.color ? { color: item.color } : void 0,
1490
- label: pointLabel(item.label, labelFormatter, { position: labelPosition })
1491
- })),
1516
+ data: withSelectedSlices(
1517
+ data.map((item) => ({
1518
+ name: item.name,
1519
+ value: item.value,
1520
+ itemStyle: item.color ? { color: item.color } : void 0,
1521
+ label: pointLabel(item.label, labelFormatter, { position: labelPosition })
1522
+ })),
1523
+ selected
1524
+ ),
1492
1525
  label: buildDataLabel3(
1493
1526
  {
1494
1527
  show: true,
@@ -1512,6 +1545,7 @@ var PieChart = React8.forwardRef(
1512
1545
  );
1513
1546
  }, [
1514
1547
  data,
1548
+ selected,
1515
1549
  isEmpty,
1516
1550
  showTooltip,
1517
1551
  showLegend,
@@ -1537,7 +1571,10 @@ var PieChart = React8.forwardRef(
1537
1571
  onReady: legend.attach,
1538
1572
  onCreated: onReady
1539
1573
  });
1540
- const accessibilityDescription = description || (!isEmpty ? generatePieChartDescription(title, data, false) : void 0);
1574
+ const accessibilityDescription = withSelectionDescription3(
1575
+ description || (!isEmpty ? generatePieChartDescription(title, data, false) : void 0),
1576
+ selected
1577
+ );
1541
1578
  return /* @__PURE__ */ jsx9(
1542
1579
  ChartContainer,
1543
1580
  {
@@ -1603,7 +1640,10 @@ import {
1603
1640
  withPointLabels as withPointLabels3,
1604
1641
  withGhostSeries as withGhostSeries3,
1605
1642
  withReferenceMarks as withReferenceMarks3,
1606
- withZoomInset as withZoomInset3
1643
+ withZoomInset as withZoomInset3,
1644
+ selectionShowsSymbols as selectionShowsSymbols2,
1645
+ withSelectedPoints as withSelectedPoints2,
1646
+ withSelectionDescription as withSelectionDescription4
1607
1647
  } from "@classic-homes/charts-core";
1608
1648
  import { jsx as jsx10 } from "react/jsx-runtime";
1609
1649
  echarts6.use([
@@ -1654,6 +1694,8 @@ var AreaChart = React9.forwardRef(
1654
1694
  showDataTable,
1655
1695
  exportable,
1656
1696
  patterns,
1697
+ showDataPoints = false,
1698
+ selected,
1657
1699
  onClick,
1658
1700
  onHover,
1659
1701
  class: className,
@@ -1683,18 +1725,25 @@ var AreaChart = React9.forwardRef(
1683
1725
  });
1684
1726
  const plotted = isPercent ? toPercentStack3(data.series) : data.series;
1685
1727
  const getLabel = seriesLabelLookup3(data.series);
1686
- const showSymbol = showLabels || hasPointLabels2(data.series);
1728
+ const showSymbol = showDataPoints || showLabels || hasPointLabels2(data.series);
1729
+ const pointSize = showDataPoints ? 6 : showSymbol ? 4 : 0;
1687
1730
  const legendBottom = builtInLegend && (legendConfig?.position ?? "bottom") === "bottom";
1688
1731
  const series = data.series.map((source, index) => {
1689
1732
  const base = source.color || chartColors.series[index % chartColors.series.length];
1690
1733
  return {
1691
1734
  name: source.name,
1692
1735
  type: "line",
1693
- data: withForecastPoints2(
1694
- withPointLabels3(plotted[index].data, source.labels, formatters.label, {
1695
- position: "top"
1696
- }),
1697
- source
1736
+ data: withSelectedPoints2(
1737
+ withForecastPoints2(
1738
+ withPointLabels3(plotted[index].data, source.labels, formatters.label, {
1739
+ position: "top"
1740
+ }),
1741
+ source,
1742
+ pointSize
1743
+ ),
1744
+ data.categories,
1745
+ selected,
1746
+ { pointSize, ringColor: chartColors.surface }
1698
1747
  ),
1699
1748
  smooth,
1700
1749
  connectNulls,
@@ -1715,8 +1764,9 @@ var AreaChart = React9.forwardRef(
1715
1764
  emphasis: {
1716
1765
  focus: "series"
1717
1766
  },
1718
- // Forecast points show even when the others are hidden (size 0)
1719
- ...forecastStart2(source) === void 0 ? { showSymbol } : { showSymbol: true, symbolSize: showSymbol ? 4 : 0 }
1767
+ // Forecast and selected points show even when the others are hidden (size 0)
1768
+ showSymbol: showSymbol || forecastStart2(source) !== void 0 || selectionShowsSymbols2(selected),
1769
+ symbolSize: pointSize
1720
1770
  };
1721
1771
  });
1722
1772
  return mergeChartOption4(
@@ -1798,6 +1848,8 @@ var AreaChart = React9.forwardRef(
1798
1848
  );
1799
1849
  }, [
1800
1850
  data,
1851
+ selected,
1852
+ showDataPoints,
1801
1853
  isEmpty,
1802
1854
  showTooltip,
1803
1855
  showLegend,
@@ -1837,7 +1889,10 @@ var AreaChart = React9.forwardRef(
1837
1889
  onCreated: onReady
1838
1890
  });
1839
1891
  const format = resolveValueFormatter4(valueFormat, locale);
1840
- const accessibilityDescription = description || (!isEmpty ? generateAreaChartDescription(title, data, format) : void 0);
1892
+ const accessibilityDescription = withSelectionDescription4(
1893
+ description || (!isEmpty ? generateAreaChartDescription(title, data, format) : void 0),
1894
+ selected
1895
+ );
1841
1896
  return /* @__PURE__ */ jsx10(
1842
1897
  ChartContainer,
1843
1898
  {
@@ -2178,7 +2233,9 @@ import {
2178
2233
  pointLabel as pointLabel2,
2179
2234
  resolveValueFormatter as resolveValueFormatter6,
2180
2235
  sliceTable as sliceTable2,
2181
- THEME_DARK as THEME_DARK4
2236
+ THEME_DARK as THEME_DARK4,
2237
+ withSelectedSlices as withSelectedSlices2,
2238
+ withSelectionDescription as withSelectionDescription5
2182
2239
  } from "@classic-homes/charts-core";
2183
2240
  import { jsx as jsx12 } from "react/jsx-runtime";
2184
2241
  echarts8.use([EChartsPieChart2, TooltipComponent6, LegendComponent6, TitleComponent6, CanvasRenderer7]);
@@ -2216,6 +2273,7 @@ var DonutChart = React11.forwardRef(
2216
2273
  showDataTable,
2217
2274
  exportable,
2218
2275
  patterns,
2276
+ selected,
2219
2277
  onClick,
2220
2278
  class: className,
2221
2279
  ...props
@@ -2312,12 +2370,15 @@ var DonutChart = React11.forwardRef(
2312
2370
  radius: [innerRadius, "70%"],
2313
2371
  center: pieCenter,
2314
2372
  avoidLabelOverlap: true,
2315
- data: data.map((item) => ({
2316
- name: item.name,
2317
- value: item.value,
2318
- itemStyle: item.color ? { color: item.color } : void 0,
2319
- label: pointLabel2(item.label, labelFormatter, { position: labelPosition })
2320
- })),
2373
+ data: withSelectedSlices2(
2374
+ data.map((item) => ({
2375
+ name: item.name,
2376
+ value: item.value,
2377
+ itemStyle: item.color ? { color: item.color } : void 0,
2378
+ label: pointLabel2(item.label, labelFormatter, { position: labelPosition })
2379
+ })),
2380
+ selected
2381
+ ),
2321
2382
  label: buildDataLabel6(
2322
2383
  {
2323
2384
  show: true,
@@ -2344,6 +2405,7 @@ var DonutChart = React11.forwardRef(
2344
2405
  );
2345
2406
  }, [
2346
2407
  data,
2408
+ selected,
2347
2409
  isEmpty,
2348
2410
  showTooltip,
2349
2411
  showLegend,
@@ -2372,7 +2434,10 @@ var DonutChart = React11.forwardRef(
2372
2434
  onReady: legend.attach,
2373
2435
  onCreated: onReady
2374
2436
  });
2375
- const accessibilityDescription = description || (!isEmpty ? generatePieChartDescription2(title, data, true) : void 0);
2437
+ const accessibilityDescription = withSelectionDescription5(
2438
+ description || (!isEmpty ? generatePieChartDescription2(title, data, true) : void 0),
2439
+ selected
2440
+ );
2376
2441
  return /* @__PURE__ */ jsx12(
2377
2442
  ChartContainer,
2378
2443
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classic-homes/charts-react",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "React ECharts components for Classic Theme",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",