import { LineChartOutlined } from '@ant-design/icons'; import * as React from 'react'; import { Chart, EntityType, SearchResult } from '../../../types.generated'; import { Direction } from '../../lineage/types'; import getChildren from '../../lineage/utils/getChildren'; import { Entity, IconStyleType, PreviewType } from '../Entity'; import { getLogoFromPlatform } from '../../shared/getLogoFromPlatform'; import { ChartPreview } from './preview/ChartPreview'; import ChartProfile from './profile/ChartProfile'; /** * Definition of the DataHub Chart entity. */ export class ChartEntity implements Entity { type: EntityType = EntityType.Chart; icon = (fontSize: number, styleType: IconStyleType) => { if (styleType === IconStyleType.TAB_VIEW) { return ; } if (styleType === IconStyleType.HIGHLIGHT) { return ; } if (styleType === IconStyleType.SVG) { return ( ); } return ( ); }; isSearchEnabled = () => true; isBrowseEnabled = () => true; isLineageEnabled = () => true; getAutoCompleteFieldName = () => 'title'; getPathName = () => 'chart'; getCollectionName = () => 'Charts'; renderProfile = (urn: string) => ; renderPreview = (_: PreviewType, data: Chart) => { return ( ); }; renderSearch = (result: SearchResult) => { return this.renderPreview(PreviewType.SEARCH, result.entity as Chart); }; getLineageVizConfig = (entity: Chart) => { return { urn: entity.urn, name: entity.info?.name || '', type: EntityType.Chart, upstreamChildren: getChildren({ entity, type: EntityType.Chart }, Direction.Upstream).map( (child) => child.entity.urn, ), downstreamChildren: getChildren({ entity, type: EntityType.Chart }, Direction.Downstream).map( (child) => child.entity.urn, ), icon: getLogoFromPlatform(entity.tool), platform: entity.tool, }; }; }