Skip to content

Commit

Permalink
fix : smooth with dots
Browse files Browse the repository at this point in the history
  • Loading branch information
neocarto committed Nov 3, 2022
1 parent d9483a6 commit 8b278b7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/layers/smooth.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export function smooth(
let cellsize = options.cellSize != undefined ? options.cellSize : 1;
let colorcurve = options.colorcurve != undefined ? options.colorcurve : 2;

let nbdots = 1000;

let id = Date.now().toString(36) + Math.random().toString(36).substring(2);
if (display) {
let data;
Expand Down Expand Up @@ -77,13 +79,17 @@ export function smooth(
blur: grid_blur,
values: options.values,
});
data = decompose(mygrid, "value", 1000, d3.geoIdentity());
data = decompose(mygrid, "value", nbdots, d3.geoIdentity());
} else {
options.geojson = centroid(options.geojson);
data = decompose(options.geojson, options.values, 1000, projection);
data = decompose(options.geojson, options.values, nbdots, projection);
}
}

if (figuration(options.geojson) == "p") {
data = decompose(options.geojson, options.values, nbdots, projection);
}

let contour = d3
.contourDensity()
.x((d) => d[0])
Expand Down

0 comments on commit 8b278b7

Please sign in to comment.