Skip to content

Commit 1305a15

Browse files
authored
Merge pull request bluehalo#43 from Asymmetrik/develop
Fixing typings to work with latest leaflet typings and leaflet library
2 parents befbae2 + 2744381 commit 1305a15

File tree

7 files changed

+230
-29
lines changed

7 files changed

+230
-29
lines changed

dist/leaflet-d3.js

Lines changed: 9 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/leaflet-d3.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/leaflet-d3.min.js

Lines changed: 196 additions & 2 deletions
Large diffs are not rendered by default.

gulpfile.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ gulp.task('build-js', [ 'rollup-js' ], () => {
5757

5858
// Uglify
5959
return gulp.src(path.join(assets.dist.dir, `${pkg.artifactName}.js`))
60-
.pipe(plugins.uglify({ preserveComments: 'license' }))
60+
.pipe(plugins.uglify({ output: { comments: 'license' } }))
61+
.on('error', (err) => { plugins.util.log(plugins.util.colors.red('[Uglify]'), err.toString()); })
6162
.pipe(plugins.rename(pkg.artifactName + '.min.js'))
6263
.pipe(gulp.dest(assets.dist.dir));
6364

@@ -66,7 +67,7 @@ gulp.task('build-js', [ 'rollup-js' ], () => {
6667
gulp.task('rollup-js', () => {
6768

6869
return rollup.rollup({
69-
entry: assets.src.entry,
70+
input: assets.src.entry,
7071
external: [
7172
'd3',
7273
'd3-hexbin',
@@ -75,10 +76,10 @@ gulp.task('rollup-js', () => {
7576
})
7677
.then((bundle) => {
7778
return bundle.write({
78-
dest: path.join(assets.dist.dir, `${pkg.artifactName}.js`),
79+
file: path.join(assets.dist.dir, `${pkg.artifactName}.js`),
7980
format: 'umd',
80-
moduleName: pkg.moduleName,
81-
sourceMap: true,
81+
name: pkg.moduleName,
82+
sourcemap: true,
8283
banner: bannerString,
8384
globals: {
8485
'd3': 'd3',

index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/// <reference types="leaflet" />
1+
import * as L from 'leaflet';
22

3-
declare namespace L {
3+
declare module 'leaflet' {
44

55
namespace internal {
66

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"artifactName": "leaflet-d3",
44
"moduleName": "leafletD3",
55
"description": "Custom d3 layers for leaflet",
6-
"version": "3.0.2",
6+
"version": "3.1.0",
77
"author": "Asymmetrik, Ltd.",
88
"copyright": "Copyright (c) 2007-2017 Asymmetrik Ltd, a Maryland Corporation",
99
"license": "MIT",
@@ -28,22 +28,22 @@
2828
},
2929

3030
"devDependencies": {
31-
"d3": "4.9",
32-
"@types/d3": "4.9",
31+
"d3": "4.10",
32+
"@types/d3": "4.10",
3333

3434
"d3-hexbin": "0.2",
3535

36-
"leaflet": "1.1",
37-
"@types/leaflet": "1.0",
36+
"leaflet": "1.2",
37+
"@types/leaflet": "1.2",
3838

39-
"rollup": "0.43",
39+
"rollup": "0.49",
4040

4141
"gulp": "3.9",
42-
"gulp-eslint": "3.0",
42+
"gulp-eslint": "4.0",
4343
"gulp-load-plugins": "1.5",
4444
"gulp-rename": "1.2",
4545
"gulp-sourcemaps": "2.6",
46-
"gulp-uglify": "2.0",
47-
"run-sequence": "1.2"
46+
"gulp-uglify": "3.0",
47+
"run-sequence": "2.1"
4848
}
4949
}

src/js/hexbin/HexbinLayer.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,15 @@ L.HexbinLayer = L.SVG.extend({
289289
// Exit
290290
var exit = join.exit();
291291

292-
exit.transition().duration(that.options.duration)
293-
.attr('fill-opacity', 0.01)
294-
.attr('stroke-opacity', 0.01)
292+
exit.select('path.hexbin-hexagon')
293+
.transition().duration(that.options.duration)
294+
.attr('fill-opacity', 0)
295+
.attr('stroke-opacity', 0)
295296
.attr('d', function(d) {
296297
return that._hexLayout.hexagon(0);
297-
})
298+
});
299+
300+
exit.transition().duration(that.options.duration)
298301
.remove();
299302

300303
},

0 commit comments

Comments
 (0)