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

feat(a11y): allow user to add optional semantic meaning to goal/gauge charts #1218

Merged
merged 24 commits into from
Jul 8, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
91bb738
feat: initial commit
rshen91 May 27, 2021
c63b88b
test: update snapshot
rshen91 Jun 10, 2021
a105604
fix: merge changes
rshen91 Jun 22, 2021
6245b05
feat: add goal chart data and labels
rshen91 Jun 22, 2021
0dc89a6
test: add test
rshen91 Jun 22, 2021
ebd8af7
fix: remove min max target value from not goal types
rshen91 Jun 22, 2021
9c90b45
feat: add semantic meaning to goal/gauge charts
rshen91 Jun 23, 2021
37acc83
fix: chart api
rshen91 Jun 23, 2021
503cb9d
fix: api chart extract
rshen91 Jun 23, 2021
91f126b
test: add story snapshot
rshen91 Jun 23, 2021
f63c09c
feat: clean up semantic representation in goals rendering
rshen91 Jun 23, 2021
5620c16
refactor: add goal semantic description component
rshen91 Jun 23, 2021
aba9bae
test: add tests
rshen91 Jun 23, 2021
7c4e432
style: clean up code per code review
rshen91 Jun 23, 2021
0c77eec
Merge remote-tracking branch 'upstream/master' into goal-semantics
rshen91 Jun 30, 2021
3f0681b
style: fix test
rshen91 Jun 30, 2021
250ab2c
fix: update per code review
rshen91 Jun 30, 2021
b5a1364
refactor: change name of prop and data type
rshen91 Jul 1, 2021
4045a9c
fix: update chart api
rshen91 Jul 1, 2021
416e18d
refactor: refactor so bands includes text
rshen91 Jul 1, 2021
50b2991
Merge remote-tracking branch 'upstream/master' into goal-semantics
rshen91 Jul 6, 2021
22ef1a6
fix: update the description so correct band label shown
rshen91 Jul 6, 2021
0bfdec4
refactor: code review
rshen91 Jul 7, 2021
3702ecf
fix: pull lowest value
rshen91 Jul 7, 2021
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
Prev Previous commit
Next Next commit
fix: merge changes
  • Loading branch information
rshen91 committed Jun 22, 2021
commit a10560458ce92ef0ee7e6e5fc3f3240e8432ad3b
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { createCustomCachedSelector } from '../../../../state/create_selector';
import { geometries } from './geometries';

/** @internal */
export type GoalChartData = {
maximum: number;
minimum: number;
target: number;
value: number;
};

/** @internal */
export const getGoalChartDataSelector = createCustomCachedSelector(
[geometries],
(geoms): GoalChartData => {
const goalChartData: GoalChartData = {
maximum: geoms.bulletViewModel.highestValue,
minimum: geoms.bulletViewModel.lowestValue,
target: geoms.bulletViewModel.target,
value: geoms.bulletViewModel.actual,
};
return goalChartData;
},
);

/** @internal */
export const getGoalChartLabelsSelector = createCustomCachedSelector([geometries], (geoms) => {
return { label: geoms.bulletViewModel.labelMajor, minorLabel: geoms.bulletViewModel.labelMinor };
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import React, { MouseEvent, RefObject } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators, Dispatch } from 'redux';

import { ScreenReaderSummary } from '../../../../components/accessibility';
import { ScreenReaderPartitionTable } from '../../../../components/accessibility/partitions_data_table';
import { ScreenReaderSummary, ScreenReaderPartitionTable } from '../../../../components/accessibility';
import { clearCanvas } from '../../../../renderers/canvas';
import { SettingsSpec } from '../../../../specs/settings';
import { onChartRendered } from '../../../../state/actions/chart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
* under the License.
*/

import createCachedSelector from 're-reselect';

import { geometries } from '../../chart_types/goal_chart/state/selectors/geometries';
import { getChartIdSelector } from '../../state/selectors/get_chart_id';
import { createCustomCachedSelector } from '../../state/create_selector';

/** @internal */
export type GoalChartData = {
Expand All @@ -31,9 +29,9 @@ export type GoalChartData = {
};

/** @internal */
export const getGoalChartDataSelector = createCachedSelector(
export const getGoalChartDataSelector = createCustomCachedSelector(
[geometries],
(geoms): GoalChartData => {
(geoms: any): GoalChartData => {
const goalChartData: GoalChartData = {
maximum: geoms.bulletViewModel.highestValue,
minimum: geoms.bulletViewModel.lowestValue,
Expand All @@ -42,4 +40,4 @@ export const getGoalChartDataSelector = createCachedSelector(
};
return goalChartData;
},
)(getChartIdSelector);
);
1 change: 1 addition & 0 deletions packages/charts/src/components/accessibility/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@

/* @internal */
export { ScreenReaderSummary } from './screen_reader_summary';
export { ScreenReaderPartitionTable } from './partitions_data_table';