dc0d
There is this totally normal mix Elixir project/repository (code and tests and stuff - just a library for now, no Phoenix or anything).
Then added a LiveBook notebook at notebooks/dicect.livemd - needed some exploratory data visualization.
When this code is executed from the inside the LiveBook:
data = [
%{"category" => "A", "score" => 28},
%{"category" => "B", "score" => 55}
]
Vl.new()
|> Vl.data_from_values(data)
It returns:
** (Protocol.UndefinedError) protocol Enumerable not implemented for %Table.Mapper{enumerable: [%{"category" => "A", "score" => 28}, %{"category" => "B", "score" => 55}], fun: #Function<1.129280379/1 in Table.Mapper.map/2>} of type Table.Mapper (a struct). This protocol is implemented for the following type(s): Date.Range, File.Stream, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, Jason.OrderedObject, List, Map, MapSet, Range, Stream
(elixir 1.17.2) lib/enum.ex:1: Enumerable.impl_for!/1
(elixir 1.17.2) lib/enum.ex:166: Enumerable.reduce/3
(elixir 1.17.2) lib/enum.ex:4423: Enum.map/2
(vega_lite 0.1.10) lib/vega_lite.ex:304: VegaLite.data_from_values/3
#cell:r6qixazynpxprvhi:9: (file)
But, when it is run from the iex -S mix prompt, it returns a VegaLite data structure.
What is missing?
The setup part of the LiveBook:
Mix.install(
[
{:dicect, path: Path.join(__DIR__, ".."), env: :dev}
],
config_path: :dicect,
lockfile: :dicect
)
Current dependencies in mix.exs are:
...
defp deps do
[
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:logger_json, "~> 6.1"},
{:vega_lite, "~> 0.1.10"},
{:kino, "~> 0.14.1"},
{:tucan, "~> 0.3.0"},
{:kino_vega_lite, "~> 0.1.8"}
]
end
...
- Also tried
tucan, had a similar story - since it uses VegaLite I guess.
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex











Showing Posts 1 to 5- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
christhekeele
How are you installing
:vega_liteand:kino_vega_litepackages? Are they in your library’smix.exs(which I’d recommend you share here in its entirety, it’s very helpful)?My suspicion is that because you are not installing them in your livebook, but your library; and because you have your library set to compile with
env: :dev, something might be off with protocol consolidation.dc0d
Thanks. Those packages are already in
mix.exs- also updated the question with the list of dependencies.christhekeele
I get a different error in livebook when trying a minimal repro with unlocked versions of those dependencies:
The error message there isn’t from Elixir, but from JS-land. Livebook is implicitly trying to render the final result of the code block; try adding final
:okatom and the error goes away as the VegaLite struct is not rendered. Add the rendering back explicitly and you’ll see the same error:So the problem isn’t in generating a VegaLite struct (as your iex code proves), it is in rendering it. The struct you are producing isn’t ready to be rendered, you need to do more massaging to make it renderable. This works for me:
Try that, in addition to unlocking and updating your
vega_lite-related dependencies.jonatanklosko
@dc0d your error looks like an issue with protocol consolidation, but I cannot reproduce it. Try removing the
_builddirectory in the project.On a sidenote, you generally don’t want to put notebook-specific dependencies inside mix.exs, because then your project unnecessarily depends on them. You could make them
only: :dev, but the recommended approach would be to have these dependencies directly in the notebook. Like this:dc0d
A temporary solution that works fine for my problem is:
Where
datais:Will go back to the original problem later in future.