GSoC 2018 | Coding Week – 1

The first week of Hogwarts, I mean GSoC with Sciruby, one is the same thing for me. I started with the spells of Highcharts that are used to add interactive charting capability.

“Code and spells are hard to deal with”- said no wise man ever but is true sometimes :P. My initial code on Highcharts produced out of the box results, I mean literally out of the box results.

2aus0u

Though things got sorted once I got used to these spells. After trying my hands on the Highcharts I moved to some advance:

  • HighStock: Based on HighCharts, It is more of a advanced spell of Highchart. It has all the core functionalities of HighCharts, plus some additional features.  I opened the PR (Btw, can I rename a PR to PatRonus :P) for the implementation of HighStock. Have a look at some of the examples (link1, link2, link3) that I executed in daru-view to implement this class in daru-view:
    • I came up with the option chart_class which can be used to differentiate between HighChart, HighStock and HighMap classes. Here chart_class need to be set as ‘stock’ by the user.
    • To retrieve the javascript code of HighStock, I used `high_stock` method which has already been implemented in `lazy_high_charts` gem.
    • As the dependent js file of HighStock (highstock.js) already includes the dependent js of HighChart (highcharts.js) so I replaced the latter one.

 

hs

In the series of advance wizarding spells, I learned a cool and amazing HighMap.

  • HighMap: It’s Highcharts for geo maps. Incorporating HighMaps in daru-view was a little tricky task as they come in two flavors, either as a standalone JavaScript file, or as a plugin for Highcharts. Initially, when I tried HighMaps, the dependent js files of HighStock and HighMaps conflicted each other, so I implemented HighMap as a plugin. This resolved the previous problem but introduced another. ‘mapchart’ , a keyword that was used in most of the examples of HighMaps was not working. This was solved by modifying the initialization of the HighMap by using Highcharts.Map constructor instead. I have opened a PR for the execution of HighMaps. Have a look at some of the examples (link1, link2, link3) that I implemented in daru-view. So, to implement HighMaps:
    • chart_class need to be set as ‘map’.
    • I created a new method high_map as it was not present in lazy_high_charts to get the javascript code of HighMap class.
    • Right now, I have included the dependent js files of HighMap’s modules also. But I am thinking of a better way to achieve the same results.

 

hm_india

When you create something good you create something bad. The case here isn’t different. There are some problems I have been facing:

  1. I am searching for a better way to include dependent js files as there are so many dependencies of HighCharts, HighStock, HighMaps and their modules.
  2. I am also working on way to incorporate data of HighMap in Daru:: DataFrame/ Daru:: Vector format.

I have added the specs of HighStock and HighMaps accordingly. Apart from these, I also worked on improving the coverage report of highcharts.rb through this PR and added this rails app to demonstrate the feature of importing data from spreadsheet in google charts.

With every passing week of my GSOC journey with Sciruby, I am getting more and more amazed with Ruby.

tenor

“Written with love for all thou fellow Wizards and Muggles!”

One thought on “GSoC 2018 | Coding Week – 1

Leave a comment