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

Already on GitHub? Sign in to your account

Support for listeners and overrides #38

Closed
greinacker opened this Issue Aug 1, 2012 · 4 comments

Comments

Projects
None yet
2 participants
Contributor

greinacker commented Aug 1, 2012

@winston -

I've been working with this gem for a while, and just recently had to make changes to do two things:

  1. Add support for adding listeners to the charts; this isn't currently possible without redefining BaseChart.to_js in its entirety. If BaseChart had an array of listeners, then they could be inserted into the script in the BaseChart.to_js in a general way.
  2. I wanted to override individual chart types (e.g. GoogleVisualr::Interactive::BarChart) to carry some extra data around before rendering. In my case I made a "ClickableBarChart". This also required redefining BaseChart.to_js, because it uses class_name to specify the Google chart type. I propose we have something like "chart_name" as a property, and in BaseChart that simply returns class_name...but in subclasses this could be overridden to be whatever was necessary.

They're not big deals - but it's just ugly to have to redefine to_js and basically copy all the code from the original version.

Would you consider pull requests for the above two items?

Contributor

greinacker commented Aug 12, 2012

Since I had the code already ready, I added the above two pull requests...

Owner

winston commented Aug 14, 2012

Hi Greg,

Thanks for the pull requests!

Please give me some time to look through the changes.

Cheers,
Winston

Contributor

greinacker commented Aug 14, 2012

No problem Winston!

Owner

winston commented Oct 16, 2012

Merged both changes. Will be doing the necessary and releasing a new version of the gem soon.

Thank you!

@winston winston closed this Oct 16, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment