Skip to content

Commit

Permalink
chore: add colorMapping telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
nickofthyme committed Aug 23, 2024
1 parent a94a571 commit df48141
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {
DEFAULT_ROW_HEIGHT,
} from './components/constants';
import { getColorStops, shouldColorByTerms } from '../../shared_components';
import { getColorMappingTelemetryEvents } from '../../lens_ui_telemetry/color_telemetry_helpers';
export interface DatatableVisualizationState {
columns: ColumnState[];
layerId: string;
Expand Down Expand Up @@ -559,6 +560,15 @@ export const getDatatableVisualization = ({
};
},

getTelemetryEventsOnSave(state, prevState) {
const colorMappingEvents = state.columns.flatMap((col) => {
const prevColumn = prevState?.columns?.find((prevCol) => prevCol.columnId === col.columnId);
return getColorMappingTelemetryEvents(col.colorMapping, prevColumn?.colorMapping);
});

return colorMappingEvents;
},

getRenderEventCounters(state) {
const events = {
color_by_value: false,
Expand Down

0 comments on commit df48141

Please sign in to comment.