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
/* global pym, d3, topojson */ | |
(function() { | |
'use strict'; | |
var pymChild; | |
function render(containerWidth) { | |
d3.selectAll('svg').remove(); |
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
.bar-chart { | |
margin-right: 1.5em; | |
.city { | |
position: relative; | |
margin-top: 0.5em; | |
.bar-label { | |
text-align: right; | |
width: 135px; | |
margin: 0.15em 0; | |
float: left; |
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
/* | |
Snippet Name: Category or Subcategory | |
Description: Gets the category and all subcategories of a cat_ID | |
Usage: Ideal if you are trying to put code only on the categories of a cat and it's children, in lieu of doing an array of all the children. Put the following code in functions.php or a plugin. | |
*/ | |
<?php if (!function_exists('is_category_or_sub')) { | |
function is_category_or_sub($cat_id = 0) { | |
foreach (get_the_category() as $cat) { | |
if ($cat_id == $cat->cat_ID || cat_is_ancestor_of($cat_id, $cat)) | |
return true; |