Skip to content
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

How to use in IRuby notebook #109

Open
Shekharrajak opened this issue Jun 6, 2017 · 4 comments
Open

How to use in IRuby notebook #109

Shekharrajak opened this issue Jun 6, 2017 · 4 comments

Comments

@Shekharrajak
Copy link

I want to use google_visualr in IRuby notebook. I tried some examples and got the string as output. I see that there is render_chart method defined in ViewHelper module. Is there any way to use it in IRuby notebook (It just need the html code of the chart and dependent JS file initially) ?

Ping @winston

@winston
Copy link
Owner

winston commented Jun 6, 2017

I haven't used IRuby notebook before. Can IRuby notebook embed JS? If you got the string as output, you should be pretty close. You just need to make it into JS somehow.

render_chart is a Rails helper method, so don't think you can use it in IRuby.

If you need to load the charts, you can refer to how it is loaded: https://developers.google.com/chart/interactive/docs/basic_load_libs

Hope this helps.

@Shekharrajak
Copy link
Author

Thanks for reply. Actually we need to things :

  1. Load the JS file when we do require google_visualr in iruby notebook . Means load <script src='https://www.google.com/jsapi'></script>

  2. When we want to see chart using some method say chart.show_in_iruby will generate html code for the chart and using IRuby.display method we can see the chart on iruby.

I can try it and open PR to make google_visualr usable in iruby notebook

@Shekharrajak
Copy link
Author

I don't think there is need of any other JS apart from this https://www.google.com/jsapi , right ?

@winston
Copy link
Owner

winston commented Jun 6, 2017

I don't think there is need of any other JS apart from this https://www.google.com/jsapi , right ?

Yes. I believe so.

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

No branches or pull requests

2 participants