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

Commit 7bce4d6

Browse files
authored
Extend Hexbin API (#11)
* fix radiusRange handling, * add colorDomain and radiusDomain options, * bump version number for further release.
1 parent 42aa74a commit 7bce4d6

File tree

4 files changed

+32
-7
lines changed

4 files changed

+32
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Add the dependency:
3333
<dependency>
3434
<groupId>pl.itrack</groupId>
3535
<artifactId>gwt-leaflet-d3</artifactId>
36-
<version>0.2.2</version>
36+
<version>0.2.3</version>
3737
</dependency>
3838
```
3939

examples/simple-hexbinlayer-demo/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<dependency>
4141
<groupId>pl.itrack</groupId>
4242
<artifactId>gwt-leaflet-d3</artifactId>
43-
<version>0.2.2</version>
43+
<version>0.2.3</version>
4444
</dependency>
4545
</dependencies>
4646

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>pl.itrack</groupId>
55
<artifactId>gwt-leaflet-d3</artifactId>
6-
<version>0.2.2</version>
6+
<version>0.2.3</version>
77
<packaging>gwt-lib</packaging>
88
<name>GWT Leaflet plugin that allows integration with d3.js library</name>
99
<description>A GWT JsInterop wrapper for collection of plugins for using d3.js with Leaflet</description>

src/main/java/pl/itrack/leafletd3/client/wrapper/HexbinLayer.java

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public HexbinLayer(Config config) {
4040
public native void initialize(Config config);
4141

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

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

116+
@JsProperty
117+
double[] colorDomain;
118+
119+
@JsProperty
120+
double[] radiusDomain;
121+
116122
Config() {
117123
}
118124

@@ -130,7 +136,7 @@ private Builder() {
130136
* @param radius default 12
131137
* @return the builder
132138
*/
133-
public Config.Builder withRadius(Double radius) {
139+
public Config.Builder withRadius(double radius) {
134140
this.radius = radius;
135141
return this;
136142
}
@@ -139,7 +145,7 @@ public Config.Builder withRadius(Double radius) {
139145
* @param opacity a stroke opacity; default 0.6
140146
* @return the builder
141147
*/
142-
public Config.Builder withOpacity(Double opacity) {
148+
public Config.Builder withOpacity(double opacity) {
143149
this.opacity = opacity;
144150
return this;
145151
}
@@ -148,11 +154,30 @@ public Config.Builder withOpacity(Double opacity) {
148154
* @param duration default 200
149155
* @return the builder
150156
*/
151-
public Config.Builder withDuration(Double duration) {
157+
public Config.Builder withDuration(double duration) {
152158
this.duration = duration;
153159
return this;
154160
}
155161

162+
/**
163+
* @param colorDomain default null
164+
* @return the builder
165+
*/
166+
public Config.Builder withColorDomain(double[] colorDomain) {
167+
this.colorDomain = colorDomain;
168+
return this;
169+
}
170+
171+
/**
172+
* @param radiusDomain default null
173+
* @return the builder
174+
*/
175+
public Config.Builder withRadiusDomain(double[] radiusDomain) {
176+
this.radiusDomain = radiusDomain;
177+
return this;
178+
}
179+
180+
156181
public Config build() {
157182
return this;
158183
}

0 commit comments

Comments
 (0)