- {`${t('label.category')}: ${
- data.name
- }`}
- {`${t('label.count')}: ${tooltipFormatter(
- data.count
- )}`}
- {`${t('label.percentage')}: ${
- data.percentage
- }%`}
+
+
+ {data.name}
+
+
+
+ ({
+ color: theme.palette.allShades.gray[700],
+ fontSize: theme.typography.pxToRem(11),
+ })}>
+ {t('label.count')}
+
+ ({
+ color: theme.palette.allShades.gray[900],
+ fontWeight: theme.typography.fontWeightMedium,
+ fontSize: theme.typography.pxToRem(11),
+ })}>
+ {tooltipFormatter(data.count)}
+
+
+
+ ({
+ color: theme.palette.allShades.gray[700],
+ fontSize: theme.typography.pxToRem(11),
+ })}>
+ {t('label.percentage')}
+
+ ({
+ color: theme.palette.allShades.gray[900],
+ fontWeight: theme.typography.fontWeightMedium,
+ fontSize: theme.typography.pxToRem(11),
+ })}>
+ {`${data.percentage}%`}
+
+
);
}
@@ -87,9 +138,19 @@ const CardinalityDistributionChart = ({
return null;
};
+ const dataEntries = Object.entries(data).filter(
+ ([, columnProfile]) => !isUndefined(columnProfile?.cardinalityDistribution)
+ );
+
return (
-
- {map(data, (columnProfile, key) => {
+
+ {dataEntries.map(([key, columnProfile], index) => {
if (
isUndefined(columnProfile) ||
isUndefined(columnProfile?.cardinalityDistribution)
@@ -108,62 +169,96 @@ const CardinalityDistributionChart = ({
const graphDate = customFormatDateTime(
columnProfile?.timestamp || 0,
- 'MMM dd'
+ 'MMM dd, yyyy'
);
return (
-
-
-
- {graphDate}
-
-
- {`${t('label.total-entity', {
+
+
+ {graphDate}
+
+ {`${t('label.total-entity', {
entity: t('label.category-plural'),
- })}: ${cardinalityData.categories?.length || 0}`}
-
-
-
-
-
- axisTickFormatter(props, '%')}
- type="number"
- />
-
- value?.length > 15 ? `${value.slice(0, 15)}...` : value
- }
- type="category"
- width={120}
- />
-
-
-
-
-
-
-
-
+ })}: ${cardinalityData.categories?.length || 0}`}
+
+
+
+
+
+
+ axisTickFormatter(props, '%')}
+ tickLine={false}
+ type="number"
+ />
+
+ value?.length > 15 ? `${value.slice(0, 15)}...` : value
+ }
+ tickLine={false}
+ type="category"
+ width={120}
+ />
+
+
+
+
+
+
+
);
})}
-
+
);
};
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Visualisations/Chart/DataDistributionHistogram.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Visualisations/Chart/DataDistributionHistogram.component.tsx
index c1454ea48ee..6bfaa2cd879 100644
--- a/openmetadata-ui/src/main/resources/ui/src/components/Visualisations/Chart/DataDistributionHistogram.component.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/components/Visualisations/Chart/DataDistributionHistogram.component.tsx
@@ -11,8 +11,8 @@
* limitations under the License.
*/
-import { Col, Row, Tag } from 'antd';
-import { isUndefined, map } from 'lodash';
+import { Box, useTheme } from '@mui/material';
+import { isUndefined } from 'lodash';
import { useTranslation } from 'react-i18next';
import {
Bar,
@@ -29,7 +29,9 @@ import { GRAPH_BACKGROUND_COLOR } from '../../../constants/constants';
import { DEFAULT_HISTOGRAM_DATA } from '../../../constants/profiler.constant';
import { HistogramClass } from '../../../generated/entity/data/table';
import { axisTickFormatter, tooltipFormatter } from '../../../utils/ChartUtils';
+import { CustomDQTooltip } from '../../../utils/DataQuality/DataQualityUtils';
import { customFormatDateTime } from '../../../utils/date-time/DateTimeUtils';
+import { DataPill } from '../../common/DataPill/DataPill.styled';
import ErrorPlaceHolder from '../../common/ErrorWithPlaceholder/ErrorPlaceHolder';
import { DataDistributionHistogramProps } from './Chart.interface';
@@ -37,7 +39,9 @@ const DataDistributionHistogram = ({
data,
noDataPlaceholderText,
}: DataDistributionHistogramProps) => {
+ const theme = useTheme();
const { t } = useTranslation();
+
const showSingleGraph =
isUndefined(data.firstDayData?.histogram) ||
isUndefined(data.currentDayData?.histogram);
@@ -47,21 +51,32 @@ const DataDistributionHistogram = ({
isUndefined(data.currentDayData?.histogram)
) {
return (
-
-
-
-
-
+
+
+
);
}
- return (
-
- {map(data, (columnProfile, key) => {
- if (isUndefined(columnProfile?.histogram)) {
- return;
- }
+ const dataEntries = Object.entries(data).filter(
+ ([, columnProfile]) => !isUndefined(columnProfile?.histogram)
+ );
+ return (
+
+ {dataEntries.map(([key, columnProfile], index) => {
const histogramData =
(columnProfile?.histogram as HistogramClass) ||
DEFAULT_HISTOGRAM_DATA;
@@ -73,59 +88,105 @@ const DataDistributionHistogram = ({
const graphDate = customFormatDateTime(
columnProfile?.timestamp || 0,
- 'MMM dd'
+ 'MMM dd, yyyy'
);
+ const skewColorTheme = columnProfile?.nonParametricSkew
+ ? columnProfile?.nonParametricSkew > 0
+ ? theme.palette.allShades.success
+ : theme.palette.allShades.error
+ : theme.palette.allShades.info;
+
return (
-
-
-
- {graphDate}
-
-
- {`${t('label.skew')}: ${
+
+
+ {graphDate}
+
+ {`${t('label.skew')}: ${
columnProfile?.nonParametricSkew || '--'
- }`}
-
-
-
-
-
-
- axisTickFormatter(props)}
- />
-
-
- tooltipFormatter(value)
- }
- />
-
-
-
-
-
-
+ }`}
+
+
+
+
+
+
+
+ axisTickFormatter(props)}
+ tickLine={false}
+ />
+
+ tooltipFormatter(value)}
+ />
+ }
+ cursor={{
+ stroke: theme.palette.grey[200],
+ strokeDasharray: '3 3',
+ }}
+ />
+
+
+
+
+
);
})}
-
+
);
};
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/DataPill/DataPill.styled.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/DataPill/DataPill.styled.tsx
new file mode 100644
index 00000000000..e9e563d3979
--- /dev/null
+++ b/openmetadata-ui/src/main/resources/ui/src/components/common/DataPill/DataPill.styled.tsx
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2023 Collate.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { Box, styled } from '@mui/material';
+
+export const DataPill = styled(Box)(({ theme }) => ({
+ backgroundColor: theme.palette.grey[100],
+ color: theme.palette.grey[900],
+ borderRadius: '6px',
+ padding: '6px 12px',
+ fontSize: theme.typography.pxToRem(14),
+ fontWeight: theme.typography.fontWeightBold,
+ display: 'inline-block',
+}));
diff --git a/openmetadata-ui/src/main/resources/ui/src/constants/Color.constants.ts b/openmetadata-ui/src/main/resources/ui/src/constants/Color.constants.ts
index 3240ade7866..59fd029b888 100644
--- a/openmetadata-ui/src/main/resources/ui/src/constants/Color.constants.ts
+++ b/openmetadata-ui/src/main/resources/ui/src/constants/Color.constants.ts
@@ -34,7 +34,7 @@ export const BLUE_2 = '#3ca2f4';
export const BLUE_500 = '#2E90FA';
export const BLUE_800 = '#1849A9';
export const BLUE_50 = '#EFF8FF';
-export const CHART_BLUE_1 = '#1890FF';
+export const CHART_BLUE_1 = '#4689FF';
export const RIPTIDE = '#76E9C6';
export const MY_SIN = '#FEB019';
export const SAN_MARINO = '#416BB3';
diff --git a/openmetadata-ui/src/main/resources/ui/src/constants/profiler.constant.ts b/openmetadata-ui/src/main/resources/ui/src/constants/profiler.constant.ts
index 76dcfbf8da4..bbaacaff834 100644
--- a/openmetadata-ui/src/main/resources/ui/src/constants/profiler.constant.ts
+++ b/openmetadata-ui/src/main/resources/ui/src/constants/profiler.constant.ts
@@ -123,28 +123,28 @@ export const INITIAL_COUNT_METRIC_VALUE = {
entity: t('label.distinct'),
}),
dataKey: 'distinctCount',
- color: '#1890FF',
+ color: '#467DDC',
},
{
title: t('label.entity-count', {
entity: t('label.null'),
}),
dataKey: 'nullCount',
- color: '#7147E8',
+ color: '#3488B5',
},
{
title: t('label.entity-count', {
entity: t('label.unique'),
}),
dataKey: 'uniqueCount',
- color: '#008376',
+ color: '#685997',
},
{
title: t('label.entity-count', {
entity: t('label.value-plural'),
}),
dataKey: 'valuesCount',
- color: '#B02AAC',
+ color: '#464A52',
},
],
data: [],
@@ -157,21 +157,21 @@ export const INITIAL_PROPORTION_METRIC_VALUE = {
entity: t('label.distinct'),
}),
dataKey: 'distinctProportion',
- color: '#1890FF',
+ color: '#6B97E3',
},
{
title: t('label.entity-proportion', {
entity: t('label.null'),
}),
dataKey: 'nullProportion',
- color: '#7147E8',
+ color: '#867AAC',
},
{
title: t('label.entity-proportion', {
entity: t('label.unique'),
}),
dataKey: 'uniqueProportion',
- color: '#008376',
+ color: '#6B6E75',
},
],
data: [],
@@ -182,17 +182,17 @@ export const INITIAL_MATH_METRIC_VALUE = {
{
title: t('label.max'),
dataKey: 'max',
- color: '#1890FF',
+ color: '#6B97E3',
},
{
title: t('label.mean'),
dataKey: 'mean',
- color: '#7147E8',
+ color: '#6B6E75',
},
{
title: t('label.min'),
dataKey: 'min',
- color: '#008376',
+ color: '#867AAC',
},
],
data: [],
@@ -203,7 +203,8 @@ export const INITIAL_SUM_METRIC_VALUE = {
{
title: t('label.sum'),
dataKey: 'sum',
- color: '#1890FF',
+ color: BLUE_500,
+ fill: BLUE_50,
},
],
data: [],
@@ -213,22 +214,22 @@ export const INITIAL_QUARTILE_METRIC_VALUE = {
{
title: t('label.first-quartile'),
dataKey: 'firstQuartile',
- color: '#1890FF',
+ color: '#467DDC',
},
{
title: t('label.median'),
dataKey: 'median',
- color: '#7147E8',
+ color: '#3488B5',
},
{
title: t('label.inter-quartile-range'),
dataKey: 'interQuartileRange',
- color: '#008376',
+ color: '#685997',
},
{
title: t('label.third-quartile'),
dataKey: 'thirdQuartile',
- color: '#B02AAC',
+ color: '#464A52',
},
],
data: [],
diff --git a/openmetadata-ui/src/main/resources/ui/src/interface/data-insight.interface.ts b/openmetadata-ui/src/main/resources/ui/src/interface/data-insight.interface.ts
index 30c3c61c31f..b9d42f1df1b 100644
--- a/openmetadata-ui/src/main/resources/ui/src/interface/data-insight.interface.ts
+++ b/openmetadata-ui/src/main/resources/ui/src/interface/data-insight.interface.ts
@@ -41,6 +41,7 @@ export interface ChartFilter {
export interface DataInsightChartTooltipProps extends TooltipProps {
cardStyles?: React.CSSProperties;
customValueKey?: string;
+ displayDateInHeader?: boolean;
dateTimeFormatter?: (date?: number, format?: string) => string;
isPercentage?: boolean;
isTier?: boolean;
diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/DataQuality/DataQualityUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/DataQuality/DataQualityUtils.tsx
index c76193c5c4c..4f10d92e1a5 100644
--- a/openmetadata-ui/src/main/resources/ui/src/utils/DataQuality/DataQualityUtils.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/utils/DataQuality/DataQualityUtils.tsx
@@ -369,11 +369,15 @@ export const CustomDQTooltip = (props: DataInsightChartTooltipProps) => {
timeStampKey = 'timestampValue',
transformLabel = true,
valueFormatter,
+ displayDateInHeader = true,
} = props;
if (active && payload && payload.length) {
// we need to check if the xAxis is a date or not.
- const timestamp = dateTimeFormatter(payload[0].payload[timeStampKey] || 0);
+ const timestamp = displayDateInHeader
+ ? dateTimeFormatter(payload[0].payload[timeStampKey] || 0)
+ : payload[0].payload[timeStampKey];
+
const payloadValue = uniqBy(payload, 'dataKey');
return (