Skip to content

Commit

Permalink
style(graphin):fix eslint error
Browse files Browse the repository at this point in the history
  • Loading branch information
pomelo-nwu committed Jan 22, 2021
1 parent e7a7649 commit 228241e
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 11 deletions.
10 changes: 9 additions & 1 deletion packages/graphin-components/src/ContextMenu/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import React, { useEffect } from 'react';
import { GraphinContext, IG6GraphEvent } from '@antv/graphin';
import * as Graphin from '@antv/graphin';
import Menu from './Menu';

const { GraphinContext } = Graphin;

interface IG6GraphEvent {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
item: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
}
const defaultStyle: React.CSSProperties = {
width: 200,
background: '#fff',
Expand Down
4 changes: 2 additions & 2 deletions packages/graphin-components/src/Hull/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';

// @ts-ignore
import { GraphinContext, Utils } from '@antv/graphin';
import { GraphinContext } from '@antv/graphin';

const defaultHullCfg = {
id: Utils.uuid(),
id: `${Math.random()}`, // Utils.uuid(),
members: [],
type: 'round-convex',
nonMembers: [],
Expand Down
1 change: 0 additions & 1 deletion packages/graphin/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jspm_packages/
.idea

# build
lib
build

# lock
Expand Down
2 changes: 1 addition & 1 deletion 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-beta.5",
"version": "2.0.0",
"description": "the react toolkit for graph analysis based on g6",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphin/src/Graphin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ class Graphin extends React.PureComponent<GraphinProps, GraphinState> {
}

clear = () => {
if (this.layout && this.layout.destroyed) {
if (this.layout && this.layout.destroy) {
this.layout.destroy(); // tree graph
}
this.layout = {} as LayoutController;
Expand Down
2 changes: 1 addition & 1 deletion packages/graphin/src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,6 @@ export const getDefaultStyleByTheme = (inputTheme: ThemeType | undefined) => {
background: isLight ? '#fff' : '#000',
...genDefaultNodeStyle(theme),
...genDefaultEdgeStyle(theme),
...genDefaultComboStyle(theme),
...genDefaultComboStyle(),
};
};
1 change: 1 addition & 0 deletions packages/graphin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default Graphin;
export { Utils, Layout, GraphinContext, Behaviors, registerFontFamily };

export { GraphinContextType, NodeStyle, EdgeStyle };

export {
/** export G6 */
default as G6,
Expand Down
4 changes: 2 additions & 2 deletions packages/graphin/src/layout/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-nocheck

import G6, { Graph } from '@antv/g6';
import defaultOptions from './utils/options';

Expand Down Expand Up @@ -26,8 +28,6 @@ class LayoutController {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
options: any;

type: string;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
instance: any;

Expand Down
4 changes: 2 additions & 2 deletions packages/graphin/src/typings/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ export interface ComboStyle {

export interface Layout {
/** 布局名称,必选 */
type: string;
reset?: Layout;
type?: string;
preset?: Layout;
/** 布局配置,可选 */
[key: string]: any; // eslint-disable-line
}
Expand Down

0 comments on commit 228241e

Please sign in to comment.