WLJS LogoWLJS Notebook

Locator

represents a draggable graphics primitive (2D or 3D), that generates "drag" event

Locator[{x,y}]

sets a locator to {x,y} initial position

Methods

EventHandler

Use it to assign a handler function for generated events:

  location = {0.3,0.7};
	Plot[x, {x,0,1}, Epilog->{
	  EventHandler[Locator[location], {
	    "drag"->Function[xy, location = xy]
	  }]
	}]
	
	Refresh[NumberForm[location, {3,2}], 1/2]

On this page