Skip to content

Commit

Permalink
layout form changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Jun 6, 2023
1 parent ed2619f commit 062d86a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ export function FontSizeInput(props: Props) {
return (
<EuiDualRange
id="tagCloudFontSizeSlider"
min={5}
min={1}
max={120}
step={1}
value={fontSize}
onChange={(value) => {
setFontSize(value as [number, number]);
}}
showLabels
aria-label={i18n.translate('xpack.lens.label.tagcloud.fontSizeLabel', {
defaultMessage: 'Font size',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
* 2.0.
*/

import React from 'react';
import React, { ChangeEvent } from 'react';
import {
EuiFlexGroup,
EuiFlexItem,
EuiFormRow,
EuiRadioGroup,
EuiSelect,
EuiSwitch,
EuiSwitchEvent,
} from '@elastic/eui';
Expand All @@ -31,20 +31,20 @@ import { FontSizeInput } from './font_size_input';

const ORIENTATION_OPTIONS = [
{
id: Orientation.SINGLE,
label: i18n.translate('xpack.lens.label.tagcloud.orientation.single', {
value: Orientation.SINGLE,
text: i18n.translate('xpack.lens.label.tagcloud.orientation.single', {
defaultMessage: 'Single',
}),
},
{
id: Orientation.RIGHT_ANGLED,
label: i18n.translate('xpack.lens.label.tagcloud.orientation.rightAngled', {
value: Orientation.RIGHT_ANGLED,
text: i18n.translate('xpack.lens.label.tagcloud.orientation.rightAngled', {
defaultMessage: 'Right angled',
}),
},
{
id: Orientation.MULTIPLE,
label: i18n.translate('xpack.lens.label.tagcloud.orientation.multiple', {
value: Orientation.MULTIPLE,
text: i18n.translate('xpack.lens.label.tagcloud.orientation.multiple', {
defaultMessage: 'Multiple',
}),
},
Expand Down Expand Up @@ -86,22 +86,24 @@ export function TagcloudToolbar(props: VisualizationToolbarProps<TagcloudState>)
defaultMessage: 'Orientation',
})}
>
<EuiRadioGroup
<EuiSelect
options={ORIENTATION_OPTIONS}
idSelected={props.state.orientation}
onChange={(id) => {
value={props.state.orientation}
onChange={(event: ChangeEvent<HTMLSelectElement>) => {
props.setState({
...props.state,
orientation: id as $Values<typeof Orientation>,
orientation: e.target.value as $Values<typeof Orientation>,
});
}}
/>
</EuiFormRow>
<EuiFormRow>
<EuiSwitch
label={i18n.translate('xpack.lens.label.tagcloud.showLabel', {
<EuiFormRow
display="columnCompressed"
label={i18n.translate('xpack.lens.label.tagcloud.showLabel', {
defaultMessage: 'Show label',
})}
>
<EuiSwitch
checked={props.state.showLabel}
onChange={(event: EuiSwitchEvent) => {
props.setState({
Expand Down

0 comments on commit 062d86a

Please sign in to comment.