Created
August 16, 2014 14:22
-
-
Save domitry/eab8723ccb32fd3a6cd8 to your computer and use it in GitHub Desktop.
Example for Nyaplotjs
This file contains hidden or 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
<html lang='en'> | |
<head> | |
<title>Nyaplotjs example -- Heatmap</title> | |
<script src='http://d3js.org/d3.v3.min.js'></script> | |
<script src='https://rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js'></script> | |
</head> | |
<body> | |
<div id='vis'></div> | |
<script> | |
var data1 = [], MAX=50, MIN=0; | |
var step=2 | |
for(var i=0;i<50;i+=step){ | |
for(var j=0;j<50;j+=step){ | |
data1.push({x:i, y:j, val:Math.random()}); | |
} | |
} | |
models = {data:{data1: data1},panes: [{type:'rectangular', diagrams:[{type: 'heatmap', data: 'data1', options: {x:'x', y:'y', fill:'val', width:step, height:step, stroke_width:0}}],options:{width:500, height:500, xrange: [0, 50], yrange: [0, 50], legend:true, zoom:true}}]}; | |
window.onload = function(){Nyaplot.core.parse(models, '#vis');}; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment