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
| function getRandomColor () { | |
| var letters = '0123456789ABCDEF'; | |
| var color = '#'; | |
| for (var i = 0; i < 6; i++) { | |
| color += letters[Math.floor(Math.random() * 16)]; | |
| } | |
| return color | |
| } |
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
| const states = [ | |
| {"name":"Alabama","abbrev":"Ala."}, | |
| {"name":"Alaska","abbrev":"Alaska"}, | |
| {"name":"Arizona","abbrev":"Ariz."}, | |
| {"name":"Arkansas","abbrev":"Ark."}, | |
| {"name":"California","abbrev":"Calif."}, | |
| {"name":"Colorado","abbrev":"Colo."}, | |
| {"name":"Connecticut","abbrev":"Conn."}, | |
| {"name":"Delaware","abbrev":"Del."}, | |
| {"name":"District of Columbia","abbrev":"D.C."}, |
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
| <!-- responsive bar chart --> | |
| <div class='chart'> | |
| <h2>US birthrate by year</h2> | |
| <svg ref:svg> | |
| <g transform='translate(0,0)'> | |
| <g class='axes'> |
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
| <!-- responsive area chart --> | |
| <div class='chart'> | |
| <h2>US birthrate by year</h2> | |
| <svg ref:svg> | |
| <g transform='translate(0,0)'> | |
| <g class='axes'> | |
| <!-- y axis --> |
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
| <!-- basic line chart --> | |
| <div class='chart'> | |
| <h2>US birthrate by year</h2> | |
| <svg style='width: {{width}}px; height: {{height}}px;'> | |
| <g transform='translate(0,0)'> | |
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
| <defs> | |
| <pattern id="hash" width="6" height="6" patternUnits="userSpaceOnUse" patternTransform="rotate(45)"> | |
| <rect width="3" height="6" transform="translate(0,0)" fill="#ccc"></rect> | |
| </pattern> | |
| </defs> |
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
| const months = { | |
| 0: { 'month': 'January', 'abbrev': 'Jan'}, | |
| 1: { 'month': 'February', 'abbrev': 'Feb'}, | |
| 2: { 'month': 'March', 'abbrev': 'Mar'}, | |
| 3: { 'month': 'April', 'abbrev': 'Apr'}, | |
| 4: { 'month': 'May', 'abbrev': 'May'}, | |
| 5: { 'month': 'June', 'abbrev': 'Jun'}, | |
| 6: { 'month': 'July', 'abbrev': 'Jul'}, | |
| 7: { 'month': 'August', 'abbrev': 'Aug'}, | |
| 8: { 'month': 'September', 'abbrev': 'Sep'}, |
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
| [ | |
| {"state_abbrev":"AL","state_name":"Alabama","type_dem":"primary","type_rep":"primary"}, | |
| {"state_abbrev":"AK","state_name":"Alaska","type_dem":"caucus","type_rep":"caucus"}, | |
| {"state_abbrev":"AZ","state_name":"Arizona","type_dem":"primary","type_rep":"primary"}, | |
| {"state_abbrev":"AR","state_name":"Arkansas","type_dem":"primary","type_rep":"primary"}, | |
| {"state_abbrev":"CA","state_name":"California","type_dem":"primary","type_rep":"primary"}, | |
| {"state_abbrev":"CO","state_name":"Colorado","type_dem":"caucus","type_rep":"caucus"}, | |
| {"state_abbrev":"CT","state_name":"Connecticut","type_dem":"primary","type_rep":"primary"}, | |
| {"state_abbrev":"DC","state_name":"District of Columbia","type_dem":"primary","type_rep":"convention"}, | |
| {"state_abbrev":"DE","state_name":"Delaware","type_dem":"primary","type_rep":"primary"}, |
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
| [ | |
| {"name":"Alabama","abbrev":"AL","fips":"01"}, | |
| {"name":"Alaska","abbrev":"AK","fips":"02"}, | |
| {"name":"Arizona","abbrev":"AZ","fips":"04"}, | |
| {"name":"Arkansas","abbrev":"AR","fips":"05"}, | |
| {"name":"California","abbrev":"CA","fips":"06"}, | |
| {"name":"Colorado","abbrev":"CO","fips":"08"}, | |
| {"name":"Connecticut","abbrev":"CT","fips":"09"}, | |
| {"name":"Delaware","abbrev":"DE","fips":"10"}, | |
| {"name":"District of Columbia","abbrev":"DC","fips":"11"}, |
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
| var state = function () { | |
| if (foo == "AL"){ return "1"} | |
| if (foo == "AK"){ return "2"} | |
| if (foo == "AZ"){ return "4"} | |
| if (foo == "AR"){ return "5"} | |
| if (foo == "CA"){ return "6"} | |
| if (foo == "CO"){ return "8"} | |
| if (foo == "CT"){ return "9"} | |
| if (foo == "DE"){ return "10"} | |
| if (foo == "FL"){ return "12"} |