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

d3kit

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3kit - npm Package Compare versions

Comparing version 3.0.0-3 to 3.0.0-4

2

dist/d3kit.js

@@ -1065,3 +1065,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

var fitResult = this.fit();
if (this.fitResult.changed) {
if (fitResult.changed) {
this.dispatcher.call('change', this, fitResult.dimension);

@@ -1068,0 +1068,0 @@ }

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-selection"),require("d3-dispatch")):"function"==typeof define&&define.amd?define(["d3-selection","d3-dispatch"],e):"object"==typeof exports?exports.d3Kit=e(require("d3-selection"),require("d3-dispatch")):t.d3Kit=e(t.d3,t.d3)}(this,function(t,e){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.helper=e.LayerOrganizer=e.SvgSkeleton=e.CanvasSkeleton=void 0;var o=n(1);Object.defineProperty(e,"CanvasSkeleton",{enumerable:!0,get:function(){return r(o)["default"]}});var u=n(20);Object.defineProperty(e,"SvgSkeleton",{enumerable:!0,get:function(){return r(u)["default"]}});var a=n(21);Object.defineProperty(e,"LayerOrganizer",{enumerable:!0,get:function(){return r(a)["default"]}});var s=n(19),f=i(s);e.helper=f},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function l(t,e,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);if(void 0===i){var r=Object.getPrototypeOf(t);return null===r?void 0:l(r,e,n)}if("value"in i)return i.value;var o=i.get;if(void 0!==o)return o.call(n)},s=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),f=n(2),c=i(f),h=function(t){function e(t){var n;r(this,e);for(var i=arguments.length,u=Array(i>1?i-1:0),a=1;a<i;a++)u[a-1]=arguments[a];var s=o(this,(n=Object.getPrototypeOf(e)).call.apply(n,[this,t,e.DEFAULT_OPTIONS].concat(u)));return s.canvas=s.container.append("canvas"),s.mainElement=s.canvas.node(),s.updateDimensionNow(),s}return u(e,t),s(e,null,[{key:"getCustomEventNames",value:function(){return[]}}]),s(e,[{key:"updateDimension",value:function(){a(Object.getPrototypeOf(e.prototype),"updateDimension",this).call(this);var t=this.state,n=t.width,i=t.height,r=this.state.options.pixelRatio;return this.canvas.style("width",n).style("height",i).attr("width",n*r).attr("height",i*r),this}}]),e}(c["default"]);h.DEFAULT_OPTIONS={pixelRatio:window.devicePixelRatio},e["default"]=h},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},u=function(){function t(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var u,a=t[Symbol.iterator]();!(i=(u=a.next()).done)&&(n.push(u.value),!e||n.length!==e);i=!0);}catch(s){r=!0,o=s}finally{try{!i&&a["return"]&&a["return"]()}finally{if(r)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=n(3),f=n(4),c=n(5),h=i(c),l=n(13),d=i(l),p=n(14),y=i(p),v=n(19),g=function(){function t(e){r(this,t);for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];var u=v.deepExtend.apply(void 0,[{},t.DEFAULT_OPTIONS].concat(i));this.state={width:u.initialWidth,height:u.initialHeight,innerWidth:0,innerHeight:0,fitOptions:null,options:u,data:null},this.container=(0,s.select)(e);var a=this.constructor.getCustomEventNames();this.setupDispatcher(a),this.dispatchData=(0,h["default"])(this.dispatchData.bind(this),1),this.dispatchOptions=(0,h["default"])(this.dispatchOptions.bind(this),1),this.dispatchResize=(0,h["default"])(this.dispatchResize.bind(this),1),this.updateDimension=(0,h["default"])(this.updateDimension.bind(this),1)}return a(t,null,[{key:"getCustomEventNames",value:function(){return[]}}]),a(t,[{key:"setupDispatcher",value:function(){var e=arguments.length<=0||void 0===arguments[0]?[]:arguments[0];this.customEventNames=e,this.eventNames=t.DEFAULT_EVENTS.concat(e),this.dispatcher=f.dispatch.apply(this,this.eventNames)}},{key:"getCustomEventNames",value:function(){return this.customEventNames}},{key:"getInnerWidth",value:function(){return this.state.innerWidth}},{key:"getInnerHeight",value:function(){return this.state.innerHeight}},{key:"width",value:function(){if(0===arguments.length)return this.state.width;var t=Math.floor(+(arguments.length<=0?void 0:arguments[0]));return t!==this.state.width&&(this.state.width=t,this.updateDimension(),this.dispatchResize()),this}},{key:"height",value:function(){if(0===arguments.length)return this.state.height;var t=Math.floor(+(arguments.length<=0?void 0:arguments[0]));return t!==this.state.height&&(this.state.height=t,this.updateDimension(),this.dispatchResize()),this}},{key:"dimension",value:function(){if(0===arguments.length)return[this.state.width,this.state.height];var t=arguments.length<=0?void 0:arguments[0],e=u(t,2),n=e[0],i=e[1];return this.width(n).height(i),this}},{key:"data",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];if(0===e.length)return this.state.data;var i=e[0];return this.state.data=i,this.dispatchData(),this}},{key:"margin",value:function(){if(0===arguments.length)return this.state.options.margin;var t=this.state.options.margin,e=(0,v.extend)({},this.state.options.margin,arguments.length<=0?void 0:arguments[0]),n=Object.keys(t).some(function(n){return t[n]!==e[n]});return n&&(this.state.options.margin=e,this.updateDimension(),this.dispatchResize()),this}},{key:"offset",value:function(){if(0===arguments.length)return this.state.options.offset;var t=this.state.options.offset,e=o({},this.state.offset,arguments.length<=0?void 0:arguments[0]),n=Object.keys(t).some(function(n){return t[n]!==e[n]});return n&&(this.state.options.offset=e,this.updateDimension(),this.dispatchResize()),this}},{key:"options",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];if(0===e.length)return this.state.options;var i=e[0];return i.margin&&this.margin(i.margin),i.offset&&this.offset(i.offset),this.state.options=(0,v.deepExtend)(this.state.options,i),this.dispatchOptions(),this}},{key:"updateDimension",value:function(){var t=this.state,e=t.width,n=t.height,i=this.state.options.margin,r=i.top,o=i.right,u=i.bottom,a=i.left;return this.state.innerWidth=e-a-o,this.state.innerHeight=n-r-u,this}},{key:"updateDimensionNow",value:function(){return this.updateDimension(),this.updateDimension.flush(),this}},{key:"hasData",value:function(){var t=this.state.data;return null!==t&&void 0!==t}},{key:"hasNonZeroArea",value:function(){var t=this.state,e=t.innerWidth,n=t.innerHeight;return e>0&&n>0}},{key:"fit",value:function(t){t&&(this.state.fitOptions=t);var e=new y["default"](t),n=e.fit(this.mainElement,this.container.node()),i=n.changed,r=n.dimension;return i&&this.dimension([r.width,r.height]),this}},{key:"autoFit",value:function(t,e,n){var i=this;return e&&(this.state.fitOptions=e),n&&(this.state.watchOptions=n),t?(this.fitWatcher&&this.fitWatcher.destroy(),this.fitWatcher=new d["default"](this.mainElement,this.container.node(),this.state.fitOptions,this.state.watchOptions).on("change",function(t){return i.dimension([t.width,t.height])}).start()):this.fitWatcher&&(this.fitWatcher.destroy(),this.fitWatcher=null),this}},{key:"dispatchData",value:function(){return this.dispatcher.call("data",this,this.state.data),this}},{key:"dispatchOptions",value:function(){return this.dispatcher.call("options",this,this.state.options),this}},{key:"dispatchResize",value:function(){var t=this.state,e=t.width,n=t.height,i=t.innerWidth,r=t.innerHeight;return this.dispatcher.apply("resize",this,[e,n,i,r]),this}},{key:"on",value:function(t,e){return this.dispatcher.on(t,e),this}},{key:"off",value:function(t){return this.dispatcher.on(t,null),this}},{key:"destroy",value:function(){var t=this;this.eventNames.forEach(function(e){t.off(e)}),this.fitWatcher&&(this.fitWatcher.destroy(),this.fitWatcher=null)}}]),t}();g.DEFAULT_OPTIONS={initialWidth:720,initialHeight:500,margin:{top:30,right:30,bottom:30,left:30},offset:{x:.5,y:.5}},g.DEFAULT_EVENTS=["data","options","resize"],e["default"]=g},function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){"use strict";function i(t,e,n){function i(e){var n=b,i=m;return b=m=void 0,j=e,O=t.apply(i,n)}function c(t){return j=t,_=setTimeout(d,e),k?i(t):O}function h(t){var n=t-E,i=t-j,r=e-n;return P?f(r,w-i):r}function l(t){var n=t-E,i=t-j;return void 0===E||n>=e||n<0||P&&i>=w}function d(){var t=o();return l(t)?p(t):void(_=setTimeout(d,h(t)))}function p(t){return _=void 0,S&&b?i(t):(b=m=void 0,O)}function y(){void 0!==_&&clearTimeout(_),j=0,b=E=m=_=void 0}function v(){return void 0===_?O:p(o())}function g(){var t=o(),n=l(t);if(b=arguments,m=this,E=t,n){if(void 0===_)return c(E);if(P)return _=setTimeout(d,e),i(E)}return void 0===_&&(_=setTimeout(d,e)),O}var b,m,w,O,_,E,j=0,k=!1,P=!1,S=!0;if("function"!=typeof t)throw new TypeError(a);return e=u(e)||0,r(n)&&(k=!!n.leading,P="maxWait"in n,w=P?s(u(n.maxWait)||0,e):w,S="trailing"in n?!!n.trailing:S),g.cancel=y,g.flush=v,g}var r=n(6),o=n(7),u=n(10),a="Expected a function",s=Math.max,f=Math.min;t.exports=i},function(t,e){"use strict";function n(t){var e="undefined"==typeof t?"undefined":i(t);return!!t&&("object"==e||"function"==e)}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};t.exports=n},function(t,e,n){"use strict";var i=n(8),r=function(){return i.Date.now()};t.exports=r},function(t,e,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},r=n(9),o="object"==("undefined"==typeof self?"undefined":i(self))&&self&&self.Object===Object&&self,u=r||o||Function("return this")();t.exports=u},function(t,e){(function(e){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},i="object"==("undefined"==typeof e?"undefined":n(e))&&e&&e.Object===Object&&e;t.exports=i}).call(e,function(){return this}())},function(t,e,n){"use strict";function i(t){if("number"==typeof t)return t;if(o(t))return u;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(a,"");var n=f.test(t);return n||c.test(t)?h(t.slice(2),n?2:8):s.test(t)?u:+t}var r=n(6),o=n(11),u=NaN,a=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,c=/^0o[0-7]+$/i,h=parseInt;t.exports=i},function(t,e,n){"use strict";function i(t){return"symbol"==("undefined"==typeof t?"undefined":r(t))||o(t)&&s.call(t)==u}var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},o=n(12),u="[object Symbol]",a=Object.prototype,s=a.toString;t.exports=i},function(t,e){"use strict";function n(t){return!!t&&"object"==("undefined"==typeof t?"undefined":i(t))}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};t.exports=n},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=n(14),f=i(s),c=n(17),h=i(c),l=n(16),d=function(t){function e(){var t=arguments.length<=0||void 0===arguments[0]?(0,l.isRequired)("box"):arguments[0],n=arguments.length<=1||void 0===arguments[1]?(0,l.isRequired)("container"):arguments[1],i=arguments[2],u=arguments[3];r(this,e);var a=o(this,Object.getPrototypeOf(e).call(this,u)),s=new f["default"](i);return a.fit=function(){return s.fit(t,n)},a}return u(e,t),a(e,[{key:"check",value:function(){if(this.hasTargetChanged()){var t=this.fit();this.fitResult.changed&&this.dispatcher.call("change",this,t.dimension)}return this}}]),e}(h["default"]);e["default"]=d},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),u=n(15),a=i(u),s=n(16),f=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,t);var n=e.mode,i=void 0===n?t.MODE_BASIC:n,o=e.width,u=void 0===o?"100%":o,a=e.height,f=void 0===a?null:a,c=e.ratio,h=void 0===c?1:c,l=e.maxWidth,d=void 0===l?null:l,p=e.maxHeight,y=void 0===p?null:p;i===t.MODE_ASPECT_RATIO?(this.wFn=(0,s.parseModifier)(d),this.hFn=(0,s.parseModifier)(y),this.options={mode:i,ratio:h,maxWidth:d,maxHeight:y}):(this.wFn=(0,s.parseModifier)(u),this.hFn=(0,s.parseModifier)(f),this.options={mode:i,width:u,height:f})}return o(t,[{key:"fit",value:function(){var e=arguments.length<=0||void 0===arguments[0]?(0,s.isRequired)("box"):arguments[0],n=arguments.length<=1||void 0===arguments[1]?(0,s.isRequired)("container"):arguments[1],i=new a["default"](e),r=i.width,o=i.height,u=new a["default"](n),f=u.width,c=u.height,h=void 0;if(this.options.mode===t.MODE_ASPECT_RATIO){var l=this.options.ratio,d=this.wFn(f,f),p=this.hFn(c,c),y=Math.floor(l*p);h=y<=d?new a["default"](y,p):new a["default"](d,Math.floor(d/l))}else h=new a["default"](this.wFn(r,f),this.hFn(o,c));return{dimension:h,changed:!h.isEqual(i)}}}]),t}();f.MODE_BASIC="basic",f.MODE_ASPECT_RATIO="aspectRatio",e["default"]=f},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(16),u=function(){function t(){i(this,t);for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];if(1===n.length){var u=n[0],a=(0,o.isFunction)(u)?u():u;if(a instanceof t)this.width=a.width,this.height=a.height;else if((0,o.isElement)(a))this.width=a.clientWidth,this.height=a.clientHeight;else if(Array.isArray(a))this.width=a[0],this.height=a[1];else{if(!((0,o.isDefined)(a)&&(0,o.isDefined)(a.width)&&(0,o.isDefined)(a.height))){var s=new Error("Unsupported input. Must be either\n DOMNode, Array or Object with field width and height,\n or a function that returns any of the above.");throw s.value=u,s}this.width=a.width,this.height=a.height}}else{var f=n[0],c=n[1];this.width=f,this.height=c}}return r(t,[{key:"isEqual",value:function(e){if(e instanceof t)return this.width===e.width&&this.height===e.height;var n=new t(e);return this.width===n.width&&this.height===n.height}},{key:"toArray",value:function(){return[this.width,this.height]}},{key:"toObject",value:function(){return{width:this.width,height:this.height}}}]),t}();e["default"]=u},function(t,e){"use strict";function n(t){throw new Error("Missing parameter "+t)}function i(t){return null!==t&&void 0!==t}function r(t){return null===t||void 0===t}function o(t){return!(!t||1!==t.nodeType)}function u(t){if(r(t))return function(t,e){return Math.min(t,e)};var e=(""+t).trim().toLowerCase();if(e.indexOf("%")>-1){var n=function(){var t=+e.replace("%","")/100;return{v:function(e,n){return n*t}}}();if("object"===("undefined"==typeof n?"undefined":a(n)))return n.v}return function(){return+e.replace("px","")}}Object.defineProperty(e,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};e.isRequired=n,e.isDefined=i,e.isNotDefined=r,e.isElement=o,e.parseModifier=u;e.isFunction=function(){return"function"!=typeof/./&&"object"!==("undefined"==typeof Int8Array?"undefined":a(Int8Array))?function(t){return"function"==typeof t||!1}:function(t){var e={};return t&&"[object Function]"===e.toString.call(t)}}()},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),u=n(15),a=i(u),s=n(4),f=n(16),c=n(18),h=i(c),l=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e.type,i=void 0===n?t.TYPE_WINDOW:n,o=e.target,u=void 0===o?null:o,a=e.interval,c=void 0===a?500:a;r(this,t),i!==t.TYPE_POLLING||u||(0,f.isRequired)("options.target"),this.type=i,this.target=u,this.interval=c,this.dispatcher=(0,s.dispatch)("change"),this.check=this.check.bind(this),this.throttledCheck=(0,h["default"])(this.check,this.interval),this.isWatching=!1}return o(t,[{key:"hasTargetChanged",value:function(){if(!this.target)return!0;var t=new a["default"](this.target);return(!this.currentDim||!t.isEqual(this.currentDim))&&(this.currentDim=t,!0)}},{key:"check",value:function(){return this.hasTargetChanged()&&this.dispatcher.call("change",this,this.currentDim),this}},{key:"on",value:function(t,e){return this.dispatcher.on(t,e),this}},{key:"off",value:function(t){return this.dispatcher.on(t,null),this}},{key:"start",value:function(){return this.isWatching||(this.target&&(this.currentDim=new a["default"](this.target)),this.type===t.TYPE_WINDOW?window.addEventListener("resize",this.throttledCheck):this.type===t.TYPE_POLLING&&(this.intervalId=window.setInterval(this.check,this.interval)),this.isWatching=!0),this}},{key:"stop",value:function(){return this.isWatching&&(this.type===t.TYPE_WINDOW?window.removeEventListener("resize",this.throttledCheck):this.type===t.TYPE_POLLING&&this.intervalId&&(window.clearInterval(this.intervalId),this.intervalId=null),this.isWatching=!1),this}},{key:"destroy",value:function(){return this.stop(),this.off("change"),this}}]),t}();l.TYPE_WINDOW="window",l.TYPE_POLLING="polling",e["default"]=l},function(t,e,n){"use strict";function i(t,e,n){var i=!0,a=!0;if("function"!=typeof t)throw new TypeError(u);return o(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),r(t,e,{leading:i,maxWait:e,trailing:a})}var r=n(5),o=n(6),u="Expected a function";t.exports=i},function(t,e){"use strict";function n(t){return!(!t||!p["undefined"==typeof t?"undefined":d(t)])}function i(t){var e={};return!!t&&"[object Function]"===e.toString.call(t)}function r(t){return null==t?"":String(t).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function o(t){return null==t?"\\s":t.source?t.source:"["+r(t)+"]"}function u(t,e){if(null==t)return"";if(!e&&y)return y.call(t);var n=o(e),i=new RegExp("^"+n+"+|"+n+"+$","g");return String(t).replace(i,"")}function a(t){return u(t).replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()}function s(t){t=t||{};for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var o in r)if(r.hasOwnProperty(o)){var u=r[o];!n(u)||Array.isArray(u)||i(u)?t[o]=u:t[o]=s(t[o],u)}}return t}function f(t){t=t||{};for(var e=1;e<arguments.length;e++)if(arguments[e])for(var n in arguments[e])arguments[e].hasOwnProperty(n)&&(t[n]=arguments[e][n]);return t}function c(t,e,n){return function(){var i=n.apply(e,arguments);return i===e?t:i}}function h(t,e){for(var n=1,i=arguments.length,r=void 0;++n<i;)t[r=arguments[n]]=c(t,e,e[r]);return t}function l(t){return i(t)?t:function(){return t}}Object.defineProperty(e,"__esModule",{value:!0});var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};e.isObject=n,e.isFunction=i,e.kebabCase=a,e.deepExtend=s,e.extend=f,e.rebind=h,e.functor=l;var p={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},y=String.prototype.trim},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function p(t,e,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);if(void 0===i){var r=Object.getPrototypeOf(t);return null===r?void 0:p(r,e,n)}if("value"in i)return i.value;var o=i.get;if(void 0!==o)return o.call(n)},s=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),f=n(2),c=i(f),h=n(21),l=i(h),d=function(t){function e(t){var n;r(this,e);for(var i=arguments.length,u=Array(i>1?i-1:0),a=1;a<i;a++)u[a-1]=arguments[a];var s=o(this,(n=Object.getPrototypeOf(e)).call.apply(n,[this,t,e.DEFAULT_OPTIONS].concat(u)));return s.svg=s.container.append("svg"),s.rootG=s.svg.append("g"),s.layers=new l["default"](s.rootG),s.mainElement=s.svg.node(),s.updateDimensionNow(),s}return u(e,t),s(e,null,[{key:"getCustomEventNames",value:function(){return[]}}]),s(e,[{key:"updateDimension",value:function(){a(Object.getPrototypeOf(e.prototype),"updateDimension",this).call(this);var t=this.state,n=t.width,i=t.height,r=this.state.options,o=r.offset,u=r.margin,s=u.top,f=u.left;return this.svg.attr("width",n).attr("height",i),this.rootG.attr("transform","translate("+(f+o.x)+","+(s+o.y)+")"),this}}]),e}(c["default"]);d.DEFAULT_OPTIONS={},e["default"]=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var u,a=t[Symbol.iterator]();!(i=(u=a.next()).done)&&(n.push(u.value),!e||n.length!==e);i=!0);}catch(s){r=!0,o=s}finally{try{!i&&a["return"]&&a["return"]()}finally{if(r)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e["default"]=function(t){function e(t,e){var n=arguments.length<=2||void 0===arguments[2]?"":arguments[2],i=e.split("."),o=void 0,u=void 0;i.length>1?(u=i[0].length>0?i[0]:"g",o=i[1]):(u="g",o=i[0]);var a=""+n+o;if(f.hasOwnProperty(a))throw new Error("invalid or duplicate layer id: "+a);var s=(0,r.kebabCase)(o)+"-layer",c=t.append(u).classed(s,!0);return f[a]=c,c}function n(t,o){var u=arguments.length<=2||void 0===arguments[2]?"":arguments[2];if(Array.isArray(o))return o.map(function(e){return n(t,e,u)});if((0,r.isObject)(o)){var a=Object.keys(o),s=i(a,1),f=s[0],c=e(t,f,u);return n(c,o[f],""+u+f+"."),c}return e(t,o,u)}function o(e){return n(t,e)}function u(t){return Array.isArray(t)?t.map(o):o(t)}function a(t){return f[t]}function s(t){return!!f[t]}var f={};return{create:u,get:a,has:s}};var r=n(19)}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-selection"),require("d3-dispatch")):"function"==typeof define&&define.amd?define(["d3-selection","d3-dispatch"],e):"object"==typeof exports?exports.d3Kit=e(require("d3-selection"),require("d3-dispatch")):t.d3Kit=e(t.d3,t.d3)}(this,function(t,e){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.helper=e.LayerOrganizer=e.SvgSkeleton=e.CanvasSkeleton=void 0;var o=n(1);Object.defineProperty(e,"CanvasSkeleton",{enumerable:!0,get:function(){return r(o)["default"]}});var a=n(20);Object.defineProperty(e,"SvgSkeleton",{enumerable:!0,get:function(){return r(a)["default"]}});var u=n(21);Object.defineProperty(e,"LayerOrganizer",{enumerable:!0,get:function(){return r(u)["default"]}});var s=n(19),f=i(s);e.helper=f},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function l(t,e,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);if(void 0===i){var r=Object.getPrototypeOf(t);return null===r?void 0:l(r,e,n)}if("value"in i)return i.value;var o=i.get;if(void 0!==o)return o.call(n)},s=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),f=n(2),c=i(f),h=function(t){function e(t){var n;r(this,e);for(var i=arguments.length,a=Array(i>1?i-1:0),u=1;u<i;u++)a[u-1]=arguments[u];var s=o(this,(n=Object.getPrototypeOf(e)).call.apply(n,[this,t,e.DEFAULT_OPTIONS].concat(a)));return s.canvas=s.container.append("canvas"),s.mainElement=s.canvas.node(),s.updateDimensionNow(),s}return a(e,t),s(e,null,[{key:"getCustomEventNames",value:function(){return[]}}]),s(e,[{key:"updateDimension",value:function(){u(Object.getPrototypeOf(e.prototype),"updateDimension",this).call(this);var t=this.state,n=t.width,i=t.height,r=this.state.options.pixelRatio;return this.canvas.style("width",n).style("height",i).attr("width",n*r).attr("height",i*r),this}}]),e}(c["default"]);h.DEFAULT_OPTIONS={pixelRatio:window.devicePixelRatio},e["default"]=h},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},a=function(){function t(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(i=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(s){r=!0,o=s}finally{try{!i&&u["return"]&&u["return"]()}finally{if(r)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=n(3),f=n(4),c=n(5),h=i(c),l=n(13),d=i(l),p=n(14),y=i(p),v=n(19),g=function(){function t(e){r(this,t);for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];var a=v.deepExtend.apply(void 0,[{},t.DEFAULT_OPTIONS].concat(i));this.state={width:a.initialWidth,height:a.initialHeight,innerWidth:0,innerHeight:0,fitOptions:null,options:a,data:null},this.container=(0,s.select)(e);var u=this.constructor.getCustomEventNames();this.setupDispatcher(u),this.dispatchData=(0,h["default"])(this.dispatchData.bind(this),1),this.dispatchOptions=(0,h["default"])(this.dispatchOptions.bind(this),1),this.dispatchResize=(0,h["default"])(this.dispatchResize.bind(this),1),this.updateDimension=(0,h["default"])(this.updateDimension.bind(this),1)}return u(t,null,[{key:"getCustomEventNames",value:function(){return[]}}]),u(t,[{key:"setupDispatcher",value:function(){var e=arguments.length<=0||void 0===arguments[0]?[]:arguments[0];this.customEventNames=e,this.eventNames=t.DEFAULT_EVENTS.concat(e),this.dispatcher=f.dispatch.apply(this,this.eventNames)}},{key:"getCustomEventNames",value:function(){return this.customEventNames}},{key:"getInnerWidth",value:function(){return this.state.innerWidth}},{key:"getInnerHeight",value:function(){return this.state.innerHeight}},{key:"width",value:function(){if(0===arguments.length)return this.state.width;var t=Math.floor(+(arguments.length<=0?void 0:arguments[0]));return t!==this.state.width&&(this.state.width=t,this.updateDimension(),this.dispatchResize()),this}},{key:"height",value:function(){if(0===arguments.length)return this.state.height;var t=Math.floor(+(arguments.length<=0?void 0:arguments[0]));return t!==this.state.height&&(this.state.height=t,this.updateDimension(),this.dispatchResize()),this}},{key:"dimension",value:function(){if(0===arguments.length)return[this.state.width,this.state.height];var t=arguments.length<=0?void 0:arguments[0],e=a(t,2),n=e[0],i=e[1];return this.width(n).height(i),this}},{key:"data",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];if(0===e.length)return this.state.data;var i=e[0];return this.state.data=i,this.dispatchData(),this}},{key:"margin",value:function(){if(0===arguments.length)return this.state.options.margin;var t=this.state.options.margin,e=(0,v.extend)({},this.state.options.margin,arguments.length<=0?void 0:arguments[0]),n=Object.keys(t).some(function(n){return t[n]!==e[n]});return n&&(this.state.options.margin=e,this.updateDimension(),this.dispatchResize()),this}},{key:"offset",value:function(){if(0===arguments.length)return this.state.options.offset;var t=this.state.options.offset,e=o({},this.state.offset,arguments.length<=0?void 0:arguments[0]),n=Object.keys(t).some(function(n){return t[n]!==e[n]});return n&&(this.state.options.offset=e,this.updateDimension(),this.dispatchResize()),this}},{key:"options",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];if(0===e.length)return this.state.options;var i=e[0];return i.margin&&this.margin(i.margin),i.offset&&this.offset(i.offset),this.state.options=(0,v.deepExtend)(this.state.options,i),this.dispatchOptions(),this}},{key:"updateDimension",value:function(){var t=this.state,e=t.width,n=t.height,i=this.state.options.margin,r=i.top,o=i.right,a=i.bottom,u=i.left;return this.state.innerWidth=e-u-o,this.state.innerHeight=n-r-a,this}},{key:"updateDimensionNow",value:function(){return this.updateDimension(),this.updateDimension.flush(),this}},{key:"hasData",value:function(){var t=this.state.data;return null!==t&&void 0!==t}},{key:"hasNonZeroArea",value:function(){var t=this.state,e=t.innerWidth,n=t.innerHeight;return e>0&&n>0}},{key:"fit",value:function(t){t&&(this.state.fitOptions=t);var e=new y["default"](t),n=e.fit(this.mainElement,this.container.node()),i=n.changed,r=n.dimension;return i&&this.dimension([r.width,r.height]),this}},{key:"autoFit",value:function(t,e,n){var i=this;return e&&(this.state.fitOptions=e),n&&(this.state.watchOptions=n),t?(this.fitWatcher&&this.fitWatcher.destroy(),this.fitWatcher=new d["default"](this.mainElement,this.container.node(),this.state.fitOptions,this.state.watchOptions).on("change",function(t){return i.dimension([t.width,t.height])}).start()):this.fitWatcher&&(this.fitWatcher.destroy(),this.fitWatcher=null),this}},{key:"dispatchData",value:function(){return this.dispatcher.call("data",this,this.state.data),this}},{key:"dispatchOptions",value:function(){return this.dispatcher.call("options",this,this.state.options),this}},{key:"dispatchResize",value:function(){var t=this.state,e=t.width,n=t.height,i=t.innerWidth,r=t.innerHeight;return this.dispatcher.apply("resize",this,[e,n,i,r]),this}},{key:"on",value:function(t,e){return this.dispatcher.on(t,e),this}},{key:"off",value:function(t){return this.dispatcher.on(t,null),this}},{key:"destroy",value:function(){var t=this;this.eventNames.forEach(function(e){t.off(e)}),this.fitWatcher&&(this.fitWatcher.destroy(),this.fitWatcher=null)}}]),t}();g.DEFAULT_OPTIONS={initialWidth:720,initialHeight:500,margin:{top:30,right:30,bottom:30,left:30},offset:{x:.5,y:.5}},g.DEFAULT_EVENTS=["data","options","resize"],e["default"]=g},function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){"use strict";function i(t,e,n){function i(e){var n=b,i=m;return b=m=void 0,j=e,O=t.apply(i,n)}function c(t){return j=t,_=setTimeout(d,e),k?i(t):O}function h(t){var n=t-E,i=t-j,r=e-n;return P?f(r,w-i):r}function l(t){var n=t-E,i=t-j;return void 0===E||n>=e||n<0||P&&i>=w}function d(){var t=o();return l(t)?p(t):void(_=setTimeout(d,h(t)))}function p(t){return _=void 0,S&&b?i(t):(b=m=void 0,O)}function y(){void 0!==_&&clearTimeout(_),j=0,b=E=m=_=void 0}function v(){return void 0===_?O:p(o())}function g(){var t=o(),n=l(t);if(b=arguments,m=this,E=t,n){if(void 0===_)return c(E);if(P)return _=setTimeout(d,e),i(E)}return void 0===_&&(_=setTimeout(d,e)),O}var b,m,w,O,_,E,j=0,k=!1,P=!1,S=!0;if("function"!=typeof t)throw new TypeError(u);return e=a(e)||0,r(n)&&(k=!!n.leading,P="maxWait"in n,w=P?s(a(n.maxWait)||0,e):w,S="trailing"in n?!!n.trailing:S),g.cancel=y,g.flush=v,g}var r=n(6),o=n(7),a=n(10),u="Expected a function",s=Math.max,f=Math.min;t.exports=i},function(t,e){"use strict";function n(t){var e="undefined"==typeof t?"undefined":i(t);return!!t&&("object"==e||"function"==e)}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};t.exports=n},function(t,e,n){"use strict";var i=n(8),r=function(){return i.Date.now()};t.exports=r},function(t,e,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},r=n(9),o="object"==("undefined"==typeof self?"undefined":i(self))&&self&&self.Object===Object&&self,a=r||o||Function("return this")();t.exports=a},function(t,e){(function(e){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},i="object"==("undefined"==typeof e?"undefined":n(e))&&e&&e.Object===Object&&e;t.exports=i}).call(e,function(){return this}())},function(t,e,n){"use strict";function i(t){if("number"==typeof t)return t;if(o(t))return a;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(u,"");var n=f.test(t);return n||c.test(t)?h(t.slice(2),n?2:8):s.test(t)?a:+t}var r=n(6),o=n(11),a=NaN,u=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,c=/^0o[0-7]+$/i,h=parseInt;t.exports=i},function(t,e,n){"use strict";function i(t){return"symbol"==("undefined"==typeof t?"undefined":r(t))||o(t)&&s.call(t)==a}var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},o=n(12),a="[object Symbol]",u=Object.prototype,s=u.toString;t.exports=i},function(t,e){"use strict";function n(t){return!!t&&"object"==("undefined"==typeof t?"undefined":i(t))}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};t.exports=n},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=n(14),f=i(s),c=n(17),h=i(c),l=n(16),d=function(t){function e(){var t=arguments.length<=0||void 0===arguments[0]?(0,l.isRequired)("box"):arguments[0],n=arguments.length<=1||void 0===arguments[1]?(0,l.isRequired)("container"):arguments[1],i=arguments[2],a=arguments[3];r(this,e);var u=o(this,Object.getPrototypeOf(e).call(this,a)),s=new f["default"](i);return u.fit=function(){return s.fit(t,n)},u}return a(e,t),u(e,[{key:"check",value:function(){if(this.hasTargetChanged()){var t=this.fit();t.changed&&this.dispatcher.call("change",this,t.dimension)}return this}}]),e}(h["default"]);e["default"]=d},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=n(15),u=i(a),s=n(16),f=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,t);var n=e.mode,i=void 0===n?t.MODE_BASIC:n,o=e.width,a=void 0===o?"100%":o,u=e.height,f=void 0===u?null:u,c=e.ratio,h=void 0===c?1:c,l=e.maxWidth,d=void 0===l?null:l,p=e.maxHeight,y=void 0===p?null:p;i===t.MODE_ASPECT_RATIO?(this.wFn=(0,s.parseModifier)(d),this.hFn=(0,s.parseModifier)(y),this.options={mode:i,ratio:h,maxWidth:d,maxHeight:y}):(this.wFn=(0,s.parseModifier)(a),this.hFn=(0,s.parseModifier)(f),this.options={mode:i,width:a,height:f})}return o(t,[{key:"fit",value:function(){var e=arguments.length<=0||void 0===arguments[0]?(0,s.isRequired)("box"):arguments[0],n=arguments.length<=1||void 0===arguments[1]?(0,s.isRequired)("container"):arguments[1],i=new u["default"](e),r=i.width,o=i.height,a=new u["default"](n),f=a.width,c=a.height,h=void 0;if(this.options.mode===t.MODE_ASPECT_RATIO){var l=this.options.ratio,d=this.wFn(f,f),p=this.hFn(c,c),y=Math.floor(l*p);h=y<=d?new u["default"](y,p):new u["default"](d,Math.floor(d/l))}else h=new u["default"](this.wFn(r,f),this.hFn(o,c));return{dimension:h,changed:!h.isEqual(i)}}}]),t}();f.MODE_BASIC="basic",f.MODE_ASPECT_RATIO="aspectRatio",e["default"]=f},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(16),a=function(){function t(){i(this,t);for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];if(1===n.length){var a=n[0],u=(0,o.isFunction)(a)?a():a;if(u instanceof t)this.width=u.width,this.height=u.height;else if((0,o.isElement)(u))this.width=u.clientWidth,this.height=u.clientHeight;else if(Array.isArray(u))this.width=u[0],this.height=u[1];else{if(!((0,o.isDefined)(u)&&(0,o.isDefined)(u.width)&&(0,o.isDefined)(u.height))){var s=new Error("Unsupported input. Must be either\n DOMNode, Array or Object with field width and height,\n or a function that returns any of the above.");throw s.value=a,s}this.width=u.width,this.height=u.height}}else{var f=n[0],c=n[1];this.width=f,this.height=c}}return r(t,[{key:"isEqual",value:function(e){if(e instanceof t)return this.width===e.width&&this.height===e.height;var n=new t(e);return this.width===n.width&&this.height===n.height}},{key:"toArray",value:function(){return[this.width,this.height]}},{key:"toObject",value:function(){return{width:this.width,height:this.height}}}]),t}();e["default"]=a},function(t,e){"use strict";function n(t){throw new Error("Missing parameter "+t)}function i(t){return null!==t&&void 0!==t}function r(t){return null===t||void 0===t}function o(t){return!(!t||1!==t.nodeType)}function a(t){if(r(t))return function(t,e){return Math.min(t,e)};var e=(""+t).trim().toLowerCase();if(e.indexOf("%")>-1){var n=function(){var t=+e.replace("%","")/100;return{v:function(e,n){return n*t}}}();if("object"===("undefined"==typeof n?"undefined":u(n)))return n.v}return function(){return+e.replace("px","")}}Object.defineProperty(e,"__esModule",{value:!0});var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};e.isRequired=n,e.isDefined=i,e.isNotDefined=r,e.isElement=o,e.parseModifier=a;e.isFunction=function(){return"function"!=typeof/./&&"object"!==("undefined"==typeof Int8Array?"undefined":u(Int8Array))?function(t){return"function"==typeof t||!1}:function(t){var e={};return t&&"[object Function]"===e.toString.call(t)}}()},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=n(15),u=i(a),s=n(4),f=n(16),c=n(18),h=i(c),l=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e.type,i=void 0===n?t.TYPE_WINDOW:n,o=e.target,a=void 0===o?null:o,u=e.interval,c=void 0===u?500:u;r(this,t),i!==t.TYPE_POLLING||a||(0,f.isRequired)("options.target"),this.type=i,this.target=a,this.interval=c,this.dispatcher=(0,s.dispatch)("change"),this.check=this.check.bind(this),this.throttledCheck=(0,h["default"])(this.check,this.interval),this.isWatching=!1}return o(t,[{key:"hasTargetChanged",value:function(){if(!this.target)return!0;var t=new u["default"](this.target);return(!this.currentDim||!t.isEqual(this.currentDim))&&(this.currentDim=t,!0)}},{key:"check",value:function(){return this.hasTargetChanged()&&this.dispatcher.call("change",this,this.currentDim),this}},{key:"on",value:function(t,e){return this.dispatcher.on(t,e),this}},{key:"off",value:function(t){return this.dispatcher.on(t,null),this}},{key:"start",value:function(){return this.isWatching||(this.target&&(this.currentDim=new u["default"](this.target)),this.type===t.TYPE_WINDOW?window.addEventListener("resize",this.throttledCheck):this.type===t.TYPE_POLLING&&(this.intervalId=window.setInterval(this.check,this.interval)),this.isWatching=!0),this}},{key:"stop",value:function(){return this.isWatching&&(this.type===t.TYPE_WINDOW?window.removeEventListener("resize",this.throttledCheck):this.type===t.TYPE_POLLING&&this.intervalId&&(window.clearInterval(this.intervalId),this.intervalId=null),this.isWatching=!1),this}},{key:"destroy",value:function(){return this.stop(),this.off("change"),this}}]),t}();l.TYPE_WINDOW="window",l.TYPE_POLLING="polling",e["default"]=l},function(t,e,n){"use strict";function i(t,e,n){var i=!0,u=!0;if("function"!=typeof t)throw new TypeError(a);return o(n)&&(i="leading"in n?!!n.leading:i,u="trailing"in n?!!n.trailing:u),r(t,e,{leading:i,maxWait:e,trailing:u})}var r=n(5),o=n(6),a="Expected a function";t.exports=i},function(t,e){"use strict";function n(t){return!(!t||!p["undefined"==typeof t?"undefined":d(t)])}function i(t){var e={};return!!t&&"[object Function]"===e.toString.call(t)}function r(t){return null==t?"":String(t).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function o(t){return null==t?"\\s":t.source?t.source:"["+r(t)+"]"}function a(t,e){if(null==t)return"";if(!e&&y)return y.call(t);var n=o(e),i=new RegExp("^"+n+"+|"+n+"+$","g");return String(t).replace(i,"")}function u(t){return a(t).replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()}function s(t){t=t||{};for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];!n(a)||Array.isArray(a)||i(a)?t[o]=a:t[o]=s(t[o],a)}}return t}function f(t){t=t||{};for(var e=1;e<arguments.length;e++)if(arguments[e])for(var n in arguments[e])arguments[e].hasOwnProperty(n)&&(t[n]=arguments[e][n]);return t}function c(t,e,n){return function(){var i=n.apply(e,arguments);return i===e?t:i}}function h(t,e){for(var n=1,i=arguments.length,r=void 0;++n<i;)t[r=arguments[n]]=c(t,e,e[r]);return t}function l(t){return i(t)?t:function(){return t}}Object.defineProperty(e,"__esModule",{value:!0});var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};e.isObject=n,e.isFunction=i,e.kebabCase=u,e.deepExtend=s,e.extend=f,e.rebind=h,e.functor=l;var p={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},y=String.prototype.trim},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function p(t,e,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);if(void 0===i){var r=Object.getPrototypeOf(t);return null===r?void 0:p(r,e,n)}if("value"in i)return i.value;var o=i.get;if(void 0!==o)return o.call(n)},s=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),f=n(2),c=i(f),h=n(21),l=i(h),d=function(t){function e(t){var n;r(this,e);for(var i=arguments.length,a=Array(i>1?i-1:0),u=1;u<i;u++)a[u-1]=arguments[u];var s=o(this,(n=Object.getPrototypeOf(e)).call.apply(n,[this,t,e.DEFAULT_OPTIONS].concat(a)));return s.svg=s.container.append("svg"),s.rootG=s.svg.append("g"),s.layers=new l["default"](s.rootG),s.mainElement=s.svg.node(),s.updateDimensionNow(),s}return a(e,t),s(e,null,[{key:"getCustomEventNames",value:function(){return[]}}]),s(e,[{key:"updateDimension",value:function(){u(Object.getPrototypeOf(e.prototype),"updateDimension",this).call(this);var t=this.state,n=t.width,i=t.height,r=this.state.options,o=r.offset,a=r.margin,s=a.top,f=a.left;return this.svg.attr("width",n).attr("height",i),this.rootG.attr("transform","translate("+(f+o.x)+","+(s+o.y)+")"),this}}]),e}(c["default"]);d.DEFAULT_OPTIONS={},e["default"]=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(i=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(s){r=!0,o=s}finally{try{!i&&u["return"]&&u["return"]()}finally{if(r)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e["default"]=function(t){function e(t,e){var n=arguments.length<=2||void 0===arguments[2]?"":arguments[2],i=e.split("."),o=void 0,a=void 0;i.length>1?(a=i[0].length>0?i[0]:"g",o=i[1]):(a="g",o=i[0]);var u=""+n+o;if(f.hasOwnProperty(u))throw new Error("invalid or duplicate layer id: "+u);var s=(0,r.kebabCase)(o)+"-layer",c=t.append(a).classed(s,!0);return f[u]=c,c}function n(t,o){var a=arguments.length<=2||void 0===arguments[2]?"":arguments[2];if(Array.isArray(o))return o.map(function(e){return n(t,e,a)});if((0,r.isObject)(o)){var u=Object.keys(o),s=i(u,1),f=s[0],c=e(t,f,a);return n(c,o[f],""+a+f+"."),c}return e(t,o,a)}function o(e){return n(t,e)}function a(t){return Array.isArray(t)?t.map(o):o(t)}function u(t){return f[t]}function s(t){return!!f[t]}var f={};return{create:a,get:u,has:s}};var r=n(19)}])});
{
"name": "d3kit",
"version": "3.0.0-3",
"version": "3.0.0-4",
"description": "A kit of tools to speed D3 related project development.",

@@ -65,3 +65,3 @@ "repository": {

"run-sequence": "^1.1.5",
"slimfit": "^0.1.0",
"slimfit": "^0.1.1",
"webpack": "^1.12.9",

@@ -68,0 +68,0 @@ "webpack-stream": "^3.1.0"

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