Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better handling of empty dataframe in
gr.DataFrame
(#5256)
* better handling of empty dataframe * add changeset * hide comments * add changeset * remove * lint * null case * add stories * stories * lint --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
- Loading branch information
1 parent
c39f06e
commit 933db53
Showing
4 changed files
with
100 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@gradio/dataframe": patch | ||
"gradio": patch | ||
--- | ||
|
||
fix:Better handling of empty dataframe in `gr.DataFrame` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<script> | ||
import { Meta, Template, Story } from "@storybook/addon-svelte-csf"; | ||
import Table from "./shared/Table.svelte"; | ||
</script> | ||
|
||
<Meta | ||
title="Components/DataFrame" | ||
component={Table} | ||
argTypes={{ | ||
editable: { | ||
control: [true, false], | ||
description: "Whether the DataFrame is editable", | ||
name: "interactive", | ||
value: true | ||
} | ||
}} | ||
/> | ||
|
||
<Template let:args> | ||
<Table {...args} /> | ||
</Template> | ||
|
||
<Story | ||
name="Interactive dataframe" | ||
args={{ | ||
values: [ | ||
["Cat", 5], | ||
["Horse", 3], | ||
["Snake", 1] | ||
], | ||
headers: ["Animal", "Votes"], | ||
label: "Animals", | ||
col_count: [2, "dynamic"], | ||
row_count: [3, "dynamic"] | ||
}} | ||
/> | ||
|
||
<Story | ||
name="Static dataframe" | ||
args={{ | ||
values: [ | ||
["Cat", 5], | ||
["Horse", 3], | ||
["Snake", 1] | ||
], | ||
headers: ["Animal", "Votes"], | ||
label: "Animals", | ||
col_count: [2, "dynamic"], | ||
row_count: [3, "dynamic"], | ||
editable: false | ||
}} | ||
/> | ||
|
||
<Story | ||
name="Empty dataframe" | ||
args={{ | ||
values: [[]], | ||
headers: ["Animal", "Votes"], | ||
label: "Animals", | ||
col_count: [2, "dynamic"], | ||
row_count: [0, "dynamic"] | ||
}} | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters