Wish to color particles originating from specific relays
I want to use the beautiful TorFlow visualization for the Roster incentive project here:
http://www.tor-roster.org/family_detail/10E13E340651D0EF66B4DEBF610B3C0981168107
Is there a way to make the particle flows between two relays be a different color?
Currently, all the colours are set from the configuration file here:
https://github.com/unchartedsoftware/torflow/blob/master/public/javascripts/config.js
There isn't a way right now to colour particles for specific relays.
Is there a way to only display specific relays? Or alternatively, only display specific cities?
That would require you to change some code. The particle colours are same regardless of what relay they're coming from.
As for cities, we don't store city information. Each relay has a lat/lng associated it though, so it would be possible if you knew the lat/lng bounds for the cities you were interested in.
If you look at the webworker code that generates the attribute buffers you can see we use four floats for the x/y of the relays, and four floats for two cubic bezier control points. You could always encode another four floats for the RGBA values based on which relays are used.
You would also need to adjust the VertexBuffer object in particlelayer.js to store these colors, and the WebGL shaders here to use them.