Skip to content

Instantly share code, notes, and snippets.

@radiodario
Last active August 29, 2015 14:00
Show Gist options
  • Save radiodario/11145144 to your computer and use it in GitHub Desktop.
Save radiodario/11145144 to your computer and use it in GitHub Desktop.
Juttle Blocks Test

Test

This is a juttle test. Everything is pretty sweet.

Let's add a bit more test here explaining what this juttle is about

// appends the result to the container
var console_view = {
initialize: function(options) {
},
consume: function(batch) {
this.container.append('<pre>' + JSON.stringify(batch) + '</pre>');
}
}
register_sink('console', console_view);
[
{
"time": 0.5,
"val": 10,
"t": "b"
},
{
"time": 1,
"val": 9,
"t": "a",
"some": 1
},
{
"time": 1.1,
"val": 12,
"t": "a"
},
{
"time": 1.2,
"val": 12,
"t": "a"
},
{
"time": 2,
"val": 15,
"t": "b",
"some": 1
},
{
"time": 2.2,
"val": 11,
"t": "c",
"some": 1
},
{
"time": 2.5,
"val": 8,
"t": "b"
},
{
"time": 3.2,
"val": 33,
"t": "c",
"some": 1
}
]
var $now = Date.now();
var pi = Math.PI;
function sinc(x) => (x==0)?1:Math.sin(pi*x)/(pi*x);
proc source(start, end, step) {
var N = (end - start) / step, HZ = 1 / step;
emitter -hz HZ -limit N -start (start*1000) -reset 1 }
source(-5,5,0.1) | put x=time/1000, y=(sinc(3*x)+1)*10
| @console
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment