Data-driven Angular app to explore functions and warnings for pins across ESP32 chip variants.
- App spec: see
PROJECT_GUIDE.md - Data lives in
src/assets/chips/<chip-id>/chip.json - Validate JSON:
npm run validate:json - Build chip index:
npm run build:index
- Install deps:
npm install - Start dev server:
npm start - Navigate to
/chip/<chipId>
npm run validate:json– Validate allchip.jsonfiles againstschemas/chip.schema.json.npm run build:index– Generatesrc/assets/chips/chips-index.jsonfor available chips.npm run extract:pins– Extract pin pad areas frompinmap.svgand updatechip.json.
The extract:pins script uses Puppeteer to automatically extract accurate bounding boxes for pin labels from SVG files and update the chip.json file with the calculated areas.
Usage:
# Using npm script (requires chip folder path and optional padding)
npm run extract:pins -- src/assets/chips/esp32-s3-mini-1 10
# Or directly with node
node tools/extract-pin-areas.mjs src/assets/chips/esp32-s3-mini-1 10Parameters:
<chip-folder>(required): Path to the chip folder containingpinmap.svgandchip.json[padding](optional): Padding in pixels around the label (default: 5)
Example:
# Extract pin areas with default 5px padding
npm run extract:pins -- src/assets/chips/esp32-s3-mini-1
# Extract pin areas with 10px padding for larger clickable areas
npm run extract:pins -- src/assets/chips/esp32-s3-mini-1 10The script will:
- Load the
pinmap.svgfile in a headless browser - Find all "Pin " text labels
- Calculate accurate bounding boxes using the browser's rendering engine
- Apply the specified padding around each label
- Update the
chip.jsonfile with the calculatedarea(x, y, w, h) andpositionvalues
Note: This script requires Puppeteer to be installed (included in devDependencies). The script handles rotated text labels automatically, ensuring correct box orientation.