This is a simple proof-of-concept example of how one could embed Juttle-powered charts and visualizations in a custom application.
Requires node.js to be installed.
// Simple example of using input controls as parameters | |
input message: text -label 'Message to show' -default 'Testing...'; | |
input num_points: dropdown -items [1,2,3,4,5,6,7,8] -label 'Number of points' -default 5; | |
emit -limit num_points | |
| put message="${message} ${count()}" | |
| @tile |
// silly little juttle that compares the twitterati | |
( | |
emit -limit 1 | put name='demmer', tweets=12, followers=33, first_tweet=:2015-06-02:; | |
emit -limit 1 | put name='apurva', tweets=81, followers=71, first_tweet=:2002-06-18:; | |
emit -limit 1 | put name='henri', tweets=121, followers=61, first_tweet=:2007-12-31:; | |
) | |
| put followers_per_day = Duration.get(:now: - first_tweet, "days") | |
| put followers_per_tweet = followers / tweets | |
|( | |
@barchart -title "Followers" -valueField 'followers' -categoryField 'name'; |
#!/usr/bin/env node | |
// | |
// Script to convert any extendable-base derived classes in the specified | |
// files into proper ES6 classes. | |
// | |
// Along the way it will remove any require() statements for extendable-base | |
// itself, convert any prototype literals into ES6 properties, and add the | |
// appropriate superclass constructor invocations to get the same behavior as | |
// the extendable-base initialize chain. | |
// |
#!/usr/bin/python | |
''' | |
Script to count messages by user posted to a channel for a given date range. | |
Install: | |
# sudo pip install slackclient | |
Also you will need to obtain a slack API token: | |
https://api.slack.com/docs/oauth-test-tokens |