Skip to content

Instantly share code, notes, and snippets.

@doc22940
Created April 5, 2020 06:15
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 doc22940/05dcae10dfe5388447f7accbb3b90d5e to your computer and use it in GitHub Desktop.
Save doc22940/05dcae10dfe5388447f7accbb3b90d5e to your computer and use it in GitHub Desktop.
roughViz Scatter Demo
license: mit
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://unpkg.com/rough-viz@1.0.4"></script>
<style>
.wrapper {
display: flex;
flex: wrap;
order: row;
}
</style>
</head>
<body>
<br><br>
<div class="wrapper">
<div id="vis0"></div>
<div id="vis1"></div>
</div>
<script>
new roughViz.Scatter(
{
element: '#vis0',
data: 'https://raw.githubusercontent.com/uiuc-cse/data-fa14/gh-pages/data/iris.csv',
title: 'Iris Scatter Plot',
x: 'sepal_width',
y: 'petal_length',
colorVar: 'species',
highlightLabel: 'species',
fillWeight: 4,
radius: 12,
colors: ['pink', 'coral', 'skyblue'],
stroke: 'black',
strokeWidth: 0.4,
roughness: 1,
width: 400,
height: 450,
font: 0,
xLabel: 'sepal width',
yLabel: 'petal length',
curbZero: false,
})
new roughViz.Scatter(
{
element: '#vis1',
data: {
x: [1, 2, 3, 7, 5, 9],
y: [240, 40, 40, 160, 100],
},
title: 'Some Random (x,y) Data',
width: 400,
roughness: 0,
radius: [25, 10, 40, 30, 60],
fillWeight: 3,
axisRoughness: 1,
height: 450,
colors: ['green', 'red', 'blue', 'black']
}
);
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment