diff --git a/packages/core/src/element/edge.ts b/packages/core/src/element/edge.ts index ea73042877..b2a3f4fbc1 100644 --- a/packages/core/src/element/edge.ts +++ b/packages/core/src/element/edge.ts @@ -349,8 +349,7 @@ const singleEdge: ShapeOptions = { drawLabel(cfg: EdgeConfig, group: IGroup): IShape { const { labelCfg: defaultLabelCfg } = this.options as ModelConfig; let defaultFontFamily; - // 额外判断window.getComputedStyle的原因为,如果nodemodule不安装在src目录下,小程序会有一个错误的window - if (typeof window !== 'undefined' && typeof window.getComputedStyle !== 'undefined') + if (typeof window !== 'undefined') defaultFontFamily = window.getComputedStyle(document.body, null).getPropertyValue('font-family') || 'Arial, sans-serif'; diff --git a/packages/core/src/element/shapeBase.ts b/packages/core/src/element/shapeBase.ts index d47c3f5928..fd3a412daf 100644 --- a/packages/core/src/element/shapeBase.ts +++ b/packages/core/src/element/shapeBase.ts @@ -71,11 +71,10 @@ export const shapeBase: ShapeOptions = { return deepMix( { // 解决局部渲染导致的文字移动残影问题 - // 额外判断window.getComputedStyle的原因为,如果nodemodule不安装在src目录下,小程序会有一个错误的window labelCfg: { style: { fontFamily: - typeof window !== 'undefined' && typeof window.getComputedStyle !== 'undefined' + typeof window !== 'undefined' ? window.getComputedStyle(document.body, null).getPropertyValue('font-family') || 'Arial, sans-serif' : 'Arial, sans-serif', @@ -84,7 +83,7 @@ export const shapeBase: ShapeOptions = { descriptionCfg: { style: { fontFamily: - typeof window !== 'undefined' && typeof window.getComputedStyle !== 'undefined' + typeof window !== 'undefined' ? window.getComputedStyle(document.body, null).getPropertyValue('font-family') || 'Arial, sans-serif' : 'Arial, sans-serif', diff --git a/packages/core/src/types/index.ts b/packages/core/src/types/index.ts index a23ca2f266..fcc560a2dc 100644 --- a/packages/core/src/types/index.ts +++ b/packages/core/src/types/index.ts @@ -635,11 +635,6 @@ export enum G6Event { NODE_DRAGSTART = 'node:dragstart', NODE_DRAG = 'node:drag', NODE_DRAGEND = 'node:dragend', - NODE_TAP = 'node:tap', - NODE_PANSTART = 'node:panstart', - NODE_PANMOVE = 'node:panmove', - NODE_PANEND = 'node:panend', - // combo, extends from nodes COMBO_CONTEXTMENU = 'combo:contextmenu', COMBO_CLICK = 'combo:click', @@ -658,10 +653,6 @@ export enum G6Event { COMBO_DRAGSTART = 'combo:dragstart', COMBO_DRAG = 'combo:drag', COMBO_DRAGEND = 'combo:dragend', - COMBO_TAP = 'combo:tap', - COMBO_PANSTART = 'combo:panstart', - COMBO_PANMOVE = 'combo:panmove', - COMBO_PANEND = 'combo:panend', // edge events EDGE_CONTEXTMENU = 'edge:contextmenu', @@ -696,10 +687,6 @@ export enum G6Event { CANVAS_DRAGSTART = 'canvas:dragstart', CANVAS_DRAG = 'canvas:drag', CANVAS_DRAGEND = 'canvas:dragend', - CANVAS_TAP = 'canvas:tap', - CANVAS_PANSTART = 'canvas:panstart', - CANVAS_PANMOVE = 'canvas:panmove', - CANVAS_PANEND = 'canvas:panend', // timing events BEFORERENDER = 'beforerender', @@ -743,14 +730,6 @@ export enum G6Event { VIEWPORTCHANGE = 'viewportchange', DRAGNODEEND = 'dragnodeend', STACKCHANGE = 'stackchange', - - // Mobile event support - TAP = 'tap', - PINCHSTART = 'pinchstart', - PINCHMOVE = 'pinchmove', - PANSTART = 'panstart', - PANMOVE = 'panmove', - PANEND = 'panend', } export type DefaultBehaviorType = IG6GraphEvent | string | number | object;