mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
do not update cell background if is label cell (#60308)
This commit is contained in:
parent
89f9260da2
commit
f875b7165e
2 changed files with 11 additions and 7 deletions
|
@ -15,6 +15,8 @@ interface ColumnData {
|
|||
error_count?: number;
|
||||
}
|
||||
|
||||
export const ACTUAL_CLASS_ID = 'actual_class';
|
||||
|
||||
export function getColumnData(confusionMatrixData: ConfusionMatrix[]) {
|
||||
const colData: Partial<ColumnData[]> = [];
|
||||
|
||||
|
@ -67,7 +69,7 @@ export function getColumnData(confusionMatrixData: ConfusionMatrix[]) {
|
|||
|
||||
const columns: any = [
|
||||
{
|
||||
id: 'actual_class',
|
||||
id: ACTUAL_CLASS_ID,
|
||||
display: <span />,
|
||||
},
|
||||
];
|
||||
|
|
|
@ -39,7 +39,7 @@ import {
|
|||
ANALYSIS_CONFIG_TYPE,
|
||||
} from '../../../../common/analytics';
|
||||
import { LoadingPanel } from '../loading_panel';
|
||||
import { getColumnData } from './column_data';
|
||||
import { getColumnData, ACTUAL_CLASS_ID } from './column_data';
|
||||
|
||||
const defaultPanelWidth = 500;
|
||||
|
||||
|
@ -205,11 +205,13 @@ export const EvaluatePanel: FC<Props> = ({ jobConfig, jobStatus, searchQuery })
|
|||
const cellValue = columnsData[rowIndex][columnId];
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
useEffect(() => {
|
||||
setCellProps({
|
||||
style: {
|
||||
backgroundColor: `rgba(0, 179, 164, ${cellValue})`,
|
||||
},
|
||||
});
|
||||
if (columnId !== ACTUAL_CLASS_ID) {
|
||||
setCellProps({
|
||||
style: {
|
||||
backgroundColor: `rgba(0, 179, 164, ${cellValue})`,
|
||||
},
|
||||
});
|
||||
}
|
||||
}, [rowIndex, columnId, setCellProps]);
|
||||
return (
|
||||
<span>{typeof cellValue === 'number' ? `${Math.round(cellValue * 100)}%` : cellValue}</span>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue