Skip to content

Commit

Permalink
fix: merge changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rshen91 committed Jun 22, 2021
1 parent c63b88b commit a105604
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 8 deletions.
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';

0 comments on commit a105604

Please sign in to comment.