@nova-ui/charts 13.0.10-4556 → 13.0.10
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.
- package/core/plugins/interaction/interaction-label-plugin.d.ts +1 -0
- package/esm2020/core/common/render-engine.mjs +2 -1
- package/esm2020/core/plugins/interaction/interaction-label-plugin.mjs +9 -7
- package/esm2020/renderers/bar/highlight-strategies/bar-highlight-strategy-outline.mjs +82 -0
- package/esm2020/renderers/bar/highlight-strategies/bar-highlight-strategy.mjs +1 -1
- package/esm2020/renderers/bar/highlight-strategies/public-api.mjs +2 -1
- package/esm2020/renderers/bar/stacked-preprocessor.mjs +2 -2
- package/esm2020/renderers/types.mjs +1 -1
- package/fesm2015/nova-ui-charts.mjs +71 -8
- package/fesm2015/nova-ui-charts.mjs.map +1 -1
- package/fesm2020/nova-ui-charts.mjs +70 -8
- package/fesm2020/nova-ui-charts.mjs.map +1 -1
- package/package.json +2 -2
- package/renderers/bar/highlight-strategies/bar-highlight-strategy-outline.d.ts +15 -0
- package/renderers/bar/highlight-strategies/bar-highlight-strategy.d.ts +3 -3
- package/renderers/bar/highlight-strategies/public-api.d.ts +1 -0
- package/renderers/types.d.ts +2 -1
|
@@ -3743,6 +3743,7 @@ class RenderEngine {
|
|
|
3743
3743
|
dataSeries: chartSeries,
|
|
3744
3744
|
containers: childContainers,
|
|
3745
3745
|
scales: chartSeries.scales,
|
|
3746
|
+
parentContainer: this.renderLayers.data,
|
|
3746
3747
|
};
|
|
3747
3748
|
chartSeries.renderer.highlightDataPoint(renderSeries, index, this.rendererSubject);
|
|
3748
3749
|
}
|
|
@@ -5284,17 +5285,19 @@ class InteractionLabelPlugin extends ChartPlugin {
|
|
|
5284
5285
|
const textSelection = interactionLabel
|
|
5285
5286
|
.select("text")
|
|
5286
5287
|
.text(labelContent);
|
|
5287
|
-
|
|
5288
|
+
if (!this.elBBox) {
|
|
5289
|
+
this.elBBox = textSelection.node().getBBox();
|
|
5290
|
+
}
|
|
5288
5291
|
const gridDimension = this.chart.getGrid().config().dimension;
|
|
5289
5292
|
// subtract the relative vertical text offset inside the bbox from
|
|
5290
5293
|
// the grid height to determine the label's vertical placement
|
|
5291
|
-
const heightOffset = gridDimension.height() -
|
|
5294
|
+
const heightOffset = gridDimension.height() - this.elBBox.y;
|
|
5292
5295
|
textSelection
|
|
5293
5296
|
.attr("transform", `translate(0, ${heightOffset})`)
|
|
5294
5297
|
.style("text-anchor", "middle");
|
|
5295
5298
|
// match the horizontal padding to the built-in bbox vertical padding
|
|
5296
|
-
const horizontalPadding = (
|
|
5297
|
-
const labelWidth =
|
|
5299
|
+
const horizontalPadding = (this.elBBox.height + this.elBBox.y) * 2;
|
|
5300
|
+
const labelWidth = this.elBBox.width + horizontalPadding;
|
|
5298
5301
|
const allowedRange = [
|
|
5299
5302
|
labelWidth / 2,
|
|
5300
5303
|
gridDimension.width() - labelWidth / 2,
|
|
@@ -5307,9 +5310,9 @@ class InteractionLabelPlugin extends ChartPlugin {
|
|
|
5307
5310
|
.attrs({
|
|
5308
5311
|
transform: `translate(0,${heightOffset})`,
|
|
5309
5312
|
x: -(labelWidth / 2),
|
|
5310
|
-
y:
|
|
5313
|
+
y: this.elBBox.y,
|
|
5311
5314
|
width: labelWidth,
|
|
5312
|
-
height:
|
|
5315
|
+
height: this.elBBox.height,
|
|
5313
5316
|
});
|
|
5314
5317
|
}
|
|
5315
5318
|
destroy() {
|
|
@@ -7275,7 +7278,7 @@ function stackedPreprocessor(chartSeriesSet, isVisible) {
|
|
|
7275
7278
|
if (chartSeriesSet.length === 0) {
|
|
7276
7279
|
return chartSeriesSet;
|
|
7277
7280
|
}
|
|
7278
|
-
const categories = gatherCategories(chartSeriesSet);
|
|
7281
|
+
const categories = gatherCategories(chartSeriesSet.filter((chartSeries) => isUndefined(chartSeries.preprocess) || chartSeries.preprocess));
|
|
7279
7282
|
// This is adding metadata to the dataset and filling missing
|
|
7280
7283
|
chartSeriesSet.reduce((acc, chartSeries) => {
|
|
7281
7284
|
if (!isUndefined(chartSeries.preprocess) && !chartSeries.preprocess) {
|
|
@@ -9771,6 +9774,66 @@ class BarHighlightStrategy {
|
|
|
9771
9774
|
draw(renderer, renderSeries, rendererSubject) { }
|
|
9772
9775
|
}
|
|
9773
9776
|
|
|
9777
|
+
// © 2022 SolarWinds Worldwide, LLC. All rights reserved.
|
|
9778
|
+
// creates an outline element that is used to highlight hovered parts of the chart
|
|
9779
|
+
class BarHighlightStrategyOutline extends BarHighlightStrategy {
|
|
9780
|
+
/**
|
|
9781
|
+
* @param scaleKey scale that will be used for searching for the data point that will be highlighted
|
|
9782
|
+
* @param levels for band scales, how many levels deep do we go to compare values
|
|
9783
|
+
*/
|
|
9784
|
+
constructor(scaleKey, levels = 1, selectedDataPointIdxFn) {
|
|
9785
|
+
super(scaleKey, levels, selectedDataPointIdxFn);
|
|
9786
|
+
this.outlineAdd = 6;
|
|
9787
|
+
this.outlineElsMap = new Map();
|
|
9788
|
+
}
|
|
9789
|
+
highlightDataPoint(renderer, renderSeries, dataPointIndex) {
|
|
9790
|
+
var _a, _b;
|
|
9791
|
+
const target = renderSeries.containers[RenderLayerName.data];
|
|
9792
|
+
const selectedDataPointIdx = !isUndefined(this.selectedDataPointIdxFn)
|
|
9793
|
+
? this.selectedDataPointIdxFn(renderSeries.dataSeries.id)
|
|
9794
|
+
: DATA_POINT_NOT_FOUND;
|
|
9795
|
+
const gNodes = target
|
|
9796
|
+
.selectAll(`g.${renderer.barContainerClass}`)
|
|
9797
|
+
.nodes();
|
|
9798
|
+
const emphasizedNode = gNodes[dataPointIndex] || gNodes[selectedDataPointIdx];
|
|
9799
|
+
if (!renderSeries.parentContainer) {
|
|
9800
|
+
return;
|
|
9801
|
+
}
|
|
9802
|
+
// needs to replace all '.' from the serie id as the dot would be treated as a class name in the query selector
|
|
9803
|
+
const outlineRectClass = `${renderer.barContainerClass}-outline-${renderSeries.dataSeries.id}`
|
|
9804
|
+
.split(".")
|
|
9805
|
+
.join("-");
|
|
9806
|
+
if (!this.outlineElsMap.has(outlineRectClass)) {
|
|
9807
|
+
// creates a rect element that will be used as a outline
|
|
9808
|
+
const rect = renderSeries.parentContainer.append("rect");
|
|
9809
|
+
rect.classed(outlineRectClass, true);
|
|
9810
|
+
this.outlineElsMap.set(outlineRectClass, rect);
|
|
9811
|
+
}
|
|
9812
|
+
const outlineRect = this.outlineElsMap.get(outlineRectClass);
|
|
9813
|
+
const emphasizedDataValue = ((_a = renderSeries.dataSeries.data[dataPointIndex]) === null || _a === void 0 ? void 0 : _a.y) ||
|
|
9814
|
+
((_b = renderSeries.dataSeries.data[dataPointIndex]) === null || _b === void 0 ? void 0 : _b.value);
|
|
9815
|
+
if (emphasizedDataValue && emphasizedNode && outlineRect) {
|
|
9816
|
+
// position the outline element on the position of the emphasized element and updates its attributes
|
|
9817
|
+
const emphasizedRect = select$1(emphasizedNode).select("rect");
|
|
9818
|
+
const x = parseFloat(emphasizedRect.attr("x")) - this.outlineAdd / 2;
|
|
9819
|
+
const y = parseFloat(emphasizedRect.attr("y")) - this.outlineAdd / 2;
|
|
9820
|
+
const width = parseFloat(emphasizedRect.attr("width")) + this.outlineAdd;
|
|
9821
|
+
const height = parseFloat(emphasizedRect.attr("height")) + this.outlineAdd;
|
|
9822
|
+
outlineRect.attr("x", x);
|
|
9823
|
+
outlineRect.attr("y", y);
|
|
9824
|
+
outlineRect.attr("width", width);
|
|
9825
|
+
outlineRect.attr("height", height);
|
|
9826
|
+
outlineRect.style("fill", emphasizedRect.style("fill"));
|
|
9827
|
+
outlineRect.style("display", "inline");
|
|
9828
|
+
}
|
|
9829
|
+
if ((outlineRect && !emphasizedDataValue) ||
|
|
9830
|
+
(outlineRect && !emphasizedNode)) {
|
|
9831
|
+
// hides outline element when there is no emphasized element
|
|
9832
|
+
outlineRect.style("display", "none");
|
|
9833
|
+
}
|
|
9834
|
+
}
|
|
9835
|
+
}
|
|
9836
|
+
|
|
9774
9837
|
// © 2022 SolarWinds Worldwide, LLC. All rights reserved.
|
|
9775
9838
|
class BarSeriesHighlightStrategy {
|
|
9776
9839
|
/**
|
|
@@ -10330,5 +10393,5 @@ function thresholdsTopGridConfig(c = new XYGridConfig()) {
|
|
|
10330
10393
|
* Generated bundle index. Do not edit.
|
|
10331
10394
|
*/
|
|
10332
10395
|
|
|
10333
|
-
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 };
|
|
10396
|
+
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 };
|
|
10334
10397
|
//# sourceMappingURL=nova-ui-charts.mjs.map
|