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.

22 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!

15 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.

8 Likes

Version 0.5.0 published yesterday; only took two years! :grinning:

After letting it languish for some time, a few months ago I became interested in having GGity accept Explorer dataframes and also using Explorer under the hood for at least some transformations. The latest release of Explorer supported all the features needed to make that happen. That has been a fun library to work with; congrats and thanks to that team.

Edit: And of course, it also now includes a Livebook with examples (which is good because the demo site perished alongside the Heroku free tier).

4 Likes

As a former R user, I love what you’re doing here. What are your plans for gritty? Do you have a roadmap? Are you working to give it all the same features as ggplot2?

Keep up the great work! :+1:

Thanks for the kind words. I am a hobbyist and this is very much a hobby project, so I just kind of work on it when I have time, which has not been that often. Frankly I also recognize that the approach the community has taken with VegaLite is by far the more pragmatic and dependable, so I don’t feel like there is a desperate need for this. It’s just something I’m interested in and if others benefit from being aware of it that’s great.

I do have a roadmap but I don’t feel a huge obligation to follow it. Right now I think histograms should be next. Then I would like to do faceting but to do that right I will have to rework the general internal plot construction pipeline to more closely resemble what ggplot2 does, which could take awhile as I have only found bits and pieces explaining that (I can use R to do analysis but hardcore R programming is not strength I have, so reverse engineering is a challenge).

2 Likes