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

Alternate themes for the dashboard #2305

Open
mrocklin opened this issue Oct 10, 2018 · 2 comments
Open

Alternate themes for the dashboard #2305

mrocklin opened this issue Oct 10, 2018 · 2 comments
Labels
diagnostics enhancement Improve existing functionality or make things work better

Comments

@mrocklin
Copy link
Member

mrocklin commented Oct 10, 2018

People may prefer different themes for the dashboard. This both allows individual style to come out, and also exposes a nice laboratory for others to explore and create better visual style than we can. (which we can then steal as defaults).

There are a few places where we currently specify colors and styling:

  1. In the bokeh theme.yaml . This determines the style of the bokeh figures, except what we specify in code
  2. In the code, where we specify colors explicitly (for example we currently have hard-coded values for "blue", "red" and "Viridis11" within our codecase. See
    try:
    color = Viridis11[level]
    except (KeyError, IndexError):
    color = 'black'
  3. In static/css/base.css where we specify background color, and color for the navbar

Currently if you want to build a new theme you'll need to touch all of these. Once you've built that theme it's not easy to switch back and forth.

What is the right way to represent styling so that people can easily experiment with it and switch back and forth without having to repackage things?

cc @canavandl

@mrocklin
Copy link
Member Author

mrocklin commented Oct 10, 2018

Here is a proposal

We can put Bokeh's theme.yaml and a few other elements into a Dask config file (just yaml files that we store in ~/.config/dask/). This file might be organized as follows:

dashboard:
  theme: name-of-theme

  name-of-theme: 
    css: path/to/my.css
    colors:
      task-stream-palette: Viridis11
      good: blue
      stressed: red
      critical: black

    bokeh-theme:
      ...  # normal bokeh theme.yaml follows

  name-of-second-theme:
    ...

  name-of-third-theme:
    ..

We'll then have to access these elements through dask.config.get('dashboard'), pick out the right sub-yaml block to read, and then refer to that template throughout files like bokeh/scheduler.py whenever we pick out colors or set templates.

People can define themes here and can easily switch between them (we can ship a couple along with dask). People can move around their own custom themes by sharing a yaml file and dropping it in ~/.config/dask/.

@openSourcerer9000
Copy link

Following

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagnostics enhancement Improve existing functionality or make things work better
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants