documentationfor yFiles for HTML 2.6

Resource Keys

Some classes in yFiles for HTML define static "KEY" properties of type string. Those constants are keys for the global client property map of HTML5 components and change certain aspects of a yFiles for HTML application.

For example, you can change the color of snap lines by simply setting a Stroke using the SNAP_LINE_STROKE_KEY resource key into the resource map of the GraphComponent like shown below:

Using a resource key
graphComponent.resources.set(SnapLine.SNAP_LINE_STROKE_KEY, Stroke.BLUE)

Customizing String Resources

Common string resources like command names, keyboard shortcuts, undo unit names and UI labels can be customized. The key and value pairs are stored globally in the variable yfiles.resources.

The resources are sub-divided into UI cultures. For example, resources for the American English language should be stored in yfiles.resources["en-US"]. By default, all resources are stored in yfiles.resources["invariant"]. This is also the fallback for all cultures, if a certain key is not found.

In order to customize resources, create a variable with the name of the key and the desired value in the respective resource object. If the resource object is not initialized, yet, create it first. Initialization of the yFiles for HTML resources is non-destructive, i.e. custom values stored in yfiles.resources before initializing the yfiles library are not overwritten by defaults. For example, you can customize the key gesture for node grouping by changing the value of the resource key "GroupSelectionKey".

Customizing a Resource
yfiles.resources["invariant"]["GroupSelectionKey"] = "Shift+G";

The customization of a resource has to be done before the commands are initialized, e.g. before the GraphComponent is instantiated.

Resources Defaults

The following table lists the resources defaults stored in yfiles.resources["invariant"] alphabetically.

Resources Defaults
Key Value
AddBend.RedoNameAdd Bend
AddBend.UndoNameRemove Bend
AddLabel.RedoNameAdd Label
AddLabel.UndoNameRemove Label
AddLabelAdd Label
AddLabelKeyShift+F2
AddPort.RedoNameAdd Port
AddPort.UndoNameRemove Port
AdjustGroupNodeSize.RedoNameAdjust Group Node Size
AdjustGroupNodeSize.UndoNameAdjust Group Node Size
AdjustGroupNodeSizeAdjust Group Node Size
AdjustGroupNodeSizeKeyCtrl+Shift+G
AdjustToSizeConstraints.RedoNameAdjust Node Size
AdjustToSizeConstraints.UndoNameAdjust Node Size
BeginEdgeCreationCreate Edge
CollapseGroupCollapse Group
CollapseGroupKeyCtrl+Subtract
CollapseNode.RedoNameCollapse Node
CollapseNode.UndoNameExpand Node
CopyCopy
CopyKeyCtrl+C
CreateEdge.RedoNameAdd Edge
CreateEdge.UndoNameRemove Edge
CreateNode.RedoNameAdd Node
CreateNode.UndoNameRemove Node
CreateStripe.RedoNameCreateStripe
CreateStripe.UndoNameAdd Stripe
Cut.RedoNameRedo Cut
Cut.UndoNameUndo Cut
CutCut
CutKeyCtrl+X
DecreaseZoomZoom Out
DeleteDelete
DeleteKeyDelete
DeleteSelection.RedoNameRedo Delete
DeleteSelection.UndoNameUndo Delete
DeselectAllDeselect All
DeselectAllKeyCtrl+D
DeselectItemDeselect Item
EditLabelEdit Label
EditLabelKeyF2
EnterGroupEnter Group
EnterGroupKeyCtrl+Enter
ExitGroupExit Group
ExitGroupKeyCtrl+Backspace
ExpandGroupExpand Group
ExpandGroupKeyCtrl+Add
ExpandNode.RedoNameExpand Node
ExpandNode.UndoNameCollapse Node
ExtendSelectionDownExtend Selection Down
ExtendSelectionDownKeyShift+Down
ExtendSelectionLeftExtend Selection Left
ExtendSelectionLeftKeyShift+Left
ExtendSelectionRightExtend Selection Right
ExtendSelectionRightKeyShift+Right
ExtendSelectionUpExtend Selection Up
ExtendSelectionUpKeyShift+Up
FitContentFit Content
FitGraphBoundsFit Graph Bounds
GroupSelectionGroup Selection
GroupSelectionKeyCtrl+G
IncreaseZoomZoom In
Move.RedoNameMove Items
Move.UndoNameMove Items
MoveDownMove Down
MoveDownKeyDown
MoveFocusBackMove Focus Backward
MoveFocusBackKeyCtrl+Left
MoveFocusDownMove Focus Down
MoveFocusDownKeyCtrl+Down
MoveFocusForwardMove Focus Forward
MoveFocusForwardKeyCtrl+Right
MoveFocusUpMove Focus Up
MoveFocusUpKeyCtrl+Up
MoveHandle.RedoNameMove Handle
MoveHandle.UndoNameMove Handle
MoveLeftMove Left
MoveLeftKeyLeft
MoveRightMove Right
MoveRightKeyRight
MoveToPageDownMove Page Down
MoveToPageDownKeyPageDown
MoveToPageUpMove Page Up
MoveToPageUpKeyPageUp
MoveUpMove Up
MoveUpKeyUp
NewNew
NewKeyCtrl+N
NodeDropInputMode.NodeDropped.RedoNameAdd Node
NodeDropInputMode.NodeDropped.UndoNameRemove Node
OpenOpen
OpenFileFailed.CaptionError Loading File
OpenFileFailed.MessageThere was a problem during the loading of the file.
Paste.RedoNameRedo Paste
Paste.UndoNameUndo Paste
PastePaste
PasteKeyCtrl+V
PrintPrint
PrintKeyCtrl+P
PrintPreviewPrintPreview
PrintPreviewKeyCtrl+F2
RedoRedo
RedoKeyCtrl+Y
RemoveBend.RedoNameRemove Bend
RemoveBend.UndoNameAdd Bend
RemoveEdge.RedoNameRemove Edge
RemoveEdge.UndoNameAdd Edge
RemoveLabel.RedoNameRemove Label
RemoveLabel.UndoNameAdd Label
RemoveNode.RedoNameRemove Node
RemoveNode.UndoNameAdd Node
RemovePort.RedoNameRemove Port
RemovePort.UndoNameAdd Port
RemoveStripe.RedoNameAdd Stripe
RemoveStripe.UndoNameRemove Stripe
ReparentStripe.RedoNameReparent Stripe
ReparentStripe.UndoNameReparent Stripe
ResizeNode.RedoNameResize Node
ResizeNode.UndoNameResize Node
SaveSave
SaveAsSave As…​
SaveFileFailed.CaptionError Saving File
SaveFileFailed.MessageThere was a problem during the saving of the file.
ScrollPageDownScroll Page Down
ScrollPageDownKeyPageDown
ScrollPageLeftScroll Page Left
ScrollPageRightScroll Page Right
ScrollPageUpScroll Page Up
ScrollPageUpKeyPageUp
SelectAllSelect All
SelectAllKeyCtrl+A
SelectItemSelect Item
SetCurrentItemSet Current Item
SetEdgeStyle.RedoNameChange Edge Style
SetEdgeStyle.UndoNameChange Edge Style
SetLabelModelParameter.RedoNameChange Label Position
SetLabelModelParameter.UndoNameChange Label Position
SetLabelStyle.RedoNameChange Label Style
SetLabelStyle.UndoNameChange Label Style
SetLabelText.RedoNameChange Label Text
SetLabelText.UndoNameChange Label Text
SetLeaf.RedoNameConvert Back to Group Node
SetLeaf.UndoNameConvert to Normal Node
SetLocationModelParameter.RedoNameChange Port Location
SetLocationModelParameter.UndoNameChange Port Location
SetNodeStyle.RedoNameChange Node Style
SetNodeStyle.UndoNameChange Node Style
SetNonLeaf.RedoNameConvert Back to Normal Node
SetNonLeaf.UndoNameConvert to Group Node
SetParent.RedoNameChange Parent
SetParent.UndoNameChange Parent
SetPorts.RedoNameReconnect Edge
SetPorts.UndoNameReconnect Edge
SetPortStyle.RedoNameChange Port Style
SetPortStyle.UndoNameChange Port Style
SetPreferredLabelSize.RedoNameChange Preferred Label Size
SetPreferredLabelSize.UndoNameChange Preferred Label Size
SetStripeInsets.RedoNameChange Stripe Insets
SetStripeInsets.UndoNameChange Stripe Insets
SetStripeMinimumSize.RedoNameChange Minimum Stripe Size
SetStripeMinimumSize.UndoNameChange Minimum Stripe Size
SetStripeSize.RedoNameChange Stripe Size
SetStripeSize.UndoNameChange Stripe Size
SetStripeStyle.RedoNameChange Stripe Style
SetStripeStyle.UndoNameChange Stripe Style
ToggleExpansionStateToggle Group State
ToggleExpansionStateKeyCtrl+Multiply
ToggleItemSelectionToggle Selection
ToggleItemSelectionKeyCtrl+Space
UnavailableUnavailable
UndoUndo
UndoKeyCtrl+Z
UngroupSelectionUngroup Selection
UngroupSelectionKeyCtrl+U
UpdateContentRectUpdate Content Rectangle
ZoomZoom
ZoomToCurrentItemZoom To Current Item