Skip to content

Add interactive Timeline chart #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 6, 2013
Merged

Conversation

ghiculescu
Copy link
Contributor

Add support for Google's Timeline chart: https://developers.google.com/chart/interactive/docs/gallery/timeline

Note that the first two commits, 1 2, are fixes for #64 - I merged them in here so I could work off my branch before this is merged into the gem. The interesting stuff is in this commit.

The Timeline chart is able to plot stuff across date ranges, or across times within a date. It does this by expecting a new Date(0, 0, 0,...) if you are only interested in the times (example). To allow the gem to handle this, I've added a new column type - timewithoutdate. It expects a Ruby Time or DateTime for validation purposes, then coerces it into the form required for the chart, outputting it as if it's a datetime.

If you want to make a dated timeline (example) you should just set your column type as date rather than timewithoutdate. Happy to help with documentation on the examples site.

If you had other ideas about how to manage this sort of "weird" handling of dates I'm certainly happy to hear it - this seemed like the simplest solution to me, and so far I haven't come across any leaks in the abstraction.

@winston
Copy link
Owner

winston commented Nov 24, 2013

I added some comments to the commit 793ceee. Let me know what you think? Otherwise, the commit is good.

Would also love it if you can add some tests for DataTable or Cell. Again, thank you for this!

I'll push a new version of the gem once this is merged.

@ghiculescu
Copy link
Contributor Author

I'm not too fussy on how its set out, your suggestions make sense. I'll try and put aside some time today to get it done.

@winston
Copy link
Owner

winston commented Nov 25, 2013

No hurry. Take your time! Thank you!

winston added a commit that referenced this pull request Dec 6, 2013
Add interactive Timeline chart
@winston winston merged commit 841f368 into winston:master Dec 6, 2013
@winston
Copy link
Owner

winston commented Dec 6, 2013

Just released 2.2.0 https://rubygems.org/gems/google_visualr. Thanks for your help on this @ghiculescu!

@ghiculescu ghiculescu deleted the timeline branch May 10, 2014 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants