Skip to content

faq 109547490

Billy Charlton edited this page Sep 5, 2018 · 2 revisions

What is the best way to implement a custom coloring scheme in otfvis?

by Henrik Bette on 2017-05-19 11:09:49


I would like to implement a coloring scheme, that I can customize whenever I need to. Is there a standard way to do it?


Comments: 2


Re: What is the best way to implement a custom coloring scheme in otfvis?

by Kai Nagel on 2017-05-24 14:39:45

Nope, sorry.  If you look at OGLAgentPointLayer, you can see how it is done.  Should be easy to make it pluggable, but is not there yet.  Do you want to try and submit as a patch?  Roughly the following steps:

  1. replace the Color in addAgent by an interface, e.g. OTFVisColoringScheme.
  2. put the static method coloring schemes into implementations of that class
  3. put something like bind(OTFVisColoringScheme.class).to(DefaultOTFVisColoringScheme.class) into OTFVisLiveModule.
  4. Somehow get this information passed through to OGLAgentPointLayer.  (This looks like the hardest part.)

As an alternative, you could just change OGLAgentPointLayer in a checkout that you have.  Not beautiful, but pragmatic.

Maybe someone else has a better idea.


Re: What is the best way to implement a custom coloring scheme in otfvis?

by Henrik Bette on 2017-06-14 13:23:56

Thank you!

I am working with the pragmatic approach right now. Might try to implement it later.

Clone this wiki locally