clinical:graphs-dailystats

v2.3.5Published 8 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

clinical:graphs-dailystats

DailyStats linechart for Meteor ClinicalFramework using D3 and NVD3.

DailyStats Screenshot

========================== ####Package Installation

meteor add clinical:graphs-dailystats

Then add the graph to your application with the following.

1{{> DailyStatsChart }}

Note that you can currently only have one DaiilyStatsChart on the page at a time. After adding the DailyStatsChart to your document object model, you'll need to subscribe to the collection and render the graph. The best pattern we've found so far is within the router, like so:

1Router.map(function(){
2  this.route('dashboardPageRoute', {
3    path: '/',
4    template: 'dashboardPage',
5    waitOn: function(){
6      Meteor.subscribe ('interactionsDaily');
7    },
8    onAfterAction: function() {
9      Graphs.renderDailyInteractionsDailyStats();
10    }
11  });
12});

If you want multiple lines in your graph, you'll need to set up a configuration object.

1Meteor.startup(function (){  
2  DailyStats.configure({
3    dailyTotal: {
4      color: "#45b76f",
5      key: "Total"
6    },
7    bucketA: {
8      color: "#E68A2E",
9      key: "Foo"
10    },
11    bucketB: {
12      color: "#80B2FF",
13      key: "Bar"
14    },
15    bucketC: {
16      color: "#DB4D4D",
17      key: "Squee"
18    }
19  });
20});

==========================

API

1// isomorphic object
2StatsCounter.incrementCount("bucketA");
3
4// remote procedure call
5Meteor.call('incrementCount', "bucketB");

==========================

Testing API

Be sure to run starrynight generate-autoconfig to add the component tests to your .meteor/nightwatch.js config file.

1// component output
2.reviewDailyStatsChart()
3
4// component input
5.clickDailyStatsChart()

========================== ####Contributions & Licensing

Made possible by the support of the Open Health Imaging Foundation and the Open Genomics Core.

MIT licensed. Use as you will.