Friday, 15 January 2010

d3.js - Visualize mongoDb with dcJs (Meteor) -



d3.js - Visualize mongoDb with dcJs (Meteor) -

i'm interested visualize meteor info (mongodb) dcjs. however, can't find much info topic.

i recreated http://www.codeproject.com/articles/697043/making-dashboards-with-dc-js-part-2-graphing using meteor.

without calling mongodb,

var info = [ {_id: "id1", date: "12/27/2012", http_404: 2, http_200: 190, http_302: 100}, {_id: "id2", date: "12/28/2012", http_404: 2, http_200: 10, http_302: 100}, {_id: "id3", date: "12/29/2012", http_404: 1, http_200: 300, http_302: 200}, {_id: "id4", date: "12/30/2012", http_404: 2, http_200: 90, http_302: 0}, {_id: "id5", date: "12/31/2012", http_404: 2, http_200: 90, http_302: 0}, {_id: "id6", date: "01/01/2013", http_404: 2, http_200: 90, http_302: 0}, {_id: "id7", date: "01/02/2013", http_404: 1, http_200: 10, http_302: 1}, {_id: "id8", date: "01/03/2013", http_404: 2, http_200: 90, http_302: 0}, {_id: "id9", date: "01/04/2013", http_404: 2, http_200: 90, http_302: 0}, {_id: "id10", date: "01/05/2013", http_404: 2, http_200: 90, http_302: 0}, {_id: "id11", date: "01/06/2013", http_404: 2, http_200: 200, http_302: 1}, {_id: "id12", date: "01/07/2013", http_404: 1, http_200: 200, http_302: 100} ];

the result working fine.

by inserting , calling info mongodb, failed.

not sure what's missing here.

hope advice. thanks!

i suspect error fired next code:

var mindate = datedim.bottom(1)[0].date; var maxdate = datedim.top(1)[0].date;

it's probable template rendered callback beingness fired before info has been loaded database.

probably easiest way prepare set if statement:

if (dichas.find().count() !== 0) { ... of code depends on there beingness info }

mongodb d3.js meteor dc.js crossfilter

No comments:

Post a Comment