@@ -205,3 +205,114 @@ export const WithChartsAndMetrics: Story = {
205205 ]
206206 } as any ,
207207} ;
208+
209+ export const WithGridLayout : Story = {
210+ render : renderStory ,
211+ args : {
212+ type : 'dashboard' ,
213+ name : 'sales_dashboard' ,
214+ title : 'Sales Analytics Dashboard' ,
215+ enableGridLayout : true ,
216+ persistLayout : true ,
217+ widgets : [
218+ {
219+ id : 'total-revenue' ,
220+ type : 'metric-card' ,
221+ title : 'Total Revenue' ,
222+ value : '$142,892' ,
223+ change : '+12.5%' ,
224+ trend : 'up' ,
225+ layout : { x : 0 , y : 0 , w : 3 , h : 2 } ,
226+ } ,
227+ {
228+ id : 'new-customers' ,
229+ type : 'metric-card' ,
230+ title : 'New Customers' ,
231+ value : '847' ,
232+ change : '+8.2%' ,
233+ trend : 'up' ,
234+ layout : { x : 3 , y : 0 , w : 3 , h : 2 } ,
235+ } ,
236+ {
237+ id : 'conversion-rate' ,
238+ type : 'metric-card' ,
239+ title : 'Conversion Rate' ,
240+ value : '3.24%' ,
241+ change : '-0.5%' ,
242+ trend : 'down' ,
243+ layout : { x : 6 , y : 0 , w : 3 , h : 2 } ,
244+ } ,
245+ {
246+ id : 'revenue-chart' ,
247+ type : 'bar' ,
248+ title : 'Monthly Revenue' ,
249+ data : [
250+ { month : 'Jan' , revenue : 12000 } ,
251+ { month : 'Feb' , revenue : 15000 } ,
252+ { month : 'Mar' , revenue : 18000 } ,
253+ { month : 'Apr' , revenue : 14000 } ,
254+ { month : 'May' , revenue : 20000 } ,
255+ { month : 'Jun' , revenue : 22000 } ,
256+ ] ,
257+ xAxisKey : 'month' ,
258+ series : [ { dataKey : 'revenue' } ] ,
259+ layout : { x : 0 , y : 2 , w : 6 , h : 4 } ,
260+ } ,
261+ {
262+ id : 'top-products' ,
263+ type : 'table' ,
264+ title : 'Top Products' ,
265+ columns : [ 'Product' , 'Sales' , 'Revenue' ] ,
266+ data : [
267+ { Product : 'Product A' , Sales : 245 , Revenue : '$12,450' } ,
268+ { Product : 'Product B' , Sales : 189 , Revenue : '$9,450' } ,
269+ { Product : 'Product C' , Sales : 156 , Revenue : '$7,800' } ,
270+ ] ,
271+ layout : { x : 6 , y : 2 , w : 3 , h : 4 } ,
272+ } ,
273+ ] ,
274+ } as any ,
275+ } ;
276+
277+ export const EditableLayout : Story = {
278+ render : renderStory ,
279+ args : {
280+ type : 'dashboard' ,
281+ name : 'custom_dashboard' ,
282+ title : 'Customizable Dashboard' ,
283+ enableGridLayout : true ,
284+ enableEditMode : true ,
285+ persistLayout : true ,
286+ widgets : [
287+ {
288+ id : 'widget-1' ,
289+ type : 'metric-card' ,
290+ title : 'Metric 1' ,
291+ value : '1,234' ,
292+ layout : { x : 0 , y : 0 , w : 3 , h : 2 } ,
293+ } ,
294+ {
295+ id : 'widget-2' ,
296+ type : 'metric-card' ,
297+ title : 'Metric 2' ,
298+ value : '5,678' ,
299+ layout : { x : 3 , y : 0 , w : 3 , h : 2 } ,
300+ } ,
301+ {
302+ id : 'widget-3' ,
303+ type : 'line' ,
304+ title : 'Trend Chart' ,
305+ data : [
306+ { date : 'Mon' , value : 100 } ,
307+ { date : 'Tue' , value : 150 } ,
308+ { date : 'Wed' , value : 130 } ,
309+ { date : 'Thu' , value : 180 } ,
310+ { date : 'Fri' , value : 200 } ,
311+ ] ,
312+ xAxisKey : 'date' ,
313+ series : [ { dataKey : 'value' } ] ,
314+ layout : { x : 0 , y : 2 , w : 6 , h : 3 } ,
315+ } ,
316+ ] ,
317+ } as any ,
318+ } ;
0 commit comments