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

chore: fully remove deprecated charts theming exports #7682

Merged
merged 4 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/eui/changelogs/upcoming/7682.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**Breaking changes**

- Removed deprecated `EUI_CHARTS_THEME_DARK`, `EUI_CHARTS_THEME_LIGHT` and `EUI_SPARKLINE_THEME_PARTIAL` exports

22 changes: 0 additions & 22 deletions packages/eui/scripts/compile-eui.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const IGNORE_TESTENV = [
];
const IGNORE_PACKAGES = [
'**/react-datepicker/test/**/*.js',
'**/themes/charts/themes.ts',
];

function compileLib() {
Expand Down Expand Up @@ -207,27 +206,6 @@ function compileBundle() {
}
);
console.log(chalk.green('✔ Finished test utils files'));

console.log('Building chart theme module...');
execSync('webpack --config=src/themes/charts/webpack.config.js', {
stdio: 'inherit',
});
dtsGenerator({
prefix: '',
out: 'dist/eui_charts_theme.d.ts',
baseDir: path.resolve(__dirname, '..', 'src/themes/charts/'),
files: ['themes.ts'],
resolveModuleId() {
return '@elastic/eui/dist/eui_charts_theme';
},
resolveModuleImport(params) {
if (params.importedModuleId === '../../components/common') {
return '@elastic/eui/src/components/common';
}
return null;
},
});
console.log(chalk.green('✔ Finished chart theme module'));
}

compileLib();
Expand Down
1 change: 0 additions & 1 deletion packages/eui/scripts/dtsgenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const generator = dtsGenerator({
'**/*.stories.{ts,tsx}',
'**/*.mock.{ts,tsx}',
'**/__mocks__/*',
'src/themes/charts/*', // A separate d.ts file is generated for the charts theme file
'src/test/**/*', // Separate d.ts files are generated for test utils
'src-docs/**/*', // Don't include src-docs
'**/*.mdx', // Don't include storybook mdx files
Expand Down
33 changes: 27 additions & 6 deletions packages/eui/src-docs/src/views/elastic_charts/sparklines.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import {
Tooltip,
LineSeries,
AreaSeries,
PartialTheme,
} from '@elastic/charts';

import { EUI_SPARKLINE_THEME_PARTIAL } from '../../../../src/themes/charts/themes';

import {
EuiPanel,
EuiStat,
Expand All @@ -28,6 +27,28 @@ import {
} from '../../../../src/services';
import { useChartBaseTheme } from './utils/use_chart_base_theme';

/**
* Example sparkline styles to match `ThemeService.useSparklineOverrides` from kibana `charts` plugin
*
* See https://github.com/elastic/kibana/blob/82fdf0414d61a1419038eed395bcdf941d72a58c/src/plugins/charts/public/services/theme/theme.ts#L55-L77
*/
const sparklineOverrides: PartialTheme = {
lineSeriesStyle: {
point: {
visible: false,
strokeWidth: 1,
radius: 1,
},
},
areaSeriesStyle: {
point: {
visible: false,
strokeWidth: 1,
radius: 1,
},
},
};

export const TIME_DATA_SMALL = [
[1551438630000, 8.515625],
[1551438660000, 10.796875],
Expand Down Expand Up @@ -60,7 +81,7 @@ export default () => {
<Chart size={{ height: 64 }}>
<Settings
baseTheme={chartBaseTheme}
theme={EUI_SPARKLINE_THEME_PARTIAL}
theme={sparklineOverrides}
showLegend={false}
/>
<Tooltip type="none" />
Expand Down Expand Up @@ -91,7 +112,7 @@ export default () => {
<Chart size={{ height: 48 }}>
<Settings
baseTheme={chartBaseTheme}
theme={EUI_SPARKLINE_THEME_PARTIAL}
theme={sparklineOverrides}
showLegend={false}
/>
<Tooltip type="none" />
Expand Down Expand Up @@ -130,7 +151,7 @@ export default () => {
<Chart size={{ height: 16 }}>
<Settings
baseTheme={chartBaseTheme}
theme={EUI_SPARKLINE_THEME_PARTIAL}
theme={sparklineOverrides}
showLegend={false}
/>
<Tooltip type="none" />
Expand Down Expand Up @@ -161,7 +182,7 @@ export default () => {
<Chart size={{ height: 48 }}>
<Settings
baseTheme={chartBaseTheme}
theme={EUI_SPARKLINE_THEME_PARTIAL}
theme={sparklineOverrides}
showLegend={false}
/>
<Tooltip type="none" />
Expand Down
251 changes: 0 additions & 251 deletions packages/eui/src/themes/charts/themes.ts

This file was deleted.

Loading
Loading