Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Use CircleGenerator ====================================================
// use simple geoCircleGenerator
let circlePolygon: GeoJSON.Polygon = circleGeneratorSimple();
// use encapsulated geoCircleGenerator
circlePolygon = circulator.getCirclePolygon([5, 5]);
circlePolygon = circulator.getCirclePolygon();
// ----------------------------------------------------------------------
// Spherical Shapes - geoGraticule
// ----------------------------------------------------------------------
// Create GeoGraticuleGenerator =========================================
let graticuleGenerator: d3Geo.GeoGraticuleGenerator = d3Geo.geoGraticule();
// Configure GeoGraticuleGenerator =======================================
// extent(...) -----------------------------------------------------------
const extent: [[number, number], [number, number]] = graticuleGenerator.extent();
graticuleGenerator = graticuleGenerator.extent([[-180, -80], [180, 80]]);
// extentMajor(...) ---------------------------------------------------------
const extentMajor: [[number, number], [number, number]] = graticuleGenerator.extentMajor();
graticuleGenerator = graticuleGenerator.extentMajor([[-180, -80], [180, 80]]);
// extentMinor(...) ---------------------------------------------------------
const extentMinor: [[number, number], [number, number]] = graticuleGenerator.extentMinor();
className="earth"
width={width}
height={height}
onMouseDown={onDragStart}
onMouseMove={onDrag}
onMouseUp={onDragEnd}
ref={svgRef}>
const computeGraticule = (projection, step) =>
geoPath().projection(projection)(geoGraticule().step(step)())
export default function Graticule({
graticule,
lines,
outline,
extent,
extentMajor,
extentMinor,
step,
stepMajor,
stepMinor,
precision,
...restProps
}) {
const currGraticule = geoGraticule();
if (extent) currGraticule.extent(extent);
if (extentMajor) currGraticule.extentMajor(extentMajor);
if (extentMinor) currGraticule.extentMinor(extentMinor);
if (step) currGraticule.step(step);
if (stepMajor) currGraticule.stepMajor(stepMajor);
if (stepMinor) currGraticule.stepMinor(stepMinor);
if (precision) currGraticule.stepMinor(precision);
return (
{graticule && (
export default function Graticule(params) {
Transform.call(this, [], params);
this.generator = geoGraticule();
}
const computeOutline = (projection) =>
geoPath().projection(projection)(geoGraticule().outline())
export default function Graticule(params) {
Transform.call(this, [], params);
this.generator = geoGraticule();
}
withPropsOnChange(['enableGraticule'], ({ enableGraticule }) => {
if (enableGraticule !== true) return
const graticule = geoGraticule()
return {
graticule,
}
}),
]
GraticuleSeries.prototype.validateData = function () {
var _this = this;
_super.prototype.validateData.call(this);
this.mapLines.clear();
var graticule = d3geo.geoGraticule();
if (graticule) {
graticule.stepMinor([this.longitudeStep, this.latitudeStep]);
graticule.stepMajor([360, 360]);
var chart = this.chart;
if (this.fitExtent) {
graticule.extent([[chart.east, chart.north], [chart.west, chart.south]]);
}
else {
graticule.extent([[this.east, this.north], [this.west, this.south]]);
}
if (this.singleSprite) {
var mapLine = this.mapLines.create();
mapLine.multiLine = graticule().coordinates;
}
else {
var lineStrings = graticule.lines();
public validateData() {
super.validateData();
this.mapLines.clear();
let graticule = d3geo.geoGraticule();
if (graticule) {
graticule.stepMinor([this.longitudeStep, this.latitudeStep]);
graticule.stepMajor([360, 360]);
let chart = this.chart;
if (this.fitExtent) {
graticule.extent([[chart.east, chart.north], [chart.west, chart.south]]);
}
else {
graticule.extent([[this.east, this.north], [this.west, this.south]]);
}
if (this.singleSprite) {
let mapLine = this.mapLines.create();
mapLine.multiLine = graticule().coordinates as Array>;