- Install Dependencies with
npm install - Place your PDF files in the
public/plots/directory - Edit json files in
src/data/to match your plots as detailed in the Configuration Guide - Run development server with
npm run dev - Deploy using github pages, cloudflare, or use your favorite website hosting service! You can find full documentation for a variety of hosting services in the official Astro deployment guide.
At runtime, each project is a JavaScript object of this shape:
{
"id": "project-id",
"name": "Project Display Name",
"description": "Brief project description",
"subpages": [...]
}This object is defined by a small JS aggregator module in
src/data/<project-id>/index.js which imports the subpage JSON files and
combines them with the project metadata:
// src/data/<project-id>/index.js
import subpageA from './subpage-a.json';
import subpageB from './subpage-b.json';
const meta = {
id: 'project-id',
name: 'Project Display Name',
description: 'Brief project description',
};
export default {
...meta,
subpages: [subpageA, subpageB],
};Note: id must match the name of a directory under src/pages.
{
"id": "subpage-id",
"name": "Subpage Display Name",
"defaultGridCols": 4,
"plots": [...]
}defaultGridCols: Number of columns for multi-plot grid view (1-8)
Note: id much match the name of a .astro page in /src/pages/<project-id>/;
e.g.: /src/pages/<project-id>/<subpage-id>.astro
{
"id": "plot-id",
"title": "Plot Title",
"description": "Plot description",
"axes": { "x": "x-axis label", "y": "y-axis label" },
"file": "/plots/path/to/plot.pdf"
}{
"id": "plot-id",
"title": "Plot Title",
"description": "Plot description",
"axes": { "x": "x-axis label", "y": "y-axis label" },
"files": [
"/plots/path/to/plot1.pdf",
"/plots/path/to/plot2.pdf"
]
}{
"id": "plot-id",
"title": "Plot Title",
"description": "Plot description",
"axes": { "x": "x-axis label", "y": "y-axis label" },
"columnHeaders": [
{ "afterIndex": 0, "text": "First Section" },
{ "afterIndex": 5, "text": "Second Section" }
],
"files": [...]
}afterIndex: 0-based position before which header appears- Header spans full grid width
{
"id": "plot-id",
"title": "Plot Title",
"description": "Plot description",
"axes": { "x": "x-axis label", "y": "y-axis label" },
"gridLayout": {
"rowHeader": "Row Label",
"colHeader": "Column Label",
"rows": ["Row 1", "Row 2"],
"cols": ["Col 1", "Col 2", "Col 3"],
"files": [
["/plots/r1c1.pdf", "/plots/r1c2.pdf", "/plots/r1c3.pdf"],
["/plots/r2c1.pdf", "/plots/r2c2.pdf", "/plots/r2c3.pdf"]
]
}
}- Creates a table with labeled rows and columns
filesis a 2D array matching row/column structure
- Supports both PDF and image files (png, jpg, jpeg, gif, webp, svg)
- All file paths are relative to
/public/directory - Use consistent naming conventions for easier maintenance