Skip to content
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

add colors for gui #486

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pyiron_workflow/nodes/composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,11 @@ def color(self) -> str:
"""For drawing the graph"""
return SeabornColors.brown

@property
def gui_color(self) -> str:
"""For nodes in the gui"""
return "#eacf9f"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it nice that @liamhuber so far mostly followed the convention of naming the color and return the variable. Do you maybe want to do that as well?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added variables for the colors, but did not define them in the Seaborn class (which is in pyiron_snippets). I think the Seaborn colors follow some pre-defined color palette . Is that OK?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And where would you like the example picture?

Copy link
Member

@samwaseda samwaseda Oct 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the PR comment.

Actually you might also need to explain either in the code (better) or in the PR how this property is used.


@property
def graph_as_dict(self) -> dict:
"""
Expand Down
5 changes: 5 additions & 0 deletions pyiron_workflow/nodes/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,11 @@ def color(self) -> str:
"""For drawing the graph"""
return SeabornColors.green

@property
def gui_color(self) -> str:
"""For nodes in the gui"""
return "#a2ea9f"

@classmethod
def _extra_info(cls) -> str:
return getsource(cls.node_function)
Expand Down
5 changes: 5 additions & 0 deletions pyiron_workflow/nodes/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ def color(self) -> str:
"""For drawing the graph"""
return SeabornColors.blue

@property
def gui_color(self) -> str:
"""For nodes in the gui"""
return "#cb9fea"


class FromManyInputs(Transformer, ABC):
_output_name: ClassVar[str] # Mandatory attribute for non-abstract subclasses
Expand Down
Loading