Skip to content

Commit a2cdb8e

Browse files
committed
more examples
1 parent 70be8b3 commit a2cdb8e

File tree

2 files changed

+282
-81
lines changed

2 files changed

+282
-81
lines changed

src/lib/sampleData.ts

Lines changed: 196 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,152 @@
11
export const sampleDatasets = {
22
basic: {
33
data: [
4-
["Alice", 25, "true", "2023-01-15"],
5-
["Bob", 30, "false", "2023-02-20"],
6-
["Charlie", 35, "true", "2023-03-10"],
7-
["Diana", 28, "false", "2023-04-05"],
8-
["Eve", 32, "true", "2023-05-12"],
4+
["Alice Johnson", 25, "true", "2023-01-15"],
5+
["Bob Smith", 30, "false", "2023-02-20"],
6+
["Charlie Brown", 35, "true", "2023-03-10"],
7+
["Diana Prince", 28, "false", "2023-04-05"],
8+
["Eve Wilson", 32, "true", "2023-05-12"],
99
],
1010
headers: ["Name", "Age", "Active", "Date"],
1111
datatypes: ["str", "number", "bool", "date"],
12+
config: {
13+
editable: true,
14+
show_row_numbers: true,
15+
show_search: "search",
16+
show_copy_button: true,
17+
show_fullscreen_button: true,
18+
max_height: 400,
19+
label: "Employee Database",
20+
show_label: true,
21+
line_breaks: true,
22+
wrap: false,
23+
},
24+
},
25+
compact: {
26+
data: [
27+
["AAPL", 150.25, 2.34, "📈"],
28+
["GOOGL", 2845.67, -15.23, "📉"],
29+
["MSFT", 412.89, 8.91, "📈"],
30+
["TSLA", 238.45, -4.12, "📉"],
31+
["AMZN", 3456.78, 12.34, "📈"],
32+
["META", 487.23, -2.87, "📉"],
33+
["NVDA", 875.23, 45.67, "📈"],
34+
["NFLX", 425.18, -8.92, "📉"],
35+
],
36+
headers: ["Symbol", "Price", "Change", "Trend"],
37+
datatypes: ["str", "number", "number", "str"],
38+
config: {
39+
editable: false,
40+
show_row_numbers: false,
41+
show_search: "none",
42+
show_copy_button: false,
43+
show_fullscreen_button: false,
44+
max_height: 200,
45+
label: "",
46+
show_label: false,
47+
line_breaks: false,
48+
wrap: false,
49+
},
50+
},
51+
filterable: {
52+
data: [
53+
["John Doe", "Engineering", "Senior", 95000, "true"],
54+
["Jane Smith", "Marketing", "Manager", 75000, "true"],
55+
["Mike Johnson", "Sales", "Junior", 45000, "false"],
56+
["Sarah Wilson", "Engineering", "Lead", 120000, "true"],
57+
["David Brown", "HR", "Specialist", 55000, "true"],
58+
["Emily Davis", "Finance", "Analyst", 65000, "false"],
59+
["Tom Anderson", "Engineering", "Junior", 70000, "true"],
60+
["Lisa Garcia", "Marketing", "Senior", 85000, "false"],
61+
["James Miller", "Sales", "Manager", 90000, "true"],
62+
["Maria Rodriguez", "Finance", "Senior", 95000, "true"],
63+
],
64+
headers: ["Name", "Department", "Level", "Salary", "Remote"],
65+
datatypes: ["str", "str", "str", "number", "bool"],
66+
config: {
67+
editable: true,
68+
show_row_numbers: true,
69+
show_search: "filter",
70+
show_copy_button: true,
71+
show_fullscreen_button: true,
72+
max_height: 350,
73+
label: "Employee Directory with Filters",
74+
show_label: true,
75+
line_breaks: true,
76+
wrap: false,
77+
},
78+
},
79+
readonly: {
80+
data: [
81+
["Q1 2023", "Revenue", 125000, "15% increase from Q4"],
82+
["Q1 2023", "Expenses", 85000, "5% decrease from Q4"],
83+
["Q1 2023", "Profit", 40000, "35% increase from Q4"],
84+
["Q2 2023", "Revenue", 145000, "16% increase from Q1"],
85+
["Q2 2023", "Expenses", 90000, "6% increase from Q1"],
86+
["Q2 2023", "Profit", 55000, "37% increase from Q1"],
87+
],
88+
headers: ["Period", "Category", "Amount", "Change"],
89+
datatypes: ["str", "str", "number", "str"],
90+
config: {
91+
editable: false,
92+
show_row_numbers: true,
93+
show_search: "search",
94+
show_copy_button: true,
95+
show_fullscreen_button: true,
96+
max_height: 300,
97+
label: "Financial Report (Read-Only)",
98+
show_label: true,
99+
line_breaks: true,
100+
wrap: true,
101+
},
102+
},
103+
wrapped: {
104+
data: [
105+
[
106+
"Bug Fix",
107+
"Fixed critical issue with user authentication that was causing login failures for users with special characters in their email addresses",
108+
"High",
109+
"Completed",
110+
],
111+
[
112+
"Feature",
113+
"Implemented new dashboard analytics with real-time data visualization including charts, graphs, and interactive elements",
114+
"Medium",
115+
"In Progress",
116+
],
117+
[
118+
"Enhancement",
119+
"Optimized database queries to improve application performance and reduce load times across all user-facing pages",
120+
"Low",
121+
"Testing",
122+
],
123+
[
124+
"Bug Fix",
125+
"Resolved mobile responsiveness issues on the checkout page that were affecting user experience on smaller screens",
126+
"High",
127+
"Completed",
128+
],
129+
],
130+
headers: ["Type", "Description", "Priority", "Status"],
131+
datatypes: ["str", "str", "str", "str"],
132+
config: {
133+
editable: true,
134+
show_row_numbers: true,
135+
show_search: "search",
136+
show_copy_button: true,
137+
show_fullscreen_button: true,
138+
max_height: 400,
139+
label: "Task Management with Text Wrapping",
140+
show_label: true,
141+
line_breaks: true,
142+
wrap: true,
143+
max_chars: 100,
144+
},
12145
},
13146
large: {
14-
data: Array.from({ length: 100 }, (_, i) => [
147+
data: Array.from({ length: 50 }, (_, i) => [
15148
`User ${i + 1}`,
149+
`user${i + 1}@example.com`,
16150
Math.floor(Math.random() * 50) + 18,
17151
Math.random() > 0.5 ? "true" : "false",
18152
new Date(
@@ -25,8 +159,28 @@ export const sampleDatasets = {
25159
(Math.random() * 100000).toFixed(2),
26160
Math.floor(Math.random() * 5) + 1,
27161
]),
28-
headers: ["Name", "Age", "Active", "Date", "Salary", "Rating"],
29-
datatypes: ["str", "number", "bool", "date", "number", "number"],
162+
headers: [
163+
"Name",
164+
"Email",
165+
"Age",
166+
"Active",
167+
"Join Date",
168+
"Revenue",
169+
"Rating",
170+
],
171+
datatypes: ["str", "str", "number", "bool", "date", "number", "number"],
172+
config: {
173+
editable: true,
174+
show_row_numbers: true,
175+
show_search: "filter",
176+
show_copy_button: true,
177+
show_fullscreen_button: true,
178+
max_height: 500,
179+
label: "Large Dataset (50 rows)",
180+
show_label: true,
181+
line_breaks: true,
182+
wrap: false,
183+
},
30184
},
31185
mixed: {
32186
data: [
@@ -61,5 +215,39 @@ export const sampleDatasets = {
61215
],
62216
headers: ["Product", "Price", "Status", "URL", "Availability"],
63217
datatypes: ["markdown", "number", "str", "str", "html"],
218+
config: {
219+
editable: true,
220+
show_row_numbers: false,
221+
show_search: "search",
222+
show_copy_button: true,
223+
show_fullscreen_button: true,
224+
max_height: 300,
225+
label: "Rich Content (HTML & Markdown)",
226+
show_label: true,
227+
line_breaks: true,
228+
wrap: false,
229+
},
230+
},
231+
minimal: {
232+
data: [
233+
["Task 1", "Complete"],
234+
["Task 2", "Pending"],
235+
["Task 3", "In Progress"],
236+
["Task 4", "Complete"],
237+
],
238+
headers: ["Task", "Status"],
239+
datatypes: ["str", "str"],
240+
config: {
241+
editable: true,
242+
show_row_numbers: false,
243+
show_search: "none",
244+
show_copy_button: false,
245+
show_fullscreen_button: false,
246+
max_height: 200,
247+
label: "",
248+
show_label: false,
249+
line_breaks: false,
250+
wrap: false,
251+
},
64252
},
65253
};

0 commit comments

Comments
 (0)