I’m trying using d3.js and nvd3 (I have the two smart packages), but I can’t display anything, I have this following exception :
Exception from Tracker afterFlush function: undefined is not a function
TypeError: undefined is not a function
I know it is caused because of the this.autorun() inside the template.rendered(), but all examples use this and I don’t understand why it’s doing this.
Other question, I want to display the last inserted document in my Temperature collection, how can I do that ? findOne() returns the first one and not the last one.
All the data flow is working, my only real problem is the front end and I’m very bad at it (I an ‘‘old’’ Java EE backend developer).
Oh it works now ! But why is this a problem ? How can I get the transitions then ?
Is it not bad for performance to sort everytime I need the last doc ? Since this will be called maybe more than once per second and on a lot of other collections too.
And another question which is not really related :
I find it very difficult to code in JS, I was used to statically typed language and to the javadoc, now I don’t really know if my code works before executing it, and the big problem too is that I can’t find the available methods and what they do without reading the doc at the same time (not just with Meteor API, but let’s say with d3).
if you need transition it’s .transition().duration(350)
if you need just the last temp, you can put it in a Session.set(“lastTemp”, lastTemp) and call it with Session.get(“lastTemp”)
unit testing is the way -> look at https://github.com/meteor-velocity/velocity
I hope you’ve seen than meteor reloads automatically when you update code, with velocity tests are also run again.
yes d3.js is ok for this kind of graphs, have a look at http://dc-js.github.io/dc.js/ based on d3 that gives crossfilter capabilities (sync multiple graphs) and large datasets -> see Nasdaq example.
Hi Sir @robfallows I hope you are doing well .
I have question regarding your answer, actually i am using chart.js with the plugin react-chart.js and chartjs-plugin-streaming , but when I use the usesubscribe and use find to get the new data, all graph change and start over from the beginning.How can i fix the problem?