Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ruhickey/Raphael-Drag-Select

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raphael-Drag-Select

A Raphael.js plugin which allows the user to drag a box across the paper and select multiple nodes at once.
The nodes are then returned to your callback function in a Raphael set.

Sample Usage

window.onload = function() {
  var paper = new Raphael("canvas");

  paper.dragSelect(function(set) {
  
    // Print out each node's type.
    for(var i = 0; i < set.items.length; i++) {
      console.log("set["+i+"] - " + set.items[i].type);
    }
    
  });

  paper.rect(10, 10, 10, 10);
}

Removing dragSelect

window.onload = function() {
  var paper = new Raphael("canvas");

  paper.dragSelect(function(set) {
  
    // Print out each node's type.
    for(var i = 0; i < set.items.length; i++) {
      console.log("set["+i+"] - " + set.items[i].type);
    }
    
  });

  paper.rect(10, 10, 10, 10);
  
  /*
  Remove the drag select.
  Could be used if you should only be able to select nodes at certain times.
  i.e. When a button is toggled.
  */
  paper.undragSelect();
}

About

A Raphael.js Plugin which allows the box selection of nodes and returns a set of them.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.