Skip to content

Commit

Permalink
feat:add edge interface docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pomelo-nwu committed Jan 31, 2021
1 parent d6a31e5 commit fcd5cfb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 21 deletions.
14 changes: 14 additions & 0 deletions packages/graphin/docs/interface/edge-style.ts
@@ -0,0 +1,14 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { EdgeStyle } from '@antv/graphin';

export type KeyshapeType = EdgeStyle['keyshape'];
export type HaloType = EdgeStyle['halo'];
export type LabelType = EdgeStyle['label'];

/** Node Style Interface */

export const keyshape = (props: KeyshapeType) => {};

export const label = (props: LabelType) => {};

export const halo = (props: HaloType) => {};
File renamed without changes.
21 changes: 1 addition & 20 deletions packages/graphin/docs/render/element/edge.md
Expand Up @@ -20,25 +20,6 @@ Graphin 官网内置了 边类型`graphin-line`.作为默认的边类型,你
<code src='./demos/edge.tsx'>

## 02.设置字体图标

上述的 icon 有 3 种类型,从实际业务出发,将 icon 设置为字体图标是最常见的做法,这样不仅减少网络贷款请求,也很方便高效。
Graphin 采用`Graphin.registerFontFamily`的方式注册加载字体文件,让我们来看看吧

<!-- <code src='./demos/edge-icon.tsx'> -->

## 03.设置默认样式

上述设置节点的字体图标,除了在每个数据的 style 中覆盖样式,graphin 也保持 G6 的机制,可以通过`defaultNode`设置默认节点样式

<!-- <code src='./demos/edge-default.tsx'> -->

## 04.设置动画

如果我们追求更细腻的交互体验,比如在 hover 的时候,让 halo 光晕又一个动画效果,如下图所示

<!-- <code src='./demos/edge-animate.tsx'> -->

## 05.`graphin-line` 样式接口文档

<!-- <API title='AP' src='../../interface/style.ts'> -->
<API src='../../interface/edge-style.ts'>
2 changes: 1 addition & 1 deletion packages/graphin/docs/render/element/node.md
Expand Up @@ -40,4 +40,4 @@ Graphin 采用`Graphin.registerFontFamily`的方式注册加载字体文件,

## 05.`graphin-circle` 样式接口文档

<API src='../../interface/style.ts' >
<API src='../../interface/node-style.ts' >

0 comments on commit fcd5cfb

Please sign in to comment.