Skip to content

Commit

Permalink
chore: rename behaviros to behaviors
Browse files Browse the repository at this point in the history
  • Loading branch information
timlrx committed Feb 21, 2021
1 parent 87030ec commit 48e1b48
Show file tree
Hide file tree
Showing 16 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Graphin has 10 built-in network graph layouts and 4 tree graph layouts to meet y

### 📝 Thoughtful interactions, easy to customize

Graphin provides 13 interactive components, including canvas zooming, panning, brush selection, lasso select , automatic resize, and also element dragging, selection, hovering, highlighting, expanding and collapsing, etc., to meet your interactive needs for different analysis scenarios [Try it online](https://graphin.antv.vision/en-US/graphin/behaviors/behaviros)
Graphin provides 13 interactive components, including canvas zooming, panning, brush selection, lasso select , automatic resize, and also element dragging, selection, hovering, highlighting, expanding and collapsing, etc., to meet your interactive needs for different analysis scenarios [Try it online](https://graphin.antv.vision/en-US/graphin/behaviors/behaviors)

### 🚀 Rich components, derived from precipitation of business development

Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Graphin 内置 10 款网图布局,4 款树图布局,满足你对于不同数

### 📝 细腻的交互,轻松自定义

Graphin 提供了 13 种交互组件。包括画布的缩放,平移,圈选,拉索,自动 Resize,也包括元素的拖拽,选中,悬停,高亮,展开收起等,满足你对于不同分析场景的交互需求。[在线体验](https://graphin.antv.vision/graphin/behaviors/behaviros)
Graphin 提供了 13 种交互组件。包括画布的缩放,平移,圈选,拉索,自动 Resize,也包括元素的拖拽,选中,悬停,高亮,展开收起等,满足你对于不同分析场景的交互需求。[在线体验](https://graphin.antv.vision/graphin/behaviors/behaviors)

### 🚀 丰富的组件,源于业务沉淀

Expand Down
4 changes: 2 additions & 2 deletions packages/graphin-components/src/CreateEdge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface Props {
(value: any): void;
};
}
const CreateEdge: React.FunctionComponent<Props> = (props) => {
const CreateEdge: React.FunctionComponent<Props> = props => {
const { children } = props;
const [state, setState] = React.useState({
active: false,
Expand Down Expand Up @@ -49,7 +49,7 @@ const CreateEdge: React.FunctionComponent<Props> = (props) => {
'default',
);
} else {
// 非边建联,即可删除behaviros
// 非边建联,即可删除behaviors
graph.removeBehaviors('create-edge', 'default');
}
}, [active]);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/graphin/docs/quick-start/overview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const demos = [
desc:
'Graphin 提供了 13 种交互组件。包括画布的缩放,平移,圈选,拉索,自动Resize,也包括元素的拖拽,选中,悬停,高亮,展开收起等,满足你对于不同分析场景的交互需求',
image: 'https://gw.alipayobjects.com/mdn/rms_402c1a/afts/img/A*L-htTIT2powAAAAAAAAAAAAAARQnAQ',
link: '/graphin/behaviors/behaviros',
link: '/graphin/behaviors/behaviors',
},
{
title: '【05】完备的分析组件',
Expand Down
2 changes: 1 addition & 1 deletion packages/graphin/docs/register/behaviors/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ As shown in the figure below: suppose we need to automatically focus on the `nod

## [Compatible] How to write G6 registration behavior

If you are an old user of G6, for the definition of interactive behavior, you may use the wording of `registerBehavior`, which of course Graphin also supports. But for the sake of logical unification, when you use this method, Graphin will remove all default interactions internally. The internal source code implementation is shown in the figure below. So you have to rewrite `drag-canvas` and other behaviros with `<Graphin modes={{ default: ['sampleBehavior','drag-canvas'] }}/>`.
If you are an old user of G6, for the definition of interactive behavior, you may use the wording of `registerBehavior`, which of course Graphin also supports. But for the sake of logical unification, when you use this method, Graphin will remove all default interactions internally. The internal source code implementation is shown in the figure below. So you have to rewrite `drag-canvas` and other behaviors with `<Graphin modes={{ default: ['sampleBehavior','drag-canvas'] }}/>`.

```jsx | pure
<>
Expand Down
4 changes: 2 additions & 2 deletions packages/graphin/docs/register/behaviors/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ nav:

## 【兼容】 G6 注册 Behavior 的写法

如果你是 G6 的老用户了,对于交互行为的定义,你可能会采用`registerBehavior`的写法,Graphin 当然也支持。不过为了逻辑的统一,当你使用这种方式的时候,Graphin 内部会移除所有的默认交互,`内部源码实现`如下图所示。因此你不得不再将`drag-canvas`behaviros,用`<Graphin modes={{ default: ['sampleBehavior','drag-canvas'] }}/>`的方式重新写入。
如果你是 G6 的老用户了,对于交互行为的定义,你可能会采用`registerBehavior`的写法,Graphin 当然也支持。不过为了逻辑的统一,当你使用这种方式的时候,Graphin 内部会移除所有的默认交互,`内部源码实现`如下图所示。因此你不得不再将`drag-canvas`behaviors,用`<Graphin modes={{ default: ['sampleBehavior','drag-canvas'] }}/>`的方式重新写入。

```jsx | pure
<>
{/** modes 不存在的时候,才启动默认的behaviros,否则会覆盖用户自己传入的 */
{/** modes 不存在的时候,才启动默认的behaviors,否则会覆盖用户自己传入的 */
!modes && (
<>
{/* 拖拽画布 */} <DragCanvas />
Expand Down
8 changes: 4 additions & 4 deletions packages/graphin/src/Graphin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import './index.less';

/** Context */
import GraphinContext from './GraphinContext';
/** 内置 Behaviros */
/** 内置 Behaviors */
import Behaviors from './behaviors';
/** 内置布局 */
import LayoutController from './layout';
Expand Down Expand Up @@ -183,8 +183,8 @@ class Graphin extends React.PureComponent<GraphinProps, GraphinState> {
...otherOptions
} = this.props;
if (modes.default.length > 0) {
// TODO :给用户正确的引导,推荐使用Graphin的Bheaviors组件
console.info('%c suggestion: you can use @antv/graphin Behaviros components', 'color:lightgreen');
// TODO :给用户正确的引导,推荐使用Graphin的Behaviors组件
console.info('%c suggestion: you can use @antv/graphin Behaviors components', 'color:lightgreen');
}
/** width and height */
const { clientWidth, clientHeight } = this.graphDOM as HTMLDivElement;
Expand Down Expand Up @@ -456,7 +456,7 @@ class Graphin extends React.PureComponent<GraphinProps, GraphinState> {
{isReady && (
<>
{
/** modes 不存在的时候,才启动默认的behaviros,否则会覆盖用户自己传入的 */
/** modes 不存在的时候,才启动默认的behaviors,否则会覆盖用户自己传入的 */
!modes && (
<>
{/* 拖拽画布 */}
Expand Down

0 comments on commit 48e1b48

Please sign in to comment.