-
Notifications
You must be signed in to change notification settings - Fork 6
fix: inherit color from source artist #606
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
base: main
Are you sure you want to change the base?
Changes from all commits
261588b
151842c
0c2d146
b68534d
37f3140
8143abb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -503,6 +503,11 @@ def update_controls(self): | |
| self._nodes.clear() | ||
|
|
||
| self.update_state() | ||
| if self._view.colormapper is None: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it have to be done every time we update the controls or only when a cut is added? Meaning: can we avoid doing this also when a cut is removed? Edit: looking more at the logic, I think this has to be called here. |
||
| for source_id, node in self._nodes.items(): | ||
| color = self._view.artists[source_id].single_color | ||
| if color is not None: | ||
| self._view.artists[node.id].color = color | ||
|
|
||
| def _set_opacity(self, change: dict[str, Any]): | ||
| """ | ||
|
|
||
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.
I think it would be useful if we can fix something else here also. Currently, if you make a scatter
if you try to update the color of the artist with
it fails, because the setter expects a numpy array with the correct size.
Can we support the above by doing more work here depending on input type/shape?
If it's a string or a tuple or a 1d numpy array (of length 3 or 4), then broadcast to the full array using
self._make_colors, and just set the array otherwise?self._colorshould then probably be updated in the setter also.We could then maybe add an accessor to the
self._colorlikesingle_colororhtml_colorwhich would beNoneif a colormapper is in use (html_coloris probably not great because we store it as a rgb, andrgb_colorcould be confusing because the current.coloralso returns rgb colors, just a large array of them).Below in
clip3d.py, we could then just have something like