This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyCEIM extends CreateEdgeInputMode { | |
private readonly TARGET_NODE_HALO_SIZE = 30 | |
constructor() { | |
super() | |
// use the default priority for CEIM in GEIM | |
this.priority = 45 | |
// allow gesture ending within a certain area of a node |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
CreateEdgeInputMode, | |
DefaultPortCandidate, | |
FreeNodePortLocationModel, | |
GraphComponent, | |
IBend, | |
IEdge, | |
IGraph, | |
IHitTestable, | |
MouseEventRecognizers, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
CreateEdgeInputMode, | |
DefaultPortCandidate, | |
FreeNodePortLocationModel, | |
GraphComponent, | |
IBend, | |
IEdge, | |
IGraph, | |
IHitTestable, | |
MouseEventRecognizers, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SelectedRootNodeHitTestable extends BaseClass(IHitTestable) { | |
constructor( | |
private readonly originalHitTestable: IHitTestable, | |
private readonly inputMode: GraphEditorInputMode | |
) { | |
super() | |
} | |
isHit(context: IInputModeContext, location: Point): boolean { | |
// get the current hit tester from the input mode context | |
const inputModeContext = this.inputMode.inputModeContext! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { INode, IRenderContext } from 'yfiles' | |
import { | |
GraphComponent, | |
InteriorLabelModel, | |
MarkupLabelStyle, | |
NodeStyleBase, | |
SimpleLabel, | |
SimpleNode, | |
SvgVisual, | |
Visual |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**************************************************************************** | |
** @license | |
** This demo file is part of yFiles for HTML 2.3. | |
** Copyright (c) 2000-2020 by yWorks GmbH, Vor dem Kreuzberg 28, | |
** 72070 Tuebingen, Germany. All rights reserved. | |
** | |
** yFiles demo files exhibit yFiles for HTML functionalities. Any redistribution | |
** of demo files in source code or binary form, with or without | |
** modification, is not permitted. | |
** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GMM extends GraphModelManager { | |
private readonly annotationGroup: ICanvasObjectGroup | |
constructor(canvas: CanvasComponent) { | |
super(canvas) | |
this.annotationGroup = this.contentGroup.addGroup() | |
} | |
protected getNodeCanvasObjectGroup(node: INode): ICanvasObjectGroup { | |
if (node.tag) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createDuplicationInputMode(graphComponent: GraphComponent): MoveInputMode { | |
graphComponent.autoDrag = false | |
const mim = new MoveInputMode() | |
mim.priority = 35 // place it before the MoveViewportInputMode due to CTRL+DRAG in case of GEIM usage | |
mim.hitTestable = IHitTestable.create((ctx, location) => { | |
const geim = ctx.canvasComponent!.inputMode as GraphEditorInputMode | |
const firstNodeHit = geim.hitTester |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyWebGLVisual extends WebGLVisual { | |
constructor(overviewVisualCreator) { | |
super() | |
this.overviewVisualCreator = overviewVisualCreator | |
} | |
render(ctx, gl) { | |
this.overviewVisualCreator.update(ctx, gl) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyWebGLVisual extends WebGLVisual { | |
constructor(overviewVisualCreator) { | |
super() | |
this.overviewVisualCreator = overviewVisualCreator | |
} | |
render(ctx, gl) { | |
this.overviewVisualCreator.update(ctx, gl) | |
} | |
} |
NewerOlder