diff --git a/lib/kino/vega_lite.ex b/lib/kino/vega_lite.ex index 7c3cbd6..9b1cda4 100644 --- a/lib/kino/vega_lite.ex +++ b/lib/kino/vega_lite.ex @@ -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 """ diff --git a/test/kino_vega_lite/chart_cell_test.exs b/test/kino_vega_lite/chart_cell_test.exs index 25f9f30..a60793d 100644 --- a/test/kino_vega_lite/chart_cell_test.exs +++ b/test/kino_vega_lite/chart_cell_test.exs @@ -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,