Skip to content

Commit 4740929

Browse files
committed
ChartFieldAggregateOptions: Remove asOverlay option
1 parent be5a96d commit 4740929

File tree

3 files changed

+2
-27
lines changed

3 files changed

+2
-27
lines changed

packages/components/src/internal/components/chart/ChartFieldAggregateOptions.tsx

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import React, { FC, memo, useCallback, useMemo } from 'react';
2-
import { OverlayTrigger } from '../../OverlayTrigger';
3-
import { Popover } from '../../Popover';
42
import { RadioGroupInput } from '../forms/input/RadioGroupInput';
53

64
import { ChartConfig, ChartConfigSetter, ChartFieldInfo, ChartTypeInfo } from './models';
@@ -22,15 +20,14 @@ const ERROR_BAR_TYPES = [
2220
];
2321

2422
interface OwnProps {
25-
asOverlay?: boolean; // TODO: defaults to true, but is always passed as false. Can be removed?
2623
chartConfig: ChartConfig;
2724
field: ChartFieldInfo;
2825
selectedType: ChartTypeInfo;
2926
setChartConfig: ChartConfigSetter;
3027
}
3128

3229
export const ChartFieldAggregateOptions: FC<OwnProps> = memo(props => {
33-
const { asOverlay = true, chartConfig, field, selectedType, setChartConfig } = props;
30+
const { chartConfig, field, selectedType, setChartConfig } = props;
3431
const yMeasure = Array.isArray(chartConfig.measures.y) ? chartConfig.measures.y[0] : chartConfig.measures.y;
3532
// Some older charts stored aggregate as an object that looked like: { label: 'Mean', value: 'MEAN' }
3633
const aggregateValue = Utils.isObject(yMeasure.aggregate) ? yMeasure.aggregate.value : yMeasure.aggregate;
@@ -84,7 +81,7 @@ export const ChartFieldAggregateOptions: FC<OwnProps> = memo(props => {
8481
const onAggregateChange = useCallback((_: never, value: string) => onChange('aggregate', value), [onChange]);
8582
const onErrorBarValueChange = useCallback((value: string) => onChange('errorBars', value), [onChange]);
8683

87-
const inputs = (
84+
return (
8885
<>
8986
<div>
9087
<label>
@@ -114,24 +111,5 @@ export const ChartFieldAggregateOptions: FC<OwnProps> = memo(props => {
114111
</div>
115112
</>
116113
);
117-
118-
if (!asOverlay) {
119-
return inputs;
120-
}
121-
122-
return (
123-
<div className="field-option-icon">
124-
<OverlayTrigger
125-
overlay={
126-
<Popover id="chart-field-option-popover" placement="left">
127-
{inputs}
128-
</Popover>
129-
}
130-
triggerType="click"
131-
>
132-
<span className="fa fa-gear" />
133-
</OverlayTrigger>
134-
</div>
135-
);
136114
});
137115
ChartFieldAggregateOptions.displayName = 'ChartFieldAggregateOptions';

packages/components/src/internal/components/chart/ChartFieldOption.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ export const ChartFieldOption: FC<OwnProps> = memo(props => {
129129
>
130130
{measure && showAggregateOptions && (
131131
<ChartFieldAggregateOptions
132-
asOverlay={false}
133132
chartConfig={chartConfig}
134133
field={field}
135134
selectedType={selectedType}

packages/components/src/internal/components/chart/ChartFieldRangeScaleOptions.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ interface OwnProps extends PropsWithChildren {
2323

2424
export const ChartFieldRangeScaleOptions: FC<OwnProps> = memo(props => {
2525
const { scale, onScaleChange, showScaleTrans, children } = props;
26-
const placement = useMemo(() => (!showScaleTrans && children ? 'left' : 'bottom'), [showScaleTrans, children]);
27-
2826
const scaleTransOptions = useMemo(() => {
2927
return SCALE_TRANS_TYPES.map(option => ({ ...option, selected: scale.trans === option.value }));
3028
}, [scale.trans]);

0 commit comments

Comments
 (0)