-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
11814c5
commit e7184b5
Showing
10 changed files
with
198 additions
and
96 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
38 changes: 38 additions & 0 deletions
38
src/legacy/ui/public/agg_types/controls/auto_precision.tsx
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,38 @@ | ||
/* | ||
* 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 React from 'react'; | ||
|
||
import { EuiSwitch, EuiFormRow } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { AggParamEditorProps } from 'ui/vis/editors/default'; | ||
|
||
function AutoPrecisionParamEditor({ value, setValue }: AggParamEditorProps<boolean>) { | ||
const label = i18n.translate('common.ui.aggTypes.changePrecisionLabel', { | ||
defaultMessage: 'Change precision on map zoom', | ||
}); | ||
|
||
return ( | ||
<EuiFormRow className="visEditorSidebar__aggParamFormRow"> | ||
<EuiSwitch label={label} checked={value} onChange={ev => setValue(ev.target.checked)} /> | ||
</EuiFormRow> | ||
); | ||
} | ||
|
||
export { AutoPrecisionParamEditor }; |
41 changes: 41 additions & 0 deletions
41
src/legacy/ui/public/agg_types/controls/is_filtered_by_collar.tsx
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,41 @@ | ||
/* | ||
* 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 React from 'react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { AggParamEditorProps } from 'ui/vis/editors/default'; | ||
import { SwitchParamEditor } from './switch'; | ||
|
||
function IsFilteredByCollarParamEditor(props: AggParamEditorProps<boolean>) { | ||
return ( | ||
<SwitchParamEditor | ||
displayLabel={i18n.translate('common.ui.aggTypes.onlyRequestDataAroundMapExtentLabel', { | ||
defaultMessage: 'Only request data around map extent', | ||
})} | ||
displayToolTip={i18n.translate('common.ui.aggTypes.onlyRequestDataAroundMapExtentTooltip', { | ||
defaultMessage: | ||
'Apply geo_bounding_box filter aggregation to narrow the subject area to the map view box with collar', | ||
})} | ||
dataTestSubj="isFilteredByCollarCheckbox" | ||
{...props} | ||
/> | ||
); | ||
} | ||
|
||
export { IsFilteredByCollarParamEditor }; |
This file was deleted.
Oops, something went wrong.
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,49 @@ | ||
/* | ||
* 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 React from 'react'; | ||
|
||
import { EuiRange, EuiFormRow } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { AggParamEditorProps } from 'ui/vis/editors/default'; | ||
|
||
function PrecisionParamEditor({ agg, config, value, setValue }: AggParamEditorProps<number>) { | ||
if (agg.params.autoPrecision) { | ||
return null; | ||
} | ||
|
||
const label = i18n.translate('common.ui.aggTypes.precisionLabel', { | ||
defaultMessage: 'Precision', | ||
}); | ||
|
||
return ( | ||
<EuiFormRow label={label} className="visEditorSidebar__aggParamFormRow"> | ||
<EuiRange | ||
min={1} | ||
max={config.get('visualization:tileMap:maxPrecision')} | ||
value={value} | ||
onChange={ev => setValue(Number(ev.target.value))} | ||
data-test-subj={`visEditorMapPrecision${agg.id}`} | ||
showValue | ||
/> | ||
</EuiFormRow> | ||
); | ||
} | ||
|
||
export { PrecisionParamEditor }; |
38 changes: 38 additions & 0 deletions
38
src/legacy/ui/public/agg_types/controls/use_geocentroid.tsx
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,38 @@ | ||
/* | ||
* 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 React from 'react'; | ||
|
||
import { EuiSwitch, EuiFormRow } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { AggParamEditorProps } from 'ui/vis/editors/default'; | ||
|
||
function UseGeocentroidParamEditor({ value, setValue }: AggParamEditorProps<boolean>) { | ||
const label = i18n.translate('common.ui.aggTypes.placeMarkersOffGridLabel', { | ||
defaultMessage: 'Place markers off grid (use geocentroid)', | ||
}); | ||
|
||
return ( | ||
<EuiFormRow className="visEditorSidebar__aggParamFormRow"> | ||
<EuiSwitch label={label} checked={value} onChange={ev => setValue(ev.target.checked)} /> | ||
</EuiFormRow> | ||
); | ||
} | ||
|
||
export { UseGeocentroidParamEditor }; |
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