Revelry engineering blog header image lightbulb TWIL This Week I Learned. Chalkboard style

At Revelry, we believe in sharing and learning from one another (beliefs that are rooted in our Core Values). Among the many things we do to encourage internal knowledge exchange is to have a different team member present at each Engineering Meeting. These presentations don’t have to be lengthy, formal, or complicated; in fact, many are brief, but also powerful in that they teach our Revelers something new, inspire conversation, and encourage collaboration.

In the spirit of sharing, we share our This Week I Learned presentations (aka RevTWILs”) here. We hope you find them helpful.

THIS WEEK: Software developer Danielle Tyler shares about ContEx:

What Is ContEx?

  • ContEx is a pure Elixir server-side data plotting library outputting SVG.
  • It’s still a relatively new library, but being maintained and updated; it’s latest release is dated May 31, 2023. 
  • ContEx’s purpose is to simplify charting / plotting in Elixir apps and eliminate the need for JS in simple use cases.
  • The typical usage pattern consists of:
    • Wrapping data in a Contex.dataset() object
    • Passing this dataset into a Contex.Plot() object, along with the desired chart type (i.e., BarChart)
    • Using to_svg function to output SVG with plotted data

Benefits of ContEx

  • ContEx allows us to draw our charts on the server and send said chart HTML down to the client instead of bringing in a library to render charts with lots of complex JavaScript.
  • It’s easy to use.

Limitations of ContEx

  • ContEx is a newer library that is still being tweaked. Documentation is being steadily improved, but there are not a ton of resources like you would find with a more established library.
  • It has some visual limitations, for example: 1.) There are no built in animations like you would get with JS libraries, and 2.) It is not as highly interactive as JS libraries.

We're building an AI-powered Product Operations Cloud, leveraging AI in almost every aspect of the software delivery lifecycle. Want to test drive it with us? Join the ProdOps party at ProdOps.ai.