Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Z axis by default from ChartImpl #4510

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Plot/src/main/java/io/deephaven/plot/ChartImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class ChartImpl implements Chart, PlotExceptionCause {
private final BaseFigureImpl figure;
@SuppressWarnings("unchecked")
private final List<AxisImpl>[] axis =
new List[] {new ArrayList<Axis>(), new ArrayList<Axis>(), new ArrayList<Axis>()};
new List[] {new ArrayList<Axis>(), new ArrayList<Axis>()};
private final List<AxesImpl> axes = new ArrayList<>();
private ChartType chartType;
private Font titleFont;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package io.deephaven.figure;

import io.deephaven.api.Selectable;
import io.deephaven.base.verify.Assert;
import io.deephaven.engine.table.PartitionedTable;
import io.deephaven.engine.table.Table;
import io.deephaven.gui.shape.JShapes;
Expand Down Expand Up @@ -170,7 +171,7 @@ private static <T> void assignOptionalField(T value, Consumer<T> setter, Runnabl
}

private FigureDescriptor.ChartDescriptor translate(ChartImpl chart) {
assert chart.dimension() == 2 : "Only dim=2 supported";
Assert.eq(chart.dimension(), "chart.dimensions()", 2);
FigureDescriptor.ChartDescriptor.Builder clientChart = FigureDescriptor.ChartDescriptor.newBuilder();

boolean swappedPositions = chart.getPlotOrientation() != ChartImpl.PlotOrientation.VERTICAL;
Expand All @@ -188,7 +189,7 @@ private FigureDescriptor.ChartDescriptor translate(ChartImpl chart) {
if ((i == 0 && !swappedPositions) || (i == 1 && swappedPositions)) {
type = AxisDescriptor.AxisType.X;
} else {
assert i == 0 || i == 1;
Assert.eqTrue(i == 0 || i == 1, "i == 0 || i == 1");
type = AxisDescriptor.AxisType.Y;
}
List<AxisImpl> currentPositionAxes = chart.getAxis()[i];
Expand Down Expand Up @@ -264,11 +265,11 @@ private FigureDescriptor.ChartDescriptor translate(ChartImpl chart) {
final AxisDescriptor catAxis;
final AxisDescriptor numAxis;
if (xAxis.getFormatType() == AxisDescriptor.AxisFormatType.CATEGORY) {
assert yAxis.getFormatType() == AxisDescriptor.AxisFormatType.NUMBER;
Assert.eq(yAxis.getFormatType(), "yAxis.getFormatType()", AxisDescriptor.AxisFormatType.NUMBER);
catAxis = xAxis;
numAxis = yAxis;
} else if (yAxis.getFormatType() == AxisDescriptor.AxisFormatType.CATEGORY) {
assert xAxis.getFormatType() == AxisDescriptor.AxisFormatType.NUMBER;
Assert.eq(xAxis.getFormatType(), "xAxis.getFormatType()", AxisDescriptor.AxisFormatType.NUMBER);
catAxis = yAxis;
numAxis = xAxis;
} else {
Expand Down
Loading