Created
October 26, 2012 18:42
-
-
Save ejfox/3960624 to your computer and use it in GitHub Desktop.
Make links for D3 force layout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _.each(d3darkmoney.nodes, (row, index) -> | |
| # console.log "Nodes, ", row, index | |
| if row.lean is "conservative" && row.type is "cluster" | |
| d3darkmoney['links'].push({"source": index, "target": 0, "value": 1}) | |
| else if row.lean is "liberal" && row.type is "cluster" | |
| d3darkmoney['links'].push({"source": index, "target": 1, "value": 1}) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment