StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics
https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
9.1 KiB
2 lines
9.1 KiB
// https://d3js.org/d3-zoom/ v1.8.3 Copyright 2019 Mike Bostock
|
|
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-dispatch"),require("d3-drag"),require("d3-interpolate"),require("d3-selection"),require("d3-transition")):"function"==typeof define&&define.amd?define(["exports","d3-dispatch","d3-drag","d3-interpolate","d3-selection","d3-transition"],n):n((t=t||self).d3=t.d3||{},t.d3,t.d3,t.d3,t.d3,t.d3)}(this,function(t,n,e,o,i,u){"use strict";function r(t){return function(){return t}}function s(t,n,e){this.target=t,this.type=n,this.transform=e}function h(t,n,e){this.k=t,this.x=n,this.y=e}h.prototype={constructor:h,scale:function(t){return 1===t?this:new h(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new h(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var c=new h(1,0,0);function a(t){for(;!t.__zoom;)if(!(t=t.parentNode))return c;return t.__zoom}function f(){i.event.stopImmediatePropagation()}function l(){i.event.preventDefault(),i.event.stopImmediatePropagation()}function m(){return!i.event.ctrlKey&&!i.event.button}function p(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function v(){return this.__zoom||c}function d(){return-i.event.deltaY*(1===i.event.deltaMode?.05:i.event.deltaMode?1:.002)}function y(){return navigator.maxTouchPoints||"ontouchstart"in this}function z(t,n,e){var o=t.invertX(n[0][0])-e[0][0],i=t.invertX(n[1][0])-e[1][0],u=t.invertY(n[0][1])-e[0][1],r=t.invertY(n[1][1])-e[1][1];return t.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),r>u?(u+r)/2:Math.min(0,u)||Math.max(0,r))}a.prototype=h.prototype,t.zoom=function(){var t,a,_=m,g=p,x=z,k=d,w=y,M=[0,1/0],T=[[-1/0,-1/0],[1/0,1/0]],b=250,Y=o.interpolateZoom,X=n.dispatch("start","zoom","end"),q=500,E=150,V=0;function B(t){t.property("__zoom",v).on("wheel.zoom",K).on("mousedown.zoom",A).on("dblclick.zoom",H).filter(w).on("touchstart.zoom",N).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",W).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function D(t,n){return(n=Math.max(M[0],Math.min(M[1],n)))===t.k?t:new h(n,t.x,t.y)}function P(t,n,e){var o=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return o===t.x&&i===t.y?t:new h(t.k,o,i)}function I(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function S(t,n,e){t.on("start.zoom",function(){j(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){j(this,arguments).end()}).tween("zoom",function(){var t=this,o=arguments,i=j(t,o),u=g.apply(t,o),r=null==e?I(u):"function"==typeof e?e.apply(t,o):e,s=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),c=t.__zoom,a="function"==typeof n?n.apply(t,o):n,f=Y(c.invert(r).concat(s/c.k),a.invert(r).concat(s/a.k));return function(t){if(1===t)t=a;else{var n=f(t),e=s/n[2];t=new h(e,r[0]-n[0]*e,r[1]-n[1]*e)}i.zoom(null,t)}})}function j(t,n,e){return!e&&t.__zooming||new G(t,n)}function G(t,n){this.that=t,this.args=n,this.active=0,this.extent=g.apply(t,n),this.taps=0}function K(){if(_.apply(this,arguments)){var t=j(this,arguments),n=this.__zoom,e=Math.max(M[0],Math.min(M[1],n.k*Math.pow(2,k.apply(this,arguments)))),o=i.mouse(this);if(t.wheel)t.mouse[0][0]===o[0]&&t.mouse[0][1]===o[1]||(t.mouse[1]=n.invert(t.mouse[0]=o)),clearTimeout(t.wheel);else{if(n.k===e)return;t.mouse=[o,n.invert(o)],u.interrupt(this),t.start()}l(),t.wheel=setTimeout(function(){t.wheel=null,t.end()},E),t.zoom("mouse",x(P(D(n,e),t.mouse[0],t.mouse[1]),t.extent,T))}}function A(){if(!a&&_.apply(this,arguments)){var t=j(this,arguments,!0),n=i.select(i.event.view).on("mousemove.zoom",function(){if(l(),!t.moved){var n=i.event.clientX-r,e=i.event.clientY-s;t.moved=n*n+e*e>V}t.zoom("mouse",x(P(t.that.__zoom,t.mouse[0]=i.mouse(t.that),t.mouse[1]),t.extent,T))},!0).on("mouseup.zoom",function(){n.on("mousemove.zoom mouseup.zoom",null),e.dragEnable(i.event.view,t.moved),l(),t.end()},!0),o=i.mouse(this),r=i.event.clientX,s=i.event.clientY;e.dragDisable(i.event.view),f(),t.mouse=[o,this.__zoom.invert(o)],u.interrupt(this),t.start()}}function H(){if(_.apply(this,arguments)){var t=this.__zoom,n=i.mouse(this),e=t.invert(n),o=t.k*(i.event.shiftKey?.5:2),u=x(P(D(t,o),n,e),g.apply(this,arguments),T);l(),b>0?i.select(this).transition().duration(b).call(S,u,n):i.select(this).call(B.transform,u)}}function N(){if(_.apply(this,arguments)){var n,e,o,r,s=i.event.touches,h=s.length,c=j(this,arguments,i.event.changedTouches.length===h);for(f(),e=0;e<h;++e)o=s[e],r=[r=i.touch(this,s,o.identifier),this.__zoom.invert(r),o.identifier],c.touch0?c.touch1||c.touch0[2]===r[2]||(c.touch1=r,c.taps=0):(c.touch0=r,n=!0,c.taps=1+!!t);t&&(t=clearTimeout(t)),n&&(c.taps<2&&(t=setTimeout(function(){t=null},q)),u.interrupt(this),c.start())}}function O(){if(this.__zooming){var n,e,o,u,r=j(this,arguments),s=i.event.changedTouches,h=s.length;for(l(),t&&(t=clearTimeout(t)),r.taps=0,n=0;n<h;++n)e=s[n],o=i.touch(this,s,e.identifier),r.touch0&&r.touch0[2]===e.identifier?r.touch0[0]=o:r.touch1&&r.touch1[2]===e.identifier&&(r.touch1[0]=o);if(e=r.that.__zoom,r.touch1){var c=r.touch0[0],a=r.touch0[1],f=r.touch1[0],m=r.touch1[1],p=(p=f[0]-c[0])*p+(p=f[1]-c[1])*p,v=(v=m[0]-a[0])*v+(v=m[1]-a[1])*v;e=D(e,Math.sqrt(p/v)),o=[(c[0]+f[0])/2,(c[1]+f[1])/2],u=[(a[0]+m[0])/2,(a[1]+m[1])/2]}else{if(!r.touch0)return;o=r.touch0[0],u=r.touch0[1]}r.zoom("touch",x(P(e,o,u),r.extent,T))}}function W(){if(this.__zooming){var t,n,e=j(this,arguments),o=i.event.changedTouches,u=o.length;for(f(),a&&clearTimeout(a),a=setTimeout(function(){a=null},q),t=0;t<u;++t)n=o[t],e.touch0&&e.touch0[2]===n.identifier?delete e.touch0:e.touch1&&e.touch1[2]===n.identifier&&delete e.touch1;if(e.touch1&&!e.touch0&&(e.touch0=e.touch1,delete e.touch1),e.touch0)e.touch0[1]=this.__zoom.invert(e.touch0[0]);else if(e.end(),2===e.taps){var r=i.select(this).on("dblclick.zoom");r&&r.apply(this,arguments)}}}return B.transform=function(t,n,e){var o=t.selection?t.selection():t;o.property("__zoom",v),t!==o?S(t,n,e):o.interrupt().each(function(){j(this,arguments).start().zoom(null,"function"==typeof n?n.apply(this,arguments):n).end()})},B.scaleBy=function(t,n,e){B.scaleTo(t,function(){var t=this.__zoom.k,e="function"==typeof n?n.apply(this,arguments):n;return t*e},e)},B.scaleTo=function(t,n,e){B.transform(t,function(){var t=g.apply(this,arguments),o=this.__zoom,i=null==e?I(t):"function"==typeof e?e.apply(this,arguments):e,u=o.invert(i),r="function"==typeof n?n.apply(this,arguments):n;return x(P(D(o,r),i,u),t,T)},e)},B.translateBy=function(t,n,e){B.transform(t,function(){return x(this.__zoom.translate("function"==typeof n?n.apply(this,arguments):n,"function"==typeof e?e.apply(this,arguments):e),g.apply(this,arguments),T)})},B.translateTo=function(t,n,e,o){B.transform(t,function(){var t=g.apply(this,arguments),i=this.__zoom,u=null==o?I(t):"function"==typeof o?o.apply(this,arguments):o;return x(c.translate(u[0],u[1]).scale(i.k).translate("function"==typeof n?-n.apply(this,arguments):-n,"function"==typeof e?-e.apply(this,arguments):-e),t,T)},o)},G.prototype={start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,n){return this.mouse&&"mouse"!==t&&(this.mouse[1]=n.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=n.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=n.invert(this.touch1[0])),this.that.__zoom=n,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){i.customEvent(new s(B,t,this.that.__zoom),X.apply,X,[t,this.that,this.args])}},B.wheelDelta=function(t){return arguments.length?(k="function"==typeof t?t:r(+t),B):k},B.filter=function(t){return arguments.length?(_="function"==typeof t?t:r(!!t),B):_},B.touchable=function(t){return arguments.length?(w="function"==typeof t?t:r(!!t),B):w},B.extent=function(t){return arguments.length?(g="function"==typeof t?t:r([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),B):g},B.scaleExtent=function(t){return arguments.length?(M[0]=+t[0],M[1]=+t[1],B):[M[0],M[1]]},B.translateExtent=function(t){return arguments.length?(T[0][0]=+t[0][0],T[1][0]=+t[1][0],T[0][1]=+t[0][1],T[1][1]=+t[1][1],B):[[T[0][0],T[0][1]],[T[1][0],T[1][1]]]},B.constrain=function(t){return arguments.length?(x=t,B):x},B.duration=function(t){return arguments.length?(b=+t,B):b},B.interpolate=function(t){return arguments.length?(Y=t,B):Y},B.on=function(){var t=X.on.apply(X,arguments);return t===X?B:t},B.clickDistance=function(t){return arguments.length?(V=(t=+t)*t,B):Math.sqrt(V)},B},t.zoomIdentity=c,t.zoomTransform=a,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
|