chore: sync master

This commit is contained in:
AlbertAZ1992 2021-04-26 21:05:01 +08:00 committed by Yanyan Wang
parent 25f7cfab4f
commit 1c1f6a280c
3 changed files with 3 additions and 26 deletions

View File

@ -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';

View File

@ -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',

View File

@ -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;