Skip to content
On this page

Emitters

To make the component easier to work with there are a few emitters that wrap the simulation Event API.

Available Emitters

EmitDescriptionReference
node-clickuser click on node shapeDocs
node-double-clickuser double click on node shapeDocs
node-context-menuuser right click on node shapeDocs
node-drag-startuser started dragging a node shapeDocs
node-drag-moveuser dragging a node shapeDocs
node-drag-enduser released dragging a node shapeDocs
link-clickuser click on link shapeDocs
link-double-clickuser double click on link shapeDocs
link-context-menuuser right click on link shapeDocs
link-drag-startuser started dragging a link shapeDocs
link-drag-moveuser dragging a link shapeDocs
link-drag-enduser released dragging a link shapeDocs
environment-clickuser click on svg backgroundDocs
environment-double-clickuser double click on svg backgroundDocs
environment-context-menuuser right click on svg backgroundDocs
environment-movesvg world moved by user or moveTo methodDocs
simulation-ticksimulation ticked one simulation stepDocs
simulation-tick-endsimulation finished ticking simulation stepsDocs
theme-changetheme changedDocs

Example

vue
<template>
	<GraphlyD3
		ref="graphly"
		@node-click="(e, d) => console.log(d.id)"
		@link-click="(e, d) => console.log(d.id)"
		@environment-click="(e, pos) => console.log(pos)"
		@theme-change="(theme) => console.log(theme)"
	/>
</template>

Graphly D3 Documentation