Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Example that shows how to change cursor on nodes #1845

Closed
mrchess opened this issue May 10, 2016 · 3 comments
Closed

Example that shows how to change cursor on nodes #1845

mrchess opened this issue May 10, 2016 · 3 comments

Comments

@mrchess
Copy link

mrchess commented May 10, 2016

I was trying to figure out if there is a way to set a cursor on a node. eg, pointer cursor on a node, default cursor on edge, and move cursor on canvas.

I looked through the docs and did not find settings for these options. Is this kind of stuff customizable?

@karanveerm
Copy link

karanveerm commented Nov 8, 2016

In case anyone also runs into this, I couldn't find a very clean way of doing this, but the following seems to work for me:


network.on('hoverNode', (node) => {
  // If you're using react and your encapsulating div has a `ref='graph'`
  // If you're using jquery, you'll probably want to do something like 
  // `$('#network')[0].style.cursor`
  this.refs.graph.style.cursor = 'pointer'
})

network.on('blurNode', (node) => {
  this.refs.graph.style.cursor = 'move'
})

@mojoaxel
Copy link
Member

mojoaxel commented Nov 8, 2016

@karanveerm Thanks!

I think we should create an example that shows how to change the cursor!
Changing to an feature-request...

@mojoaxel mojoaxel changed the title Able to set a custom cursor on nodes? Example that shows how to change cursor on nodes Nov 8, 2016
CapitanMorgan added a commit to CapitanMorgan/vis that referenced this issue Dec 15, 2016
CapitanMorgan added a commit to CapitanMorgan/vis that referenced this issue Dec 16, 2016
@yotamberk
Copy link
Contributor

Added with #2463

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants