Skip to content

Commit 770f3f7

Browse files
committed
♻️ some more description
1 parent daefb8b commit 770f3f7

3 files changed

Lines changed: 4 additions & 16 deletions

File tree

x-pack/plugins/lens/public/visualizations/gauge/visualization.tsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -235,23 +235,7 @@ export const getGaugeVisualization = ({
235235
getSuggestions,
236236

237237
getConfiguration({ state, frame }) {
238-
// const hasColoring = Boolean(state.colorMode !== 'none' && state.palette?.params?.stops);
239-
240238
const row = state?.layerId ? frame?.activeData?.[state?.layerId]?.rows?.[0] : undefined;
241-
// const { metricAccessor } = state ?? {};
242-
243-
// const accessors = getAccessorsFromState(state);
244-
245-
// let palette;
246-
// if (!(row == null || metricAccessor == null || state?.palette == null || !hasColoring)) {
247-
// const currentMinMax = {
248-
// min: getMinValue(row, accessors),
249-
// max: getMaxValue(row, accessors),
250-
// };
251-
252-
// const displayStops = applyPaletteParams(paletteService, state?.palette, currentMinMax);
253-
// palette = displayStops.map(({ color }) => color);
254-
// }
255239
const { palette, metricAccessor, accessors } = getConfigurationAccessorsAndPalette(
256240
state,
257241
paletteService,

x-pack/plugins/lens/public/visualizations/partition/visualization.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,9 @@ export const getPieVisualization = ({
675675
)
676676
);
677677
} else if (!layer.primaryGroups?.length) {
678+
// This is a logic integrated in the renderer, here simulated
679+
// In the particular case of no color assigned (as no sliceBy dimension defined)
680+
// the color is generated on the fly from the default palette
678681
palette.push(
679682
...paletteService
680683
.get(state.palette?.name || 'default')

x-pack/plugins/lens/public/visualizations/xy/visualization.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2242,6 +2242,7 @@ describe('xy_visualization', () => {
22422242
expect(yConfigs?.accessors[1].columnId).toEqual('b');
22432243
expect(yConfigs?.accessors[1].color).toEqual('green');
22442244

2245+
// This call restores the initial state of the paletteGetter
22452246
paletteGetter.mockRestore();
22462247
});
22472248
});

0 commit comments

Comments
 (0)