diff --git a/.changeset/witty-camels-stare.md b/.changeset/witty-camels-stare.md new file mode 100644 index 0000000..f8abe1b --- /dev/null +++ b/.changeset/witty-camels-stare.md @@ -0,0 +1,5 @@ +--- +'@antv/gpt-vis': minor +--- + +lite component for GPTVis diff --git a/src/GPTVis/index.tsx b/src/GPTVis/index.tsx index 040ad00..19940b6 100644 --- a/src/GPTVis/index.tsx +++ b/src/GPTVis/index.tsx @@ -1,29 +1,16 @@ import React, { memo } from 'react'; -import type { Options } from 'react-markdown'; -import Markdown from 'react-markdown'; -import rehypeRaw from 'rehype-raw'; import { withDefaultChartCode } from '../ChartCodeRender'; +import { default as GPTVisLite, type GPTVisLiteProps } from './Lite'; -export interface GPTVisProps extends Options { - /** 自定义 markdown components样式 */ - components?: - | Options['components'] - | { - [key: string]: (props: any) => React.ReactNode; - }; -} +export interface GPTVisProps extends GPTVisLiteProps {} const CodeBlock = withDefaultChartCode(); -const GPTVis: React.FC = ({ children, components, rehypePlugins, ...rest }) => { +const GPTVis: React.FC = ({ children, components, ...rest }) => { return ( - + {children} - + ); }; diff --git a/src/export.ts b/src/export.ts index aeff9d9..f84ce1e 100644 --- a/src/export.ts +++ b/src/export.ts @@ -1,27 +1,33 @@ +/********** plot chart **********/ import { default as Area, type AreaProps } from './Area'; import { default as Bar, type BarProps } from './Bar'; import { default as Column, type ColumnProps } from './Column'; import { default as DualAxes, type DualAxesProps } from './DualAxes'; -import { default as FlowDiagram, type FlowDiagramProps } from './FlowDiagram'; import { default as HeatMap, type HeatMapProps } from './HeatMap'; import { default as Histogram, type HistogramProps } from './Histogram'; import { default as Line, type LineProps } from './Line'; -import { default as MindMap, type MindMapProps } from './MindMap'; -import { default as NetworkGraph, type NetworkGraphProps } from './NetworkGraph'; -import { default as PathMap, type PathMapProps } from './PathMap'; import { default as Pie, type PieProps } from './Pie'; -import { default as PinMap, type PinMapProps } from './PinMap'; import { default as Radar, type RadarProps } from './Radar'; import { default as Scatter, type ScatterProps } from './Scatter'; import { default as Treemap, type TreemapProps } from './Treemap'; -import { ChartType } from './types'; import { default as WordCloud, type WordCloudProps } from './WordCloud'; -export { default as ConfigProvider, type ConfigProviderProps } from './ConfigProvider'; +/********** graph chart **********/ +import { default as FlowDiagram, type FlowDiagramProps } from './FlowDiagram'; +import { default as MindMap, type MindMapProps } from './MindMap'; +import { default as NetworkGraph, type NetworkGraphProps } from './NetworkGraph'; +import { default as PathMap, type PathMapProps } from './PathMap'; +import { default as PinMap, type PinMapProps } from './PinMap'; +import { ChartType } from './types'; export { default as IndentedTree, type IndentedTreeProps } from './IndentedTree'; -export { default as Map, type MapProps } from './Map'; export { default as OrganizationChart, type OrganizationChartProps } from './OrganizationChart'; +/********** map chart **********/ +export { default as Map, type MapProps } from './Map'; + +/********** NTV **********/ +export { VisText, type VisTextProps } from './Text'; + export { Area, Bar, @@ -59,8 +65,6 @@ export { type WordCloudProps, }; -export { VisText, type VisTextProps } from './Text'; - export const DEFAULT_CHART_COMPONENTS: Record> = { [ChartType.Line]: Line, [ChartType.Column]: Column, diff --git a/src/index.ts b/src/index.ts index 1216fcf..5fbf487 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,14 @@ +/********** export chart **********/ export * from './export'; -export { default as version } from './version'; +/********** export types **********/ +export * from './types'; + +/********** export GPTVis **********/ export { withChartCode, withDefaultChartCode } from './ChartCodeRender'; export type { CodeBlockComponent, WithChartCodeOptions } from './ChartCodeRender/type'; +export { default as ConfigProvider, type ConfigProviderProps } from './ConfigProvider'; export { default as GPTVis, type GPTVisProps } from './GPTVis'; export { default as GPTVisLite, type GPTVisLiteProps } from './GPTVis/Lite'; -export * from './types'; +export { default as version } from './version';