You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+67-1Lines changed: 67 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,10 @@ Host your Plotly Chart Studio visualizations online for free using GitHub Pages.
13
13
14
14
## What This Does
15
15
16
-
Upload your Chart Studio HTML exports, and they'll be automatically published online:
16
+
Upload your Chart Studio HTML exports or JSON data files, and they'll be automatically published online:
17
17
- An **index page** listing all your Plotly charts is created at `https://yourusername.github.io/your-project/`
18
18
- Each chart gets its own web address: `https://yourusername.github.io/your-project/my-chart.html`
19
+
-**NEW:** Support for JSON exports - just place Chart Studio JSON files in the `json/` directory and they'll be automatically converted to HTML
19
20
20
21
Perfect for sharing interactive Plotly visualizations with your team or embedding in presentations!
21
22
@@ -65,6 +66,14 @@ You can add files directly on GitHub (easiest) or use GitHub Desktop:
65
66
4. In GitHub Desktop, write a description and click **Commit to main**
66
67
5. Click **Push origin** to upload
67
68
69
+
**Option C: Upload JSON Files (Alternative)**
70
+
If you have JSON exports from Chart Studio instead of HTML files:
71
+
1. Click on the `json` folder (or create it if it doesn't exist)
72
+
2. Click **Add file** → **Upload files**
73
+
3. Drag and drop your Chart Studio JSON files (e.g., `chart_data.json` files)
74
+
4. Click **Commit changes** at the bottom
75
+
5. The GitHub Action will automatically convert these to HTML files in the `charts` folder
76
+
68
77
### Step 5: Wait for Publishing
69
78
70
79
After uploading files:
@@ -185,3 +194,60 @@ uv run poll_all_charts.py
185
194
The script will download all your charts and save them as HTML files in the `charts/` folder. Then just commit and push the changes to publish them on GitHub Pages!
186
195
187
196
**Note:** This script uses Plotly.js version 1.58.5 to ensure compatibility and consistent rendering across all your charts.
197
+
198
+
## Working with JSON Exports
199
+
200
+
If you have Chart Studio JSON exports (such as `chart_data.json` files from bulk exports), this repository can automatically convert them to HTML files.
201
+
202
+
### Why Use JSON Files?
203
+
204
+
- Bulk exports from Chart Studio often come as JSON files
205
+
- JSON files are more portable and easier to version control
206
+
- You can modify chart data programmatically before converting to HTML
207
+
- Smaller file sizes compared to full HTML files
208
+
209
+
### How to Use JSON Files
210
+
211
+
**Option 1: Manual Conversion (Local)**
212
+
213
+
1. Place your JSON files in the `json/` directory
214
+
2. Run the conversion script locally:
215
+
```bash
216
+
./convert_json_to_html.py
217
+
```
218
+
3. The script will create HTML files in the `charts/` directory
219
+
220
+
**Option 2: Automatic Conversion (GitHub)**
221
+
222
+
1. Upload your JSON files to the `json/` folder in your repository
223
+
2. Commit and push the changes
224
+
3. GitHub Actions will automatically:
225
+
- Detect the JSON files
226
+
- Convert them to HTML using the same Plotly.js version (1.58.5)
227
+
- Include them in your published site
228
+
229
+
### JSON File Format
230
+
231
+
The JSON files should match the Chart Studio export format:
232
+
233
+
```json
234
+
{
235
+
"data": [
236
+
{
237
+
"type": "scatter",
238
+
"x": [1, 2, 3],
239
+
"y": [2, 4, 6],
240
+
"mode": "lines+markers"
241
+
}
242
+
],
243
+
"layout": {
244
+
"title": {
245
+
"text": "My Chart"
246
+
},
247
+
"xaxis": {"title": {"text": "X Axis"}},
248
+
"yaxis": {"title": {"text": "Y Axis"}}
249
+
}
250
+
}
251
+
```
252
+
253
+
The conversion script reads the `data` and `layout` fields and generates standalone HTML files with embedded Plotly.js.
0 commit comments