GGity - another plotting library

Hello all,

I have been working on a charting library designed to support drawing SVG plots in Elixir using an API that is as close to ggplot2 as practical (you could call it a clone, but that would be an insult to the advanced stage of the science of cloning).

image

It currently supports point and line plots, but with a decent amount of options (bar charts are next). There are some examples in the README, and the project includes some mix tasks that generate several other examples. The README also explains in more detail my design goals and how GGity compares to the alternatives.

This is a personal project, but if anyone is interested in taking a look and offering feedback I would love to hear it.

21 Likes

I have made enough progress to publish the latest version of GGity to Hex. This version implements ggplot’s layered approach to building up graphics; it also now supports bar charts, area/ribbon charts, data labels and custom themes.

I put together a demo here: GGity By Example. Thank you in advance for politely ignoring the Heroku free tier lag on first load.

Appreciate any feedback, and thanks to those whose forum responses have helped along the way!

4 Likes

Hi everyone - I just published version 0.4.

New features include:

  • LiveView support, via custom attributes - generate custom attributes for each shape on a plot. Those could be Phoenix event handlers, data bindings, Tailwind utility classes - it’s up to you. Attributes are created by passing a function that takes the plot and a row of data and returns a list of attributes to be attached to the shape representing that row on the plot
  • Boxplots - underappreciated in my view
  • Annotations - shortcut for adding a single text/line/rectangle element for including annotations on a plot
  • All of the ggplot2 point shapes (fillable and non-fillable) are available

The demo site has been updated with a simple LiveView example.

As always appreciate any feedback!

14 Likes

Hi @srowley, this looks great! As someone who has been looking into the R ecosystem lately, having something that is inspired by ggplot2 can be really helpful to welcome data science and ml folks that have familiarity with said tooling.

7 Likes