From 372be808ecf0bb917172e3b0c6ee475685fc7b17 Mon Sep 17 00:00:00 2001 From: mikebender Date: Thu, 2 Nov 2023 11:40:45 -0400 Subject: [PATCH] Add support for MultiXYErrorBarSeries - Wasn't wired up at all --- .../multiseries/MultiXYErrorBarSeries.java | 32 ++++++++++ .../figure/FigureWidgetTranslator.java | 60 +++++++++++++++++++ 2 files changed, 92 insertions(+) diff --git a/Plot/src/main/java/io/deephaven/plot/datasets/multiseries/MultiXYErrorBarSeries.java b/Plot/src/main/java/io/deephaven/plot/datasets/multiseries/MultiXYErrorBarSeries.java index 83b0f296930..0b8a681ed7e 100644 --- a/Plot/src/main/java/io/deephaven/plot/datasets/multiseries/MultiXYErrorBarSeries.java +++ b/Plot/src/main/java/io/deephaven/plot/datasets/multiseries/MultiXYErrorBarSeries.java @@ -107,6 +107,38 @@ public XYErrorBarDataSeriesInternal createSeries(String seriesName, final BaseTa drawXError, drawYError); } + public boolean getDrawXError() { + return drawXError; + } + + public boolean getDrawYError() { + return drawYError; + } + + public String getX() { + return x; + } + + public String getXLow() { + return xLow; + } + + public String getXHigh() { + return xHigh; + } + + public String getY() { + return y; + } + + public String getYLow() { + return yLow; + } + + public String getYHigh() { + return yHigh; + } + ////////////////////////////// CODE BELOW HERE IS GENERATED -- DO NOT EDIT BY HAND ////////////////////////////// ////////////////////////////// TO REGENERATE RUN GenerateMultiSeries ////////////////////////////// ////////////////////////////// AND THEN RUN GenerateFigureImmutable ////////////////////////////// diff --git a/plugin/figure/src/main/java/io/deephaven/figure/FigureWidgetTranslator.java b/plugin/figure/src/main/java/io/deephaven/figure/FigureWidgetTranslator.java index 350aedc2e2a..395984d8e47 100644 --- a/plugin/figure/src/main/java/io/deephaven/figure/FigureWidgetTranslator.java +++ b/plugin/figure/src/main/java/io/deephaven/figure/FigureWidgetTranslator.java @@ -32,6 +32,7 @@ import io.deephaven.plot.datasets.multiseries.AbstractMultiSeries; import io.deephaven.plot.datasets.multiseries.AbstractPartitionedTableHandleMultiSeries; import io.deephaven.plot.datasets.multiseries.MultiCatSeries; +import io.deephaven.plot.datasets.multiseries.MultiXYErrorBarSeries; import io.deephaven.plot.datasets.multiseries.MultiXYSeries; import io.deephaven.plot.datasets.ohlc.OHLCDataSeriesArray; import io.deephaven.plot.datasets.xy.AbstractXYDataSeries; @@ -518,6 +519,65 @@ private FigureDescriptor.ChartDescriptor translate(ChartImpl chart) { clientSeries.setPointShape(stringMapWithDefault(mergeShapes( multiCatSeries.pointShapeSeriesNameToStringMap(), multiCatSeries.pointShapeSeriesNameToShapeMap()))); + } else if (partitionedTableMultiSeries instanceof MultiXYErrorBarSeries) { + MultiXYErrorBarSeries multiXYErrorBarSeries = + (MultiXYErrorBarSeries) partitionedTableMultiSeries; + + clientAxes.add(makePartitionedTableSourceDescriptor( + plotHandle, multiXYErrorBarSeries.getX(), SourceType.X, xAxis)); + if (multiXYErrorBarSeries.getDrawXError()) { + clientAxes.add(makePartitionedTableSourceDescriptor( + plotHandle, multiXYErrorBarSeries.getXLow(), SourceType.X_LOW, xAxis)); + clientAxes.add(makePartitionedTableSourceDescriptor( + plotHandle, multiXYErrorBarSeries.getXHigh(), SourceType.X_HIGH, + xAxis)); + } + + clientAxes.add(makePartitionedTableSourceDescriptor( + plotHandle, multiXYErrorBarSeries.getY(), SourceType.Y, yAxis)); + if (multiXYErrorBarSeries.getDrawYError()) { + clientAxes.add(makePartitionedTableSourceDescriptor( + plotHandle, multiXYErrorBarSeries.getYLow(), SourceType.Y_LOW, yAxis)); + clientAxes.add(makePartitionedTableSourceDescriptor( + plotHandle, multiXYErrorBarSeries.getYHigh(), SourceType.Y_HIGH, + yAxis)); + } + + clientSeries.setLineColor(stringMapWithDefault(mergeColors( + multiXYErrorBarSeries.lineColorSeriesNameTointMap(), + multiXYErrorBarSeries.lineColorSeriesNameToStringMap(), + multiXYErrorBarSeries.lineColorSeriesNameToPaintMap()))); + clientSeries.setPointColor(stringMapWithDefault(mergeColors( + multiXYErrorBarSeries.pointColorSeriesNameTointMap(), + multiXYErrorBarSeries.pointColorSeriesNameToStringMap(), + multiXYErrorBarSeries.pointColorSeriesNameToPaintMap()))); + clientSeries.setLinesVisible( + boolMapWithDefault( + multiXYErrorBarSeries.linesVisibleSeriesNameToBooleanMap())); + clientSeries.setPointsVisible( + boolMapWithDefault( + multiXYErrorBarSeries.pointsVisibleSeriesNameToBooleanMap())); + clientSeries.setGradientVisible( + boolMapWithDefault( + multiXYErrorBarSeries.gradientVisibleSeriesNameTobooleanMap())); + clientSeries.setPointLabelFormat(stringMapWithDefault( + multiXYErrorBarSeries.pointLabelFormatSeriesNameToStringMap())); + clientSeries.setXToolTipPattern( + stringMapWithDefault( + multiXYErrorBarSeries.xToolTipPatternSeriesNameToStringMap())); + clientSeries.setYToolTipPattern( + stringMapWithDefault( + multiXYErrorBarSeries.yToolTipPatternSeriesNameToStringMap())); + clientSeries.setPointLabel(stringMapWithDefault( + multiXYErrorBarSeries.pointColorSeriesNameToStringMap(), + Objects::toString)); + clientSeries.setPointSize(doubleMapWithDefault( + multiXYErrorBarSeries.pointSizeSeriesNameToNumberMap(), + number -> number == null ? null : number.doubleValue())); + + clientSeries.setPointShape(stringMapWithDefault(mergeShapes( + multiXYErrorBarSeries.pointShapeSeriesNameToStringMap(), + multiXYErrorBarSeries.pointShapeSeriesNameToShapeMap()))); } else { errorList.add( "OpenAPI presently does not support series of type "