This is a Jekyll-specific way to render HTML source for a given page (in this case, one in a collection) alongside the markup itself without having to duplicate content in includes.
This is an example of what you should be able to do once the major browsers implement some seriously cool features in the CSS3 draft spec as of April, 2016:
- [CSS variables][vars], using the
--name: valueassignment and
var(--name)accessor syntax. (Already implemented by Chrome, Firefox, and Webkit!)
- [CSS3 calc()][calc], which gives us calculated values between different units, e.g. subtracting a value in
emfrom a percentage. (Partially implemented in Chrome, Firefox, and Safari.)
- [CSS3 attr()][attr], which grants the function the ability to parse values in specific units in the form
attr(attr-name units). (Not yet implemented in any major browser.)
RegionalProduct dataset /
|1||All industry total [State Annual SIC]|
|2||Private industries [State Annual SIC]|
|3||Agriculture, forestry, and fishing [State Annual SIC]|
|4||Farms [State Annual SIC]|
|5||Agricultural services, forestry, and fishing [State Annual SIC]|
|6||Mining [State Annual SIC]|
|7||Metal mining [State Annual SIC]|
|8||Coal mining [State Annual SIC]|
|9||Oil and gas extraction [State Annual SIC]|
|10||Nonmetallic minerals, except fuels [State Annual SIC]|
|11||Construction [State Annual SIC]|
|12||Manufacturing [State Annual SIC]|
|13||Durable goods manufacturing [State Annual SIC]|
|14||Lumber and w|
This is an attempt to get Leaflet working with D3's Albers USA projection.
This first stab works deceptively well: the coordinates are at least self-consistent, so centering, panning and zooming work as expected. There are some problems, though:
d3.geo.albersUsa()projection appears to return
nullfor coordinates that don't fall within its parallels, which Leaflet doesn't like.
- Likely related, something in Leaflet's bounding box calculation for the US GeoJSON produces
NaNs and fails.
- The D3 projection's
scale(.25)is a stab in the dark that makes the US approximately the right size at zoom 3, but is most certainly wrong.
In general, it's not clear whether we should be transforming D3's projection (which, according to the docs, doesn't support translation anyway) or Leaflet's transformation (currently a noop).