Simple
/** @jsx hJSX */
import Rx from 'rx'
import {run} from '@cycle/core'
import {makeDOMDriver, h, hJSX} from '@cycle/dom'
import { sparklines, sparklinesLine } from 'cyclejs-sparklines'
function main({DOM}) {
const view$ = Rx.Observable.just(
);
return { DOM: view$ }
}
run(main, {
DOM: makeDOMDriver('#app', {'sparklines':sparklines, 'sparklinesLine':sparklinesLine})
});
Customizable
Spots
Bars
Dynamic
import Rx from 'rx';
import {run} from '@cycle/core';
import {makeDOMDriver, h, hJSX} from '@cycle/dom';
import { sparklines, sparklinesSpots, sparklinesLine } from 'cyclejs-sparklines';
function makeDataSourceDriver(){
return Rx.Observable.interval(100)
.scan( (acc, x) => acc.concat([someRandomFunction()] ), []);
}
function dynamic1({DOM, DataSource}) {
const view$ = DataSource.map( data => (
));
return { DOM: view$ }
}
run(dynamic1, {
DOM: makeDOMDriver('#dynamic1', {
'sparklines':sparklines,
'sparklinesSpots':sparklinesSpots,
'sparklinesLine':sparklinesLine
}),
DataSource: makeDataSourceDriver
});
Reference Line
Normal Band
Real world examples