Skip to content

Commit

Permalink
Merge pull request #221 from antvis/release/2.0.1
Browse files Browse the repository at this point in the history
chore: release graphin version 2.0.1
  • Loading branch information
pomelo-nwu authored Feb 24, 2021
2 parents d8856f5 + 87a2d9b commit 6246a18
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
4 changes: 3 additions & 1 deletion packages/dumi-theme-graphin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
"prism-react-renderer": "^1.1.1",
"prismjs": "^1.21.0",
"rc-tabs": "^11.7.1",
"react-i18next": "^11.8.7",
"react-slick": "^0.28.0",
"react-use": "^17.1.1"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.11.3",
"@testing-library/react": "^10.4.8",
"dumi": "1.1.3",
"dumi": "1.1.5-0",
"father": "^2.30.1",
"global-dirs": "^2.1.0",
"react-test-renderer": "^16.13.1"
Expand Down
2 changes: 0 additions & 2 deletions packages/dumi-theme-graphin/src/components/Banner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import GitHubButton from 'react-github-button';
import gh from 'parse-github-url';
import classNames from 'classnames';
import { context } from 'dumi/theme';

import 'video-react/dist/video-react.css';
// @ts-ignore
import styles from './Banner.module.less';
import Notification, { NotificationProps } from './Notification';
Expand Down
8 changes: 4 additions & 4 deletions packages/dumi-theme-graphin/src/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ const Layout: React.FC<IRouteComponentProps> = ({ children, location }) => {
locale,
} = Context;

const { meta } = processRedirect(Context, location);

const { meta, isDirect } = processRedirect(Context, location);
console.log('Context', Context, 'calculate meta', meta);
const { url: repoUrl, branch, platform } = repository;
const [menuCollapsed, setMenuCollapsed] = useState<boolean>(true);
const isSiteMode = mode === 'site';
Expand All @@ -130,8 +130,8 @@ const Layout: React.FC<IRouteComponentProps> = ({ children, location }) => {
const updatedTime: any = new Date(meta.updatedTime).toLocaleString([], { hour12: false });
const repoPlatform =
{ github: 'GitHub', gitlab: 'GitLab' }[(repoUrl || '').match(/(github|gitlab)/)?.[1] || 'nothing'] || platform;

if (isEmpty(meta)) {
// 等dumi最新版发布后解决路由匹配问题
if (isEmpty(meta) && !isDirect) {
return (
<div>
<div
Expand Down
2 changes: 1 addition & 1 deletion packages/graphin-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"peerDependencies": {
"react": "^16.x",
"react-dom": "^16.x",
"@antv/graphin": "2.0.0"
"@antv/graphin": "^2.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
5 changes: 3 additions & 2 deletions packages/graphin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/graphin",
"version": "2.0.0",
"version": "2.0.1",
"description": "the react toolkit for graph analysis based on g6",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -49,7 +49,8 @@
"dependencies": {
"@antv/g-canvas": "^0.5.1",
"@antv/g6": "4.1.11",
"@antv/util": "^2.0.10"
"@antv/util": "^2.0.10",
"lodash-es": "^4.17.21"
},
"peerDependencies": {
"react": "^16.x",
Expand Down
5 changes: 3 additions & 2 deletions packages/graphin/src/Graphin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import React, { ErrorInfo } from 'react';
// todo ,G6@unpack版本将规范类型的输出
import G6, { Graph as IGraph, GraphOptions, GraphData, TreeGraphData } from '@antv/g6';
import { deepMix } from '@antv/util';

/** utils */
// import shallowEqual from './utils/shallowEqual';
import deepEqual from './utils/deepEqual';

import cloneDeep from 'lodash-es/cloneDeep';

import './index.less';

/** Context */
Expand Down Expand Up @@ -158,7 +159,7 @@ class Graphin extends React.PureComponent<GraphinProps, GraphinState> {
if ((data as GraphinTreeData).children) {
this.isTree = true;
}
this.data = deepMix({}, data);
this.data = cloneDeep(data);
};

initGraphInstance = () => {
Expand Down

0 comments on commit 6246a18

Please sign in to comment.