Skip to content

Commit

Permalink
Revert " [Maps] unify legend for percentiles, interpolate, and custom…
Browse files Browse the repository at this point in the history
… ordinal color breaks (#85343)"

This reverts commit 85dae26.
  • Loading branch information
Tyler Smalley committed Dec 15, 2020
1 parent a9a06ff commit c3770fd
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 137 deletions.
8 changes: 8 additions & 0 deletions x-pack/plugins/maps/common/i18n_getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ import { i18n } from '@kbn/i18n';
import { $Values } from '@kbn/utility-types';
import { ES_SPATIAL_RELATIONS } from './constants';

export const UPTO = i18n.translate('xpack.maps.upto', {
defaultMessage: 'up to',
});

export const GREAT_THAN = i18n.translate('xpack.maps.greatThan', {
defaultMessage: 'greater than',
});

export function getAppTitle() {
return i18n.translate('xpack.maps.appTitle', {
defaultMessage: 'Maps',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const ColorStopsOrdinal = ({
return error;
};

const renderStopInput = (stop, onStopChange, index) => {
const renderStopInput = (stop, onStopChange) => {
function handleOnChangeEvent(event) {
const sanitizedValue = parseFloat(event.target.value);
const newStopValue = isNaN(sanitizedValue) ? '' : sanitizedValue;
Expand All @@ -50,10 +50,9 @@ export const ColorStopsOrdinal = ({
aria-label={i18n.translate('xpack.maps.styles.colorStops.ordinalStop.stopLabel', {
defaultMessage: 'Stop',
})}
value={index === 0 ? '' : stop}
value={stop}
onChange={handleOnChangeEvent}
compressed
disabled={index === 0}
/>
);
};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ describe('get mapbox color expression (via internal _getMbColor)', () => {
expect(colorProperty._getMbColor()).toBeNull();
});

describe('interpolate color ramp', () => {
describe('pre-defined color ramp', () => {
test('should return null when color ramp is not provided', async () => {
const dynamicStyleOptions = {
type: COLOR_MAP_TYPE.ORDINAL,
Expand Down Expand Up @@ -457,16 +457,7 @@ describe('get mapbox color expression (via internal _getMbColor)', () => {
const colorProperty = makeProperty(dynamicStyleOptions);
expect(colorProperty._getMbColor()).toEqual([
'step',
[
'coalesce',
[
'case',
['==', ['feature-state', 'foobar'], null],
9,
['max', ['min', ['to-number', ['feature-state', 'foobar']], 100], 10],
],
9,
],
['coalesce', ['feature-state', 'foobar'], 9],
'rgba(0,0,0,0)',
10,
'#f7faff',
Expand All @@ -492,16 +483,7 @@ describe('get mapbox color expression (via internal _getMbColor)', () => {
const colorProperty = makeProperty(dynamicStyleOptions, undefined, field);
expect(colorProperty._getMbColor()).toEqual([
'step',
[
'coalesce',
[
'case',
['==', ['get', 'foobar'], null],
9,
['max', ['min', ['to-number', ['get', 'foobar']], 100], 10],
],
9,
],
['coalesce', ['get', 'foobar'], 9],
'rgba(0,0,0,0)',
10,
'#f7faff',
Expand Down
Loading

0 comments on commit c3770fd

Please sign in to comment.