1- import type { RExample } from ' @/types'
1+ import type { RExample } from " @/types" ;
22
33export const examples : RExample [ ] = [
44 {
5- id : 'iris-petal-scatter' ,
6- title : 'Iris sepal dimensions' ,
7- description : 'Explore the relationship between sepal length and width across iris species' ,
5+ id : "iris-petal-scatter" ,
6+ title : "Iris sepal dimensions" ,
7+ description :
8+ "Explore the relationship between sepal length and width across iris species" ,
89 code : `library(ggplot2)
910
1011# Load the classic iris dataset
@@ -21,9 +22,9 @@ ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species)) +
2122 theme(legend.position = "bottom")` ,
2223 } ,
2324 {
24- id : ' kawaii-iris' ,
25- title : ' Kawaii-style iris visualization' ,
26- description : ' A playful, pastel visualization of iris sepal dimensions' ,
25+ id : " kawaii-iris" ,
26+ title : " Kawaii-style iris visualization" ,
27+ description : " A playful, pastel visualization of iris sepal dimensions" ,
2728 code : `library(ggplot2)
2829
2930# Load iris dataset for a cute visualization
@@ -38,15 +39,15 @@ ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species)) +
3839 "versicolor" = "#DDA0DD", # Plum
3940 "virginica" = "#87CEEB")) + # Sky blue
4041 # Add cute title and labels
41- labs(title = "✿ Kawaii Iris Garden ✿",
42- x = "Sepal Length ♡",
43- y = "Sepal Width ♡") +
42+ labs(title = "✿ Kawaii Iris Meadow ✿",
43+ x = "Sepal Length (cm) ♡",
44+ y = "Sepal Width (cm) ♡") +
4445 # Simple kawaii theme
4546 theme_minimal() +
4647 theme(
47- plot.background = element_rect(fill = "#FFF0F5 ", color = NA),
48+ plot.background = element_rect(fill = "#FFFAFA ", color = NA),
4849 panel.background = element_rect(fill = "#FFFAFA", color = NA),
49- panel.grid = element_line(color = "#FFE0F0", size = 0.3),
50+ panel.grid = element_line(color = "#FFE0F0", linewidth = 0.3),
5051 text = element_text(color = "#FF1493"),
5152 plot.title = element_text(size = 18, face = "bold", hjust = 0.5),
5253 legend.position = "bottom",
@@ -57,9 +58,10 @@ ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species)) +
5758 )` ,
5859 } ,
5960 {
60- id : 'iris-violin-panels' ,
61- title : 'Iris measurements distribution' ,
62- description : 'Violin plots showing distribution of all iris measurements in a 2x2 panel' ,
61+ id : "iris-violin-panels" ,
62+ title : "Iris measurements distribution" ,
63+ description :
64+ "Violin plots showing distribution of all iris measurements in a 2x2 panel" ,
6365 code : `library(ggplot2)
6466library(tidyr)
6567
@@ -92,10 +94,10 @@ ggplot(iris_long, aes(x = Species, y = Value, fill = Species)) +
9294 )` ,
9395 } ,
9496 {
95- id : ' metal-bands-happiness' ,
96- title : ' Metal bands vs happiness' ,
97- description : ' Surprising correlation: more metal bands = happier countries' ,
98- csvUrl : ' ./metal_bands_happiness.csv' ,
97+ id : " metal-bands-happiness" ,
98+ title : " Metal bands vs happiness" ,
99+ description : " Surprising correlation: more metal bands = happier countries" ,
100+ csvUrl : " ./metal_bands_happiness.csv" ,
99101 code : `library(ggplot2)
100102library(ggrepel)
101103
@@ -115,13 +117,13 @@ ggplot(data, aes(x = Metal.bands.per.capita, y = Score, label = Country.or.regio
115117 theme_minimal()` ,
116118 } ,
117119 {
118- id : ' custom-csv-template' ,
119- title : ' Your CSV template' ,
120- description : ' Starting point for analyzing your own data' ,
120+ id : " custom-csv-template" ,
121+ title : " Your CSV template" ,
122+ description : " Starting point for analyzing your own data" ,
121123 code : `library(ggplot2)
122124
123125# Upload your CSV file using the button above
124126# Then change "your_filename.csv" to your actual filename and press Run
125127data <- read.csv("/tmp/your_filename.csv", stringsAsFactors = FALSE)` ,
126128 } ,
127- ]
129+ ] ;
0 commit comments