diff --git a/dist/d3kit.js b/dist/d3kit.js index 8c0475d..29033df 100644 --- a/dist/d3kit.js +++ b/dist/d3kit.js @@ -640,7 +640,7 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /** * Example usage: diff --git a/dist/d3kit.min.js b/dist/d3kit.min.js index a0e4ec1..b8d88da 100644 --- a/dist/d3kit.min.js +++ b/dist/d3kit.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("d3-selection"),require("d3-dispatch")):"function"==typeof define&&define.amd?define(["d3-selection","d3-dispatch"],t):"object"==typeof exports?exports.d3Kit=t(require("d3-selection"),require("d3-dispatch")):e.d3Kit=t(e.d3,e.d3)}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.helper=t.LayerOrganizer=t.Chartlet=t.Skeleton=t.factory=void 0;var i=n(1);Object.defineProperty(t,"Skeleton",{enumerable:!0,get:function(){return r(i)["default"]}});var o=n(6);Object.defineProperty(t,"Chartlet",{enumerable:!0,get:function(){return r(o)["default"]}});var u=n(4);Object.defineProperty(t,"LayerOrganizer",{enumerable:!0,get:function(){return r(u)["default"]}});var a=n(5);Object.defineProperty(t,"helper",{enumerable:!0,get:function(){return r(a)["default"]}});var f=n(7);t.factory={createChart:f.createChart}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){function r(e,t){return 0===arguments.length?P:(P=e,t||G.call("data",this,e),C)}function i(e,t){return 0===arguments.length?L:(L=l["default"].deepExtend(L,e),e&&(e.margin?c(t):e.offset&&a()),t||G.call("options",this,e),C)}function a(){I.attr("transform","translate("+(L.margin.left+L.offset[0])+","+(L.margin.top+L.offset[1])+")")}function c(e){a(),T=S-L.margin.left-L.margin.right,k=D-L.margin.top-L.margin.bottom,e||G.call("resize",this,[S,D,T,k])}function p(e,t){return 0===arguments.length?L.margin:(L.margin=l["default"].extend(L.margin,e),c(t),C)}function h(e){return 0===arguments.length?L.offset:(L.offset=e,a(),C)}function m(t,n){if(0===arguments.length||null===t||void 0===t)return S;if(S=l["default"].isNumber(t)?+t:"auto"==t.trim().toLowerCase()?e.clientWidth:+(t+"").replace(/px/gi,"").trim(),l["default"].isNaN(S))throw Error("invalid width: "+S);return S=Math.floor(S),T=S-L.margin.left-L.margin.right,W.attr("width",S),n||G.call("resize",this,[S,D,T,k]),C}function g(t,n){if(0===arguments.length||null===t||void 0===t)return D;if(D=l["default"].isNumber(t)?+t:"auto"==t.trim().toLowerCase()?e.clientHeight:+(t+"").replace(/px/gi,"").trim(),l["default"].isNaN(D))throw Error("invalid height: "+D);return D=Math.floor(D),k=D-L.margin.top-L.margin.bottom,W.attr("height",D),n||G.call("resize",this,[S,D,T,k]),C}function v(e,t){return 0===arguments.length?[S,D]:(m(e[0],!0),g(e[1],t),C)}function y(e){return 0===arguments.length?F:F!=e?N(e,$):C}function b(e){return 0===arguments.length?$:$!=e?N(F,e):C}function w(e){return 0===arguments.length?R:(R=null!==e&&void 0!==e&&""!==e&&e!==!1&&"false"!==(e+"").toLowerCase()&&(!!l["default"].isNumber(e)&&(0!==+e&&+e)),C)}function x(){if(H)switch($){case"dom":l["default"].off(e,"resize",H);break;default:case"window":l["default"].off(window,"resize",H)}return H=null,C}function j(t){if(t)switch($){case"dom":l["default"].on(e,"resize",t);break;default:case"window":l["default"].on(window,"resize",t)}return H=t,C}function N(e,t){if(e=(!e||"false"!=(e+"").toLowerCase())&&e,t=t||$,e!=F)x(),F=e,$=t,e&&(H=l["default"].debounce(function(){R?(M(F,!0),_(R)):M(F)},100),j(H));else if(t!=$){var n=H;x(),$=t,j(n)}return H&&H(),C}function E(){return n||[]}function O(e){var t=C;return l["default"].isObject(e)&&Object.keys(e).forEach(function(n){t[n]=e[n]}),t}function M(e,t){switch(e){case"all":case"full":case"both":v(["auto","auto"],t);break;case"height":g("auto",t);break;default:case"width":m("auto",t)}return C}function _(e,t){var n=S,r=D;if(!l["default"].isNumber(e))throw"Invalid ratio: must be a Number";if(e=+e,(n/r).toFixed(4)==e.toFixed(4))return C;var i=Math.floor(n/e);return i>r?m(Math.floor(r*e),t):g(i,t),C}function z(){return null!==P&&void 0!==P}function A(){return T>0&&k>0}var C={};e=l["default"].$(e);var P=null,L=l["default"].deepExtend({},s,t),S=0,D=0,T=0,k=0,$="window",F=!1,H=null,R=!1,q=(0,o.select)(e).style("line-height",0),W=q.append("svg"),I=W.append("g");a();var K=new f["default"](I),Z=n?n.concat(d):d,G=u.dispatch.apply(this,Z);return v([L.initialWidth,L.initialHeight]),l["default"].extend(C,{getCustomEventNames:E,getDispatcher:function(){return G},getInnerWidth:function(){return T},getInnerHeight:function(){return k},getLayerOrganizer:function(){return K},getRootG:function(){return I},getSvg:function(){return W},data:r,options:i,margin:p,offset:h,width:m,height:g,dimension:v,autoResize:y,autoResizeDetection:b,autoResizeToAspectRatio:w,hasData:z,hasNonZeroArea:A,mixin:O,resizeToFitContainer:M,resizeToAspectRatio:_}),l["default"].rebind(C,G,"on"),C}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),u=n(3),a=n(4),f=r(a),c=n(5),l=r(c),s={margin:{top:30,right:30,bottom:30,left:30},offset:[.5,.5],initialWidth:720,initialHeight:500},d=["data","options","resize"];t["default"]=i},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e,t){function n(e,n,r){var i=r?r+"."+n:n;if(c.hasOwnProperty(i))throw"invalid or duplicate layer id: "+i;var u=e.append(t).classed(o["default"].dasherize(n)+"-layer",!0);return c[i]=u,u}function r(e,t,i){if(Array.isArray(t))return t.map(function(t){r(e,t,i)});if(o["default"].isObject(t)){var u=Object.keys(t)[0],a=n(e,u,i);return r(a,t[u],i?i+"."+u:u),a}return n(e,t,i)}function i(t){return r(e,t)}function u(e){return Array.isArray(e)?e.map(i):i(e)}function a(e){return c[e]}function f(e){return!!c[e]}var c={};return t=t||"g",{create:u,get:a,has:f}};var i=n(5),o=r(i)},function(e,t){"use strict";function n(e,t,n){return e.on("click",function(e,r){t.call(n+"Click",this,e,r)}).on("mouseover",function(e,r){t.call(n+"MouseOver",this,e,r)}).on("mousemove",function(e,r){t.call(n+"MouseMove",this,e,r)}).on("mouseout",function(e,r){t.call(n+"MouseOut",this,e,r)})}function r(e,t){return t?e.selectAll("*").remove():e.selectAll("*").transition().style("opacity",0).remove()}function i(e){return"object"===("undefined"==typeof HTMLElement?"undefined":x(HTMLElement))?e instanceof HTMLElement:e&&"object"===("undefined"==typeof e?"undefined":x(e))&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}function o(e){return i(e)?e:document.querySelector(e)}function u(e){return Array.isArray(e)?e:[].slice.call(document.querySelectorAll(e))}function a(e){e=e||{};for(var t=1;t1?(h[e]=f["default"].functor(t),this):f["default"].functor(h[e])}function a(e,t,n){return o(e)(t,n)}function c(e,t){return function(n){e(n,f["default"].debounce(function(e,r){m.call(t,this,n)}),5)}}function l(e,t,n){return h[n||t]=function(n,r){return e.property(t)(n,r)},this}function s(e,t,n){return t.forEach(function(t,r){l(e,t,n&&rr?m(Math.floor(r*e),t):g(o,t),C}function z(){return null!==P&&void 0!==P}function A(){return T>0&&k>0}var C={};e=l["default"].$(e);var P=null,S=l["default"].deepExtend({},s,t),L=0,D=0,T=0,k=0,$="window",F=!1,H=null,R=!1,q=(0,i.select)(e).style("line-height",0),W=q.append("svg"),I=W.append("g");a();var K=new f["default"](I),Z=n?n.concat(d):d,G=u.dispatch.apply(this,Z);return v([S.initialWidth,S.initialHeight]),l["default"].extend(C,{getCustomEventNames:E,getDispatcher:function(){return G},getInnerWidth:function(){return T},getInnerHeight:function(){return k},getLayerOrganizer:function(){return K},getRootG:function(){return I},getSvg:function(){return W},data:r,options:o,margin:p,offset:h,width:m,height:g,dimension:v,autoResize:y,autoResizeDetection:b,autoResizeToAspectRatio:w,hasData:z,hasNonZeroArea:A,mixin:O,resizeToFitContainer:M,resizeToAspectRatio:_}),l["default"].rebind(C,G,"on"),C}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),u=n(3),a=n(4),f=r(a),c=n(5),l=r(c),s={margin:{top:30,right:30,bottom:30,left:30},offset:[.5,.5],initialWidth:720,initialHeight:500},d=["data","options","resize"];t["default"]=o},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e,t){function n(e,n,r){var o=r?r+"."+n:n;if(c.hasOwnProperty(o))throw"invalid or duplicate layer id: "+o;var u=e.append(t).classed(i["default"].dasherize(n)+"-layer",!0);return c[o]=u,u}function r(e,t,o){if(Array.isArray(t))return t.map(function(t){r(e,t,o)});if(i["default"].isObject(t)){var u=Object.keys(t)[0],a=n(e,u,o);return r(a,t[u],o?o+"."+u:u),a}return n(e,t,o)}function o(t){return r(e,t)}function u(e){return Array.isArray(e)?e.map(o):o(e)}function a(e){return c[e]}function f(e){return!!c[e]}var c={};return t=t||"g",{create:u,get:a,has:f}};var o=n(5),i=r(o)},function(e,t){"use strict";function n(e,t,n){return e.on("click",function(e,r){t.call(n+"Click",this,e,r)}).on("mouseover",function(e,r){t.call(n+"MouseOver",this,e,r)}).on("mousemove",function(e,r){t.call(n+"MouseMove",this,e,r)}).on("mouseout",function(e,r){t.call(n+"MouseOut",this,e,r)})}function r(e,t){return t?e.selectAll("*").remove():e.selectAll("*").transition().style("opacity",0).remove()}function o(e){return"object"===("undefined"==typeof HTMLElement?"undefined":x(HTMLElement))?e instanceof HTMLElement:e&&"object"===("undefined"==typeof e?"undefined":x(e))&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}function i(e){return o(e)?e:document.querySelector(e)}function u(e){return Array.isArray(e)?e:[].slice.call(document.querySelectorAll(e))}function a(e){e=e||{};for(var t=1;t1?(h[e]=f["default"].functor(t),this):f["default"].functor(h[e])}function a(e,t,n){return i(e)(t,n)}function c(e,t){return function(n){e(n,f["default"].debounce(function(e,r){m.call(t,this,n)}),5)}}function l(e,t,n){return h[n||t]=function(n,r){return e.property(t)(n,r)},this}function s(e,t,n){return t.forEach(function(t,r){l(e,t,n&&r