fix dataframe stories (#7747)

This commit is contained in:
pngwn 2024-03-19 19:50:48 +00:00 committed by GitHub
parent 853d945e75
commit 41385f402b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,15 +24,12 @@
<Story
name="Interactive dataframe"
args={{
value: {
data: [
["Cat", 5],
["Horse", 3],
["Snake", 1]
],
headers: ["Animal", "Votes"],
metadata: null
},
values: [
["Cat", 5],
["Horse", 3],
["Snake", 1]
],
headers: ["Animal", "Votes"],
label: "Animals",
col_count: [2, "dynamic"],
row_count: [3, "dynamic"]
@ -42,15 +39,12 @@
<Story
name="Interactive dataframe with label"
args={{
value: {
data: [
["Cat", 5],
["Horse", 3],
["Snake", 1]
],
headers: ["Animal", "Votes"],
metadata: null
},
values: [
["Cat", 5],
["Horse", 3],
["Snake", 1]
],
headers: ["Animal", "Votes"],
label: "Animals",
show_label: true,
col_count: [2, "dynamic"],
@ -61,15 +55,13 @@
<Story
name="Interactive dataframe no label"
args={{
value: {
data: [
["Cat", 5],
["Horse", 3],
["Snake", 1]
],
headers: ["Animal", "Votes"],
metadata: null
},
values: [
["Cat", 5],
["Horse", 3],
["Snake", 1]
],
headers: ["Animal", "Votes"],
metadata: null,
label: "Animals",
show_label: false,
col_count: [2, "dynamic"],
@ -80,15 +72,13 @@
<Story
name="Static dataframe"
args={{
value: {
data: [
["Cat", 5],
["Horse", 3],
["Snake", 1]
],
headers: ["Animal", "Votes"],
metadata: null
},
values: [
["Cat", 5],
["Horse", 3],
["Snake", 1]
],
headers: ["Animal", "Votes"],
label: "Animals",
col_count: [2, "dynamic"],
row_count: [3, "dynamic"],
@ -99,19 +89,15 @@
<Story
name="Dataframe with different precisions"
args={{
value: {
data: [
[1.24, 1.24, 1.24],
[1.21, 1.21, 1.21]
],
headers: ["Precision=0", "Precision=1", "Precision=2"],
metadata: {
display_value: [
["1", "1.2", "1.24"],
["1", "1.2", "1.21"]
]
}
},
values: [
[1.24, 1.24, 1.24],
[1.21, 1.21, 1.21]
],
headers: ["Precision=0", "Precision=1", "Precision=2"],
display_value: [
["1", "1.2", "1.24"],
["1", "1.2", "1.21"]
],
label: "Numbers",
col_count: [3, "dynamic"],
row_count: [2, "dynamic"],
@ -122,15 +108,12 @@
<Story
name="Dataframe with markdown and math"
args={{
value: {
data: [
["Linear", "$y=x$", "Has a *maximum* of 1 root"],
["Quadratic", "$y=x^2$", "Has a *maximum* of 2 roots"],
["Cubic", "$y=x^3$", "Has a *maximum* of 3 roots"]
],
headers: ["Type", "Example", "Roots"],
metadata: null
},
values: [
["Linear", "$y=x$", "Has a *maximum* of 1 root"],
["Quadratic", "$y=x^2$", "Has a *maximum* of 2 roots"],
["Cubic", "$y=x^3$", "Has a *maximum* of 3 roots"]
],
headers: ["Type", "Example", "Roots"],
datatype: ["str", "markdown", "markdown"],
latex_delimiters: [{ left: "$", right: "$", display: false }],
label: "Math",
@ -143,23 +126,20 @@
<Story
name="Dataframe with different colors"
args={{
value: {
data: [
[800, 100, 800],
[200, 800, 700]
values: [
[800, 100, 800],
[200, 800, 700]
],
headers: ["Math", "Reading", "Writing"],
styling: [
[
"background-color:teal; color: white",
"1.2",
"background-color:teal; color: white"
],
headers: ["Math", "Reading", "Writing"],
metadata: {
styling: [
[
"background-color:teal; color: white",
"1.2",
"background-color:teal; color: white"
],
["1", "background-color:teal; color: white", "1.21"]
]
}
},
["1", "background-color:teal; color: white", "1.21"]
],
label: "Test scores",
col_count: [3, "dynamic"],
row_count: [2, "dynamic"],
@ -170,13 +150,11 @@
<Story
name="Dataframe with column widths"
args={{
value: {
data: [
[800, 100, 800],
[200, 800, 700]
],
headers: ["Narrow", "Wide", "Half"]
},
values: [
[800, 100, 800],
[200, 800, 700]
],
headers: ["Narrow", "Wide", "Half"],
label: "Test scores",
col_count: [3, "dynamic"],
row_count: [2, "dynamic"],