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

Observable Plot · all subjects

projections

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

Projection difference from mark clip option

The clip projection option affects generated geometry and typically produces smaller SVG output, whereas the clip mark option is implemented using SVG clipping.

Built-in projection names

Observable Plot supports the following built-in named projections: equirectangular (plate carrée), orthographic, stereographic, mercator, equal-earth, azimuthal-equal-area, azimuthal-equidistant, conic-conformal, conic-equal-area, conic-equidistant, gnomonic, transverse-mercator, albers (Albers' conic equal-area), albers-usa (composite for United States), identity (for planar geometry), reflect-y (identity with y pointing up), and null (default, for pre-projected geometry in screen coordinates).

Projection option type parameter

The projection option may be specified as an object with a type parameter that takes one of the built-in projection names, a D3 projection object, or a custom projection implementing projection.stream, or a function that receives a configuration object with width, height, and other options and returns a projection.

Projection options when specified as object

When the projection option is specified as an object, the following projection options are supported: type (one of the projection names), parallels (standard parallels for conic projections only), precision (sampling threshold), rotate (two- or three-element array of Euler angles), domain (GeoJSON object to fit in center of frame), inset (inset amount in pixels when fitting, default zero), insetLeft (inset from left edge, defaults to inset), insetRight (inset from right edge, defaults to inset), insetTop (inset from top edge, defaults to inset), insetBottom (inset from bottom edge, defaults to inset), and clip (projection clipping method).

Projection clipping methods

The clip projection option supports the following clipping methods: frame or true (default, clips to frame extent including margins but not insets), a number (clips to a great circle of the given radius in degrees centered around the origin), and null or false (no clipping).

Projection-aware marks

The geo mark is projection-aware and handles nuances of projecting spherical polygons to screen using d3-geo features including adaptive sampling with configurable precision, antimeridian cutting, and clipping. The line mark is also projection-aware to draw geodesics. Other marks like dot and text apply projection in place of x and y scales.

Marks incompatible with projections

Marks that require band scales (bars, cells, and ticks) cannot be used with projections. One-dimensional marks such as rules cannot be used with projections.

Materialized projection retrieval

After rendering a plot, the materialized projection can be retrieved using plot.scale('projection'). The returned projection object exposes a projection.stream method (from d3-geo) for projecting geometry, as well as projection.apply(point) and projection.invert(point) methods if supported.

Reusing projections across plots

A projection object retrieved from one plot can be reused in another plot by passing it as the projection option to Plot.plot().

Projection characteristics comparison

Conformal projections preserve angles and local shape. Equal-area projections preserve area and should be used for choropleths. Equidistant projections preserve distance from one or two points. Azimuthal projections expand radially from a central feature. Cylindrical projections have symmetry around the axis of rotation. Stereographic projections preserve circles. Gnomonic projections display all great circles as straight lines. No single projection is best at everything; a projection cannot be both conformal and equal-area.

Albers-USA projection characteristics

The albers-usa projection is a U.S.-centric composite conic equal-area projection with an inset of Alaska and Hawaii. Alaska's scale is diminished to 0.35× its true relative area.

Domain option for zooming with projection

The domain option on a projection allows zooming in on a specific region. It takes a GeoJSON object. For example, d3.geoCircle can generate a circle of a given radius centered at given longitude and latitude coordinates.

Projection applied to coordinate channels

The projection option applies to plots using x and y channels. For marks using x1, y1, x2, and y2 channels, the two projected points are ⟨x1, y1⟩ and ⟨x2, y2⟩. Otherwise the projected point is ⟨x, y⟩.

Projection domain with inset example

The projection option can be specified as an object with type (azimuthal-equidistant), rotate ([-9, -34]), domain (circle GeoJSON), and inset (10 pixels) to zoom into a region with padding.

Custom projection function

A custom projection can be specified as a function that receives a configuration object with {width, height, ...options} and returns a D3 projection. The function can set properties like rotate, translate, scale, and clipAngle on the projection. Width and height represent frame dimensions minus any insets.

Identity projection for planar geometry

The identity projection displays planar geometry and does not apply any geographic transformation. It is used for non-geographic coordinates, such as architectural floor plans.

Reflect-y projection for y-up coordinates

The reflect-y projection is like the identity projection but inverts the y-axis so that y points upward, which is common with projected reference systems.

Contour mark with projection

The contour mark supports Plot's projection system. When using projections, contours are generated in the projected coordinate space.

density mark with projection best practice

Use an equal-area projection with the density mark.

density mark projection support

The density mark supports Plot's projection system for geographic data visualization.

Vector mark works with projections

Vectors can be used with Plot's projection system, such as 'albers-usa' for geographic projections.

Give your agent this brain