Skip to content

Commit

Permalink
Update scripts and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeLonewolf committed Oct 5, 2023
1 parent 175317a commit 5c3fb07
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ The highway shield [color palette](americana.gpl) can be imported into Inkscape
3. Import [americana.gpl](americana.gpl).
4. Restart Inkscape.
5. Click the ◀ button to the right of the color palette strip at the bottom of the window (or in the top-right corner of the Color Palette panel), then choose americana.gpl from the menu.

## Map sample images

Map sample images can be generated with a script. See [sample_locations.json](test/sample_locations.json) for the format.

1. Create a JSON file with the map location and clipping rectangles
2. Run the generate_samples script and pass the JSON file location: `npm run generate_samples -- test/sample_locations.json``
9 changes: 6 additions & 3 deletions scripts/generate_samples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ const loadSampleLocations = (filePath: string): SampleSpecification[] => {

const sampleFolder = "./samples";

const screenshots: SampleSpecification[] = loadSampleLocations(
"test/sample_locations.json"
);
const jsonSampleLocations = process.argv[2] || "test/sample_locations.json";

console.log(`Loading sample locations from ${jsonSampleLocations}`);

const screenshots: SampleSpecification[] =
loadSampleLocations(jsonSampleLocations);

fs.mkdirSync(sampleFolder, { recursive: true });

Expand Down

0 comments on commit 5c3fb07

Please sign in to comment.