Skip to content

Commit

Permalink
add XYTime Plot (breakpoints, colorRamp ...) functionality to the sim… (
Browse files Browse the repository at this point in the history
#3710)

* add XYTime Plot (breakpoints, colorRamp ...) functionality to the simwrapper contrib

* add XYTime Plot (breakpoints, colorRamp ...) functionality to the simwrapper contrib

* add XYTime Plot (breakpoints, colorRamp ...) functionality to the simwrapper contrib

* add XYTime Plot (breakpoints, colorRamp ...) functionality to the simwrapper contrib

---------

Co-authored-by: rakow <[email protected]>
  • Loading branch information
frievoe97 and rakow authored Feb 4, 2025
1 parent b9d66ad commit b722c52
Showing 1 changed file with 61 additions and 0 deletions.
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;
}

}

0 comments on commit b722c52

Please sign in to comment.