pnezis

pnezis

Tucan - a plotting library on top of VegaLite

Tucan is an Elixir plotting library built on top of VegaLite designed to simplify the creation of interactive and visually stunning plots. With Tucan you can effortlessly generate a wide range of plots, from simple bar charts to complex composite plots, all while enjoying the power and flexibility of a clean composable functional API. Version 0.1.1 was just released :tada:

You can find the docs here.

Sample usage:

scatter =
  Tucan.scatter(:iris, "petal_width", "petal_length", tooltip: true)
  |> Tucan.color_by("species")
  |> Tucan.shape_by("species")

lines = Tucan.lineplot(:stocks, "date", "price", color_by: "symbol", x: [type: :temporal])

area =
  Tucan.area(:stocks, "date", "price", color_by: "symbol", mode: :normalize, x: [type: :temporal])

density = Tucan.density(:penguins, "Body Mass (g)", color_by: "Species", fill_opacity: 0.2)

strip =
  Tucan.stripplot(:tips, "total_bill", group: "day", style: :jitter)
  |> Tucan.color_by("sex")

boxplot = Tucan.boxplot(:penguins, "Body Mass (g)", color_by: "Species")
histogram = Tucan.histogram(:cars, "Horsepower", color_by: "Origin", fill_opacity: 0.5)

pie = Tucan.pie(:barley, "yield", "site", aggregate: :sum, tooltip: true)

donut = Tucan.donut(:barley, "yield", "site", aggregate: :sum, tooltip: true)

heatmap =
  Tucan.density_heatmap(:penguins, "Beak Length (mm)", "Beak Depth (mm)", fill_opacity: 1.0)

Tucan.vconcat([
  Tucan.hconcat([scatter, lines, area]),
  Tucan.hconcat([density, Tucan.vconcat([strip, boxplot]), histogram]),
  Tucan.hconcat([pie, donut, heatmap])
])

will generate the following:

Credits go to @jonatanklosko for the awesome VegaLite bindings.

Most Liked

pnezis

pnezis

New version released today: v0.2.0, with many new features:

  • heatmap, punchcard and jointplot plots
  • vruler and hruler for adding vertical/horizontal rulers on any plot
  • Helper modules for configuring the Legend and the Scale
  • Docs improvements, added a livebook guide

You can find the full CHANGELOG here

Any feedback welcome

josevalim

josevalim

Creator of Elixir

The new (and old) plots are great!

pnezis

pnezis

:tada: v0.3.0 is out. It includes many new features and enhancements:

  • Nx support, you can pass directly tensors as series to all plots
  • imshow allows you to plot pseudo-color images
  • errorbar and errorband plots added
  • lollipop plot added as an alternative to bar chart
  • Tucan.Geometry module provides an API for plotting common geometric shapes and polylines

You can find the full CHANGELOG here

Happy new year!

jonatanklosko

jonatanklosko

Creator of Livebook

@pnezis this is amazing and charts in the docs are absolute fire!! :cat2: :fire:

pnezis

pnezis

@josevalim heatmap/5 added :slight_smile: Will release a new version later this week

Where Next?

Popular in Libraries Top

hpopp
After just over two years in development, this latest version of Pigeon is what I finally consider done in regards to my original vision ...
New
kevinlang
Hey all, We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3! We have successfully on-boarded the full suite of integration tests (...
New
oltarasenko
Dear Elixir community, After a year of development, bug fixes, and improvements, we are proudly ready to share the release of Crawly 0.1...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. Features Unstyled Phoenix components. Storybook that can be added to...
New
markmark206
simple_feature_flags is a tiny package that lets you turn features on or off based on which environment (e.g. localhost, staging, product...
New
dbern
I’m excited to announce that TaxJar has developed and open-sourced DateTimeParser. We developed it because we found a need to parse user ...
New
asiniy
Hey there! I wrote a download elixir package which does exactly what its name about - an easy way to download files. I saw solutions ...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
Antrater
Hi everyone! I’m thrilled to announce a huge thing. We have been developing Elixir Moon Design System for quite a while. We are finally ...
New
versilov
Could not wait for the missing Elixir ML libraries to appear, so, I wrote one myself, taking https://github.com/sdwolfz/exlearn as a foun...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New

Sub Categories:

We're in Beta

About us Mission Statement