Skip to content

Commit

Permalink
DataTable - fix for empty data with columns (#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristine Guadelupe authored May 16, 2024
1 parent eaabcd7 commit df73bed
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
4 changes: 0 additions & 4 deletions assets/data_table/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,6 @@ export function App({ ctx, data }) {
return true;
}

if (!hasEntries) {
return false;
}

ctx.rect(rect.x, rect.y, rect.width, rect.height);

const basePadding = 10;
Expand Down
2 changes: 1 addition & 1 deletion lib/assets/data_table/build/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/kino/table.ex
Original file line number Diff line number Diff line change
Expand Up @@ -293,5 +293,6 @@ defmodule Kino.Table do

defp sample_data([], _), do: {0, []}
defp sample_data(data, :rows), do: {length(data), hd(data)}
defp sample_data([[] | _], :columns), do: {0, []}
defp sample_data(data, :columns), do: {length(hd(data)), Enum.map(data, &List.first(&1))}
end

0 comments on commit df73bed

Please sign in to comment.