Skip to content

Commit

Permalink
wip lens
Browse files Browse the repository at this point in the history
  • Loading branch information
mbondyra committed Jan 30, 2025
1 parent 2112f74 commit d2cd1ac
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
.lnsDynamicColoringRow {
align-items: center;
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ import {
import { GaugeTicksPositions, GaugeColorModes } from '@kbn/expression-gauge-plugin/common';
import { getMaxValue, getMinValue } from '@kbn/expression-gauge-plugin/public';
import { TooltipWrapper } from '@kbn/visualization-utils';
import { css } from '@emotion/react';
import { isNumericFieldForDatatable } from '../../../common/expressions/datatable/utils';
import { PalettePanelContainer } from '../../shared_components';
import type { VisualizationDimensionEditorProps } from '../../types';
import type { GaugeVisualizationState } from './constants';
import { defaultPaletteParams } from './palette_config';
import { getAccessorsFromState } from './utils';

import './dimension_editor.scss';

export function GaugeDimensionEditor(
props: VisualizationDimensionEditorProps<GaugeVisualizationState> & {
paletteService: PaletteRegistry;
Expand Down Expand Up @@ -74,7 +73,9 @@ export function GaugeDimensionEditor(
label={i18n.translate('xpack.lens.gauge.dynamicColoring.label', {
defaultMessage: 'Band colors',
})}
className="lnsDynamicColoringRow"
css={css`
align-items: center;
`}
>
<EuiSwitch
data-test-subj="lnsDynamicColoringGaugeSwitch"
Expand Down Expand Up @@ -111,12 +112,14 @@ export function GaugeDimensionEditor(
{hasDynamicColoring && (
<>
<EuiFormRow
className="lnsDynamicColoringRow"
display="columnCompressed"
fullWidth
label={i18n.translate('xpack.lens.paletteMetricGradient.label', {
defaultMessage: 'Color mapping',
})}
css={css`
align-items: center;
`}
>
<PalettePanelContainer
palette={displayStops.map(({ color }) => color)}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { EuiFormRow } from '@elastic/eui';
import { CustomizablePalette, PaletteRegistry } from '@kbn/coloring';
import type { VisualizationDimensionEditorProps } from '../../types';
import { PalettePanelContainer } from '../../shared_components';
import './dimension_editor.scss';
import type { HeatmapVisualizationState } from './types';
import { getSafePaletteParams } from './utils';
import { css } from '@emotion/react';

export function HeatmapDimensionEditor(
props: VisualizationDimensionEditorProps<HeatmapVisualizationState> & {
Expand All @@ -37,12 +37,14 @@ export function HeatmapDimensionEditor(
return (
<>
<EuiFormRow
className="lnsDynamicColoringRow"
display="columnCompressed"
fullWidth
label={i18n.translate('xpack.lens.paletteHeatmapGradient.label', {
defaultMessage: 'Color',
})}
css={css`
align-items: center;
`}
>
<PalettePanelContainer
palette={displayStops.map(({ color }) => color)}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ import {
import { i18n } from '@kbn/i18n';
import React from 'react';
import { ColorMode } from '@kbn/charts-plugin/common';
import { css } from '@emotion/react';
import type { LegacyMetricState } from '../../../common/types';
import { isNumericFieldForDatatable } from '../../../common/expressions/datatable/utils';
import { PalettePanelContainer } from '../../shared_components';
import type { VisualizationDimensionEditorProps } from '../../types';
import { defaultPaletteParams } from './palette_config';

import './dimension_editor.scss';

const idPrefix = htmlIdGenerator()();

export function MetricDimensionEditor(
Expand Down Expand Up @@ -134,12 +133,14 @@ export function MetricDimensionEditor(
</EuiFormRow>
{hasDynamicColoring && (
<EuiFormRow
className="lnsDynamicColoringRow"
display="columnCompressed"
fullWidth
label={i18n.translate('xpack.lens.paletteMetricGradient.label', {
defaultMessage: 'Color mapping',
})}
css={css`
align-items: center;
`}
>
<PalettePanelContainer
palette={stops.map(({ color }) => color)}
Expand Down

0 comments on commit d2cd1ac

Please sign in to comment.