From 7e469c5e8669b02f391e70dd809eea3dabca63e4 Mon Sep 17 00:00:00 2001 From: openwayne Date: Thu, 20 May 2021 21:05:00 +0800 Subject: [PATCH] fix: resovle build error --- packages/mobile/src/interface/graph.ts | 27 ------------------- packages/mobile/src/stories/Basic.tsx | 4 +-- packages/mobile/src/stories/index.stories.tsx | 5 ++-- 3 files changed, 3 insertions(+), 33 deletions(-) diff --git a/packages/mobile/src/interface/graph.ts b/packages/mobile/src/interface/graph.ts index 00572272727..31ff57725ef 100644 --- a/packages/mobile/src/interface/graph.ts +++ b/packages/mobile/src/interface/graph.ts @@ -123,30 +123,3 @@ export interface ITreeGraph extends IGraph { */ isLayoutAnimating: () => boolean; } - -export class G6GraphEvent extends GraphEvent implements IG6GraphEvent { - public item: Item; - - public canvasX: number; - - public canvasY: number; - - public clientX: number; - - public clientY: number; - - public wheelDelta: number; - - public detail: number; - - public target!: IShapeBase & ICanvas; - - constructor(type: string, event: IG6GraphEvent) { - super(type, event); - this.item = event.item; - this.canvasX = event.canvasX; - this.canvasY = event.canvasY; - this.wheelDelta = event.wheelDelta; - this.detail = event.detail; - } -} diff --git a/packages/mobile/src/stories/Basic.tsx b/packages/mobile/src/stories/Basic.tsx index 39a0bbad5d8..364010ca92e 100644 --- a/packages/mobile/src/stories/Basic.tsx +++ b/packages/mobile/src/stories/Basic.tsx @@ -1,6 +1,4 @@ import React, { useEffect } from 'react'; -import ReactDOM from 'react-dom'; -import PropTypes from 'prop-types'; import G6 from '../../src'; import GridLayout from '../extends/layout/gridLayout'; import './basic.css'; @@ -36,7 +34,7 @@ export const BasicDemo = () => { useEffect(() => { if (!graph) { graph = new G6.Graph({ - container: ReactDOM.findDOMNode(ref.current), + container: ref.current, width: 500, height: 500, layout: { diff --git a/packages/mobile/src/stories/index.stories.tsx b/packages/mobile/src/stories/index.stories.tsx index 3aecea7a681..53a1939fca0 100644 --- a/packages/mobile/src/stories/index.stories.tsx +++ b/packages/mobile/src/stories/index.stories.tsx @@ -1,15 +1,14 @@ import React from 'react'; // also exported from '@storybook/react' if you can deal with breaking changes in 6.1 -import { Story, Meta } from '@storybook/react/types-6-0'; import { BasicDemo, BasicProps } from './Basic'; export default { title: 'Example/basic-demo', component: BasicDemo, -} as Meta; +}; -const Template: Story = (args) => ; +const Template = (args) => ; export const MobileBasicDemo = Template.bind({}); MobileBasicDemo.args = {};