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.
@@ -16198,7 +16198,7 @@
16198
16198
  chartTypes.Speedometer,
16199
16199
  chartTypes.RadialBarChart
16200
16200
  ];
16201
- function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width, legendMargin, formatOptions, seriesData, chartId, dataTableHeight, margin, legendShape, chartType) {
16201
+ function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width, legendMargin, formatOptions, seriesData, chartId, dataTableHeight, margin, legendShape, chartType, addLocalFilterFromLib) {
16202
16202
  try {
16203
16203
  let position = formatOptions.legends.legendPosition;
16204
16204
  let horizontalLegendAlignment = formatOptions.legends.legendAlignmentTopBottom;
@@ -16220,7 +16220,9 @@
16220
16220
  verticalLegendAlignment,
16221
16221
  legendShape,
16222
16222
  formatOptions,
16223
- chartId
16223
+ chartId,
16224
+ false,
16225
+ addLocalFilterFromLib
16224
16226
  );
16225
16227
  break;
16226
16228
  case staticLegendPosition.top:
@@ -16235,7 +16237,9 @@
16235
16237
  horizontalLegendAlignment,
16236
16238
  legendShape,
16237
16239
  formatOptions,
16238
- chartId
16240
+ chartId,
16241
+ false,
16242
+ addLocalFilterFromLib
16239
16243
  );
16240
16244
  break;
16241
16245
  case staticLegendPosition.left:
@@ -16252,7 +16256,9 @@
16252
16256
  verticalLegendAlignment,
16253
16257
  legendShape,
16254
16258
  formatOptions,
16255
- chartId
16259
+ chartId,
16260
+ false,
16261
+ addLocalFilterFromLib
16256
16262
  );
16257
16263
  break;
16258
16264
  case staticLegendPosition.bottom:
@@ -16267,7 +16273,9 @@
16267
16273
  horizontalLegendAlignment,
16268
16274
  legendShape,
16269
16275
  formatOptions,
16270
- chartId
16276
+ chartId,
16277
+ false,
16278
+ addLocalFilterFromLib
16271
16279
  );
16272
16280
  break;
16273
16281
  }
@@ -16792,7 +16800,7 @@
16792
16800
  logError$2(fileName$b, "findStringWithLongestLength", error);
16793
16801
  }
16794
16802
  };
16795
- const legendsWithScroll = (svg, seriesData, x2, y2, width, height, legendPosition, alignment, legendShape, chartFormatOptions, chartId, isVennChart = false) => {
16803
+ const legendsWithScroll = (svg, seriesData, x2, y2, width, height, legendPosition, alignment, legendShape, chartFormatOptions, chartId, isVennChart = false, addLocalFilterFromLib) => {
16796
16804
  try {
16797
16805
  if (chartFormatOptions.legends.legendVisibility) {
16798
16806
  let justifyContent = "";
@@ -16815,7 +16823,9 @@
16815
16823
  if (legendPosition == staticLegendPosition.top || legendPosition == staticLegendPosition.bottom)
16816
16824
  div.style("flex-direction", "row");
16817
16825
  seriesData.forEach((d, i) => {
16818
- 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() {
16826
+ 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() {
16827
+ addLocalFilterFromLib(d?.properties);
16828
+ }).on("mousemove", function() {
16819
16829
  if (chartFormatOptions.legends.onHoverEffect) {
16820
16830
  const hoverId = this.textContent.replace(/\s+/g, "-");
16821
16831
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
@@ -17083,7 +17093,7 @@
17083
17093
  logError$2(fileName$b, "marginCalculationsForChartsWithoutAxis", error);
17084
17094
  }
17085
17095
  };
17086
- const initLegendListWithTotalValueAllowance = (chartFormatOptions, svg, seriesData, width, height, legendListWidth, chartTitleHeight, chartId, margins, staticLegendShape2, shouldAllowTotalValueMargin = true) => {
17096
+ const initLegendListWithTotalValueAllowance = (chartFormatOptions, svg, seriesData, width, height, legendListWidth, chartTitleHeight, chartId, margins, staticLegendShape2, shouldAllowTotalValueMargin = true, addLocalFilterFromLib) => {
17087
17097
  try {
17088
17098
  let position = chartFormatOptions.legends.legendPosition;
17089
17099
  let totalPosition = chartFormatOptions.total.totalPosition;
@@ -17106,7 +17116,9 @@
17106
17116
  verticalLegendAlignment,
17107
17117
  staticLegendShape2,
17108
17118
  chartFormatOptions,
17109
- chartId
17119
+ chartId,
17120
+ false,
17121
+ addLocalFilterFromLib
17110
17122
  );
17111
17123
  break;
17112
17124
  case staticLegendPosition.top:
@@ -17121,7 +17133,9 @@
17121
17133
  horizontalLegendAlignment,
17122
17134
  staticLegendShape2,
17123
17135
  chartFormatOptions,
17124
- chartId
17136
+ chartId,
17137
+ false,
17138
+ addLocalFilterFromLib
17125
17139
  );
17126
17140
  break;
17127
17141
  case staticLegendPosition.left:
@@ -17136,7 +17150,9 @@
17136
17150
  verticalLegendAlignment,
17137
17151
  staticLegendShape2,
17138
17152
  chartFormatOptions,
17139
- chartId
17153
+ chartId,
17154
+ false,
17155
+ addLocalFilterFromLib
17140
17156
  );
17141
17157
  break;
17142
17158
  case staticLegendPosition.bottom:
@@ -17151,7 +17167,9 @@
17151
17167
  horizontalLegendAlignment,
17152
17168
  staticLegendShape2,
17153
17169
  chartFormatOptions,
17154
- chartId
17170
+ chartId,
17171
+ false,
17172
+ addLocalFilterFromLib
17155
17173
  );
17156
17174
  break;
17157
17175
  }
@@ -17385,7 +17403,8 @@
17385
17403
  formatOptions,
17386
17404
  data,
17387
17405
  isReportEditable,
17388
- onDataLabelCoordinatesChange
17406
+ onDataLabelCoordinatesChange,
17407
+ addLocalFilterFromLib
17389
17408
  }) => {
17390
17409
  const chartId = crypto.randomUUID();
17391
17410
  let columnWidth = 0;
@@ -17601,7 +17620,9 @@
17601
17620
  chartId,
17602
17621
  dataTableHeight,
17603
17622
  margin,
17604
- staticLegendShape.rectangle
17623
+ staticLegendShape.rectangle,
17624
+ chartType,
17625
+ addLocalFilterFromLib
17605
17626
  );
17606
17627
  horizontalScrollBar(
17607
17628
  seriesData,
@@ -17957,7 +17978,8 @@
17957
17978
  formatOptions,
17958
17979
  data,
17959
17980
  isReportEditable,
17960
- onDataLabelCoordinatesChange
17981
+ onDataLabelCoordinatesChange,
17982
+ addLocalFilterFromLib
17961
17983
  }) => {
17962
17984
  const chartId = crypto.randomUUID();
17963
17985
  let columnWidth = 0;
@@ -18185,8 +18207,9 @@
18185
18207
  chartId,
18186
18208
  dataTableHeight,
18187
18209
  margin,
18188
- null
18189
- // legendShape.rectangle
18210
+ null,
18211
+ chartType,
18212
+ addLocalFilterFromLib
18190
18213
  );
18191
18214
  horizontalScrollBar(
18192
18215
  seriesData,
@@ -19100,7 +19123,8 @@
19100
19123
  formatOptions,
19101
19124
  data,
19102
19125
  isReportEditable,
19103
- onDataLabelCoordinatesChange
19126
+ onDataLabelCoordinatesChange,
19127
+ addLocalFilterFromLib
19104
19128
  }) => {
19105
19129
  const chartId = crypto.randomUUID();
19106
19130
  let columnWidth = 0;
@@ -19303,7 +19327,9 @@
19303
19327
  chartId,
19304
19328
  dataTableHeight,
19305
19329
  margin,
19306
- staticLegendShape.rectangle
19330
+ staticLegendShape.rectangle,
19331
+ chartType,
19332
+ addLocalFilterFromLib
19307
19333
  );
19308
19334
  horizontalScrollBar(
19309
19335
  seriesData,
@@ -19654,7 +19680,8 @@
19654
19680
  formatOptions,
19655
19681
  data,
19656
19682
  isReportEditable,
19657
- onDataLabelCoordinatesChange
19683
+ onDataLabelCoordinatesChange,
19684
+ addLocalFilterFromLib
19658
19685
  }) => {
19659
19686
  const chartId = crypto.randomUUID();
19660
19687
  let columnWidth = 0;
@@ -19856,7 +19883,9 @@
19856
19883
  chartId,
19857
19884
  dataTableHeight,
19858
19885
  margin,
19859
- staticLegendShape.rectangle
19886
+ staticLegendShape.rectangle,
19887
+ chartType,
19888
+ addLocalFilterFromLib
19860
19889
  );
19861
19890
  horizontalScrollBar(
19862
19891
  seriesData,
@@ -20390,7 +20419,8 @@
20390
20419
  formatOptions,
20391
20420
  data,
20392
20421
  isReportEditable,
20393
- onDataLabelCoordinatesChange
20422
+ onDataLabelCoordinatesChange,
20423
+ addLocalFilterFromLib
20394
20424
  }) => {
20395
20425
  const chartId = crypto.randomUUID();
20396
20426
  let columnWidth = 0;
@@ -20591,7 +20621,9 @@
20591
20621
  chartId,
20592
20622
  dataTableHeight,
20593
20623
  margin,
20594
- staticLegendShape.rectangle
20624
+ staticLegendShape.rectangle,
20625
+ chartType,
20626
+ addLocalFilterFromLib
20595
20627
  );
20596
20628
  horizontalScrollBar(
20597
20629
  seriesData,
@@ -22226,7 +22258,8 @@
22226
22258
  formatOptions,
22227
22259
  data,
22228
22260
  isReportEditable,
22229
- onDataLabelCoordinatesChange
22261
+ onDataLabelCoordinatesChange,
22262
+ addLocalFilterFromLib
22230
22263
  }) => {
22231
22264
  const chartId = crypto.randomUUID();
22232
22265
  const barWidth = 0;
@@ -22444,7 +22477,9 @@
22444
22477
  chartId,
22445
22478
  dataTableHeight,
22446
22479
  margin,
22447
- staticLegendShape.line
22480
+ staticLegendShape.line,
22481
+ chartType,
22482
+ addLocalFilterFromLib
22448
22483
  );
22449
22484
  horizontalScrollBar(
22450
22485
  seriesData,
@@ -22799,7 +22834,8 @@
22799
22834
  formatOptions,
22800
22835
  data,
22801
22836
  isReportEditable,
22802
- onDataLabelCoordinatesChange
22837
+ onDataLabelCoordinatesChange,
22838
+ addLocalFilterFromLib
22803
22839
  }) => {
22804
22840
  const chartId = crypto.randomUUID();
22805
22841
  const barWidth = 0;
@@ -23002,7 +23038,9 @@
23002
23038
  chartId,
23003
23039
  dataTableHeight,
23004
23040
  margin,
23005
- staticLegendShape.line
23041
+ staticLegendShape.line,
23042
+ chartType,
23043
+ addLocalFilterFromLib
23006
23044
  );
23007
23045
  horizontalScrollBar(
23008
23046
  seriesData,
@@ -23384,7 +23422,8 @@
23384
23422
  formatOptions,
23385
23423
  data,
23386
23424
  isReportEditable,
23387
- onDataLabelCoordinatesChange
23425
+ onDataLabelCoordinatesChange,
23426
+ addLocalFilterFromLib
23388
23427
  }) => {
23389
23428
  const chartId = crypto.randomUUID();
23390
23429
  const barWidth = 0;
@@ -23578,7 +23617,9 @@
23578
23617
  chartId,
23579
23618
  dataTableHeight,
23580
23619
  margin,
23581
- staticLegendShape.line
23620
+ staticLegendShape.line,
23621
+ chartType,
23622
+ addLocalFilterFromLib
23582
23623
  );
23583
23624
  horizontalScrollBar(
23584
23625
  seriesData,
@@ -23912,7 +23953,8 @@
23912
23953
  formatOptions,
23913
23954
  data,
23914
23955
  isReportEditable,
23915
- onDataLabelCoordinatesChange
23956
+ onDataLabelCoordinatesChange,
23957
+ addLocalFilterFromLib
23916
23958
  }) => {
23917
23959
  const chartId = crypto.randomUUID();
23918
23960
  let columnWidth = 0;
@@ -24114,7 +24156,9 @@
24114
24156
  chartId,
24115
24157
  dataTableHeight,
24116
24158
  margin,
24117
- staticLegendShape.rectangle
24159
+ staticLegendShape.rectangle,
24160
+ chartType,
24161
+ addLocalFilterFromLib
24118
24162
  );
24119
24163
  horizontalScrollBar(
24120
24164
  seriesData,
@@ -24462,7 +24506,8 @@
24462
24506
  formatOptions,
24463
24507
  data,
24464
24508
  isReportEditable,
24465
- onDataLabelCoordinatesChange
24509
+ onDataLabelCoordinatesChange,
24510
+ addLocalFilterFromLib
24466
24511
  }) => {
24467
24512
  const chartId = crypto.randomUUID();
24468
24513
  let columnWidth = 0;
@@ -24636,7 +24681,9 @@
24636
24681
  chartId,
24637
24682
  0,
24638
24683
  margin,
24639
- staticLegendShape.rectangle
24684
+ staticLegendShape.rectangle,
24685
+ chartType,
24686
+ addLocalFilterFromLib
24640
24687
  );
24641
24688
  horizontalScrollBar(
24642
24689
  seriesData,
@@ -25184,7 +25231,8 @@
25184
25231
  formatOptions,
25185
25232
  data,
25186
25233
  isReportEditable,
25187
- onDataLabelCoordinatesChange
25234
+ onDataLabelCoordinatesChange,
25235
+ addLocalFilterFromLib
25188
25236
  }) => {
25189
25237
  const chartId = crypto.randomUUID();
25190
25238
  let columnWidth = 0;
@@ -25357,7 +25405,9 @@
25357
25405
  chartId,
25358
25406
  0,
25359
25407
  margin,
25360
- staticLegendShape.rectangle
25408
+ staticLegendShape.rectangle,
25409
+ chartType,
25410
+ addLocalFilterFromLib
25361
25411
  );
25362
25412
  horizontalScrollBar(
25363
25413
  seriesData,
@@ -25662,7 +25712,8 @@
25662
25712
  formatOptions,
25663
25713
  data,
25664
25714
  isReportEditable,
25665
- onDataLabelCoordinatesChange
25715
+ onDataLabelCoordinatesChange,
25716
+ addLocalFilterFromLib
25666
25717
  }) => {
25667
25718
  const chartId = crypto.randomUUID();
25668
25719
  let columnWidth = 0;
@@ -25834,7 +25885,9 @@
25834
25885
  chartId,
25835
25886
  0,
25836
25887
  margin,
25837
- staticLegendShape.rectangle
25888
+ staticLegendShape.rectangle,
25889
+ chartType,
25890
+ addLocalFilterFromLib
25838
25891
  );
25839
25892
  horizontalScrollBar(
25840
25893
  seriesData,
@@ -26876,7 +26929,8 @@
26876
26929
  formatOptions,
26877
26930
  data,
26878
26931
  isReportEditable,
26879
- onDataLabelCoordinatesChange
26932
+ onDataLabelCoordinatesChange,
26933
+ addLocalFilterFromLib
26880
26934
  }) => {
26881
26935
  const chartId = crypto.randomUUID();
26882
26936
  const barWidth = 0;
@@ -27092,7 +27146,9 @@
27092
27146
  chartId,
27093
27147
  dataTableHeight,
27094
27148
  margin,
27095
- staticLegendShape.areaWithLine
27149
+ staticLegendShape.areaWithLine,
27150
+ chartType,
27151
+ addLocalFilterFromLib
27096
27152
  );
27097
27153
  horizontalScrollBar(
27098
27154
  seriesData,
@@ -27466,7 +27522,8 @@
27466
27522
  formatOptions,
27467
27523
  data,
27468
27524
  isReportEditable,
27469
- onDataLabelCoordinatesChange
27525
+ onDataLabelCoordinatesChange,
27526
+ addLocalFilterFromLib
27470
27527
  }) => {
27471
27528
  const chartId = crypto.randomUUID();
27472
27529
  const barWidth = 0;
@@ -27669,7 +27726,9 @@
27669
27726
  chartId,
27670
27727
  dataTableHeight,
27671
27728
  margin,
27672
- staticLegendShape.areaWithLine
27729
+ staticLegendShape.areaWithLine,
27730
+ chartType,
27731
+ addLocalFilterFromLib
27673
27732
  );
27674
27733
  horizontalScrollBar(
27675
27734
  seriesData,
@@ -28066,7 +28125,8 @@
28066
28125
  formatOptions,
28067
28126
  data,
28068
28127
  isReportEditable,
28069
- onDataLabelCoordinatesChange
28128
+ onDataLabelCoordinatesChange,
28129
+ addLocalFilterFromLib
28070
28130
  }) => {
28071
28131
  const chartId = crypto.randomUUID();
28072
28132
  const barWidth = 0;
@@ -28259,7 +28319,9 @@
28259
28319
  chartId,
28260
28320
  dataTableHeight,
28261
28321
  margin,
28262
- staticLegendShape.areaWithLine
28322
+ staticLegendShape.areaWithLine,
28323
+ chartType,
28324
+ addLocalFilterFromLib
28263
28325
  );
28264
28326
  horizontalScrollBar(
28265
28327
  seriesData,
@@ -28723,7 +28785,7 @@
28723
28785
  }
28724
28786
  };
28725
28787
  const fileName$8 = "PieChart.tsx";
28726
- const PieChart = ({ data, formatOptions, chartId, isReportEditable, onDataLabelCoordinatesChange }) => {
28788
+ const PieChart = ({ data, formatOptions, chartId, isReportEditable, onDataLabelCoordinatesChange, addLocalFilterFromLib }) => {
28727
28789
  const svgRef = require$$0$1.useRef();
28728
28790
  const seriesData = generalizedChartData(data.ChartData);
28729
28791
  let chartFormatOptions;
@@ -28775,7 +28837,9 @@
28775
28837
  chartTitleHeight,
28776
28838
  chartId,
28777
28839
  margins,
28778
- staticLegendShape.circle
28840
+ staticLegendShape.circle,
28841
+ void 0,
28842
+ addLocalFilterFromLib
28779
28843
  );
28780
28844
  initPieChartData();
28781
28845
  drawPieChart();
@@ -29153,7 +29217,8 @@
29153
29217
  formatOptions,
29154
29218
  chartId,
29155
29219
  isReportEditable,
29156
- onDataLabelCoordinatesChange
29220
+ onDataLabelCoordinatesChange,
29221
+ addLocalFilterFromLib
29157
29222
  }) => {
29158
29223
  const svgRef = require$$0$1.useRef();
29159
29224
  const seriesData = generalizedChartData(data.ChartData);
@@ -29208,7 +29273,8 @@
29208
29273
  chartId,
29209
29274
  margins,
29210
29275
  staticLegendShape.hollowCircle,
29211
- false
29276
+ false,
29277
+ addLocalFilterFromLib
29212
29278
  );
29213
29279
  initPieChartData();
29214
29280
  drawDonutChart();
@@ -30319,7 +30385,8 @@
30319
30385
  data,
30320
30386
  formatOptions,
30321
30387
  chartId,
30322
- onDataLabelCoordinatesChange
30388
+ onDataLabelCoordinatesChange,
30389
+ addLocalFilterFromLib
30323
30390
  }) => {
30324
30391
  const svgRef = require$$0$1.useRef();
30325
30392
  let seriesData = generalizedChartData(data.ChartData);
@@ -30373,7 +30440,8 @@
30373
30440
  chartId,
30374
30441
  margins,
30375
30442
  staticLegendShape.rectangle,
30376
- false
30443
+ false,
30444
+ addLocalFilterFromLib
30377
30445
  );
30378
30446
  initPyramidData();
30379
30447
  drawPyramidChart();
@@ -30707,7 +30775,8 @@
30707
30775
  const ProgressChart = ({
30708
30776
  data: { ChartData },
30709
30777
  formatOptions,
30710
- chartId
30778
+ chartId,
30779
+ addLocalFilterFromLib
30711
30780
  }) => {
30712
30781
  const svgRef = require$$0$1.useRef();
30713
30782
  let seriesData = generalizedChartData(ChartData);
@@ -30760,7 +30829,9 @@
30760
30829
  chartTitleHeight,
30761
30830
  chartId,
30762
30831
  margins,
30763
- staticLegendShape.hollowCircle
30832
+ staticLegendShape.hollowCircle,
30833
+ true,
30834
+ addLocalFilterFromLib
30764
30835
  );
30765
30836
  initProgressChartData();
30766
30837
  drawProgressChart();
@@ -31487,7 +31558,8 @@
31487
31558
  const RadialBarChart = ({
31488
31559
  data: { ChartData },
31489
31560
  formatOptions,
31490
- chartId
31561
+ chartId,
31562
+ addLocalFilterFromLib
31491
31563
  }) => {
31492
31564
  const svgRef = require$$0$1.useRef();
31493
31565
  const seriesData = generalizedChartData(ChartData);
@@ -31536,7 +31608,9 @@
31536
31608
  chartTitleHeight,
31537
31609
  chartId,
31538
31610
  margins,
31539
- staticLegendShape.hollowCircle
31611
+ staticLegendShape.hollowCircle,
31612
+ false,
31613
+ addLocalFilterFromLib
31540
31614
  );
31541
31615
  initRadialBarChart();
31542
31616
  };
@@ -54686,7 +54760,8 @@
54686
54760
  const BubbleChart = ({
54687
54761
  data,
54688
54762
  formatOptions,
54689
- chartId
54763
+ chartId,
54764
+ addLocalFilterFromLib
54690
54765
  }) => {
54691
54766
  let legendEntries = data.LegendList;
54692
54767
  const svgRef = require$$0$1.useRef();
@@ -55100,7 +55175,9 @@
55100
55175
  chartTitleHeight,
55101
55176
  chartId,
55102
55177
  margins,
55103
- staticLegendShape.circle
55178
+ staticLegendShape.circle,
55179
+ false,
55180
+ addLocalFilterFromLib
55104
55181
  );
55105
55182
  } catch (e) {
55106
55183
  logError$2("BubbleChart", "initLegendList", e);
@@ -57121,7 +57198,8 @@
57121
57198
  formatOptions,
57122
57199
  data,
57123
57200
  isReportEditable,
57124
- onDataLabelCoordinatesChange
57201
+ onDataLabelCoordinatesChange,
57202
+ addLocalFilterFromLib
57125
57203
  }) => {
57126
57204
  const chartId = crypto.randomUUID();
57127
57205
  let columnWidth = 0;
@@ -57292,7 +57370,9 @@
57292
57370
  chartId,
57293
57371
  0,
57294
57372
  margin,
57295
- staticLegendShape.rectangle
57373
+ staticLegendShape.rectangle,
57374
+ chartType,
57375
+ addLocalFilterFromLib
57296
57376
  );
57297
57377
  horizontalScrollBar(
57298
57378
  seriesData,
@@ -58046,9 +58126,14 @@
58046
58126
  if (displayUnits === "Billions") return (value2 / 1e9).toFixed(precision) + "B";
58047
58127
  return value2.toFixed(precision);
58048
58128
  }
58049
- function mapFormatOptionsToChartJS(formatOptions, chartType, hasSecondaryAxis = false) {
58129
+ function findLegendFromAlias(legendList, alias) {
58130
+ return legendList.find((d) => d.alias == alias);
58131
+ }
58132
+ function mapFormatOptionsToChartJS(formatOptions, chartType, hasSecondaryAxis = false, addLocalFilterFromLib, legendList) {
58050
58133
  const isCircular = chartType === "pie" || chartType === "doughnut" || chartType === "polarArea";
58051
58134
  const isHorizontal = chartType === "horizontalBar";
58135
+ let lastClickTime = 0;
58136
+ const DOUBLE_CLICK_DELAY = 300;
58052
58137
  const gridColor = formatOptions.plotArea?.gridLinesColor ?? "#e0e0e0";
58053
58138
  const legendLabelColor = formatOptions.legends?.legendFontColor ?? "#333333";
58054
58139
  const opts = {
@@ -58073,6 +58158,21 @@
58073
58158
  usePointStyle: false,
58074
58159
  boxWidth: 12,
58075
58160
  padding: 16
58161
+ },
58162
+ onClick: function(e, legendItem, legend) {
58163
+ if (addLocalFilterFromLib) {
58164
+ const currentTime = (/* @__PURE__ */ new Date()).getTime();
58165
+ const timeDiff = currentTime - lastClickTime;
58166
+ if (timeDiff < DOUBLE_CLICK_DELAY) {
58167
+ const actualLegend = findLegendFromAlias(legendList, legendItem.text);
58168
+ if (actualLegend) {
58169
+ addLocalFilterFromLib(actualLegend);
58170
+ }
58171
+ lastClickTime = 0;
58172
+ } else {
58173
+ lastClickTime = currentTime;
58174
+ }
58175
+ }
58076
58176
  }
58077
58177
  },
58078
58178
  // ---- Tooltip ----
@@ -73474,9 +73574,14 @@ ${formattedValue}` : formattedValue;
73474
73574
  clientWidth = 0,
73475
73575
  clientHeight = 0,
73476
73576
  isChartStacked,
73477
- colorBank
73577
+ colorBank,
73478
73578
  //= CJS_DEFAULT_COLORS,
73579
+ addLocalFilterFromLib
73479
73580
  }) => {
73581
+ const legendList = require$$0$1.useMemo(
73582
+ () => data.ChartData?.map((s2) => s2.properties),
73583
+ [data]
73584
+ );
73480
73585
  const hasSecondaryAxis = require$$0$1.useMemo(
73481
73586
  () => data.ChartData?.some((s2) => s2.Axis === "Secondary" || s2.properties?.axis === "Secondary"),
73482
73587
  [data]
@@ -73486,7 +73591,7 @@ ${formattedValue}` : formattedValue;
73486
73591
  [data, formatOptions, colorBank]
73487
73592
  );
73488
73593
  const chartOptions = require$$0$1.useMemo(() => {
73489
- const opts = mapFormatOptionsToChartJS(formatOptions, "bar", hasSecondaryAxis);
73594
+ const opts = mapFormatOptionsToChartJS(formatOptions, "bar", hasSecondaryAxis, addLocalFilterFromLib, legendList);
73490
73595
  if (isChartStacked) {
73491
73596
  opts.scales ??= {};
73492
73597
  opts.scales.x ??= {};
@@ -73515,8 +73620,13 @@ ${formattedValue}` : formattedValue;
73515
73620
  clientWidth = 0,
73516
73621
  clientHeight = 0,
73517
73622
  isChartStacked,
73518
- colorBank = CJS_DEFAULT_COLORS
73623
+ colorBank = CJS_DEFAULT_COLORS,
73624
+ addLocalFilterFromLib
73519
73625
  }) => {
73626
+ const legendList = require$$0$1.useMemo(
73627
+ () => data.ChartData?.map((s2) => s2.properties),
73628
+ [data]
73629
+ );
73520
73630
  const hasSecondaryAxis = require$$0$1.useMemo(
73521
73631
  () => data.ChartData?.some((s2) => s2.Axis === "Secondary" || s2.properties?.axis === "Secondary"),
73522
73632
  [data]
@@ -73526,7 +73636,7 @@ ${formattedValue}` : formattedValue;
73526
73636
  [data, formatOptions, colorBank]
73527
73637
  );
73528
73638
  const chartOptions = require$$0$1.useMemo(() => {
73529
- const opts = mapFormatOptionsToChartJS(formatOptions, "horizontalBar", hasSecondaryAxis);
73639
+ const opts = mapFormatOptionsToChartJS(formatOptions, "horizontalBar", hasSecondaryAxis, addLocalFilterFromLib, legendList);
73530
73640
  opts.indexAxis = "y";
73531
73641
  if (isChartStacked) {
73532
73642
  opts.scales ??= {};
@@ -73556,8 +73666,13 @@ ${formattedValue}` : formattedValue;
73556
73666
  clientWidth = 0,
73557
73667
  clientHeight = 0,
73558
73668
  isChartStacked,
73559
- colorBank = CJS_DEFAULT_COLORS
73669
+ colorBank = CJS_DEFAULT_COLORS,
73670
+ addLocalFilterFromLib
73560
73671
  }) => {
73672
+ const legendList = require$$0$1.useMemo(
73673
+ () => data.ChartData?.map((s2) => s2.properties),
73674
+ [data]
73675
+ );
73561
73676
  const hasSecondaryAxis = require$$0$1.useMemo(
73562
73677
  () => data.ChartData?.some((s2) => s2.Axis === "Secondary" || s2.properties?.axis === "Secondary"),
73563
73678
  [data]
@@ -73567,7 +73682,7 @@ ${formattedValue}` : formattedValue;
73567
73682
  [data, formatOptions, colorBank]
73568
73683
  );
73569
73684
  const chartOptions = require$$0$1.useMemo(() => {
73570
- const opts = mapFormatOptionsToChartJS(formatOptions, "line", hasSecondaryAxis);
73685
+ const opts = mapFormatOptionsToChartJS(formatOptions, "line", hasSecondaryAxis, addLocalFilterFromLib, legendList);
73571
73686
  if (isChartStacked) {
73572
73687
  opts.scales ??= {};
73573
73688
  opts.scales.y ??= {};
@@ -73594,8 +73709,13 @@ ${formattedValue}` : formattedValue;
73594
73709
  clientWidth = 0,
73595
73710
  clientHeight = 0,
73596
73711
  isChartStacked,
73597
- colorBank = CJS_DEFAULT_COLORS
73712
+ colorBank,
73713
+ addLocalFilterFromLib
73598
73714
  }) => {
73715
+ const legendList = require$$0$1.useMemo(
73716
+ () => data.ChartData?.map((s2) => s2.properties),
73717
+ [data]
73718
+ );
73599
73719
  const hasSecondaryAxis = require$$0$1.useMemo(
73600
73720
  () => data.ChartData?.some((s2) => s2.Axis === "Secondary" || s2.properties?.axis === "Secondary"),
73601
73721
  [data]
@@ -73605,7 +73725,7 @@ ${formattedValue}` : formattedValue;
73605
73725
  [data, formatOptions, colorBank]
73606
73726
  );
73607
73727
  const chartOptions = require$$0$1.useMemo(() => {
73608
- const opts = mapFormatOptionsToChartJS(formatOptions, "area", hasSecondaryAxis);
73728
+ const opts = mapFormatOptionsToChartJS(formatOptions, "area", hasSecondaryAxis, addLocalFilterFromLib, legendList);
73609
73729
  if (isChartStacked) {
73610
73730
  opts.scales ??= {};
73611
73731
  opts.scales.y ??= {};
@@ -73631,14 +73751,19 @@ ${formattedValue}` : formattedValue;
73631
73751
  formatOptions,
73632
73752
  clientWidth,
73633
73753
  clientHeight,
73634
- colorBank
73754
+ colorBank,
73755
+ addLocalFilterFromLib
73635
73756
  }) => {
73757
+ const legendList = require$$0$1.useMemo(
73758
+ () => data.LegendList ?? [],
73759
+ [data]
73760
+ );
73636
73761
  const chartData = require$$0$1.useMemo(
73637
73762
  () => transformToChartJSData(data, "pie", formatOptions, colorBank),
73638
73763
  [data, formatOptions, colorBank]
73639
73764
  );
73640
73765
  const chartOptions = require$$0$1.useMemo(
73641
- () => mapFormatOptionsToChartJS(formatOptions, "pie", false),
73766
+ () => mapFormatOptionsToChartJS(formatOptions, "pie", false, addLocalFilterFromLib, legendList),
73642
73767
  [formatOptions]
73643
73768
  );
73644
73769
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -73658,14 +73783,19 @@ ${formattedValue}` : formattedValue;
73658
73783
  formatOptions,
73659
73784
  clientWidth,
73660
73785
  clientHeight,
73661
- colorBank = CJS_DEFAULT_COLORS
73786
+ colorBank = CJS_DEFAULT_COLORS,
73787
+ addLocalFilterFromLib
73662
73788
  }) => {
73789
+ const legendList = require$$0$1.useMemo(
73790
+ () => data.LegendList ?? [],
73791
+ [data]
73792
+ );
73663
73793
  const chartData = require$$0$1.useMemo(
73664
73794
  () => transformToChartJSData(data, "doughnut", formatOptions, colorBank),
73665
73795
  [data, formatOptions, colorBank]
73666
73796
  );
73667
73797
  const chartOptions = require$$0$1.useMemo(() => {
73668
- const base = mapFormatOptionsToChartJS(formatOptions, "doughnut", false);
73798
+ const base = mapFormatOptionsToChartJS(formatOptions, "doughnut", false, addLocalFilterFromLib, legendList);
73669
73799
  const rawInner = formatOptions.plotArea?.innerRadius;
73670
73800
  if (rawInner !== void 0 && rawInner !== null) {
73671
73801
  base.cutout = `${rawInner}%`;
@@ -73716,14 +73846,19 @@ ${formattedValue}` : formattedValue;
73716
73846
  formatOptions,
73717
73847
  clientWidth,
73718
73848
  clientHeight,
73719
- colorBank = CJS_DEFAULT_COLORS
73849
+ colorBank = CJS_DEFAULT_COLORS,
73850
+ addLocalFilterFromLib
73720
73851
  }) => {
73852
+ const legendList = require$$0$1.useMemo(
73853
+ () => data.ChartData?.map((s2) => s2.properties),
73854
+ [data]
73855
+ );
73721
73856
  const chartData = require$$0$1.useMemo(
73722
73857
  () => transformToChartJSData(data, "bubble", formatOptions, colorBank),
73723
73858
  [data, formatOptions, colorBank]
73724
73859
  );
73725
73860
  const chartOptions = require$$0$1.useMemo(
73726
- () => mapFormatOptionsToChartJS(formatOptions, "bubble", false),
73861
+ () => mapFormatOptionsToChartJS(formatOptions, "bubble", false, addLocalFilterFromLib, legendList),
73727
73862
  [formatOptions]
73728
73863
  );
73729
73864
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -73791,15 +73926,20 @@ ${formattedValue}` : formattedValue;
73791
73926
  formatOptions,
73792
73927
  clientWidth,
73793
73928
  clientHeight,
73794
- colorBank = CJS_DEFAULT_COLORS
73929
+ colorBank = CJS_DEFAULT_COLORS,
73930
+ addLocalFilterFromLib
73795
73931
  }) => {
73932
+ const legendList = require$$0$1.useMemo(
73933
+ () => data.LegendList ?? [],
73934
+ [data]
73935
+ );
73796
73936
  const chartData = require$$0$1.useMemo(
73797
73937
  // Reuse the circular builder (same shape as pie)
73798
73938
  () => transformToChartJSData(data, "polarArea", formatOptions, colorBank),
73799
73939
  [data, formatOptions, colorBank]
73800
73940
  );
73801
73941
  const chartOptions = require$$0$1.useMemo(() => {
73802
- const opts = mapFormatOptionsToChartJS(formatOptions, "polarArea", false);
73942
+ const opts = mapFormatOptionsToChartJS(formatOptions, "polarArea", false, addLocalFilterFromLib, legendList);
73803
73943
  delete opts.scales;
73804
73944
  const xAxisFontStyle = formatOptions.xAxisLabel?.xAxisLabelFontStyle;
73805
73945
  const isItalic = Array.isArray(xAxisFontStyle) ? xAxisFontStyle.includes("Italic") || xAxisFontStyle.includes("italic") : false;
@@ -73840,8 +73980,13 @@ ${formattedValue}` : formattedValue;
73840
73980
  formatOptions,
73841
73981
  clientWidth = 0,
73842
73982
  clientHeight = 0,
73843
- colorBank = CJS_DEFAULT_COLORS
73983
+ colorBank = CJS_DEFAULT_COLORS,
73984
+ addLocalFilterFromLib
73844
73985
  }) => {
73986
+ const legendList = require$$0$1.useMemo(
73987
+ () => data.ChartData?.map((s2) => s2.properties),
73988
+ [data]
73989
+ );
73845
73990
  const chartData = require$$0$1.useMemo(
73846
73991
  () => transformToNormalizedChartJSData(data, "bar", formatOptions, colorBank),
73847
73992
  [data, formatOptions, colorBank]
@@ -73851,7 +73996,7 @@ ${formattedValue}` : formattedValue;
73851
73996
  [chartData]
73852
73997
  );
73853
73998
  const chartOptions = require$$0$1.useMemo(() => {
73854
- const opts = mapFormatOptionsToChartJS(formatOptions, "bar", false);
73999
+ const opts = mapFormatOptionsToChartJS(formatOptions, "bar", false, addLocalFilterFromLib, legendList);
73855
74000
  opts.scales ??= {};
73856
74001
  opts.scales.x ??= {};
73857
74002
  opts.scales.y ??= {};
@@ -73882,8 +74027,13 @@ ${formattedValue}` : formattedValue;
73882
74027
  formatOptions,
73883
74028
  clientWidth = 0,
73884
74029
  clientHeight = 0,
73885
- colorBank = CJS_DEFAULT_COLORS
74030
+ colorBank = CJS_DEFAULT_COLORS,
74031
+ addLocalFilterFromLib
73886
74032
  }) => {
74033
+ const legendList = require$$0$1.useMemo(
74034
+ () => data.ChartData?.map((s2) => s2.properties),
74035
+ [data]
74036
+ );
73887
74037
  const chartData = require$$0$1.useMemo(
73888
74038
  () => transformToNormalizedChartJSData(data, "horizontalBar", formatOptions, colorBank),
73889
74039
  [data, formatOptions, colorBank]
@@ -73893,7 +74043,7 @@ ${formattedValue}` : formattedValue;
73893
74043
  [chartData]
73894
74044
  );
73895
74045
  const chartOptions = require$$0$1.useMemo(() => {
73896
- const opts = mapFormatOptionsToChartJS(formatOptions, "horizontalBar", false);
74046
+ const opts = mapFormatOptionsToChartJS(formatOptions, "horizontalBar", false, addLocalFilterFromLib, legendList);
73897
74047
  opts.indexAxis = "y";
73898
74048
  opts.scales ??= {};
73899
74049
  opts.scales.x ??= {};
@@ -73925,8 +74075,13 @@ ${formattedValue}` : formattedValue;
73925
74075
  formatOptions,
73926
74076
  clientWidth = 0,
73927
74077
  clientHeight = 0,
73928
- colorBank = CJS_DEFAULT_COLORS
74078
+ colorBank = CJS_DEFAULT_COLORS,
74079
+ addLocalFilterFromLib
73929
74080
  }) => {
74081
+ const legendList = require$$0$1.useMemo(
74082
+ () => data.ChartData?.map((s2) => s2.properties),
74083
+ [data]
74084
+ );
73930
74085
  const chartData = require$$0$1.useMemo(
73931
74086
  () => transformToNormalizedChartJSData(data, "line", formatOptions, colorBank),
73932
74087
  [data, formatOptions, colorBank]
@@ -73936,7 +74091,7 @@ ${formattedValue}` : formattedValue;
73936
74091
  [chartData]
73937
74092
  );
73938
74093
  const chartOptions = require$$0$1.useMemo(() => {
73939
- const opts = mapFormatOptionsToChartJS(formatOptions, "line", false);
74094
+ const opts = mapFormatOptionsToChartJS(formatOptions, "line", false, addLocalFilterFromLib, legendList);
73940
74095
  opts.scales ??= {};
73941
74096
  opts.scales.y ??= {};
73942
74097
  opts.scales.y.stacked = true;
@@ -73965,8 +74120,13 @@ ${formattedValue}` : formattedValue;
73965
74120
  formatOptions,
73966
74121
  clientWidth = 0,
73967
74122
  clientHeight = 0,
73968
- colorBank = CJS_DEFAULT_COLORS
74123
+ colorBank = CJS_DEFAULT_COLORS,
74124
+ addLocalFilterFromLib
73969
74125
  }) => {
74126
+ const legendList = require$$0$1.useMemo(
74127
+ () => data.ChartData?.map((s2) => s2.properties),
74128
+ [data]
74129
+ );
73970
74130
  const chartData = require$$0$1.useMemo(
73971
74131
  () => transformToNormalizedChartJSData(data, "area", formatOptions, colorBank),
73972
74132
  [data, formatOptions, colorBank]
@@ -73976,7 +74136,7 @@ ${formattedValue}` : formattedValue;
73976
74136
  [chartData]
73977
74137
  );
73978
74138
  const chartOptions = require$$0$1.useMemo(() => {
73979
- const opts = mapFormatOptionsToChartJS(formatOptions, "area", false);
74139
+ const opts = mapFormatOptionsToChartJS(formatOptions, "area", false, addLocalFilterFromLib, legendList);
73980
74140
  opts.scales ??= {};
73981
74141
  opts.scales.y ??= {};
73982
74142
  opts.scales.y.stacked = true;