d3 force directed graph don't select text

juniper-

Is there a way to stop to text from being selected when the drag behavior is turned off in a force directed graph?

The drag behavior is turned off using these lines:

svg.selectAll('g.gnode')
.on('mousedown.drag', null);

The pointer remains a pointer, rather than a cursor (as per the answer to this question). But dragging still ends up changing the pointer to a cursor and starts to select text. Is there a way to avoid this so no text is selected when dragging?

Here's a link to the fiddle.

juniper-

Using the answer to this question seems to do the trick. This requires adding the following definition to the css file:

.noselect {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

And adding the noselect class to the gnodes:

  var gnodes = svg.selectAll('g.gnode')
  .data(graph.nodes)
  .enter()
  .append('g')
  .classed('gnode', true)
  .classed('noselect', true)
  .call(force.drag);

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

D3 Force Directed Graph: why don't the flags appear?

From Dev

D3 Force directed Graph: Why don't the links appear and why is the simulation on the left?

From Dev

d3 force directed graph remove text cursor

From Dev

D3 force directed graph moving text

From Dev

D3 force directed graph direction

From Dev

Introducing Arrow(directed), in Force Directed Graph d3

From Dev

D3 force directed graph node - text is being duplicated when expading

From Dev

d3 force directed graph downward force simulation

From Dev

D3 force directed graph: Performance issue in a complex graph

From Dev

"Pinning" nodes in a D3 force-directed graph

From Dev

Adding label to the links in D3 force directed graph

From Dev

semantic zooming of the force directed graph in d3

From Dev

modifying the d3 force-directed graph example

From Dev

d3 force directed graph, links not being drawn

From Dev

D3 Force Directed Graph ajax update

From Dev

D3 force-directed graph: update node position

From Dev

modifying the d3 force-directed graph example

From Dev

Load JSON object into D3 Force Directed Graph

From Dev

Dynamically change color of D3 Node (force directed graph)

From Dev

JUNG force directed graph

From Dev

Having trouble converting a D3 v3 Force Directed graph into D3 v4 library implementation?

From Dev

How to add a dynamic legend to a D3 force directed graph in Apex?

From Dev

How to draw a simple Force-directed graph in D3 Javascript

From Dev

The links between the nodes in Force-Directed Graph in D3 Javascript

From Dev

How to restrict number of nodes initially in d3 Force directed graph

From Dev

How to render links as elbow connectors in d3 force directed graph

From Dev

How to make it so D3 Force Directed Graph generates nodes in same position each time

From Dev

Unable to Delete links from a D3 force directed graph with arrows

From Dev

Collapsible D3 force directed graph with non-tree data

Related Related

  1. 1

    D3 Force Directed Graph: why don't the flags appear?

  2. 2

    D3 Force directed Graph: Why don't the links appear and why is the simulation on the left?

  3. 3

    d3 force directed graph remove text cursor

  4. 4

    D3 force directed graph moving text

  5. 5

    D3 force directed graph direction

  6. 6

    Introducing Arrow(directed), in Force Directed Graph d3

  7. 7

    D3 force directed graph node - text is being duplicated when expading

  8. 8

    d3 force directed graph downward force simulation

  9. 9

    D3 force directed graph: Performance issue in a complex graph

  10. 10

    "Pinning" nodes in a D3 force-directed graph

  11. 11

    Adding label to the links in D3 force directed graph

  12. 12

    semantic zooming of the force directed graph in d3

  13. 13

    modifying the d3 force-directed graph example

  14. 14

    d3 force directed graph, links not being drawn

  15. 15

    D3 Force Directed Graph ajax update

  16. 16

    D3 force-directed graph: update node position

  17. 17

    modifying the d3 force-directed graph example

  18. 18

    Load JSON object into D3 Force Directed Graph

  19. 19

    Dynamically change color of D3 Node (force directed graph)

  20. 20

    JUNG force directed graph

  21. 21

    Having trouble converting a D3 v3 Force Directed graph into D3 v4 library implementation?

  22. 22

    How to add a dynamic legend to a D3 force directed graph in Apex?

  23. 23

    How to draw a simple Force-directed graph in D3 Javascript

  24. 24

    The links between the nodes in Force-Directed Graph in D3 Javascript

  25. 25

    How to restrict number of nodes initially in d3 Force directed graph

  26. 26

    How to render links as elbow connectors in d3 force directed graph

  27. 27

    How to make it so D3 Force Directed Graph generates nodes in same position each time

  28. 28

    Unable to Delete links from a D3 force directed graph with arrows

  29. 29

    Collapsible D3 force directed graph with non-tree data

HotTag

Archive