Skip to content

Instantly share code, notes, and snippets.

@kenwarner
Created August 31, 2019 16:31
Show Gist options
  • Save kenwarner/780664bf8eb0493f5bb2e771a9cd9064 to your computer and use it in GitHub Desktop.
Save kenwarner/780664bf8eb0493f5bb2e771a9cd9064 to your computer and use it in GitHub Desktop.
// run this in the dev console on RealClearPolitics polling chart pages
// https://www.realclearpolitics.com/epolls/2020/president/us/2020_democratic_presidential_nomination-6730.html
function hide(c, idx) {
c.forEach(function (ci) {
Array.from(document.getElementsByClassName(ci)).forEach((el, i) => {
el.style.visibility = 'visible';
if (!idx.includes(i)) el.style.visibility = 'hidden';
});
});
};
hide(['spread_line', 'spread_area', 'spread_tooltip', 'spread_circle'], []);
hide(['candidate_line', 'candidate_tooltip', 'candidate_circle'], [0, 1, 2, 3, 4, 5]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment