Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return projection;
};
delete projection.scale;
delete projection.translate;
delete projection.center;
return projection.alpha(0);
}
var globe = {type: "Sphere"},
land = topojson.feature(world, world.objects.land),
countries = topojson.feature(world, world.objects.countries).features,
boundary = topojson.mesh(world, world.objects.countries, function(a, b) { return a !== b; });
var t = textures.circles().lighter().size(3).fill("#e1e1e1");
g.call(t);
//append countries path
feature
.data(countries)
.enter()
.append("path")
.attr("d", path(land))
.style("fill", t.url())
.attr("stroke", "#e1e1e1");
}
generate() {
const t = textures.circles();
[
'size',
'strokeWidth',
'stroke',
'fill',
'background',
'id',
'complement',
'radius',
].forEach((key) => {
if (this.props[key]) t[key](this.props[key]);
});
const selection = new Selection();
t(selection);
this.setState({
colors.forEach((c, i) => {
let t;
switch (i) {
case 0:
t = textures
.lines()
.thicker()
.strokeWidth(1)
.stroke(d3.rgb(c).brighter(0.6))
.background(c);
break;
case 1:
t = textures
.circles()
.fill(d3.rgb(c).brighter(0.6))
.thicker()
.background(c);
break;
case 2:
t = textures
.paths()
.d('crosses')
.stroke(d3.rgb(c).brighter(0.6))
.background(c)
.lighter()
.thicker();
break;
case 3:
t = textures
.thicker()
.strokeWidth(1)
.stroke(d3.rgb(c).brighter(0.6))
.background(c);
break;
case 4:
t = textures
.lines()
.strokeWidth(1)
.thicker()
.orientation('6/8')
.stroke(d3.rgb(c).brighter(0.6))
.background(c);
break;
default:
t = textures
.circles()
.radius(3)
.fill('transparent')
.strokeWidth(1)
.stroke(d3.rgb(c).brighter(0.6))
.background(c);
break;
}
svg.call(t);
ts.push(t.url());
});
return ts;