Skip to content

Instantly share code, notes, and snippets.

@mukhtyar
Last active January 18, 2018 20:41
Show Gist options
  • Save mukhtyar/c14c1512e553d12a8eb0b348c01206d3 to your computer and use it in GitHub Desktop.
Save mukhtyar/c14c1512e553d12a8eb0b348c01206d3 to your computer and use it in GitHub Desktop.
SVG Icons
license: mit
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
.container, .container-new {
width: 100%;
height: 100%;
margin: 1rem;
background-color: #fafafa;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
}
.icon {
flex: 0 1 20%;
display: flex;
flex-direction: column;
align-items: center;
}
svg {
width: 50%;
height: 50%;
}
</style>
</head>
<body>
<h3>Existing Topic Icons</h3>
<div class="container">
</div>
<h3>Options for New Topic Icons</h3>
<div class="container equity"></div>
<div class="container financing"></div>
<div class="container tribal"></div>
<script>
var existingIcons = [
{
color: '#479c6b',
topic: 'agriculture'
},
{
color: '#3c5882',
topic: 'biodiversity-and-habitat'
},
{
color: '#809530',
topic: 'parks-recreation-and-historic-and-cultural'
},
{
color: '#a73f3b',
topic: 'emergency-management'
},
{
color: '#ce8a34',
topic: 'energy'
},
{
color: '#1d6440',
topic: 'forestry'
},
{
color: '#815a54',
topic: 'land-use-and-community-development'
},
{
color: '#009290',
topic: 'ocean-and-coast'
},
{
color: '#bc3a6d',
topic: 'public-health'
},
{
color: '#7f5a79',
topic: 'transportation'
},
{
color: '#138db8',
topic: 'water'
}
];
var equityIcons = [
{
color: '#479c6b',
topic: 'equity-and-environmental-justice1'
},
{
color: '#3c5882',
topic: 'equity-and-environmental-justice2'
},
];
var financingIcons = [
{
color: '#809530',
topic: 'financing1'
},
{
color: '#a73f3b',
topic: 'financing2'
},
{
color: '#a73f3b',
topic: 'financing3'
},
];
var tribalIcons = [
{
color: '#1d6440',
topic: 'tribal-and-indigenous-communities1'
},
{
color: '#1d6440',
topic: 'tribal-and-indigenous-communities2'
},
];
function loadSvgFile(filename, className) {
d3.xml(filename).mimeType('image/svg+xml').get(function(error, xml) {
if (error) throw error;
var icon = d3.select('.' + className)
.append('div')
.classed('icon', true)
.node();
icon.appendChild(xml.documentElement);
var span = document.createElement('span');
var topic = filename.split('.')[0];
span.innerHTML = topic.split('topic-')[1];
icon.appendChild(span)
});
}
existingIcons.forEach(function(item){
loadSvgFile('topic-' + item.topic + '.svg', 'container');
});
equityIcons.forEach(function(item){
loadSvgFile('topic-' + item.topic + '.svg', 'equity');
});
financingIcons.forEach(function(item){
loadSvgFile('topic-' + item.topic + '.svg', 'financing');
});
tribalIcons.forEach(function(item){
loadSvgFile('topic-' + item.topic + '.svg', 'tribal');
});
</script>
</body>
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
width="115"
height="115"
viewBox="0 0 115 115"
enable-background="new 0 0 792 612"
xml:space="preserve"><metadata
id="metadata413"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs411" /><circle
style="fill:none;stroke:#ffffff;stroke-width:3.26600003"
id="circle315"
r="54.798"
cy="485.431"
cx="260.83099"
clip-path="url(#SVGID_26_)"
transform="translate(-203.33099,-427.931)" /><path
transform="translate(-203.33099,-427.931)"
style="fill:#d3540f;fill-opacity:0.94117647;stroke:#ffffff;stroke-opacity:1"
id="path313"
d="m 260.831,540.229 c -30.264,0 -54.798,-24.534 -54.798,-54.798 0,-30.266 24.534,-54.798 54.798,-54.798 30.264,0 54.798,24.532 54.798,54.798 -0.001,30.263 -24.534,54.798 -54.798,54.798"
clip-path="url(#SVGID_26_)" /><path
transform="scale(-1,1)"
d="m -56.600617,55.269739 c -0.09895,-0.14808 0.04547,-0.325407 0.183339,-0.376882 0.318084,-0.118758 0.624305,0.158487 0.696343,0.453675 0.131379,0.53835 -0.326752,1.014884 -0.832107,1.101509 -0.807727,0.138455 -1.493378,-0.546933 -1.589044,-1.312869 -0.140512,-1.124972 0.816777,-2.056856 1.8919,-2.156375 1.48892,-0.137823 2.702954,1.134604 2.801413,2.566089 0.130584,1.898538 -1.499074,3.429705 -3.332923,3.522411 -2.352918,0.118947 -4.235437,-1.909082 -4.317873,-4.190305 -0.103035,-2.85126 2.363691,-5.118697 5.136442,-5.186492 3.392851,-0.08296 6.078206,2.862083 6.127112,6.16977 0.0588,3.977052 -3.403539,7.112822 -7.288905,7.138696 -4.603283,0.03065 -8.221519,-3.987419 -8.22031,-8.492608 0.0014,-5.27102 4.613147,-9.403363 9.779763,-9.371099 5.979778,0.03734 10.657499,5.280195 10.590279,11.149348 -0.07707,6.72911 -5.988082,11.983139 -12.600427,11.877127 -7.518607,-0.120542 -13.379555,-6.736367 -13.230972,-14.132138 0.167711,-8.347881 7.524637,-14.846068 15.743678,-14.651187 9.216574,0.218533 16.382045,8.35251 16.137188,17.4343 -0.272966,10.124349 -9.219629,17.986891 -19.203306,17.688423 -11.070889,-0.330971 -19.660049,-10.125659 -19.304375,-21.050039 0.392513,-12.055892 11.070285,-21.400987 22.97388,-20.984552 13.079077,0.457557 23.209208,12.053208 22.728492,24.974245 -0.526073,14.140172 -13.074147,25.084237 -27.05058,24.535752 -15.238924,-0.59803 -27.025623,-14.132834 -26.405912,-29.202359 0.6734,-16.375085 15.229013,-29.032937 31.429079,-28.338573 17.548426,0.752157 31.105768,16.362443 30.333352,33.730266 -0.834275,18.758721 -17.532893,33.243724 -36.105461,32.389882 -14.330731,-0.65883 -27.086115,-10.179408 -32.140427,-23.549573"
id="path4176"
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317"
d="m 78.555358,35.541707 6.621525,-5.116633"
style="fill:#3f47ff;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /><path
id="path4317-5"
d="m 73.158982,29.446776 4.472207,-7.072757"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-5-6"
d="m 65.473996,25.784602 1.783475,-8.175803"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-5-6-2"
d="m 56.265114,23.770498 0.336667,-8.361291"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-5-6-2-9"
d="M 46.668148,24.725038 44.829281,16.561516"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-5-6-2-9-1"
d="M 37.76097,28.561685 33.871885,21.152263"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-5-6-2-9-1-2"
d="M 30.376655,34.854668 24.702388,28.704286"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-5-6-2-9-1-2-7"
d="M 24.825216,45.188367 17.752459,40.716163"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-5-6-2-9-1-2-7-0"
d="M 22.760678,52.751905 14.399387,52.415241"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-5-6-2-9-1-2-7-0-9"
d="m 23.108001,63.724956 -8.292725,1.120372"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-5-6-2-9-1-2-7-0-9-3"
d="m 26.282982,72.603173 -7.720183,3.228512"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-5-6-2-9-1-2-7-0-9-3-6"
d="m 31.36716,80.259158 -6.150383,5.674266"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-5-6-2-9-1-2-7-0-9-3-6-0"
d="m 38.203019,85.579481 -4.472205,7.072758"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-5-6-2-9-1-2-7-0-9-3-6-0-6"
d="m 47.29432,89.936887 -2.489255,7.989248"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-5-6-2-9-1-2-7-0-9-3-6-0-6-2"
d="m 55.849335,91.707228 -0.33667,8.361292"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-5-6-2-9-1-2-7-0-9-3-6-0-6-2-6"
d="m 66.367827,90.583962 2.543364,7.972192"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-5-6-2-9-1-2-7-0-9-3-6-0-6-2-6-1"
d="m 76.81666,85.932288 4.520056,7.042273"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-5-6-2-9-1-2-7-0-9-3-6-0-6-2-6-1-8"
d="m 85.393287,79.07616 6.188718,5.632435"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-9"
d="m 84.477064,43.17553 7.720185,-3.228511"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-9-2"
d="M 86.066524,52.692291 94.359251,51.57192"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
id="path4317-5-6-2-9-1-2-7-0-9-3-6-0-6-2-6-1-8-0"
d="m 91.541847,68.234842 7.435624,3.838757"
style="fill:#3f47ff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /></svg>
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment