Skip to content
This repository has been archived by the owner on Oct 27, 2019. It is now read-only.

Commit

Permalink
Extend Hexbin API (#11)
Browse files Browse the repository at this point in the history
* fix radiusRange handling,
* add colorDomain and radiusDomain options,
* bump version number for further release.
  • Loading branch information
baldram authored Sep 8, 2018
1 parent 42aa74a commit 7bce4d6
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Add the dependency:
<dependency>
<groupId>pl.itrack</groupId>
<artifactId>gwt-leaflet-d3</artifactId>
<version>0.2.2</version>
<version>0.2.3</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion examples/simple-hexbinlayer-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<dependency>
<groupId>pl.itrack</groupId>
<artifactId>gwt-leaflet-d3</artifactId>
<version>0.2.2</version>
<version>0.2.3</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>pl.itrack</groupId>
<artifactId>gwt-leaflet-d3</artifactId>
<version>0.2.2</version>
<version>0.2.3</version>
<packaging>gwt-lib</packaging>
<name>GWT Leaflet plugin that allows integration with d3.js library</name>
<description>A GWT JsInterop wrapper for collection of plugins for using d3.js with Leaflet</description>
Expand Down
33 changes: 29 additions & 4 deletions src/main/java/pl/itrack/leafletd3/client/wrapper/HexbinLayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public HexbinLayer(Config config) {
public native void initialize(Config config);

@JsMethod(name = "radiusRange")
public native HexbinLayer<T> withRadiusRange(Integer[] radiusRange);
public native HexbinLayer<T> withRadiusRange(double[] radiusRange);

@JsMethod(name = "colorRange")
public native HexbinLayer<T> withColorRange(String[] colorRange);
Expand Down Expand Up @@ -113,6 +113,12 @@ public static class Config {
@JsProperty
double duration;

@JsProperty
double[] colorDomain;

@JsProperty
double[] radiusDomain;

Config() {
}

Expand All @@ -130,7 +136,7 @@ private Builder() {
* @param radius default 12
* @return the builder
*/
public Config.Builder withRadius(Double radius) {
public Config.Builder withRadius(double radius) {
this.radius = radius;
return this;
}
Expand All @@ -139,7 +145,7 @@ public Config.Builder withRadius(Double radius) {
* @param opacity a stroke opacity; default 0.6
* @return the builder
*/
public Config.Builder withOpacity(Double opacity) {
public Config.Builder withOpacity(double opacity) {
this.opacity = opacity;
return this;
}
Expand All @@ -148,11 +154,30 @@ public Config.Builder withOpacity(Double opacity) {
* @param duration default 200
* @return the builder
*/
public Config.Builder withDuration(Double duration) {
public Config.Builder withDuration(double duration) {
this.duration = duration;
return this;
}

/**
* @param colorDomain default null
* @return the builder
*/
public Config.Builder withColorDomain(double[] colorDomain) {
this.colorDomain = colorDomain;
return this;
}

/**
* @param radiusDomain default null
* @return the builder
*/
public Config.Builder withRadiusDomain(double[] radiusDomain) {
this.radiusDomain = radiusDomain;
return this;
}


public Config build() {
return this;
}
Expand Down

0 comments on commit 7bce4d6

Please sign in to comment.