Skip to content
This repository has been archived by the owner on Dec 24, 2022. It is now read-only.

From RubyPlot GR to Rubyplot

Pranav Garg edited this page Aug 30, 2018 · 2 revisions

Evolution of RubyPlot

Ideas for Projects to enhance RubyPlot:

The following Ideas can be implemented after November 2018 after Pranav Garg (@pgtgrly) finishes the second phase of the project as per the above diagram.

1. Rewriting the Scripting Layer for a more Rubylike interface:

The scripting layer needs to be rewritten to make the API more Rubylike as suggested by Dr. John Woods (@mowhawkjohn). This will require reworking the API while making sure that it correctly interfaces with the artist layer and retains the functionality of the existing API.

Thought: We can perhaps have multiple Scripting APIs, one for Rubyists and other for those just using Ruby as a tool for visualization?

2. Creating a Backend in AntiGrainGeometry (AGG):

Matplotlib uses (AGG)[http://antigrain.com/], A raster-based graphics library as the backend renderer. The library is written in C++ and is unfortunately largely undocumented and contains a few bugs because of the sad demise of its brilliant creator. The project would require the following:

  • Understanding AGG (and possibly documenting it)
  • Creating a ruby wrapper around AGG (Matplotlib's python wrapper can be referred here)
  • Creating a backend renderer sublayer for AGG based on the existing Rmagick (Ruby wrapper around ImageMagick) Sublayer

3. Creating a Backend in Cairo Graphics:

ImageMagick and AGG are Raster based Graphics Library. Cairo is a Vector-based Graphics Library. The difference between Raster and Vector graphics can be read about here. Creating a Backend Renderer from a vector based Graphics Library can be used as an example for more vector Graphics library renderers in future. Cairo already has a Ruby Wrapper. The project would require the following:

  • Understanding the Working of Cairo and its Ruby Wrapper.
  • Modelling and creating a generalized backend renderer sublayer for vector Graphics Libray
  • Implementing it in Cairo

4. Creating a more robust testing parameter:

Since the Library creates images. It is tested by testing the RMS loss between the produced image and a reference image for every test. This has been brilliantly implemented in Ruby arrays by @ArafatK here.

However, computation over Ruby Array is painfully slow and does not allow development utilities such as autotest to be utilized fully. One idea is to load images into Nmatrix Arrays or XND Arrays and performing computation on the very same. This can later be used to create an image processing library for Ruby.