-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Colordata #897
Colordata #897
Conversation
…gh to a StructuredataColormaker class. It also provides a mechanism for passing arbitrary data through to a Colormaker instance - see nglviewer#892
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are minor suggestions.
Maybe a major concern would be about the expected format as using an array should be favored to an inlined object.
Fix issue with manageColor introduced earlier in this branch (decorating bondColor with manageColor did not pass through the fromTo flag). Update examples
I'll have a look when I can. Thanks for the hard work @fredludlow! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Great additions, and clear examples.
Tested and approved
This is partly in response to #892, Adds a
colorData
parameter to representations, that colormakers may make use of, and a new builtinstructuredata
colormaker will make use of this where colorData is of shapeSee the examples color/atom-data and color/bond-data for usage.
I'm open to alternative ways to achieve this. One obvious alternative would be to allow arbitrary (atom-based?) data to be added to
Structure
objects. The main reason I didn't do this is that I couldn't think of a clean way to connect updates in the extra data to updating coloring of representations without some objects knowing more about others than they ought to. (IfStructure
sends a signal saying that indicates the data with attribute name "_some_fancy_model_output" has been updated, should a representation trigger a re-color?)Note that at runtime there's no check that you're passing in colorData of the shape described above, so it could be used to pass any data through to your custom colormaker - if that's preferable as a general method we could update the typing info to support it.
Comments (major changes as well as naming/nitpick etc) very welcome!