diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 1cf99bb..131903f 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -2,14 +2,15 @@ was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs + - #### Brief description of what is fixed or changed + #### Testcase / documentation @@ -17,6 +18,7 @@ open. --> #### Other comments + diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ab37c0c..0a1d771 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,13 +2,12 @@ name: daru-view test on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] jobs: test: - strategy: fail-fast: false matrix: @@ -17,20 +16,20 @@ jobs: runs-on: ${{ matrix.os }}-latest steps: - - uses: actions/checkout@v2 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - name: Install dependencies - run: | - gem install bundler - gem install rainbow -v '2.2.1' - bundle install - - name: Run tests - run: | - bundle exec rspec - bundle exec rubocop - - name: Push coverage report - run: bundle exec rake coveralls:push \ No newline at end of file + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Install dependencies + run: | + gem install bundler + gem install rainbow -v '2.2.1' + bundle install + - name: Run tests + run: | + bundle exec rspec + bundle exec rubocop + - name: Push coverage report + run: bundle exec rake coveralls:push diff --git a/.travis.yml b/.travis.yml index 2b2a145..302e579 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,14 @@ -language: - ruby +language: ruby rvm: # - '2.0' # - '2.1' NOTE: For ruby <2.3,rubocop Offense : adapters/*charts.rb:11:9: C: Style/ModuleFunction: Use module_function instead of extend self. # - '2.2' - Not checking because of so many rubocop conflicts with # new ruby versions - - '2.3.0' - - '2.4.0' - - '2.5.3' - - '2.6.0' + - "2.3.0" + - "2.4.0" + - "2.5.3" + - "2.6.0" script: - bundle exec rspec @@ -20,8 +19,8 @@ after_script: install: - if [ $TRAVIS_RUBY_VERSION == '2.2' ] || [ $TRAVIS_RUBY_VERSION == '2.1' ] || [ $TRAVIS_RUBY_VERSION == '2.0' ]; - then gem install bundler -v '~> 1.6'; - else gem install bundler; - fi + then gem install bundler -v '~> 1.6'; + else gem install bundler; + fi - gem install rainbow -v '2.2.1' - bundle install diff --git a/CHANGELOG.md b/CHANGELOG.md index 40ea9cc..d314959 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,9 @@ **Fixes:** - Fixed Rubocop offenses coming from version 0.60 #125 (by @Shekharrajak) -- Updated README.md and Contribution Guide #129, #131, #133, - #139, #141 (by @Shekharrajak) -- Removed the duplicate highcharts.css #145 (by @[snpd25](/snpd25)) +- Updated README.md and Contribution Guide #129, #131, #133, + #139, #141 (by @Shekharrajak) +- Removed the duplicate highcharts.css #145 (by @[snpd25](/snpd25)) - [Majaor Fix] Windows installation error fix #147 (by @kojix2 & @Shekharrajak) ## 0.2.4 (2017-08-29) @@ -15,25 +15,24 @@ - Added Highstock feature of HighCharts plotting: #89 (by @Prakriti-nith) - Added HighMaps feature of HighCharts plotting: #92 (by @Prakriti-nith) - Added Custom Styling CSS feature of HighCharts plotting: #93 -(by @Prakriti-nith) + (by @Prakriti-nith) - Exporting HighCharts to different formats: #94 (by @Prakriti-nith) - Added ChartWrapper feature of GoogleCharts: #95 (by @Prakriti-nith) - Import data from google spreadsheet: PR #88 (by @Prakriti-nith) - Added ChartEditor feature of GoogleCharts plotting: #96 (by @Prakriti-nith) - Multiple Charts having different (or same plotting library) -in a single row(or in single cell in IRuby notebook): #97 (by @Prakriti-nith) + in a single row(or in single cell in IRuby notebook): #97 (by @Prakriti-nith) - Different formatters feature of GoogleCharts: #110 (by @Prakriti-nith) - Require dependent JS for the plotting libraries -GoogleCharts/HighCharts/DataTables in Rails application.js file: #115 -(by @Prakriti-nith) - + GoogleCharts/HighCharts/DataTables in Rails application.js file: #115 + (by @Prakriti-nith) **Minor Enhancements:** - Exporting charts in PNG formate for GoogleCharts: #98 (by @Prakriti-nith) - Handling Events in GoogleCharts: #100 (by @Prakriti-nith) - Added a method to load dependent scripts for multiple adapters: #107 -(by @Prakriti-nith) + (by @Prakriti-nith) - Rake Task to add new adapter templates: #112 (by @Prakriti-nith) - (by @Prakriti-nith) - export_html method, generate_html method is implemented and load large set of data piece by piece using datatables adaptor: #104 (by @Prakriti-nith) @@ -47,26 +46,26 @@ GoogleCharts/HighCharts/DataTables in Rails application.js file: #115 **Note:** -* [GSoC 2018 project](https://github.com/SciRuby/daru-view/wiki/GSoC-2018---Progress-Report) +- [GSoC 2018 project](https://github.com/SciRuby/daru-view/wiki/GSoC-2018---Progress-Report) ## 0.1.0 (2017-09-20) **Features:** - Generate Plot using [Nyaplot](https://github.com/SciRuby/nyaplot), -[google_visualr](https://github.com/winston/google_visualr/), -[lazy_high_charts](https://github.com/michelson/lazy_high_charts) gem with more features. + [google_visualr](https://github.com/winston/google_visualr/), + [lazy_high_charts](https://github.com/michelson/lazy_high_charts) gem with more features. - Generate Tables using [Google Charts DataTable](https://developers.google.com/chart/interactive/docs/gallery/table) and [daru-data_tables](https://github.com/Shekharrajak/daru-data_tables) with features like pagination, sorting by column, option to choose number of rows to be displayed. - Plotting can be done in IRuby notebook as well as any ruby web application -framework. + framework. - Data can be in Daru::DataFrame, Daru::Vector, array of array data or -according to the formate described in [Google Charts tool](https://developers.google.com/chart/interactive/docs/gallery), [Highcharts](https://www.highcharts.com/demo). + according to the formate described in [Google Charts tool](https://developers.google.com/chart/interactive/docs/gallery), [Highcharts](https://www.highcharts.com/demo). - User can use all the features already present in google_visualr, -lazy_high_charts, nayplot by accessing the respective object using -`#chart` and tables using `#table`. + lazy_high_charts, nayplot by accessing the respective object using + `#chart` and tables using `#table`. - The article written about initial features briefly : https://github.com/shekharrajak/daru-view/wiki/All-about-daru-view diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 7e33c5f..88c4db8 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -2,73 +2,131 @@ ## Our Pledge -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. -Examples of unacceptable behavior by participants include: +## Our Standards -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a +Examples of behavior that contributes to a positive environment for our +community include: + +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +- Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +- The use of sexualized language or imagery, and sexual attention or advances of + any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, + without their explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting -## Our Responsibilities +## Enforcement Responsibilities -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. ## Scope -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at shekharstudy@ymail.com. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. +reported to the community leaders responsible for enforcement at +[INSERT CONTACT METHOD]. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][mozilla coc]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][faq]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[mozilla coc]: https://github.com/mozilla/diversity +[faq]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7a7ef38..313a104 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,8 +2,8 @@ ## Setup development Version in Unix system -* Follow the steps given in [daru-view/wiki/development-workflow](https://github.com/SciRuby/daru-view/wiki/Development-Workflow-and-Contribution-guide). -* Also it is worth to see [daru Contribution guide](https://github.com/SciRuby/daru/blob/master/CONTRIBUTING.md). +- Follow the steps given in [daru-view/wiki/development-workflow](https://github.com/SciRuby/daru-view/wiki/Development-Workflow-and-Contribution-guide). +- Also it is worth seeing [daru Contribution guide](https://github.com/SciRuby/daru/blob/master/CONTRIBUTING.md). ## Understand daru-view features @@ -11,26 +11,25 @@ **Summary of work done on daru:** -* [GSoC 2015](http://sciruby.com/blog/2015/08/16/summary-of-work-on-daru-this-summer-for-gsoc-2015/) -* [GSoC 2016](http://sciruby.com/blog/2016/11/25/gsoc-2016-adding-categorical-data-support/) -* [GSoC 2017 daru-view](http://sciruby.com/blog/2017/09/01/gsoc-2017-data-visualization-using-daru-view/) -* [GSoC 2017 daru-io](http://sciruby.com/blog/2017/08/29/gsoc-2017-support-to-import-export-of-more-formats/) -* [GSoC 2018 Progress Report](https://github.com/SciRuby/daru-view/wiki/GSoC-2018---Progress-Report) +- [GSoC 2015](http://sciruby.com/blog/2015/08/16/summary-of-work-on-daru-this-summer-for-gsoc-2015/) +- [GSoC 2016](http://sciruby.com/blog/2016/11/25/gsoc-2016-adding-categorical-data-support/) +- [GSoC 2017 daru-view](http://sciruby.com/blog/2017/09/01/gsoc-2017-data-visualization-using-daru-view/) +- [GSoC 2017 daru-io](http://sciruby.com/blog/2017/08/29/gsoc-2017-support-to-import-export-of-more-formats/) +- [GSoC 2018 Progress Report](https://github.com/SciRuby/daru-view/wiki/GSoC-2018---Progress-Report) **daru-view specific links:** **Learn basics of daru-view, from [sciruby/blog](http://sciruby.com/blog/2017/09/01/gsoc-2017-data-visualization-using-daru-view/) or [daru-view/wiki](https://github.com/SciRuby/daru-view/wiki/All-about-daru-view).** - -* [daru-view/wiki/ideas](https://github.com/SciRuby/daru-view/wiki/Ideas) -* [Discussion in sciruby mailing thread ](https://groups.google.com/forum/#!topic/sciruby-dev/yCxtSt_dZxM) -* [Shekhar's blog post: GSoC 2017](http://shekharrajak.github.io/gsoc_2017_posts/) -* [GSoC 2018 Progress Report](https://github.com/SciRuby/daru-view/wiki/GSoC-2018---Progress-Report) -* [GSoC 2018 discussion](https://discourse.ruby-data.org/t/gsoc-2108-project-advance-features-in-daru-view-discussion/43/50) +- [daru-view/wiki/ideas](https://github.com/SciRuby/daru-view/wiki/Ideas) +- [Discussion in sciruby mailing thread ](https://groups.google.com/forum/#!topic/sciruby-dev/yCxtSt_dZxM) +- [Shekhar's blog post: GSoC 2017](http://shekharrajak.github.io/gsoc_2017_posts/) +- [GSoC 2018 Progress Report](https://github.com/SciRuby/daru-view/wiki/GSoC-2018---Progress-Report) +- [GSoC 2018 discussion](https://discourse.ruby-data.org/t/gsoc-2108-project-advance-features-in-daru-view-discussion/43/50) ## Let's start the contribution -* Pick up easy to fix open issues (or you can pick any open issue, if you find any solution for it) and involve in daru-view discussions. -* Discuss your approach about the issue (or may be issue you are facing). -* Create a PR for the implementation of your approach. Get it reviewed (and work on any changes, if suggested). -* It will be merged surely :) +- Pick up easy to fix open issues (or you can pick any open issue if you find any solution for it) and involve in daru-view discussions. +- Discuss your approach about the issue (or maybe the issue you are facing). +- Create a PR for the implementation of your approach. Get it reviewed (and work on any changes, if suggested). +- It will be merged surely :) diff --git a/README.md b/README.md index 20ebdd3..aa5c621 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,31 @@ -# Daru::View +
+

Daru::View

+

+daru-view is for easy and interactive plotting in web application & IRuby notebook. daru-view is a plugin gem to the existing daru gem +

+ + + +Coverage Status + + + -[![Gem Version](https://badge.fury.io/rb/daru-view.svg)](https://badge.fury.io/rb/daru-view) -[![Build Status](https://travis-ci.org/SciRuby/daru-view.svg?branch=master)](https://travis-ci.org/SciRuby/daru-view) -[![Coverage Status](https://coveralls.io/repos/github/SciRuby/daru-view/badge.svg?branch=master)](https://coveralls.io/github/SciRuby/daru-view?branch=master) +
+# About -[Daru](https://github.com/sciruby/daru) (Data Analysis in RUby) is a library for analysis, manipulation and visualization of data. Daru-view is for easy and interactive plotting in web application & IRuby notebook. It can work in frameworks like Rails, Sinatra, Nanoc and hopefully in others too. +[Daru](https://github.com/sciruby/daru) (Data Analysis in Ruby) is a library for analysis, manipulation, and visualization of data. Daru-view is for easy and interactive plotting in web applications & IRuby notebook. It can work in frameworks like Rails, Sinatra, Nanoc, and hopefully in others too. -It is a plugin gem to Data Analysis in RUby([Daru](https://github.com/sciruby/daru)) for visualisation of data +It is a plugin gem to Data Analysis in Ruby([Daru](https://github.com/sciruby/daru)) for visualization of data -## Documentation : +## Documentation: - [Documentation present in Rubydoc](http://www.rubydoc.info/github/sciruby/daru-view/) - [daru-view/wiki](https://github.com/SciRuby/daru-view/wiki) -## Blogs : +## Blogs: - [ScirRuby/blog](http://sciruby.com/blog/2017/09/01/gsoc-2017-data-visualization-using-daru-view/) @@ -23,13 +33,13 @@ It is a plugin gem to Data Analysis in RUby([Daru](https://github.com/sciruby/da - [GSoC 2018: Work Product](https://32teethglitter.wordpress.com/2018/08/07/work-product-gsoc-2018/) -- [Rubyist’s, so called Powerful Future Plotting library](https://medium.com/@Shekharrajak/rubyists-so-called-powerful-future-plotting-library-1c4e202eee6d) +- [Rubyist’s, so-called Powerful Future Plotting library](https://medium.com/@Shekharrajak/rubyists-so-called-powerful-future-plotting-library-1c4e202eee6d) - [I am a Ruby developer. How can I use Highcharts?](https://www.highcharts.com/blog/post/i-am-ruby-developer-how-can-i-use-highcharts/?__cf_chl_jschl_tk__=338bba242759c7d002887f58fad0e75aa46ed51a-1590914540-0-AQMW--o2s08ZWLQPqt7pePLoMu7ffsDtNrL-9goaQigUbeCmxrCFfev9yAtGpwnEl3W6SDFy3NUKf04OfUXff8rKSfSRZDr32vJdkHnjnvgaaFWz1o3zeuneNUSriZsyFOGQ3OD5Gr5qWQJc-lWOI9X7Dc8g6qiV36RH2hUS1WLloOy23igNvfODDZwSt5WXQNh7-SoiJbJfiUXb7k_k3a49sqY9qmHvUsz6qTlMs1QivPkDU17-CdhNLK6tfOO6YEqSFy9tvvj-WzdMIUXCwa5x6OmOpJPo9qzfPqz7hCmnZcGBjepS1LLQmFKt4d1vAoRquLZPJI4oHBh0CVKi6LMcayOHXmwbq-tnRfNuhqyIAx-pD56OY0B2-rmLE3h3UB9FoDfI5hpOE1XAI7YB-9M) - [How to create charts with daru-view and Highcharts in any Ruby web application framework](https://www.highcharts.com/blog/tutorials/how-to-create-charts-with-daru-view-and-highcharts/?__cf_chl_jschl_tk__=55ff70069823ebbf589d04997c7d68914e94a5dc-1590914539-0-AbSHzGQB6RsWEv-9EV-Ia-Lgk281WXlDwulwWHMivv_SZ8D2SmSEA3xWLfyFVubIrBi0DYER-Y8A7M37WKJmsbPAO5EGfoOL-0GLwl6An3Ol0iwkUN_BFvtntg3oS2sysjvCakfMJvo50yDgLAzFAiJuxeHfUhpn9ejs4Qxk0xQy3coVmH6qjpFXjDb9ZEJxbEZ2F7LmUW4DBg9MmgWyu7KNMZn5B0P7c6TFhOxv4xBb6__A17QWGOb-Af8_a1-y_8aKAVtTE2uJOuil5tPL9IuWI1oDZ2kMaeg04es9VLJOv6MFH0u9ayN3OyEUPYN7xVkn8b-weKpo8sJoEc60UvX9zDyx-1StSVWbGUbHgOLlNPZT6Xz6365q7MLHXaYAFICXSafLDGY6DSizy147MDuZbNVg6glgFosbgHjeCXK4) -## Examples : +## Examples: - [IRuby notebook examples](http://nbviewer.jupyter.org/github/sciruby/daru-view/tree/master/spec/dummy_iruby/) @@ -51,8 +61,7 @@ Or install it yourself as: $ gem install daru-view -If above is not working or you want to install latest version from the -github repo: +If the above is not working or you want to install the latest version from the GitHub repo: ``` gem install specific_install @@ -66,7 +75,7 @@ gem specific_install https://github.com/SciRuby/daru-view - To install IRuby notebook in your system, follow the steps given in [IRuby repo](https://github.com/SciRuby/iruby#quick-start). -- Create separate folder and Gemfile inside it. Add minimum these lines in it +- Create a separate folder and Gemfile inside it. Add a minimum these lines to it ```ruby source "http://rubygems.org" @@ -87,9 +96,9 @@ gem 'daru-data_tables', git: 'https://github.com/Shekharrajak/daru-data_tables.g - Now do `bundle install` and run `iruby notebook` -- You may like to try some examples that is added in specs : [spec/dummy_iruby/](http://nbviewer.jupyter.org/github/sciruby/daru-view/tree/master/spec/dummy_iruby/) +- You may like to try some examples that are added in specs : [spec/dummy_iruby/](http://nbviewer.jupyter.org/github/sciruby/daru-view/tree/master/spec/dummy_iruby/) -#### HighCharts example : +#### HighCharts example: ```ruby @@ -101,18 +110,17 @@ Daru::View.plotting_library = :highcharts data=[43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175] ) -# to see graph in IRuby noteboook +# to see graph in IRuby notebook @line_graph.show_in_iruby # to see graph in any ruby web application framework -# Add this line in your view file, where you want to see you graph in web application. (It will put the html code of the line graph in web page) +# Add this line in your view file, where you want to see your graph in the web application. (It will put the HTML code of the line graph on the web page) <%=raw @line_graph.div %> ``` ![Line Graph](https://raw.githubusercontent.com/Shekharrajak/medium-daru-view-blog/master/GIF_Images/HighChartBlog/lineChart.gif) - ##### GoogleChart example: ```ruby @@ -163,7 +171,6 @@ geochart.show_in_iruby ![World map GoogleChart](https://raw.githubusercontent.com/Shekharrajak/medium-daru-view-blog/master/GIF_Images/GoogleChart/worldMap.gif) - - You can find more examples in this [IRuby notebook example](https://nbviewer.jupyter.org/github/sciruby/daru-view/blob/master/spec/dummy_iruby/Google%20Charts%20%7C%20Geo%20Charts%20examples.ipynb). #### GoogleChart - datatable @@ -189,7 +196,7 @@ table.show_in_iruby ![GoogleChart datatable](https://raw.githubusercontent.com/Shekharrajak/medium-daru-view-blog/master/GIF_Images/GoogleChart/GoogleChartDatatable.gif) -- Checkout more amazing examples of GoogleChart datatable in [IRuby notebook](https://nbviewer.jupyter.org/github/sciruby/daru-view/blob/master/spec/dummy_iruby/GoolgeChart%20%7C%20Datatables.ipynb). +- Check out more amazing examples of GoogleChart datatable in [IRuby notebook](https://nbviewer.jupyter.org/github/sciruby/daru-view/blob/master/spec/dummy_iruby/GoolgeChart%20%7C%20Datatables.ipynb). #### DataTable example @@ -202,7 +209,7 @@ arrayOfArray = [ ] arrayOfArrayTable = Daru::View::Table.new(arrayOfArray, pageLength: 3, adapter: :datatables) -# paste the div part of the table in view part of the app or any html file. +# paste the div part of the table in view part of the app or any HTML file. # First load the dependency for the datatable using this line : `Daru::View.dependent_script(:datatables)` arrayOfArrayTable.div @@ -211,8 +218,8 @@ arrayOfArrayTable.div ``` -- NOTE: It works seamlessly in Ruby web applications, but currently DataTable doesn't work in IRuby notebook, -because of conflict in DataTable dependent js and IRuby dependent js. +- NOTE: It works seamlessly in Ruby web applications, but currently DataTable doesn't work in IRuby notebook, + because of conflict in DataTable dependent js and IRuby dependent js. - To see more examples, please check datatables examples written in [demo_daru-view](https://github.com/Shekharrajak/demo_daru-view) repository for different Ruby web application frameworks. @@ -260,7 +267,6 @@ map.show_in_iruby - Read more about HighMap API in daru-view gem in this [wiki page section](https://github.com/SciRuby/daru-view/wiki/HighCharts-features#highmap). - #### Nyaplot example : ```ruby @@ -287,7 +293,7 @@ data_df.to_category :c @bar_graph_vector = Daru::View::Plot.new(data_vector ,opts) @bar_graph_df = Daru::View::Plot.new(data_df, type: :bar, x: :c) -# Add this line in your view file, where you want to see you graph in web application. (It will put the html code of the line graph in web page) +# Add this line in your view file, where you want to see your graph in the web application. (It will put the HTML code of the line graph on the web page) <%=raw @bar_graph_vector.div %> <%=raw @bar_graph_df.div %> @@ -302,7 +308,6 @@ data_df.to_category :c ![Bar Graph Nyaplot Vector](https://raw.githubusercontent.com/Shekharrajak/medium-daru-view-blog/master/GIF_Images/Nyaplot/nyaplot%2Bvector.gif) - ``` @bar_graph_df.show_in_iruby @@ -310,17 +315,17 @@ data_df.to_category :c ![Bar Graph Nyaplot Dataframe](https://raw.githubusercontent.com/Shekharrajak/medium-daru-view-blog/master/GIF_Images/Nyaplot/nyaplot_df.gif) -- User can try examples, that is added in [Demo web applicatioons (Rails, Sinatra, Nanoc)](https://github.com/Shekharrajak/demo_daru-view). To setup the rails app, run following commands : +- User can try examples, that are added in [Demo web applications (Rails, Sinatra, Nanoc)](https://github.com/Shekharrajak/demo_daru-view). To set up the rails app, run the following commands : ``` bundle install bundle exec rails s ``` + Now go to the http://localhost:3000/nyaplot to see the Nyaplot examples or http://localhost:3000/highcharts and similarly for googlecharts, datatables to see the Highcharts examples. - ### Use in web application - Add this line in your Gemfile : @@ -335,18 +340,18 @@ gem 'google_visualr', git: 'https://github.com/winston/google_visualr.git' gem 'daru-data_tables', git: 'https://github.com/Shekharrajak/daru-data_tables.git' ``` -_Note_ : Right now, in daru-view gemspec file `daru` and `nyaplot` is not added as development_dependency. Since daru-view required the latest github version of the Daru and Nyaplot gem and we can't fetch gem from the github in the gemspec. +_Note_ : Right now, in daru-view gemspec file `daru` and `nyaplot` are not added as development_dependency. Since daru-view required the latest GitHub version of the Daru and Nyaplot gem and we can't fetch gem from GitHub in the gemspec. #### Rails application -- In controller, do the data analysis process using daru operations and get the DataFrame/Vectors. +- In the controller, do the data analysis process using daru operations and get the DataFrame/Vectors. - Set a plotting library using e.g. `Daru::View.plotting_library = :highcharts` -- To setup the dependencies of HighCharts/DataTables in rails app, we can use below line in app/assets/javascript/application.js file : +- To set up the dependencies of HighCharts/DataTables in rails app, we can use the below line in app/assets/javascript/application.js file : ``` -//= require highcharts/highcharts +//= require highcharts/highcharts //= require highcharts/highcharts-more //= require highcharts/map //= require jquery-latest.min @@ -359,7 +364,7 @@ and CSS files can be included as: *= require jquery.dataTables ``` -Include the below line in the head of the layout file(whereever you want to plot charts): +Include the below line in the head of the layout file(wherever you want to plot charts): ``` @@ -367,26 +372,22 @@ Include the below line in the head of the layout file(whereever you want to plot <%= stylesheet_link_tag "application" %> ``` +NOTE: [ Old way ] In view, add the required JS files (for the plotting library), in head tag (generally) using the line, e.g.: `Daru::View.dependent_script(:highcharts)` -NOTE: [ Old way ] In view, add the required JS files (for the plotting library), in head tag (generally) using the line , e.g. : `Daru::View.dependent_script(:highcharts)` - -The line `<%=raw Daru::View.dependent_script(:highcharts) %>` for rails app , must be added in the layout file of the application. +The line `<%=raw Daru::View.dependent_script(:highcharts) %>` for rails app, must be added in the layout file of the application. You can read more about this feature in [this wiki page section](https://github.com/SciRuby/daru-view/wiki/GSoC-2018---Progress-Report#reduce-a-bunch-of-lines-due-to-js-files-in-source-html-in-rails-pr-115-in-daru-view-pr-23-in-daru-data_tables). - #### Sinatra application - - In view, add the required JS files (for the plotting library), in head tag (generally) using the line , e.g. : `Daru::View.dependent_script(:highcharts)` -The line `<%= Daru::View.dependent_script(:highcharts) %>` for sinatra app , must be added in the layout file of the application(inside the head tag). - +The line `<%= Daru::View.dependent_script(:highcharts) %>` for sinatra app, must be added in the layout file of the application(inside the head tag). ```ruby -# In side the `app.rb` user must do data analysis process using daru features and define the Daru::View::Plot class instance variables to pass into the webpages in the `view` files. You will understand this better, if you will try to run sinatra app present in the `[Demo web applicatioons (Rails, Sinatra, Nanoc)](https://github.com/Shekharrajak/demo_daru-view)` +# In side the `app.rb` user must do data analysis process using daru features and define the Daru::View::Plot class instance variables to pass into the webpages in the `view` files. You will understand this better if you will try to run sinatra app present in the `[Demo web applications (Rails, Sinatra, Nanoc)](https://github.com/Shekharrajak/demo_daru-view)` -# Add this line in your view file, where you want to see you graph in web application. (It will put the html code of the line graph in web page) +# Add this line in your view file, where you want to see your graph in the web application. (It will put the HTML code of the line graph on the web page) <%= @line_graph.div %> @@ -397,21 +398,21 @@ The line `<%= Daru::View.dependent_script(:highcharts) %>` for sinatra app , mus ``` -- User can try examples, that is added in [Demo web applicatioons (Rails, Sinatra, Nanoc)](https://github.com/Shekharrajak/demo_daru-view). To setup the rails app, run following commands : +- User can try examples, that are added in [Demo web applications (Rails, Sinatra, Nanoc)](https://github.com/Shekharrajak/demo_daru-view). To set up the rails app, run the following commands : ``` bundle install bundle exec ruby app.rb ``` -Now go to the http://localhost:4567/nyaplot to see the Nyaplot examples or http://localhost:4567/highcharts to see the Highcharts examples. +Now go to the http://localhost:4567/nyaplot to see the Nyaplot examples or http://localhost:4567/highcharts to see the Highcharts examples. #### Nanoc application -Most of the things similar to Rails application (syntax of the view part of the application). +Most of the things are similar to the Rails application (syntax of the view part of the application). -- User can try examples, that is added in [Demo web applicatioons (Rails, Sinatra, Nanoc)](https://github.com/Shekharrajak/demo_daru-view). To setup the rails app, run following commands : +- User can try examples, that are added in [Demo web applications (Rails, Sinatra, Nanoc)](https://github.com/Shekharrajak/demo_daru-view). To set up the rails app, run the following commands : ``` bundle install @@ -419,15 +420,15 @@ bundle exec nanoc bundle exec nanoc view ``` + Now go to the http://localhost:3000/nyaplot to see the Nyaplot examples or http://localhost:3000/highcharts and similarly for googlecharts, datatables to see the Highcharts examples. - #### Live demo links -Nanoc web application complie and generates the html code of the nanoc web application. So you can see the running Nanoc app here : +Nanoc web application compiles and generates the HTML code of the nanoc web application. So you can see the running Nanoc app here : -Note : There is some problem in nyaplot (in live link. It works fine locally). Some css is not working so some styling ain't working properly. You can see it properly in local setup. +Note: There is some problem in nyaplot (in the live link. It works fine locally). Some CSS is not working so some styling ain't working properly. You can see it properly in the local setup. [index.html](https://sciruby.github.io/daru-view/spec/dummy_nanoc/output/) @@ -437,63 +438,65 @@ Note : There is some problem in nyaplot (in live link. It works fine locally). S [googlecharts](https://sciruby.github.io/daru-view/spec/dummy_nanoc/output/googlecharts) -For now, other applications (Rails/Sinatra) you need to run it locally. - +For now, for other applications (Rails/Sinatra) you need to run it locally. ## Update to latest js library. Additional command line ### 1. Users - - To view command usage: +- To view command usage: - ``` - daru-view - ``` +``` +daru-view +``` + +- To update all the JS files: + +``` +daru-view update +``` - - To update all the JS files: - ``` - daru-view update - ``` +- To update JS files for google charts: - - To update JS files for google charts: - ``` - daru-view update -g (or) --googlecharts - ``` +``` +daru-view update -g (or) --googlecharts +``` - - To update JS files for highcharts: - ``` - daru-view update -H (or) --highcharts - ``` +- To update JS files for highcharts: + +``` +daru-view update -H (or) --highcharts +``` ### 2. Developers - To update to the current highcharts.js directly from http://code.highcharts.com/", you can always run +To update to the current highcharts.js directly from http://code.highcharts.com/", you can always run rake highcharts:update - And it will be copied to your adapters/js/highcharts_js directory. +And it will be copied to your adapters/js/highcharts_js directory. - Similarly for other libraries. +Similarly for other libraries. - To update the all libraries Javascript file, run this command : +To update the all libraries Javascript file, run this command : rake update_all ## Creating a new adapter (Developers) - To create a new adapter `Demo`, run - ``` - rake new:adapter Demo - ``` +To create a new adapter `Demo`, run - and a file demo.rb will be created in the daru/view/adapters folder with all the necessary methods (init, init_script, init_ruby, generate_body, show_in_iruby and export_html_file) as TODO. +``` +rake new:adapter Demo +``` + +and a file demo.rb will be created in the daru/view/adapters folder with all the necessary methods (init, init_script, init_ruby, generate_body, show_in_iruby, and export_html_file) as TODO. ## Development After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment. -Generally I prefer to use `bundle console` for testing few codes and experimenting the gem repo. - +Generally, I prefer to use `bundle console` for testing a few codes and experimenting with the gem repo. ## Contributing @@ -509,6 +512,6 @@ This software has been developed by [Shekhar Prasad Rajak](https://github.com/Sh ## License -The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). +The gem is available as open-source under the terms of the [MIT License](http://opensource.org/licenses/MIT). Copyright (c) 2017 Shekhar Prasad Rajak(@shekharrajak) diff --git a/_config.yml b/_config.yml index fc24e7a..8bbf794 100644 --- a/_config.yml +++ b/_config.yml @@ -1 +1 @@ -theme: jekyll-theme-hacker \ No newline at end of file +theme: jekyll-theme-hacker