mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[ES|QL] Disables new color mapping for suggested charts (#168068)
## Summary There are cases in ES|QL where a query might return a lot of buckets. With our new color mapping system a lot of buckets were greyed out and there were many concerns. For this reason I am disabling the new color mapping for these suggestions (users can always turn it on) I m fine with this as a temporary solution but I think we need to re-think: - having 10 colored buckets was a business decision we took, is it ok for ES|QL though? - possibly for cases like this another chart should be suggested, we agreed with @markov00 that we are going to revisit all the suggestions soonish and improve. We might need a different suggestion system per datasource but this is a quite big project and needs a lot of discussions. Until then, we can have the color mapping disabled by default for the ES|QL suggestions. **Now** <img width="2492" alt="image" src="2327ccf3
-d0d0-4ee7-bf1a-25e3d282003b"> **Before** <img width="2495" alt="image" src="9c35f90b
-04d6-4e39-9eb6-a5e2d2df335f">
This commit is contained in:
parent
e52957f167
commit
2f3180b70a
1 changed files with 16 additions and 1 deletions
|
@ -7,7 +7,12 @@
|
|||
import type { VisualizeFieldContext } from '@kbn/ui-actions-plugin/public';
|
||||
import type { DataView } from '@kbn/data-views-plugin/public';
|
||||
import { getSuggestions } from './editor_frame_service/editor_frame/suggestion_helpers';
|
||||
import type { DatasourceMap, VisualizationMap, VisualizeEditorContext } from './types';
|
||||
import type {
|
||||
DatasourceMap,
|
||||
VisualizationMap,
|
||||
VisualizeEditorContext,
|
||||
SuggestionRequest,
|
||||
} from './types';
|
||||
import type { DataViewsState } from './state_management';
|
||||
|
||||
interface SuggestionsApi {
|
||||
|
@ -18,6 +23,14 @@ interface SuggestionsApi {
|
|||
excludedVisualizations?: string[];
|
||||
}
|
||||
|
||||
const PREFERRED_PALETTE: SuggestionRequest['mainPalette'] = {
|
||||
type: 'legacyPalette',
|
||||
value: {
|
||||
name: 'default',
|
||||
type: 'palette',
|
||||
},
|
||||
};
|
||||
|
||||
export const suggestionsApi = ({
|
||||
context,
|
||||
dataView,
|
||||
|
@ -62,6 +75,7 @@ export const suggestionsApi = ({
|
|||
visualizationState: undefined,
|
||||
visualizeTriggerFieldContext: context,
|
||||
dataViews,
|
||||
mainPalette: PREFERRED_PALETTE,
|
||||
});
|
||||
if (!suggestions.length) return [];
|
||||
const activeVisualization = suggestions[0];
|
||||
|
@ -84,6 +98,7 @@ export const suggestionsApi = ({
|
|||
activeVisualization: visualizationMap[activeVisualization.visualizationId],
|
||||
visualizationState: activeVisualization.visualizationState,
|
||||
dataViews,
|
||||
mainPalette: PREFERRED_PALETTE,
|
||||
}).filter((sug) => !sug.hide && sug.visualizationId !== 'lnsLegacyMetric');
|
||||
const suggestionsList = [activeVisualization, ...newSuggestions];
|
||||
// until we separate the text based suggestions logic from the dataview one,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue