Created
October 18, 2014 20:55
-
-
Save TweededBadger/17a6f13a787578a69fc5 to your computer and use it in GitHub Desktop.
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
angular.module('SvgMapApp', []) | |
.controller('MainCtrl', ['$scope', function ($scope) { | |
var states = ["AL", "AK", "AS", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FM", "FL", "GA", "GU", "HI", "ID", "IL", | |
"IN", "IA", "KS", "KY", "LA", "ME", "MH", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", | |
"NY", "NC", "ND", "MP", "OH", "OK", "OR", "PW", "PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VI", "VA", | |
"WA", "WV", "WI", "WY"]; | |
$scope.createDummyData = function () { | |
var dataTemp = {}; | |
angular.forEach(states, function (state, key) { | |
dataTemp[state] = {value: Math.random()} | |
}); | |
$scope.dummyData = dataTemp; | |
}; | |
$scope.createDummyData(); | |
}]); |
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
<!--...--> | |
<div class="container"> | |
<div svg-map></div> | |
<p> | |
<button ng-click="createDummyData()" class="btn btn-block btn-default">Create Dummy Data</button> | |
</p> | |
<div class="regionlist"> | |
<div ng-repeat="(key,region) in dummyData"> | |
<div>{{key}}</div> | |
<div>{{region.value | number}}</div> | |
</div> | |
</div> | |
</div> | |
<!--...--> |
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
/*....*/ | |
.regionlist { | |
-webkit-column-count: 5; /* Chrome, Safari, Opera */ | |
-moz-column-count: 5; /* Firefox */ | |
column-count: 5; | |
} | |
.regionlist > div { | |
display: inline-block; | |
width: 100%; | |
border-bottom: 1px solid grey; | |
} | |
.regionlist > div > div { | |
display: inline-block; | |
width: 48%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment