-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(bullet): add a11y summary and debugState (#2352)
- Loading branch information
1 parent
c433d8c
commit 49a1b35
Showing
10 changed files
with
129 additions
and
9 deletions.
There are no files selected for viewing
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
43 changes: 43 additions & 0 deletions
43
packages/charts/src/chart_types/bullet_graph/selectors/get_debug_state.ts
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,43 @@ | ||
/* | ||
* 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 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 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { getActiveValue } from './get_active_value'; | ||
import { getBulletSpec } from './get_bullet_spec'; | ||
import { getPanelDimensions } from './get_panel_dimensions'; | ||
import { createCustomCachedSelector } from '../../../state/create_selector'; | ||
import { BulletDebugStateRow, DebugState } from '../../../state/types'; | ||
|
||
/** @internal */ | ||
export const getDebugStateSelector = createCustomCachedSelector( | ||
[getPanelDimensions, getActiveValue, getBulletSpec], | ||
(dimensions, activeValue, spec): DebugState => { | ||
return { | ||
bullet: { | ||
rows: dimensions.rows.map((row) => { | ||
return row.map((d): BulletDebugStateRow | null => { | ||
if (!d) return d; | ||
|
||
const { datum, colorBands, ticks, domain } = d; | ||
const { title, subtitle, target, value } = datum; | ||
return { | ||
title, | ||
subtitle, | ||
target, | ||
value, | ||
subtype: spec.subtype, | ||
colorBands: colorBands.map((b) => b.color), | ||
ticks, | ||
domain, | ||
}; | ||
}); | ||
}), | ||
activeValue: activeValue?.value, | ||
}, | ||
}; | ||
}, | ||
); |
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
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