Skip to content

Commit

Permalink
chore: reclaim charts theme ownership from eui (elastic#2175)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: elastic charts theme renamed to `LEGACY_DARK_THEME` and `LEGACY_LIGHT_THEME` in favor of the main `DARK_THEME` and `LIGHT_THEME` which was merged with eui theme overrides. These new themes are now default.
  • Loading branch information
nickofthyme authored Oct 24, 2023
1 parent 418acce commit 422c7d5
Show file tree
Hide file tree
Showing 48 changed files with 1,755 additions and 385 deletions.
3 changes: 1 addition & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@
<!-- Delete any items that are not applicable to this PR. -->
- [ ] The proper **chart type** label has been added (e.g. `:xy`, `:partition`)
- [ ] The proper **feature** labels have been added (e.g. `:interactions`, `:axis`)
- [ ] The `:theme` label has been added and the `@elastic/eui-team` team has been pinged when there are `Theme` API changes
- [ ] All related issues have been linked (i.e. `closes #123`, `fixes #123`)
- [ ] New public API exports have been added to `packages/charts/src/index.ts`
- [ ] Unit tests have been added or updated to match the most common scenarios
- [ ] The proper documentation and/or storybook story has been added or updated
- [ ] The code has been checked for cross-browser compatibility (Chrome, Firefox, Safari, Edge)
- [ ] Visual changes have been tested with all available themes including `dark`, `light`, `eui-dark` & `eui-light`
- [ ] Visual changes have been tested with `light` and `dark` themes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions packages/charts/api/charts.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,24 @@ export class Chart extends React_2.Component<ChartProps, ChartState> {
render(): JSX.Element;
}

// @public
export interface ChartBaseColors {
// (undocumented)
darkestShade: string;
// (undocumented)
darkShade: string;
// (undocumented)
emptyShade: string;
// (undocumented)
lightestShade: string;
// (undocumented)
lightShade: string;
// (undocumented)
mediumShade: string;
// (undocumented)
title: string;
}

// @public (undocumented)
export interface ChartProps {
// (undocumented)
Expand Down Expand Up @@ -709,6 +727,9 @@ export interface CustomTooltipProps<D extends BaseDatum = Datum, SI extends Seri
// @public (undocumented)
export type CustomXDomain = (DomainRange & Pick<LogScaleOptions, 'logBase'>) | OrdinalDomain;

// @public (undocumented)
export const DARK_BASE_COLORS: ChartBaseColors;

// @public (undocumented)
export const DARK_THEME: Theme;

Expand Down Expand Up @@ -1579,6 +1600,12 @@ export const LayoutDirection: Readonly<{
// @public (undocumented)
export type LayoutDirection = $Values<typeof LayoutDirection>;

// @public @deprecated
export const LEGACY_DARK_THEME: Theme;

// @public @deprecated
export const LEGACY_LIGHT_THEME: Theme;

// @public
export interface LegacyAnimationConfig {
// @alpha (undocumented)
Expand Down Expand Up @@ -1683,6 +1710,9 @@ export interface LegendStyle {
verticalWidth: number;
}

// @public (undocumented)
export const LIGHT_BASE_COLORS: ChartBaseColors;

// @public (undocumented)
export const LIGHT_THEME: Theme;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { createStore, Store } from 'redux';

import { partitionMultiGeometries } from './geometries';
import { createOnElementClickCaller } from './on_element_click_caller';
import { GOLDEN_RATIO } from '../../../../common/constants';
import { Predicate } from '../../../../common/predicate';
import { MockGlobalSpec, MockSeriesSpec } from '../../../../mocks/specs';
import { SettingsSpec, GroupBySpec, SmallMultiplesSpec } from '../../../../specs';
Expand Down Expand Up @@ -206,6 +207,11 @@ describe('Picked shapes selector', () => {
const onClickListener = jest.fn();
addSeries(store, sunburstSpec, {
onElementClick: onClickListener,
theme: {
partition: {
outerSizeRatio: 1 / GOLDEN_RATIO,
},
},
});
const geometries = partitionMultiGeometries(store.getState())[0];
expect(geometries?.quadViewModel).toHaveLength(6);
Expand Down
Loading

0 comments on commit 422c7d5

Please sign in to comment.