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

Vega vis needs to have visible fonts for dark theme dashboard #73675

Merged
merged 14 commits into from
Aug 17, 2020

Conversation

VladLasitsa
Copy link
Contributor

@VladLasitsa VladLasitsa commented Jul 29, 2020

Closes #16456

Summary

Added support for dark theme in vega:

Now we have this color behavior on dark mode:

image

And light theme:

image

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@VladLasitsa VladLasitsa requested a review from timroes July 29, 2020 14:39
@VladLasitsa
Copy link
Contributor Author

@elasticmachine merge upstream

@VladLasitsa VladLasitsa marked this pull request as ready for review July 31, 2020 07:26
@VladLasitsa VladLasitsa requested a review from a team July 31, 2020 07:26
@VladLasitsa VladLasitsa self-assigned this Jul 31, 2020
@VladLasitsa VladLasitsa added Feature:NP Migration release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.10.0 v8.0.0 labels Jul 31, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@VladLasitsa
Copy link
Contributor Author

@elasticmachine merge upstream

@timroes
Copy link
Contributor

timroes commented Aug 4, 2020

@elastic/datavis Would you mind giving this a look (and potentially review)? Since we're changing things around chart colors here, I'd like to get your feedback.

@markov00 markov00 self-requested a review August 4, 2020 15:43
Copy link
Member

@markov00 markov00 left a comment

Choose a reason for hiding this comment

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

As described in my comment, the gridline is too pronounced and we should introduce/reuse the existing EUI chart theme for that.

Please also check that there are a few missing customizable configurations like the group-title and group-subtitle that can be used and that needs the same theme default as the others

src/plugins/vis_type_vega/public/data_model/vega_parser.ts Outdated Show resolved Hide resolved
@VladLasitsa
Copy link
Contributor Author

@elasticmachine merge upstream

@timroes
Copy link
Contributor

timroes commented Aug 6, 2020

We should not inline those color codes in Kibana. If we cannot access them right now in EUI, we need to talk to EUI (or open PR there) to access them. It seems though like at least the createTheme is accessible from Kibana, so we could pull them out there. @markov00 might be able to know more.

@VladLasitsa
Copy link
Contributor Author

We should not inline those color codes in Kibana. If we cannot access them right now in EUI, we need to talk to EUI (or open PR there) to access them. It seems though like at least the createTheme is accessible from Kibana, so we could pull them out there. @markov00 might be able to know more.

I got needed colors. I checked which colors used in chart themes and used it.

@timroes
Copy link
Contributor

timroes commented Aug 8, 2020

We should not inline those color codes in Kibana. If we cannot access them right now in EUI, we need to talk to EUI (or open PR there) to access them. It seems though like at least the createTheme is accessible from Kibana, so we could pull them out there. @markov00 might be able to know more.

I got needed colors. I checked which colors used in chart themes and used it.

Yeap that once was on me, sorry. I reviewed on my phone and confused the test files with the source files.

@VladLasitsa
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Member

@markov00 markov00 left a comment

Choose a reason for hiding this comment

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

I've added one suggestion and requested a slight modification to include subtitle and use the right color for axis title

Comment on lines 661 to 662
this._setDefaultValue(euiThemeVars.euiColorDarkShade, 'config', 'style', 'guide-title', 'fill');
this._setDefaultValue(euiThemeVars.euiColorDarkShade, 'config', 'style', 'group-title', 'fill');
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
this._setDefaultValue(euiThemeVars.euiColorDarkShade, 'config', 'style', 'guide-title', 'fill');
this._setDefaultValue(euiThemeVars.euiColorDarkShade, 'config', 'style', 'group-title', 'fill');
this._setDefaultValue(euiThemeVars.euiColorDarkestShade, 'config', 'style', 'guide-title', 'fill');
this._setDefaultValue(euiThemeVars.euiColorDarkestShade, 'config', 'style', 'group-subtitle', 'fill');
this._setDefaultValue(euiThemeVars.euiColorDarkestShade, 'config', 'style', 'group-title', 'fill');

We should threat both the guide-title (the axis title) and the group-subtitle (used when the user wants a subtitle) with the same color as specified by EUI theme.

Copy link
Member

Choose a reason for hiding this comment

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

you can test the subtitle with this spec on vega:

"title": {
  "text": "Title Text",
  "subtitle": "Subtitle Text"
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

Choose a reason for hiding this comment

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

@VladLasitsa I think there you haven't fixed my suggestion to use euiColorDarkestShade (as in the current EUI theme) for all of the following styles: guide-title, group-subtitle and group-title.

@timroes timroes requested a review from markov00 August 13, 2020 08:04
Copy link
Contributor

@timroes timroes left a comment

Choose a reason for hiding this comment

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

Tested on Firefox Linux, Light and dark theme on the default Vega spec. Works as intended, Code LGTM

Copy link
Member

@markov00 markov00 left a comment

Choose a reason for hiding this comment

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

We should stick exactly to the color used by EUI, please check my comments below

Comment on lines 661 to 662
this._setDefaultValue(euiThemeVars.euiColorDarkShade, 'config', 'style', 'guide-title', 'fill');
this._setDefaultValue(euiThemeVars.euiColorDarkShade, 'config', 'style', 'group-title', 'fill');
Copy link
Member

Choose a reason for hiding this comment

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

@VladLasitsa I think there you haven't fixed my suggestion to use euiColorDarkestShade (as in the current EUI theme) for all of the following styles: guide-title, group-subtitle and group-title.

@VladLasitsa
Copy link
Contributor Author

@elasticmachine merge upstream

@VladLasitsa
Copy link
Contributor Author

We should stick exactly to the color used by EUI, please check my comments below

done

Copy link
Member

@markov00 markov00 left a comment

Choose a reason for hiding this comment

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

LGTM

@VladLasitsa VladLasitsa merged commit d5fd34e into elastic:master Aug 17, 2020
VladLasitsa added a commit to VladLasitsa/kibana that referenced this pull request Aug 17, 2020
…c#73675)

* Support dark theme in vega

* Fixed tests

* Fixed colors

* Fixed tests

* Fixed comment

* Fixed colors

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

async chunks size

id value diff baseline
visTypeVega 1.4MB +1.1KB 1.4MB

page load bundle size

id value diff baseline
visTypeVega 661.8KB +65.0B 661.7KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

VladLasitsa added a commit that referenced this pull request Aug 18, 2020
#75139)

* Support dark theme in vega

* Fixed tests

* Fixed colors

* Fixed tests

* Fixed comment

* Fixed colors

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:NP Migration release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vega vis needs to have visible fonts for dark theme dashboard
5 participants