preparation to add plots for percentiles

This commit is contained in:
ahr
2017-11-05 09:21:34 +01:00
parent 870ff492d9
commit 92dde94443
12 changed files with 129 additions and 54 deletions

View File

@@ -1,8 +1,11 @@
package org.lucares.pdbui;
import org.lucares.pdb.plot.api.AggreateInternal;
import org.lucares.pdb.plot.api.AggregateHandler;
import org.lucares.pdb.plot.api.AxisScale;
import org.lucares.pdb.plot.api.Limit;
import org.lucares.pdb.plot.api.MeanAggregate;
import org.lucares.pdb.plot.api.NullAggregate;
import org.lucares.pdb.plot.api.PlotSettings;
import org.lucares.pdbui.domain.Aggregate;
import org.lucares.pdbui.domain.LimitBy;
@@ -29,10 +32,13 @@ class PlotSettingsTransformer {
return result;
}
private static AggreateInternal toAggregateInternal(Aggregate aggregate) {
private static AggregateHandler toAggregateInternal(Aggregate aggregate) {
switch (aggregate) {
case NONE:return AggreateInternal.NONE;
case MEAN:return AggreateInternal.MEAN;
case NONE:return new NullAggregate();
case MEAN:return new MeanAggregate();
case PERCENTILE95:return new NullAggregate();
case PERCENTILE99:return new NullAggregate();
case PERCENTILE999:return new NullAggregate();
}
throw new IllegalStateException("unhandled enum: " + aggregate);
}

View File

@@ -1,5 +1,5 @@
package org.lucares.pdbui.domain;
public enum Aggregate {
NONE, MEAN
NONE, MEAN, PERCENTILE95, PERCENTILE99, PERCENTILE999
}

View File

@@ -70,6 +70,9 @@
<select id="show-aggregate">
<option value="NONE" selected="selected">-</option>
<option value="MEAN">Mean</option>
<option value="PERCENTILE95">95% percentile</option>
<option value="PERCENTILE99">99% percentile</option>
<option value="PERCENTILE999">99.9% percentile</option>
</select>
</div>
<div class="group">