@nova-ui/charts 12.0.34 → 12.0.35

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.
@@ -4223,6 +4223,7 @@ class RenderEngine {
4223
4223
  dataSeries: chartSeries,
4224
4224
  containers: childContainers,
4225
4225
  scales: chartSeries.scales,
4226
+ parentContainer: this.renderLayers.data,
4226
4227
  };
4227
4228
  chartSeries.renderer.highlightDataPoint(renderSeries, index, this.rendererSubject);
4228
4229
  }
@@ -5738,17 +5739,19 @@ class InteractionLabelPlugin extends ChartPlugin {
5738
5739
  const textSelection = interactionLabel
5739
5740
  .select("text")
5740
5741
  .text(labelContent);
5741
- const bbox = textSelection.node().getBBox();
5742
+ if (!this.elBBox) {
5743
+ this.elBBox = textSelection.node().getBBox();
5744
+ }
5742
5745
  const gridDimension = this.chart.getGrid().config().dimension;
5743
5746
  // subtract the relative vertical text offset inside the bbox from
5744
5747
  // the grid height to determine the label's vertical placement
5745
- const heightOffset = gridDimension.height() - bbox.y;
5748
+ const heightOffset = gridDimension.height() - this.elBBox.y;
5746
5749
  textSelection
5747
5750
  .attr("transform", `translate(0, ${heightOffset})`)
5748
5751
  .style("text-anchor", "middle");
5749
5752
  // match the horizontal padding to the built-in bbox vertical padding
5750
- const horizontalPadding = (bbox.height + bbox.y) * 2;
5751
- const labelWidth = bbox.width + horizontalPadding;
5753
+ const horizontalPadding = (this.elBBox.height + this.elBBox.y) * 2;
5754
+ const labelWidth = this.elBBox.width + horizontalPadding;
5752
5755
  const allowedRange = [
5753
5756
  labelWidth / 2,
5754
5757
  gridDimension.width() - labelWidth / 2,
@@ -5761,9 +5764,9 @@ class InteractionLabelPlugin extends ChartPlugin {
5761
5764
  .attrs({
5762
5765
  transform: `translate(0,${heightOffset})`,
5763
5766
  x: -(labelWidth / 2),
5764
- y: bbox.y,
5767
+ y: this.elBBox.y,
5765
5768
  width: labelWidth,
5766
- height: bbox.height,
5769
+ height: this.elBBox.height,
5767
5770
  });
5768
5771
  }
5769
5772
  destroy() {
@@ -7579,7 +7582,7 @@ function stackedPreprocessor(chartSeriesSet, isVisible) {
7579
7582
  if (chartSeriesSet.length === 0) {
7580
7583
  return chartSeriesSet;
7581
7584
  }
7582
- const categories = gatherCategories(chartSeriesSet);
7585
+ const categories = gatherCategories(chartSeriesSet.filter((chartSeries) => isUndefined(chartSeries.preprocess) || chartSeries.preprocess));
7583
7586
  // This is adding metadata to the dataset and filling missing
7584
7587
  const forExtents = chartSeriesSet.reduce((acc, chartSeries) => {
7585
7588
  if (!isUndefined(chartSeries.preprocess) && !chartSeries.preprocess) {
@@ -9740,6 +9743,66 @@ class BarHighlightStrategy {
9740
9743
  draw(renderer, renderSeries, rendererSubject) { }
9741
9744
  }
9742
9745
 
9746
+ // © 2022 SolarWinds Worldwide, LLC. All rights reserved.
9747
+ // creates an outline element that is used to highlight hovered parts of the chart
9748
+ class BarHighlightStrategyOutline extends BarHighlightStrategy {
9749
+ /**
9750
+ * @param scaleKey scale that will be used for searching for the data point that will be highlighted
9751
+ * @param levels for band scales, how many levels deep do we go to compare values
9752
+ */
9753
+ constructor(scaleKey, levels = 1, selectedDataPointIdxFn) {
9754
+ super(scaleKey, levels, selectedDataPointIdxFn);
9755
+ this.outlineAdd = 6;
9756
+ this.outlineElsMap = new Map();
9757
+ }
9758
+ highlightDataPoint(renderer, renderSeries, dataPointIndex) {
9759
+ var _a, _b;
9760
+ const target = renderSeries.containers[RenderLayerName.data];
9761
+ const selectedDataPointIdx = !isUndefined(this.selectedDataPointIdxFn)
9762
+ ? this.selectedDataPointIdxFn(renderSeries.dataSeries.id)
9763
+ : DATA_POINT_NOT_FOUND;
9764
+ const gNodes = target
9765
+ .selectAll(`g.${renderer.barContainerClass}`)
9766
+ .nodes();
9767
+ const emphasizedNode = gNodes[dataPointIndex] || gNodes[selectedDataPointIdx];
9768
+ if (!renderSeries.parentContainer) {
9769
+ return;
9770
+ }
9771
+ // needs to replace all '.' from the serie id as the dot would be treated as a class name in the query selector
9772
+ const outlineRectClass = `${renderer.barContainerClass}-outline-${renderSeries.dataSeries.id}`
9773
+ .split(".")
9774
+ .join("-");
9775
+ if (!this.outlineElsMap.has(outlineRectClass)) {
9776
+ // creates a rect element that will be used as a outline
9777
+ const rect = renderSeries.parentContainer.append("rect");
9778
+ rect.classed(outlineRectClass, true);
9779
+ this.outlineElsMap.set(outlineRectClass, rect);
9780
+ }
9781
+ const outlineRect = this.outlineElsMap.get(outlineRectClass);
9782
+ const emphasizedDataValue = ((_a = renderSeries.dataSeries.data[dataPointIndex]) === null || _a === void 0 ? void 0 : _a.y) ||
9783
+ ((_b = renderSeries.dataSeries.data[dataPointIndex]) === null || _b === void 0 ? void 0 : _b.value);
9784
+ if (emphasizedDataValue && emphasizedNode && outlineRect) {
9785
+ // position the outline element on the position of the emphasized element and updates its attributes
9786
+ const emphasizedRect = select(emphasizedNode).select("rect");
9787
+ const x = parseFloat(emphasizedRect.attr("x")) - this.outlineAdd / 2;
9788
+ const y = parseFloat(emphasizedRect.attr("y")) - this.outlineAdd / 2;
9789
+ const width = parseFloat(emphasizedRect.attr("width")) + this.outlineAdd;
9790
+ const height = parseFloat(emphasizedRect.attr("height")) + this.outlineAdd;
9791
+ outlineRect.attr("x", x);
9792
+ outlineRect.attr("y", y);
9793
+ outlineRect.attr("width", width);
9794
+ outlineRect.attr("height", height);
9795
+ outlineRect.style("fill", emphasizedRect.style("fill"));
9796
+ outlineRect.style("display", "inline");
9797
+ }
9798
+ if ((outlineRect && !emphasizedDataValue) ||
9799
+ (outlineRect && !emphasizedNode)) {
9800
+ // hides outline element when there is no emphasized element
9801
+ outlineRect.style("display", "none");
9802
+ }
9803
+ }
9804
+ }
9805
+
9743
9806
  // © 2022 SolarWinds Worldwide, LLC. All rights reserved.
9744
9807
  class BarSeriesHighlightStrategy {
9745
9808
  /**
@@ -10311,5 +10374,5 @@ function thresholdsTopGridConfig(c = new XYGridConfig()) {
10311
10374
  * Generated bundle index. Do not edit.
10312
10375
  */
10313
10376
 
10314
- 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, ɵ3, ɵ4, ɵ5 };
10377
+ 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, ɵ3, ɵ4, ɵ5 };
10315
10378
  //# sourceMappingURL=nova-ui-charts.js.map