From cafe7b0ca40c7d5cf8dae8f4e0a6ca08d395f142 Mon Sep 17 00:00:00 2001 From: Chushen Date: Mon, 4 Dec 2023 15:16:14 +0800 Subject: [PATCH] fix: fix typos --- .gitignore | 2 - .vscode/settings.json | 49 +++++++++++++++++++ README.en-US.md | 2 +- packages/g6/src/item/item.ts | 4 +- packages/g6/src/runtime/controller/data.ts | 18 +++---- .../g6/src/runtime/controller/interaction.ts | 4 +- packages/g6/src/runtime/controller/item.ts | 4 +- packages/g6/src/runtime/controller/layout.ts | 4 +- packages/g6/src/runtime/graph.ts | 6 +-- packages/g6/src/runtime/hooks.ts | 4 +- .../g6/src/stdlib/behavior/create-edge.ts | 2 +- .../g6/src/stdlib/behavior/drag-canvas.ts | 2 +- packages/g6/src/stdlib/behavior/drag-node.ts | 2 +- .../g6/src/stdlib/behavior/hover-activate.ts | 2 +- .../g6/src/stdlib/behavior/orbit-canvas-3d.ts | 2 +- .../src/stdlib/behavior/rotate-canvas-3d.ts | 4 +- .../g6/src/stdlib/behavior/scroll-canvas.ts | 10 ++-- .../g6/src/stdlib/behavior/track-canvas-3d.ts | 2 +- .../g6/src/stdlib/behavior/zoom-canvas-3d.ts | 2 +- .../g6/src/stdlib/behavior/zoom-canvas.ts | 8 +-- packages/g6/src/stdlib/index.ts | 6 +-- packages/g6/src/stdlib/item/node/base.ts | 4 +- packages/g6/src/stdlib/item/node/donut.ts | 2 +- .../g6/src/stdlib/plugin/hull/bubbleset.ts | 28 +++++------ packages/g6/src/stdlib/plugin/hull/index.ts | 8 +-- packages/g6/src/stdlib/plugin/hull/util.ts | 2 +- packages/g6/src/stdlib/plugin/legend/index.ts | 22 ++++----- .../src/stdlib/plugin/lodController/index.ts | 2 +- packages/g6/src/stdlib/plugin/menu/index.ts | 2 +- .../g6/src/stdlib/plugin/snapline/index.ts | 6 +-- .../g6/src/stdlib/plugin/tooltip/index.ts | 8 +-- .../g6/src/stdlib/plugin/watermaker/index.ts | 16 +++--- packages/g6/src/stdlib/selector/lasso.ts | 6 +-- packages/g6/src/stdlib/themeSolver/spec.ts | 6 +-- packages/g6/src/stdlib/themeSolver/subject.ts | 2 +- packages/g6/src/types/animate.ts | 4 +- packages/g6/src/types/graph.ts | 14 +++--- packages/g6/src/types/item.ts | 8 +-- packages/g6/src/types/layout.ts | 2 +- packages/g6/src/types/plugin.ts | 2 +- packages/g6/src/types/spec.ts | 2 +- packages/g6/src/types/theme.ts | 2 +- packages/g6/src/types/view.ts | 2 +- packages/g6/src/util/animate.ts | 2 +- packages/g6/src/util/data.ts | 16 +++--- packages/g6/src/util/extend.ts | 2 +- packages/g6/src/util/math.ts | 2 +- packages/g6/src/util/path.ts | 2 +- packages/g6/src/util/polyline.ts | 6 +-- packages/g6/src/util/router.ts | 14 +++--- packages/g6/src/util/shape.ts | 12 ++--- packages/g6/src/util/shape3d.ts | 8 +-- .../g6/tests/demo/plugins/edgeFilterLens.ts | 22 ++++----- packages/g6/tests/demo/plugins/fisheye.ts | 22 ++++----- packages/g6/tests/demo/plugins/watermarker.ts | 2 +- .../layout/ForceAtlas2LayoutOptions.en.md | 2 +- .../site/docs/apis/plugins/WaterMarker.en.md | 2 +- .../site/docs/apis/plugins/WaterMarker.zh.md | 4 +- .../tool/edgeFilterLens/demo/default.ts | 22 ++++----- .../tool/edgeFilterLens/demo/moreConfig.ts | 22 ++++----- .../examples/tool/fisheye/demo/fisheye.ts | 22 ++++----- .../tool/watermarker/demo/textWaterMarker.ts | 2 +- 62 files changed, 260 insertions(+), 215 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 30b8da310c1..36f376f1a4c 100644 --- a/.gitignore +++ b/.gitignore @@ -36,5 +36,3 @@ packages/g6/tests/integration/snapshots/**/*-diff.* site/.dumi/tmp site/.dumi/tmp-production -# Editor -.vscode diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000000..afacded0a26 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,49 @@ +{ + "cSpell.words": [ + "AABB", + "afterchangedata", + "aftercollapsecombo", + "afterexpandcombo", + "afteritemchange", + "afteritemstatechange", + "afteritemvisibilitychange", + "afteritemzindexchange", + "afterlayout", + "afterremoveitem", + "afterrender", + "aftersetsize", + "afterviewportanimation", + "bbox", + "beforeitemchange", + "beforelayout", + "beforeviewportanimation", + "behaviorchange", + "cancelviewportanimation", + "datachange", + "dendrogram", + "Fruchterman", + "gforce", + "graphcore", + "graphlib", + "itemchange", + "itemstatechange", + "itemstateconfigchange", + "itemvisibilitychange", + "itemzindexchange", + "keyShape", + "mapperchange", + "mindmap", + "modechange", + "onframe", + "pluginchange", + "snapline", + "themechange", + "tooltipchange", + "transientupdate", + "treecollapseexpand", + "upsert", + "viewportchange", + "watermaker", + "watermarker" + ] +} \ No newline at end of file diff --git a/README.en-US.md b/README.en-US.md index 5bfd4944fd4..1cfbfca6d43 100644 --- a/README.en-US.md +++ b/README.en-US.md @@ -62,7 +62,7 @@ The gif is not fully loaded, [Click Here to See the Original Image](https://mdn. - (TODO: migrate from v4) Abundant Built-in Items: Nodes and edges with free configurations; - (TODO: migrate from v4) Convenient Components: Outstanding ability and performance; -G6 concentrates on the principle of 'good by default'. In addition, the custom mechanism of the item, interation behavior, and layout satisfies the customazation requirements. +G6 concentrates on the principle of 'good by default'. In addition, the custom mechanism of the item, interaction behavior, and layout satisfies the customazation requirements. > Abundant Built-in Items diff --git a/packages/g6/src/item/item.ts b/packages/g6/src/item/item.ts index 44f4a209dd7..fe4feeea4cb 100644 --- a/packages/g6/src/item/item.ts +++ b/packages/g6/src/item/item.ts @@ -44,7 +44,7 @@ export default abstract class Item implements IItem { public displayModel: ItemDisplayModel; /** The mapper configured at graph with field name 'node' / 'edge' / 'combo'. */ public mapper: DisplayMapper; - /** The state sstyle mapper configured at traph with field name 'nodeState' / 'edgeState' / 'comboState'. */ + /** The state style mapper configured at graph with field name 'nodeState' / 'edgeState' / 'comboState'. */ public stateMapper: { [stateName: string]: DisplayMapper; }; @@ -88,7 +88,7 @@ export default abstract class Item implements IItem { public lodLevels: LodLevelRanges; /** Last zoom ratio. */ public zoom: number; - /** Cache the chaging states which are not consomed by draw */ + /** Cache the changing states which are not consumed by draw */ public changedStates: string[]; /** The listener for the animations frames. */ public onframe: Function; diff --git a/packages/g6/src/runtime/controller/data.ts b/packages/g6/src/runtime/controller/data.ts index e677e262363..da0f08b2d8c 100644 --- a/packages/g6/src/runtime/controller/data.ts +++ b/packages/g6/src/runtime/controller/data.ts @@ -1,7 +1,7 @@ import { Graph as GraphLib, ID } from '@antv/graphlib'; import { clone, isArray, isEmpty, isObject } from '@antv/util'; import { AABB } from '@antv/g'; -import { registery as registry } from '../../stdlib'; +import { registry } from '../../stdlib'; import { ComboModel, ComboUserModel, @@ -42,7 +42,7 @@ import { graphData2TreeData, traverse, treeData2GraphData, - validateComboStrucutre, + validateComboStructure, } from '../../util/data'; import { getExtension } from '../../util/extension'; import { isTreeLayout } from '../../util/layout'; @@ -113,13 +113,13 @@ export class DataController { }); } } else if (conditionType === 'function') { - const getDatas = + const getData = type === 'node' ? graphCore.getAllNodes : graphCore.getAllEdges; if (type === 'combo') { - // TODO getDatas = ? + // TODO getData = ? } - const datas = getDatas() as any; - return datas.filter((data) => condition(data)); + const data = getData() as any; + return data.filter((datum) => condition(datum)); } } @@ -373,7 +373,7 @@ export class DataController { nodes.forEach((node) => { if (node.data.parentId) { if ( - validateComboStrucutre(this.graph, node.id, node.data.parentId) + validateComboStructure(this.graph, node.id, node.data.parentId) ) { this.graphCore.setParent( node.id, @@ -388,7 +388,7 @@ export class DataController { combos.forEach((combo) => { if (combo.data.parentId) { if ( - validateComboStrucutre(this.graph, combo.id, combo.data.parentId) + validateComboStructure(this.graph, combo.id, combo.data.parentId) ) { this.graphCore.setParent(combo.id, combo.data.parentId, 'combo'); } else { @@ -704,7 +704,7 @@ export class DataController { graphCore.addNode({ id, data: { ...others, _isCombo: true } }); } - // update strucutre + // update structure (_children as ID[]).forEach((childId) => { if (!this.graphCore.hasNode(childId)) { console.warn( diff --git a/packages/g6/src/runtime/controller/interaction.ts b/packages/g6/src/runtime/controller/interaction.ts index bff76f2fe3c..43f40d6441a 100644 --- a/packages/g6/src/runtime/controller/interaction.ts +++ b/packages/g6/src/runtime/controller/interaction.ts @@ -1,5 +1,5 @@ import { FederatedPointerEvent, IElement } from '@antv/g'; -import { registery } from '../../stdlib'; +import { registry } from '../../stdlib'; import { IGraph } from '../../types'; import { Behavior } from '../../types/behavior'; import { @@ -100,7 +100,7 @@ export class InteractionController { } try { // Get behavior extensions from useLib. - const BehaviorClass = getExtension(config, registery.useLib, 'behavior'); + const BehaviorClass = getExtension(config, registry.useLib, 'behavior'); const options = typeof config === 'string' ? {} : config; const behavior = new BehaviorClass(options); behavior.graph = this.graph; diff --git a/packages/g6/src/runtime/controller/item.ts b/packages/g6/src/runtime/controller/item.ts index edc478219f1..8d6a65d2c27 100644 --- a/packages/g6/src/runtime/controller/item.ts +++ b/packages/g6/src/runtime/controller/item.ts @@ -1287,7 +1287,7 @@ export class ItemController { /** * Create nodes with inner data to canvas. - * @param models nodes' inner datas + * @param models nodes' inner data */ private async renderNodes( models: NodeModel[], @@ -1460,7 +1460,7 @@ export class ItemController { /** * Create edges with inner data to canvas. - * @param models edges' inner datas + * @param models edges' inner data */ private renderEdges( models: EdgeModel[], diff --git a/packages/g6/src/runtime/controller/layout.ts b/packages/g6/src/runtime/controller/layout.ts index 9f509373841..2d3d51f6d24 100644 --- a/packages/g6/src/runtime/controller/layout.ts +++ b/packages/g6/src/runtime/controller/layout.ts @@ -7,7 +7,7 @@ import { OutNode, Supervisor, } from '@antv/layout'; -import registery, { Extensions, stdLib } from '../../stdlib'; +import { Extensions, registry, stdLib } from '../../stdlib'; import { IGraph, isImmediatelyInvokedLayoutOptions, @@ -219,7 +219,7 @@ export class LayoutController { let { workerEnabled = false } = options; // Find built-in layout algorithms. - const layoutCtor = stdLib.layouts[type] || registery.useLib.layouts[type]; + const layoutCtor = stdLib.layouts[type] || registry.useLib.layouts[type]; if (!layoutCtor) { throw new Error(`Unknown layout algorithm: ${type}`); } diff --git a/packages/g6/src/runtime/graph.ts b/packages/g6/src/runtime/graph.ts index 026dc7f443e..58dac4a2525 100644 --- a/packages/g6/src/runtime/graph.ts +++ b/packages/g6/src/runtime/graph.ts @@ -1164,7 +1164,7 @@ export class Graph return this.dataController.findRelatedEdges(nodeId, direction); } /** - * Get nearby edges from a start node using quadtree collision detection. + * Get nearby edges from a start node using quad-tree collision detection. * @param nodeId id of the start node * @returns nearby edges' data array */ @@ -1920,7 +1920,7 @@ export class Graph /** * Add a new combo to the graph, and update the structure of the existed child in childrenIds to be the children of the new combo. - * Different from addData with combo type, this API update the succeeds' combo tree strucutres in the same time. + * Different from addData with combo type, this API update the succeeds' combo tree structures in the same time. * @param model combo user data. * @param childrenIds the ids of the children nodes / combos to move into the new combo. * @returns whether success @@ -2394,7 +2394,7 @@ export class Graph /** * Draw or update a G shape or group to the transient canvas. * @param type shape type or item type - * @param id new shape id or updated shape id for a interation shape, node/edge/combo id for item interaction group drawing + * @param id new shape id or updated shape id for a interaction shape, node/edge/combo id for item interaction group drawing * @returns upserted shape or group * @group Interaction */ diff --git a/packages/g6/src/runtime/hooks.ts b/packages/g6/src/runtime/hooks.ts index 3583e62b7d8..fdd1f8b6a38 100644 --- a/packages/g6/src/runtime/hooks.ts +++ b/packages/g6/src/runtime/hooks.ts @@ -1,8 +1,8 @@ import { IHook } from '../types/hook'; /** - * A hook class unified the definitions of tap, untap, and emit. - * One hook corresponds to one lifecyle on a graph. + * A hook class unified the definitions of tap, un-tap, and emit. + * One hook corresponds to one lifecycle on a graph. */ export default class Hook implements IHook { public name: string; diff --git a/packages/g6/src/stdlib/behavior/create-edge.ts b/packages/g6/src/stdlib/behavior/create-edge.ts index a2647cdce26..84f0ba5cf6e 100644 --- a/packages/g6/src/stdlib/behavior/create-edge.ts +++ b/packages/g6/src/stdlib/behavior/create-edge.ts @@ -20,7 +20,7 @@ interface CreateEdgeOptions { trigger: (typeof EVENT_TRIGGERS)[number]; /** * The assistant secondary key on keyboard. If it is not assigned, the behavior will be triggered when trigger happens. - * cound be 'shift', 'ctrl', 'control', 'alt', 'meta', undefined. + * could be 'shift', 'ctrl', 'control', 'alt', 'meta', undefined. */ secondaryKey?: (typeof KEYBOARD_TRIGGERS)[number]; /** diff --git a/packages/g6/src/stdlib/behavior/drag-canvas.ts b/packages/g6/src/stdlib/behavior/drag-canvas.ts index 3ebe89b508d..22c88e0abc4 100644 --- a/packages/g6/src/stdlib/behavior/drag-canvas.ts +++ b/packages/g6/src/stdlib/behavior/drag-canvas.ts @@ -27,7 +27,7 @@ export interface DragCanvasOptions { */ secondaryKey?: string; /** - * The assistant secondary key on keyboard to prevent the behavior to be tiggered. 'shift' by default. + * The assistant secondary key on keyboard to prevent the behavior to be triggered. 'shift' by default. */ secondaryKeyToDisable?: string; /** diff --git a/packages/g6/src/stdlib/behavior/drag-node.ts b/packages/g6/src/stdlib/behavior/drag-node.ts index 59e7fe64452..555b4a334d2 100644 --- a/packages/g6/src/stdlib/behavior/drag-node.ts +++ b/packages/g6/src/stdlib/behavior/drag-node.ts @@ -179,7 +179,7 @@ export class DragNode extends Behavior { return relatedNodes; } - /** Retrieve the nearby edges for a given node using quadtree collision detection. */ + /** Retrieve the nearby edges for a given node using quad-tree collision detection. */ private getNearEdgesForNodes( nodeIds: ID[], shouldBegin?: (edge: EdgeModel) => boolean, diff --git a/packages/g6/src/stdlib/behavior/hover-activate.ts b/packages/g6/src/stdlib/behavior/hover-activate.ts index 2e1ba544d4f..08dc4f9fed5 100644 --- a/packages/g6/src/stdlib/behavior/hover-activate.ts +++ b/packages/g6/src/stdlib/behavior/hover-activate.ts @@ -15,7 +15,7 @@ export interface HoverActivateOptions { */ activateState?: string; /** - * Item types to be able to acitvate. + * Item types to be able to activate. * Defaults to `["node", "edge"]`. * Should be an array of "node", "edge", or "combo". */ diff --git a/packages/g6/src/stdlib/behavior/orbit-canvas-3d.ts b/packages/g6/src/stdlib/behavior/orbit-canvas-3d.ts index 05468b67d30..f79459b9f72 100644 --- a/packages/g6/src/stdlib/behavior/orbit-canvas-3d.ts +++ b/packages/g6/src/stdlib/behavior/orbit-canvas-3d.ts @@ -8,7 +8,7 @@ const VALID_TRIGGERS = ['drag', 'directionKeys']; export interface OrbitCanvas3DOptions { /** - * The way to tranlate the canvas. 'drag' (default) means dragged by mouse, 'directionKeys' means the up/down/left/right key on keyBoard. + * The way to translate the canvas. 'drag' (default) means dragged by mouse, 'directionKeys' means the up/down/left/right key on keyBoard. */ trigger?: 'drag' | 'directionKeys'; /** diff --git a/packages/g6/src/stdlib/behavior/rotate-canvas-3d.ts b/packages/g6/src/stdlib/behavior/rotate-canvas-3d.ts index ba6e4a600bb..8c0ed0b2e3a 100644 --- a/packages/g6/src/stdlib/behavior/rotate-canvas-3d.ts +++ b/packages/g6/src/stdlib/behavior/rotate-canvas-3d.ts @@ -7,7 +7,7 @@ const VALID_TRIGGERS = ['drag', 'directionKeys']; export interface RotateCanvas3DOptions { /** - * The way to tranlate the canvas. 'drag' (default) means dragged by mouse, 'directionKeys' means the up/down/left/right key on keyBoard. + * The way to translate the canvas. 'drag' (default) means dragged by mouse, 'directionKeys' means the up/down/left/right key on keyBoard. */ trigger?: 'drag' | 'directionKeys'; /** @@ -18,7 +18,7 @@ export interface RotateCanvas3DOptions { */ secondaryKey?: string; /** - * To speed up rotating while pressing and rotate the canvas by direciton keys (trigger = 'directionKeys'). + * To speed up rotating while pressing and rotate the canvas by direction keys (trigger = 'directionKeys'). */ speedUpKey?: string; /** diff --git a/packages/g6/src/stdlib/behavior/scroll-canvas.ts b/packages/g6/src/stdlib/behavior/scroll-canvas.ts index c52963861c8..ab866d500c2 100644 --- a/packages/g6/src/stdlib/behavior/scroll-canvas.ts +++ b/packages/g6/src/stdlib/behavior/scroll-canvas.ts @@ -222,10 +222,10 @@ export class ScrollCanvas extends Behavior { graph.getSpecification().optimize || {}; const { optimizeZoom } = options; const optimize = this.options.enableOptimize || graphBehaviorOptimize; - const shouldOptimzie = isNumber(optimize) + const shouldOptimize = isNumber(optimize) ? graph.getAllNodesData().length > optimize : optimize; - if (shouldOptimzie) { + if (shouldOptimize) { const currentZoom = graph.getZoom(); const newHiddenEdgeIds = graph .getAllEdgesData() @@ -278,7 +278,7 @@ export class ScrollCanvas extends Behavior { const { optimizeZoom } = this.options; // hide the shapes when the zoom ratio is smaller than optimizeZoom - // hide the shapes when zoomming + // hide the shapes when zooming if (currentZoom < optimizeZoom) { return; } @@ -286,10 +286,10 @@ export class ScrollCanvas extends Behavior { const { tileBehavior: graphBehaviorOptimize, tileBehaviorSize = 1000 } = graph.getSpecification().optimize || {}; const optimize = this.options.enableOptimize || graphBehaviorOptimize; - const shouldOptimzie = isNumber(optimize) + const shouldOptimize = isNumber(optimize) ? graph.getAllNodesData().length > optimize : optimize; - if (!shouldOptimzie) { + if (!shouldOptimize) { this.hiddenEdgeIds = this.hiddenNodeIds = []; return; } diff --git a/packages/g6/src/stdlib/behavior/track-canvas-3d.ts b/packages/g6/src/stdlib/behavior/track-canvas-3d.ts index 8a959367f72..7a181d6361b 100644 --- a/packages/g6/src/stdlib/behavior/track-canvas-3d.ts +++ b/packages/g6/src/stdlib/behavior/track-canvas-3d.ts @@ -8,7 +8,7 @@ const VALID_TRIGGERS = ['drag', 'directionKeys']; export interface TrackCanvas3DOptions { /** - * The way to tranlate the canvas. 'drag' (default) means dragged by mouse, 'directionKeys' means the up/down/left/right key on keyBoard. + * The way to translate the canvas. 'drag' (default) means dragged by mouse, 'directionKeys' means the up/down/left/right key on keyBoard. */ trigger?: 'drag' | 'directionKeys'; /** diff --git a/packages/g6/src/stdlib/behavior/zoom-canvas-3d.ts b/packages/g6/src/stdlib/behavior/zoom-canvas-3d.ts index 2bcdb6cee47..19773f51761 100644 --- a/packages/g6/src/stdlib/behavior/zoom-canvas-3d.ts +++ b/packages/g6/src/stdlib/behavior/zoom-canvas-3d.ts @@ -9,7 +9,7 @@ const VALID_TRIGGERS = ['wheel', 'upDownKeys']; export interface ZoomCanvas3DOptions { /** - * The way to tranlate the canvas. 'drag' (default) means dragged by mouse, 'directionKeys' means the up/down/left/right key on keyBoard. + * The way to translate the canvas. 'drag' (default) means dragged by mouse, 'directionKeys' means the up/down/left/right key on keyBoard. */ trigger?: 'wheel' | 'upDownKeys'; /** diff --git a/packages/g6/src/stdlib/behavior/zoom-canvas.ts b/packages/g6/src/stdlib/behavior/zoom-canvas.ts index 96f81bb6d32..a76b96ad57b 100644 --- a/packages/g6/src/stdlib/behavior/zoom-canvas.ts +++ b/packages/g6/src/stdlib/behavior/zoom-canvas.ts @@ -124,10 +124,10 @@ export class ZoomCanvas extends Behavior { this.options.enableOptimize !== undefined ? this.options.enableOptimize : graphBehaviorOptimize; - const shouldOptimze = isNumber(optimize) + const shouldOptimize = isNumber(optimize) ? graph.getAllNodesData().length > optimize : optimize; - if (shouldOptimze) { + if (shouldOptimize) { this.hiddenEdgeIds = graph .getAllEdgesData() .map((edge) => edge.id) @@ -169,11 +169,11 @@ export class ZoomCanvas extends Behavior { this.options.enableOptimize !== undefined ? this.options.enableOptimize : graphBehaviorOptimize; - const shouldOptimze = isNumber(optimize) + const shouldOptimize = isNumber(optimize) ? graph.getAllNodesData().length > optimize : optimize; this.zooming = false; - if (shouldOptimze) { + if (shouldOptimize) { if (this.tileRequestId) { cancelAnimationFrame(this.tileRequestId); this.tileRequestId = undefined; diff --git a/packages/g6/src/stdlib/index.ts b/packages/g6/src/stdlib/index.ts index 0dd4010ef11..63624fba7ea 100644 --- a/packages/g6/src/stdlib/index.ts +++ b/packages/g6/src/stdlib/index.ts @@ -211,7 +211,7 @@ const utils = { lassoSelector, }; -const registery = { useLib }; +const registry = { useLib }; const Extensions = { // transforms @@ -305,5 +305,5 @@ const Extensions = { WaterMarker, }; -export default registery; -export { Extensions, registery, stdLib, utils }; +export default registry; +export { Extensions, registry, stdLib, utils }; diff --git a/packages/g6/src/stdlib/item/node/base.ts b/packages/g6/src/stdlib/item/node/base.ts index c950a0c3190..00b02ca16ff 100644 --- a/packages/g6/src/stdlib/item/node/base.ts +++ b/packages/g6/src/stdlib/item/node/base.ts @@ -47,7 +47,7 @@ export abstract class BaseNode { // cache the zoom level infomations protected zoomCache: { - // last responsed zoom ratio. + // last response zoom ratio. zoom: number; // wordWrapWidth of labelShape according to the maxWidth wordWrapWidth: number; @@ -347,7 +347,7 @@ export abstract class BaseNode { ): DisplayObject { const { labelShape } = shapeMap; if (!labelShape || !labelShape.style.text || !model.data.labelShape) return; - // label's local bounds, will take scale into acount + // label's local bounds, will take scale into account const textBBoxGeo = labelShape.getGeometryBounds(); const height = textBBoxGeo.max[1] - textBBoxGeo.min[1]; const width = Math.min( diff --git a/packages/g6/src/stdlib/item/node/donut.ts b/packages/g6/src/stdlib/item/node/donut.ts index ea132945402..cc8707bfc66 100644 --- a/packages/g6/src/stdlib/item/node/donut.ts +++ b/packages/g6/src/stdlib/item/node/donut.ts @@ -252,7 +252,7 @@ export class DonutNode extends BaseNode { diffData?: { previous: NodeModelData; current: NodeModelData }, diffState?: { previous: State[]; current: State[] }, ): { - beginAngle: number; // next begin iangle + beginAngle: number; // next begin angle shouldEnd: boolean; // finish fans drawing } => { const { diff --git a/packages/g6/src/stdlib/plugin/hull/bubbleset.ts b/packages/g6/src/stdlib/plugin/hull/bubbleset.ts index 4cd5f5dd526..87c619c682b 100644 --- a/packages/g6/src/stdlib/plugin/hull/bubbleset.ts +++ b/packages/g6/src/stdlib/plugin/hull/bubbleset.ts @@ -39,7 +39,7 @@ const defaultOps = { }; /** - * Marching square algorithm for traching the contour of a pixel group + * Marching square algorithm for tracking the contour of a pixel group * https://www.emanueleferonato.com/2013/03/01/using-marching-squares-algorithm-to-trace-the-contour-of-an-image/ * @param potentialArea * @param threshold @@ -183,21 +183,21 @@ const pickBestNeighbor = ( visited: (NodeModel | ComboModel)[], nonMembers: (NodeModel | ComboModel)[], ): NodeModel | ComboModel | null => { - let closestNeighbour = null; + let closestNeighbor = null; let minCost = Number.POSITIVE_INFINITY; visited.forEach((neighborModel) => { const itemP = { x: model.data.x, y: model.data.y } as Point; - const neighbourItemP = { + const neighborItemP = { x: neighborModel.data.x, y: neighborModel.data.y, } as Point; - const dist = squareDist(itemP, neighbourItemP); + const dist = squareDist(itemP, neighborItemP); const directLine = new LineStructure( itemP.x, itemP.y, - neighbourItemP.x, - neighbourItemP.y, + neighborItemP.x, + neighborItemP.y, ); const numberObstacles = nonMembers.reduce((count, _item) => { if (fractionToLine(graph, _item.id, directLine) > 0) { @@ -206,11 +206,11 @@ const pickBestNeighbor = ( return count; }, 0); if (dist * (numberObstacles + 1) ** 2 < minCost) { - closestNeighbour = neighborModel; + closestNeighbor = neighborModel; minCost = dist * (numberObstacles + 1) ** 2; } }); - return closestNeighbour; + return closestNeighbor; }; /** @@ -449,7 +449,7 @@ function getRoute( } /** - * Calculate the countor that includes the selected items and exclues the non-selected items + * Calculate the counter that includes the selected items and excludes the non-selected items * @param members * @param nonMembers * @param options @@ -492,7 +492,7 @@ export const genBubbleSet = ( // virtualEdges.push(new LineStructure(e.getSource().getModel().x, e.getSource().getModel().y, e.getTarget().getModel().x, e.getTarget().getModel().y)); // }); - const activeRegion = getActiveRregion( + const activeRegion = getActiveRegion( graph, members, virtualEdges, @@ -567,7 +567,7 @@ export const genBubbleSet = ( return hull; } - // update parameters for next iteraction + // update parameters for next interaction options.threshold *= 0.9; if (iterations <= options.maxMarchingIterations * 0.5) { options.memberInfluenceFactor *= 1.2; @@ -586,11 +586,11 @@ export const genBubbleSet = ( }; /** - * unionboundingbox + * union bounding box * @param members * @param edges */ -function getActiveRregion( +function getActiveRegion( graph: IGraph, members: (NodeModel | ComboModel)[], edges: LineStructure[], @@ -789,7 +789,7 @@ function rerouteLine( ); } - // Find the position of the control point according to the intersect of line and boundinb box + // Find the position of the control point according to the intersect of line and bounding box if (leftIntersect) { // If there is a triangle in the intersect area if (topIntersect) diff --git a/packages/g6/src/stdlib/plugin/hull/index.ts b/packages/g6/src/stdlib/plugin/hull/index.ts index 2f858d50995..71d872e510f 100644 --- a/packages/g6/src/stdlib/plugin/hull/index.ts +++ b/packages/g6/src/stdlib/plugin/hull/index.ts @@ -192,7 +192,7 @@ export default class Hull extends Base { const hullComponent = this.hullMap[id]; if (!hullComponent) { console.warn( - `Add member to hull faield. The hull with id ${id} is not exist`, + `Add member to hull failed. The hull with id ${id} is not exist`, ); return; } @@ -203,7 +203,7 @@ export default class Hull extends Base { const hullComponent = this.hullMap[id]; if (!hullComponent) { console.warn( - `Remove member from hull faield. The hull with id ${id} is not exist`, + `Remove member from hull failed. The hull with id ${id} is not exist`, ); return; } @@ -214,7 +214,7 @@ export default class Hull extends Base { const hullComponent = this.hullMap[id]; if (!hullComponent) { console.warn( - `Add non member to hull faield. The hull with id ${id} is not exist`, + `Add non member to hull failed. The hull with id ${id} is not exist`, ); return; } @@ -225,7 +225,7 @@ export default class Hull extends Base { const hullComponent = this.hullMap[id]; if (!hullComponent) { console.warn( - `Remove non member from hull faield. The hull with id ${id} is not exist`, + `Remove non member from hull failed. The hull with id ${id} is not exist`, ); return; } diff --git a/packages/g6/src/stdlib/plugin/hull/util.ts b/packages/g6/src/stdlib/plugin/hull/util.ts index 6f7f8197822..2b14a36189b 100644 --- a/packages/g6/src/stdlib/plugin/hull/util.ts +++ b/packages/g6/src/stdlib/plugin/hull/util.ts @@ -11,7 +11,7 @@ import { getLineIntersect } from '../../../util/shape'; export const getClosedSpline = (points: Point[]) => { if (points.length < 2) { throw new Error( - `point length must largn than 2, now it's ${points.length}`, + `point length must large than 2, now it's ${points.length}`, ); } const first = points[0]; diff --git a/packages/g6/src/stdlib/plugin/legend/index.ts b/packages/g6/src/stdlib/plugin/legend/index.ts index d3239b7e84e..623f5986ebd 100644 --- a/packages/g6/src/stdlib/plugin/legend/index.ts +++ b/packages/g6/src/stdlib/plugin/legend/index.ts @@ -374,11 +374,11 @@ export class Legend extends Base { const { size: legendSize, grid } = this.getLegendSize(rows, cols, padding); // Gets all the data for the given item type and extracts the unique types based on the typeField. - const datas = + const data = itemType === 'node' ? graph.getAllNodesData() : graph.getAllEdgesData(); const typeSet = new Set(); const typeModelMap = {}; - datas.map((model) => { + data.map((model) => { if (model.data[typeField]) { const type = model.data[typeField]; typeSet.add(type); @@ -514,11 +514,11 @@ export class Legend extends Base { new Shape({ style, id: `marker-${itemType}-${typeValue}` }); }, mouseenter: (ele) => - this.handleMouseEnter(ele, types, typeField, itemType, datas), + this.handleMouseEnter(ele, types, typeField, itemType, data), mouseleave: (ele) => this.handleMouseLeave(ele, types, typeField, itemType), click: (ele) => - this.handleClick(ele, types, typeField, itemType, datas), + this.handleClick(ele, types, typeField, itemType, data), }, }); @@ -607,7 +607,7 @@ export class Legend extends Base { : size[1], ]; this.canvas.resize(canvasSize[0], canvasSize[1]); - // During serverside rendering, wrapper is not available. + // During server-side rendering, wrapper is not available. if (this.wrapper) { this.wrapper.style.width = `${canvasSize[0]}px`; this.wrapper.style.height = `${canvasSize[1]}px`; @@ -703,16 +703,16 @@ export class Legend extends Base { * @param {Array} types - An array of all the types on the legend. * @param {string} typeField - The field that contains the type information. * @param {string} itemType - The type of item, node or edge. - * @param {Array} datas - An array of data models. + * @param {Array} data - An array of data models. */ - private handleMouseEnter(ele, types, typeField, itemType, datas) { + private handleMouseEnter(ele, types, typeField, itemType, data) { const { graph, options } = this; const { activeState } = options; if (!activeState) return; const { index } = ele.__data__; const type = types[index]; this.activeType[typeField] = type; - const activeIds = datas + const activeIds = data .filter((model) => model.data[typeField] === type) .map((model) => model.id); graph.setItemState(activeIds, activeState, true); @@ -755,15 +755,15 @@ export class Legend extends Base { * @param {Array} types - An array of all the types on the legend. * @param {string} typeField - The field in the data model that contains the type of the data. * @param {string} itemType - The type of the item, node or edge. - * @param {Array} datas - An array of data models. + * @param {Array} data - An array of data models. */ - private handleClick(ele, types, typeField, itemType, datas) { + private handleClick(ele, types, typeField, itemType, data) { const { graph, options } = this; const { selectedState } = options; if (!selectedState) return; const { index } = ele.__data__; const type = types[index]; - const ids = datas + const ids = data .filter((model) => model.data[typeField] === type) .map((model) => model.id); if (this.selectedTypes[itemType].has(type)) { diff --git a/packages/g6/src/stdlib/plugin/lodController/index.ts b/packages/g6/src/stdlib/plugin/lodController/index.ts index 89f2f33c529..d008fba7067 100644 --- a/packages/g6/src/stdlib/plugin/lodController/index.ts +++ b/packages/g6/src/stdlib/plugin/lodController/index.ts @@ -82,7 +82,7 @@ export class LodController extends Base { } protected onAfterRender = () => { - // show the shapes with lod when diableLod is true + // show the shapes with lod when disableLod is true const { graph, options } = this; this.clearCache(); diff --git a/packages/g6/src/stdlib/plugin/menu/index.ts b/packages/g6/src/stdlib/plugin/menu/index.ts index 5f7e2576caf..7c46b938127 100644 --- a/packages/g6/src/stdlib/plugin/menu/index.ts +++ b/packages/g6/src/stdlib/plugin/menu/index.ts @@ -190,7 +190,7 @@ export class Menu extends Base { //the type is string menuDom.innerHTML = menu; } else if (menu instanceof HTMLElement) { - //the type is htmldom + //the type is html dom menuDom.innerHTML = menu.outerHTML; } else { //the type is Promise diff --git a/packages/g6/src/stdlib/plugin/snapline/index.ts b/packages/g6/src/stdlib/plugin/snapline/index.ts index 42221ed588d..1ff75ea9de6 100644 --- a/packages/g6/src/stdlib/plugin/snapline/index.ts +++ b/packages/g6/src/stdlib/plugin/snapline/index.ts @@ -20,7 +20,7 @@ type LinePosition = 'top' | 'hcenter' | 'bottom' | 'left' | 'vcenter' | 'right'; /** * Line for draw - * first point: point on constractItem + * first point: point on contrastItem * second point: point on draggingItem */ type DrawLine = { line: [Point, Point]; lp: LinePosition }; @@ -47,7 +47,7 @@ export class Snapline extends Base { ] = [undefined, undefined]; /** - * Cache the nodes' positions to be throttly updated. + * Cache the nodes' positions to be throttle updated. */ private updateCache: Map = new Map(); @@ -823,7 +823,7 @@ export class Snapline extends Base { this.updateAlignLineWhenAbsorb([true, false]); } else { // cancel absorb - // 1.update positon + // 1.update position this.doUpdatePosition({ fx: undefined }); // 2.remove align line && update state this.removeAlignLine([true, undefined]); diff --git a/packages/g6/src/stdlib/plugin/tooltip/index.ts b/packages/g6/src/stdlib/plugin/tooltip/index.ts index 466364caa1f..2f79f6bd536 100644 --- a/packages/g6/src/stdlib/plugin/tooltip/index.ts +++ b/packages/g6/src/stdlib/plugin/tooltip/index.ts @@ -92,7 +92,7 @@ export class Tooltip extends Base { private currentTarget; private asyncTooltip; private currentAsyncTarget; - private hidenTimer; //delay hiding tooltip + private hiddenTimer; //delay hiding tooltip constructor(options?: TooltipConfig) { super(options); @@ -245,7 +245,7 @@ export class Tooltip extends Base { } public async showTooltip(e: IG6GraphEvent) { - clearTimeout(this.hidenTimer); + clearTimeout(this.hiddenTimer); if (!e.itemId) { return; } @@ -294,11 +294,11 @@ export class Tooltip extends Base { public hideTooltip() { const tooltip = this.tooltip; if (tooltip) { - this.hidenTimer = setTimeout(() => { + this.hiddenTimer = setTimeout(() => { modifyCSS(tooltip, { visibility: 'hidden', display: 'none' }); }, 100); tooltip.addEventListener('pointerenter', (e) => { - clearTimeout(this.hidenTimer); + clearTimeout(this.hiddenTimer); }); tooltip.addEventListener('pointerleave', (e) => { modifyCSS(tooltip, { visibility: 'hidden', display: 'none' }); diff --git a/packages/g6/src/stdlib/plugin/watermaker/index.ts b/packages/g6/src/stdlib/plugin/watermaker/index.ts index 3b6d16c8ea2..565a624705f 100644 --- a/packages/g6/src/stdlib/plugin/watermaker/index.ts +++ b/packages/g6/src/stdlib/plugin/watermaker/index.ts @@ -41,7 +41,7 @@ export interface WaterMarkerConfig extends IPluginBaseConfig { /** The first marker's position. [0, 0] by default. */ begin?: [number, number]; /** The gap of x and y between neighbor markers. [100, 100] by default. */ - seperation?: [number, number]; + separation?: [number, number]; } export class WaterMarker extends Base { @@ -64,7 +64,7 @@ export class WaterMarker extends Base { height: undefined, position: 'bottom', begin: [0, 0], - seperation: [100, 100], + separation: [100, 100], image: { imgURL: 'https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg', @@ -201,7 +201,7 @@ export class WaterMarker extends Base { */ public setImageWaterMarker() { const { canvas, options, canvasSize } = this; - const { image, begin, seperation } = options; + const { image, begin, separation } = options; const { imgURL, rotate = 0, ...imageStyles } = image; const currentPosition = [...begin]; @@ -225,14 +225,14 @@ export class WaterMarker extends Base { imageBounds = imageShape.getLocalBounds(); } rowGroup.appendChild(imageShape); - currentPosition[0] += imageBounds.halfExtents[0] * 2 + seperation[0]; + currentPosition[0] += imageBounds.halfExtents[0] * 2 + separation[0]; } return rowGroup; }; while (currentPosition[1] < canvasSize[1]) { canvas.appendChild(getRowGroup()); currentPosition[0] = begin[0]; - currentPosition[1] += imageBounds.halfExtents[1] * 2 + seperation[1]; + currentPosition[1] += imageBounds.halfExtents[1] * 2 + separation[1]; } } @@ -241,7 +241,7 @@ export class WaterMarker extends Base { */ public async setTextWaterMarker() { const { canvas, options, canvasSize } = this; - const { text, seperation, begin } = options; + const { text, separation, begin } = options; const { texts, rotate, ...textStyles } = text; const currentPosition = [...begin]; @@ -266,14 +266,14 @@ export class WaterMarker extends Base { textBounds = textShape.getLocalBounds(); } rowGroup.appendChild(textShape); - currentPosition[0] += textBounds.halfExtents[0] * 2 + seperation[0]; + currentPosition[0] += textBounds.halfExtents[0] * 2 + separation[0]; } return rowGroup; }; while (currentPosition[1] < canvasSize[1]) { canvas.appendChild(getRowGroup()); currentPosition[0] = begin[0]; - currentPosition[1] += textBounds.halfExtents[1] * 2 + seperation[1]; + currentPosition[1] += textBounds.halfExtents[1] * 2 + separation[1]; } } diff --git a/packages/g6/src/stdlib/selector/lasso.ts b/packages/g6/src/stdlib/selector/lasso.ts index 529191d62d0..48c84e98c99 100644 --- a/packages/g6/src/stdlib/selector/lasso.ts +++ b/packages/g6/src/stdlib/selector/lasso.ts @@ -20,7 +20,7 @@ export default (graph: IGraph, points: Point[], itemTypes: ITEM_TYPE[]) => { graph.getAllNodesData().forEach((node) => { const { id } = node; if (!graph.getItemVisible(id)) return; // hidden node is not selectable - if (isItemIntersecPolygon(graph, id, lassoContour)) { + if (isItemIntersectPolygon(graph, id, lassoContour)) { selectedNodeIds.push(id); } }); @@ -31,7 +31,7 @@ export default (graph: IGraph, points: Point[], itemTypes: ITEM_TYPE[]) => { const { id } = combo; if ( graph.getItemVisible(id) && // hidden combo is not selectable - isItemIntersecPolygon(graph, id, lassoContour) + isItemIntersectPolygon(graph, id, lassoContour) ) { selectedComboIds.push(id); } @@ -52,7 +52,7 @@ export default (graph: IGraph, points: Point[], itemTypes: ITEM_TYPE[]) => { combos: selectedComboIds, }; }; -const isItemIntersecPolygon = ( +const isItemIntersectPolygon = ( graph: IGraph, id: ID, polyPoints: number[][], diff --git a/packages/g6/src/stdlib/themeSolver/spec.ts b/packages/g6/src/stdlib/themeSolver/spec.ts index 79e7cb85fdd..db53ae7b9bd 100644 --- a/packages/g6/src/stdlib/themeSolver/spec.ts +++ b/packages/g6/src/stdlib/themeSolver/spec.ts @@ -96,11 +96,11 @@ export class SpecThemeSolver extends BaseThemeSolver { mergedStyles = { others: baseStyles }; Object.keys(incomingStyles).forEach((dataType) => { const mergedStatesStyles = { ...baseStyles }; - const incomintStyle = incomingStyles[dataType]; - Object.keys(incomintStyle).forEach((stateName) => { + const incomingStyle = incomingStyles[dataType]; + Object.keys(incomingStyle).forEach((stateName) => { mergedStatesStyles[stateName] = mergeStyles([ baseStyles[stateName], - incomintStyle[stateName], + incomingStyle[stateName], ]); }); mergedStyles[dataType] = mergedStatesStyles; diff --git a/packages/g6/src/stdlib/themeSolver/subject.ts b/packages/g6/src/stdlib/themeSolver/subject.ts index 8a4fd23fedb..1d8bad338dd 100644 --- a/packages/g6/src/stdlib/themeSolver/subject.ts +++ b/packages/g6/src/stdlib/themeSolver/subject.ts @@ -265,7 +265,7 @@ export class SubjectThemeSolver extends BaseThemeSolver { } /** - * get the mix color of backColor and frontColor with alpah + * get the mix color of backColor and frontColor with alpha * @param backColor background color * @param frontColor foreground color * @param frontAlpha the opacity of foreground color diff --git a/packages/g6/src/types/animate.ts b/packages/g6/src/types/animate.ts index 93fdf221aee..1d70fa9ba30 100644 --- a/packages/g6/src/types/animate.ts +++ b/packages/g6/src/types/animate.ts @@ -17,7 +17,7 @@ export interface AnimateCfg { */ delay?: number; /** - * Iteration number for the animation, Inifinity means repeat. + * Iteration number for the animation, Infinity means repeat. * @type {number | typeof Infinity} */ iterations?: number | typeof Infinity; @@ -45,7 +45,7 @@ export interface IAnimate { fields?: string[]; // shapeId for the animate, 'group' by default, means animation on whole graphics group shapeId?: string; - // the order of the animate, 0 by dfault + // the order of the animate, 0 by default order?: number; // animate options duration?: number; diff --git a/packages/g6/src/types/graph.ts b/packages/g6/src/types/graph.ts index a160443586c..9f70b1f3e0b 100644 --- a/packages/g6/src/types/graph.ts +++ b/packages/g6/src/types/graph.ts @@ -159,7 +159,7 @@ export interface IGraph< direction?: 'in' | 'out' | 'both', ) => EdgeModel[]; /** - * Get nearby edges from a start node using quadtree collision detection. + * Get nearby edges from a start node using quad-tree collision detection. * @param nodeId id of the start node * @returns nearby edges' data array * @group Data @@ -203,7 +203,7 @@ export interface IGraph< * Change graph data. * @param data new data * @param type the way to change data, 'replace' means discard the old data and use the new one; 'mergeReplace' means merge the common part, remove (old - new), add (new - old) - * @param relayout whether relayout the nodes after data changing + * @param re-layout whether re-layout the nodes after data changing * @returns * @group Data */ @@ -237,7 +237,7 @@ export interface IGraph< * Add one or more node/edge/combo data to the graph. * @param itemType item type * @param model user data - * @returns whehter success + * @returns whether success * @group Data */ addData: ( @@ -260,7 +260,7 @@ export interface IGraph< * Remove one or more node/edge/combo data from the graph. * @param itemType the type the item(s) to be removed. * @param id the id or the ids' array of the items to be removed. - * @returns whehter success + * @returns whether success * @group Data */ removeData: (itemType: ITEM_TYPE, id: ID | ID[]) => void; @@ -623,7 +623,7 @@ export interface IGraph< /** * Get the visibility for a node / edge / combo. * @param id the id for the node / edge / combo - * @returns visibility for the item, false for invisible or unexistence for the item + * @returns visibility for the item, false for invisible or un-existence for the item */ getItemVisible: (id: ID) => boolean; @@ -638,7 +638,7 @@ export interface IGraph< /** * Add a new combo to the graph, and update the structure of the existed child in childrenIds to be the children of the new combo. - * Different from addData with combo type, this API update the succeeds' combo tree strucutres in the same time. + * Different from addData with combo type, this API update the succeeds' combo tree structures in the same time. * @param model combo user data. * @param childrenIds the ids of the children nodes / combos to move into the new combo. * @returns whether success @@ -717,7 +717,7 @@ export interface IGraph< /** * Draw or update a G shape or group to the transient canvas. * @param type shape type or item type - * @param id new shape id or updated shape id for a interation shape, node/edge/combo id for item interaction group drawing + * @param id new shape id or updated shape id for a interaction shape, node/edge/combo id for item interaction group drawing * @returns upserted shape or group * @group Interaction */ diff --git a/packages/g6/src/types/item.ts b/packages/g6/src/types/item.ts index 43813f0c4b1..4d0c17caabd 100644 --- a/packages/g6/src/types/item.ts +++ b/packages/g6/src/types/item.ts @@ -100,7 +100,7 @@ export interface ShapesEncode { iconShape?: ShapeAttrEncode | Encode; otherShapes?: { [shapeId: string]: { - [shapeAtrr: string]: unknown | Encode; + [shapeAttr: string]: unknown | Encode; }; }; } @@ -198,7 +198,7 @@ export interface IItem { displayModel: ItemDisplayModel; /** The style mapper configured at graph with field name 'node' / 'edge' / 'combo'. */ mapper: DisplayMapper; - /** The state sstyle mapper configured at traph with field name 'nodeState' / 'edgeState' / 'comboState'. */ + /** The state style mapper configured at graph with field name 'nodeState' / 'edgeState' / 'comboState'. */ stateMapper: { [stateName: string]: DisplayMapper; }; @@ -233,7 +233,7 @@ export interface IItem { lodLevels: LodLevelRanges; /** Last zoom ratio. */ zoom: number; - /** Cache the chaging states which are not consomed by draw */ + /** Cache the changing states which are not consumed by draw */ changedStates: string[]; /** The listener for the animations frames. */ onframe: Function; @@ -332,7 +332,7 @@ export interface IItem { getBBox: () => AABB; /** Stop all the animations on the item. */ stopAnimations: () => void; - /** Animations' frame listemer. */ + /** Animations' frame listener. */ animateFrameListener: Function; /** Call render extension's onZoom to response the graph zooming. */ updateZoom: (zoom: number) => void; diff --git a/packages/g6/src/types/layout.ts b/packages/g6/src/types/layout.ts index a745462d800..ba2721cb7a2 100644 --- a/packages/g6/src/types/layout.ts +++ b/packages/g6/src/types/layout.ts @@ -35,7 +35,7 @@ type Workerized = { workerEnabled?: boolean; /** - * Iterations for iteratable layouts such as Force. + * Iterations for iterable layouts such as Force. */ iterations?: number; }; diff --git a/packages/g6/src/types/plugin.ts b/packages/g6/src/types/plugin.ts index 2fba02dfe62..dd1a6cd1aab 100644 --- a/packages/g6/src/types/plugin.ts +++ b/packages/g6/src/types/plugin.ts @@ -45,7 +45,7 @@ export abstract class Plugin { } /** - * Get the defualt options of the plugin. + * Get the default options of the plugin. */ public getDefaultCfgs() { return {}; diff --git a/packages/g6/src/types/spec.ts b/packages/g6/src/types/spec.ts index 47da986c094..d253b3cdf84 100644 --- a/packages/g6/src/types/spec.ts +++ b/packages/g6/src/types/spec.ts @@ -61,7 +61,7 @@ export interface Specification< tileFirstRender?: boolean | number; /** Tile size for first rendering. */ tileFirstRenderSize?: number; - /** Whether enable tile hiding / showing for behaivors, e.g. hiding shapes while drag-canvas, zoom-canvas. The enableOptimize in behavior configuration has higher priority. */ + /** Whether enable tile hiding / showing for behaviors, e.g. hiding shapes while drag-canvas, zoom-canvas. The enableOptimize in behavior configuration has higher priority. */ tileBehavior?: boolean | number; /** Tile size for shape optimizing by behaviors, e.g. hiding shapes while drag-canvas, zoom-canvas. The enableOptimize in behavior configuration has higher priority. */ tileBehaviorSize?: number; diff --git a/packages/g6/src/types/theme.ts b/packages/g6/src/types/theme.ts index 337c34598c8..97e85eece70 100644 --- a/packages/g6/src/types/theme.ts +++ b/packages/g6/src/types/theme.ts @@ -19,7 +19,7 @@ export abstract class Theme { destroy() {} } -/** Theme regisry table. +/** Theme registry table. * @example { 'drag-node': DragNodeBehavior, 'my-drag-node': MyDragNodeBehavior } */ export interface ThemeRegistry { diff --git a/packages/g6/src/types/view.ts b/packages/g6/src/types/view.ts index 8d7ec15b398..7974e69a9cd 100644 --- a/packages/g6/src/types/view.ts +++ b/packages/g6/src/types/view.ts @@ -1,5 +1,5 @@ export interface FitViewRules { - /** Whehter fit it only when the graph is out of the viewport. */ + /** Whether fit it only when the graph is out of the viewport. */ onlyOutOfViewport?: boolean; /** Whether zoom the graph only when the graph is larger than the viewport. */ onlyZoomAtLargerThanViewport?: boolean; diff --git a/packages/g6/src/util/animate.ts b/packages/g6/src/util/animate.ts index 3c204c8ec53..e10e5615e35 100644 --- a/packages/g6/src/util/animate.ts +++ b/packages/g6/src/util/animate.ts @@ -509,7 +509,7 @@ export const getAnimatesExcludePosition = (animates) => { }; export const fadeIn = (id, shape, style, hiddenShape, animateConfig) => { - // omit inexist shape and the shape which is not hidden by zoom changing + // omit in-existence shape and the shape which is not hidden by zoom changing if (!shape || !hiddenShape[id]) return; if (!shape?.isVisible()) { shape.style.opacity = 0; diff --git a/packages/g6/src/util/data.ts b/packages/g6/src/util/data.ts index 8de05b84595..02c9338ed8e 100644 --- a/packages/g6/src/util/data.ts +++ b/packages/g6/src/util/data.ts @@ -94,10 +94,10 @@ export const graphComboTreeDfs = ( }; /** - * Depth first search begin from nodes in g6 graph data, and then search the ancestirs from begin nodes. + * Depth first search begin from nodes in g6 graph data, and then search the ancestors from begin nodes. * @param graph G6 graph instance * @param graphCore graphlib data structure - * @param nodes begin ndoes + * @param nodes begin nodes * @param fn will be called while visiting each node * @param mode 'TB' - visit from top to bottom; 'BT' - visit from bottom to top; * @returns @@ -135,7 +135,7 @@ export const traverseGraphAncestors = ( /** * Traverse the ancestors from the begin nodes. * @param graphCore graphlib data structure - * @param nodes begin ndoes + * @param nodes begin nodes * @param fn will be called while visiting each node */ export const traverseAncestors = (graphCore, nodes, fn) => { @@ -172,7 +172,7 @@ export const isSucceed = (graph, testParent, testSucceed): boolean => { * @param toBeAncestorId id of the new parent to check if it is valid to be a parent of the node with id toBeSucceedId * @returns */ -export const validateComboStrucutre = ( +export const validateComboStructure = ( graph, toBeSucceedId, toBeAncestorId, @@ -298,7 +298,7 @@ export const graphData2TreeData = ( }; /** - * Travere a tree data from top to bottom. + * Traverse a tree data from top to bottom. * @param treeData * @param callback */ @@ -333,15 +333,15 @@ export const dataLifecycleMap: Record = { /** * Whether the graph is empty. * @param graph graph instance. - * @param excludeInvisibles whether exclude invisibles. true means the function should test without visible items. + * @param excludeInvisible whether exclude invisible. true means the function should test without visible items. * @returns graph is empty or not. */ -export const isEmptyGraph = (graph, excludeInvisibles = false): boolean => { +export const isEmptyGraph = (graph, excludeInvisible = false): boolean => { const nodes = graph.getAllNodesData(); const combos = graph.getAllCombosData(); if (nodes.length === 0 && combos.length === 0) return true; - if (excludeInvisibles) { + if (excludeInvisible) { const edges = graph.getAllEdgesData(); if (nodes.find((node) => graph.getItemVisible(node.id))) return false; if (edges.find((edge) => graph.getItemVisible(edge.id))) return false; diff --git a/packages/g6/src/util/extend.ts b/packages/g6/src/util/extend.ts index a31275564fa..a6cfbcea7ab 100644 --- a/packages/g6/src/util/extend.ts +++ b/packages/g6/src/util/extend.ts @@ -5,7 +5,7 @@ import { EdgeRegistry } from '../types/edge'; import { LayoutRegistry } from '../types/layout'; import { PluginRegistry } from '../types/plugin'; import { Graph } from '../runtime/graph'; -import registry from '../stdlib'; +import { registry } from '../stdlib'; /** * Extend graph class with custom libs (extendLibrary), and extendLibrary will be merged into useLib. diff --git a/packages/g6/src/util/math.ts b/packages/g6/src/util/math.ts index f16f73cf1c3..3ea5ae2b6dc 100644 --- a/packages/g6/src/util/math.ts +++ b/packages/g6/src/util/math.ts @@ -1,7 +1,7 @@ import { Point, PolyPoint } from '../types/common'; /** - * Whether the value is begween the range of [min, max] + * Whether the value is between the range of [min, max] * @param {number} value the value to be judged * @param {number} min the min of the range * @param {number} max the max of the range diff --git a/packages/g6/src/util/path.ts b/packages/g6/src/util/path.ts index d2a02b384af..66ed0e577b5 100644 --- a/packages/g6/src/util/path.ts +++ b/packages/g6/src/util/path.ts @@ -6,7 +6,7 @@ import { Point } from '../types/common'; * @param {IPoint} startPoint Start point with x and y. * @param {IPoint} endPoint End point with x and y. * @param {Number} percent Control point's position percentage between source and end point, ranges from 0 to 1. - * @param {Number} offset Offsest from the control point to the line start at startPoint and end at endPoint. + * @param {Number} offset Offset from the control point to the line start at startPoint and end at endPoint. * @return {IPoint} The control point with x and y. */ export const getControlPoint = ( diff --git a/packages/g6/src/util/polyline.ts b/packages/g6/src/util/polyline.ts index de085e5b132..307fec31c6d 100644 --- a/packages/g6/src/util/polyline.ts +++ b/packages/g6/src/util/polyline.ts @@ -465,7 +465,7 @@ export const removeRedundantPoint = (points: Point[]) => { }; /** - * sorted array ascendly + * sorted array ascend * add new item to proper index when calling add */ export class SortedArray { @@ -552,7 +552,7 @@ interface ComputedEdge { bbox: AABB; } -/** Define a quadtree */ +/** Define a quad-tree */ export class QuadTree { private readonly capacity: number; private edges: ComputedEdge[] = []; @@ -590,7 +590,7 @@ export class QuadTree { ); } - // Divide the quadtree into four subtrees + // Divide the quad-tree into four subtrees subdivide() { const x = this.boundary.center[0]; const y = this.boundary.center[1]; diff --git a/packages/g6/src/util/router.ts b/packages/g6/src/util/router.ts index cba405e37e7..df43a17eab5 100644 --- a/packages/g6/src/util/router.ts +++ b/packages/g6/src/util/router.ts @@ -252,7 +252,7 @@ const getBoxPoints = ( ]; for (let i = 0; i < 4; i++) { const boundLine = bounds[i]; - const insterctP = getLineIntersect( + const intersectP = getLineIntersect( point, { x: point.x + dir.stepX * getBBoxWidth(expandBBox), @@ -261,18 +261,18 @@ const getBoxPoints = ( boundLine[0], boundLine[1], ) as PolyPoint; - if (insterctP && !isSegmentCrossingBBox(point, insterctP, bbox)) { - insterctP.id = `${insterctP.x}|||${insterctP.y}`; - points.push(insterctP); + if (intersectP && !isSegmentCrossingBBox(point, intersectP, bbox)) { + intersectP.id = `${intersectP.x}|||${intersectP.y}`; + points.push(intersectP); } } } return points; } // If the anchorPoint is on the node, there is only one optional direction - const insterctP = getExpandedBBoxPoint(expandBBox, point, anotherPoint); - insterctP.id = `${insterctP.x}|||${insterctP.y}`; - return [insterctP]; + const intersectP = getExpandedBBoxPoint(expandBBox, point, anotherPoint); + intersectP.id = `${intersectP.x}|||${intersectP.y}`; + return [intersectP]; }; const getDirectionChange = ( diff --git a/packages/g6/src/util/shape.ts b/packages/g6/src/util/shape.ts index 44e70529499..c09162b71e1 100644 --- a/packages/g6/src/util/shape.ts +++ b/packages/g6/src/util/shape.ts @@ -217,7 +217,7 @@ export const getGroupSucceedMap = ( }; /** - * Update shapes in the intersaction of prevShapeMap and newShapeMap; + * Update shapes in the intersection of prevShapeMap and newShapeMap; * Remove shapes in the prevShapeMap - newShapeMap (if removeDiff is true); * Add shapes in the newShapeMap - prevShapeMap; * @param prevShapeMap previous shape map @@ -233,14 +233,14 @@ export const updateShapes = ( removeDiff = true, shouldUpdate: (id: string) => boolean = () => true, ): NodeShapeMap | EdgeShapeMap => { - const tolalMap = { + const totalMap = { ...prevShapeMap, ...newShapeMap, }; const finalShapeMap = { ...prevShapeMap, }; - Object.keys(tolalMap).forEach((id) => { + Object.keys(totalMap).forEach((id) => { const prevShape = prevShapeMap[id]; const newShape = newShapeMap[id]; if (newShape && !shouldUpdate(id)) return; @@ -257,7 +257,7 @@ export const updateShapes = ( ? labelGroup : group; if ( - // NewShape is already in the group, no need to reappend. + // NewShape is already in the group, no need to re-append. // Note: If the given child is a reference to an existing node in the document, // appendChild() moves it from its current position to the new position. // @see https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild @@ -572,7 +572,7 @@ export const getLineIntersect = ( return null; }; -const FEILDS_AFFECT_BBOX = { +const FIELDS_AFFECT_BBOX = { circle: ['r', 'lineWidth'], rect: ['width', 'height', 'lineWidth'], image: ['width', 'height', 'lineWidth'], @@ -596,7 +596,7 @@ export const isStyleAffectBBox = ( type: SHAPE_TYPE | SHAPE_TYPE_3D, style: ShapeStyle, ) => { - return isArrayOverlap(Object.keys(style), FEILDS_AFFECT_BBOX[type]); + return isArrayOverlap(Object.keys(style), FIELDS_AFFECT_BBOX[type]); }; /** diff --git a/packages/g6/src/util/shape3d.ts b/packages/g6/src/util/shape3d.ts index 383a43a5aed..10baeed4302 100644 --- a/packages/g6/src/util/shape3d.ts +++ b/packages/g6/src/util/shape3d.ts @@ -147,7 +147,7 @@ export const upsertShape3D = ( }; /** - * Update shapes in the intersaction of prevShapeMap and newShapeMap; + * Update shapes in the intersection of prevShapeMap and newShapeMap; * Remove shapes in the prevShapeMap - newShapeMap (if removeDiff is true); * Add shapes in the newShapeMap - prevShapeMap; * @param prevShapeMap previous shape map @@ -162,14 +162,14 @@ export const updateShapes3D = ( removeDiff = true, shouldUpdate: (id: string) => boolean = () => true, ): NodeShapeMap | EdgeShapeMap => { - const tolalMap = { + const totalMap = { ...prevShapeMap, ...newShapeMap, }; const finalShapeMap = { ...prevShapeMap, }; - Object.keys(tolalMap).forEach((id) => { + Object.keys(totalMap).forEach((id) => { const prevShape = prevShapeMap[id]; const newShape = newShapeMap[id]; if (newShape && !shouldUpdate(id)) return; @@ -181,7 +181,7 @@ export const updateShapes3D = ( } finalShapeMap[id] = newShape; if ( - // NewShape is already in the group, no need to reappend. + // NewShape is already in the group, no need to re-append. // Note: If the given child is a reference to an existing node in the document, // appendChild() moves it from its current position to the new position. // @see https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild diff --git a/packages/g6/tests/demo/plugins/edgeFilterLens.ts b/packages/g6/tests/demo/plugins/edgeFilterLens.ts index 50d50c256bf..d862cd20218 100644 --- a/packages/g6/tests/demo/plugins/edgeFilterLens.ts +++ b/packages/g6/tests/demo/plugins/edgeFilterLens.ts @@ -40,13 +40,13 @@ export default (context: TestCaseContext, options = {}) => { buttonContainer.appendChild(document.createElement('br')); // enable/disable the fisheye lens button - const swithButton = document.createElement('input'); - swithButton.type = 'button'; - swithButton.value = 'Disable'; - swithButton.style.height = '25px'; - swithButton.style.width = '60px'; - swithButton.style.marginLeft = '16px'; - buttonContainer.appendChild(swithButton); + const switchButton = document.createElement('input'); + switchButton.type = 'button'; + switchButton.value = 'Disable'; + switchButton.style.height = '25px'; + switchButton.style.width = '60px'; + switchButton.style.marginLeft = '16px'; + buttonContainer.appendChild(switchButton); // list for changing trigger const triggerTag = document.createElement('span'); @@ -152,12 +152,12 @@ export default (context: TestCaseContext, options = {}) => { }, }); - swithButton.addEventListener('click', (e) => { - if (swithButton.value === 'Disable') { - swithButton.value = 'Enable'; + switchButton.addEventListener('click', (e) => { + if (switchButton.value === 'Disable') { + switchButton.value = 'Enable'; graph.removePlugins(['filterLens1']); } else { - swithButton.value = 'Disable'; + switchButton.value = 'Disable'; graph.addPlugins([filterLens]); } }); diff --git a/packages/g6/tests/demo/plugins/fisheye.ts b/packages/g6/tests/demo/plugins/fisheye.ts index 97e6296bca6..6594d3ecca4 100644 --- a/packages/g6/tests/demo/plugins/fisheye.ts +++ b/packages/g6/tests/demo/plugins/fisheye.ts @@ -40,13 +40,13 @@ export default async () => { buttonContainer.appendChild(clearButton); // enable/disable the fisheye lens button - const swithButton = document.createElement('input'); - swithButton.type = 'button'; - swithButton.value = 'Disable'; - swithButton.style.height = '25px'; - swithButton.style.width = '60px'; - swithButton.style.marginLeft = '16px'; - buttonContainer.appendChild(swithButton); + const switchButton = document.createElement('input'); + switchButton.type = 'button'; + switchButton.value = 'Disable'; + switchButton.style.height = '25px'; + switchButton.style.width = '60px'; + switchButton.style.marginLeft = '16px'; + buttonContainer.appendChild(switchButton); buttonContainer.appendChild(document.createElement('br')); @@ -162,12 +162,12 @@ export default async () => { }); clearButton.addEventListener('click', (e) => {}); - swithButton.addEventListener('click', (e) => { - if (swithButton.value === 'Disable') { - swithButton.value = 'Enable'; + switchButton.addEventListener('click', (e) => { + if (switchButton.value === 'Disable') { + switchButton.value = 'Enable'; graph.removePlugins(['fisheye1']); } else { - swithButton.value = 'Disable'; + switchButton.value = 'Disable'; graph.addPlugins([fisheye]); } }); diff --git a/packages/g6/tests/demo/plugins/watermarker.ts b/packages/g6/tests/demo/plugins/watermarker.ts index 826751f4764..b7a2e1a190e 100644 --- a/packages/g6/tests/demo/plugins/watermarker.ts +++ b/packages/g6/tests/demo/plugins/watermarker.ts @@ -68,7 +68,7 @@ export default (context: TestCaseContext, options = {}) => { position: 'bottom', mode: 'image', begin: [10, 10], - seperation: [10, 10], + separation: [10, 10], text: { texts: [ 'hello', diff --git a/packages/site/docs/apis/layout/ForceAtlas2LayoutOptions.en.md b/packages/site/docs/apis/layout/ForceAtlas2LayoutOptions.en.md index b84bc8dc64e..50af813cceb 100644 --- a/packages/site/docs/apis/layout/ForceAtlas2LayoutOptions.en.md +++ b/packages/site/docs/apis/layout/ForceAtlas2LayoutOptions.en.md @@ -65,7 +65,7 @@ The maximum number of iterations. If set to `0`, it will be adjusted automatical **Default**: `undefined` -Whether to enable Barnes-Hut acceleration, which is quadtree acceleration. Since the quadtree needs to be updated at each iteration, it is recommended to enable it on large-scale graphs. By default, it is undefined, and it will be activated when the number of nodes exceeds 250. Setting it to `false` will not automatically activate it. +Whether to enable Barnes-Hut acceleration, which is quad-tree acceleration. Since the quad-tree needs to be updated at each iteration, it is recommended to enable it on large-scale graphs. By default, it is undefined, and it will be activated when the number of nodes exceeds 250. Setting it to `false` will not automatically activate it. ## dissuadeHubs diff --git a/packages/site/docs/apis/plugins/WaterMarker.en.md b/packages/site/docs/apis/plugins/WaterMarker.en.md index c80b8711060..05ee3fe6c5a 100644 --- a/packages/site/docs/apis/plugins/WaterMarker.en.md +++ b/packages/site/docs/apis/plugins/WaterMarker.en.md @@ -48,7 +48,7 @@ Watermark position - `middle`: Middle layer canvas - `bottom`: Bottom layer canvas (below the graph) -### seperation +### separation **Type**: `[number, number]` diff --git a/packages/site/docs/apis/plugins/WaterMarker.zh.md b/packages/site/docs/apis/plugins/WaterMarker.zh.md index 531446f1b79..21493e5b057 100644 --- a/packages/site/docs/apis/plugins/WaterMarker.zh.md +++ b/packages/site/docs/apis/plugins/WaterMarker.zh.md @@ -48,9 +48,7 @@ order: 9 - `middle`:中间层画布 - `bottom`:底层画布(位于图下层) - - -### seperation +### separation **类型**:`[number, number]` diff --git a/packages/site/examples/tool/edgeFilterLens/demo/default.ts b/packages/site/examples/tool/edgeFilterLens/demo/default.ts index 35c4faad34d..b1bca56c28b 100644 --- a/packages/site/examples/tool/edgeFilterLens/demo/default.ts +++ b/packages/site/examples/tool/edgeFilterLens/demo/default.ts @@ -73,13 +73,13 @@ buttonContainer.appendChild(tipEn); buttonContainer.appendChild(document.createElement('br')); // enable/disable the fisheye lens button -const swithButton = document.createElement('input'); -swithButton.type = 'button'; -swithButton.value = 'Disable'; -swithButton.style.height = '25px'; -swithButton.style.width = '60px'; -swithButton.style.marginLeft = '16px'; -buttonContainer.appendChild(swithButton); +const switchButton = document.createElement('input'); +switchButton.type = 'button'; +switchButton.value = 'Disable'; +switchButton.style.height = '25px'; +switchButton.style.width = '60px'; +switchButton.style.marginLeft = '16px'; +buttonContainer.appendChild(switchButton); // list for changing trigger const triggerTag = document.createElement('span'); @@ -127,12 +127,12 @@ buttonContainer.appendChild(configScaleRBy); container.parentNode.appendChild(buttonContainer); -swithButton.addEventListener('click', (e) => { - if (swithButton.value === 'Disable') { - swithButton.value = 'Enable'; +switchButton.addEventListener('click', (e) => { + if (switchButton.value === 'Disable') { + switchButton.value = 'Enable'; graph.removePlugins([filterLensConfig.key]); } else { - swithButton.value = 'Disable'; + switchButton.value = 'Disable'; graph.addPlugins([filterLensConfig]); } }); diff --git a/packages/site/examples/tool/edgeFilterLens/demo/moreConfig.ts b/packages/site/examples/tool/edgeFilterLens/demo/moreConfig.ts index 756a3507c1e..27dfee9e6a2 100644 --- a/packages/site/examples/tool/edgeFilterLens/demo/moreConfig.ts +++ b/packages/site/examples/tool/edgeFilterLens/demo/moreConfig.ts @@ -91,13 +91,13 @@ buttonContainer.appendChild(tipEn); buttonContainer.appendChild(document.createElement('br')); // enable/disable the fisheye lens button -const swithButton = document.createElement('input'); -swithButton.type = 'button'; -swithButton.value = 'Disable'; -swithButton.style.height = '25px'; -swithButton.style.width = '60px'; -swithButton.style.marginLeft = '16px'; -buttonContainer.appendChild(swithButton); +const switchButton = document.createElement('input'); +switchButton.type = 'button'; +switchButton.value = 'Disable'; +switchButton.style.height = '25px'; +switchButton.style.width = '60px'; +switchButton.style.marginLeft = '16px'; +buttonContainer.appendChild(switchButton); // list for changing trigger const triggerTag = document.createElement('span'); @@ -145,12 +145,12 @@ buttonContainer.appendChild(configScaleRBy); container.parentNode.appendChild(buttonContainer); -swithButton.addEventListener('click', (e) => { - if (swithButton.value === 'Disable') { - swithButton.value = 'Enable'; +switchButton.addEventListener('click', (e) => { + if (switchButton.value === 'Disable') { + switchButton.value = 'Enable'; graph.removePlugins([filterLensConfig.key]); } else { - swithButton.value = 'Disable'; + switchButton.value = 'Disable'; graph.addPlugins([filterLensConfig]); } }); diff --git a/packages/site/examples/tool/fisheye/demo/fisheye.ts b/packages/site/examples/tool/fisheye/demo/fisheye.ts index f0609747eeb..c92100f8433 100644 --- a/packages/site/examples/tool/fisheye/demo/fisheye.ts +++ b/packages/site/examples/tool/fisheye/demo/fisheye.ts @@ -35,13 +35,13 @@ clearButton.style.width = '60px'; buttonContainer.appendChild(clearButton); // enable/disable the fisheye lens button -const swithButton = document.createElement('input'); -swithButton.type = 'button'; -swithButton.value = 'Disable'; -swithButton.style.height = '25px'; -swithButton.style.width = '60px'; -swithButton.style.marginLeft = '16px'; -buttonContainer.appendChild(swithButton); +const switchButton = document.createElement('input'); +switchButton.type = 'button'; +switchButton.value = 'Disable'; +switchButton.style.height = '25px'; +switchButton.style.width = '60px'; +switchButton.style.marginLeft = '16px'; +buttonContainer.appendChild(switchButton); buttonContainer.appendChild(document.createElement('br')); @@ -158,12 +158,12 @@ const createGraph = (customData) => { }); clearButton.addEventListener('click', (e) => {}); - swithButton.addEventListener('click', (e) => { - if (swithButton.value === 'Disable') { - swithButton.value = 'Enable'; + switchButton.addEventListener('click', (e) => { + if (switchButton.value === 'Disable') { + switchButton.value = 'Enable'; graph.removePlugins(['fisheye1']); } else { - swithButton.value = 'Disable'; + switchButton.value = 'Disable'; graph.addPlugins([fisheye]); } }); diff --git a/packages/site/examples/tool/watermarker/demo/textWaterMarker.ts b/packages/site/examples/tool/watermarker/demo/textWaterMarker.ts index 20fb12cbf7f..7d52bb2dac2 100644 --- a/packages/site/examples/tool/watermarker/demo/textWaterMarker.ts +++ b/packages/site/examples/tool/watermarker/demo/textWaterMarker.ts @@ -25,7 +25,7 @@ const graph = new Graph({ type: 'water-marker', mode: 'text', begin: [100, 50], - seperation: [50, 50], + separation: [50, 50], text: { texts: ['AntV G6', 'Graph Visualization'], lineHeight: 20,