How to use the d3-geo.geoGraticule function in d3-geo

To help you get started, we’ve selected a few d3-geo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / d3-geo / d3-geo-tests.ts View on Github external
// 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();
github ArcBlock / forge-js / apps / forge-web / src / components / globe / index.js View on Github external
className="earth"
        width={width}
        height={height}
        onMouseDown={onDragStart}
        onMouseMove={onDrag}
        onMouseUp={onDragEnd}
        ref={svgRef}>
github zcreativelabs / react-simple-maps / src / Graticule.js View on Github external
const computeGraticule = (projection, step) =>
  geoPath().projection(projection)(geoGraticule().step(step)())
github hshoff / vx / packages / vx-geo / src / graticule / Graticule.js View on Github external
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 && (
github vega / vega / packages / vega-geo / src / Graticule.js View on Github external
export default function Graticule(params) {
  Transform.call(this, [], params);
  this.generator = geoGraticule();
}
github zcreativelabs / react-simple-maps / src / Graticule.js View on Github external
const computeOutline = (projection) =>
  geoPath().projection(projection)(geoGraticule().outline())
github vega / vega-dataflow / src / geo / Graticule.js View on Github external
export default function Graticule(params) {
  Transform.call(this, [], params);
  this.generator = geoGraticule();
}
github plouc / nivo / packages / geo / src / enhance.js View on Github external
withPropsOnChange(['enableGraticule'], ({ enableGraticule }) => {
        if (enableGraticule !== true) return

        const graticule = geoGraticule()

        return {
            graticule,
        }
    }),
]
github amcharts / amcharts4 / dist / es2015 / .internal / charts / map / GraticuleSeries.js View on Github external
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();
github amcharts / amcharts4 / src / .internal / charts / map / GraticuleSeries.ts View on Github external
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>;