pace-chart-lib 1.0.51 → 1.0.53

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.
Files changed (50) hide show
  1. package/dist/pace-chart-lib.es.js +103 -66
  2. package/dist/pace-chart-lib.umd.js +103 -66
  3. package/package.json +1 -1
  4. package/dist/Components/Charts/ChartsWithAxis/AreaFamily/AreaChart.d.ts +0 -4
  5. package/dist/Components/Charts/ChartsWithAxis/AreaFamily/NormalizedStackAreaChart.d.ts +0 -4
  6. package/dist/Components/Charts/ChartsWithAxis/AreaFamily/StackAreaChart.d.ts +0 -4
  7. package/dist/Components/Charts/ChartsWithAxis/ChartsWithAxisFunctions.d.ts +0 -628
  8. package/dist/Components/Charts/ChartsWithAxis/ChartsWithAxisTypes.types.d.ts +0 -171
  9. package/dist/Components/Charts/ChartsWithAxis/ColumnFamily/ColumnChart.d.ts +0 -4
  10. package/dist/Components/Charts/ChartsWithAxis/ColumnFamily/ColumnHistogramChart.d.ts +0 -4
  11. package/dist/Components/Charts/ChartsWithAxis/ColumnFamily/CustomColumnChart.d.ts +0 -4
  12. package/dist/Components/Charts/ChartsWithAxis/ColumnFamily/LayeredColumnChart.d.ts +0 -4
  13. package/dist/Components/Charts/ChartsWithAxis/ColumnFamily/NormalizedStackColumnChart.d.ts +0 -4
  14. package/dist/Components/Charts/ChartsWithAxis/ColumnFamily/StackColumnChart.d.ts +0 -4
  15. package/dist/Components/Charts/ChartsWithAxis/HorizontalBarFamily/HorizontalBarChart.d.ts +0 -4
  16. package/dist/Components/Charts/ChartsWithAxis/HorizontalBarFamily/HorizontalHistogramChart.d.ts +0 -4
  17. package/dist/Components/Charts/ChartsWithAxis/HorizontalBarFamily/LayeredHorizontalBarChart.d.ts +0 -4
  18. package/dist/Components/Charts/ChartsWithAxis/HorizontalBarFamily/NormalizedStackHorizontalBarChart.d.ts +0 -4
  19. package/dist/Components/Charts/ChartsWithAxis/HorizontalBarFamily/StackHorizontalBarChart.d.ts +0 -4
  20. package/dist/Components/Charts/ChartsWithAxis/LineFamily/LineChart.d.ts +0 -4
  21. package/dist/Components/Charts/ChartsWithAxis/LineFamily/NormalizedStackLineChart.d.ts +0 -4
  22. package/dist/Components/Charts/ChartsWithAxis/LineFamily/StackLineChart.d.ts +0 -4
  23. package/dist/Components/Charts/ChartsWithAxis/MiscellaneousChartFamily/DotPlot.d.ts +0 -4
  24. package/dist/Components/Charts/ChartsWithAxis/MiscellaneousChartFamily/TornadoChart.d.ts +0 -4
  25. package/dist/Components/Charts/ChartsWithAxis/MiscellaneousChartFamily/WaterfallChart.d.ts +0 -4
  26. package/dist/Components/Charts/ChartsWithoutAxis/ChartsWithoutAxisFunctions.d.ts +0 -95
  27. package/dist/Components/Charts/ChartsWithoutAxis/ChartsWithoutAxisTypes.types.d.ts +0 -112
  28. package/dist/Components/Charts/ChartsWithoutAxis/Maps/Cordinates.d.ts +0 -26
  29. package/dist/Components/Charts/ChartsWithoutAxis/Maps/Maps.d.ts +0 -4
  30. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/BubbleChart.d.ts +0 -4
  31. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/OrganizationChart.d.ts +0 -4
  32. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/ProgressChart.d.ts +0 -3
  33. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/PyramidChart.d.ts +0 -3
  34. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/RadialBarChart.d.ts +0 -4
  35. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/SankeyChart.d.ts +0 -4
  36. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/ScatterChart.d.ts +0 -4
  37. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/Speedometer.d.ts +0 -3
  38. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/VennChart.d.ts +0 -4
  39. package/dist/Components/Charts/ChartsWithoutAxis/OtherCharts/WordCloud.d.ts +0 -4
  40. package/dist/Components/Charts/ChartsWithoutAxis/PieFamily/DonutChart.d.ts +0 -4
  41. package/dist/Components/Charts/ChartsWithoutAxis/PieFamily/PieChart.d.ts +0 -4
  42. package/dist/Components/Charts/ChartsWithoutAxis/PieFamily/PieFamilyCommonFunctions.d.ts +0 -10
  43. package/dist/Components/Charts/ChartsWithoutAxis/PieFamily/PieofPieChart.d.ts +0 -3
  44. package/dist/Components/Charts/ChartsWithoutAxis/PieFamily/TreemapChart.d.ts +0 -3
  45. package/dist/Components/Charts/Core/Common.types.d.ts +0 -414
  46. package/dist/Components/Charts/Core/CommonFunctions.d.ts +0 -250
  47. package/dist/Components/Charts/Core/DefaultChartDataProperties.d.ts +0 -66
  48. package/dist/Components/Charts/Core/DefaultProperties.types.d.ts +0 -603
  49. package/dist/Services/ErrorLog.d.ts +0 -1
  50. package/dist/index.d.ts +0 -36
@@ -11178,6 +11178,7 @@ const defaultChartFormatOptions = {
11178
11178
  totalColor: "#41a5b4",
11179
11179
  positiveColor: "#9fb700",
11180
11180
  negativeColor: "#e25a42",
11181
+ dotPlotLineColor: "#c7c7c7",
11181
11182
  dataLabelValue: true,
11182
11183
  plotAreaAbsoluteValue: false,
11183
11184
  dataLabelName: true,
@@ -16079,11 +16080,13 @@ function calculateMaxLegendWidth(list, formatOptions) {
16079
16080
  let maxLength = 0;
16080
16081
  let maxLegend = list[0];
16081
16082
  list.forEach((legend) => {
16082
- let splitedLegend = legend.includes("~$~") ? legend.split("~$~")[1] : legend.includes("-") ? legend.slice(legend.indexOf("-") + 1) : legend;
16083
- let splitedLegendLength = splitedLegend.length;
16084
- if (maxLength < splitedLegendLength) {
16085
- maxLength = splitedLegendLength;
16086
- maxLegend = splitedLegend;
16083
+ if (legend !== void 0) {
16084
+ let splitedLegend = legend.includes("~$~") ? legend.split("~$~")[1] : legend.includes("-") ? legend.slice(legend.indexOf("-") + 1) : legend;
16085
+ let splitedLegendLength = splitedLegend.length;
16086
+ if (maxLength < splitedLegendLength) {
16087
+ maxLength = splitedLegendLength;
16088
+ maxLegend = splitedLegend;
16089
+ }
16087
16090
  }
16088
16091
  });
16089
16092
  return calculateWidthHeightDynamically(maxLegend, formatOptions.legends.legendFontSize, formatOptions.legends.legendFontFamily);
@@ -16413,6 +16416,15 @@ function showTooltipOnMouseMove(elements, chartFormatOptions, event2, prop) {
16413
16416
  const bgColor = isLightTheme ? "rgba(255, 255, 255)" : "#272729ff";
16414
16417
  const textColor = isLightTheme ? "black" : commonColors.white;
16415
16418
  const subTextColor = isLightTheme ? "gray" : "#d1d5db";
16419
+ const formatValueWithWordLimit = (text, wordsPerLine = 6) => {
16420
+ if (!text) return "";
16421
+ const words = text.split(" ");
16422
+ let result = "";
16423
+ for (let i = 0; i < words.length; i += wordsPerLine) {
16424
+ result += words.slice(i, i + wordsPerLine).join(" ") + "<br/>";
16425
+ }
16426
+ return result;
16427
+ };
16416
16428
  selectAll(".chartTooltip").style("visibility", visibilityCondition.hidden);
16417
16429
  const tooltip = select$2("#chartTooltipDiv").html("").append("div").attr(
16418
16430
  "class",
@@ -16447,29 +16459,53 @@ function showTooltipOnMouseMove(elements, chartFormatOptions, event2, prop) {
16447
16459
  }
16448
16460
  })();
16449
16461
  p += `
16450
- <div style="display:flex; align-items:center; margin-bottom:4px;">
16462
+ <div style="
16463
+ display:flex;
16464
+ align-items:flex-start;
16465
+ justify-content:space-between;
16466
+ margin-bottom:6px;
16467
+ gap:10px;
16468
+ ">
16469
+
16470
+ <!-- LEFT SIDE (Dot + Key) -->
16471
+ <div style="
16472
+ display:flex;
16473
+ align-items:flex-start;
16474
+ gap:6px;
16475
+ flex-shrink:0;
16476
+ ">
16451
16477
  <span style="
16452
- display:inline-block;
16453
16478
  width:6px;
16454
16479
  height:6px;
16455
- background-color:${markerColor};
16456
- margin-right:6px;
16457
- ${shapeStyle}
16480
+ background:${markerColor};
16481
+ margin-top:5px;
16482
+ border-radius:50%;
16458
16483
  "></span>
16484
+
16459
16485
  <span style="
16460
- font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;
16461
16486
  font-size:11px;
16462
16487
  color:${subTextColor};
16463
- flex:1;
16464
- ">${c2.key || ""}</span>
16465
- <span style="
16466
- font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;
16467
- font-size:11px;
16468
- color:${textColor};
16469
- font-weight:bold;
16470
- margin-left:6px;
16471
- ">${c2.value || ""}</span>
16472
- </div>`;
16488
+ white-space:nowrap;
16489
+ ">
16490
+ ${c2.key || ""}
16491
+ </span>
16492
+ </div>
16493
+
16494
+ <!-- RIGHT SIDE (Value) -->
16495
+ <div style="
16496
+ font-size:11px;
16497
+ font-weight:bold;
16498
+ color:${textColor};
16499
+ text-align:right;
16500
+ max-width:200px;
16501
+ word-break:break-word;
16502
+ line-height:1.4;
16503
+ ">
16504
+ ${formatValueWithWordLimit(String(c2.value), 6)}
16505
+ </div>
16506
+
16507
+ </div>
16508
+ `;
16473
16509
  return p;
16474
16510
  }, ``);
16475
16511
  tooltip.html(`
@@ -16481,35 +16517,20 @@ function showTooltipOnMouseMove(elements, chartFormatOptions, event2, prop) {
16481
16517
  const tooltipNode = tooltip.node();
16482
16518
  const tooltipWidth = tooltipNode.offsetWidth;
16483
16519
  const tooltipHeight = tooltipNode.offsetHeight;
16484
- const halfWidth = window.innerWidth / 2;
16485
- const halfHeight = window.innerHeight / 2;
16486
- let left2 = 0;
16487
- let top2 = 0;
16488
- let arrow = "";
16489
- if (mouseX > halfWidth && mouseY < halfHeight) {
16490
- left2 = mouseX - tooltipWidth - 10;
16491
- top2 = mouseY - 10;
16492
- arrow = "right-top";
16493
- } else if (mouseX < halfWidth && mouseY < halfHeight) {
16494
- left2 = mouseX + 20;
16495
- top2 = mouseY - 10;
16496
- arrow = "left-top";
16497
- } else if (mouseX < halfWidth && mouseY >= halfHeight) {
16498
- left2 = mouseX + 20;
16499
- top2 = mouseY - tooltipHeight + 10;
16500
- arrow = "left-bottom";
16501
- } else {
16520
+ let left2 = mouseX + 15;
16521
+ let top2 = mouseY + 15;
16522
+ if (left2 + tooltipWidth > window.innerWidth) {
16502
16523
  left2 = mouseX - tooltipWidth - 10;
16503
- top2 = mouseY - tooltipHeight + 10;
16504
- arrow = "right-bottom";
16524
+ }
16525
+ if (top2 + tooltipHeight > window.innerHeight) {
16526
+ top2 = mouseY - tooltipHeight - 10;
16505
16527
  }
16506
16528
  tooltip.style("left", `${left2}px`).style("top", `${top2}px`).style(
16507
16529
  "visibility",
16508
- chartFormatOptions.toolTip.toolTipVisibility ? visibilityCondition.visible : visibilityCondition.hidden
16509
- ).style("transform", "scale(1)").style("opacity", "1");
16510
- tooltip.select(".arrow-placeholder").attr("class", `arrow-${arrow}`);
16530
+ chartFormatOptions.toolTip.toolTipVisibility ? "visible" : "hidden"
16531
+ );
16511
16532
  } catch (error) {
16512
- logError$2(fileName$b, "showTooltipOnMouseMove", error);
16533
+ console.error("Tooltip Error:", error);
16513
16534
  }
16514
16535
  }
16515
16536
  function hideTooltipOnMouseOut() {
@@ -16578,12 +16599,14 @@ const legendsWithScroll = (svg, seriesData, x2, y2, width, height, legendPositio
16578
16599
  const hoverId = this.textContent.replace(/\s+/g, "-");
16579
16600
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
16580
16601
  svg.selectAll(`[hoverId="${hoverId}"]`).classed("highlight", true).classed("unhighlight", false);
16602
+ svg.selectAll(".cleveland-line-group").classed("highlight", false).classed("unhighlight", true);
16581
16603
  }
16582
16604
  }).on("mouseout", function() {
16583
16605
  if (chartFormatOptions.legends.onHoverEffect) {
16584
16606
  const hoverId = this.textContent.replace(/\s+/g, "-");
16585
16607
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
16586
16608
  svg.selectAll(`[hoverId="${hoverId}"]`).classed("highlight", false).classed("unhighlight", false);
16609
+ svg.selectAll(".cleveland-line-group").classed("highlight", false).classed("unhighlight", false);
16587
16610
  }
16588
16611
  });
16589
16612
  if (legendPosition == staticLegendPosition.top || legendPosition == staticLegendPosition.bottom) {
@@ -55633,6 +55656,7 @@ const WaterfallChart = ({
55633
55656
  }
55634
55657
  }
55635
55658
  });
55659
+ gTag.selectAll(".parentGroup").raise();
55636
55660
  };
55637
55661
  const setSVGContainer = (margin2) => {
55638
55662
  innerWidth2 = width - margin2.left - margin2.right;
@@ -55702,7 +55726,6 @@ const WaterfallChart = ({
55702
55726
  drawColumnChart();
55703
55727
  };
55704
55728
  const drawColumnChart = () => {
55705
- getChartType();
55706
55729
  initXaxis$1(
55707
55730
  gTag,
55708
55731
  chartJSON,
@@ -55720,6 +55743,7 @@ const WaterfallChart = ({
55720
55743
  chartJSON.legendList,
55721
55744
  xScale
55722
55745
  );
55746
+ getChartType();
55723
55747
  };
55724
55748
  const generateWaterFallData = () => {
55725
55749
  try {
@@ -55835,7 +55859,7 @@ const TornadoChart = ({
55835
55859
  const chartId = crypto.randomUUID();
55836
55860
  let columnWidth = 0;
55837
55861
  const chartType = chartTypes.TornadoChart;
55838
- const isAdvanceAnalyticsChart = data.IsadvanceanalyticsChart;
55862
+ const isAdvanceAnalyticsChart = data.IsadvanceanalyticsChart ?? data.IsCalCSensitivity;
55839
55863
  const svgRef = useRef();
55840
55864
  let seriesData = generalizedChartData(
55841
55865
  data.ChartData,
@@ -56152,23 +56176,38 @@ const TornadoChart = ({
56152
56176
  }
56153
56177
  };
56154
56178
  const initScale = () => {
56179
+ let min2 = chartJSON.yMaxLeft;
56180
+ let max2 = chartJSON.yMaxRight;
56181
+ let adjustedPosition = formatOptions.annotation.annotationVisibility != "5" && formatOptions.annotation.annotationPosition == "1" ? 20 : 0;
56182
+ let maxValue;
56155
56183
  let right2 = false;
56156
56184
  let left2 = false;
56157
- let maxValue;
56158
- if (chartJSON.yMaxLeft > chartJSON.yMaxRight) {
56159
- maxValue = chartJSON.yMaxLeft;
56185
+ if (min2 > max2) {
56186
+ maxValue = min2;
56160
56187
  right2 = true;
56161
56188
  } else {
56162
- maxValue = chartJSON.yMaxRight;
56189
+ maxValue = max2;
56163
56190
  left2 = true;
56164
56191
  }
56165
- let adjustedPosition = formatOptions.annotation.annotationVisibility != "5" && formatOptions.annotation.annotationPosition == "1" ? 20 : 0;
56166
- let scaleFactor = formatOptions.annotation.annotationVisibility != "5" ? chartJSON.yMaxLeft / maxValue !== 1 ? Math.abs(chartJSON.yMaxLeft / maxValue) * 100 < 10 ? 3 : 0 : Math.abs(chartJSON.yMaxRight / maxValue) * 100 < 10 ? 3 : 0 : 0;
56167
- chartJSON.yMaxLeft = chartJSON.yMaxLeft;
56168
- xScaleForLegends = linear$1().domain([
56169
- chartJSON.yMaxLeft * (1.2 + (left2 ? scaleFactor : 0)),
56170
- chartJSON.yMaxRight * (1.2 + (right2 ? scaleFactor : 0))
56171
- ]).range([adjustedPosition, innerWidth2 - adjustedPosition]);
56192
+ let scaleFactor = formatOptions.annotation.annotationVisibility != "5" ? min2 / maxValue !== 1 ? Math.abs(min2 / maxValue) * 100 < 10 ? 3 : 0 : Math.abs(max2 / maxValue) * 100 < 10 ? 3 : 0 : 0;
56193
+ let domainMin = 0;
56194
+ let domainMax = 0;
56195
+ if (min2 < 0 && max2 > 0) {
56196
+ domainMin = min2 * (1.2 + (left2 ? scaleFactor : 0));
56197
+ domainMax = max2 * (1.2 + (right2 ? scaleFactor : 0));
56198
+ } else if (min2 >= 0 && max2 >= 0) {
56199
+ domainMin = 0;
56200
+ domainMax = max2 * (1.2 + (right2 ? scaleFactor : 0));
56201
+ } else if (min2 <= 0 && max2 <= 0) {
56202
+ domainMin = min2 * (1.2 + (left2 ? scaleFactor : 0));
56203
+ domainMax = 0;
56204
+ } else {
56205
+ domainMin = min2 * 1.2;
56206
+ domainMax = max2 * 1.2;
56207
+ }
56208
+ domainMin = Math.floor(domainMin);
56209
+ domainMax = Math.ceil(domainMax);
56210
+ xScaleForLegends = linear$1().domain([domainMin, domainMax]).range([adjustedPosition, innerWidth2 - adjustedPosition]);
56172
56211
  xScale = xScaleForLegends;
56173
56212
  calculatedRange = [0, innerWidth2];
56174
56213
  getXScale();
@@ -56262,7 +56301,7 @@ const TornadoChart = ({
56262
56301
  [
56263
56302
  {
56264
56303
  key: "Measure",
56265
- value: formatOptions.yAxisTitle.yAxisTitleHTML !== "" ? new DOMParser().parseFromString(formatOptions.yAxisTitle.yAxisTitleHTML, "text/html").body.textContent?.trim() : d.dimension
56304
+ value: formatOptions.yAxisTitle.yAxisTitleHTML !== "" ? new DOMParser().parseFromString(formatOptions.yAxisTitle.yAxisTitleHTML, "text/html").body.textContent?.trim() : !data.IsCalCSensitivity ? d.dimension : d.properties.currentMeasure.split("~$~")[1]
56266
56305
  },
56267
56306
  { key: "Legend", value: d.legendText },
56268
56307
  {
@@ -56278,7 +56317,7 @@ const TornadoChart = ({
56278
56317
  ],
56279
56318
  formatOptions,
56280
56319
  event2,
56281
- d.properties
56320
+ !data.IsCalCSensitivity ? d.properties : d.properties.legend === "Calculated Low(-ve)" ? { markerColor: formatOptions.plotArea.plotAreaCalculatedLow } : { markerColor: formatOptions.plotArea.plotAreaCalculatedHigh }
56282
56321
  );
56283
56322
  }).on("mouseout", hideTooltipOnMouseOut);
56284
56323
  };
@@ -56780,6 +56819,8 @@ const DotPlot = ({
56780
56819
  d.markerColor = lData.properties.markerColor || lData.properties.color;
56781
56820
  d.alias = lData.properties.alias;
56782
56821
  d.lineStyle = lData.properties.lineStyle;
56822
+ d.lineWidth = lData.properties.lineWidth;
56823
+ d.lineColor = formatOptions.plotArea.dotPlotLineColor ?? "#c7c7c7";
56783
56824
  });
56784
56825
  });
56785
56826
  const groupedData = group(
@@ -56799,10 +56840,10 @@ const DotPlot = ({
56799
56840
  ).attr(
56800
56841
  "x2",
56801
56842
  ([, v]) => xScaleBottom(Math.max(v[0]?.value ?? 0, v[1]?.value ?? 0))
56802
- ).attr("stroke", "#c7c7c7").attr("stroke-width", 2).attr("stroke-dasharray", (d) => {
56843
+ ).attr("stroke", (d) => d[1][0].lineColor).attr("stroke-width", (d) => d[1][0].lineStyle !== "None" ? d[1][0].lineWidth : 0).attr("stroke-dasharray", (d) => {
56803
56844
  switch (d[1][0].lineStyle) {
56804
56845
  case staticLineStyle.dotted:
56805
- return `0,${d[1][0].lineStyle + 2}`;
56846
+ return "1,4";
56806
56847
  case staticLineStyle.dashed:
56807
56848
  return strokeDashValues;
56808
56849
  default:
@@ -56856,10 +56897,6 @@ const DotPlot = ({
56856
56897
  event2,
56857
56898
  data2.properties
56858
56899
  );
56859
- let legend = (data2.properties.alias || data2.properties.name || "Legend").replace(/ /g, "-");
56860
- selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
56861
- selectAll('[hoverId="' + legend + '"]').classed("highlight", true).classed("unhighlight", false);
56862
- select$2(event2.currentTarget.parentNode).selectAll(".halo").data([d]).join("circle").attr("class", "halo").attr("cx", xScaleBottom(d.value)).attr("cy", yScale(d.dimension)).attr("r", (d.markerSize || 6) * 3).attr("fill", d.markerColor).attr("opacity", 0.4);
56863
56900
  }).on("mouseout", () => {
56864
56901
  selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
56865
56902
  selectAll(".halo").remove();
@@ -11181,6 +11181,7 @@
11181
11181
  totalColor: "#41a5b4",
11182
11182
  positiveColor: "#9fb700",
11183
11183
  negativeColor: "#e25a42",
11184
+ dotPlotLineColor: "#c7c7c7",
11184
11185
  dataLabelValue: true,
11185
11186
  plotAreaAbsoluteValue: false,
11186
11187
  dataLabelName: true,
@@ -16082,11 +16083,13 @@
16082
16083
  let maxLength = 0;
16083
16084
  let maxLegend = list[0];
16084
16085
  list.forEach((legend) => {
16085
- let splitedLegend = legend.includes("~$~") ? legend.split("~$~")[1] : legend.includes("-") ? legend.slice(legend.indexOf("-") + 1) : legend;
16086
- let splitedLegendLength = splitedLegend.length;
16087
- if (maxLength < splitedLegendLength) {
16088
- maxLength = splitedLegendLength;
16089
- maxLegend = splitedLegend;
16086
+ if (legend !== void 0) {
16087
+ let splitedLegend = legend.includes("~$~") ? legend.split("~$~")[1] : legend.includes("-") ? legend.slice(legend.indexOf("-") + 1) : legend;
16088
+ let splitedLegendLength = splitedLegend.length;
16089
+ if (maxLength < splitedLegendLength) {
16090
+ maxLength = splitedLegendLength;
16091
+ maxLegend = splitedLegend;
16092
+ }
16090
16093
  }
16091
16094
  });
16092
16095
  return calculateWidthHeightDynamically(maxLegend, formatOptions.legends.legendFontSize, formatOptions.legends.legendFontFamily);
@@ -16416,6 +16419,15 @@
16416
16419
  const bgColor = isLightTheme ? "rgba(255, 255, 255)" : "#272729ff";
16417
16420
  const textColor = isLightTheme ? "black" : commonColors.white;
16418
16421
  const subTextColor = isLightTheme ? "gray" : "#d1d5db";
16422
+ const formatValueWithWordLimit = (text, wordsPerLine = 6) => {
16423
+ if (!text) return "";
16424
+ const words = text.split(" ");
16425
+ let result = "";
16426
+ for (let i = 0; i < words.length; i += wordsPerLine) {
16427
+ result += words.slice(i, i + wordsPerLine).join(" ") + "<br/>";
16428
+ }
16429
+ return result;
16430
+ };
16419
16431
  selectAll(".chartTooltip").style("visibility", visibilityCondition.hidden);
16420
16432
  const tooltip = select$2("#chartTooltipDiv").html("").append("div").attr(
16421
16433
  "class",
@@ -16450,29 +16462,53 @@
16450
16462
  }
16451
16463
  })();
16452
16464
  p += `
16453
- <div style="display:flex; align-items:center; margin-bottom:4px;">
16465
+ <div style="
16466
+ display:flex;
16467
+ align-items:flex-start;
16468
+ justify-content:space-between;
16469
+ margin-bottom:6px;
16470
+ gap:10px;
16471
+ ">
16472
+
16473
+ <!-- LEFT SIDE (Dot + Key) -->
16474
+ <div style="
16475
+ display:flex;
16476
+ align-items:flex-start;
16477
+ gap:6px;
16478
+ flex-shrink:0;
16479
+ ">
16454
16480
  <span style="
16455
- display:inline-block;
16456
16481
  width:6px;
16457
16482
  height:6px;
16458
- background-color:${markerColor};
16459
- margin-right:6px;
16460
- ${shapeStyle}
16483
+ background:${markerColor};
16484
+ margin-top:5px;
16485
+ border-radius:50%;
16461
16486
  "></span>
16487
+
16462
16488
  <span style="
16463
- font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;
16464
16489
  font-size:11px;
16465
16490
  color:${subTextColor};
16466
- flex:1;
16467
- ">${c2.key || ""}</span>
16468
- <span style="
16469
- font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;
16470
- font-size:11px;
16471
- color:${textColor};
16472
- font-weight:bold;
16473
- margin-left:6px;
16474
- ">${c2.value || ""}</span>
16475
- </div>`;
16491
+ white-space:nowrap;
16492
+ ">
16493
+ ${c2.key || ""}
16494
+ </span>
16495
+ </div>
16496
+
16497
+ <!-- RIGHT SIDE (Value) -->
16498
+ <div style="
16499
+ font-size:11px;
16500
+ font-weight:bold;
16501
+ color:${textColor};
16502
+ text-align:right;
16503
+ max-width:200px;
16504
+ word-break:break-word;
16505
+ line-height:1.4;
16506
+ ">
16507
+ ${formatValueWithWordLimit(String(c2.value), 6)}
16508
+ </div>
16509
+
16510
+ </div>
16511
+ `;
16476
16512
  return p;
16477
16513
  }, ``);
16478
16514
  tooltip.html(`
@@ -16484,35 +16520,20 @@
16484
16520
  const tooltipNode = tooltip.node();
16485
16521
  const tooltipWidth = tooltipNode.offsetWidth;
16486
16522
  const tooltipHeight = tooltipNode.offsetHeight;
16487
- const halfWidth = window.innerWidth / 2;
16488
- const halfHeight = window.innerHeight / 2;
16489
- let left2 = 0;
16490
- let top2 = 0;
16491
- let arrow = "";
16492
- if (mouseX > halfWidth && mouseY < halfHeight) {
16493
- left2 = mouseX - tooltipWidth - 10;
16494
- top2 = mouseY - 10;
16495
- arrow = "right-top";
16496
- } else if (mouseX < halfWidth && mouseY < halfHeight) {
16497
- left2 = mouseX + 20;
16498
- top2 = mouseY - 10;
16499
- arrow = "left-top";
16500
- } else if (mouseX < halfWidth && mouseY >= halfHeight) {
16501
- left2 = mouseX + 20;
16502
- top2 = mouseY - tooltipHeight + 10;
16503
- arrow = "left-bottom";
16504
- } else {
16523
+ let left2 = mouseX + 15;
16524
+ let top2 = mouseY + 15;
16525
+ if (left2 + tooltipWidth > window.innerWidth) {
16505
16526
  left2 = mouseX - tooltipWidth - 10;
16506
- top2 = mouseY - tooltipHeight + 10;
16507
- arrow = "right-bottom";
16527
+ }
16528
+ if (top2 + tooltipHeight > window.innerHeight) {
16529
+ top2 = mouseY - tooltipHeight - 10;
16508
16530
  }
16509
16531
  tooltip.style("left", `${left2}px`).style("top", `${top2}px`).style(
16510
16532
  "visibility",
16511
- chartFormatOptions.toolTip.toolTipVisibility ? visibilityCondition.visible : visibilityCondition.hidden
16512
- ).style("transform", "scale(1)").style("opacity", "1");
16513
- tooltip.select(".arrow-placeholder").attr("class", `arrow-${arrow}`);
16533
+ chartFormatOptions.toolTip.toolTipVisibility ? "visible" : "hidden"
16534
+ );
16514
16535
  } catch (error) {
16515
- logError$2(fileName$b, "showTooltipOnMouseMove", error);
16536
+ console.error("Tooltip Error:", error);
16516
16537
  }
16517
16538
  }
16518
16539
  function hideTooltipOnMouseOut() {
@@ -16581,12 +16602,14 @@
16581
16602
  const hoverId = this.textContent.replace(/\s+/g, "-");
16582
16603
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
16583
16604
  svg.selectAll(`[hoverId="${hoverId}"]`).classed("highlight", true).classed("unhighlight", false);
16605
+ svg.selectAll(".cleveland-line-group").classed("highlight", false).classed("unhighlight", true);
16584
16606
  }
16585
16607
  }).on("mouseout", function() {
16586
16608
  if (chartFormatOptions.legends.onHoverEffect) {
16587
16609
  const hoverId = this.textContent.replace(/\s+/g, "-");
16588
16610
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
16589
16611
  svg.selectAll(`[hoverId="${hoverId}"]`).classed("highlight", false).classed("unhighlight", false);
16612
+ svg.selectAll(".cleveland-line-group").classed("highlight", false).classed("unhighlight", false);
16590
16613
  }
16591
16614
  });
16592
16615
  if (legendPosition == staticLegendPosition.top || legendPosition == staticLegendPosition.bottom) {
@@ -55636,6 +55659,7 @@
55636
55659
  }
55637
55660
  }
55638
55661
  });
55662
+ gTag.selectAll(".parentGroup").raise();
55639
55663
  };
55640
55664
  const setSVGContainer = (margin2) => {
55641
55665
  innerWidth2 = width - margin2.left - margin2.right;
@@ -55705,7 +55729,6 @@
55705
55729
  drawColumnChart();
55706
55730
  };
55707
55731
  const drawColumnChart = () => {
55708
- getChartType();
55709
55732
  initXaxis$1(
55710
55733
  gTag,
55711
55734
  chartJSON,
@@ -55723,6 +55746,7 @@
55723
55746
  chartJSON.legendList,
55724
55747
  xScale
55725
55748
  );
55749
+ getChartType();
55726
55750
  };
55727
55751
  const generateWaterFallData = () => {
55728
55752
  try {
@@ -55838,7 +55862,7 @@
55838
55862
  const chartId = crypto.randomUUID();
55839
55863
  let columnWidth = 0;
55840
55864
  const chartType = chartTypes.TornadoChart;
55841
- const isAdvanceAnalyticsChart = data.IsadvanceanalyticsChart;
55865
+ const isAdvanceAnalyticsChart = data.IsadvanceanalyticsChart ?? data.IsCalCSensitivity;
55842
55866
  const svgRef = require$$0$1.useRef();
55843
55867
  let seriesData = generalizedChartData(
55844
55868
  data.ChartData,
@@ -56155,23 +56179,38 @@
56155
56179
  }
56156
56180
  };
56157
56181
  const initScale = () => {
56182
+ let min2 = chartJSON.yMaxLeft;
56183
+ let max2 = chartJSON.yMaxRight;
56184
+ let adjustedPosition = formatOptions.annotation.annotationVisibility != "5" && formatOptions.annotation.annotationPosition == "1" ? 20 : 0;
56185
+ let maxValue;
56158
56186
  let right2 = false;
56159
56187
  let left2 = false;
56160
- let maxValue;
56161
- if (chartJSON.yMaxLeft > chartJSON.yMaxRight) {
56162
- maxValue = chartJSON.yMaxLeft;
56188
+ if (min2 > max2) {
56189
+ maxValue = min2;
56163
56190
  right2 = true;
56164
56191
  } else {
56165
- maxValue = chartJSON.yMaxRight;
56192
+ maxValue = max2;
56166
56193
  left2 = true;
56167
56194
  }
56168
- let adjustedPosition = formatOptions.annotation.annotationVisibility != "5" && formatOptions.annotation.annotationPosition == "1" ? 20 : 0;
56169
- let scaleFactor = formatOptions.annotation.annotationVisibility != "5" ? chartJSON.yMaxLeft / maxValue !== 1 ? Math.abs(chartJSON.yMaxLeft / maxValue) * 100 < 10 ? 3 : 0 : Math.abs(chartJSON.yMaxRight / maxValue) * 100 < 10 ? 3 : 0 : 0;
56170
- chartJSON.yMaxLeft = chartJSON.yMaxLeft;
56171
- xScaleForLegends = linear$1().domain([
56172
- chartJSON.yMaxLeft * (1.2 + (left2 ? scaleFactor : 0)),
56173
- chartJSON.yMaxRight * (1.2 + (right2 ? scaleFactor : 0))
56174
- ]).range([adjustedPosition, innerWidth2 - adjustedPosition]);
56195
+ let scaleFactor = formatOptions.annotation.annotationVisibility != "5" ? min2 / maxValue !== 1 ? Math.abs(min2 / maxValue) * 100 < 10 ? 3 : 0 : Math.abs(max2 / maxValue) * 100 < 10 ? 3 : 0 : 0;
56196
+ let domainMin = 0;
56197
+ let domainMax = 0;
56198
+ if (min2 < 0 && max2 > 0) {
56199
+ domainMin = min2 * (1.2 + (left2 ? scaleFactor : 0));
56200
+ domainMax = max2 * (1.2 + (right2 ? scaleFactor : 0));
56201
+ } else if (min2 >= 0 && max2 >= 0) {
56202
+ domainMin = 0;
56203
+ domainMax = max2 * (1.2 + (right2 ? scaleFactor : 0));
56204
+ } else if (min2 <= 0 && max2 <= 0) {
56205
+ domainMin = min2 * (1.2 + (left2 ? scaleFactor : 0));
56206
+ domainMax = 0;
56207
+ } else {
56208
+ domainMin = min2 * 1.2;
56209
+ domainMax = max2 * 1.2;
56210
+ }
56211
+ domainMin = Math.floor(domainMin);
56212
+ domainMax = Math.ceil(domainMax);
56213
+ xScaleForLegends = linear$1().domain([domainMin, domainMax]).range([adjustedPosition, innerWidth2 - adjustedPosition]);
56175
56214
  xScale = xScaleForLegends;
56176
56215
  calculatedRange = [0, innerWidth2];
56177
56216
  getXScale();
@@ -56265,7 +56304,7 @@
56265
56304
  [
56266
56305
  {
56267
56306
  key: "Measure",
56268
- value: formatOptions.yAxisTitle.yAxisTitleHTML !== "" ? new DOMParser().parseFromString(formatOptions.yAxisTitle.yAxisTitleHTML, "text/html").body.textContent?.trim() : d.dimension
56307
+ value: formatOptions.yAxisTitle.yAxisTitleHTML !== "" ? new DOMParser().parseFromString(formatOptions.yAxisTitle.yAxisTitleHTML, "text/html").body.textContent?.trim() : !data.IsCalCSensitivity ? d.dimension : d.properties.currentMeasure.split("~$~")[1]
56269
56308
  },
56270
56309
  { key: "Legend", value: d.legendText },
56271
56310
  {
@@ -56281,7 +56320,7 @@
56281
56320
  ],
56282
56321
  formatOptions,
56283
56322
  event2,
56284
- d.properties
56323
+ !data.IsCalCSensitivity ? d.properties : d.properties.legend === "Calculated Low(-ve)" ? { markerColor: formatOptions.plotArea.plotAreaCalculatedLow } : { markerColor: formatOptions.plotArea.plotAreaCalculatedHigh }
56285
56324
  );
56286
56325
  }).on("mouseout", hideTooltipOnMouseOut);
56287
56326
  };
@@ -56783,6 +56822,8 @@
56783
56822
  d.markerColor = lData.properties.markerColor || lData.properties.color;
56784
56823
  d.alias = lData.properties.alias;
56785
56824
  d.lineStyle = lData.properties.lineStyle;
56825
+ d.lineWidth = lData.properties.lineWidth;
56826
+ d.lineColor = formatOptions.plotArea.dotPlotLineColor ?? "#c7c7c7";
56786
56827
  });
56787
56828
  });
56788
56829
  const groupedData = group(
@@ -56802,10 +56843,10 @@
56802
56843
  ).attr(
56803
56844
  "x2",
56804
56845
  ([, v]) => xScaleBottom(Math.max(v[0]?.value ?? 0, v[1]?.value ?? 0))
56805
- ).attr("stroke", "#c7c7c7").attr("stroke-width", 2).attr("stroke-dasharray", (d) => {
56846
+ ).attr("stroke", (d) => d[1][0].lineColor).attr("stroke-width", (d) => d[1][0].lineStyle !== "None" ? d[1][0].lineWidth : 0).attr("stroke-dasharray", (d) => {
56806
56847
  switch (d[1][0].lineStyle) {
56807
56848
  case staticLineStyle.dotted:
56808
- return `0,${d[1][0].lineStyle + 2}`;
56849
+ return "1,4";
56809
56850
  case staticLineStyle.dashed:
56810
56851
  return strokeDashValues;
56811
56852
  default:
@@ -56859,10 +56900,6 @@
56859
56900
  event2,
56860
56901
  data2.properties
56861
56902
  );
56862
- let legend = (data2.properties.alias || data2.properties.name || "Legend").replace(/ /g, "-");
56863
- selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
56864
- selectAll('[hoverId="' + legend + '"]').classed("highlight", true).classed("unhighlight", false);
56865
- select$2(event2.currentTarget.parentNode).selectAll(".halo").data([d]).join("circle").attr("class", "halo").attr("cx", xScaleBottom(d.value)).attr("cy", yScale(d.dimension)).attr("r", (d.markerSize || 6) * 3).attr("fill", d.markerColor).attr("opacity", 0.4);
56866
56903
  }).on("mouseout", () => {
56867
56904
  selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
56868
56905
  selectAll(".halo").remove();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pace-chart-lib",
3
- "version": "1.0.51",
3
+ "version": "1.0.53",
4
4
  "description": "A simple React + Vite + TS UI library with a Button using custom fonts via SCSS.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import { type TChartProps } from "../ChartsWithAxisTypes.types";
3
- declare const AreaChart: React.FC<TChartProps>;
4
- export default AreaChart;
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import { type TChartProps } from "../ChartsWithAxisTypes.types";
3
- declare const NormalizedStackAreaChart: React.FC<TChartProps>;
4
- export default NormalizedStackAreaChart;
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import { type TChartProps } from "../ChartsWithAxisTypes.types";
3
- declare const StackAreaChart: React.FC<TChartProps>;
4
- export default StackAreaChart;