pace-chart-lib 1.0.36 → 1.0.38

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.
@@ -624,3 +624,4 @@ export declare const clamp: (v: any, a: any, b: any) => number;
624
624
  export declare const horizontalScrollBar: (seriesData: any, height: any, width: any, svg: any, margin: any, innerWidth: any, scrollbarVisible: any, visibleBars: any, chartJSON: any, scrollPosition: any, isStackedChart: any, setAndUpdateChartData: any, isBarChart?: boolean) => void;
625
625
  export declare function addTotalValue(totalValueMap: Map<string, number>, xScale: any, yScale: any, margin: TMargin, d3Annotation: any, oldAnnotationList: any[], formatOptions: TDefaultChartFormatOptionsType, chartType: string, height: number, width: number, svg: any, isReportEditable?: boolean, isBarChart?: boolean): void;
626
626
  export declare function createTotalMeasureValueMap(data: TData, totalValueMap: Map<string, number>, filteredDimension: string[]): void;
627
+ export declare function getVerticalGridLinesTickSize(formatOptions: TDefaultChartFormatOptionsType, innerHeight: number, dataTableHeight: number, shouldAdjustForAxisPosition?: boolean): number;
@@ -12682,7 +12682,7 @@ function initXaxis$1(gTag, chartJSON, xLabel, formatOptions, dataTableHeight, yS
12682
12682
  XaxisG.select(".domain").style("stroke", formatOptions.xAxisLabel.xAxisColor).attr(
12683
12683
  "stroke-width",
12684
12684
  formatOptions.xAxisLabel.xAxisWidth ? formatOptions.xAxisLabel.xAxisWidth : formatOptions.plotArea.plotAreaBorderThickness
12685
- ).style("shape-rendering", "crispEdges");
12685
+ ).style("shape-rendering", "crispEdges").raise();
12686
12686
  return gTag;
12687
12687
  } catch (error) {
12688
12688
  throw error;
@@ -13226,7 +13226,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13226
13226
  }
13227
13227
  });
13228
13228
  if (formatOptions.annotation.annotationHideZeroValues) {
13229
- annotationsList = annotationsList.filter((d) => d.data.y.measure != 0);
13229
+ annotationsList = annotationsList.filter((d) => barChart ? d.data.x.measure != 0 : d.data.y.measure != 0);
13230
13230
  }
13231
13231
  if (oldAnnotationList.length === 0) {
13232
13232
  oldAnnotationList = annotationsList;
@@ -13799,7 +13799,7 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13799
13799
  }
13800
13800
  }
13801
13801
  }
13802
- finalAnnotationList.push(newAnnotation);
13802
+ newAnnotation.data.labelPosition != 4 && finalAnnotationList.push(newAnnotation);
13803
13803
  });
13804
13804
  makeAnnotations.editMode(formatOptions.annotation.annotationDraggable && isReportEditable).accessors({
13805
13805
  x: function(d) {
@@ -15757,6 +15757,13 @@ function createTotalMeasureValueMap(data, totalValueMap, filteredDimension) {
15757
15757
  });
15758
15758
  }
15759
15759
  }
15760
+ function getVerticalGridLinesTickSize(formatOptions, innerHeight2, dataTableHeight, shouldAdjustForAxisPosition = false) {
15761
+ const axisPositionMultiplier = shouldAdjustForAxisPosition ? formatOptions.xAxisLabel.xAxisPosition == "1" ? -1 : 1 : 1;
15762
+ const dataTableHeightIfPreset = dataTableHeight > 0 ? dataTableHeight : 0;
15763
+ const tickHeightPercentage = parseFloat(formatOptions.plotArea.ticksHeight) || 100;
15764
+ const actualTickHeight = (innerHeight2 - dataTableHeightIfPreset) * tickHeightPercentage / 100;
15765
+ return formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? -actualTickHeight * axisPositionMultiplier : 0 : 0;
15766
+ }
15760
15767
  const chartProperties = {
15761
15768
  color: "defaultColor",
15762
15769
  name: "",
@@ -17368,7 +17375,7 @@ const ColumnChart = ({
17368
17375
  const getXAxis = () => {
17369
17376
  let xaxisLabelPosition = parseInt(formatOptions.xAxisLabel.xAxisPosition);
17370
17377
  xAxis = (xaxisLabelPosition == 1 ? axisTop(xScale) : axisBottom(xScale)).tickSize(
17371
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? formatOptions.plotArea.gridLinesVertical ? -(dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) : -formatOptions.plotArea.ticksHeight * ((dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) / 100) : 0 : 0
17378
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, dataTableHeight)
17372
17379
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
17373
17380
  };
17374
17381
  const getChartType = (lineData) => {
@@ -17849,7 +17856,7 @@ const CustomColumnChart = ({
17849
17856
  ...point2,
17850
17857
  type: series.properties.type,
17851
17858
  axis: series.properties.axis,
17852
- labelPosition: formatOptions?.annotation?.annotationPosition.toString() === "4" ? series.properties.dataLabelPosition.toString() : formatOptions?.annotation?.annotationPosition.toString(),
17859
+ labelPosition: formatOptions?.annotation?.annotationPosition.toString() === "4" ? series.properties.annotationPosition.toString() : formatOptions?.annotation?.annotationPosition.toString(),
17853
17860
  labelColor: series.properties.labelColor,
17854
17861
  legendUniqueId: series.properties.legendUniqueId
17855
17862
  };
@@ -18572,7 +18579,7 @@ const CustomColumnChart = ({
18572
18579
  stackData["individualAnnotationVisibility"] = JSON.parse(
18573
18580
  JSON.stringify(requiredStackChatData.data[j].properties.annotation)
18574
18581
  );
18575
- d.data.labelPosition = formatOptions?.annotation?.annotationPosition.toString() === "4" ? requiredStackChatData.data[j].properties.dataLabelPosition.toString() : formatOptions?.annotation?.annotationPosition.toString();
18582
+ d.data.labelPosition = formatOptions?.annotation?.annotationPosition.toString() === "4" ? requiredStackChatData.data[j].properties.annotationPosition.toString() : formatOptions?.annotation?.annotationPosition.toString();
18576
18583
  d.data["labelColor"] = seriesColor == "2" ? JSON.parse(
18577
18584
  JSON.stringify(requiredStackChatData.data[j].properties.color)
18578
18585
  ) : JSON.parse(
@@ -19459,7 +19466,7 @@ const StackColumnChart = ({
19459
19466
  };
19460
19467
  const getXAxis = () => {
19461
19468
  xAxis = axisBottom(xScale).tickSize(
19462
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? formatOptions.plotArea.gridLinesVertical ? -(dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) : parseFloat(formatOptions.plotArea.ticksHeight) * ((dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) / 100) * (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1) : 0 : 0
19469
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, dataTableHeight, true)
19463
19470
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
19464
19471
  };
19465
19472
  const getChartType = (lineData) => {
@@ -25056,6 +25063,7 @@ const LayeredHorizontalBarChart = ({
25056
25063
  lData.data.forEach((cData) => {
25057
25064
  cData.hideZero = lData.properties.hideZeroValues;
25058
25065
  cData.axis = lData.properties.axis;
25066
+ cData["properties"] = lData.properties;
25059
25067
  });
25060
25068
  });
25061
25069
  lineData.forEach((data2, index2) => {
@@ -26384,23 +26392,6 @@ const AreaChart = ({
26384
26392
  const drawAreaChart = () => {
26385
26393
  getXScale();
26386
26394
  getXAxis();
26387
- initXaxis$1(
26388
- gTag,
26389
- chartJSON,
26390
- xLabel,
26391
- formatOptions,
26392
- dataTableHeight,
26393
- yScaleLeft,
26394
- xAxis,
26395
- dimensionHeightWidthArray,
26396
- height,
26397
- barWidth,
26398
- isDateType,
26399
- innerWidth2,
26400
- innerHeight2,
26401
- filteredDimension,
26402
- xScale
26403
- );
26404
26395
  commonAnnotations(
26405
26396
  seriesData,
26406
26397
  xScale,
@@ -26437,6 +26428,23 @@ const AreaChart = ({
26437
26428
  isSecondaryAxisDrawn
26438
26429
  ).labelArray;
26439
26430
  getChartType(filteredData);
26431
+ initXaxis$1(
26432
+ gTag,
26433
+ chartJSON,
26434
+ xLabel,
26435
+ formatOptions,
26436
+ dataTableHeight,
26437
+ yScaleLeft,
26438
+ xAxis,
26439
+ dimensionHeightWidthArray,
26440
+ height,
26441
+ barWidth,
26442
+ isDateType,
26443
+ innerWidth2,
26444
+ innerHeight2,
26445
+ filteredDimension,
26446
+ xScale
26447
+ );
26440
26448
  drawSeriesLabels(formatOptions, gTag, newSeriesLabelArray);
26441
26449
  if (formatOptions.dataTableProperties && formatOptions.dataTableProperties.dataTable) {
26442
26450
  if (formatOptions.xAxisLabel.xAxisPosition != "1")
@@ -26935,6 +26943,7 @@ const StackAreaChart = ({
26935
26943
  const drawLineChart = () => {
26936
26944
  getXScale();
26937
26945
  getXAxis();
26946
+ getChartType(filteredData);
26938
26947
  initXaxis$1(
26939
26948
  gTag,
26940
26949
  chartJSON,
@@ -26952,7 +26961,6 @@ const StackAreaChart = ({
26952
26961
  filteredDimension,
26953
26962
  xScale
26954
26963
  );
26955
- getChartType(filteredData);
26956
26964
  stacklineAnnotations(
26957
26965
  stackChartData,
26958
26966
  xScale,
@@ -54742,7 +54750,8 @@ const WaterfallChart = ({
54742
54750
  };
54743
54751
  const preProcessChartData = () => {
54744
54752
  if (isAdvancedWaterfall) {
54745
- const tempWaterfallChartData2 = mapAdvancedWaterfallData(data);
54753
+ let tempWaterfallChartData2 = mapAdvancedWaterfallData(data);
54754
+ tempWaterfallChartData2 = tempWaterfallChartData2.filter((d) => d.up + d.down + d.base != 0);
54746
54755
  chartJSON.dimensionList = tempWaterfallChartData2.map((d) => d.xKey);
54747
54756
  chartJSON.legendList = chartJSON.dimensionList;
54748
54757
  waterFallData = stack().keys(["base", "dimensionTotal", "up", "down"])(
@@ -12685,7 +12685,7 @@
12685
12685
  XaxisG.select(".domain").style("stroke", formatOptions.xAxisLabel.xAxisColor).attr(
12686
12686
  "stroke-width",
12687
12687
  formatOptions.xAxisLabel.xAxisWidth ? formatOptions.xAxisLabel.xAxisWidth : formatOptions.plotArea.plotAreaBorderThickness
12688
- ).style("shape-rendering", "crispEdges");
12688
+ ).style("shape-rendering", "crispEdges").raise();
12689
12689
  return gTag;
12690
12690
  } catch (error) {
12691
12691
  throw error;
@@ -13229,7 +13229,7 @@
13229
13229
  }
13230
13230
  });
13231
13231
  if (formatOptions.annotation.annotationHideZeroValues) {
13232
- annotationsList = annotationsList.filter((d) => d.data.y.measure != 0);
13232
+ annotationsList = annotationsList.filter((d) => barChart ? d.data.x.measure != 0 : d.data.y.measure != 0);
13233
13233
  }
13234
13234
  if (oldAnnotationList.length === 0) {
13235
13235
  oldAnnotationList = annotationsList;
@@ -13802,7 +13802,7 @@
13802
13802
  }
13803
13803
  }
13804
13804
  }
13805
- finalAnnotationList.push(newAnnotation);
13805
+ newAnnotation.data.labelPosition != 4 && finalAnnotationList.push(newAnnotation);
13806
13806
  });
13807
13807
  makeAnnotations.editMode(formatOptions.annotation.annotationDraggable && isReportEditable).accessors({
13808
13808
  x: function(d) {
@@ -15760,6 +15760,13 @@
15760
15760
  });
15761
15761
  }
15762
15762
  }
15763
+ function getVerticalGridLinesTickSize(formatOptions, innerHeight2, dataTableHeight, shouldAdjustForAxisPosition = false) {
15764
+ const axisPositionMultiplier = shouldAdjustForAxisPosition ? formatOptions.xAxisLabel.xAxisPosition == "1" ? -1 : 1 : 1;
15765
+ const dataTableHeightIfPreset = dataTableHeight > 0 ? dataTableHeight : 0;
15766
+ const tickHeightPercentage = parseFloat(formatOptions.plotArea.ticksHeight) || 100;
15767
+ const actualTickHeight = (innerHeight2 - dataTableHeightIfPreset) * tickHeightPercentage / 100;
15768
+ return formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? -actualTickHeight * axisPositionMultiplier : 0 : 0;
15769
+ }
15763
15770
  const chartProperties = {
15764
15771
  color: "defaultColor",
15765
15772
  name: "",
@@ -17371,7 +17378,7 @@
17371
17378
  const getXAxis = () => {
17372
17379
  let xaxisLabelPosition = parseInt(formatOptions.xAxisLabel.xAxisPosition);
17373
17380
  xAxis = (xaxisLabelPosition == 1 ? axisTop(xScale) : axisBottom(xScale)).tickSize(
17374
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? formatOptions.plotArea.gridLinesVertical ? -(dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) : -formatOptions.plotArea.ticksHeight * ((dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) / 100) : 0 : 0
17381
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, dataTableHeight)
17375
17382
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
17376
17383
  };
17377
17384
  const getChartType = (lineData) => {
@@ -17852,7 +17859,7 @@
17852
17859
  ...point2,
17853
17860
  type: series.properties.type,
17854
17861
  axis: series.properties.axis,
17855
- labelPosition: formatOptions?.annotation?.annotationPosition.toString() === "4" ? series.properties.dataLabelPosition.toString() : formatOptions?.annotation?.annotationPosition.toString(),
17862
+ labelPosition: formatOptions?.annotation?.annotationPosition.toString() === "4" ? series.properties.annotationPosition.toString() : formatOptions?.annotation?.annotationPosition.toString(),
17856
17863
  labelColor: series.properties.labelColor,
17857
17864
  legendUniqueId: series.properties.legendUniqueId
17858
17865
  };
@@ -18575,7 +18582,7 @@
18575
18582
  stackData["individualAnnotationVisibility"] = JSON.parse(
18576
18583
  JSON.stringify(requiredStackChatData.data[j].properties.annotation)
18577
18584
  );
18578
- d.data.labelPosition = formatOptions?.annotation?.annotationPosition.toString() === "4" ? requiredStackChatData.data[j].properties.dataLabelPosition.toString() : formatOptions?.annotation?.annotationPosition.toString();
18585
+ d.data.labelPosition = formatOptions?.annotation?.annotationPosition.toString() === "4" ? requiredStackChatData.data[j].properties.annotationPosition.toString() : formatOptions?.annotation?.annotationPosition.toString();
18579
18586
  d.data["labelColor"] = seriesColor == "2" ? JSON.parse(
18580
18587
  JSON.stringify(requiredStackChatData.data[j].properties.color)
18581
18588
  ) : JSON.parse(
@@ -19462,7 +19469,7 @@
19462
19469
  };
19463
19470
  const getXAxis = () => {
19464
19471
  xAxis = axisBottom(xScale).tickSize(
19465
- formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? formatOptions.plotArea.gridLinesVertical ? -(dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) : parseFloat(formatOptions.plotArea.ticksHeight) * ((dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) / 100) * (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1) : 0 : 0
19472
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, dataTableHeight, true)
19466
19473
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
19467
19474
  };
19468
19475
  const getChartType = (lineData) => {
@@ -25059,6 +25066,7 @@
25059
25066
  lData.data.forEach((cData) => {
25060
25067
  cData.hideZero = lData.properties.hideZeroValues;
25061
25068
  cData.axis = lData.properties.axis;
25069
+ cData["properties"] = lData.properties;
25062
25070
  });
25063
25071
  });
25064
25072
  lineData.forEach((data2, index2) => {
@@ -26387,23 +26395,6 @@
26387
26395
  const drawAreaChart = () => {
26388
26396
  getXScale();
26389
26397
  getXAxis();
26390
- initXaxis$1(
26391
- gTag,
26392
- chartJSON,
26393
- xLabel,
26394
- formatOptions,
26395
- dataTableHeight,
26396
- yScaleLeft,
26397
- xAxis,
26398
- dimensionHeightWidthArray,
26399
- height,
26400
- barWidth,
26401
- isDateType,
26402
- innerWidth2,
26403
- innerHeight2,
26404
- filteredDimension,
26405
- xScale
26406
- );
26407
26398
  commonAnnotations(
26408
26399
  seriesData,
26409
26400
  xScale,
@@ -26440,6 +26431,23 @@
26440
26431
  isSecondaryAxisDrawn
26441
26432
  ).labelArray;
26442
26433
  getChartType(filteredData);
26434
+ initXaxis$1(
26435
+ gTag,
26436
+ chartJSON,
26437
+ xLabel,
26438
+ formatOptions,
26439
+ dataTableHeight,
26440
+ yScaleLeft,
26441
+ xAxis,
26442
+ dimensionHeightWidthArray,
26443
+ height,
26444
+ barWidth,
26445
+ isDateType,
26446
+ innerWidth2,
26447
+ innerHeight2,
26448
+ filteredDimension,
26449
+ xScale
26450
+ );
26443
26451
  drawSeriesLabels(formatOptions, gTag, newSeriesLabelArray);
26444
26452
  if (formatOptions.dataTableProperties && formatOptions.dataTableProperties.dataTable) {
26445
26453
  if (formatOptions.xAxisLabel.xAxisPosition != "1")
@@ -26938,6 +26946,7 @@
26938
26946
  const drawLineChart = () => {
26939
26947
  getXScale();
26940
26948
  getXAxis();
26949
+ getChartType(filteredData);
26941
26950
  initXaxis$1(
26942
26951
  gTag,
26943
26952
  chartJSON,
@@ -26955,7 +26964,6 @@
26955
26964
  filteredDimension,
26956
26965
  xScale
26957
26966
  );
26958
- getChartType(filteredData);
26959
26967
  stacklineAnnotations(
26960
26968
  stackChartData,
26961
26969
  xScale,
@@ -54745,7 +54753,8 @@
54745
54753
  };
54746
54754
  const preProcessChartData = () => {
54747
54755
  if (isAdvancedWaterfall) {
54748
- const tempWaterfallChartData2 = mapAdvancedWaterfallData(data);
54756
+ let tempWaterfallChartData2 = mapAdvancedWaterfallData(data);
54757
+ tempWaterfallChartData2 = tempWaterfallChartData2.filter((d) => d.up + d.down + d.base != 0);
54749
54758
  chartJSON.dimensionList = tempWaterfallChartData2.map((d) => d.xKey);
54750
54759
  chartJSON.legendList = chartJSON.dimensionList;
54751
54760
  waterFallData = stack().keys(["base", "dimensionTotal", "up", "down"])(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pace-chart-lib",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
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",