klonowsk
Plotly_ex - Interactive Plotly.js charts for Elixir - works in LiveBook via Kino and in Phoenix LiveView
plotly_ex is an Elixir library providing bindings for Plotly. This library was heavily inspired by VegaLite, which I do love. However, over the last year or so, I found myself producing various data sets via Elixir apps, only to have to export them out and presented via throwaway R::shiny apps that relied on the R plotly library to produce interactive plots that I used in many of my presentations. Although I did find some previous attempts of the community at implementing such bindings for Elixir, for example s417-lama/plotly_ex, this project appears to have been abandoned.
Like VegaLiteas well as the python version of the Plotly bindings, plotly_ex provides both a concise “express” API for rapid chart creation as well as a “fluent builder” API for fine-grained control with LiveBook and Phoenix LiveView integration. A Kino SmartCell is also available for simple plot types in LiveBook.
I’ve released on github
https://github.com/pklonowski/plotly_ex
Any and all suggestions welcome.
LiveBook example code:
Mix.install([
{:plotly_ex, "~> 0.1"},
{:kino, "~> 0.14"},
{:explorer, "~> 0.11"}
])
data = [
%{"month" => "Jan", "sales" => 42},
%{"month" => "Feb", "sales" => 55},
%{"month" => "Mar", "sales" => 38}
]
Plotly.bar(data, x: "month", y: "sales", title: "Monthly Sales")
|> Plotly.show()
# or using an Explorer DataFrame:
df = Explorer.DataFrame.new(x: [1, 2, 3], y: [10, 20, 15])
Plotly.scatter(df, x: "x", y: "y", title: "From DataFrame")
|> Plotly.show()
Popular in Announcing
Other popular topics
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
- #performance









