-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathroadsOptions.js
More file actions
27 lines (24 loc) · 792 Bytes
/
roadsOptions.js
File metadata and controls
27 lines (24 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import * as util from '/src/utils.js'
const baseUrl = '/models/data/roads14.png'
const baseMapTile = await util.imagePromise(baseUrl)
export default function TwoDrawOptions(div, model, patchSize = 4) {
const breedColor = {
nodes: 'red',
intersections: 'blue',
drivers: 'green',
}
const breedSize = { nodes: 1, intersections: 2, drivers: 5 }
const breedShape = {
nodes: 'circle',
intersections: 'circle',
drivers: 'dart',
}
const drawOptions = {
patchesColor: baseMapTile,
turtlesColor: t => breedColor[t.breed.name],
turtlesSize: t => breedSize[t.breed.name],
turtlesShape: t => breedShape[t.breed.name],
linksColor: 'black',
}
return { div, patchSize, drawOptions }
}