new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

D3 · all subjects

d3-geo/shape

19 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

d3-geo graticule configuration

Graticule generator configuration methods: graticule.lines (generate array of LineStrings), graticule.outline (generate Polygon of extent), graticule.extent (get/set major & minor extents), graticule.extentMajor (get/set major extent), graticule.extentMinor (get/set minor extent), graticule.step (get/set major & minor step intervals), graticule.stepMajor (get/set major step), graticule.stepMinor (get/set minor step), graticule.precision (get/set latitudinal precision).

d3-geo circle configuration

Circle generator configuration methods: circle.center (specify center in latitude and longitude), circle.radius (specify angular radius in degrees), circle.precision (specify precision of piecewise circle).

geoGraticule() constructor

Constructs a geometry generator for creating graticules: a uniform grid of meridians and parallels for showing projection distortion. The default graticule has meridians and parallels every 10° between ±80° latitude; for the polar regions, there are meridians every 90°.

graticule() output

Returns a GeoJSON MultiLineString geometry object representing all meridians and parallels for the graticule.

graticule.lines()

Returns an array of GeoJSON LineString geometry objects, one for each meridian or parallel for the graticule.

graticule.outline()

Returns a GeoJSON Polygon geometry object representing the outline of the graticule along the meridians and parallels defining its extent.

graticule.extentMajor() method

If extent is specified, sets the major extent of the graticule. If extent is not specified, returns the current major extent, which defaults to ⟨⟨-180°, -90° + ε⟩, ⟨180°, 90° - ε⟩⟩.

graticule.extentMinor() method

If extent is specified, sets the minor extent of the graticule. If extent is not specified, returns the current minor extent, which defaults to ⟨⟨-180°, -80° - ε⟩, ⟨180°, 80° + ε⟩⟩.

graticule.stepMajor() method

If step is specified, sets the major step for the graticule. If step is not specified, returns the current major step, which defaults to ⟨90°, 360°⟩.

graticule.stepMinor() method

If step is specified, sets the minor step for the graticule. If step is not specified, returns the current minor step, which defaults to ⟨10°, 10°⟩.

graticule.precision() method

If precision is specified, sets the precision for the graticule in degrees. If precision is not specified, returns the current precision, which defaults to 2.5°.

geoGraticule10() convenience method

A convenience method for directly generating the default 10° global graticule as a GeoJSON MultiLineString geometry object. Equivalent to calling geoGraticule()().

geoCircle() constructor

Returns a new circle generator.

circle() generator output

Returns a new GeoJSON geometry object of type Polygon approximating a circle on the surface of a sphere, with the current center, radius and precision. Any arguments passed to the circle generator are passed to the accessors.

circle.center() method

If center is specified, sets the circle center to the specified point [longitude, latitude] in degrees and returns the circle generator. The center may also be specified as a function; this function will be invoked whenever a circle is generated, being passed any arguments passed to the circle generator. If center is not specified, returns the current center accessor, which defaults to function center() { return [0, 0]; }

circle.radius() method

If radius is specified, sets the circle radius to the specified angle in degrees and returns the circle generator. The radius may also be specified as a function; this function will be invoked whenever a circle is generated, being passed any arguments passed to the circle generator. If radius is not specified, returns the current radius accessor, which defaults to function radius() { return 90; }

circle.precision() method

If precision is specified, sets the circle precision to the specified angle in degrees and returns the circle generator. The precision may also be specified as a function; this function will be invoked whenever a circle is generated, being passed any arguments passed to the circle generator. If precision is not specified, returns the current precision accessor, which defaults to function precision() { return 2; } Small circles do not follow great arcs and thus the generated polygon is only an approximation. Specifying a smaller precision angle improves the accuracy of the approximate polygon but also increases the cost to generate and render it.

Spherical shapes use geoPath

Spherical shape generators return spherical GeoJSON for use with geoPath.

Great arc with geoPath

To generate a great arc (a segment of a great circle), pass a GeoJSON LineString geometry object to geoPath. D3's projections use geodesic interpolation for intermediate points.

Give your agent this brain