Comments (3)
This is basically a dupe of #20, and really of #3. Unfortunately I haven't had much time to work on this library in a couple of years, so if you're interested in helping out, pull requests are welcome!
from topogram.
from topogram.
Here is where I got when I last thought about the problem.
One solution is something along the lines of using the area (in pixels) of the features as the basis for the scale range. E.g.
var path = d3.geo.path();
var areas = features.map(path.area);
var areaRange = d3.extent(areas);
var scale = d3.scale.linear()
.domain(valueDomain)
.range(areaRange);
Another way of doing it would be to find the total area of the features, then proportionally scale the output range in such a way that you end up with the same total area. That's a slightly more complicated process, but might be possible to generalize within the library.
from topogram.
Related Issues (20)
- Cartogram of countries of the world display error HOT 16
- Does anyone know if this would enable nvd3 in IE8? HOT 1
- page starts out with no attribute selected HOT 1
- Comment Example Doesn't Have Correct Number of Variables HOT 6
- How can make d3-cartogram works on a NULL projection? HOT 1
- Area Scaling HOT 1
- Uncaught TypeError: Cannot read property '0' of null HOT 1
- cartogram.js receive help to coordinate directly.
- I'm trying to read data not from .csv, but i have no idea. HOT 2
- topojson.merge topojson.mesh HOT 3
- Area scaling is wonky
- Make this repo a d3-plugin
- Publish to npm HOT 2
- example is not working: pointing to wrong file HOT 1
- can't find build/topogram.js HOT 2
- Cartogram does not seem to load
- Needs modification to work with d3 v3 HOT 7
- sum() routine is wrong HOT 1
- Needs modification to work with topojson.v1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from topogram.