Skip to content

Instantly share code, notes, and snippets.

@jwilber
Last active November 16, 2019 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jwilber/4dc5235f7ea5e51ac1219b3605f5af6a to your computer and use it in GitHub Desktop.
Save jwilber/4dc5235f7ea5e51ac1219b3605f5af6a to your computer and use it in GitHub Desktop.
roughViz Bar Demo
license: mit
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://unpkg.com/rough-viz@1.0.5"></script>
<style>
.wrapper {
display: flex;
flex: wrap;
order: row;
}
</style>
</head>
<body>
<br><br>
<div class="wrapper">
<div id="vis0"></div>
</div>
<script>
new roughViz.Bar(
{
element: '#vis0',
// data: [[1,2], [5, 6], [8,8], [5, 100], [200, 10], [50, 50]],
data: 'https://gist.githubusercontent.com/mbostock/3310560/raw/98311dc46685ed02588afdcb69e5fa296febc1eb/letter-frequency.tsv',
title: 'Letters',
labels: 'letter',
values: 'frequency',
width: window.innerWidth,
stroke: 'coral',
strokeWidth: 3,
color: 'pink',
fillWeight: 1.5,
}
);
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment