torflow icon indicating copy to clipboard operation
torflow copied to clipboard

Wish to color particles originating from specific relays

Open virgil opened this issue 9 years ago • 4 comments

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?

virgil avatar Mar 10 '16 14:03 virgil

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.

chris-dickson avatar Mar 10 '16 14:03 chris-dickson

Is there a way to only display specific relays? Or alternatively, only display specific cities?

virgil avatar Mar 10 '16 15:03 virgil

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.

chris-dickson avatar Mar 10 '16 15:03 chris-dickson

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.

kbirk avatar Mar 10 '16 15:03 kbirk