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 ![]()
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
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
11
josevalim
Creator of Elixir
pnezis
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!
6
Popular in Announcing
I’d like to announce a small library called boundaries.
This is an experimental project which explores the idea of enforcing boundaries ...
New
Yes, yet another parser combinator library!
Most of the parser combinators in the ecosystem are either compile-time, often using AST tra...
New
I’ve been working with Claude Code extensively and absolutely love it. However, I’ve come across the challenge of managing configuration ...
New
ExApi is a library that I’m developing now and hope release soon
This library will allow to:
list all apis
list all api implementation...
New
The best overview for how things are tied together is this presentation. Modules and functions are pretty well documented at this point, ...
New
Hello all,
I’ve been working on Svonix - a library for quickly integrating Svelte components into Phoenix views. It’s a much-needed succ...
New
Hi everyone,
I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
parameterized pipe in elixir: |n>
edit: negative index in |n> and mixed usage with |> are supported
example:
use ParamPipe
...
New
Hi! Today, after a couple weeks of development I’ve released v0.1 of LiveVue.
It’s a seamless integration of Vue and Phoenix LiveView, i...
New
I feel kind of stuck with the absence of a proper xml library for Elixir. Currently I use SweetXML which was ok for me more or less to pa...
New
Other popular topics
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...
New
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode.
The solution seems to be, in a hyphena...
New
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
I have an umbrella app.
Some of the apps inside depend on other apps in the umbrella, unsurprisingly.
I’m writing a test for one of the...
New
Hello everyone,
I try to use an Javascript Event Handler in my root.html.leex file.
Therefore I created a function in the app.js file: ...
New
After calling mix ecto.create I get this error:
17:00:32.162 [error] GenServer #PID<0.412.0> terminating
** (Postgrex.Error) FATAL...
New
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar.
I p...
New
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...
New
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
New
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex











