Skip to content

Commit

Permalink
Use new export API to avoid deprecation warnings with latest kino (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatanklosko authored Sep 21, 2023
1 parent 79a94ce commit 98ec2f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion lib/kino/vega_lite.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ defmodule Kino.VegaLite do
datasets: []
}

Kino.JS.new(__MODULE__, data, export_info_string: "vega-lite", export_key: :spec)
Kino.JS.new(__MODULE__, data,
export: fn data -> {"vega-lite", data.spec} end,
# TODO: remove legacy export attributes once we require Kino v0.11.0
export_info_string: "vega-lite",
export_key: :spec
)
end

@doc """
Expand Down
8 changes: 4 additions & 4 deletions test/kino_vega_lite/chart_cell_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ defmodule KinoVegaLite.ChartCellTest do
test "finds tabular data in binding and sends new options to the client" do
{kino, _source} = start_smart_cell!(ChartCell, %{})

row_data = [%{x: 1, y: 1}, %{x: 2, y: 2}]
column_data = %{x: 1..2, y: 1..2}
temporal_data = %{x: ["cats", "dogs"], y: ["2022-01-01", "2020-01-01"]}
invalid_data = %{self() => [1, 2], :y => [1, 2]}
row_data = [[x: 1, y: 1], [x: 2, y: 2]]
column_data = [x: 1..2, y: 1..2]
temporal_data = [x: ["cats", "dogs"], y: ["2022-01-01", "2020-01-01"]]
invalid_data = [{self(), [1, 2]}, {:y, [1, 2]}]

binding = [
row_data: row_data,
Expand Down

0 comments on commit 98ec2f4

Please sign in to comment.