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

add XYTime Plot (breakpoints, colorRamp ...) functionality to the sim… #3710

Merged
merged 6 commits into from
Feb 4, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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.
* <p>
* 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;
}

}
Loading