Pre-computed graph coloring:
canvas.nodes([1, 2, 3, 4, 5, 6]).add()
canvas.edges([[1, 2], [1, 3], [1, 6], [2, 3],
[2, 4], [3, 5], [3, 6], [4, 5], [5, 6]]).add()
canvas.pause(0.5)
const coloring = {
1: 'red',
2: 'blue',
3: 'green',
4: 'red',
5: 'blue',
6: 'yellow'
}
for (const k in coloring) {
canvas.node(k).color(coloring[k])
canvas.node(k).highlight(0).size('1.2x')
canvas.pause(0.5)
}