Skip to content

Adding dark mode for pipeline diagram #26364

@solo-driven

Description

@solo-driven

Describe the workflow you want to enable

The current diagram truly hurts eyes when everything else in dark mode. It would be a very nice feature to add.
Screenshot 2023-05-14 100107

Describe your proposed solution

Currently I do it this way, but I bet there could have been a better way.

`
def display_dark(pipeline, text_color="#3bd5eb"):
replacements = {
"color: black": f"color: {text_color};",
"background-color: white": "background-color: transparent",
'class="sk-toggleable__label sk-toggleable__label-arrow"': 'class="sk-toggleable__label sk-toggleable__label-arrow" style="background-color: #222831;"',
"#696969;": "#e6e6e6;",
"#d4ebff;": "#1a1a1a;",
"background-color: #f0f8ff;": "background-color: #393e46",
"background-color: #d4ebff;": "background-color: #1a1a1a;",
"color: #e6e6e6;": "color: #b3b3b3;"
}

html = estimator_html_repr(pipeline)

for old, new in replacements.items():
    html = html.replace(old, new)
display(HTML(html))

`
Screenshot 2023-05-14 100143

Describe alternatives you've considered, if relevant

No response

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions