prepare to have more flexibility when for plots
This commit is contained in:
@@ -5,7 +5,9 @@ import java.time.OffsetDateTime;
|
|||||||
import java.time.ZoneOffset;
|
import java.time.ZoneOffset;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import java.util.TreeMap;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.lucares.pdb.api.DateTimeRange;
|
import org.lucares.pdb.api.DateTimeRange;
|
||||||
@@ -47,6 +49,16 @@ public class PlotSettings {
|
|||||||
|
|
||||||
private boolean renderBarChartTickLabels;
|
private boolean renderBarChartTickLabels;
|
||||||
|
|
||||||
|
private Map<String, RenderOptions> renders = new TreeMap<>();
|
||||||
|
|
||||||
|
public void setRenders(final Map<String, RenderOptions> renders) {
|
||||||
|
this.renders = renders;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, RenderOptions> getRenders() {
|
||||||
|
return renders;
|
||||||
|
}
|
||||||
|
|
||||||
public String getQuery() {
|
public String getQuery() {
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package org.lucares.pdb.plot.api;
|
||||||
|
|
||||||
|
public class RenderOptions {
|
||||||
|
private int height;
|
||||||
|
private int width;
|
||||||
|
private boolean keyOutside;
|
||||||
|
private boolean renderLabels;
|
||||||
|
|
||||||
|
public int getHeight() {
|
||||||
|
return height;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHeight(final int height) {
|
||||||
|
this.height = height;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWidth() {
|
||||||
|
return width;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWidth(final int width) {
|
||||||
|
this.width = width;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isKeyOutside() {
|
||||||
|
return keyOutside;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKeyOutside(final boolean keyOutside) {
|
||||||
|
this.keyOutside = keyOutside;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isRenderLabels() {
|
||||||
|
return renderLabels;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRenderLabels(final boolean renderLabels) {
|
||||||
|
this.renderLabels = renderLabels;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -38,6 +38,7 @@ class PlotSettingsTransformer {
|
|||||||
result.setAggregates(toAggregateInternal(config.getY1(), config.getY2(), config.getAggregates()));
|
result.setAggregates(toAggregateInternal(config.getY1(), config.getY2(), config.getAggregates()));
|
||||||
result.setInterval(Interval.create(config.getIntervalUnit(), config.getIntervalValue(), result.dateRange()));
|
result.setInterval(Interval.create(config.getIntervalUnit(), config.getIntervalValue(), result.dateRange()));
|
||||||
result.setRenderBarChartTickLabels(config.isRenderBarChartTickLabels());
|
result.setRenderBarChartTickLabels(config.isRenderBarChartTickLabels());
|
||||||
|
result.setRenders(request.getRenders());
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
package org.lucares.pdbui.domain;
|
package org.lucares.pdbui.domain;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.TreeMap;
|
||||||
|
|
||||||
|
import org.lucares.pdb.plot.api.RenderOptions;
|
||||||
|
|
||||||
public class PlotRequest {
|
public class PlotRequest {
|
||||||
|
|
||||||
private int height = 1000;
|
private int height = 1000;
|
||||||
@@ -16,6 +21,16 @@ public class PlotRequest {
|
|||||||
|
|
||||||
private PlotConfig config;
|
private PlotConfig config;
|
||||||
|
|
||||||
|
private Map<String, RenderOptions> renders = new TreeMap<>();
|
||||||
|
|
||||||
|
public void setRenders(final Map<String, RenderOptions> renders) {
|
||||||
|
this.renders = renders;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, RenderOptions> getRenders() {
|
||||||
|
return renders;
|
||||||
|
}
|
||||||
|
|
||||||
public PlotConfig getConfig() {
|
public PlotConfig getConfig() {
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user