@databrainhq/plugin 0.7.19 → 0.7.21

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.es.js CHANGED
@@ -78859,22 +78859,17 @@ const AreaChart = ({
78859
78859
  legendSettings,
78860
78860
  labelSettings,
78861
78861
  axisSettings,
78862
- enableSaveAs,
78863
78862
  colors: colors2,
78864
78863
  updateGroup,
78865
78864
  isEnableGroupBy,
78866
78865
  backGroundColor,
78867
78866
  customSettings,
78868
- chartClickConfig
78867
+ chartClickConfig,
78868
+ chartRef
78869
78869
  }) => {
78870
78870
  var _a2;
78871
78871
  const option2 = {
78872
78872
  toolbox: {
78873
- feature: {
78874
- saveAsImage: enableSaveAs && {
78875
- name: "databrain"
78876
- }
78877
- },
78878
78873
  emphasis: {
78879
78874
  iconStyle: {
78880
78875
  borderColor: "#5865F6"
@@ -78965,6 +78960,7 @@ const AreaChart = ({
78965
78960
  };
78966
78961
  return /* @__PURE__ */ jsxs(Fragment, {
78967
78962
  children: [!isEnableGroupBy && /* @__PURE__ */ jsx(EChartsReact, {
78963
+ ref: chartRef,
78968
78964
  style: {
78969
78965
  width: "100%",
78970
78966
  height: "90%"
@@ -78977,6 +78973,7 @@ const AreaChart = ({
78977
78973
  }
78978
78974
  }
78979
78975
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
78976
+ ref: chartRef,
78980
78977
  style: {
78981
78978
  width: "100%",
78982
78979
  height: "90%"
@@ -79001,16 +78998,12 @@ const BarChart = ({
79001
78998
  axisSettings,
79002
78999
  margins,
79003
79000
  customSettings,
79004
- chartClickConfig
79001
+ chartClickConfig,
79002
+ chartRef
79005
79003
  }) => {
79006
79004
  var _a2, _b2;
79007
79005
  const option2 = {
79008
79006
  toolbox: {
79009
- feature: {
79010
- saveAsImage: {
79011
- name: "databrain"
79012
- }
79013
- },
79014
79007
  emphasis: {
79015
79008
  iconStyle: {
79016
79009
  borderColor: "#5865F6"
@@ -79103,6 +79096,7 @@ const BarChart = ({
79103
79096
  };
79104
79097
  return /* @__PURE__ */ jsxs(Fragment, {
79105
79098
  children: [!isEnableGroupBy && /* @__PURE__ */ jsx(EChartsReact, {
79099
+ ref: chartRef,
79106
79100
  style: {
79107
79101
  width: "100%",
79108
79102
  height: "90%"
@@ -79115,6 +79109,7 @@ const BarChart = ({
79115
79109
  }
79116
79110
  }
79117
79111
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
79112
+ ref: chartRef,
79118
79113
  style: {
79119
79114
  width: "100%",
79120
79115
  height: "90%"
@@ -79133,13 +79128,13 @@ const ComboChart = ({
79133
79128
  margins,
79134
79129
  legendSettings,
79135
79130
  labelSettings,
79136
- enableSaveAs,
79137
79131
  colors: colors2,
79138
79132
  updateGroup,
79139
79133
  isEnableGroupBy,
79140
79134
  backGroundColor,
79141
79135
  customSettings,
79142
- chartClickConfig
79136
+ chartClickConfig,
79137
+ chartRef
79143
79138
  }) => {
79144
79139
  var _a2;
79145
79140
  const choice = ["bar", "line"];
@@ -79156,11 +79151,6 @@ const ComboChart = ({
79156
79151
  color: colors2
79157
79152
  } : {},
79158
79153
  toolbox: {
79159
- feature: {
79160
- saveAsImage: enableSaveAs && {
79161
- name: "databrain"
79162
- }
79163
- },
79164
79154
  emphasis: {
79165
79155
  iconStyle: {
79166
79156
  borderColor: "#5865F6"
@@ -79269,6 +79259,7 @@ const ComboChart = ({
79269
79259
  height: "90%"
79270
79260
  },
79271
79261
  option: option2,
79262
+ ref: chartRef,
79272
79263
  onEvents: {
79273
79264
  click: (params) => {
79274
79265
  var _a3;
@@ -79281,6 +79272,7 @@ const ComboChart = ({
79281
79272
  height: "90%"
79282
79273
  },
79283
79274
  option: option2,
79275
+ ref: chartRef,
79284
79276
  onEvents: {
79285
79277
  click: (params) => {
79286
79278
  updateGroup(params.name);
@@ -79295,12 +79287,12 @@ const LineChart = ({
79295
79287
  legendSettings,
79296
79288
  labelSettings,
79297
79289
  axisSettings,
79298
- enableSaveAs,
79299
79290
  colors: colors2,
79300
79291
  updateGroup,
79301
79292
  isEnableGroupBy,
79302
79293
  customSettings,
79303
- chartClickConfig
79294
+ chartClickConfig,
79295
+ chartRef
79304
79296
  }) => {
79305
79297
  var _a2, _b2;
79306
79298
  const option2 = {
@@ -79330,11 +79322,6 @@ const LineChart = ({
79330
79322
  containLabel: true
79331
79323
  },
79332
79324
  toolbox: {
79333
- feature: {
79334
- saveAsImage: enableSaveAs && {
79335
- name: "databrain"
79336
- }
79337
- },
79338
79325
  emphasis: {
79339
79326
  iconStyle: {
79340
79327
  borderColor: "#5865F6"
@@ -79400,7 +79387,14 @@ const LineChart = ({
79400
79387
  width: "100%",
79401
79388
  height: "90%"
79402
79389
  },
79403
- option: option2
79390
+ option: option2,
79391
+ ref: chartRef,
79392
+ onEvents: {
79393
+ click: (params) => {
79394
+ var _a3;
79395
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
79396
+ }
79397
+ }
79404
79398
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
79405
79399
  style: {
79406
79400
  width: "100%",
@@ -79409,9 +79403,10 @@ const LineChart = ({
79409
79403
  option: option2,
79410
79404
  onEvents: {
79411
79405
  click: (params) => {
79412
- handleChartClick(chartClickConfig, params.name);
79406
+ updateGroup(params.name);
79413
79407
  }
79414
- }
79408
+ },
79409
+ ref: chartRef
79415
79410
  })]
79416
79411
  });
79417
79412
  };
@@ -79420,7 +79415,7 @@ const PieChart = ({
79420
79415
  margins,
79421
79416
  legendSettings,
79422
79417
  labelSettings,
79423
- enableSaveAs,
79418
+ chartRef,
79424
79419
  colors: colors2,
79425
79420
  updateGroup,
79426
79421
  isEnableGroupBy,
@@ -79445,11 +79440,6 @@ const PieChart = ({
79445
79440
  });
79446
79441
  const option22 = {
79447
79442
  toolbox: {
79448
- feature: {
79449
- saveAsImage: enableSaveAs && {
79450
- name: "databrain"
79451
- }
79452
- },
79453
79443
  emphasis: {
79454
79444
  iconStyle: {
79455
79445
  borderColor: "#5865F6"
@@ -79518,7 +79508,8 @@ const PieChart = ({
79518
79508
  click: (params) => {
79519
79509
  updateGroup(params.name);
79520
79510
  }
79521
- }
79511
+ },
79512
+ ref: chartRef
79522
79513
  })
79523
79514
  }), !isEnableGroupBy && /* @__PURE__ */ jsx(Fragment, {
79524
79515
  children: /* @__PURE__ */ jsx(EChartsReact, {
@@ -79532,7 +79523,8 @@ const PieChart = ({
79532
79523
  var _a3;
79533
79524
  handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
79534
79525
  }
79535
- }
79526
+ },
79527
+ ref: chartRef
79536
79528
  })
79537
79529
  })]
79538
79530
  });
@@ -79545,11 +79537,6 @@ const PieChart = ({
79545
79537
  });
79546
79538
  const option2 = {
79547
79539
  toolbox: {
79548
- feature: {
79549
- saveAsImage: enableSaveAs && {
79550
- name: "databrain"
79551
- }
79552
- },
79553
79540
  emphasis: {
79554
79541
  iconStyle: {
79555
79542
  borderColor: "#5865F6"
@@ -79608,7 +79595,8 @@ const PieChart = ({
79608
79595
  click: (params) => {
79609
79596
  updateGroup(params.name);
79610
79597
  }
79611
- }
79598
+ },
79599
+ ref: chartRef
79612
79600
  })
79613
79601
  }), !isEnableGroupBy && /* @__PURE__ */ jsx(Fragment, {
79614
79602
  children: /* @__PURE__ */ jsx(EChartsReact, {
@@ -79622,7 +79610,8 @@ const PieChart = ({
79622
79610
  var _a3;
79623
79611
  handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
79624
79612
  }
79625
- }
79613
+ },
79614
+ ref: chartRef
79626
79615
  })
79627
79616
  })]
79628
79617
  })
@@ -79633,7 +79622,7 @@ const RowChart = ({
79633
79622
  margins,
79634
79623
  legendSettings,
79635
79624
  labelSettings,
79636
- enableSaveAs,
79625
+ chartRef,
79637
79626
  colors: colors2,
79638
79627
  updateGroup,
79639
79628
  isEnableGroupBy,
@@ -79644,11 +79633,6 @@ const RowChart = ({
79644
79633
  var _a2;
79645
79634
  const option2 = {
79646
79635
  toolbox: {
79647
- feature: {
79648
- saveAsImage: enableSaveAs && {
79649
- name: "databrain"
79650
- }
79651
- },
79652
79636
  emphasis: {
79653
79637
  iconStyle: {
79654
79638
  borderColor: "#5865F6"
@@ -79750,7 +79734,8 @@ const RowChart = ({
79750
79734
  var _a3;
79751
79735
  handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
79752
79736
  }
79753
- }
79737
+ },
79738
+ ref: chartRef
79754
79739
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
79755
79740
  style: {
79756
79741
  width: "100%",
@@ -79761,7 +79746,8 @@ const RowChart = ({
79761
79746
  click: (params) => {
79762
79747
  updateGroup(params.name);
79763
79748
  }
79764
- }
79749
+ },
79750
+ ref: chartRef
79765
79751
  })]
79766
79752
  });
79767
79753
  };
@@ -79771,7 +79757,7 @@ const ScatterChart = ({
79771
79757
  legendSettings,
79772
79758
  labelSettings,
79773
79759
  axisSettings,
79774
- enableSaveAs,
79760
+ chartRef,
79775
79761
  colors: colors2,
79776
79762
  updateGroup,
79777
79763
  isEnableGroupBy,
@@ -79782,11 +79768,6 @@ const ScatterChart = ({
79782
79768
  var _a2;
79783
79769
  const option2 = {
79784
79770
  toolbox: {
79785
- feature: {
79786
- saveAsImage: enableSaveAs && {
79787
- name: "databrain"
79788
- }
79789
- },
79790
79771
  emphasis: {
79791
79772
  iconStyle: {
79792
79773
  borderColor: "#5865F6"
@@ -79882,7 +79863,8 @@ const ScatterChart = ({
79882
79863
  var _a3;
79883
79864
  handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
79884
79865
  }
79885
- }
79866
+ },
79867
+ ref: chartRef
79886
79868
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
79887
79869
  style: {
79888
79870
  width: "100%",
@@ -79893,7 +79875,8 @@ const ScatterChart = ({
79893
79875
  click: (params) => {
79894
79876
  updateGroup(params.name);
79895
79877
  }
79896
- }
79878
+ },
79879
+ ref: chartRef
79897
79880
  })]
79898
79881
  });
79899
79882
  };
@@ -79902,7 +79885,7 @@ const WaterFallChart = ({
79902
79885
  margins,
79903
79886
  labelSettings,
79904
79887
  axisSettings,
79905
- enableSaveAs,
79888
+ chartRef,
79906
79889
  colors: colors2,
79907
79890
  updateGroup,
79908
79891
  isEnableGroupBy,
@@ -79913,11 +79896,6 @@ const WaterFallChart = ({
79913
79896
  var _a2, _b2;
79914
79897
  const option2 = {
79915
79898
  toolbox: {
79916
- feature: {
79917
- saveAsImage: enableSaveAs && {
79918
- name: "databrain"
79919
- }
79920
- },
79921
79899
  emphasis: {
79922
79900
  iconStyle: {
79923
79901
  borderColor: "#5865F6"
@@ -80016,7 +79994,8 @@ const WaterFallChart = ({
80016
79994
  var _a3;
80017
79995
  handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80018
79996
  }
80019
- }
79997
+ },
79998
+ ref: chartRef
80020
79999
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
80021
80000
  style: {
80022
80001
  width: "100%",
@@ -80027,7 +80006,8 @@ const WaterFallChart = ({
80027
80006
  click: (params) => {
80028
80007
  updateGroup(params.name);
80029
80008
  }
80030
- }
80009
+ },
80010
+ ref: chartRef
80031
80011
  })]
80032
80012
  });
80033
80013
  };
@@ -80037,7 +80017,8 @@ const FunnelChart = ({
80037
80017
  legendSettings,
80038
80018
  labelSettings,
80039
80019
  colors: colors2,
80040
- chartClickConfig
80020
+ chartClickConfig,
80021
+ chartRef
80041
80022
  }) => {
80042
80023
  const option2 = {
80043
80024
  tooltip: {
@@ -80116,7 +80097,8 @@ const FunnelChart = ({
80116
80097
  var _a2;
80117
80098
  handleChartClick(chartClickConfig, ((_a2 = params == null ? void 0 : params.name) == null ? void 0 : _a2.split(" ").join("_")) || "undefined");
80118
80099
  }
80119
- }
80100
+ },
80101
+ ref: chartRef
80120
80102
  })
80121
80103
  });
80122
80104
  };
@@ -80126,12 +80108,12 @@ const BubbleChart = ({
80126
80108
  legendSettings,
80127
80109
  labelSettings,
80128
80110
  axisSettings,
80129
- enableSaveAs,
80130
80111
  colors: colors2,
80131
80112
  updateGroup,
80132
80113
  isEnableGroupBy,
80133
80114
  customSettings,
80134
- chartClickConfig
80115
+ chartClickConfig,
80116
+ chartRef
80135
80117
  }) => {
80136
80118
  var _a2;
80137
80119
  const modifiedData = [];
@@ -80157,11 +80139,6 @@ const BubbleChart = ({
80157
80139
  color: colors2
80158
80140
  } : {},
80159
80141
  toolbox: {
80160
- feature: {
80161
- saveAsImage: enableSaveAs && {
80162
- name: "databrain"
80163
- }
80164
- },
80165
80142
  emphasis: {
80166
80143
  iconStyle: {
80167
80144
  borderColor: "#5865F6"
@@ -80251,6 +80228,7 @@ const BubbleChart = ({
80251
80228
  };
80252
80229
  return /* @__PURE__ */ jsxs(Fragment, {
80253
80230
  children: [!isEnableGroupBy && /* @__PURE__ */ jsx(EChartsReact, {
80231
+ ref: chartRef,
80254
80232
  style: {
80255
80233
  width: "100%",
80256
80234
  height: "90%"
@@ -80263,6 +80241,7 @@ const BubbleChart = ({
80263
80241
  }
80264
80242
  }
80265
80243
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
80244
+ ref: chartRef,
80266
80245
  style: {
80267
80246
  width: "100%",
80268
80247
  height: "90%"
@@ -80281,11 +80260,11 @@ const DoughnutChart = ({
80281
80260
  margins,
80282
80261
  legendSettings,
80283
80262
  labelSettings,
80284
- enableSaveAs,
80285
80263
  colors: colors2,
80286
80264
  updateGroup,
80287
80265
  isEnableGroupBy,
80288
- chartClickConfig
80266
+ chartClickConfig,
80267
+ chartRef
80289
80268
  }) => {
80290
80269
  var _a2, _b2;
80291
80270
  if (((_a2 = data2 == null ? void 0 : data2.labels) == null ? void 0 : _a2.length) > 1) {
@@ -80307,11 +80286,6 @@ const DoughnutChart = ({
80307
80286
  });
80308
80287
  const option22 = {
80309
80288
  toolbox: {
80310
- feature: {
80311
- saveAsImage: enableSaveAs && {
80312
- name: "databrain"
80313
- }
80314
- },
80315
80289
  emphasis: {
80316
80290
  iconStyle: {
80317
80291
  borderColor: "#5865F6"
@@ -80369,7 +80343,14 @@ const DoughnutChart = ({
80369
80343
  width: "100%",
80370
80344
  height: "90%"
80371
80345
  },
80372
- option: option22
80346
+ option: option22,
80347
+ ref: chartRef,
80348
+ onEvents: {
80349
+ click: (params) => {
80350
+ var _a3;
80351
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80352
+ }
80353
+ }
80373
80354
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
80374
80355
  style: {
80375
80356
  width: "100%",
@@ -80380,7 +80361,8 @@ const DoughnutChart = ({
80380
80361
  click: (params) => {
80381
80362
  updateGroup(params.name);
80382
80363
  }
80383
- }
80364
+ },
80365
+ ref: chartRef
80384
80366
  })]
80385
80367
  });
80386
80368
  }
@@ -80392,11 +80374,6 @@ const DoughnutChart = ({
80392
80374
  });
80393
80375
  const option2 = {
80394
80376
  toolbox: {
80395
- feature: {
80396
- saveAsImage: enableSaveAs && {
80397
- name: "databrain"
80398
- }
80399
- },
80400
80377
  emphasis: {
80401
80378
  iconStyle: {
80402
80379
  borderColor: "#5865F6"
@@ -80452,7 +80429,8 @@ const DoughnutChart = ({
80452
80429
  var _a3;
80453
80430
  handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80454
80431
  }
80455
- }
80432
+ },
80433
+ ref: chartRef
80456
80434
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
80457
80435
  style: {
80458
80436
  width: "100%",
@@ -80463,7 +80441,8 @@ const DoughnutChart = ({
80463
80441
  click: (params) => {
80464
80442
  updateGroup(params.name);
80465
80443
  }
80466
- }
80444
+ },
80445
+ ref: chartRef
80467
80446
  })]
80468
80447
  });
80469
80448
  };
@@ -80473,7 +80452,7 @@ const SteppedAreaChart = ({
80473
80452
  legendSettings,
80474
80453
  labelSettings,
80475
80454
  axisSettings,
80476
- enableSaveAs,
80455
+ chartRef,
80477
80456
  colors: colors2,
80478
80457
  updateGroup,
80479
80458
  isEnableGroupBy,
@@ -80486,11 +80465,6 @@ const SteppedAreaChart = ({
80486
80465
  let k = 2;
80487
80466
  const option2 = {
80488
80467
  toolbox: {
80489
- feature: {
80490
- saveAsImage: enableSaveAs && {
80491
- name: "databrain"
80492
- }
80493
- },
80494
80468
  emphasis: {
80495
80469
  iconStyle: {
80496
80470
  borderColor: "#5865F6"
@@ -80588,7 +80562,8 @@ const SteppedAreaChart = ({
80588
80562
  var _a3;
80589
80563
  handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80590
80564
  }
80591
- }
80565
+ },
80566
+ ref: chartRef
80592
80567
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
80593
80568
  style: {
80594
80569
  width: "100%",
@@ -80599,7 +80574,8 @@ const SteppedAreaChart = ({
80599
80574
  click: (params) => {
80600
80575
  updateGroup(params.name);
80601
80576
  }
80602
- }
80577
+ },
80578
+ ref: chartRef
80603
80579
  })]
80604
80580
  });
80605
80581
  };
@@ -80609,7 +80585,7 @@ const Histogram = ({
80609
80585
  legendSettings,
80610
80586
  labelSettings,
80611
80587
  axisSettings,
80612
- enableSaveAs,
80588
+ chartRef,
80613
80589
  colors: colors2,
80614
80590
  updateGroup,
80615
80591
  isEnableGroupBy,
@@ -80620,11 +80596,6 @@ const Histogram = ({
80620
80596
  var _a2, _b2;
80621
80597
  const option2 = {
80622
80598
  toolbox: {
80623
- feature: {
80624
- saveAsImage: enableSaveAs && {
80625
- name: "databrain"
80626
- }
80627
- },
80628
80599
  emphasis: {
80629
80600
  iconStyle: {
80630
80601
  borderColor: "#5865F6"
@@ -80718,7 +80689,8 @@ const Histogram = ({
80718
80689
  var _a3;
80719
80690
  handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80720
80691
  }
80721
- }
80692
+ },
80693
+ ref: chartRef
80722
80694
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
80723
80695
  style: {
80724
80696
  width: "100%",
@@ -80729,7 +80701,8 @@ const Histogram = ({
80729
80701
  click: (params) => {
80730
80702
  updateGroup(params.name);
80731
80703
  }
80732
- }
80704
+ },
80705
+ ref: chartRef
80733
80706
  })]
80734
80707
  });
80735
80708
  };
@@ -80737,9 +80710,9 @@ const GaugeChart = ({
80737
80710
  gaugeData,
80738
80711
  margins,
80739
80712
  legendSettings,
80740
- enableSaveAs,
80741
80713
  colors: colors2,
80742
- chartClickConfig
80714
+ chartClickConfig,
80715
+ chartRef
80743
80716
  }) => {
80744
80717
  const newGuageData = Array.isArray(gaugeData) ? gaugeData : [];
80745
80718
  const total = newGuageData.reduce((sum2, item) => {
@@ -80748,11 +80721,6 @@ const GaugeChart = ({
80748
80721
  const average = Math.floor(total / newGuageData.length);
80749
80722
  const option2 = {
80750
80723
  toolbox: {
80751
- feature: {
80752
- saveAsImage: enableSaveAs && {
80753
- name: "databrain"
80754
- }
80755
- },
80756
80724
  emphasis: {
80757
80725
  iconStyle: {
80758
80726
  borderColor: "#5865F6"
@@ -80840,13 +80808,14 @@ const GaugeChart = ({
80840
80808
  var _a2;
80841
80809
  handleChartClick(chartClickConfig, ((_a2 = params == null ? void 0 : params.name) == null ? void 0 : _a2.split(" ").join("_")) || "undefined");
80842
80810
  }
80843
- }
80811
+ },
80812
+ ref: chartRef
80844
80813
  });
80845
80814
  };
80846
80815
  const SankeyChart = ({
80847
80816
  data: data2,
80848
80817
  margins,
80849
- enableSaveAs,
80818
+ chartRef,
80850
80819
  colors: colors2,
80851
80820
  backGroundColor,
80852
80821
  chartClickConfig
@@ -80873,11 +80842,6 @@ const SankeyChart = ({
80873
80842
  }
80874
80843
  const option2 = {
80875
80844
  toolbox: {
80876
- feature: {
80877
- saveAsImage: enableSaveAs && {
80878
- name: "databrain"
80879
- }
80880
- },
80881
80845
  emphasis: {
80882
80846
  iconStyle: {
80883
80847
  borderColor: "#5865F6"
@@ -80932,7 +80896,8 @@ const SankeyChart = ({
80932
80896
  var _a3;
80933
80897
  handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80934
80898
  }
80935
- }
80899
+ },
80900
+ ref: chartRef
80936
80901
  })
80937
80902
  });
80938
80903
  };
@@ -80942,7 +80907,7 @@ const StackedBarChart = ({
80942
80907
  legendSettings,
80943
80908
  labelSettings,
80944
80909
  axisSettings,
80945
- enableSaveAs,
80910
+ chartRef,
80946
80911
  colors: colors2,
80947
80912
  updateGroup,
80948
80913
  isEnableGroupBy,
@@ -80953,11 +80918,6 @@ const StackedBarChart = ({
80953
80918
  var _a2, _b2;
80954
80919
  const option2 = {
80955
80920
  toolbox: {
80956
- feature: {
80957
- saveAsImage: enableSaveAs && {
80958
- name: "databrain"
80959
- }
80960
- },
80961
80921
  emphasis: {
80962
80922
  iconStyle: {
80963
80923
  borderColor: "#5865F6"
@@ -81060,7 +81020,8 @@ const StackedBarChart = ({
81060
81020
  var _a3;
81061
81021
  handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
81062
81022
  }
81063
- }
81023
+ },
81024
+ ref: chartRef
81064
81025
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
81065
81026
  style: {
81066
81027
  width: "100%",
@@ -81071,7 +81032,8 @@ const StackedBarChart = ({
81071
81032
  click: (params) => {
81072
81033
  updateGroup(params.name);
81073
81034
  }
81074
- }
81035
+ },
81036
+ ref: chartRef
81075
81037
  })]
81076
81038
  });
81077
81039
  };
@@ -81357,10 +81319,10 @@ const BoxPlot = ({
81357
81319
  margins,
81358
81320
  legendSettings,
81359
81321
  axisSettings,
81360
- enableSaveAs,
81361
81322
  colors: colors2,
81362
81323
  customSettings,
81363
- chartClickConfig
81324
+ chartClickConfig,
81325
+ chartRef
81364
81326
  }) => {
81365
81327
  var _a2;
81366
81328
  const modifiedData = [];
@@ -81371,11 +81333,6 @@ const BoxPlot = ({
81371
81333
  });
81372
81334
  const option2 = {
81373
81335
  toolbox: {
81374
- feature: {
81375
- saveAsImage: enableSaveAs && {
81376
- name: "databrain"
81377
- }
81378
- },
81379
81336
  emphasis: {
81380
81337
  iconStyle: {
81381
81338
  borderColor: "#5865F6"
@@ -81475,6 +81432,7 @@ const BoxPlot = ({
81475
81432
  };
81476
81433
  return /* @__PURE__ */ jsx(Fragment, {
81477
81434
  children: /* @__PURE__ */ jsx(EChartsReact, {
81435
+ ref: chartRef,
81478
81436
  style: {
81479
81437
  width: "100%",
81480
81438
  height: "90%"
@@ -81621,7 +81579,8 @@ const MetricChart = ({
81621
81579
  isEnableGroupBy,
81622
81580
  backGroundColor,
81623
81581
  chartClickConfig,
81624
- tableSettings
81582
+ tableSettings,
81583
+ chartRef
81625
81584
  }) => {
81626
81585
  var _a2, _b2, _c2, _d;
81627
81586
  if (chartType2 === CHART_TYPES.line) {
@@ -81632,10 +81591,10 @@ const MetricChart = ({
81632
81591
  labelSettings,
81633
81592
  axisSettings,
81634
81593
  customSettings,
81635
- enableSaveAs,
81636
81594
  updateGroup,
81637
81595
  isEnableGroupBy,
81638
- chartClickConfig
81596
+ chartClickConfig,
81597
+ chartRef
81639
81598
  });
81640
81599
  }
81641
81600
  if (chartType2 === CHART_TYPES.stepped) {
@@ -81652,7 +81611,8 @@ const MetricChart = ({
81652
81611
  updateGroup,
81653
81612
  isEnableGroupBy,
81654
81613
  backGroundColor,
81655
- chartClickConfig
81614
+ chartClickConfig,
81615
+ chartRef
81656
81616
  });
81657
81617
  }
81658
81618
  if (chartType2 === CHART_TYPES.bar) {
@@ -81667,7 +81627,8 @@ const MetricChart = ({
81667
81627
  axisSettings,
81668
81628
  customSettings,
81669
81629
  margins,
81670
- chartClickConfig
81630
+ chartClickConfig,
81631
+ chartRef
81671
81632
  });
81672
81633
  }
81673
81634
  if (chartType2 === CHART_TYPES.stack) {
@@ -81683,7 +81644,8 @@ const MetricChart = ({
81683
81644
  isEnableGroupBy,
81684
81645
  backGroundColor,
81685
81646
  customSettings,
81686
- chartClickConfig
81647
+ chartClickConfig,
81648
+ chartRef
81687
81649
  });
81688
81650
  }
81689
81651
  if (chartType2 === CHART_TYPES.histogram) {
@@ -81699,7 +81661,8 @@ const MetricChart = ({
81699
81661
  isEnableGroupBy,
81700
81662
  backGroundColor,
81701
81663
  customSettings,
81702
- chartClickConfig
81664
+ chartClickConfig,
81665
+ chartRef
81703
81666
  });
81704
81667
  }
81705
81668
  if (chartType2 === CHART_TYPES.bubble) {
@@ -81715,7 +81678,8 @@ const MetricChart = ({
81715
81678
  isEnableGroupBy,
81716
81679
  backGroundColor,
81717
81680
  customSettings,
81718
- chartClickConfig
81681
+ chartClickConfig,
81682
+ chartRef
81719
81683
  });
81720
81684
  }
81721
81685
  if (chartType2 === CHART_TYPES.scatter) {
@@ -81731,7 +81695,8 @@ const MetricChart = ({
81731
81695
  isEnableGroupBy,
81732
81696
  backGroundColor,
81733
81697
  customSettings,
81734
- chartClickConfig
81698
+ chartClickConfig,
81699
+ chartRef
81735
81700
  });
81736
81701
  }
81737
81702
  if (chartType2 === CHART_TYPES.row) {
@@ -81746,7 +81711,8 @@ const MetricChart = ({
81746
81711
  isEnableGroupBy,
81747
81712
  backGroundColor,
81748
81713
  customSettings,
81749
- chartClickConfig
81714
+ chartClickConfig,
81715
+ chartRef
81750
81716
  });
81751
81717
  }
81752
81718
  if (chartType2 === CHART_TYPES.area) {
@@ -81765,7 +81731,8 @@ const MetricChart = ({
81765
81731
  isEnableGroupBy,
81766
81732
  backGroundColor,
81767
81733
  customSettings,
81768
- chartClickConfig
81734
+ chartClickConfig,
81735
+ chartRef
81769
81736
  });
81770
81737
  }
81771
81738
  if (chartType2 === CHART_TYPES.combo) {
@@ -81786,7 +81753,8 @@ const MetricChart = ({
81786
81753
  isEnableGroupBy,
81787
81754
  backGroundColor,
81788
81755
  customSettings,
81789
- chartClickConfig
81756
+ chartClickConfig,
81757
+ chartRef
81790
81758
  });
81791
81759
  }
81792
81760
  if (chartType2 === CHART_TYPES.pie) {
@@ -81799,7 +81767,8 @@ const MetricChart = ({
81799
81767
  colors: colors2,
81800
81768
  updateGroup,
81801
81769
  isEnableGroupBy,
81802
- chartClickConfig
81770
+ chartClickConfig,
81771
+ chartRef
81803
81772
  });
81804
81773
  }
81805
81774
  if (chartType2 === CHART_TYPES.doughnut) {
@@ -81812,7 +81781,8 @@ const MetricChart = ({
81812
81781
  colors: colors2,
81813
81782
  updateGroup,
81814
81783
  isEnableGroupBy,
81815
- chartClickConfig
81784
+ chartClickConfig,
81785
+ chartRef
81816
81786
  });
81817
81787
  }
81818
81788
  if (chartType2 === CHART_TYPES.waterfall) {
@@ -81842,7 +81812,8 @@ const MetricChart = ({
81842
81812
  isEnableGroupBy,
81843
81813
  backGroundColor,
81844
81814
  customSettings,
81845
- chartClickConfig
81815
+ chartClickConfig,
81816
+ chartRef
81846
81817
  });
81847
81818
  }
81848
81819
  if (chartType2 === CHART_TYPES.funnel) {
@@ -81852,7 +81823,8 @@ const MetricChart = ({
81852
81823
  legendSettings,
81853
81824
  labelSettings,
81854
81825
  colors: colors2,
81855
- chartClickConfig
81826
+ chartClickConfig,
81827
+ chartRef
81856
81828
  });
81857
81829
  }
81858
81830
  if (chartType2 === CHART_TYPES.gauge) {
@@ -81863,7 +81835,8 @@ const MetricChart = ({
81863
81835
  labelSettings,
81864
81836
  enableSaveAs,
81865
81837
  colors: colors2,
81866
- chartClickConfig
81838
+ chartClickConfig,
81839
+ chartRef
81867
81840
  });
81868
81841
  }
81869
81842
  if (chartType2 === CHART_TYPES.sankey) {
@@ -81875,7 +81848,8 @@ const MetricChart = ({
81875
81848
  enableSaveAs,
81876
81849
  colors: colors2,
81877
81850
  backGroundColor,
81878
- chartClickConfig
81851
+ chartClickConfig,
81852
+ chartRef
81879
81853
  });
81880
81854
  }
81881
81855
  if (chartType2 === CHART_TYPES.singleValue) {
@@ -81897,7 +81871,8 @@ const MetricChart = ({
81897
81871
  enableSaveAs,
81898
81872
  colors: colors2,
81899
81873
  customSettings,
81900
- chartClickConfig
81874
+ chartClickConfig,
81875
+ chartRef
81901
81876
  });
81902
81877
  }
81903
81878
  if (chartType2 === CHART_TYPES.table) {
@@ -81945,7 +81920,8 @@ const FullScreenChart = ({
81945
81920
  dynamic: "{{value}}",
81946
81921
  route: "/{{value}}",
81947
81922
  routeType: "internal"
81948
- }
81923
+ },
81924
+ chartRef: chart.chartRef
81949
81925
  })
81950
81926
  })
81951
81927
  });
@@ -82409,6 +82385,17 @@ const Header = ({
82409
82385
  const {
82410
82386
  globalTheme
82411
82387
  } = useGlobalTheme();
82388
+ const saveDashboardStyle = useMemo(() => {
82389
+ var _a2, _b2;
82390
+ if (!globalTheme)
82391
+ return void 0;
82392
+ const style2 = {};
82393
+ if ((_a2 = globalTheme.dashboard.ctaColor) == null ? void 0 : _a2.trim())
82394
+ style2.backgroundColor = globalTheme.dashboard.ctaColor.trim() || void 0;
82395
+ if ((_b2 = globalTheme.dashboard.ctaTextColor) == null ? void 0 : _b2.trim())
82396
+ style2.color = globalTheme.dashboard.ctaTextColor.trim() || void 0;
82397
+ return style2;
82398
+ }, [globalTheme]);
82412
82399
  return /* @__PURE__ */ jsxs("div", {
82413
82400
  className: styles$h["header-container"],
82414
82401
  children: [/* @__PURE__ */ jsxs("div", {
@@ -82444,10 +82431,7 @@ const Header = ({
82444
82431
  className: styles$h["save-btn"],
82445
82432
  isDisabled: isDisableSaveBtn,
82446
82433
  onClick: () => setShowSaveMetricModal(true),
82447
- style: globalTheme ? {
82448
- backgroundColor: `${globalTheme.dashboard.ctaColor} !important`,
82449
- color: `${globalTheme.dashboard.ctaTextColor} !important`
82450
- } : void 0,
82434
+ style: saveDashboardStyle,
82451
82435
  children: [/* @__PURE__ */ jsx(Icons, {
82452
82436
  name: "save-icon",
82453
82437
  className: styles$h["save-btn-icon"]
@@ -83654,6 +83638,7 @@ const ChartTab = ({
83654
83638
  setTableSettings
83655
83639
  }) => {
83656
83640
  var _a2, _b2, _c2, _d;
83641
+ const chartRef = useRef(null);
83657
83642
  const {
83658
83643
  globalTheme
83659
83644
  } = useGlobalTheme();
@@ -83793,7 +83778,8 @@ const ChartTab = ({
83793
83778
  routeType: "internal"
83794
83779
  },
83795
83780
  enableSaveAs: true,
83796
- tableSettings
83781
+ tableSettings,
83782
+ chartRef
83797
83783
  })
83798
83784
  }) : /* @__PURE__ */ jsxs("div", {
83799
83785
  className: styles$b.metricChartEmpty,
@@ -83847,7 +83833,8 @@ const ChartTab = ({
83847
83833
  dynamic: "{{value}}",
83848
83834
  route: "/{{value}}",
83849
83835
  routeType: "internal"
83850
- }
83836
+ },
83837
+ chartRef
83851
83838
  }
83852
83839
  })]
83853
83840
  });
@@ -84978,6 +84965,17 @@ const MetricForm = ({
84978
84965
  if (isEnableGroupBy)
84979
84966
  setSelectedGroupBy(selectedDimensions);
84980
84967
  }, [selectedDimensions, isEnableGroupBy]);
84968
+ const primaryButtonStyle = useMemo(() => {
84969
+ var _a2, _b2;
84970
+ if (!globalTheme)
84971
+ return void 0;
84972
+ const style2 = {};
84973
+ if ((_a2 = globalTheme.dashboard.ctaColor) == null ? void 0 : _a2.trim())
84974
+ style2.backgroundColor = globalTheme.dashboard.ctaColor.trim() || void 0;
84975
+ if ((_b2 = globalTheme.dashboard.ctaTextColor) == null ? void 0 : _b2.trim())
84976
+ style2.color = globalTheme.dashboard.ctaTextColor.trim() || void 0;
84977
+ return style2;
84978
+ }, [globalTheme]);
84981
84979
  return /* @__PURE__ */ jsxs("div", {
84982
84980
  className: styles$5["form-container"],
84983
84981
  children: [!isDisableTimeColumn && /* @__PURE__ */ jsxs("div", {
@@ -85093,6 +85091,7 @@ const MetricForm = ({
85093
85091
  type: "button",
85094
85092
  variant: "primary",
85095
85093
  size: "small",
85094
+ style: primaryButtonStyle,
85096
85095
  className: styles$5.disabled,
85097
85096
  isDisabled: !metricAggregate.value || !metricColumn.value,
85098
85097
  onClick: () => {
@@ -85184,6 +85183,7 @@ const MetricForm = ({
85184
85183
  type: "button",
85185
85184
  variant: "primary",
85186
85185
  size: "small",
85186
+ style: primaryButtonStyle,
85187
85187
  className: styles$5.disabled,
85188
85188
  isDisabled: !column2.value,
85189
85189
  onClick: () => {
@@ -85281,6 +85281,7 @@ const MetricForm = ({
85281
85281
  variant: "primary",
85282
85282
  size: "small",
85283
85283
  isDisabled: !filterColumn.value || !operator.value || !isFilterValue,
85284
+ style: primaryButtonStyle,
85284
85285
  className: styles$5.disabled,
85285
85286
  onClick: () => {
85286
85287
  setFilters((prev) => [...prev, `${isBigQuery || isMySql ? `${filterColumn.value}` : isMongoDb ? `\`${filterColumn.value}\`` : `"${filterColumn.value}"`} ${operator.value} ${isInFilter ? `(${selectedFilterValues.map((f2) => `'${f2}'`).join(", ")})` : `${filterValue.value ? `'${filterValue.value}'` : ""}`}`]);
@@ -85337,6 +85338,7 @@ const MetricForm = ({
85337
85338
  size: "small",
85338
85339
  isDisabled: !sortColumn.value || isDisableSorting,
85339
85340
  className: styles$5.disabled,
85341
+ style: primaryButtonStyle,
85340
85342
  onClick: () => {
85341
85343
  if (!columns.length) {
85342
85344
  setSort(`${sortAggregate.value}(${isBigQuery || isMySql ? `${sortColumn.value}` : isMongoDb ? `\`${sortColumn.value}\`` : `"${sortColumn.value}"`})`);
@@ -85387,10 +85389,7 @@ const MetricForm = ({
85387
85389
  variant: "primary",
85388
85390
  className: styles$5.generateButton,
85389
85391
  isDisabled: isGeneratingDataset || isDisableGenerate,
85390
- style: globalTheme ? {
85391
- backgroundColor: `${globalTheme.dashboard.ctaColor} !important`,
85392
- color: `${globalTheme.dashboard.ctaTextColor} !important`
85393
- } : void 0,
85392
+ style: primaryButtonStyle,
85394
85393
  onClick: () => {
85395
85394
  var _a2, _b2, _c2;
85396
85395
  setError("");
@@ -85803,6 +85802,17 @@ const EmbeddedMetricCreation = ({
85803
85802
  updateGroupData(data2, [selectedGroupBy[0]], selectedGroupBy, setGroupedData);
85804
85803
  }
85805
85804
  }, [groupedData, isEnableGroupBy, selectedGroupBy]);
85805
+ const createMetricStyle = useMemo(() => {
85806
+ var _a3, _b2;
85807
+ if (!globalTheme)
85808
+ return void 0;
85809
+ const style2 = {};
85810
+ if ((_a3 = globalTheme.dashboard.ctaColor) == null ? void 0 : _a3.trim())
85811
+ style2.backgroundColor = globalTheme.dashboard.ctaColor.trim() || void 0;
85812
+ if ((_b2 = globalTheme.dashboard.ctaTextColor) == null ? void 0 : _b2.trim())
85813
+ style2.color = globalTheme.dashboard.ctaTextColor.trim() || void 0;
85814
+ return style2;
85815
+ }, [globalTheme]);
85806
85816
  return /* @__PURE__ */ jsxs(Fragment, {
85807
85817
  children: [/* @__PURE__ */ jsx(Button, {
85808
85818
  type: "button",
@@ -85810,10 +85820,7 @@ const EmbeddedMetricCreation = ({
85810
85820
  size: "large",
85811
85821
  className: variant === "floating" ? styles$g.floatingCreateButton : "",
85812
85822
  onClick: () => setShowMetricCreateModal(true),
85813
- style: globalTheme ? {
85814
- backgroundColor: `${globalTheme.dashboard.ctaColor} !important`,
85815
- color: `${globalTheme.dashboard.ctaTextColor} !important`
85816
- } : void 0,
85823
+ style: createMetricStyle,
85817
85824
  children: variant === "floating" ? /* @__PURE__ */ jsx(mdiPlus, {
85818
85825
  className: styles$g.floatingCreateButtonIcon
85819
85826
  }) : "Create Metric"
@@ -91210,6 +91217,50 @@ var styles = {
91210
91217
  features
91211
91218
  };
91212
91219
  var NoData = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMDAgMzAwIj48ZGVmcz48c3R5bGU+LmNscy0xe3N0cm9rZTojMTgyYzYwO30uY2xzLTEsLmNscy0ye2ZpbGw6bm9uZTtzdHJva2UtbGluZWNhcDpyb3VuZDtzdHJva2UtbGluZWpvaW46cm91bmQ7fS5jbHMtM3tmaWxsOiM1ODY1ZjY7b3BhY2l0eTouMTt9LmNscy00e2ZpbGw6I2YyZjNmNDt9LmNscy01e2ZpbGw6I2MxYzdjOTt9LmNscy02e2ZpbGw6I2RhZGVkZjt9LmNscy03e2ZpbGw6IzE4MmM2MDt9LmNscy0ye3N0cm9rZTojNTg2NWY2O3N0cm9rZS13aWR0aDo0cHg7fTwvc3R5bGU+PC9kZWZzPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0ibTIxMC41LDIwMC44M2MuNC0uNjYuNjgtMS40LjgyLTIuMiwxLjU4LTguODcsMy4xNS0xNy43NSw0LjczLTI2LjYyLDIuMDMtMTEuNDQsNC4wNi0yMi44OCw2LjA5LTM0LjMyLjcyLTQuMDgsMS43Ny04LjI1LDIuMTYtMTIuMzguNDMtNC41Ni0yLjA5LTkuNjgtNi44Ni0xMC42Ni0uMDEsMC0uMDMsMC0uMDQsMC0yLjQtLjQ5LTUuMDItLjIyLTcuNDUtLjIyaC00NC4yMmMtLjUyLDAtMi4zMy0uMzEtMi43NywwbC0yNC4yOCwxNy4yMmgtNjEuNjFjLTMuOTcsMC02Ljk5LDMuNTYtNi4zNCw3LjQ3bDkuNzUsNTkuNDJjLjUxLDMuMTEsMy4yLDUuM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jA5LjAyIDg5LjUgMjA4LjY2IDg3Ljk4IDIwNy45MiA4Ni44MiAyMDYuNTggODYuMDEgMjA1LjAzIDg1LjY4IDIwMy45MyIvPjwvc3ZnPg==";
91220
+ const handleSaveChartImage = (chartRef) => {
91221
+ var _a2;
91222
+ const chartInstance = (_a2 = chartRef.current) == null ? void 0 : _a2.getEchartsInstance();
91223
+ if (chartInstance) {
91224
+ const dataUrl = chartInstance.getConnectedDataURL({
91225
+ type: "png",
91226
+ pixelRatio: 2,
91227
+ excludeComponents: ["toolbox"],
91228
+ backgroundColor: "#fff"
91229
+ });
91230
+ const link = document.createElement("a");
91231
+ link.href = dataUrl;
91232
+ link.download = "chart.png";
91233
+ document.body.appendChild(link);
91234
+ link.click();
91235
+ document.body.removeChild(link);
91236
+ }
91237
+ };
91238
+ const uilImageDownload = (props) => /* @__PURE__ */ jsx("svg", {
91239
+ viewBox: "0 0 24 24",
91240
+ width: "1.2em",
91241
+ height: "1.2em",
91242
+ ...props,
91243
+ children: /* @__PURE__ */ jsx("path", {
91244
+ fill: "currentColor",
91245
+ d: "M22.71 6.29a1 1 0 0 0-1.42 0L20 7.59V2a1 1 0 0 0-2 0v5.59l-1.29-1.3a1 1 0 0 0-1.42 1.42l3 3a1 1 0 0 0 .33.21a.94.94 0 0 0 .76 0a1 1 0 0 0 .33-.21l3-3a1 1 0 0 0 0-1.42ZM19 13a1 1 0 0 0-1 1v.38l-1.48-1.48a2.79 2.79 0 0 0-3.93 0l-.7.7l-2.48-2.48a2.85 2.85 0 0 0-3.93 0L4 12.6V7a1 1 0 0 1 1-1h8a1 1 0 0 0 0-2H5a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h12a3 3 0 0 0 3-3v-5a1 1 0 0 0-1-1ZM5 20a1 1 0 0 1-1-1v-3.57l2.9-2.9a.79.79 0 0 1 1.09 0l3.17 3.17l4.3 4.3Zm13-1a.89.89 0 0 1-.18.53L13.31 15l.7-.7a.77.77 0 0 1 1.1 0L18 17.21Z"
91246
+ })
91247
+ });
91248
+ const ChartImageDownloadButton = ({
91249
+ className,
91250
+ iconClass,
91251
+ text: text2,
91252
+ chartRef
91253
+ }) => {
91254
+ return /* @__PURE__ */ jsxs(Button, {
91255
+ variant: "custom",
91256
+ type: "button",
91257
+ onClick: () => handleSaveChartImage(chartRef),
91258
+ className,
91259
+ children: [/* @__PURE__ */ jsx(uilImageDownload, {
91260
+ className: iconClass
91261
+ }), text2]
91262
+ });
91263
+ };
91213
91264
  const MetricCard = ({
91214
91265
  globalFilters = {
91215
91266
  tableName: "",
@@ -91224,6 +91275,7 @@ const MetricCard = ({
91224
91275
  renderHeaderName
91225
91276
  }) => {
91226
91277
  var _a2, _b2, _c2;
91278
+ const chartRef = useRef(null);
91227
91279
  const {
91228
91280
  globalTheme
91229
91281
  } = useGlobalTheme();
@@ -91480,6 +91532,32 @@ const MetricCard = ({
91480
91532
  } : rls));
91481
91533
  }
91482
91534
  };
91535
+ const titleStyle = useMemo(() => {
91536
+ var _a3, _b3, _c3;
91537
+ if (!globalTheme)
91538
+ return void 0;
91539
+ const style2 = {};
91540
+ if ((_a3 = globalTheme.cardTitle.fontWeight) == null ? void 0 : _a3.trim())
91541
+ style2.fontWeight = globalTheme.cardTitle.fontWeight.trim() || void 0;
91542
+ if ((_b3 = globalTheme.cardTitle.color) == null ? void 0 : _b3.trim())
91543
+ style2.color = globalTheme.cardTitle.color.trim() || void 0;
91544
+ if ((_c3 = globalTheme.cardTitle.fontSize) == null ? void 0 : _c3.trim())
91545
+ style2.color = globalTheme.cardTitle.fontSize.trim() || void 0;
91546
+ return style2;
91547
+ }, [globalTheme]);
91548
+ const descriptionStyle = useMemo(() => {
91549
+ var _a3, _b3, _c3;
91550
+ if (!globalTheme)
91551
+ return void 0;
91552
+ const style2 = {};
91553
+ if ((_a3 = globalTheme.cardDescription.fontWeight) == null ? void 0 : _a3.trim())
91554
+ style2.fontWeight = globalTheme.cardDescription.fontWeight.trim() || void 0;
91555
+ if ((_b3 = globalTheme.cardDescription.color) == null ? void 0 : _b3.trim())
91556
+ style2.color = globalTheme.cardDescription.color.trim() || void 0;
91557
+ if ((_c3 = globalTheme.cardDescription.fontSize) == null ? void 0 : _c3.trim())
91558
+ style2.color = globalTheme.cardDescription.fontSize.trim() || void 0;
91559
+ return style2;
91560
+ }, [globalTheme]);
91483
91561
  return /* @__PURE__ */ jsx(Fragment, {
91484
91562
  children: /* @__PURE__ */ jsxs("div", {
91485
91563
  className: styles.cardContainer,
@@ -91489,30 +91567,18 @@ const MetricCard = ({
91489
91567
  variant: "h3",
91490
91568
  styleClass: "primary",
91491
91569
  className: styles.metricName,
91492
- style: globalTheme ? {
91493
- color: globalTheme.cardTitle.color,
91494
- fontWeight: globalTheme.cardTitle.fontWeight,
91495
- fontSize: globalTheme.cardTitle.fontSize
91496
- } : void 0,
91570
+ style: titleStyle,
91497
91571
  children: [renderHeaderName ? renderHeaderName(metricItem.name) : /* @__PURE__ */ jsx(Button, {
91498
91572
  type: "button",
91499
91573
  variant: "custom",
91500
91574
  isDisabled: !clickBehaviourConfigs.card.isEnable,
91501
91575
  className: "disabled:cursor-text",
91502
91576
  onClick: () => handleCardClick(clickBehaviourConfigs, metricItem.metricId, metricItem.id),
91503
- style: globalTheme ? {
91504
- color: globalTheme.cardTitle.color,
91505
- fontWeight: globalTheme.cardTitle.fontWeight,
91506
- fontSize: globalTheme.cardTitle.fontSize
91507
- } : void 0,
91577
+ style: titleStyle,
91508
91578
  children: metricItem.name
91509
91579
  }), metricItem.description && /* @__PURE__ */ jsx("span", {
91510
91580
  className: styles.metricDescription,
91511
- style: globalTheme ? {
91512
- color: globalTheme.cardDescription.color,
91513
- fontWeight: globalTheme.cardDescription.fontWeight,
91514
- fontSize: globalTheme.cardDescription.fontSize
91515
- } : void 0,
91581
+ style: descriptionStyle,
91516
91582
  children: metricItem.description
91517
91583
  })]
91518
91584
  }), /* @__PURE__ */ jsxs("div", {
@@ -91604,13 +91670,19 @@ const MetricCard = ({
91604
91670
  backGroundColor,
91605
91671
  tableSettings,
91606
91672
  enableSaveAs: true,
91607
- chartClickConfig: clickBehaviourConfigs.chart
91673
+ chartClickConfig: clickBehaviourConfigs.chart,
91674
+ chartRef
91608
91675
  });
91609
91676
  },
91610
91677
  children: [/* @__PURE__ */ jsx(Icons, {
91611
91678
  name: "fullscreen-icon",
91612
91679
  className: styles.popupItemIcon
91613
91680
  }), "Enter Fullscreen"]
91681
+ }), /* @__PURE__ */ jsx(ChartImageDownloadButton, {
91682
+ text: "Save As PNG",
91683
+ chartRef,
91684
+ className: `${styles.popupItem} ${styles.csvBtn}`,
91685
+ iconClass: styles.popupItemIcon
91614
91686
  }), /* @__PURE__ */ jsx(CsvDownloadButton, {
91615
91687
  data: dataDb,
91616
91688
  fileName: metricItem.name,
@@ -91666,7 +91738,8 @@ const MetricCard = ({
91666
91738
  isEnableGroupBy,
91667
91739
  customSettings,
91668
91740
  backGroundColor,
91669
- chartClickConfig: clickBehaviourConfigs.chart
91741
+ chartClickConfig: clickBehaviourConfigs.chart,
91742
+ chartRef
91670
91743
  }) : null]
91671
91744
  })]
91672
91745
  })
@@ -91804,6 +91877,32 @@ const SingleValueCard = ({
91804
91877
  } : rls));
91805
91878
  }
91806
91879
  };
91880
+ const titleStyle = useMemo(() => {
91881
+ var _a3, _b2, _c2;
91882
+ if (!globalTheme)
91883
+ return void 0;
91884
+ const style2 = {};
91885
+ if ((_a3 = globalTheme.cardTitle.fontWeight) == null ? void 0 : _a3.trim())
91886
+ style2.fontWeight = globalTheme.cardTitle.fontWeight.trim() || void 0;
91887
+ if ((_b2 = globalTheme.cardTitle.color) == null ? void 0 : _b2.trim())
91888
+ style2.color = globalTheme.cardTitle.color.trim() || void 0;
91889
+ if ((_c2 = globalTheme.cardTitle.fontSize) == null ? void 0 : _c2.trim())
91890
+ style2.color = globalTheme.cardTitle.fontSize.trim() || void 0;
91891
+ return style2;
91892
+ }, [globalTheme]);
91893
+ const descriptionStyle = useMemo(() => {
91894
+ var _a3, _b2, _c2;
91895
+ if (!globalTheme)
91896
+ return void 0;
91897
+ const style2 = {};
91898
+ if ((_a3 = globalTheme.cardDescription.fontWeight) == null ? void 0 : _a3.trim())
91899
+ style2.fontWeight = globalTheme.cardDescription.fontWeight.trim() || void 0;
91900
+ if ((_b2 = globalTheme.cardDescription.color) == null ? void 0 : _b2.trim())
91901
+ style2.color = globalTheme.cardDescription.color.trim() || void 0;
91902
+ if ((_c2 = globalTheme.cardDescription.fontSize) == null ? void 0 : _c2.trim())
91903
+ style2.color = globalTheme.cardDescription.fontSize.trim() || void 0;
91904
+ return style2;
91905
+ }, [globalTheme]);
91807
91906
  return /* @__PURE__ */ jsx(Fragment, {
91808
91907
  children: /* @__PURE__ */ jsxs("div", {
91809
91908
  className: styles.cardContainer,
@@ -91813,30 +91912,18 @@ const SingleValueCard = ({
91813
91912
  variant: "h3",
91814
91913
  styleClass: "primary",
91815
91914
  className: styles.metricName,
91816
- style: globalTheme ? {
91817
- color: globalTheme.cardTitle.color,
91818
- fontWeight: globalTheme.cardTitle.fontWeight,
91819
- fontSize: globalTheme.cardTitle.fontSize
91820
- } : void 0,
91915
+ style: titleStyle,
91821
91916
  children: [renderHeaderName ? renderHeaderName(metricItem.name) : /* @__PURE__ */ jsx(Button, {
91822
91917
  type: "button",
91823
91918
  variant: "custom",
91824
91919
  isDisabled: !clickBehaviourConfigs.card.isEnable,
91825
91920
  className: "disabled:cursor-text",
91826
91921
  onClick: () => handleCardClick(clickBehaviourConfigs, metricItem.metricId, metricItem.id),
91827
- style: globalTheme ? {
91828
- color: globalTheme.cardTitle.color,
91829
- fontWeight: globalTheme.cardTitle.fontWeight,
91830
- fontSize: globalTheme.cardTitle.fontSize
91831
- } : void 0,
91922
+ style: titleStyle,
91832
91923
  children: metricItem.name
91833
91924
  }), metricItem.description && /* @__PURE__ */ jsx("span", {
91834
91925
  className: styles.metricDescription,
91835
- style: globalTheme ? {
91836
- color: globalTheme.cardDescription.color,
91837
- fontWeight: globalTheme.cardDescription.fontWeight,
91838
- fontSize: globalTheme.cardDescription.fontSize
91839
- } : void 0,
91926
+ style: descriptionStyle,
91840
91927
  children: metricItem.description
91841
91928
  })]
91842
91929
  }), /* @__PURE__ */ jsx("div", {
@@ -92137,13 +92224,21 @@ const EmbeddedDashboard = React__default.memo(({
92137
92224
  setGlobalTheme(res.themes[0]);
92138
92225
  }
92139
92226
  });
92227
+ const embedDashboardStyle = useMemo(() => {
92228
+ var _a3, _b3;
92229
+ if (!globalTheme)
92230
+ return void 0;
92231
+ const style2 = {};
92232
+ if ((_a3 = globalTheme.dashboard.backgroundColor) == null ? void 0 : _a3.trim())
92233
+ style2.backgroundColor = globalTheme.dashboard.backgroundColor.trim() || void 0;
92234
+ if ((_b3 = globalTheme.general.fontFamily) == null ? void 0 : _b3.trim())
92235
+ style2.fontFamily = globalTheme.general.fontFamily.trim() || void 0;
92236
+ return style2;
92237
+ }, [globalTheme]);
92140
92238
  return /* @__PURE__ */ jsx(Fragment, {
92141
92239
  children: /* @__PURE__ */ jsxs("div", {
92142
92240
  className: styles$C["embedDashboard-container"],
92143
- style: globalTheme ? {
92144
- backgroundColor: `${globalTheme.dashboard.backgroundColor} !important`,
92145
- fontFamily: `${globalTheme.general.fontFamily} !important`
92146
- } : void 0,
92241
+ style: embedDashboardStyle,
92147
92242
  children: [((_a2 = data2.externalDashboard) == null ? void 0 : _a2.id) && !isLoading && /* @__PURE__ */ jsxs(Fragment, {
92148
92243
  children: [!(options2 == null ? void 0 : options2.disableMetricCreation) && !data2.externalDashboard.filters.length && !data2.isAllowedToCreateMetrics ? null : /* @__PURE__ */ jsxs("div", {
92149
92244
  className: (options2 == null ? void 0 : options2.headerVariant) === "floating" ? styles$C["embedDashboard-header-floating"] : styles$C["embedDashboard-header-static"],