javascript - d3: only two "on" possible? -


Using D.JS, I have a strange problem. The following code works fine: < pre> var zoomHandler = d3.behavior.zoom () .scaleExtent ([min, max]) .on ("zoom", function () {// do something;}). ("Zumen", function () {// do something;});

But, I also want to zoomhandler another inactive, so I tried to expand the code like this:

 < code> var zoomHandler = d3.behavior. Zoom () .scaleExtent ([min, max]) .on ("zoom", function () {// do something;}). ("Zoomed", function () {// do something;}) ("Other Event", blank);   

But now, at runtime, I get an exception

  Uncort type type: 'can not read' on unchanged property  < / Pre> 

Why can I add only two listeners but not three?

Your problem is the number of events, this event type "other avant" (or whatever you type in your code Are using)). Zoom behavior only supports:

are supported as follows:

  • ZoomTart - the beginning of the zoom signal (for example, TouchStart).
  • Zoom - When changes in the scene (e.g., Touchmov).
  • At the end of the current zoom gesture (for example, zumen). Zoomed

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -