Skip to content

Commit

Permalink
feat:add dev tips when graphType change
Browse files Browse the repository at this point in the history
  • Loading branch information
pomelo-nwu committed Feb 4, 2021
1 parent 73c5ada commit 71ece7e
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions packages/graphin/src/Graphin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,7 @@ class Graphin extends React.PureComponent<GraphinProps, GraphinState> {
this.initStatus();
/** 生成API */
this.apis = ApiController(this.graph);
};

updateLayout = () => {
this.layout.changeLayout();
};

componentDidMount() {
this.initGraphInstance();

/** 设置Context */
this.setState({
isReady: true,
context: {
Expand All @@ -280,6 +272,14 @@ class Graphin extends React.PureComponent<GraphinProps, GraphinState> {
theme: this.theme,
},
});
};

updateLayout = () => {
this.layout.changeLayout();
};

componentDidMount() {
this.initGraphInstance();
}

/**
Expand Down Expand Up @@ -332,8 +332,10 @@ class Graphin extends React.PureComponent<GraphinProps, GraphinState> {

/** 图类型变化 */
if (isGraphTypeChange) {
this.initGraphInstance();
console.log('%c isGraphTypeChange', 'color:grey');
console.error(
'The data types of pervProps.data and props.data are inconsistent,Graphin does not support the dynamic switching of TreeGraph and NetworkGraph',
);
return;
}
/** 配置变化 */
if (isOptionsChange) {
Expand Down

0 comments on commit 71ece7e

Please sign in to comment.