Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

d3-brush

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-brush - npm Package Compare versions

Comparing version 0.1.6 to 0.2.0

8

build/d3-brush.js

@@ -0,9 +1,8 @@

// https://d3js.org/d3-brush/ Version 0.2.0. Copyright 2016 Mike Bostock.
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-dispatch'), require('d3-drag'), require('d3-interpolate'), require('d3-selection'), require('d3-transition')) :
typeof define === 'function' && define.amd ? define(['exports', 'd3-dispatch', 'd3-drag', 'd3-interpolate', 'd3-selection', 'd3-transition'], factory) :
(factory((global.d3_brush = global.d3_brush || {}),global.d3_dispatch,global.d3_drag,global.d3_interpolate,global.d3_selection,global.d3_transition));
(factory((global.d3 = global.d3 || {}),global.d3,global.d3,global.d3,global.d3,global.d3));
}(this, function (exports,d3Dispatch,d3Drag,d3Interpolate,d3Selection,d3Transition) { 'use strict';
var version = "0.1.6";
function constant(x) {

@@ -561,3 +560,2 @@ return function() {

exports.version = version;
exports.brush = brush;

@@ -568,2 +566,4 @@ exports.brushX = brushX;

Object.defineProperty(exports, '__esModule', { value: true });
}));

@@ -1,1 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(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"],e):e(t.d3_brush=t.d3_brush||{},t.d3_dispatch,t.d3_drag,t.d3_interpolate,t.d3_selection,t.d3_transition)}(this,function(t,e,n,r,s,i){"use strict";function a(t){return function(){return t}}function u(t,e,n){this.target=t,this.type=e,this.selection=n}function o(){s.event.stopImmediatePropagation()}function l(){s.event.preventDefault(),s.event.stopImmediatePropagation()}function c(t){return{type:t}}function h(){return!s.event.button}function f(){var t=this.ownerSVGElement;return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function p(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function d(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function v(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function m(){return w(z)}function b(){return w(A)}function y(){return w(q)}function w(t){function v(e){var n=e.property("__brush",g).selectAll(".overlay").data([c("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",E.overlay).merge(n).each(function(){var t=p(this).extent;s.select(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])}),e.selectAll(".selection").data([c("selection")]).enter().append("rect").attr("class","selection").attr("cursor",E.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=e.selectAll(".handle").data(t.handles,function(t){return t.type});r.exit().remove(),r.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return E[t.type]}),e.each(m).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",w)}function m(){var t=s.select(this),e=p(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",function(t){return"e"===t.type[t.type.length-1]?e[1][0]-P/2:e[0][0]-P/2}).attr("y",function(t){return"s"===t.type[0]?e[1][1]-P/2:e[0][1]-P/2}).attr("width",function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+P:P}).attr("height",function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+P:P})):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function b(t,e){return t.__brush.emitter||new y(t,e)}function y(t,e){this.that=t,this.args=e,this.state=t.__brush,this.active=0}function w(){function e(){var t=s.mouse(Y);!$||N||X||(Math.abs(t[0]-et[0])>Math.abs(t[1]-et[1])?X=!0:N=!0),et=t,G=!0,l(),r()}function r(){var t;switch(P=et[0]-tt[0],j=et[1]-tt[1],F){case x:case _:H&&(P=Math.max(R-h,Math.min(W-w,P)),f=h+P,g=w+P),J&&(j=Math.max(U-v,Math.min(Z-C,j)),y=v+j,I=C+j);break;case M:0>H?(P=Math.max(R-h,Math.min(W-h,P)),f=h+P,g=w):H>0&&(P=Math.max(R-w,Math.min(W-w,P)),f=h,g=w+P),0>J?(j=Math.max(U-v,Math.min(Z-v,j)),y=v+j,I=C):J>0&&(j=Math.max(U-C,Math.min(Z-C,j)),y=v,I=C+j);break;case k:H&&(f=Math.max(R,Math.min(W,h-P*H)),g=Math.max(R,Math.min(W,w+P*H))),J&&(y=Math.max(U,Math.min(Z,v-j*J)),I=Math.max(U,Math.min(Z,C+j*J)))}f>g&&(H*=-1,t=h,h=w,w=t,t=f,f=g,g=t,B in K&&st.attr("cursor",E[B=K[B]])),y>I&&(J*=-1,t=v,v=C,C=t,t=y,y=I,I=t,B in S&&st.attr("cursor",E[B=S[B]])),N&&(f=Q[0][0],g=Q[1][0]),X&&(y=Q[0][1],I=Q[1][1]),Q[0][0]===f&&Q[0][1]===y&&Q[1][0]===g&&Q[1][1]===I||(Q[0][0]=f,Q[0][1]=y,Q[1][0]=g,Q[1][1]=I,m.call(Y),nt.brush())}function a(){if(o(),s.event.touches){if(s.event.touches.length)return;q&&clearTimeout(q),q=setTimeout(function(){q=null},500),rt.on("touchmove.brush touchend.brush touchcancel.brush",null)}else n.dragEnable(s.event.view,G),it.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);rt.attr("pointer-events","all"),st.attr("cursor",E.overlay),d(Q)&&(L.selection=null,m.call(Y)),nt.end()}function u(){switch(s.event.keyCode){case 16:$=H&&J;break;case 18:F===M&&(H&&(w=g-P*H,h=f+P*H),J&&(C=I-j*J,v=y+j*J),F=k,r());break;case 32:F!==M&&F!==k||(0>H?w=g-P:H>0&&(h=f-P),0>J?C=I-j:J>0&&(v=y-j),F=x,st.attr("cursor",E.selection),r());break;default:return}l()}function c(){switch(s.event.keyCode){case 16:$&&(N=X=$=!1,r());break;case 18:F===k&&(0>H?w=g:H>0&&(h=f),0>J?C=I:J>0&&(v=y),F=M,r());break;case 32:F===x&&(s.event.altKey?(H&&(w=g-P*H,h=f+P*H),J&&(C=I-j*J,v=y+j*J),F=k):(0>H?w=g:H>0&&(h=f),0>J?C=I:J>0&&(v=y),F=M),st.attr("cursor",E[B]),r());break;default:return}l()}if(s.event.touches){if(s.event.changedTouches.length<s.event.touches.length)return l()}else if(q)return;if(D.apply(this,arguments)){var h,f,v,y,w,g,C,I,P,j,G,N,X,Y=this,B=s.event.target.__data__.type,F="selection"===(s.event.metaKey?B="overlay":B)?_:s.event.altKey?k:M,H=t===A?null:T[B],J=t===z?null:V[B],L=p(Y),O=L.extent,Q=L.selection,R=O[0][0],U=O[0][1],W=O[1][0],Z=O[1][1],$=H&&J&&s.event.shiftKey,tt=s.mouse(Y),et=tt,nt=b(Y,arguments).beforestart();"overlay"===B?L.selection=Q=[[h=t===A?R:tt[0],v=t===z?U:tt[1]],[w=t===A?W:h,C=t===z?Z:v]]:(h=Q[0][0],v=Q[0][1],w=Q[1][0],C=Q[1][1]),f=h,y=v,g=w,I=C;var rt=s.select(Y).attr("pointer-events","none"),st=rt.selectAll(".overlay").attr("cursor",E[B]);if(s.event.touches)rt.on("touchmove.brush",e,!0).on("touchend.brush touchcancel.brush",a,!0);else{var it=s.select(s.event.view).on("keydown.brush",u,!0).on("keyup.brush",c,!0).on("mousemove.brush",e,!0).on("mouseup.brush",a,!0);n.dragDisable(s.event.view)}o(),i.interrupt(Y),m.call(Y),nt.start()}}function g(){var e=this.__brush||{selection:null};return e.extent=C.apply(this,arguments),e.dim=t,e}var q,C=f,D=h,I=e.dispatch(v,"start","brush","end"),P=6;return v.move=function(e,n){e.selection?e.on("start.brush",function(){b(this,arguments).beforestart().start()}).on("interrupt.brush end.brush",function(){b(this,arguments).end()}).tween("brush",function(){function e(t){i.selection=1===t&&d(o)?null:l(t),m.call(s),a.brush()}var s=this,i=s.__brush,a=b(s,arguments),u=i.selection,o=t.input("function"==typeof n?n.apply(this,arguments):n,i.extent),l=r.interpolate(u,o);return u&&o?e:e(1)}):e.each(function(){var e=this,r=arguments,s=e.__brush,a=t.input("function"==typeof n?n.apply(e,r):n,s.extent),u=b(e,r).beforestart();i.interrupt(e),s.selection=null==a||d(a)?null:a,m.call(e),u.start().brush().end()})},y.prototype={beforestart:function(){return 1===++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(){return this.starting&&(this.starting=!1,this.emit("start")),this},brush:function(){return this.emit("brush"),this},end:function(){return 0===--this.active&&(delete this.state.emitter,this.emit("end")),this},emit:function(e){s.customEvent(new u(v,e,t.output(this.state.selection)),I.apply,I,[e,this.that,this.args])}},v.extent=function(t){return arguments.length?(C="function"==typeof t?t:a([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),v):C},v.filter=function(t){return arguments.length?(D="function"==typeof t?t:a(!!t),v):D},v.handleSize=function(t){return arguments.length?(P=+t,v):P},v.on=function(){var t=I.on.apply(I,arguments);return t===I?v:t},v}var g="0.1.6",_={name:"drag"},x={name:"space"},M={name:"handle"},k={name:"center"},z={name:"x",handles:["e","w"].map(c),input:function(t,e){return t&&[[t[0],e[0][1]],[t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},A={name:"y",handles:["n","s"].map(c),input:function(t,e){return t&&[[e[0][0],t[0]],[e[1][0],t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},q={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(c),input:function(t){return t},output:function(t){return t}},E={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},K={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},S={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},T={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},V={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};t.version=g,t.brush=y,t.brushX=m,t.brushY=b,t.brushSelection=v});
// https://d3js.org/d3-brush/ Version 0.2.0. Copyright 2016 Mike Bostock.
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(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"],e):e(t.d3=t.d3||{},t.d3,t.d3,t.d3,t.d3,t.d3)}(this,function(t,e,n,r,s,a){"use strict";function i(t){return function(){return t}}function u(t,e,n){this.target=t,this.type=e,this.selection=n}function o(){s.event.stopImmediatePropagation()}function l(){s.event.preventDefault(),s.event.stopImmediatePropagation()}function c(t){return{type:t}}function h(){return!s.event.button}function f(){var t=this.ownerSVGElement;return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function p(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function d(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function v(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function m(){return w(k)}function y(){return w(z)}function b(){return w(A)}function w(t){function v(e){var n=e.property("__brush",A).selectAll(".overlay").data([c("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",q.overlay).merge(n).each(function(){var t=p(this).extent;s.select(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])}),e.selectAll(".selection").data([c("selection")]).enter().append("rect").attr("class","selection").attr("cursor",q.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=e.selectAll(".handle").data(t.handles,function(t){return t.type});r.exit().remove(),r.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return q[t.type]}),e.each(m).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",w)}function m(){var t=s.select(this),e=p(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",function(t){return"e"===t.type[t.type.length-1]?e[1][0]-D/2:e[0][0]-D/2}).attr("y",function(t){return"s"===t.type[0]?e[1][1]-D/2:e[0][1]-D/2}).attr("width",function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+D:D}).attr("height",function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+D:D})):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function y(t,e){return t.__brush.emitter||new b(t,e)}function b(t,e){this.that=t,this.args=e,this.state=t.__brush,this.active=0}function w(){function e(){var t=s.mouse(X);!$||N||O||(Math.abs(t[0]-et[0])>Math.abs(t[1]-et[1])?O=!0:N=!0),et=t,G=!0,l(),r()}function r(){var t;switch(D=et[0]-tt[0],I=et[1]-tt[1],B){case x:case g:F&&(D=Math.max(R-h,Math.min(W-w,D)),f=h+D,A=w+D),H&&(I=Math.max(U-v,Math.min(Z-V,I)),b=v+I,C=V+I);break;case _:0>F?(D=Math.max(R-h,Math.min(W-h,D)),f=h+D,A=w):F>0&&(D=Math.max(R-w,Math.min(W-w,D)),f=h,A=w+D),0>H?(I=Math.max(U-v,Math.min(Z-v,I)),b=v+I,C=V):H>0&&(I=Math.max(U-V,Math.min(Z-V,I)),b=v,C=V+I);break;case M:F&&(f=Math.max(R,Math.min(W,h-D*F)),A=Math.max(R,Math.min(W,w+D*F))),H&&(b=Math.max(U,Math.min(Z,v-I*H)),C=Math.max(U,Math.min(Z,V+I*H)))}f>A&&(F*=-1,t=h,h=w,w=t,t=f,f=A,A=t,Y in E&&st.attr("cursor",q[Y=E[Y]])),b>C&&(H*=-1,t=v,v=V,V=t,t=b,b=C,C=t,Y in K&&st.attr("cursor",q[Y=K[Y]])),N&&(f=Q[0][0],A=Q[1][0]),O&&(b=Q[0][1],C=Q[1][1]),Q[0][0]===f&&Q[0][1]===b&&Q[1][0]===A&&Q[1][1]===C||(Q[0][0]=f,Q[0][1]=b,Q[1][0]=A,Q[1][1]=C,m.call(X),nt.brush())}function i(){if(o(),s.event.touches){if(s.event.touches.length)return;T&&clearTimeout(T),T=setTimeout(function(){T=null},500),rt.on("touchmove.brush touchend.brush touchcancel.brush",null)}else n.dragEnable(s.event.view,G),at.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);rt.attr("pointer-events","all"),st.attr("cursor",q.overlay),d(Q)&&(J.selection=null,m.call(X)),nt.end()}function u(){switch(s.event.keyCode){case 16:$=F&&H;break;case 18:B===_&&(F&&(w=A-D*F,h=f+D*F),H&&(V=C-I*H,v=b+I*H),B=M,r());break;case 32:B!==_&&B!==M||(0>F?w=A-D:F>0&&(h=f-D),0>H?V=C-I:H>0&&(v=b-I),B=x,st.attr("cursor",q.selection),r());break;default:return}l()}function c(){switch(s.event.keyCode){case 16:$&&(N=O=$=!1,r());break;case 18:B===M&&(0>F?w=A:F>0&&(h=f),0>H?V=C:H>0&&(v=b),B=_,r());break;case 32:B===x&&(s.event.altKey?(F&&(w=A-D*F,h=f+D*F),H&&(V=C-I*H,v=b+I*H),B=M):(0>F?w=A:F>0&&(h=f),0>H?V=C:H>0&&(v=b),B=_),st.attr("cursor",q[Y]),r());break;default:return}l()}if(s.event.touches){if(s.event.changedTouches.length<s.event.touches.length)return l()}else if(T)return;if(j.apply(this,arguments)){var h,f,v,b,w,A,V,C,D,I,G,N,O,X=this,Y=s.event.target.__data__.type,B="selection"===(s.event.metaKey?Y="overlay":Y)?g:s.event.altKey?M:_,F=t===z?null:P[Y],H=t===k?null:S[Y],J=p(X),L=J.extent,Q=J.selection,R=L[0][0],U=L[0][1],W=L[1][0],Z=L[1][1],$=F&&H&&s.event.shiftKey,tt=s.mouse(X),et=tt,nt=y(X,arguments).beforestart();"overlay"===Y?J.selection=Q=[[h=t===z?R:tt[0],v=t===k?U:tt[1]],[w=t===z?W:h,V=t===k?Z:v]]:(h=Q[0][0],v=Q[0][1],w=Q[1][0],V=Q[1][1]),f=h,b=v,A=w,C=V;var rt=s.select(X).attr("pointer-events","none"),st=rt.selectAll(".overlay").attr("cursor",q[Y]);if(s.event.touches)rt.on("touchmove.brush",e,!0).on("touchend.brush touchcancel.brush",i,!0);else{var at=s.select(s.event.view).on("keydown.brush",u,!0).on("keyup.brush",c,!0).on("mousemove.brush",e,!0).on("mouseup.brush",i,!0);n.dragDisable(s.event.view)}o(),a.interrupt(X),m.call(X),nt.start()}}function A(){var e=this.__brush||{selection:null};return e.extent=V.apply(this,arguments),e.dim=t,e}var T,V=f,j=h,C=e.dispatch(v,"start","brush","end"),D=6;return v.move=function(e,n){e.selection?e.on("start.brush",function(){y(this,arguments).beforestart().start()}).on("interrupt.brush end.brush",function(){y(this,arguments).end()}).tween("brush",function(){function e(t){a.selection=1===t&&d(o)?null:l(t),m.call(s),i.brush()}var s=this,a=s.__brush,i=y(s,arguments),u=a.selection,o=t.input("function"==typeof n?n.apply(this,arguments):n,a.extent),l=r.interpolate(u,o);return u&&o?e:e(1)}):e.each(function(){var e=this,r=arguments,s=e.__brush,i=t.input("function"==typeof n?n.apply(e,r):n,s.extent),u=y(e,r).beforestart();a.interrupt(e),s.selection=null==i||d(i)?null:i,m.call(e),u.start().brush().end()})},b.prototype={beforestart:function(){return 1===++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(){return this.starting&&(this.starting=!1,this.emit("start")),this},brush:function(){return this.emit("brush"),this},end:function(){return 0===--this.active&&(delete this.state.emitter,this.emit("end")),this},emit:function(e){s.customEvent(new u(v,e,t.output(this.state.selection)),C.apply,C,[e,this.that,this.args])}},v.extent=function(t){return arguments.length?(V="function"==typeof t?t:i([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),v):V},v.filter=function(t){return arguments.length?(j="function"==typeof t?t:i(!!t),v):j},v.handleSize=function(t){return arguments.length?(D=+t,v):D},v.on=function(){var t=C.on.apply(C,arguments);return t===C?v:t},v}var g={name:"drag"},x={name:"space"},_={name:"handle"},M={name:"center"},k={name:"x",handles:["e","w"].map(c),input:function(t,e){return t&&[[t[0],e[0][1]],[t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},z={name:"y",handles:["n","s"].map(c),input:function(t,e){return t&&[[e[0][0],t[0]],[e[1][0],t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},A={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(c),input:function(t){return t},output:function(t){return t}},q={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},E={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},K={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},P={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},S={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};t.brush=b,t.brushX=m,t.brushY=y,t.brushSelection=v,Object.defineProperty(t,"__esModule",{value:!0})});

@@ -1,3 +0,1 @@

export {version} from "./build/package";
export {

@@ -4,0 +2,0 @@ default as brush,

{
"name": "d3-brush",
"version": "0.1.6",
"version": "0.2.0",
"description": "Select a one- or two-dimensional region using the mouse or touch.",

@@ -10,3 +10,3 @@ "keywords": [

],
"homepage": "https://github.com/d3/d3-brush",
"homepage": "https://d3js.org/d3-brush/",
"license": "BSD-3-Clause",

@@ -24,18 +24,18 @@ "author": {

"scripts": {
"pretest": "rm -rf build && mkdir build && json2module package.json > build/package.js && rollup -g d3-dispatch:d3_dispatch,d3-drag:d3_drag,d3-interpolate:d3_interpolate,d3-selection:d3_selection,d3-transition:d3_transition -f umd -n d3_brush -o build/d3-brush.js -- index.js",
"pretest": "rm -rf build && mkdir build && rollup --banner \"$(preamble)\" -g d3-dispatch:d3,d3-drag:d3,d3-interpolate:d3,d3-selection:d3,d3-transition:d3 -f umd -n d3 -o build/d3-brush.js -- index.js",
"test": "tape 'test/**/*-test.js' && eslint index.js src",
"prepublish": "npm run test && uglifyjs build/d3-brush.js -c -m -o build/d3-brush.min.js",
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp build/d3-brush.js ../d3.github.com/d3-brush.v0.1.js && cp build/d3-brush.min.js ../d3.github.com/d3-brush.v0.1.min.js && cd ../d3.github.com && git add d3-brush.v0.1.js d3-brush.v0.1.min.js && git commit -m \"d3-brush ${VERSION}\" && git push && cd - && zip -j build/d3-brush.zip -- LICENSE README.md build/d3-brush.js build/d3-brush.min.js"
"prepublish": "npm run test && uglifyjs --preamble \"$(preamble)\" build/d3-brush.js -c -m -o build/d3-brush.min.js",
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp build/d3-brush.js ../d3.github.com/d3-brush.v0.2.js && cp build/d3-brush.min.js ../d3.github.com/d3-brush.v0.2.min.js && cd ../d3.github.com && git add d3-brush.v0.2.js d3-brush.v0.2.min.js && git commit -m \"d3-brush ${VERSION}\" && git push && cd - && zip -j build/d3-brush.zip -- LICENSE README.md build/d3-brush.js build/d3-brush.min.js"
},
"dependencies": {
"d3-dispatch": "~0.4.3",
"d3-drag": "~0.2.0",
"d3-interpolate": "~0.8.0",
"d3-selection": "~0.7.2",
"d3-transition": "~0.2.8"
"d3-dispatch": "~0.5.0",
"d3-drag": "~0.3.0",
"d3-interpolate": "~0.9.0",
"d3-selection": "~0.8.0",
"d3-transition": "~0.3.0"
},
"devDependencies": {
"eslint": "2",
"json2module": "0.0",
"rollup": "0.26",
"package-preamble": "0.0",
"rollup": "0.27",
"tape": "4",

@@ -42,0 +42,0 @@ "uglify-js": "2"

@@ -11,17 +11,17 @@ # d3-brush

If you use NPM, `npm install d3-brush`. Otherwise, download the [latest release](https://github.com/d3/d3-brush/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-brush.v0.1.min.js) or as part of [D3 4.0](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3_brush` global is exported:
If you use NPM, `npm install d3-brush`. Otherwise, download the [latest release](https://github.com/d3/d3-brush/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-brush.v0.2.min.js) or as part of [D3 4.0](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported:
```html
<script src="https://d3js.org/d3-color.v0.4.min.js"></script>
<script src="https://d3js.org/d3-dispatch.v0.4.min.js"></script>
<script src="https://d3js.org/d3-ease.v0.7.min.js"></script>
<script src="https://d3js.org/d3-interpolate.v0.8.min.js"></script>
<script src="https://d3js.org/d3-timer.v0.4.min.js"></script>
<script src="https://d3js.org/d3-selection.v0.7.min.js"></script>
<script src="https://d3js.org/d3-transition.v0.2.min.js"></script>
<script src="https://d3js.org/d3-drag.v0.2.min.js"></script>
<script src="https://d3js.org/d3-brush.v0.1.min.js"></script>
<script src="https://d3js.org/d3-color.v0.5.min.js"></script>
<script src="https://d3js.org/d3-dispatch.v0.5.min.js"></script>
<script src="https://d3js.org/d3-ease.v0.8.min.js"></script>
<script src="https://d3js.org/d3-interpolate.v0.9.min.js"></script>
<script src="https://d3js.org/d3-timer.v0.5.min.js"></script>
<script src="https://d3js.org/d3-selection.v0.8.min.js"></script>
<script src="https://d3js.org/d3-transition.v0.3.min.js"></script>
<script src="https://d3js.org/d3-drag.v0.3.min.js"></script>
<script src="https://d3js.org/d3-brush.v0.2.min.js"></script>
<script>
var brush = d3_brush.brush();
var brush = d3.brush();

@@ -28,0 +28,0 @@ </script>

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc