Skip to content

Commit

Permalink
[ML] Data Frame Analytics: Migrate scatterplot matrix from SCSS to em…
Browse files Browse the repository at this point in the history
…otion (elastic#199180)

## Summary

Part of elastic#140695

Migrates SCSS to emotion for the DFA scatterplot matrix.

![CleanShot 2024-11-06 at 17 27
35@2x](https://github.com/user-attachments/assets/a022b4b8-a659-495d-ae82-10b65cf42579)

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
  • Loading branch information
walterra authored Nov 11, 2024
1 parent 10db645 commit aeef51f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import type { FC } from 'react';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { css } from '@emotion/react';

import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { EuiComboBoxOptionOption } from '@elastic/eui';
Expand Down Expand Up @@ -35,6 +36,7 @@ import {
type RuntimeMappings,
} from '@kbn/ml-runtime-field-utils';
import { getProcessedFields } from '@kbn/ml-data-grid';
import { euiThemeVars } from '@kbn/ui-theme';

import { useCurrentThemeVars, useMlApi, useMlKibana } from '../../contexts/kibana';

Expand All @@ -48,7 +50,17 @@ import {
OUTLIER_SCORE_FIELD,
} from './scatterplot_matrix_vega_lite_spec';

import './scatterplot_matrix.scss';
const cssOverrides = css({
// Prevent the chart from overflowing the container
overflowX: 'auto',
// Overrides for the outlier threshold slider
'.vega-bind': {
span: {
fontSize: euiThemeVars.euiFontSizeXS,
padding: `0 ${euiThemeVars.euiSizeXS}`,
},
},
});

const SCATTERPLOT_MATRIX_DEFAULT_FIELDS = 4;
const SCATTERPLOT_MATRIX_DEFAULT_FETCH_SIZE = 1000;
Expand Down Expand Up @@ -413,7 +425,7 @@ export const ScatterplotMatrix: FC<ScatterplotMatrixProps> = ({
) : (
<div
data-test-subj={`mlScatterplotMatrix ${isLoading ? 'loading' : 'loaded'}`}
className="mlScatterplotMatrix"
css={cssOverrides}
>
<EuiFlexGroup>
<EuiFlexItem>
Expand Down

0 comments on commit aeef51f

Please sign in to comment.