@nova-ui/charts 13.0.10-4556 → 13.0.10-4572

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.
@@ -4236,6 +4236,7 @@ class RenderEngine {
4236
4236
  dataSeries: chartSeries,
4237
4237
  containers: childContainers,
4238
4238
  scales: chartSeries.scales,
4239
+ parentContainer: this.renderLayers.data,
4239
4240
  };
4240
4241
  chartSeries.renderer.highlightDataPoint(renderSeries, index, this.rendererSubject);
4241
4242
  }
@@ -5751,17 +5752,19 @@ class InteractionLabelPlugin extends ChartPlugin {
5751
5752
  const textSelection = interactionLabel
5752
5753
  .select("text")
5753
5754
  .text(labelContent);
5754
- const bbox = textSelection.node().getBBox();
5755
+ if (!this.elBBox) {
5756
+ this.elBBox = textSelection.node().getBBox();
5757
+ }
5755
5758
  const gridDimension = this.chart.getGrid().config().dimension;
5756
5759
  // subtract the relative vertical text offset inside the bbox from
5757
5760
  // the grid height to determine the label's vertical placement
5758
- const heightOffset = gridDimension.height() - bbox.y;
5761
+ const heightOffset = gridDimension.height() - this.elBBox.y;
5759
5762
  textSelection
5760
5763
  .attr("transform", `translate(0, ${heightOffset})`)
5761
5764
  .style("text-anchor", "middle");
5762
5765
  // match the horizontal padding to the built-in bbox vertical padding
5763
- const horizontalPadding = (bbox.height + bbox.y) * 2;
5764
- const labelWidth = bbox.width + horizontalPadding;
5766
+ const horizontalPadding = (this.elBBox.height + this.elBBox.y) * 2;
5767
+ const labelWidth = this.elBBox.width + horizontalPadding;
5765
5768
  const allowedRange = [
5766
5769
  labelWidth / 2,
5767
5770
  gridDimension.width() - labelWidth / 2,
@@ -5774,9 +5777,9 @@ class InteractionLabelPlugin extends ChartPlugin {
5774
5777
  .attrs({
5775
5778
  transform: `translate(0,${heightOffset})`,
5776
5779
  x: -(labelWidth / 2),
5777
- y: bbox.y,
5780
+ y: this.elBBox.y,
5778
5781
  width: labelWidth,
5779
- height: bbox.height,
5782
+ height: this.elBBox.height,
5780
5783
  });
5781
5784
  }
5782
5785
  destroy() {
@@ -7582,7 +7585,7 @@ function stackedPreprocessor(chartSeriesSet, isVisible) {
7582
7585
  if (chartSeriesSet.length === 0) {
7583
7586
  return chartSeriesSet;
7584
7587
  }
7585
- const categories = gatherCategories(chartSeriesSet);
7588
+ const categories = gatherCategories(chartSeriesSet.filter((chartSeries) => isUndefined(chartSeries.preprocess) || chartSeries.preprocess));
7586
7589
  // This is adding metadata to the dataset and filling missing
7587
7590
  chartSeriesSet.reduce((acc, chartSeries) => {
7588
7591
  if (!isUndefined(chartSeries.preprocess) && !chartSeries.preprocess) {
@@ -9778,6 +9781,65 @@ class BarHighlightStrategy {
9778
9781
  draw(renderer, renderSeries, rendererSubject) { }
9779
9782
  }
9780
9783
 
9784
+ // © 2022 SolarWinds Worldwide, LLC. All rights reserved.
9785
+ // creates an outline element that is used to highlight hovered parts of the chart
9786
+ class BarHighlightStrategyOutline extends BarHighlightStrategy {
9787
+ /**
9788
+ * @param scaleKey scale that will be used for searching for the data point that will be highlighted
9789
+ * @param levels for band scales, how many levels deep do we go to compare values
9790
+ */
9791
+ constructor(scaleKey, levels = 1, selectedDataPointIdxFn) {
9792
+ super(scaleKey, levels, selectedDataPointIdxFn);
9793
+ this.outlineAdd = 6;
9794
+ this.outlineElsMap = new Map();
9795
+ }
9796
+ highlightDataPoint(renderer, renderSeries, dataPointIndex) {
9797
+ const target = renderSeries.containers[RenderLayerName.data];
9798
+ const selectedDataPointIdx = !isUndefined(this.selectedDataPointIdxFn)
9799
+ ? this.selectedDataPointIdxFn(renderSeries.dataSeries.id)
9800
+ : DATA_POINT_NOT_FOUND;
9801
+ const gNodes = target
9802
+ .selectAll(`g.${renderer.barContainerClass}`)
9803
+ .nodes();
9804
+ const emphasizedNode = gNodes[dataPointIndex] || gNodes[selectedDataPointIdx];
9805
+ if (!renderSeries.parentContainer) {
9806
+ return;
9807
+ }
9808
+ // needs to replace all '.' from the serie id as the dot would be treated as a class name in the query selector
9809
+ const outlineRectClass = `${renderer.barContainerClass}-outline-${renderSeries.dataSeries.id}`
9810
+ .split(".")
9811
+ .join("-");
9812
+ if (!this.outlineElsMap.has(outlineRectClass)) {
9813
+ // creates a rect element that will be used as a outline
9814
+ const rect = renderSeries.parentContainer.append("rect");
9815
+ rect.classed(outlineRectClass, true);
9816
+ this.outlineElsMap.set(outlineRectClass, rect);
9817
+ }
9818
+ const outlineRect = this.outlineElsMap.get(outlineRectClass);
9819
+ const emphasizedDataValue = renderSeries.dataSeries.data[dataPointIndex]?.y ||
9820
+ renderSeries.dataSeries.data[dataPointIndex]?.value;
9821
+ if (emphasizedDataValue && emphasizedNode && outlineRect) {
9822
+ // position the outline element on the position of the emphasized element and updates its attributes
9823
+ const emphasizedRect = select$1(emphasizedNode).select("rect");
9824
+ const x = parseFloat(emphasizedRect.attr("x")) - this.outlineAdd / 2;
9825
+ const y = parseFloat(emphasizedRect.attr("y")) - this.outlineAdd / 2;
9826
+ const width = parseFloat(emphasizedRect.attr("width")) + this.outlineAdd;
9827
+ const height = parseFloat(emphasizedRect.attr("height")) + this.outlineAdd;
9828
+ outlineRect.attr("x", x);
9829
+ outlineRect.attr("y", y);
9830
+ outlineRect.attr("width", width);
9831
+ outlineRect.attr("height", height);
9832
+ outlineRect.style("fill", emphasizedRect.style("fill"));
9833
+ outlineRect.style("display", "inline");
9834
+ }
9835
+ if ((outlineRect && !emphasizedDataValue) ||
9836
+ (outlineRect && !emphasizedNode)) {
9837
+ // hides outline element when there is no emphasized element
9838
+ outlineRect.style("display", "none");
9839
+ }
9840
+ }
9841
+ }
9842
+
9781
9843
  // © 2022 SolarWinds Worldwide, LLC. All rights reserved.
9782
9844
  class BarSeriesHighlightStrategy {
9783
9845
  /**
@@ -10334,5 +10396,5 @@ function thresholdsTopGridConfig(c = new XYGridConfig()) {
10334
10396
  * Generated bundle index. Do not edit.
10335
10397
  */
10336
10398
 
10337
- export { AXES_STYLE_CHANGE_EVENT, AreaAccessors, AreaGridConfig, AreaRenderer, AxisConfig, BandScale, BarAccessors, BarGridConfig, BarHighlightStrategy, BarHorizontalGridConfig, BarRenderer, BarSeriesHighlightStrategy, BarStatusGridConfig, BarTooltipsPlugin, BasicLegendTileComponent, BorderConfig, CHART_COMPONENT, CHART_MARKERS, CHART_PALETTE_CS1, CHART_PALETTE_CS2, CHART_PALETTE_CS3, CHART_PALETTE_CS_S, CHART_PALETTE_CS_S_EXTENDED, CHART_VIEW_STATUS_EVENT, Chart, ChartAssist, ChartAssistEventType, ChartAssistRenderStateData, ChartCollection, ChartCollectionIdDirective, ChartCollectionService, ChartComponent, ChartDonutContentComponent, ChartDonutContentPlugin, ChartMarkerComponent, ChartPalette, ChartPlugin, ChartPopoverComponent, ChartPopoverPlugin, ChartTooltipComponent, ChartTooltipDirective, ChartTooltipsComponent, ChartTooltipsPlugin, CssFilterId, DATA_POINT_INTERACTION_RESET, DATA_POINT_NOT_FOUND, DEFAULT_DONUT_GAUGE_THRESHOLDS_RENDERER_CONFIG, DEFAULT_LINEAR_GAUGE_THRESHOLDS_RENDERER_CONFIG, DEFAULT_MARKER_INTERACTION_CONFIG, DEFAULT_RADIAL_RENDERER_CONFIG, DESTROY_EVENT, DONUT_GAUGE_LABEL_CLEARANCE_DEFAULT, DataManager, DataSeries, DimensionConfig, DonutGaugeLabelsPlugin, DonutGaugeRenderingUtil, DonutGaugeThresholdsRenderer, EMPTY_CONTINUOUS_DOMAIN, EventBus, GAUGE_LABELS_CONTAINER_CLASS, GAUGE_LABEL_FORMATTER_NAME_DEFAULT, GAUGE_QUANTITY_SERIES_ID, GAUGE_REMAINDER_SERIES_ID, GAUGE_THRESHOLD_LABEL_CLASS, GAUGE_THRESHOLD_MARKERS_SERIES_ID, GAUGE_THRESHOLD_MARKER_CLASS, GRAYSCALE_COLOR_MATRIX, GRAYSCALE_FILTER, GaugeMode, GaugeUtil, Grid, GridConfig, HIGHLIGHT_DATA_POINT_EVENT, HIGHLIGHT_SERIES_EVENT, HorizontalBarAccessors, IGNORE_INTERACTION_CLASS, INTERACTION_COORDINATES_EVENT, INTERACTION_DATA_POINTS_EVENT, INTERACTION_DATA_POINT_EVENT, INTERACTION_SERIES_EVENT, INTERACTION_VALUES_ACTIVE_EVENT, INTERACTION_VALUES_EVENT, InteractionLabelPlugin, InteractionLinePlugin, InteractionType, LEGEND_SERIES_CLASS_NAME, LINEAR_GAUGE_LABEL_CLEARANCE_DEFAULTS, Lasagna, LegendComponent, LegendInteractionAssist, LegendSeriesComponent, LineAccessors, LineRenderer, LineSelectSeriesInteractionStrategy, LinearGaugeLabelsPlugin, LinearGaugeThresholdsRenderer, LinearScale, MOUSE_ACTIVE_EVENT, MappedValueProvider, MissingDataLineRendererConfig, MouseInteractiveArea, MouseInteractiveAreaPlugin, NORMALIZED_DOMAIN, NoopAccessors, NoopRenderer, NoopScale, NuiChartsModule, PathMarker, PieRenderer, PointScale, ProcessedColorProvider, REFRESH_EVENT, RadialAccessors, RadialGrid, RadialPopoverPlugin, RadialRenderer, RadialTooltipsPlugin, RectangleAccessors, RenderEngine, RenderEnginePlugin, RenderLayerName, RenderState, Renderer, RichLegendTileComponent, SELECT_DATA_POINT_EVENT, SERIES_STATE_CHANGE_EVENT, SET_DOMAIN_EVENT, STANDARD_RENDER_LAYERS, Scale, SequentialChartMarkerProvider, SequentialColorProvider, SequentialValueProvider, SideIndicatorAccessors, SideIndicatorRenderer, SparkChartAssist, StandardGaugeColor, StandardGaugeThresholdId, StandardGaugeThresholdMarkerRadius, StandardLinearGaugeThickness, StatusAccessors, SvgMarker, THRESHOLDS_MAIN_CHART_RENDERER_CONFIG, THRESHOLDS_SUMMARY_RENDERER_CONFIG, TOOLTIP_POSITION_OFFSET, TextColorProvider, ThresholdsService, TimeIntervalScale, TimeScale, TimeseriesZoomPlugin, TimeseriesZoomPluginsSyncService, UtilityService, VerticalBarAccessors, XYAccessors, XYGrid, XYGridConfig, XYRenderer, ZoneBoundary, ZoomPlugin, applyStackMetadata, areaGrid, barAccessors, barGrid, barScales, borderMidpoint, calculateDomainValueCombinedTotals, calculateMissingData, convert, datetimeFormatter, defaultColorProvider, defaultMarkerProvider, defaultPalette, domainWithAuxiliarySeries, donutGaugeRendererConfig, getAutomaticDomain, getAutomaticDomainWithIncludedInterval, getAutomaticDomainWithTicks, getColorValueByName, getHorizontalSetup, getVerticalSetup, hasInnerScale, invert, isBandScale, isDaylightSavingTime, isDomainWithTicksCalculator, linearGaugeGridConfig, mergeDomains, radial, radialGrid, radialPreprocessor, radialScales, sparkChartGridConfig, stack, stackedArea, stackedAreaAccessors, stackedAreaPreprocessor, stackedPercentageArea, stackedPercentageAreaPreprocessor, stackedPreprocessor, statusAccessors, thresholdsSummaryGridConfig, thresholdsTopGridConfig };
10399
+ export { AXES_STYLE_CHANGE_EVENT, AreaAccessors, AreaGridConfig, AreaRenderer, AxisConfig, BandScale, BarAccessors, BarGridConfig, BarHighlightStrategy, BarHighlightStrategyOutline, BarHorizontalGridConfig, BarRenderer, BarSeriesHighlightStrategy, BarStatusGridConfig, BarTooltipsPlugin, BasicLegendTileComponent, BorderConfig, CHART_COMPONENT, CHART_MARKERS, CHART_PALETTE_CS1, CHART_PALETTE_CS2, CHART_PALETTE_CS3, CHART_PALETTE_CS_S, CHART_PALETTE_CS_S_EXTENDED, CHART_VIEW_STATUS_EVENT, Chart, ChartAssist, ChartAssistEventType, ChartAssistRenderStateData, ChartCollection, ChartCollectionIdDirective, ChartCollectionService, ChartComponent, ChartDonutContentComponent, ChartDonutContentPlugin, ChartMarkerComponent, ChartPalette, ChartPlugin, ChartPopoverComponent, ChartPopoverPlugin, ChartTooltipComponent, ChartTooltipDirective, ChartTooltipsComponent, ChartTooltipsPlugin, CssFilterId, DATA_POINT_INTERACTION_RESET, DATA_POINT_NOT_FOUND, DEFAULT_DONUT_GAUGE_THRESHOLDS_RENDERER_CONFIG, DEFAULT_LINEAR_GAUGE_THRESHOLDS_RENDERER_CONFIG, DEFAULT_MARKER_INTERACTION_CONFIG, DEFAULT_RADIAL_RENDERER_CONFIG, DESTROY_EVENT, DONUT_GAUGE_LABEL_CLEARANCE_DEFAULT, DataManager, DataSeries, DimensionConfig, DonutGaugeLabelsPlugin, DonutGaugeRenderingUtil, DonutGaugeThresholdsRenderer, EMPTY_CONTINUOUS_DOMAIN, EventBus, GAUGE_LABELS_CONTAINER_CLASS, GAUGE_LABEL_FORMATTER_NAME_DEFAULT, GAUGE_QUANTITY_SERIES_ID, GAUGE_REMAINDER_SERIES_ID, GAUGE_THRESHOLD_LABEL_CLASS, GAUGE_THRESHOLD_MARKERS_SERIES_ID, GAUGE_THRESHOLD_MARKER_CLASS, GRAYSCALE_COLOR_MATRIX, GRAYSCALE_FILTER, GaugeMode, GaugeUtil, Grid, GridConfig, HIGHLIGHT_DATA_POINT_EVENT, HIGHLIGHT_SERIES_EVENT, HorizontalBarAccessors, IGNORE_INTERACTION_CLASS, INTERACTION_COORDINATES_EVENT, INTERACTION_DATA_POINTS_EVENT, INTERACTION_DATA_POINT_EVENT, INTERACTION_SERIES_EVENT, INTERACTION_VALUES_ACTIVE_EVENT, INTERACTION_VALUES_EVENT, InteractionLabelPlugin, InteractionLinePlugin, InteractionType, LEGEND_SERIES_CLASS_NAME, LINEAR_GAUGE_LABEL_CLEARANCE_DEFAULTS, Lasagna, LegendComponent, LegendInteractionAssist, LegendSeriesComponent, LineAccessors, LineRenderer, LineSelectSeriesInteractionStrategy, LinearGaugeLabelsPlugin, LinearGaugeThresholdsRenderer, LinearScale, MOUSE_ACTIVE_EVENT, MappedValueProvider, MissingDataLineRendererConfig, MouseInteractiveArea, MouseInteractiveAreaPlugin, NORMALIZED_DOMAIN, NoopAccessors, NoopRenderer, NoopScale, NuiChartsModule, PathMarker, PieRenderer, PointScale, ProcessedColorProvider, REFRESH_EVENT, RadialAccessors, RadialGrid, RadialPopoverPlugin, RadialRenderer, RadialTooltipsPlugin, RectangleAccessors, RenderEngine, RenderEnginePlugin, RenderLayerName, RenderState, Renderer, RichLegendTileComponent, SELECT_DATA_POINT_EVENT, SERIES_STATE_CHANGE_EVENT, SET_DOMAIN_EVENT, STANDARD_RENDER_LAYERS, Scale, SequentialChartMarkerProvider, SequentialColorProvider, SequentialValueProvider, SideIndicatorAccessors, SideIndicatorRenderer, SparkChartAssist, StandardGaugeColor, StandardGaugeThresholdId, StandardGaugeThresholdMarkerRadius, StandardLinearGaugeThickness, StatusAccessors, SvgMarker, THRESHOLDS_MAIN_CHART_RENDERER_CONFIG, THRESHOLDS_SUMMARY_RENDERER_CONFIG, TOOLTIP_POSITION_OFFSET, TextColorProvider, ThresholdsService, TimeIntervalScale, TimeScale, TimeseriesZoomPlugin, TimeseriesZoomPluginsSyncService, UtilityService, VerticalBarAccessors, XYAccessors, XYGrid, XYGridConfig, XYRenderer, ZoneBoundary, ZoomPlugin, applyStackMetadata, areaGrid, barAccessors, barGrid, barScales, borderMidpoint, calculateDomainValueCombinedTotals, calculateMissingData, convert, datetimeFormatter, defaultColorProvider, defaultMarkerProvider, defaultPalette, domainWithAuxiliarySeries, donutGaugeRendererConfig, getAutomaticDomain, getAutomaticDomainWithIncludedInterval, getAutomaticDomainWithTicks, getColorValueByName, getHorizontalSetup, getVerticalSetup, hasInnerScale, invert, isBandScale, isDaylightSavingTime, isDomainWithTicksCalculator, linearGaugeGridConfig, mergeDomains, radial, radialGrid, radialPreprocessor, radialScales, sparkChartGridConfig, stack, stackedArea, stackedAreaAccessors, stackedAreaPreprocessor, stackedPercentageArea, stackedPercentageAreaPreprocessor, stackedPreprocessor, statusAccessors, thresholdsSummaryGridConfig, thresholdsTopGridConfig };
10338
10400
  //# sourceMappingURL=nova-ui-charts.mjs.map