pace-chart-lib 1.0.68 → 1.0.69

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.
@@ -11332,7 +11332,8 @@
11332
11332
  totalHideZeroValues: true,
11333
11333
  totalDisplayUnits: "None",
11334
11334
  editTotalTextToggle: false,
11335
- editTotalText: "Total"
11335
+ editTotalText: "Total",
11336
+ showTotalLabel: true
11336
11337
  },
11337
11338
  toolTip: {
11338
11339
  toolTipVisibility: true,
@@ -13597,7 +13598,15 @@
13597
13598
  const ease = effectsMap[formatOptions.animation.animationEffect];
13598
13599
  const accessors = makeAnnotations.accessors();
13599
13600
  const isLineChartType = chartType === chartTypes.LineChart;
13600
- if (isLineChartType) {
13601
+ const isDotPlot = chartType === chartTypes.DotPlot;
13602
+ const toTranslate = (d, dx = 0) => {
13603
+ const x2 = accessors.x(d.data);
13604
+ const y2 = accessors.y(d.data);
13605
+ return `translate(${x2 + dx}, ${y2})`;
13606
+ };
13607
+ if (isDotPlot) {
13608
+ annotations.selectAll(".annotation").attr("opacity", 0).attr("transform", (d) => toTranslate(d, -15)).transition().duration(duration).ease(ease).attr("opacity", 1).attr("transform", (d) => toTranslate(d));
13609
+ } else if (isLineChartType) {
13601
13610
  const xRange = xScale.range ? xScale.range() : [0, 1];
13602
13611
  const xRangeMin = Math.min(xRange[0], xRange[1]);
13603
13612
  const xRangeSpan = Math.max(xRange[0], xRange[1]) - xRangeMin;
@@ -28846,7 +28855,9 @@
28846
28855
  chartFormatOptions.total.totalDecimalPrecision
28847
28856
  )(totalValue);
28848
28857
  let cords = getTotalValueCords(chartFormatOptions, chartTitleHeight, innerWidth2, innerHeight2);
28849
- chartAreaTagG.append("g").attr("transform", `translate(${cords.x}, ${cords.y})`).style("user-select", "none").append("text").text(`${chartFormatOptions.total.editTotalTextToggle ? chartFormatOptions.total.editTotalText : "Total"} : ${formatedTotalValue}`).style(
28858
+ chartAreaTagG.append("g").attr("transform", `translate(${cords.x}, ${cords.y})`).style("user-select", "none").append("text").text(
28859
+ chartFormatOptions.total.showTotalLabel !== false ? `${chartFormatOptions.total.editTotalTextToggle ? chartFormatOptions.total.editTotalText : "Total"} : ${formatedTotalValue}` : formatedTotalValue
28860
+ ).style(
28850
28861
  "fill",
28851
28862
  chartFormatOptions.total.totalColor !== commonColors.white ? chartFormatOptions.total.totalColor : "none"
28852
28863
  ).style("font-family", chartFormatOptions.total.totalFontFamily).style("font-size", chartFormatOptions.total.totalFontSize).style("font-style", fontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : "").style(
@@ -29751,7 +29762,8 @@
29751
29762
  if (chartFormatOptions.total && chartFormatOptions.total.totalVisibility) {
29752
29763
  let total = pieTotalValue;
29753
29764
  let fontStyle = chartFormatOptions.total.totalFontStyle;
29754
- chartAreaTagG.append("g").attr("transform", getPiePosition()).attr("pointer-events", "none").attr("text-anchor", "middle").append("text").style(
29765
+ const totalGroup = chartAreaTagG.append("g").attr("transform", getPiePosition()).attr("pointer-events", "none").attr("text-anchor", "middle");
29766
+ totalGroup.append("text").style(
29755
29767
  "fill",
29756
29768
  chartFormatOptions.total.totalColor !== commonColors.white ? chartFormatOptions.total.totalColor : "none"
29757
29769
  ).style("font-family", chartFormatOptions.total.totalFontFamily).style("font-size", chartFormatOptions.total.totalFontSize).style(
@@ -29766,7 +29778,7 @@
29766
29778
  ).attr("text-anchor", "middle").attr(
29767
29779
  "visibility",
29768
29780
  chartFormatOptions.plotArea.dataLabelValue ? "visible" : "hidden"
29769
- ).text(chartFormatOptions.total.editTotalText).append("tspan").attr("x", 0).attr("y", "1.3em").attr(
29781
+ ).text(chartFormatOptions.total.showTotalLabel !== false ? chartFormatOptions.total.editTotalText : "").append("tspan").attr("x", 0).attr("y", chartFormatOptions.total.showTotalLabel !== false ? "1.3em" : "0").attr(
29770
29782
  "font-weight",
29771
29783
  fontStyle.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : 300
29772
29784
  ).text(
@@ -29776,6 +29788,9 @@
29776
29788
  chartFormatOptions.total.totalDecimalPrecision
29777
29789
  )(total)
29778
29790
  );
29791
+ if (chartFormatOptions.animation.animationEnabled) {
29792
+ totalGroup.attr("opacity", 0).transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("opacity", 1);
29793
+ }
29779
29794
  }
29780
29795
  } catch (error) {
29781
29796
  logError$2(fileName$7, "drawTotalValue", error);
@@ -31427,7 +31442,17 @@
31427
31442
  )(d)
31428
31443
  ).attr("visibility", (d) => d === "" ? "hidden" : "visible");
31429
31444
  if (chartFormatOptions.animation.animationEnabled) {
31430
- lg.selectAll("text").attr("opacity", 0).transition().duration(chartFormatOptions.animation.animationDuration).ease(effectsMap[chartFormatOptions.animation.animationEffect]).attr("opacity", 1);
31445
+ const duration = chartFormatOptions.animation.animationDuration;
31446
+ const ease = effectsMap[chartFormatOptions.animation.animationEffect];
31447
+ lg.selectAll("text").attr("opacity", 0).attr("transform", function(d, i) {
31448
+ const factor = range2 / config.majorTicks * i;
31449
+ const tickAngle = config.minAngle + factor;
31450
+ return `rotate(${tickAngle}) translate(0, ${config.labelInset - radius + 20})`;
31451
+ }).transition().duration(duration).ease(ease).attr("opacity", 1).attr("transform", function(d, i) {
31452
+ const factor = range2 / config.majorTicks * i;
31453
+ const tickAngle = config.minAngle + factor;
31454
+ return `rotate(${tickAngle}) translate(0, ${config.labelInset - radius})`;
31455
+ });
31431
31456
  }
31432
31457
  }
31433
31458
  if (chartFormatOptions.pointerValue.showPointerValue && seriesData.length === 2) {
@@ -56492,7 +56517,7 @@
56492
56517
  rects = rectsEnter.merge(rects);
56493
56518
  if (formatOptions.plotArea.plotAreaDataLabel == "2" && k2 != 1) {
56494
56519
  const textGroups = barGroups.selectAll("text").data((d) => d);
56495
- textGroups.enter().append("text").text(
56520
+ const textEnter = textGroups.enter().append("text").text(
56496
56521
  (d) => getNumberWithFormat(
56497
56522
  d[1] - d[0],
56498
56523
  formatOptions.plotArea.plotAreaDisplayUnits,
@@ -56504,10 +56529,12 @@
56504
56529
  (d) => xScale(
56505
56530
  !isAdvancedWaterfall ? d.data.dimension || d.data.legend : d.data.xKey
56506
56531
  ) + xScale.bandwidth() / 2
56507
- ).attr("y", (d) => d[1] ? yScaleLeft(d[1]) - 15 : 0).style("font-size", "11px").attr("text-anchor", "middle").attr(
56532
+ ).attr("y", yScaleLeft(0) ?? 0).style("font-size", "11px").attr("text-anchor", "middle").attr(
56508
56533
  "visibility",
56509
56534
  (d) => d[1] - d[0] !== 0 && yScaleLeft(d[1]) ? "visible" : "hidden"
56510
56535
  );
56536
+ const finalTexts = shouldAnimate ? textEnter.transition().duration(formatOptions.animation.animationDuration).ease(effectsMap[formatOptions.animation.animationEffect]) : textEnter;
56537
+ finalTexts.attr("y", (d) => d[1] ? yScaleLeft(d[1]) - 15 : 0);
56511
56538
  textGroups.exit().remove();
56512
56539
  }
56513
56540
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pace-chart-lib",
3
- "version": "1.0.68",
3
+ "version": "1.0.69",
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",