pace-chart-lib 1.0.62 → 1.0.64

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.
@@ -16195,7 +16195,7 @@ const fileName$b = "CommonFunctions.ts";
16195
16195
  chartTypes.Speedometer,
16196
16196
  chartTypes.RadialBarChart
16197
16197
  ];
16198
- function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width, legendMargin, formatOptions, seriesData, chartId, dataTableHeight, margin, legendShape, chartType) {
16198
+ function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width, legendMargin, formatOptions, seriesData, chartId, dataTableHeight, margin, legendShape, chartType, addLocalFilterFromLib) {
16199
16199
  try {
16200
16200
  let position = formatOptions.legends.legendPosition;
16201
16201
  let horizontalLegendAlignment = formatOptions.legends.legendAlignmentTopBottom;
@@ -16217,7 +16217,9 @@ function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width,
16217
16217
  verticalLegendAlignment,
16218
16218
  legendShape,
16219
16219
  formatOptions,
16220
- chartId
16220
+ chartId,
16221
+ false,
16222
+ addLocalFilterFromLib
16221
16223
  );
16222
16224
  break;
16223
16225
  case staticLegendPosition.top:
@@ -16232,7 +16234,9 @@ function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width,
16232
16234
  horizontalLegendAlignment,
16233
16235
  legendShape,
16234
16236
  formatOptions,
16235
- chartId
16237
+ chartId,
16238
+ false,
16239
+ addLocalFilterFromLib
16236
16240
  );
16237
16241
  break;
16238
16242
  case staticLegendPosition.left:
@@ -16249,7 +16253,9 @@ function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width,
16249
16253
  verticalLegendAlignment,
16250
16254
  legendShape,
16251
16255
  formatOptions,
16252
- chartId
16256
+ chartId,
16257
+ false,
16258
+ addLocalFilterFromLib
16253
16259
  );
16254
16260
  break;
16255
16261
  case staticLegendPosition.bottom:
@@ -16264,7 +16270,9 @@ function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width,
16264
16270
  horizontalLegendAlignment,
16265
16271
  legendShape,
16266
16272
  formatOptions,
16267
- chartId
16273
+ chartId,
16274
+ false,
16275
+ addLocalFilterFromLib
16268
16276
  );
16269
16277
  break;
16270
16278
  }
@@ -16789,7 +16797,7 @@ const findStringWithLongestLength = (data, key) => {
16789
16797
  logError$2(fileName$b, "findStringWithLongestLength", error);
16790
16798
  }
16791
16799
  };
16792
- const legendsWithScroll = (svg, seriesData, x2, y2, width, height, legendPosition, alignment, legendShape, chartFormatOptions, chartId, isVennChart = false) => {
16800
+ const legendsWithScroll = (svg, seriesData, x2, y2, width, height, legendPosition, alignment, legendShape, chartFormatOptions, chartId, isVennChart = false, addLocalFilterFromLib) => {
16793
16801
  try {
16794
16802
  if (chartFormatOptions.legends.legendVisibility) {
16795
16803
  let justifyContent = "";
@@ -16812,7 +16820,9 @@ const legendsWithScroll = (svg, seriesData, x2, y2, width, height, legendPositio
16812
16820
  if (legendPosition == staticLegendPosition.top || legendPosition == staticLegendPosition.bottom)
16813
16821
  div.style("flex-direction", "row");
16814
16822
  seriesData.forEach((d, i) => {
16815
- let innerdiv = div.append("div").style("display", "inline-flex").style("justify-content", "flex-start").style("align-items", "center").style("width", "fit-content").style("margin", "3px 0px").style("flex-wrap", "nowrap").style("white-space", "nowrap").on("mousemove", function() {
16823
+ let innerdiv = div.append("div").style("display", "inline-flex").style("justify-content", "flex-start").style("align-items", "center").style("width", "fit-content").style("margin", "3px 0px").style("flex-wrap", "nowrap").style("white-space", "nowrap").on("dblclick", function() {
16824
+ addLocalFilterFromLib(d?.properties);
16825
+ }).on("mousemove", function() {
16816
16826
  if (chartFormatOptions.legends.onHoverEffect) {
16817
16827
  const hoverId = this.textContent.replace(/\s+/g, "-");
16818
16828
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
@@ -17080,7 +17090,7 @@ const marginCalculationsForChartsWithoutAxis = (chartFormatOptions, width, heigh
17080
17090
  logError$2(fileName$b, "marginCalculationsForChartsWithoutAxis", error);
17081
17091
  }
17082
17092
  };
17083
- const initLegendListWithTotalValueAllowance = (chartFormatOptions, svg, seriesData, width, height, legendListWidth, chartTitleHeight, chartId, margins, staticLegendShape2, shouldAllowTotalValueMargin = true) => {
17093
+ const initLegendListWithTotalValueAllowance = (chartFormatOptions, svg, seriesData, width, height, legendListWidth, chartTitleHeight, chartId, margins, staticLegendShape2, shouldAllowTotalValueMargin = true, addLocalFilterFromLib) => {
17084
17094
  try {
17085
17095
  let position = chartFormatOptions.legends.legendPosition;
17086
17096
  let totalPosition = chartFormatOptions.total.totalPosition;
@@ -17103,7 +17113,9 @@ const initLegendListWithTotalValueAllowance = (chartFormatOptions, svg, seriesDa
17103
17113
  verticalLegendAlignment,
17104
17114
  staticLegendShape2,
17105
17115
  chartFormatOptions,
17106
- chartId
17116
+ chartId,
17117
+ false,
17118
+ addLocalFilterFromLib
17107
17119
  );
17108
17120
  break;
17109
17121
  case staticLegendPosition.top:
@@ -17118,7 +17130,9 @@ const initLegendListWithTotalValueAllowance = (chartFormatOptions, svg, seriesDa
17118
17130
  horizontalLegendAlignment,
17119
17131
  staticLegendShape2,
17120
17132
  chartFormatOptions,
17121
- chartId
17133
+ chartId,
17134
+ false,
17135
+ addLocalFilterFromLib
17122
17136
  );
17123
17137
  break;
17124
17138
  case staticLegendPosition.left:
@@ -17133,7 +17147,9 @@ const initLegendListWithTotalValueAllowance = (chartFormatOptions, svg, seriesDa
17133
17147
  verticalLegendAlignment,
17134
17148
  staticLegendShape2,
17135
17149
  chartFormatOptions,
17136
- chartId
17150
+ chartId,
17151
+ false,
17152
+ addLocalFilterFromLib
17137
17153
  );
17138
17154
  break;
17139
17155
  case staticLegendPosition.bottom:
@@ -17148,7 +17164,9 @@ const initLegendListWithTotalValueAllowance = (chartFormatOptions, svg, seriesDa
17148
17164
  horizontalLegendAlignment,
17149
17165
  staticLegendShape2,
17150
17166
  chartFormatOptions,
17151
- chartId
17167
+ chartId,
17168
+ false,
17169
+ addLocalFilterFromLib
17152
17170
  );
17153
17171
  break;
17154
17172
  }
@@ -17382,7 +17400,8 @@ const ColumnChart = ({
17382
17400
  formatOptions,
17383
17401
  data,
17384
17402
  isReportEditable,
17385
- onDataLabelCoordinatesChange
17403
+ onDataLabelCoordinatesChange,
17404
+ addLocalFilterFromLib
17386
17405
  }) => {
17387
17406
  const chartId = crypto.randomUUID();
17388
17407
  let columnWidth = 0;
@@ -17598,7 +17617,9 @@ const ColumnChart = ({
17598
17617
  chartId,
17599
17618
  dataTableHeight,
17600
17619
  margin,
17601
- staticLegendShape.rectangle
17620
+ staticLegendShape.rectangle,
17621
+ chartType,
17622
+ addLocalFilterFromLib
17602
17623
  );
17603
17624
  horizontalScrollBar(
17604
17625
  seriesData,
@@ -17954,7 +17975,8 @@ const CustomColumnChart = ({
17954
17975
  formatOptions,
17955
17976
  data,
17956
17977
  isReportEditable,
17957
- onDataLabelCoordinatesChange
17978
+ onDataLabelCoordinatesChange,
17979
+ addLocalFilterFromLib
17958
17980
  }) => {
17959
17981
  const chartId = crypto.randomUUID();
17960
17982
  let columnWidth = 0;
@@ -18182,8 +18204,9 @@ const CustomColumnChart = ({
18182
18204
  chartId,
18183
18205
  dataTableHeight,
18184
18206
  margin,
18185
- null
18186
- // legendShape.rectangle
18207
+ null,
18208
+ chartType,
18209
+ addLocalFilterFromLib
18187
18210
  );
18188
18211
  horizontalScrollBar(
18189
18212
  seriesData,
@@ -19097,7 +19120,8 @@ const LayeredColumnChart = ({
19097
19120
  formatOptions,
19098
19121
  data,
19099
19122
  isReportEditable,
19100
- onDataLabelCoordinatesChange
19123
+ onDataLabelCoordinatesChange,
19124
+ addLocalFilterFromLib
19101
19125
  }) => {
19102
19126
  const chartId = crypto.randomUUID();
19103
19127
  let columnWidth = 0;
@@ -19300,7 +19324,9 @@ const LayeredColumnChart = ({
19300
19324
  chartId,
19301
19325
  dataTableHeight,
19302
19326
  margin,
19303
- staticLegendShape.rectangle
19327
+ staticLegendShape.rectangle,
19328
+ chartType,
19329
+ addLocalFilterFromLib
19304
19330
  );
19305
19331
  horizontalScrollBar(
19306
19332
  seriesData,
@@ -19651,7 +19677,8 @@ const StackColumnChart = ({
19651
19677
  formatOptions,
19652
19678
  data,
19653
19679
  isReportEditable,
19654
- onDataLabelCoordinatesChange
19680
+ onDataLabelCoordinatesChange,
19681
+ addLocalFilterFromLib
19655
19682
  }) => {
19656
19683
  const chartId = crypto.randomUUID();
19657
19684
  let columnWidth = 0;
@@ -19853,7 +19880,9 @@ const StackColumnChart = ({
19853
19880
  chartId,
19854
19881
  dataTableHeight,
19855
19882
  margin,
19856
- staticLegendShape.rectangle
19883
+ staticLegendShape.rectangle,
19884
+ chartType,
19885
+ addLocalFilterFromLib
19857
19886
  );
19858
19887
  horizontalScrollBar(
19859
19888
  seriesData,
@@ -20387,7 +20416,8 @@ const NormalizedStackColumnChart = ({
20387
20416
  formatOptions,
20388
20417
  data,
20389
20418
  isReportEditable,
20390
- onDataLabelCoordinatesChange
20419
+ onDataLabelCoordinatesChange,
20420
+ addLocalFilterFromLib
20391
20421
  }) => {
20392
20422
  const chartId = crypto.randomUUID();
20393
20423
  let columnWidth = 0;
@@ -20588,7 +20618,9 @@ const NormalizedStackColumnChart = ({
20588
20618
  chartId,
20589
20619
  dataTableHeight,
20590
20620
  margin,
20591
- staticLegendShape.rectangle
20621
+ staticLegendShape.rectangle,
20622
+ chartType,
20623
+ addLocalFilterFromLib
20592
20624
  );
20593
20625
  horizontalScrollBar(
20594
20626
  seriesData,
@@ -22223,7 +22255,8 @@ const LineChart = ({
22223
22255
  formatOptions,
22224
22256
  data,
22225
22257
  isReportEditable,
22226
- onDataLabelCoordinatesChange
22258
+ onDataLabelCoordinatesChange,
22259
+ addLocalFilterFromLib
22227
22260
  }) => {
22228
22261
  const chartId = crypto.randomUUID();
22229
22262
  const barWidth = 0;
@@ -22441,7 +22474,9 @@ const LineChart = ({
22441
22474
  chartId,
22442
22475
  dataTableHeight,
22443
22476
  margin,
22444
- staticLegendShape.line
22477
+ staticLegendShape.line,
22478
+ chartType,
22479
+ addLocalFilterFromLib
22445
22480
  );
22446
22481
  horizontalScrollBar(
22447
22482
  seriesData,
@@ -22796,7 +22831,8 @@ const StackLineChart = ({
22796
22831
  formatOptions,
22797
22832
  data,
22798
22833
  isReportEditable,
22799
- onDataLabelCoordinatesChange
22834
+ onDataLabelCoordinatesChange,
22835
+ addLocalFilterFromLib
22800
22836
  }) => {
22801
22837
  const chartId = crypto.randomUUID();
22802
22838
  const barWidth = 0;
@@ -22999,7 +23035,9 @@ const StackLineChart = ({
22999
23035
  chartId,
23000
23036
  dataTableHeight,
23001
23037
  margin,
23002
- staticLegendShape.line
23038
+ staticLegendShape.line,
23039
+ chartType,
23040
+ addLocalFilterFromLib
23003
23041
  );
23004
23042
  horizontalScrollBar(
23005
23043
  seriesData,
@@ -23381,7 +23419,8 @@ const NormalisedStackLineChart = ({
23381
23419
  formatOptions,
23382
23420
  data,
23383
23421
  isReportEditable,
23384
- onDataLabelCoordinatesChange
23422
+ onDataLabelCoordinatesChange,
23423
+ addLocalFilterFromLib
23385
23424
  }) => {
23386
23425
  const chartId = crypto.randomUUID();
23387
23426
  const barWidth = 0;
@@ -23575,7 +23614,9 @@ const NormalisedStackLineChart = ({
23575
23614
  chartId,
23576
23615
  dataTableHeight,
23577
23616
  margin,
23578
- staticLegendShape.line
23617
+ staticLegendShape.line,
23618
+ chartType,
23619
+ addLocalFilterFromLib
23579
23620
  );
23580
23621
  horizontalScrollBar(
23581
23622
  seriesData,
@@ -23909,7 +23950,8 @@ const HorizontalBarChart = ({
23909
23950
  formatOptions,
23910
23951
  data,
23911
23952
  isReportEditable,
23912
- onDataLabelCoordinatesChange
23953
+ onDataLabelCoordinatesChange,
23954
+ addLocalFilterFromLib
23913
23955
  }) => {
23914
23956
  const chartId = crypto.randomUUID();
23915
23957
  let columnWidth = 0;
@@ -24111,7 +24153,9 @@ const HorizontalBarChart = ({
24111
24153
  chartId,
24112
24154
  dataTableHeight,
24113
24155
  margin,
24114
- staticLegendShape.rectangle
24156
+ staticLegendShape.rectangle,
24157
+ chartType,
24158
+ addLocalFilterFromLib
24115
24159
  );
24116
24160
  horizontalScrollBar(
24117
24161
  seriesData,
@@ -24459,7 +24503,8 @@ const StackHorizontalChart = ({
24459
24503
  formatOptions,
24460
24504
  data,
24461
24505
  isReportEditable,
24462
- onDataLabelCoordinatesChange
24506
+ onDataLabelCoordinatesChange,
24507
+ addLocalFilterFromLib
24463
24508
  }) => {
24464
24509
  const chartId = crypto.randomUUID();
24465
24510
  let columnWidth = 0;
@@ -24633,7 +24678,9 @@ const StackHorizontalChart = ({
24633
24678
  chartId,
24634
24679
  0,
24635
24680
  margin,
24636
- staticLegendShape.rectangle
24681
+ staticLegendShape.rectangle,
24682
+ chartType,
24683
+ addLocalFilterFromLib
24637
24684
  );
24638
24685
  horizontalScrollBar(
24639
24686
  seriesData,
@@ -25181,7 +25228,8 @@ const NormalizedStackHorizontalBarChart = ({
25181
25228
  formatOptions,
25182
25229
  data,
25183
25230
  isReportEditable,
25184
- onDataLabelCoordinatesChange
25231
+ onDataLabelCoordinatesChange,
25232
+ addLocalFilterFromLib
25185
25233
  }) => {
25186
25234
  const chartId = crypto.randomUUID();
25187
25235
  let columnWidth = 0;
@@ -25354,7 +25402,9 @@ const NormalizedStackHorizontalBarChart = ({
25354
25402
  chartId,
25355
25403
  0,
25356
25404
  margin,
25357
- staticLegendShape.rectangle
25405
+ staticLegendShape.rectangle,
25406
+ chartType,
25407
+ addLocalFilterFromLib
25358
25408
  );
25359
25409
  horizontalScrollBar(
25360
25410
  seriesData,
@@ -25659,7 +25709,8 @@ const LayeredHorizontalBarChart = ({
25659
25709
  formatOptions,
25660
25710
  data,
25661
25711
  isReportEditable,
25662
- onDataLabelCoordinatesChange
25712
+ onDataLabelCoordinatesChange,
25713
+ addLocalFilterFromLib
25663
25714
  }) => {
25664
25715
  const chartId = crypto.randomUUID();
25665
25716
  let columnWidth = 0;
@@ -25831,7 +25882,9 @@ const LayeredHorizontalBarChart = ({
25831
25882
  chartId,
25832
25883
  0,
25833
25884
  margin,
25834
- staticLegendShape.rectangle
25885
+ staticLegendShape.rectangle,
25886
+ chartType,
25887
+ addLocalFilterFromLib
25835
25888
  );
25836
25889
  horizontalScrollBar(
25837
25890
  seriesData,
@@ -26873,7 +26926,8 @@ const AreaChart = ({
26873
26926
  formatOptions,
26874
26927
  data,
26875
26928
  isReportEditable,
26876
- onDataLabelCoordinatesChange
26929
+ onDataLabelCoordinatesChange,
26930
+ addLocalFilterFromLib
26877
26931
  }) => {
26878
26932
  const chartId = crypto.randomUUID();
26879
26933
  const barWidth = 0;
@@ -27089,7 +27143,9 @@ const AreaChart = ({
27089
27143
  chartId,
27090
27144
  dataTableHeight,
27091
27145
  margin,
27092
- staticLegendShape.areaWithLine
27146
+ staticLegendShape.areaWithLine,
27147
+ chartType,
27148
+ addLocalFilterFromLib
27093
27149
  );
27094
27150
  horizontalScrollBar(
27095
27151
  seriesData,
@@ -27463,7 +27519,8 @@ const StackAreaChart = ({
27463
27519
  formatOptions,
27464
27520
  data,
27465
27521
  isReportEditable,
27466
- onDataLabelCoordinatesChange
27522
+ onDataLabelCoordinatesChange,
27523
+ addLocalFilterFromLib
27467
27524
  }) => {
27468
27525
  const chartId = crypto.randomUUID();
27469
27526
  const barWidth = 0;
@@ -27666,7 +27723,9 @@ const StackAreaChart = ({
27666
27723
  chartId,
27667
27724
  dataTableHeight,
27668
27725
  margin,
27669
- staticLegendShape.areaWithLine
27726
+ staticLegendShape.areaWithLine,
27727
+ chartType,
27728
+ addLocalFilterFromLib
27670
27729
  );
27671
27730
  horizontalScrollBar(
27672
27731
  seriesData,
@@ -28063,7 +28122,8 @@ const NormalizedStackAreaChart = ({
28063
28122
  formatOptions,
28064
28123
  data,
28065
28124
  isReportEditable,
28066
- onDataLabelCoordinatesChange
28125
+ onDataLabelCoordinatesChange,
28126
+ addLocalFilterFromLib
28067
28127
  }) => {
28068
28128
  const chartId = crypto.randomUUID();
28069
28129
  const barWidth = 0;
@@ -28256,7 +28316,9 @@ const NormalizedStackAreaChart = ({
28256
28316
  chartId,
28257
28317
  dataTableHeight,
28258
28318
  margin,
28259
- staticLegendShape.areaWithLine
28319
+ staticLegendShape.areaWithLine,
28320
+ chartType,
28321
+ addLocalFilterFromLib
28260
28322
  );
28261
28323
  horizontalScrollBar(
28262
28324
  seriesData,
@@ -28720,7 +28782,7 @@ const drawTotalValue = (chartFormatOptions, totalValue, chartTitleHeight, chartA
28720
28782
  }
28721
28783
  };
28722
28784
  const fileName$8 = "PieChart.tsx";
28723
- const PieChart = ({ data, formatOptions, chartId, isReportEditable, onDataLabelCoordinatesChange }) => {
28785
+ const PieChart = ({ data, formatOptions, chartId, isReportEditable, onDataLabelCoordinatesChange, addLocalFilterFromLib }) => {
28724
28786
  const svgRef = useRef();
28725
28787
  const seriesData = generalizedChartData(data.ChartData);
28726
28788
  let chartFormatOptions;
@@ -28772,7 +28834,9 @@ const PieChart = ({ data, formatOptions, chartId, isReportEditable, onDataLabelC
28772
28834
  chartTitleHeight,
28773
28835
  chartId,
28774
28836
  margins,
28775
- staticLegendShape.circle
28837
+ staticLegendShape.circle,
28838
+ void 0,
28839
+ addLocalFilterFromLib
28776
28840
  );
28777
28841
  initPieChartData();
28778
28842
  drawPieChart();
@@ -29150,7 +29214,8 @@ const DonutChart = ({
29150
29214
  formatOptions,
29151
29215
  chartId,
29152
29216
  isReportEditable,
29153
- onDataLabelCoordinatesChange
29217
+ onDataLabelCoordinatesChange,
29218
+ addLocalFilterFromLib
29154
29219
  }) => {
29155
29220
  const svgRef = useRef();
29156
29221
  const seriesData = generalizedChartData(data.ChartData);
@@ -29205,7 +29270,8 @@ const DonutChart = ({
29205
29270
  chartId,
29206
29271
  margins,
29207
29272
  staticLegendShape.hollowCircle,
29208
- false
29273
+ false,
29274
+ addLocalFilterFromLib
29209
29275
  );
29210
29276
  initPieChartData();
29211
29277
  drawDonutChart();
@@ -30316,7 +30382,8 @@ const PyramidChart = ({
30316
30382
  data,
30317
30383
  formatOptions,
30318
30384
  chartId,
30319
- onDataLabelCoordinatesChange
30385
+ onDataLabelCoordinatesChange,
30386
+ addLocalFilterFromLib
30320
30387
  }) => {
30321
30388
  const svgRef = useRef();
30322
30389
  let seriesData = generalizedChartData(data.ChartData);
@@ -30370,7 +30437,8 @@ const PyramidChart = ({
30370
30437
  chartId,
30371
30438
  margins,
30372
30439
  staticLegendShape.rectangle,
30373
- false
30440
+ false,
30441
+ addLocalFilterFromLib
30374
30442
  );
30375
30443
  initPyramidData();
30376
30444
  drawPyramidChart();
@@ -30704,7 +30772,8 @@ const fileName$3 = "ProgressChart.tsx";
30704
30772
  const ProgressChart = ({
30705
30773
  data: { ChartData },
30706
30774
  formatOptions,
30707
- chartId
30775
+ chartId,
30776
+ addLocalFilterFromLib
30708
30777
  }) => {
30709
30778
  const svgRef = useRef();
30710
30779
  let seriesData = generalizedChartData(ChartData);
@@ -30757,7 +30826,9 @@ const ProgressChart = ({
30757
30826
  chartTitleHeight,
30758
30827
  chartId,
30759
30828
  margins,
30760
- staticLegendShape.hollowCircle
30829
+ staticLegendShape.hollowCircle,
30830
+ true,
30831
+ addLocalFilterFromLib
30761
30832
  );
30762
30833
  initProgressChartData();
30763
30834
  drawProgressChart();
@@ -31484,7 +31555,8 @@ function logError(fileName2, functionName, error) {
31484
31555
  const RadialBarChart = ({
31485
31556
  data: { ChartData },
31486
31557
  formatOptions,
31487
- chartId
31558
+ chartId,
31559
+ addLocalFilterFromLib
31488
31560
  }) => {
31489
31561
  const svgRef = useRef();
31490
31562
  const seriesData = generalizedChartData(ChartData);
@@ -31533,7 +31605,9 @@ const RadialBarChart = ({
31533
31605
  chartTitleHeight,
31534
31606
  chartId,
31535
31607
  margins,
31536
- staticLegendShape.hollowCircle
31608
+ staticLegendShape.hollowCircle,
31609
+ false,
31610
+ addLocalFilterFromLib
31537
31611
  );
31538
31612
  initRadialBarChart();
31539
31613
  };
@@ -54683,7 +54757,8 @@ const OrganizationChart = ({
54683
54757
  const BubbleChart = ({
54684
54758
  data,
54685
54759
  formatOptions,
54686
- chartId
54760
+ chartId,
54761
+ addLocalFilterFromLib
54687
54762
  }) => {
54688
54763
  let legendEntries = data.LegendList;
54689
54764
  const svgRef = useRef();
@@ -55097,7 +55172,9 @@ const BubbleChart = ({
55097
55172
  chartTitleHeight,
55098
55173
  chartId,
55099
55174
  margins,
55100
- staticLegendShape.circle
55175
+ staticLegendShape.circle,
55176
+ false,
55177
+ addLocalFilterFromLib
55101
55178
  );
55102
55179
  } catch (e) {
55103
55180
  logError$2("BubbleChart", "initLegendList", e);
@@ -57118,7 +57195,8 @@ const DotPlot = ({
57118
57195
  formatOptions,
57119
57196
  data,
57120
57197
  isReportEditable,
57121
- onDataLabelCoordinatesChange
57198
+ onDataLabelCoordinatesChange,
57199
+ addLocalFilterFromLib
57122
57200
  }) => {
57123
57201
  const chartId = crypto.randomUUID();
57124
57202
  let columnWidth = 0;
@@ -57289,7 +57367,9 @@ const DotPlot = ({
57289
57367
  chartId,
57290
57368
  0,
57291
57369
  margin,
57292
- staticLegendShape.rectangle
57370
+ staticLegendShape.rectangle,
57371
+ chartType,
57372
+ addLocalFilterFromLib
57293
57373
  );
57294
57374
  horizontalScrollBar(
57295
57375
  seriesData,
@@ -58043,9 +58123,14 @@ function formatValueForAxis(value2, displayUnits, decimalPrecision) {
58043
58123
  if (displayUnits === "Billions") return (value2 / 1e9).toFixed(precision) + "B";
58044
58124
  return value2.toFixed(precision);
58045
58125
  }
58046
- function mapFormatOptionsToChartJS(formatOptions, chartType, hasSecondaryAxis = false) {
58126
+ function findLegendFromAlias(legendList, alias) {
58127
+ return legendList.find((d) => d.alias == alias);
58128
+ }
58129
+ function mapFormatOptionsToChartJS(formatOptions, chartType, hasSecondaryAxis = false, addLocalFilterFromLib, legendList) {
58047
58130
  const isCircular = chartType === "pie" || chartType === "doughnut" || chartType === "polarArea";
58048
58131
  const isHorizontal = chartType === "horizontalBar";
58132
+ let lastClickTime = 0;
58133
+ const DOUBLE_CLICK_DELAY = 300;
58049
58134
  const gridColor = formatOptions.plotArea?.gridLinesColor ?? "#e0e0e0";
58050
58135
  const legendLabelColor = formatOptions.legends?.legendFontColor ?? "#333333";
58051
58136
  const opts = {
@@ -58070,6 +58155,21 @@ function mapFormatOptionsToChartJS(formatOptions, chartType, hasSecondaryAxis =
58070
58155
  usePointStyle: false,
58071
58156
  boxWidth: 12,
58072
58157
  padding: 16
58158
+ },
58159
+ onClick: function(e, legendItem, legend) {
58160
+ if (addLocalFilterFromLib) {
58161
+ const currentTime = (/* @__PURE__ */ new Date()).getTime();
58162
+ const timeDiff = currentTime - lastClickTime;
58163
+ if (timeDiff < DOUBLE_CLICK_DELAY) {
58164
+ const actualLegend = findLegendFromAlias(legendList, legendItem.text);
58165
+ if (actualLegend) {
58166
+ addLocalFilterFromLib(actualLegend);
58167
+ }
58168
+ lastClickTime = 0;
58169
+ } else {
58170
+ lastClickTime = currentTime;
58171
+ }
58172
+ }
58073
58173
  }
58074
58174
  },
58075
58175
  // ---- Tooltip ----
@@ -73471,9 +73571,14 @@ const CJSColumnChart = ({
73471
73571
  clientWidth = 0,
73472
73572
  clientHeight = 0,
73473
73573
  isChartStacked,
73474
- colorBank
73574
+ colorBank,
73475
73575
  //= CJS_DEFAULT_COLORS,
73576
+ addLocalFilterFromLib
73476
73577
  }) => {
73578
+ const legendList = useMemo(
73579
+ () => data.ChartData?.map((s2) => s2.properties),
73580
+ [data]
73581
+ );
73477
73582
  const hasSecondaryAxis = useMemo(
73478
73583
  () => data.ChartData?.some((s2) => s2.Axis === "Secondary" || s2.properties?.axis === "Secondary"),
73479
73584
  [data]
@@ -73483,7 +73588,7 @@ const CJSColumnChart = ({
73483
73588
  [data, formatOptions, colorBank]
73484
73589
  );
73485
73590
  const chartOptions = useMemo(() => {
73486
- const opts = mapFormatOptionsToChartJS(formatOptions, "bar", hasSecondaryAxis);
73591
+ const opts = mapFormatOptionsToChartJS(formatOptions, "bar", hasSecondaryAxis, addLocalFilterFromLib, legendList);
73487
73592
  if (isChartStacked) {
73488
73593
  opts.scales ??= {};
73489
73594
  opts.scales.x ??= {};
@@ -73512,8 +73617,13 @@ const CJSHorizontalBarChart = ({
73512
73617
  clientWidth = 0,
73513
73618
  clientHeight = 0,
73514
73619
  isChartStacked,
73515
- colorBank = CJS_DEFAULT_COLORS
73620
+ colorBank = CJS_DEFAULT_COLORS,
73621
+ addLocalFilterFromLib
73516
73622
  }) => {
73623
+ const legendList = useMemo(
73624
+ () => data.ChartData?.map((s2) => s2.properties),
73625
+ [data]
73626
+ );
73517
73627
  const hasSecondaryAxis = useMemo(
73518
73628
  () => data.ChartData?.some((s2) => s2.Axis === "Secondary" || s2.properties?.axis === "Secondary"),
73519
73629
  [data]
@@ -73523,7 +73633,7 @@ const CJSHorizontalBarChart = ({
73523
73633
  [data, formatOptions, colorBank]
73524
73634
  );
73525
73635
  const chartOptions = useMemo(() => {
73526
- const opts = mapFormatOptionsToChartJS(formatOptions, "horizontalBar", hasSecondaryAxis);
73636
+ const opts = mapFormatOptionsToChartJS(formatOptions, "horizontalBar", hasSecondaryAxis, addLocalFilterFromLib, legendList);
73527
73637
  opts.indexAxis = "y";
73528
73638
  if (isChartStacked) {
73529
73639
  opts.scales ??= {};
@@ -73553,8 +73663,13 @@ const CJSLineChart = ({
73553
73663
  clientWidth = 0,
73554
73664
  clientHeight = 0,
73555
73665
  isChartStacked,
73556
- colorBank = CJS_DEFAULT_COLORS
73666
+ colorBank = CJS_DEFAULT_COLORS,
73667
+ addLocalFilterFromLib
73557
73668
  }) => {
73669
+ const legendList = useMemo(
73670
+ () => data.ChartData?.map((s2) => s2.properties),
73671
+ [data]
73672
+ );
73558
73673
  const hasSecondaryAxis = useMemo(
73559
73674
  () => data.ChartData?.some((s2) => s2.Axis === "Secondary" || s2.properties?.axis === "Secondary"),
73560
73675
  [data]
@@ -73564,7 +73679,7 @@ const CJSLineChart = ({
73564
73679
  [data, formatOptions, colorBank]
73565
73680
  );
73566
73681
  const chartOptions = useMemo(() => {
73567
- const opts = mapFormatOptionsToChartJS(formatOptions, "line", hasSecondaryAxis);
73682
+ const opts = mapFormatOptionsToChartJS(formatOptions, "line", hasSecondaryAxis, addLocalFilterFromLib, legendList);
73568
73683
  if (isChartStacked) {
73569
73684
  opts.scales ??= {};
73570
73685
  opts.scales.y ??= {};
@@ -73591,8 +73706,13 @@ const CJSAreaChart = ({
73591
73706
  clientWidth = 0,
73592
73707
  clientHeight = 0,
73593
73708
  isChartStacked,
73594
- colorBank = CJS_DEFAULT_COLORS
73709
+ colorBank,
73710
+ addLocalFilterFromLib
73595
73711
  }) => {
73712
+ const legendList = useMemo(
73713
+ () => data.ChartData?.map((s2) => s2.properties),
73714
+ [data]
73715
+ );
73596
73716
  const hasSecondaryAxis = useMemo(
73597
73717
  () => data.ChartData?.some((s2) => s2.Axis === "Secondary" || s2.properties?.axis === "Secondary"),
73598
73718
  [data]
@@ -73602,7 +73722,7 @@ const CJSAreaChart = ({
73602
73722
  [data, formatOptions, colorBank]
73603
73723
  );
73604
73724
  const chartOptions = useMemo(() => {
73605
- const opts = mapFormatOptionsToChartJS(formatOptions, "area", hasSecondaryAxis);
73725
+ const opts = mapFormatOptionsToChartJS(formatOptions, "area", hasSecondaryAxis, addLocalFilterFromLib, legendList);
73606
73726
  if (isChartStacked) {
73607
73727
  opts.scales ??= {};
73608
73728
  opts.scales.y ??= {};
@@ -73628,14 +73748,19 @@ const CJSPieChart = ({
73628
73748
  formatOptions,
73629
73749
  clientWidth,
73630
73750
  clientHeight,
73631
- colorBank
73751
+ colorBank,
73752
+ addLocalFilterFromLib
73632
73753
  }) => {
73754
+ const legendList = useMemo(
73755
+ () => data.LegendList ?? [],
73756
+ [data]
73757
+ );
73633
73758
  const chartData = useMemo(
73634
73759
  () => transformToChartJSData(data, "pie", formatOptions, colorBank),
73635
73760
  [data, formatOptions, colorBank]
73636
73761
  );
73637
73762
  const chartOptions = useMemo(
73638
- () => mapFormatOptionsToChartJS(formatOptions, "pie", false),
73763
+ () => mapFormatOptionsToChartJS(formatOptions, "pie", false, addLocalFilterFromLib, legendList),
73639
73764
  [formatOptions]
73640
73765
  );
73641
73766
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -73655,14 +73780,19 @@ const CJSDonutChart = ({
73655
73780
  formatOptions,
73656
73781
  clientWidth,
73657
73782
  clientHeight,
73658
- colorBank = CJS_DEFAULT_COLORS
73783
+ colorBank = CJS_DEFAULT_COLORS,
73784
+ addLocalFilterFromLib
73659
73785
  }) => {
73786
+ const legendList = useMemo(
73787
+ () => data.LegendList ?? [],
73788
+ [data]
73789
+ );
73660
73790
  const chartData = useMemo(
73661
73791
  () => transformToChartJSData(data, "doughnut", formatOptions, colorBank),
73662
73792
  [data, formatOptions, colorBank]
73663
73793
  );
73664
73794
  const chartOptions = useMemo(() => {
73665
- const base = mapFormatOptionsToChartJS(formatOptions, "doughnut", false);
73795
+ const base = mapFormatOptionsToChartJS(formatOptions, "doughnut", false, addLocalFilterFromLib, legendList);
73666
73796
  const rawInner = formatOptions.plotArea?.innerRadius;
73667
73797
  if (rawInner !== void 0 && rawInner !== null) {
73668
73798
  base.cutout = `${rawInner}%`;
@@ -73713,14 +73843,19 @@ const CJSBubbleChart = ({
73713
73843
  formatOptions,
73714
73844
  clientWidth,
73715
73845
  clientHeight,
73716
- colorBank = CJS_DEFAULT_COLORS
73846
+ colorBank = CJS_DEFAULT_COLORS,
73847
+ addLocalFilterFromLib
73717
73848
  }) => {
73849
+ const legendList = useMemo(
73850
+ () => data.ChartData?.map((s2) => s2.properties),
73851
+ [data]
73852
+ );
73718
73853
  const chartData = useMemo(
73719
73854
  () => transformToChartJSData(data, "bubble", formatOptions, colorBank),
73720
73855
  [data, formatOptions, colorBank]
73721
73856
  );
73722
73857
  const chartOptions = useMemo(
73723
- () => mapFormatOptionsToChartJS(formatOptions, "bubble", false),
73858
+ () => mapFormatOptionsToChartJS(formatOptions, "bubble", false, addLocalFilterFromLib, legendList),
73724
73859
  [formatOptions]
73725
73860
  );
73726
73861
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -73788,15 +73923,20 @@ const CJSPolarAreaChart = ({
73788
73923
  formatOptions,
73789
73924
  clientWidth,
73790
73925
  clientHeight,
73791
- colorBank = CJS_DEFAULT_COLORS
73926
+ colorBank = CJS_DEFAULT_COLORS,
73927
+ addLocalFilterFromLib
73792
73928
  }) => {
73929
+ const legendList = useMemo(
73930
+ () => data.LegendList ?? [],
73931
+ [data]
73932
+ );
73793
73933
  const chartData = useMemo(
73794
73934
  // Reuse the circular builder (same shape as pie)
73795
73935
  () => transformToChartJSData(data, "polarArea", formatOptions, colorBank),
73796
73936
  [data, formatOptions, colorBank]
73797
73937
  );
73798
73938
  const chartOptions = useMemo(() => {
73799
- const opts = mapFormatOptionsToChartJS(formatOptions, "polarArea", false);
73939
+ const opts = mapFormatOptionsToChartJS(formatOptions, "polarArea", false, addLocalFilterFromLib, legendList);
73800
73940
  delete opts.scales;
73801
73941
  const xAxisFontStyle = formatOptions.xAxisLabel?.xAxisLabelFontStyle;
73802
73942
  const isItalic = Array.isArray(xAxisFontStyle) ? xAxisFontStyle.includes("Italic") || xAxisFontStyle.includes("italic") : false;
@@ -73837,8 +73977,13 @@ const CJSNormalizedStackColumnChart = ({
73837
73977
  formatOptions,
73838
73978
  clientWidth = 0,
73839
73979
  clientHeight = 0,
73840
- colorBank = CJS_DEFAULT_COLORS
73980
+ colorBank = CJS_DEFAULT_COLORS,
73981
+ addLocalFilterFromLib
73841
73982
  }) => {
73983
+ const legendList = useMemo(
73984
+ () => data.ChartData?.map((s2) => s2.properties),
73985
+ [data]
73986
+ );
73842
73987
  const chartData = useMemo(
73843
73988
  () => transformToNormalizedChartJSData(data, "bar", formatOptions, colorBank),
73844
73989
  [data, formatOptions, colorBank]
@@ -73848,7 +73993,7 @@ const CJSNormalizedStackColumnChart = ({
73848
73993
  [chartData]
73849
73994
  );
73850
73995
  const chartOptions = useMemo(() => {
73851
- const opts = mapFormatOptionsToChartJS(formatOptions, "bar", false);
73996
+ const opts = mapFormatOptionsToChartJS(formatOptions, "bar", false, addLocalFilterFromLib, legendList);
73852
73997
  opts.scales ??= {};
73853
73998
  opts.scales.x ??= {};
73854
73999
  opts.scales.y ??= {};
@@ -73879,8 +74024,13 @@ const CJSNormalizedStackHorizontalBarChart = ({
73879
74024
  formatOptions,
73880
74025
  clientWidth = 0,
73881
74026
  clientHeight = 0,
73882
- colorBank = CJS_DEFAULT_COLORS
74027
+ colorBank = CJS_DEFAULT_COLORS,
74028
+ addLocalFilterFromLib
73883
74029
  }) => {
74030
+ const legendList = useMemo(
74031
+ () => data.ChartData?.map((s2) => s2.properties),
74032
+ [data]
74033
+ );
73884
74034
  const chartData = useMemo(
73885
74035
  () => transformToNormalizedChartJSData(data, "horizontalBar", formatOptions, colorBank),
73886
74036
  [data, formatOptions, colorBank]
@@ -73890,7 +74040,7 @@ const CJSNormalizedStackHorizontalBarChart = ({
73890
74040
  [chartData]
73891
74041
  );
73892
74042
  const chartOptions = useMemo(() => {
73893
- const opts = mapFormatOptionsToChartJS(formatOptions, "horizontalBar", false);
74043
+ const opts = mapFormatOptionsToChartJS(formatOptions, "horizontalBar", false, addLocalFilterFromLib, legendList);
73894
74044
  opts.indexAxis = "y";
73895
74045
  opts.scales ??= {};
73896
74046
  opts.scales.x ??= {};
@@ -73922,8 +74072,13 @@ const CJSNormalizedStackLineChart = ({
73922
74072
  formatOptions,
73923
74073
  clientWidth = 0,
73924
74074
  clientHeight = 0,
73925
- colorBank = CJS_DEFAULT_COLORS
74075
+ colorBank = CJS_DEFAULT_COLORS,
74076
+ addLocalFilterFromLib
73926
74077
  }) => {
74078
+ const legendList = useMemo(
74079
+ () => data.ChartData?.map((s2) => s2.properties),
74080
+ [data]
74081
+ );
73927
74082
  const chartData = useMemo(
73928
74083
  () => transformToNormalizedChartJSData(data, "line", formatOptions, colorBank),
73929
74084
  [data, formatOptions, colorBank]
@@ -73933,7 +74088,7 @@ const CJSNormalizedStackLineChart = ({
73933
74088
  [chartData]
73934
74089
  );
73935
74090
  const chartOptions = useMemo(() => {
73936
- const opts = mapFormatOptionsToChartJS(formatOptions, "line", false);
74091
+ const opts = mapFormatOptionsToChartJS(formatOptions, "line", false, addLocalFilterFromLib, legendList);
73937
74092
  opts.scales ??= {};
73938
74093
  opts.scales.y ??= {};
73939
74094
  opts.scales.y.stacked = true;
@@ -73962,8 +74117,13 @@ const CJSNormalizedStackAreaChart = ({
73962
74117
  formatOptions,
73963
74118
  clientWidth = 0,
73964
74119
  clientHeight = 0,
73965
- colorBank = CJS_DEFAULT_COLORS
74120
+ colorBank = CJS_DEFAULT_COLORS,
74121
+ addLocalFilterFromLib
73966
74122
  }) => {
74123
+ const legendList = useMemo(
74124
+ () => data.ChartData?.map((s2) => s2.properties),
74125
+ [data]
74126
+ );
73967
74127
  const chartData = useMemo(
73968
74128
  () => transformToNormalizedChartJSData(data, "area", formatOptions, colorBank),
73969
74129
  [data, formatOptions, colorBank]
@@ -73973,7 +74133,7 @@ const CJSNormalizedStackAreaChart = ({
73973
74133
  [chartData]
73974
74134
  );
73975
74135
  const chartOptions = useMemo(() => {
73976
- const opts = mapFormatOptionsToChartJS(formatOptions, "area", false);
74136
+ const opts = mapFormatOptionsToChartJS(formatOptions, "area", false, addLocalFilterFromLib, legendList);
73977
74137
  opts.scales ??= {};
73978
74138
  opts.scales.y ??= {};
73979
74139
  opts.scales.y.stacked = true;