-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dependency @elastic/charts to v68.0.4 (main) (#203955)
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@elastic/charts](https://togithub.com/elastic/elastic-charts) | dependencies | patch | [`68.0.3` -> `68.0.4`](https://renovatebot.com/diffs/npm/@elastic%2fcharts/68.0.3/68.0.4) | This version of charts exports a helper function to correct an issue with the chart background color for the new Borealis theme. In addition to this we created a simplified hook `useElasticChartsTheme` from the `@kbn/charts-theme` package which reads the `euiTheme`. ```diff -import { Chart, Settings, LIGHT_THEME, DARK_THEME } from '@elastic/charts'; +import { Chart, Settings } from '@elastic/charts'; -import { useEuiTheme } from '@elastic/eui'; +import { useElasticChartsTheme } from '@kbn/charts-theme'; export function MyComponent() { - const euiTheme = useEuiTheme(); - const baseTheme = euiTheme.colorMode === 'LIGHT' ? LIGHT_THEME : DARK_THEME; + const baseTheme = useElasticChartsTheme(); return ( <Chart> <Settings baseTheme={baseTheme} {/* ... */} /> {/* ... */} </Chart> ) } ``` --- ### Release Notes <details> <summary>elastic/elastic-charts (@​elastic/charts)</summary> ### [`v68.0.4`](https://togithub.com/elastic/elastic-charts/blob/HEAD/CHANGELOG.md#6804-2024-12-11) [Compare Source](https://togithub.com/elastic/elastic-charts/compare/v68.0.3...v68.0.4) ##### Bug Fixes - **xy:** compute per series and global minPointsDistance ([#​2571](https://togithub.com/elastic/elastic-charts/issues/2571)) ([8dae2c1](https://togithub.com/elastic/elastic-charts/commit/8dae2c1f4c99146aa757b2d3eec9d72846248cc7)) ##### Performance Improvements - fix unnecessary re-render ([#​2573](https://togithub.com/elastic/elastic-charts/issues/2573)) ([feacfd6](https://togithub.com/elastic/elastic-charts/commit/feacfd6247b9580a8d32bc5d6284329b2035c1ba)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjUuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOlZpc3VhbGl6YXRpb25zIiwiYmFja3BvcnQ6cHJldi1taW5vciIsInJlbGVhc2Vfbm90ZTpza2lwIl19--> --------- Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> Co-authored-by: nickofthyme <[email protected]> Co-authored-by: adcoelho <[email protected]> Co-authored-by: Marco Vettorello <[email protected]> Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
4f4772f
commit 841bf73
Showing
39 changed files
with
174 additions
and
119 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# @kbn/charts-theme | ||
|
||
A temporary package to provide a hook for getting `@elastic/charts` theme based on `@elastic/eui` theme. | ||
|
||
To be refactored to be consumed from `ElasticChartsProvider`. | ||
|
||
```tsx | ||
import { useElasticChartsTheme } from '@kbn/charts-theme'; | ||
import { Chart, Settings } from '@elastic/charts'; | ||
|
||
export function MyComponent() { | ||
const baseTheme = useElasticChartsTheme(); | ||
|
||
return ( | ||
<Chart> | ||
<Settings | ||
baseTheme={baseTheme} | ||
{/* ... */} | ||
/> | ||
{/* ... */} | ||
</Chart> | ||
) | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
import { type Theme, getChartsTheme } from '@elastic/charts'; | ||
import { useEuiTheme } from '@elastic/eui'; | ||
import { useMemo } from 'react'; | ||
|
||
/** | ||
* A hook used to get the `@elastic/charts` theme based on the current eui theme. | ||
*/ | ||
export function useElasticChartsTheme(): Theme { | ||
const { euiTheme, colorMode } = useEuiTheme(); | ||
return useMemo( | ||
() => getChartsTheme(euiTheme.themeName, colorMode), | ||
[colorMode, euiTheme.themeName] | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
module.exports = { | ||
preset: '@kbn/test', | ||
rootDir: '../..', | ||
roots: ['<rootDir>/packages/kbn-charts-theme'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "shared-common", | ||
"id": "@kbn/charts-theme", | ||
"owner": "@elastic/kibana-visualizations" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "@kbn/charts-theme", | ||
"private": true, | ||
"version": "1.0.0", | ||
"license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"outDir": "target/types", | ||
"types": [ | ||
"jest", | ||
"node", | ||
"react" | ||
] | ||
}, | ||
"include": [ | ||
"**/*.ts", | ||
"**/*.tsx", | ||
], | ||
"exclude": [ | ||
"target/**/*" | ||
], | ||
"kbn_references": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ | |
"@kbn/datemath", | ||
"@kbn/ui-theme", | ||
"@kbn/i18n-react", | ||
"@kbn/charts-theme", | ||
], | ||
"exclude": ["target/**/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.