Update notebooks

This commit is contained in:
Jonatan Kłosko 2024-06-17 23:23:46 +07:00
parent e98fa825f6
commit e32d52599c
8 changed files with 25 additions and 18 deletions

View file

@ -2,7 +2,7 @@
```elixir ```elixir
Mix.install([ Mix.install([
{:kino, "~> 0.12.0"} {:kino, "~> 0.13.0"}
]) ])
``` ```

View file

@ -2,7 +2,7 @@
```elixir ```elixir
Mix.install([ Mix.install([
{:kino_explorer, "~> 0.1.18"} {:kino_explorer, "~> 0.1.20"}
]) ])
``` ```

View file

@ -3,7 +3,7 @@
```elixir ```elixir
Mix.install([ Mix.install([
{:vega_lite, "~> 0.1.6"}, {:vega_lite, "~> 0.1.6"},
{:kino_vega_lite, "~> 0.1.10"} {:kino_vega_lite, "~> 0.1.11"}
]) ])
``` ```

View file

@ -2,7 +2,7 @@
```elixir ```elixir
Mix.install([ Mix.install([
{:kino, "~> 0.12.0"} {:kino, "~> 0.13.0"}
]) ])
``` ```

View file

@ -2,7 +2,7 @@
```elixir ```elixir
Mix.install([ Mix.install([
{:kino, "~> 0.12.0"} {:kino, "~> 0.13.0"}
]) ])
``` ```

View file

@ -2,7 +2,7 @@
```elixir ```elixir
Mix.install([ Mix.install([
{:kino, "~> 0.12.0"}, {:kino, "~> 0.13.0"},
{:jason, "~> 1.4"} {:jason, "~> 1.4"}
]) ])
``` ```
@ -177,8 +177,10 @@ defmodule KinoGuide.ShellCell do
use Kino.SmartCell, name: "Shell script" use Kino.SmartCell, name: "Shell script"
@impl true @impl true
def init(_attrs, ctx) do def init(attrs, ctx) do
{:ok, ctx, editor: [attribute: "source"]} source = attrs["source"] || ""
{:ok, assign(ctx, source: source), editor: [source: source]}
end end
@impl true @impl true
@ -187,8 +189,13 @@ defmodule KinoGuide.ShellCell do
end end
@impl true @impl true
def to_attrs(_ctx) do def handle_editor_change(source, ctx) do
%{} {:ok, assign(ctx, source: source)}
end
@impl true
def to_attrs(ctx) do
%{"source" => ctx.assigns.source}
end end
@impl true @impl true

View file

@ -2,8 +2,8 @@
```elixir ```elixir
Mix.install([ Mix.install([
{:kino, "~> 0.12.0"}, {:kino, "~> 0.13.0"},
{:kino_vega_lite, "~> 0.1.10"} {:kino_vega_lite, "~> 0.1.11"}
]) ])
``` ```

View file

@ -1,5 +1,5 @@
defmodule Livebook.Runtime.Definitions do defmodule Livebook.Runtime.Definitions do
@kino_requirement "~> 0.12.0" @kino_requirement "~> 0.13.0"
def kino_requirement do def kino_requirement do
@kino_requirement @kino_requirement
@ -17,12 +17,12 @@ defmodule Livebook.Runtime.Definitions do
kino_db = %{ kino_db = %{
name: "kino_db", name: "kino_db",
dependency: %{dep: {:kino_db, "~> 0.2.5"}, config: []} dependency: %{dep: {:kino_db, "~> 0.2.8"}, config: []}
} }
exqlite = %{ exqlite = %{
name: "exqlite", name: "exqlite",
dependency: %{dep: {:exqlite, "~> 0.11.0"}, config: []} dependency: %{dep: {:exqlite, "~> 0.23.0"}, config: []}
} }
kino_maplibre = %{ kino_maplibre = %{
@ -52,7 +52,7 @@ defmodule Livebook.Runtime.Definitions do
kino_explorer = %{ kino_explorer = %{
name: "kino_explorer", name: "kino_explorer",
dependency: %{dep: {:kino_explorer, "~> 0.1.18"}, config: []} dependency: %{dep: {:kino_explorer, "~> 0.1.20"}, config: []}
} }
jason = %{ jason = %{
@ -62,12 +62,12 @@ defmodule Livebook.Runtime.Definitions do
stb_image = %{ stb_image = %{
name: "stb_image", name: "stb_image",
dependency: %{dep: {:stb_image, "~> 0.6.2"}, config: []} dependency: %{dep: {:stb_image, "~> 0.6.9"}, config: []}
} }
xlsx_reader = %{ xlsx_reader = %{
name: "xlsx_reader", name: "xlsx_reader",
dependency: %{dep: {:xlsx_reader, "~> 0.8.4"}, config: []} dependency: %{dep: {:xlsx_reader, "~> 0.8.5"}, config: []}
} }
windows? = match?({:win32, _}, :os.type()) windows? = match?({:win32, _}, :os.type())