functionaxisRenderer(orientation,transform){varaxisGroup=document.createElementNS("http://www.w3.org/2000/svg","g");varaxisPath=document.createElementNS("http://www.w3.org/2000/svg","path");axisGroup.setAttribute("class",orientation+"-axis");varxMin=gutter;varxMax=width-gutter;varyMin=height-gutter;varyMax=gutter;if(orientation==="x"){axisPath.setAttribute("d","M "+xMin+""+yMin+" L "+xMax+""+yMin);for(vari=xMin;i<=xMax;i++){if((i-xMin)%pixelsPerTick===0&&i!==xMin){vartext=document.createElementNS("http://www.w3.org/2000/svg","text");text.innerHTML=Math.floor(transform(i));text.setAttribute("x",i);text.setAttribute("y",yMin);text.setAttribute("dy","1em");axisGroup.appendChild(text);}}}else{axisPath.setAttribute("d","M "+xMin+""+yMin+" L "+xMin+""+yMax);for(vari=yMax;i<=yMin;i++){if((i-yMin)%pixelsPerTick===0&&i!==yMin){vartickGroup=document.createElementNS("http://www.w3.org/2000/svg","g");vargridLine=document.createElementNS("http://www.w3.org/2000/svg","path");text=document.createElementNS("http://www.w3.org/2000/svg","text");text.innerHTML=Math.floor(transform(i));text.setAttribute("x",xMin);text.setAttribute("y",i);text.setAttribute("dx","-.5em");text.setAttribute("dy",".3em");gridLine.setAttribute("d","M "+xMin+""+i+" L "+xMax+""+i);tickGroup.appendChild(gridLine);tickGroup.appendChild(text);axisGroup.appendChild(tickGroup);}}}