Skip to content

Instantly share code, notes, and snippets.

@sanandak

sanandak/g3tst.html

Created May 12, 2016
Embed
What would you like to do?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>G3 Test</title>
<style media="screen">
.axis path,
.axis line {
stroke-width: 1;
fill: none;
stroke: #000;
shape-rendering: crispEdges;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js" charset="utf-8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.js" charset="utf-8"></script>
<script src="g3/dist/g3.js" charset="utf-8"></script>
</head>
<body>
<div class="wig_plot_div">
</div>
<script type="text/javascript">
var myPlot = g3.plot('.wig_plot_div')
.height(400).width(600)
.xDomain([-10, 10])
.yDomain([0, 100])
.draw();
var myarr = new Array(10);
for(var t=0; t<10; t++) {
myarr[t] = new Array(100);
for (var i=0; i<100; i++) {
myarr[t][i] = Math.sin(2*Math.PI * 5 * i / 100 + Math.PI * t / 8);
}
}
console.log(myarr);
var wig = g3.wiggle(myPlot, myarr)
.sampleRate(1000)
.xTrans(0)
.xMult(1)
.draw()
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.