I need to programmatically generate a list of neuroglancer URLs encoding a lot of viewer state from n5 containers stored on s3. For each n5 container in an s3 bucket, I need to parse the attributes.json file and use that information to create either an image layer or a segmentation layer, adjust transformation matrices, etc.
I could manually construct the viewer state as JSON then escape out all the stuff that's not allowed in a URL, but I wondered if there was an easier way, e.g. to access ViewerState and other neuroglancer classes from clientside javascript, then use methods of those classes to generate a URL. This is the approach I would use if I were doing things in python, but I can't quite see how to do it easily in client-side JS. Complicating things is the fact that I'm very inexperienced with JS...
So, any examples or suggestions would be greatly appreciated!