Skip to content

Commit a1bc863

Browse files
staredclaude
andcommitted
Fix CSV loading for production deployment and add R load instructions
- Change absolute CSV path to relative path for proper loading on GitHub Pages - Add R code snippet in CSV info dropdown showing exact load command - Style the code snippet with monospace font and appropriate formatting 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 0cb58f7 commit a1bc863

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

src/components/FileUpload.vue

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ onUnmounted(() => {
264264
</span>
265265
</div>
266266
</div>
267+
<div class="code-section">
268+
<span class="code-header">Load in R:</span>
269+
<code class="code-snippet">data &lt;- read.csv("/tmp/{{ props.uploadedFile.name }}")</code>
270+
</div>
267271
</div>
268272
</div>
269273
</div>
@@ -493,6 +497,31 @@ onUnmounted(() => {
493497
gap: 0.5rem;
494498
}
495499
500+
.code-section {
501+
margin-top: 0.75rem;
502+
padding-top: 0.75rem;
503+
border-top: 1px solid #e5e7eb;
504+
}
505+
506+
.code-header {
507+
font-size: 0.875rem;
508+
font-weight: 500;
509+
color: #6b7280;
510+
display: block;
511+
margin-bottom: 0.5rem;
512+
}
513+
514+
.code-snippet {
515+
display: block;
516+
background: #f3f4f6;
517+
padding: 0.5rem;
518+
border-radius: 0.25rem;
519+
font-family: 'Monaco', 'Courier New', monospace;
520+
font-size: 0.8125rem;
521+
color: #1f2937;
522+
word-break: break-all;
523+
}
524+
496525
.column-name {
497526
background: #f3f4f6;
498527
padding: 0.25rem 0.5rem;

src/data/examples.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ ggplot(iris_long, aes(x = Species, y = Value, fill = Species)) +
9595
id: 'metal-bands-happiness',
9696
title: 'Metal bands vs happiness',
9797
description: 'Surprising correlation: more metal bands = happier countries',
98-
csvUrl: '/metal_bands_happiness.csv',
98+
csvUrl: './metal_bands_happiness.csv',
9999
code: `library(ggplot2)
100100
library(ggrepel)
101101

0 commit comments

Comments
 (0)