Skip to content

Commit

Permalink
📝 feat: demos path
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangchu committed Nov 14, 2023
1 parent 2f54f96 commit 2d7ca6d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 22 deletions.
21 changes: 7 additions & 14 deletions src/Background/demos/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { FlowView } from '@/index';
import { Background, BackgroundVariant, FlowPanel, FlowView } from '@ant-design/pro-flow';
import { Button } from 'antd';
import { createStyles } from 'antd-style';
import { memo, useState } from 'react';
import { Panel } from 'reactflow';
import Background, { BackgroundVariant } from '..';

const useStyles = createStyles(({ css }) => ({
container: css`
Expand All @@ -18,18 +17,12 @@ const BackgroundDemo = memo(() => {
return (
<div className={styles.container}>
<FlowView nodes={[]} edges={[]} miniMap={false} background={false}>
<Panel position={'top-left'}>
<FlowPanel position={'top-left'}>
<div>variant:</div>
<button type="button" onClick={() => setVariant(BackgroundVariant.Dots)}>
dots
</button>
<button type="button" onClick={() => setVariant(BackgroundVariant.Lines)}>
lines
</button>
<button type="button" onClick={() => setVariant(BackgroundVariant.Cross)}>
cross
</button>
</Panel>
<Button onClick={() => setVariant(BackgroundVariant.Dots)}>dots</Button>
<Button onClick={() => setVariant(BackgroundVariant.Lines)}>lines</Button>
<Button onClick={() => setVariant(BackgroundVariant.Cross)}>cross</Button>
</FlowPanel>
<Background variant={variant} />
</FlowView>
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/FlowPanel/demos/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { FlowView } from '@/index';
import { FlowPanel, FlowView } from '@ant-design/pro-flow';
import { createStyles } from 'antd-style';
import { memo } from 'react';
import FlowPanel from '..';

const useStyles = createStyles(({ css }) => ({
container: css`
Expand Down
3 changes: 1 addition & 2 deletions src/LineageGroupNode/demos/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { FlowViewEdge, FlowViewNode, SelectType } from '@/index';
import { FlowView } from '@ant-design/pro-flow';
import { FlowView, FlowViewEdge, FlowViewNode, SelectType } from '@/index';
import { createStyles } from 'antd-style';
import { useState } from 'react';

Expand Down
3 changes: 1 addition & 2 deletions src/LineageNode/demos/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { FlowViewEdge, FlowViewNode, SelectType } from '@/index';
import { FlowView } from '@ant-design/pro-flow';
import { FlowView, FlowViewEdge, FlowViewNode, SelectType } from '@ant-design/pro-flow';
import { Progress } from 'antd';
import { createStyles } from 'antd-style';
import React, { useState } from 'react';
Expand Down
18 changes: 16 additions & 2 deletions src/ProFlowController/demos/FlowControllerDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FlowView, ProFlowController } from '@/index';
import { FlowView, ProFlowController } from '@ant-design/pro-flow';
import { createStyles } from 'antd-style';
import { memo } from 'react';

Expand All @@ -13,7 +13,21 @@ const FlowControllerDemo = memo(() => {
const { styles } = useStyles();
return (
<div className={styles.container}>
<FlowView nodes={[]} edges={[]} miniMap={false}>
<FlowView
nodes={[
{
id: 'a1',
label: 'default',
data: {
title: 'XXX_API_b3',
logo: 'https://mdn.alipayobjects.com/huamei_ntgeqc/afts/img/A*kgyiRKi04eUAAAAAAAAAAAAADvuvAQ/original',
describe: 'XXX_XXX_XXX_API',
},
},
]}
edges={[]}
miniMap={false}
>
<ProFlowController position={{ x: 200, y: 50 }} />
</FlowView>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './Background';
export { default as Background } from './Background';
export { default as BasicNode } from './BasicNode';
export { default as CanvasLoading } from './CanvasLoading';
export * from './ControlInput';
Expand Down

0 comments on commit 2d7ca6d

Please sign in to comment.