-
I am learning to use Plot and it's cool! I am trying to change the "albers" projection in https://github.com/jaanli/jaan.li/blob/dd7c3ef57bfb4dc607ec01f60ba0d5abf7ada5b9/docs/components/narrativeMap.js (from the electricity example: https://github.com/observablehq/framework/blob/main/examples/eia/docs/components/map.js) But from the documentation (https://observablehq.com/plot/features/projections) it looks like the Imago projection is not supported. Would love to use something like this: https://observablehq.com/d/51f92faafc3fb631 (the idea is just to have a more interactive CV, rather than the boring standard PDF: jaan.io/cv) Potentially related: #1191 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Out of the box, Plot only supports a handful of projections (the same as d3-geo). But you can pass any projection (as long as it is defined as a D3 projection stream) as the projection option, which is a bit complex to use because it offers quite a few possibilities—in particular to adjust the projection to the chart's dimensions. In particular all the projections from the d3-geo-projection and d3-geo-polygon modules can be included this way. For example, to use the Imago projection in a notebook, define:
(You also need d3 and land, see https://observablehq.com/@recifs/plot-imago) To use in Framework:
For background on how the Imago projection was created, see d3/d3-geo-polygon#24 |
Beta Was this translation helpful? Give feedback.
Out of the box, Plot only supports a handful of projections (the same as d3-geo). But you can pass any projection (as long as it is defined as a D3 projection stream) as the projection option, which is a bit complex to use because it offers quite a few possibilities—in particular to adjust the projection to the chart's dimensions.
In particular all the projections from the d3-geo-projection and d3-geo-polygon modules can be included this way.
For example, to use the Imago projection in a notebook, define: