Skip to content

Instantly share code, notes, and snippets.



Created Jul 11, 2014
What would you like to do?
<html lang='en'>
<title>Nyaplotjs example -- Boxplot</title>
<script src=''></script>
<script src=''></script>
<div id='vis'></div>
var data1=[];
for(var i=0;i<100;i++){
norm1:d3.random.normal(0, 1)(),
norm2:d3.random.normal(3, 2)(),
norm3:d3.random.normal(1, 0.5)()
var y_min = d3.min(data1, function(d){return (d.norm2 < d.norm1 ? d.norm2 : d.norm1)})-1;
var y_max = d3.max(data1, function(d){return (d.norm2 > d.norm1 ? d.norm2 : d.norm1)})+1;
models = {data:{data1: data1},panes: [{type:'rectangular', diagrams:[{type: 'box', data: 'data1', options: {value:["norm1","norm2","norm3"]}}],options:{width:500, height:500, xrange: ["norm1","norm2","norm3"], yrange: [y_min, y_max]}}]};
window.onload = function(){Nyaplot.core.parse(models, '#vis');};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment