Live data from Hacker News

Show HN: Create Javascript charts with one line of Ruby

ankane.github.io

51–60 of 64 posts

Re: Show HN: Create Javascript charts with one line of Ruby

#52

I wasn't going to click on this as I don't use Ruby very often, but I'm glad I did as it's mostly JavaScript with a ruby helper! If I were you I would reverse the focus and make it a JavaScript library with helpers for various languages.

Would love to do that! Stay tuned :-)

Re: Show HN: Create Javascript charts with one line of Ruby

#56
post #45

Earlier quoted context omitted.

it'd be nice to get a heads up that this was dependent on using a SQL database.

It's not dependent on SQL. @pixel.hits is returning an Array, and there is no method group for Array in Ruby. You could try group_by if you really want to group an Array, or use the Mongoid syntax for grouping.

Is this:

http://stackoverflow.com/questions/4732393/ordering-and-grou...

What you're referring to?

Re: Show HN: Create Javascript charts with one line of Ruby

#58
post #35

Assuming the data for the graph shown is the dots, then the lines between them should be straight, not curved, because othrwise the graph is pretending to have higher accuracy than it actually has, which is a lie.

it's called interpolation.

Using straight lines between points has an even fancier name: "Linear interpolation," which, by your logic, still means it's a better idea.

Re: Show HN: Create Javascript charts with one line of Ruby

#60
post #45

Earlier quoted context omitted.

It's not dependent on SQL. @pixel.hits is returning an Array, and there is no method group for Array in Ruby. You could try group_by if you really want to group an Array, or use the Mongoid syntax for grouping.

Is this: http://stackoverflow.com/questions/4732393/ordering-and-grou... What you're referring to?

You may have to use counts from map reduce. I'm not super familiar with the current state of MongoDB. http://mongoid.org/en/mongoid/docs/querying.html#aggregation...

Hopefully someone else can speak to this.

Post reply on HN