Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new export API to avoid deprecation warnings with latest kino #50

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading