-
Notifications
You must be signed in to change notification settings - Fork 100
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
adding support for embedded functions inside the google visualization #74
base: master
Are you sure you want to change the base?
Conversation
@@ -32,6 +33,10 @@ def add_listener(event, callback) | |||
@listeners << { :event => event.to_s, :callback => callback } | |||
end | |||
|
|||
def add_function(callback) | |||
@functions << {:callback=> callback} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the new Ruby 1.9 hash syntax.
Use 2 (not -3) spaces for indentation.
Surrounding space missing for operator '=>'.
Space inside { missing.
Space inside } missing.
Tab detected.
@@ -32,6 +33,10 @@ def add_listener(event, callback) | |||
@listeners << { :event => event.to_s, :callback => callback } | |||
end | |||
|
|||
def add_function(callback) | |||
@functions << { :callback=> callback } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the new Ruby 1.9 hash syntax.
Surrounding space missing for operator '=>'.
@@ -32,6 +33,10 @@ def add_listener(event, callback) | |||
@listeners << { :event => event.to_s, :callback => callback } | |||
end | |||
|
|||
def add_function(callback) | |||
@functions << { :callback => callback } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the new Ruby 1.9 hash syntax.
module GoogleVisualr | ||
module Interactive | ||
|
||
# https://developers.google.com/chart/interactive/docs/gallery/timeline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be https://developers.google.com/chart/interactive/docs/gallery/calendar instead.
Hi! Thanks for the PR! The stuff for the new calendar chart is great (and can be extracted as another PR), and I'll merge that. However, I am not so sure about introducing the embedded functions, as it doesn't look too good if you have to write JS in the code, which is precisely the reason for this gem. Do you have a specific use case that cannot be done with listeners? Let me know. Thank you! |
If you take a look at the Treemap example in Google charts, they As for the calendar, I wasn't quite ready to release it to the project but Thanks for google_visualr. It's a great time saver and makes the visuals Robert Hall
|
I had a look at the treemap example, and it seems like you can actually do
So I guess in the Ruby code, you can also do the same, instead of creating additional functions. Will that work for you? I am thinking that this is an edge case for treemap, and am still unsure if it the gem should support adding functions at this point. |
I needed a new function inside the draw_chart() function to support custom tooltips for the TreeMap chart. Added a new add_function method along with additional spec for testing. Please advise?
Ex: