diff --git a/Plot/src/main/java/io/deephaven/plot/datasets/multiseries/MultiOHLCSeries.java b/Plot/src/main/java/io/deephaven/plot/datasets/multiseries/MultiOHLCSeries.java index cc3085413e9..44b04d1b8c1 100644 --- a/Plot/src/main/java/io/deephaven/plot/datasets/multiseries/MultiOHLCSeries.java +++ b/Plot/src/main/java/io/deephaven/plot/datasets/multiseries/MultiOHLCSeries.java @@ -83,6 +83,26 @@ public OHLCDataSeriesInternal createSeries(String seriesName, final BaseTable t, timeCol, openCol, highCol, lowCol, closeCol); } + public String getTimeCol() { + return timeCol; + } + + public String getOpenCol() { + return openCol; + } + + public String getHighCol() { + return highCol; + } + + public String getLowCol() { + return lowCol; + } + + public String getCloseCol() { + return closeCol; + } + ////////////////////////////// CODE BELOW HERE IS GENERATED -- DO NOT EDIT BY HAND ////////////////////////////// ////////////////////////////// TO REGENERATE RUN GenerateMultiSeries ////////////////////////////// ////////////////////////////// AND THEN RUN GenerateFigureImmutable ////////////////////////////// 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..13cf5911b5c 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,30 @@ public XYErrorBarDataSeriesInternal createSeries(String seriesName, final BaseTa drawXError, drawYError); } + public boolean getDrawXError() { + return drawXError; + } + + public boolean getDrawYError() { + return drawYError; + } + + public String getXLow() { + return xLow; + } + + public String getXHigh() { + return xHigh; + } + + 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 09c2a92f874..3888321f23d 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,8 @@ 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.MultiOHLCSeries; +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 +520,119 @@ 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.pointLabelSeriesNameToObjectMap(), + Objects::toString)); + clientSeries.setPointSize(doubleMapWithDefault( + multiXYErrorBarSeries.pointSizeSeriesNameToNumberMap(), + number -> number == null ? null : number.doubleValue())); + + clientSeries.setPointShape(stringMapWithDefault(mergeShapes( + multiXYErrorBarSeries.pointShapeSeriesNameToStringMap(), + multiXYErrorBarSeries.pointShapeSeriesNameToShapeMap()))); + } else if (partitionedTableMultiSeries instanceof MultiOHLCSeries) { + MultiOHLCSeries multiOHLCSeries = + (MultiOHLCSeries) partitionedTableMultiSeries; + + clientAxes.add(makePartitionedTableSourceDescriptor( + plotHandle, multiOHLCSeries.getTimeCol(), SourceType.TIME, xAxis)); + clientAxes.add(makePartitionedTableSourceDescriptor( + plotHandle, multiOHLCSeries.getOpenCol(), SourceType.OPEN, yAxis)); + clientAxes.add(makePartitionedTableSourceDescriptor( + plotHandle, multiOHLCSeries.getCloseCol(), SourceType.CLOSE, yAxis)); + clientAxes.add(makePartitionedTableSourceDescriptor( + plotHandle, multiOHLCSeries.getHighCol(), SourceType.HIGH, yAxis)); + clientAxes.add(makePartitionedTableSourceDescriptor( + plotHandle, multiOHLCSeries.getLowCol(), SourceType.LOW, yAxis)); + + clientSeries.setLineColor(stringMapWithDefault(mergeColors( + multiOHLCSeries.lineColorSeriesNameTointMap(), + multiOHLCSeries.lineColorSeriesNameToStringMap(), + multiOHLCSeries.lineColorSeriesNameToPaintMap()))); + clientSeries.setPointColor(stringMapWithDefault(mergeColors( + multiOHLCSeries.pointColorSeriesNameTointMap(), + multiOHLCSeries.pointColorSeriesNameToStringMap(), + multiOHLCSeries.pointColorSeriesNameToPaintMap()))); + clientSeries.setLinesVisible( + boolMapWithDefault( + multiOHLCSeries.linesVisibleSeriesNameToBooleanMap())); + clientSeries.setPointsVisible( + boolMapWithDefault( + multiOHLCSeries.pointsVisibleSeriesNameToBooleanMap())); + clientSeries.setGradientVisible( + boolMapWithDefault( + multiOHLCSeries.gradientVisibleSeriesNameTobooleanMap())); + clientSeries.setPointLabelFormat(stringMapWithDefault( + multiOHLCSeries.pointLabelFormatSeriesNameToStringMap())); + clientSeries.setXToolTipPattern( + stringMapWithDefault( + multiOHLCSeries.xToolTipPatternSeriesNameToStringMap())); + clientSeries.setYToolTipPattern( + stringMapWithDefault( + multiOHLCSeries.yToolTipPatternSeriesNameToStringMap())); + clientSeries.setPointLabel(stringMapWithDefault( + multiOHLCSeries.pointLabelSeriesNameToObjectMap(), + Objects::toString)); + clientSeries.setPointSize(doubleMapWithDefault( + multiOHLCSeries.pointSizeSeriesNameToNumberMap(), + number -> number == null ? null : number.doubleValue())); + + clientSeries.setPointShape(stringMapWithDefault(mergeShapes( + multiOHLCSeries.pointShapeSeriesNameToStringMap(), + multiOHLCSeries.pointShapeSeriesNameToShapeMap()))); + } else { + errorList.add( + "OpenAPI presently does not support series of type " + + partitionedTableMultiSeries.getClass()); } } else { errorList.add( @@ -530,7 +645,6 @@ private FigureDescriptor.ChartDescriptor translate(ChartImpl chart) { } else { errorList.add( "OpenAPI presently does not support series of type " + seriesInternal.getClass()); - // TODO handle multi-series, possibly transformed case? } }); }); diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigure.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigure.java index f373494f1bc..04f2a7989a7 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigure.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigure.java @@ -166,6 +166,8 @@ public String toString() { private JsChart[] charts; + private JsArray errors; + private JsTable[] tables; private Map plotHandlesToTables; @@ -201,6 +203,8 @@ public Promise refetch() { .map(chartDescriptor -> new JsChart(chartDescriptor, this)).toArray(JsChart[]::new); JsObject.freeze(charts); + errors = JsObject.freeze(descriptor.getErrorsList().slice()); + return this.tableFetch.fetch(this, response); }).then(tableFetchData -> { // all tables are wired up, need to map them to the series instances @@ -324,8 +328,9 @@ public JsChart[] getCharts() { return charts; } - public String[] getErrors() { - return Js.uncheckedCast(descriptor.getErrorsList().slice()); + @JsProperty + public JsArray getErrors() { + return errors; } /**