Remarks
import { Workarounds } from '@yfiles/yfiles';
Workarounds.Ff1729465 = true;See Also
Developer's Guide
Members
Constants
If set to true, the input modes perform hit tests upon repeated key events for modifier keys that are held down.
The default value is falsy, as a result, such repeated key events are ignored.
Symptoms: Starting with Chrome 47, unresponsive GraphComponent during mouse drag, screen updates at ~1 FPS while moving the mouse.
Original cause: setInterval and setTimeout stop during input if timer callbacks are expensive.
Workaround: Make sure that no setTimeout(fn,0) calls are "lost" by flushing Dispatcher actions on mouse move.
This workaround is enabled by default and can be disabled by setting a value < 0. A value > 0 sets the maximum tolerated delay between last dispatcher invoke call and manual flush, e.g. 26 (flush uses requestAnimationFrame).
Workarounds.cr570845 = 24;More information: Chromium issue
See Also
Developer's Guide
If set, inline stylesheets and script tags inserted into the DOM by the library will set the nonce attribute to this value.
This can be used together with loadDefaultCSS to allowlist the yFiles stylesheet when a Content Security Policy is in effect.
The default value is "".
If this is disabled, shader compilation becomes a synchronous, blocking operation, that will take a significant amount of time unless the compiled shaders are already cached by the browser.
The default value is false.
Prevents calling preventDefault on touch events by early exiting CanvasComponent.maybePreventPointerDefault.
preventDefault on touch events by early exiting CanvasComponent.maybePreventPointerDefault.This property is enabled by default in Firefox to support multitouch gestures.
Symptoms: Configuring multi-touch gestures like two-finger panning does not work properly in Firefox.
Original cause: Calling preventDefault on the primary pointer prevents Firefox emitting secondary events.
Workaround: Do not call preventDefault on touch events in Firefox.
This workaround is enabled by default in Firefox.
Workarounds.ff1729465 = true;More information: Firefox issue
This property is enabled by default in Firefox on macOS to support snapping overwrite with CTRL modifier.
Symptoms: In Firefox on macOS, CTRL cannot be used to overwrite snapping behavior.
Original cause: Firefox on macOS reports a bogus button event state for left clicks with CTRL modifier.
Workarounds.ff1837973 = true;More information: Firefox issue
If enabled and no yfiles.css was loaded explicitly, the stylesheet is inserted into the head element of the document or into the Web Component's DocumentFragment.
When disabled, it is required to load the yfiles.css stylesheet explicitly.
The default value is true.
mouseWheelParameters
: Partial<{ mouseWheelThreshold: number; mouseWheelMax: number; mouseWheelFactor: number; trackpadPinchMax: number; trackpadPinchFactor: number; trackpadPanMax: number; trackpadPanFactor: number; resetTime: number;}> | undefinedstaticOptionally provides values to control how mouse wheels behave and are distinguished from trackpad pinches and pans.
mouseWheelParameters
: Partial<{ mouseWheelThreshold: number; mouseWheelMax: number; mouseWheelFactor: number; trackpadPinchMax: number; trackpadPinchFactor: number; trackpadPanMax: number; trackpadPanFactor: number; resetTime: number;}> | undefinedresetTimeis the time in milliseconds that can pass between native wheel events before the type of the event will be re-evaluated.mouseWheelThresholdis the value used to discriminate mouse wheel movements from trackpad gestures. Wheel deltas larger than this will be considered mouse wheel events. Set this property to0to disable trackpad panning. Mouse wheel events will then always be considered zoom events, even for mouse wheels or mouse drivers that report very small wheel deltas. You can then still use modifiers to pan the canvas with the mouse wheel.mouseWheelMaxthe maximum value a mouse wheel event should ever have (absolute). This value will clamp the wheel delta value after the correction factor was applied.mouseWheelFactorthe correction factor that will be applied to mouse wheel events before passing them on. This will happen before the clamping.trackpadPanMaxthe maximum value a trackpad panning gesture should ever have (absolute). This value will clamp the wheel delta value after the correction factor was applied.trackpadPanFactorthe correction factor that will be applied to trackpad pans before passing them on. This will happen before the clamping.trackpadPinchMaxthe maximum value a mouse wheel event should ever have (absolute). This value will clamp the wheel delta value after the correction factor was applied.trackpadPinchFactorthe correction factor that will be applied to trackpad pans before passing them on. This will happen before the clamping.
false.On iOS, a double tap followed by holding the second tap opens the text-editor loupe. This behavior is unexpected within the GraphComponent, so this workaround calls preventDefault() on the second tap when it occurs within the configured threshold.
For reference, see https://bugs.webkit.org/show_bug.cgi?id=296492 or https://bugs.webkit.org/show_bug.cgi?id=251572. The GraphComponent already uses CSS declarations that are intended to suppress this behavior, but due to the mentioned WebKit regressions, additionally calling preventDefault() is required.
A value of -1 disables this workaround.
The default value is 500 for iOS devices, otherwise -1 (disabled).
After this duration, a tooltip is eventually removed from the DOM after the leave animation was triggered.
By default, the tooltip element is automatically removed from the DOM after its CSS transition/animation ended. However, the "animation end" event can fail under rare circumstances such that the element must be removed explicitly.
The leave transition should not take longer than this duration.
The default value is 5000 (5 seconds).
The default value is 90 milliseconds.
Labels that are not rendered within the given duration are delayed to the next frame to keep the browser responsive even when loading thousands of labels.
If set to 0, staggered loading of labels is completely disabled and all labels are rendered at once, blocking the browser until completion.
The library parses the license watermark with parseFromString which is an injection sink and therefore blocked when specifying the CSP require-trusted-types-for 'script'. To resolve this, you can pass your Trusted Types createHTML function here, with which the watermark will be processed before calling parseFromString.
The watermark in the license provided by yWorks can be trusted because it is protected by the license signature. It must not be modified or sanitized by the createHTML function, otherwise the license check will fail.
Example usage:
<meta http-equiv="Content-Security-Policy" content="require-trusted-types-for 'script'; trusted-types watermark-policy;"/>const policy = window.trustedTypes.createPolicy('watermark-policy', {
createHTML: (input: string) => input // do nothing
})
Workarounds.trustedTypesWatermarkCreateHtml= (input) => policy.createHTML(input)TResult parameter.- arg: string
- The parameter of the method that this delegate encapsulates.
- string
- The return value of the method that this delegate encapsulates.