-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first stab at getting custom colors for negative numbers working per #28
. Fix some bugs that should help, but not entirely fix, #27
- Loading branch information
Ths2-9Y-LqJt6
committed
Sep 15, 2016
1 parent
18b1569
commit 4ed1b84
Showing
4 changed files
with
111 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
country,widgets | ||
United States,-110 | ||
Angola,-100 | ||
Egypt,-80 | ||
Gambia,-50 | ||
Kenya,-40 | ||
Malawi,-10 | ||
Mozambique,10 | ||
Namibia,20 | ||
Nigeria,40 | ||
Rwanda,50 | ||
South Africa,60 | ||
Mexico,100 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<link rel="stylesheet" href="bootstrap.min.css"> | ||
<link rel="stylesheet" href="maptable.css"> | ||
<title>MapTable: Basic with Map, Filters and Table - minimal options</title> | ||
</head> | ||
<body> | ||
|
||
<script src="d3.min.js" charset="utf-8"></script> | ||
<script src="topojson.min.js"></script> | ||
<script src="maptable.js"></script> | ||
|
||
<div id="vizContainer" class='container'></div> | ||
<script> | ||
var viz = d3.maptable('#vizContainer') | ||
.csv('negative.csv') | ||
.map({ | ||
countryIdentifierKey: 'country', | ||
countryIdentifierType: 'name', | ||
path: 'ne_110m_admin_0_countries.json', | ||
countries: { | ||
attr: { // todo min, max, empty, legend and rollup don't work | ||
fill: { | ||
min: "#B4C3D1", | ||
max: "#043864", | ||
minNegative: "#FFB3B3", | ||
maxNegative: "#FF0000", | ||
empty: "#f9f9f9", | ||
legend: true, | ||
rollup: function(groupedData) { | ||
if (groupedData[0] != undefined) { | ||
return groupedData[0].widgets; | ||
} | ||
}, | ||
}, | ||
stroke: "#d9d9d9", | ||
"stroke-width": 0.5 | ||
}, | ||
}, | ||
markers: false, | ||
}) | ||
.filters() | ||
.table() | ||
.render(); | ||
</script> | ||
</body> | ||
</html> |
This file contains 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
This file contains 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