mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-08 08:31:37 +00:00
This commit is contained in:
parent
8e5064481e
commit
805839f9f4
@ -1,7 +1,7 @@
|
||||
import classNames from 'classnames';
|
||||
import React, { Fragment, useState } from 'react';
|
||||
import { Table, TableProfile } from '../../generated/entity/data/table';
|
||||
import ProfilerGraph from './ProfilerGraph';
|
||||
import TableProfilerGraph from './TableProfilerGraph';
|
||||
|
||||
type Props = {
|
||||
tableProfiles: Table['tableProfile'];
|
||||
@ -13,7 +13,7 @@ type ProfilerGraphData = Array<{
|
||||
value: number;
|
||||
}>;
|
||||
|
||||
const ProfilerTable = ({ tableProfiles, columns }: Props) => {
|
||||
const TableProfiler = ({ tableProfiles, columns }: Props) => {
|
||||
const [expandedColumn, setExpandedColumn] = useState<{
|
||||
name: string;
|
||||
isExpanded: boolean;
|
||||
@ -92,7 +92,7 @@ const ProfilerTable = ({ tableProfiles, columns }: Props) => {
|
||||
{col.name}
|
||||
</td>
|
||||
<td className="tw-relative tableBody-cell profiler-graph">
|
||||
<ProfilerGraph
|
||||
<TableProfilerGraph
|
||||
data={
|
||||
col.data
|
||||
?.map((d) => ({
|
||||
@ -104,7 +104,7 @@ const ProfilerTable = ({ tableProfiles, columns }: Props) => {
|
||||
/>
|
||||
</td>
|
||||
<td className="tw-relative tableBody-cell profiler-graph">
|
||||
<ProfilerGraph
|
||||
<TableProfilerGraph
|
||||
data={
|
||||
col.data
|
||||
?.map((d) => ({
|
||||
@ -116,7 +116,7 @@ const ProfilerTable = ({ tableProfiles, columns }: Props) => {
|
||||
/>
|
||||
</td>
|
||||
<td className="tw-relative tableBody-cell profiler-graph">
|
||||
<ProfilerGraph
|
||||
<TableProfilerGraph
|
||||
data={
|
||||
col.data
|
||||
?.map((d) => ({
|
||||
@ -131,7 +131,7 @@ const ProfilerTable = ({ tableProfiles, columns }: Props) => {
|
||||
<td className="tw-relative tableBody-cell">{col.max}</td>
|
||||
<td className="tw-relative tableBody-cell">{col.median}</td>
|
||||
<td className="tw-relative tableBody-cell profiler-graph">
|
||||
<ProfilerGraph
|
||||
<TableProfilerGraph
|
||||
data={
|
||||
col.data
|
||||
?.map((d) => ({
|
||||
@ -198,4 +198,4 @@ const ProfilerTable = ({ tableProfiles, columns }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default ProfilerTable;
|
||||
export default TableProfiler;
|
@ -4,7 +4,7 @@ import { Area, AreaChart, Tooltip } from 'recharts';
|
||||
type Props = {
|
||||
data: Array<{ date: Date | undefined; value: number | undefined }>;
|
||||
};
|
||||
const ProfilerGraph = ({ data }: Props) => {
|
||||
const TableProfilerGraph = ({ data }: Props) => {
|
||||
const CustomTooltip = ({
|
||||
active,
|
||||
payload,
|
||||
@ -40,7 +40,7 @@ const ProfilerGraph = ({ data }: Props) => {
|
||||
content={CustomTooltip}
|
||||
cursor={{ stroke: '#FF4C3B', strokeWidth: 2 }}
|
||||
offset={20}
|
||||
position={{ x: 20, y: 20 }}
|
||||
position={{ x: 20, y: -40 }}
|
||||
/>
|
||||
<Area
|
||||
dataKey="value"
|
||||
@ -53,4 +53,4 @@ const ProfilerGraph = ({ data }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default ProfilerGraph;
|
||||
export default TableProfilerGraph;
|
@ -41,8 +41,8 @@ import PageContainer from '../../components/containers/PageContainer';
|
||||
import Entitylineage from '../../components/dataset-lineage/EntityLineage';
|
||||
import FrequentlyJoinedTables from '../../components/my-data-details/FrequentlyJoinedTables';
|
||||
import ManageTab from '../../components/my-data-details/ManageTab';
|
||||
import ProfilerTable from '../../components/my-data-details/ProfilerTable';
|
||||
import SchemaTab from '../../components/my-data-details/SchemaTab';
|
||||
import TableProfiler from '../../components/my-data-details/TableProfiler';
|
||||
import {
|
||||
getDatabaseDetailsPath,
|
||||
getServiceDetailsPath,
|
||||
@ -90,7 +90,7 @@ const getProfilerRowDiff = (tableProfile: Table['tableProfile']) => {
|
||||
if (tableProfile.length > 1) {
|
||||
rowDiff = rowDiff - (tableProfile[1].rowCount || 0);
|
||||
}
|
||||
retDiff = `${(rowDiff >= 0 ? '+' : '-') + rowDiff} rows ${dayDiff}`;
|
||||
retDiff = `${(rowDiff >= 0 ? '+' : '') + rowDiff} rows ${dayDiff}`;
|
||||
}
|
||||
|
||||
return retDiff;
|
||||
@ -555,7 +555,7 @@ const MyDataDetailsPage = () => {
|
||||
</div>
|
||||
)}
|
||||
{activeTab === 2 && (
|
||||
<ProfilerTable
|
||||
<TableProfiler
|
||||
columns={columns.map((col) => col.name)}
|
||||
tableProfiles={tableProfile}
|
||||
/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user