use y1/y2 axis definitions
This commit is contained in:
@@ -33,10 +33,8 @@
|
||||
|
||||
<pdb-limit-by #limitbycomponent></pdb-limit-by>
|
||||
|
||||
|
||||
<pdb-y-axis-definition #y1AxisDefinitionComponent yIndex="1"></pdb-y-axis-definition>
|
||||
|
||||
|
||||
<pdb-y-axis-definition #y2AxisDefinitionComponent yIndex="2" *ngIf="y2AxisAvailable"></pdb-y-axis-definition>
|
||||
|
||||
<mat-checkbox [(ngModel)]="enableGallery">Gallery</mat-checkbox>
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ export class VisualizationPageComponent implements OnInit {
|
||||
|
||||
enableGallery = false;
|
||||
splitBy = null;
|
||||
y2AxisAvailable = false;
|
||||
|
||||
constructor(private plotService: PlotService, private snackBar: MatSnackBar) {
|
||||
}
|
||||
@@ -83,6 +84,9 @@ export class VisualizationPageComponent implements OnInit {
|
||||
const compatiblePlotTypes = this.plotTypes.filter(pt => pt.compatible(selectedPlotTypes));
|
||||
this.plotTypes.forEach(pt => pt.active=false);
|
||||
compatiblePlotTypes.forEach(pt => pt.active=true);
|
||||
|
||||
const axesTypes = this.getAxes();
|
||||
this.y2AxisAvailable = axesTypes.y.length == 2;
|
||||
}
|
||||
|
||||
|
||||
@@ -144,7 +148,7 @@ export class VisualizationPageComponent implements OnInit {
|
||||
this.selectedPlotType.forEach(a => aggregates.push(a.id));
|
||||
|
||||
const y1 = this.y1AxisDefinitionComponent.getAxisDefinition();
|
||||
const y2 = this.y2AxisDefinitionComponent.getAxisDefinition();
|
||||
const y2 = this.y2AxisDefinitionComponent ? this.y2AxisDefinitionComponent.getAxisDefinition() : undefined;
|
||||
|
||||
const request = new PlotRequest();
|
||||
request.query = this.query.query;
|
||||
|
||||
@@ -10,18 +10,24 @@
|
||||
<mat-form-field class="pdb-form-mid">
|
||||
<mat-label>Y{{yIndex}}-Axis Range:</mat-label>
|
||||
<mat-select [(value)]="yAxisUnit">
|
||||
<mat-option value="AUTOMATIC">automatic</mat-option>
|
||||
<mat-optgroup label="⸺numbers⸺">
|
||||
<mat-option value="AUTOMATIC_NUMBER">auto (number)</mat-option>
|
||||
<mat-option value="NO_UNIT">no unit</mat-option>
|
||||
</mat-optgroup>
|
||||
<mat-optgroup label="⸺time⸺">
|
||||
<mat-option value="AUTOMATIC_TIME">auto (time)</mat-option>
|
||||
<mat-option value="MILLISECONDS">millis</mat-option>
|
||||
<mat-option value="SECONDS">seconds</mat-option>
|
||||
<mat-option value="MINUTES">minutes</mat-option>
|
||||
<mat-option value="HOURS">hours</mat-option>
|
||||
<mat-option value="DAYS">days</mat-option>
|
||||
</mat-optgroup>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="yAxisUnit !== 'AUTOMATIC'" class="pdb-form-number">
|
||||
<mat-form-field *ngIf="yAxisUnit !== 'AUTOMATIC_TIME' && yAxisUnit !== 'AUTOMATIC_NUMBER'" class="pdb-form-number">
|
||||
<input matInput type="number" placeholder="Min" min="0" [(ngModel)]="minYValue">
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="yAxisUnit !== 'AUTOMATIC'" class="pdb-form-number">
|
||||
<mat-form-field *ngIf="yAxisUnit !== 'AUTOMATIC_TIME' && yAxisUnit !== 'AUTOMATIC_NUMBER'" class="pdb-form-number">
|
||||
<input matInput type="number" placeholder="Max" min="0" [(ngModel)]="maxYValue">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
@@ -5,11 +5,11 @@ import java.util.Collection;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.lucares.recommind.logs.AxisSettings;
|
||||
import org.lucares.recommind.logs.AxisSettings.Type;
|
||||
import org.lucares.recommind.logs.DataSeries;
|
||||
import org.lucares.recommind.logs.GnuplotAxis;
|
||||
import org.lucares.recommind.logs.GnuplotSettings;
|
||||
import org.lucares.recommind.logs.LineStyle;
|
||||
import org.lucares.recommind.logs.Type;
|
||||
|
||||
public abstract class AggregateHandler implements Appender {
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.lucares.recommind.logs.AxisSettings;
|
||||
import org.lucares.recommind.logs.AxisSettings.Type;
|
||||
import org.lucares.recommind.logs.DataSeries;
|
||||
import org.lucares.recommind.logs.GnuplotAxis;
|
||||
import org.lucares.recommind.logs.GnuplotSettings;
|
||||
import org.lucares.recommind.logs.Type;
|
||||
import org.lucares.utils.CollectionUtils;
|
||||
import org.lucares.utils.Preconditions;
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@ import java.util.Locale;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.lucares.recommind.logs.AxisSettings;
|
||||
import org.lucares.recommind.logs.AxisSettings.Type;
|
||||
import org.lucares.recommind.logs.DataSeries;
|
||||
import org.lucares.recommind.logs.GnuplotAxis;
|
||||
import org.lucares.recommind.logs.GnuplotLineType;
|
||||
import org.lucares.recommind.logs.GnuplotSettings;
|
||||
import org.lucares.recommind.logs.LineStyle;
|
||||
import org.lucares.recommind.logs.Type;
|
||||
|
||||
public class BarChartHandler extends AggregateHandler {
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@ import java.util.Collection;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.lucares.recommind.logs.AxisSettings;
|
||||
import org.lucares.recommind.logs.AxisSettings.Type;
|
||||
import org.lucares.recommind.logs.AxisTime;
|
||||
import org.lucares.recommind.logs.DataSeries;
|
||||
import org.lucares.recommind.logs.GnuplotAxis;
|
||||
import org.lucares.recommind.logs.GnuplotSettings;
|
||||
import org.lucares.recommind.logs.LineStyle;
|
||||
import org.lucares.recommind.logs.Type;
|
||||
|
||||
public class CumulativeDistributionHandler extends AggregateHandler {
|
||||
|
||||
@@ -39,7 +39,7 @@ public class CumulativeDistributionHandler extends AggregateHandler {
|
||||
|
||||
@Override
|
||||
public AxisSettings createYAxisSettings(final GnuplotSettings settings, final Collection<DataSeries> dataSeries) {
|
||||
final AxisSettings result = AxisTime.createYAxis(settings, dataSeries);
|
||||
final AxisSettings result = AxisTime.createYAxis(settings, getyAxis(), dataSeries);
|
||||
result.setAxis(getyAxis());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@ import java.util.Collection;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.lucares.recommind.logs.AxisSettings;
|
||||
import org.lucares.recommind.logs.AxisSettings.Type;
|
||||
import org.lucares.recommind.logs.DataSeries;
|
||||
import org.lucares.recommind.logs.GnuplotAxis;
|
||||
import org.lucares.recommind.logs.GnuplotSettings;
|
||||
import org.lucares.recommind.logs.LineStyle;
|
||||
import org.lucares.recommind.logs.Type;
|
||||
|
||||
public class HistogramHandler extends AggregateHandler {
|
||||
|
||||
|
||||
@@ -6,12 +6,12 @@ import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.lucares.recommind.logs.AxisSettings;
|
||||
import org.lucares.recommind.logs.AxisSettings.Type;
|
||||
import org.lucares.recommind.logs.AxisTime;
|
||||
import org.lucares.recommind.logs.DataSeries;
|
||||
import org.lucares.recommind.logs.GnuplotAxis;
|
||||
import org.lucares.recommind.logs.GnuplotSettings;
|
||||
import org.lucares.recommind.logs.LineStyle;
|
||||
import org.lucares.recommind.logs.Type;
|
||||
|
||||
public class ParallelRequestsAggregate extends AggregateHandler {
|
||||
|
||||
@@ -31,13 +31,25 @@ public class ParallelRequestsAggregate extends AggregateHandler {
|
||||
|
||||
@Override
|
||||
public AxisSettings createYAxisSettings(final GnuplotSettings settings, final Collection<DataSeries> dataSeries) {
|
||||
final AxisSettings result = new AxisSettings();
|
||||
result.setLabel("Parallel Requests");
|
||||
result.setType(Type.Number);
|
||||
result.setAxis(getyAxis());
|
||||
result.setTicsEnabled(true);
|
||||
result.setFrom("0");
|
||||
|
||||
final AxisSettings result = AxisTime.createYAxis(settings, getyAxis(), dataSeries);
|
||||
return result;
|
||||
|
||||
// final YAxisDefinition yAxisDefinition = settings.getYAxisDefinition(getyAxis());
|
||||
//
|
||||
// final AxisSettings result = new AxisSettings();
|
||||
// result.setLabel("Parallel Requests");
|
||||
// result.setType(Type.Number);
|
||||
// result.setAxis(getyAxis());
|
||||
// result.setTicsEnabled(true);
|
||||
// if (yAxisDefinition.hasRange()) {
|
||||
// result.setFrom(String.valueOf(yAxisDefinition.getRangeMinForUnit()));
|
||||
// result.setTo(String.valueOf(yAxisDefinition.getRangeMaxForUnit()));
|
||||
// } else {
|
||||
// result.setFrom("0");
|
||||
// }
|
||||
// result.setLogscale(yAxisDefinition.isLogscale());
|
||||
// return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package org.lucares.pdb.plot.api;
|
||||
|
||||
import org.lucares.recommind.logs.Type;
|
||||
|
||||
public enum RangeUnit {
|
||||
AUTOMATIC_NUMBER(true, Type.Number, "Value"),
|
||||
|
||||
NO_UNIT(false, Type.Number, "Value"),
|
||||
|
||||
BYTES(false, Type.Number, "Value"),
|
||||
|
||||
AUTOMATIC_TIME(true, Type.Duration, "Duration"),
|
||||
|
||||
MILLISECONDS(false, Type.Duration, "Duration"),
|
||||
|
||||
SECONDS(false, Type.Duration, "Duration"),
|
||||
|
||||
MINUTES(false, Type.Duration, "Duration"),
|
||||
|
||||
HOURS(false, Type.Duration, "Duration"),
|
||||
|
||||
DAYS(false, Type.Duration, "Duration");
|
||||
|
||||
private final boolean isAutomatic;
|
||||
private final String axisLabel;
|
||||
private final Type type;
|
||||
|
||||
private RangeUnit(final boolean isAutomatic, final Type type, final String axisLabel) {
|
||||
this.isAutomatic = isAutomatic;
|
||||
this.type = type;
|
||||
this.axisLabel = axisLabel;
|
||||
}
|
||||
|
||||
public boolean isAutomatic() {
|
||||
return isAutomatic;
|
||||
}
|
||||
|
||||
public boolean isTime() {
|
||||
return type == Type.Duration;
|
||||
}
|
||||
|
||||
public boolean isNumber() {
|
||||
return type == Type.Number || type == Type.HistogramCount;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return axisLabel;
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int valueForUnit(final int value) {
|
||||
|
||||
switch (this) {
|
||||
case AUTOMATIC_NUMBER:
|
||||
return Integer.MAX_VALUE;
|
||||
case NO_UNIT:
|
||||
case BYTES:
|
||||
return value;
|
||||
case MILLISECONDS:
|
||||
return value;
|
||||
case SECONDS:
|
||||
return value * 1000;
|
||||
case MINUTES:
|
||||
return value * 60 * 1000;
|
||||
case HOURS:
|
||||
return value * 60 * 60 * 1000;
|
||||
case DAYS:
|
||||
return value * 24 * 60 * 60 * 1000;
|
||||
case AUTOMATIC_TIME:
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,13 +5,13 @@ import java.util.Collection;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.lucares.recommind.logs.AxisSettings;
|
||||
import org.lucares.recommind.logs.AxisSettings.Type;
|
||||
import org.lucares.recommind.logs.AxisTime;
|
||||
import org.lucares.recommind.logs.DataSeries;
|
||||
import org.lucares.recommind.logs.GnuplotAxis;
|
||||
import org.lucares.recommind.logs.GnuplotLineType;
|
||||
import org.lucares.recommind.logs.GnuplotSettings;
|
||||
import org.lucares.recommind.logs.LineStyle;
|
||||
import org.lucares.recommind.logs.Type;
|
||||
|
||||
public class ScatterAggregateHandler extends AggregateHandler {
|
||||
|
||||
@@ -31,8 +31,8 @@ public class ScatterAggregateHandler extends AggregateHandler {
|
||||
|
||||
@Override
|
||||
public AxisSettings createYAxisSettings(final GnuplotSettings settings, final Collection<DataSeries> dataSeries) {
|
||||
final AxisSettings result = AxisTime.createYAxis(settings, dataSeries);
|
||||
result.setAxis(getyAxis());
|
||||
final AxisSettings result = AxisTime.createYAxis(settings, getyAxis(), dataSeries);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ScatterAggregator implements CustomAggregator {
|
||||
|
||||
private final long minValue;
|
||||
private final long maxValue;
|
||||
private final long durationMillisPerPixel;
|
||||
private final long valuesPerPixel;
|
||||
|
||||
private final Path tmpDir;
|
||||
|
||||
@@ -44,10 +44,10 @@ public class ScatterAggregator implements CustomAggregator {
|
||||
|
||||
final YAxisDefinition yAxisDefinition = plotSettings.getyAxisDefinition(yAxis);
|
||||
|
||||
minValue = yAxisDefinition.getRangeUnit() == TimeRangeUnit.AUTOMATIC ? 0 : yAxisDefinition.getRangeMinInMs();
|
||||
maxValue = yAxisDefinition.getRangeUnit() == TimeRangeUnit.AUTOMATIC ? Long.MAX_VALUE
|
||||
: yAxisDefinition.getRangeMaxInMs();
|
||||
durationMillisPerPixel = yAxisDefinition.getAxisScale() == AxisScale.LINEAR
|
||||
final boolean automaticRange = yAxisDefinition.getRangeUnit().isAutomatic();
|
||||
minValue = automaticRange ? 0 : yAxisDefinition.getRangeMinForUnit();
|
||||
maxValue = automaticRange ? Long.MAX_VALUE : yAxisDefinition.getRangeMaxForUnit();
|
||||
valuesPerPixel = yAxisDefinition.getAxisScale() == AxisScale.LINEAR && !automaticRange
|
||||
? Math.max(1, (maxValue - minValue) / plotAreaHeightInPx)
|
||||
: 1;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class ScatterAggregator implements CustomAggregator {
|
||||
@Override
|
||||
public void addValue(final long epochMilli, final long value) {
|
||||
final long roundedEpochMilli = epochMilli - epochMilli % epochMillisPerPixel;
|
||||
final long roundedValue = value - value % durationMillisPerPixel;
|
||||
final long roundedValue = value - value % valuesPerPixel;
|
||||
matrix2d.put(roundedEpochMilli, roundedValue, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
package org.lucares.pdb.plot.api;
|
||||
|
||||
public enum TimeRangeUnit {
|
||||
AUTOMATIC, MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS;
|
||||
|
||||
public int toMilliSeconds(final int value) {
|
||||
|
||||
switch (this) {
|
||||
case MILLISECONDS:
|
||||
return value;
|
||||
case SECONDS:
|
||||
return value * 1000;
|
||||
case MINUTES:
|
||||
return value * 60 * 1000;
|
||||
case HOURS:
|
||||
return value * 60 * 60 * 1000;
|
||||
case DAYS:
|
||||
return value * 24 * 60 * 60 * 1000;
|
||||
case AUTOMATIC:
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ public class YAxisDefinition {
|
||||
|
||||
private int rangeMin = 0;
|
||||
private int rangeMax = 300;
|
||||
private TimeRangeUnit rangeUnit = TimeRangeUnit.AUTOMATIC;
|
||||
private RangeUnit rangeUnit = RangeUnit.AUTOMATIC_TIME;
|
||||
|
||||
public AxisScale getAxisScale() {
|
||||
return axisScale;
|
||||
@@ -15,12 +15,12 @@ public class YAxisDefinition {
|
||||
this.axisScale = axisScale;
|
||||
}
|
||||
|
||||
public long getRangeMinInMs() {
|
||||
return rangeUnit.toMilliSeconds(rangeMin);
|
||||
public long getRangeMinForUnit() {
|
||||
return rangeUnit.valueForUnit(rangeMin);
|
||||
}
|
||||
|
||||
public long getRangeMaxInMs() {
|
||||
return rangeUnit.toMilliSeconds(rangeMax);
|
||||
public long getRangeMaxForUnit() {
|
||||
return rangeUnit.valueForUnit(rangeMax);
|
||||
}
|
||||
|
||||
public int getRangeMin() {
|
||||
@@ -28,7 +28,7 @@ public class YAxisDefinition {
|
||||
}
|
||||
|
||||
public boolean hasRange() {
|
||||
return rangeUnit != TimeRangeUnit.AUTOMATIC && rangeMin >= 0 && rangeMax >= 0 && rangeMin < rangeMax;
|
||||
return !rangeUnit.isAutomatic() && rangeMin >= 0 && rangeMax >= 0 && rangeMin < rangeMax;
|
||||
}
|
||||
|
||||
public void setRangeMin(final int rangeMin) {
|
||||
@@ -43,11 +43,11 @@ public class YAxisDefinition {
|
||||
this.rangeMax = rangeMax;
|
||||
}
|
||||
|
||||
public TimeRangeUnit getRangeUnit() {
|
||||
public RangeUnit getRangeUnit() {
|
||||
return rangeUnit;
|
||||
}
|
||||
|
||||
public void setRangeUnit(final TimeRangeUnit rangeUnit) {
|
||||
public void setRangeUnit(final RangeUnit rangeUnit) {
|
||||
this.rangeUnit = rangeUnit;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,10 +9,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
public class AxisSettings {
|
||||
|
||||
public enum Type {
|
||||
Number, Time, Duration, Percent, HistogramBin, HistogramCount, Group
|
||||
}
|
||||
|
||||
private String format = "";
|
||||
|
||||
private String label = "";
|
||||
|
||||
@@ -9,7 +9,6 @@ import org.lucares.collections.LongList;
|
||||
import org.lucares.pdb.api.DateTimeRange;
|
||||
import org.lucares.pdb.plot.api.AxisScale;
|
||||
import org.lucares.pdb.plot.api.YAxisDefinition;
|
||||
import org.lucares.recommind.logs.AxisSettings.Type;
|
||||
|
||||
public class AxisTime {
|
||||
public static AxisSettings createXAxis(final GnuplotSettings settings) {
|
||||
@@ -40,22 +39,21 @@ public class AxisTime {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static AxisSettings createYAxis(final GnuplotSettings settings, final Collection<DataSeries> dataSeries) {
|
||||
|
||||
final GnuplotAxis yAxis = GnuplotAxis.Y1; // TODO get yAxis as parameter
|
||||
|
||||
final AxisSettings result = new AxisSettings();
|
||||
result.setLabel("Duration");
|
||||
result.setType(Type.Duration);
|
||||
result.setAxis(yAxis);
|
||||
result.setTicsEnabled(true);
|
||||
public static AxisSettings createYAxis(final GnuplotSettings settings, final GnuplotAxis yAxis,
|
||||
final Collection<DataSeries> dataSeries) {
|
||||
|
||||
final YAxisDefinition yAxisDefinition = settings.getYAxisDefinition(yAxis);
|
||||
|
||||
final AxisSettings result = new AxisSettings();
|
||||
result.setLabel(yAxisDefinition.getRangeUnit().getLabel());
|
||||
result.setType(yAxisDefinition.getRangeUnit().getType());
|
||||
result.setAxis(yAxis);
|
||||
result.setTicsEnabled(true);
|
||||
|
||||
final int graphOffset = yAxisDefinition.getAxisScale() == AxisScale.LINEAR ? 0 : 1;
|
||||
if (yAxisDefinition.hasRange()) {
|
||||
final long min = Math.max(yAxisDefinition.getRangeMinInMs(), graphOffset);
|
||||
final long max = yAxisDefinition.getRangeMaxInMs();
|
||||
final long min = Math.max(yAxisDefinition.getRangeMinForUnit(), graphOffset);
|
||||
final long max = yAxisDefinition.getRangeMaxForUnit();
|
||||
result.setFrom(String.valueOf(min));
|
||||
result.setTo(String.valueOf(max));
|
||||
} else {
|
||||
|
||||
@@ -203,7 +203,7 @@ public class Plotter {
|
||||
}
|
||||
|
||||
static String title(final Tags tags, final CsvSummary csvSummary) {
|
||||
// FIXME title must be computed by the AggregateHandler, because it is the only
|
||||
// TODO title must be computed by the AggregateHandler, because it is the only
|
||||
// one knowing how many values are plotted
|
||||
final StringBuilder result = new StringBuilder(tags.asValueString());
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package org.lucares.recommind.logs;
|
||||
|
||||
public enum Type {
|
||||
Number, Time, Duration, Percent, HistogramBin, HistogramCount, Group
|
||||
}
|
||||
@@ -25,28 +25,31 @@ class YAxisTicks {
|
||||
final long yRangeMax;
|
||||
final long yRangeMin;
|
||||
if (yAxisDefinition.hasRange()) {
|
||||
yRangeMin = yAxisDefinition.getRangeMinInMs();
|
||||
yRangeMax = yAxisDefinition.getRangeMaxInMs();
|
||||
yRangeMin = yAxisDefinition.getRangeMinForUnit();
|
||||
yRangeMax = yAxisDefinition.getRangeMaxForUnit();
|
||||
} else {
|
||||
yRangeMin = 0;
|
||||
yRangeMax = DataSeries.maxValue(dataSeries);
|
||||
}
|
||||
final int height = settings.getHeight();
|
||||
|
||||
if (yAxisDefinition.getRangeUnit().isTime()) {
|
||||
|
||||
switch (yAxisDefinition.getAxisScale()) {
|
||||
case LINEAR:
|
||||
result = computeLinearYTicks(height, yRangeMin, yRangeMax);
|
||||
result = computeLinearYTicksTime(height, yRangeMin, yRangeMax);
|
||||
break;
|
||||
case LOG10:
|
||||
result = computeLog10YTicks(height, yRangeMin, yRangeMax);
|
||||
result = computeLog10YTicksTime(height, yRangeMin, yRangeMax);
|
||||
break;
|
||||
default:
|
||||
// use the default
|
||||
throw new IllegalStateException("unhandled value: " + yAxisDefinition.getRangeUnit());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static List<String> computeLog10YTicks(final int height, final long yRangeMin, final long yRangeMax) {
|
||||
private static List<String> computeLog10YTicksTime(final int height, final long yRangeMin, final long yRangeMax) {
|
||||
|
||||
final List<String> ticsLabels = Arrays.asList(//
|
||||
"\"1ms\" 1", //
|
||||
@@ -86,7 +89,7 @@ class YAxisTicks {
|
||||
return ticsLabels;
|
||||
}
|
||||
|
||||
private static List<String> computeLinearYTicks(final long height, final long yRangeMinInMs,
|
||||
private static List<String> computeLinearYTicksTime(final long height, final long yRangeMinInMs,
|
||||
final long yRangeMaxInMs) {
|
||||
|
||||
final long plotHeight = height - GnuplotSettings.GNUPLOT_TOP_BOTTOM_MARGIN;
|
||||
|
||||
@@ -4,14 +4,12 @@ import java.util.List;
|
||||
|
||||
import org.lucares.pdb.plot.api.Aggregate;
|
||||
import org.lucares.pdb.plot.api.AggregateHandlerCollection;
|
||||
import org.lucares.pdb.plot.api.AxisScale;
|
||||
import org.lucares.pdb.plot.api.BarChartHandler;
|
||||
import org.lucares.pdb.plot.api.CumulativeDistributionHandler;
|
||||
import org.lucares.pdb.plot.api.HistogramHandler;
|
||||
import org.lucares.pdb.plot.api.ParallelRequestsAggregate;
|
||||
import org.lucares.pdb.plot.api.PlotSettings;
|
||||
import org.lucares.pdb.plot.api.ScatterAggregateHandler;
|
||||
import org.lucares.pdb.plot.api.TimeRangeUnit;
|
||||
import org.lucares.pdb.plot.api.YAxisDefinition;
|
||||
import org.lucares.pdbui.domain.PlotRequest;
|
||||
|
||||
@@ -69,12 +67,12 @@ class PlotSettingsTransformer {
|
||||
aggregateHandlerCollection.updateAxisForHandlers();
|
||||
|
||||
// Note: this check is incomplete -> implement the todo and remove this
|
||||
if (y1.getRangeUnit() == TimeRangeUnit.AUTOMATIC && y1.getAxisScale() == AxisScale.LINEAR) {
|
||||
// TODO need a second ScatterAggregateHandler for YRangeUnit() ==
|
||||
// TimeRangeUnitInternal.AUTOMATIC
|
||||
throw new UnsupportedOperationException(
|
||||
"linear axis with automatic y range does not work, use logarthmic y-axis, or define a y-axis range");
|
||||
}
|
||||
// if (y1.getRangeUnit() == RangeUnit.AUTOMATIC_TIME && y1.getAxisScale() == AxisScale.LINEAR) {
|
||||
// // TODO need a second ScatterAggregateHandler for YRangeUnit() ==
|
||||
// // TimeRangeUnitInternal.AUTOMATIC
|
||||
// throw new UnsupportedOperationException(
|
||||
// "linear axis with automatic y range does not work, use logarthmic y-axis, or define a y-axis range");
|
||||
// }
|
||||
|
||||
return aggregateHandlerCollection;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user