For some applications it would be nice to have access to device info and maps inside the pattern code, but we don’t.
One thing I have seen done to make map reconfiguration easier is to put multiple sections into the mapper function and switch between them with a single variable:
function (pixelCount) {
// Select which of the available maps to use.
whichMap = 0;
// Build the appropriate map.
var map = []
if (whichMap == 0) {
// 16x16 matrix.
width = 16
for (i = 0; i < pixelCount; i++) {
x = Math.floor(i / width)
y = i % width
y = x % 2 == 1 ? width - 1 - y : y //zigzag
map.push([x, y])
}
}
else if (whichMap == 1) {
// 7-bit hex ring.
for (i = 0; i < pixelCount; i++) {
c = i / pixelCount * Math.PI * 2
map.push([Math.cos(c), Math.sin(c)])
}
}
// ...and so on...
return map
}
…which would allow you to maintain one map file that can be loaded onto all Pixelblazes and easily matched to the particular LED configuration each one is connected to. There’s no avoiding some level of customization when swapping devices because the pixel count (and possibly LED type and color order) need to be set anyway.
And if you need to manage patterns across multiple Pixelblazes, there are a few tools that might help.