diff --git a/contribs/simwrapper/src/main/java/org/matsim/simwrapper/viz/XYTime.java b/contribs/simwrapper/src/main/java/org/matsim/simwrapper/viz/XYTime.java index 031871980e2..058b578082c 100644 --- a/contribs/simwrapper/src/main/java/org/matsim/simwrapper/viz/XYTime.java +++ b/contribs/simwrapper/src/main/java/org/matsim/simwrapper/viz/XYTime.java @@ -2,6 +2,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + /** * The Tile plug-in creates an overview of important key figures. */ @@ -13,7 +16,65 @@ public class XYTime extends Viz { @JsonProperty(required = true) public String file; + /** + * The radius of the points. + */ + @JsonProperty(required = false) + public Double radius; + + /** + * The name of the color ramp. + */ + @JsonProperty(required = false) + public String colorRamp; + + /** + * The number of buckets of the color ramp. + */ + @JsonProperty(required = false) + public Integer buckets; + + /** + * The exponent of the color ramp. + */ + @JsonProperty(required = false) + public Integer exponent; + + /** + * The minimum value of the color ramp. + */ + @JsonProperty(required = false) + public Integer clipMax; + + /** + * Breakpoints can either be a list of values or a map with colors and values. + */ + @JsonProperty(required = false) + private Object breakpoints; + public XYTime() { super("xytime"); } + + /** + * Sets breakpoints as a map when colors are provided. + *

+ * The number of colors must be one less than the number of values. + */ + public XYTime setBreakpoints(String[] colors, double... values) { + this.breakpoints = Map.of( + "colors", colors, + "values", values + ); + return this; + } + + /** + * Set breakpoints as a simple list. + */ + public XYTime setBreakpoints(double... values) { + this.breakpoints = List.of(values); + return this; + } + }