[Maps] EUI Visual Refresh Integration#204434
Conversation
|
Pinging @elastic/kibana-presentation (Team:Presentation) |
There was a problem hiding this comment.
circleStyle is defined in props but never used in props.
There was a problem hiding this comment.
I am not sure about the direction where EUI themes are only available in a react component. There are times when we need access to EUI themes outside of a react component. For example, to get hex codes to pass to map-libre. I think we need to loop in @elastic/kibana-design and have a discussion about their plans to deprecate euiThemeVars as this will not work for maps and external libraries like maplibre.
There was a problem hiding this comment.
How about removing circleStyle const here
There was a problem hiding this comment.
Fyi, we realized that there are usages where a non-react way to get theme tokens are still required.
We'll not deprecate it completely, but we deprecate it for react components where euiTheme should be used.
There was a problem hiding this comment.
Then use circleStyle from props here.
There was a problem hiding this comment.
Now that MasksByFieldOrigin is a react component, how about moving it into a separate file?
There was a problem hiding this comment.
Looks like euiTheme is unused
There was a problem hiding this comment.
'textSubdued' is not going to work. This value is passed to maplibre for rendering and must be a hex value. For example, this is what a map looks like with a value of 'textSubdued'. The reason being is that OTHER_CATEGORY_DEFAULT_COLOR_TOKEN is used to create a maplibre expression. The expression is invalid with a value of 'textSubdued' so maplibre does not include the expression and all styling is lost.
This should loop in @elastic/eui-team |
3a25a3c to
0c4e9a4
Compare
61f662d to
59afe56
Compare
189fe21 to
51ebf31
Compare
There was a problem hiding this comment.
@nreese Is it okay if we just hard code this color hex for the default other category color? It looks fine in both light and dark mode, and otherwise the user can change the color if they're not happy with it. Then we can avoid the huge refactor necessary to access euiTheme from parts of maps that aren't in React.


There was a problem hiding this comment.
Using a static value is ok. How about using #cad3e2, its the current value for euiThemeVars.euiColorLightShade. #516381 is very dark with dark themed tiles.
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate' Fix jest tests BROKEN Switch to euiThemeGetColor [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' Remove vector layer changes Remove console log Undo default map changes [CI] Auto-commit changed files from 'node scripts/yarn_deduplicate' fix tsconfig Remove vector layer changes Fix types [CI] Auto-commit changed files from 'node scripts/yarn_deduplicate' Fix tests Change other category swatches Change category swatches
| ); | ||
|
|
||
| useEffect(() => { | ||
| mapSettings$.next({ |
There was a problem hiding this comment.
Re-setting backgroundColor removes user selected background color.
To view problem
- create a new map
- remove baselayer
- add EMS boundaries world country layer.
- Clicking "settings" in map top nave and provide a background color.
- add map to dashboard, save dashboard.
- re-open dashboard. Notice how custom background color is removed.
There was a problem hiding this comment.
Oh yeah I'll remove this bit of code. I opted to make the default background color transparent instead of having to pass an EUI color into the default map settings object, which also fixes the white flash that you see on some maps in dark mode.
| return { | ||
| api, | ||
| Component: () => { | ||
| const { euiTheme } = useEuiTheme(); |
There was a problem hiding this comment.
euiTheme can be removed since its no longer used.
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
|
nreese
left a comment
There was a problem hiding this comment.
kibana-presentation changes LGTM. Thanks for removing euiThemes from maps
code review, tested in chrome
|
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/12939436185 |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |



Summary
Related to #203132.
Closes #204591.
This replaces all references to euiThemeVars in favor of the useEuiTheme hook in maps.
Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesIdentify risks
Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.