mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-20 05:39:39 +02:00
3 lines
16 KiB
JavaScript
3 lines
16 KiB
JavaScript
|
var t="http://www.w3.org/1999/xhtml";var e={svg:"http://www.w3.org/2000/svg",xhtml:t,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function namespace(t){var n=t+="",r=n.indexOf(":");r>=0&&"xmlns"!==(n=t.slice(0,r))&&(t=t.slice(r+1));return e.hasOwnProperty(n)?{space:e[n],local:t}:t}function creatorInherit(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===t&&n.documentElement.namespaceURI===t?n.createElement(e):n.createElementNS(r,e)}}function creatorFixed(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function creator(t){var e=namespace(t);return(e.local?creatorFixed:creatorInherit)(e)}function none(){}function selector(t){return null==t?none:function(){return this.querySelector(t)}}function selection_select(t){"function"!==typeof t&&(t=selector(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,s,c=e[i],l=c.length,a=r[i]=new Array(l),u=0;u<l;++u)if((o=c[u])&&(s=t.call(o,o.__data__,u,c))){"__data__"in o&&(s.__data__=o.__data__);a[u]=s}return new Selection(r,this._parents)}function array(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function empty(){return[]}function selectorAll(t){return null==t?empty:function(){return this.querySelectorAll(t)}}function arrayAll(t){return function(){return array(t.apply(this,arguments))}}function selection_selectAll(t){t="function"===typeof t?arrayAll(t):selectorAll(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var s,c=e[o],l=c.length,a=0;a<l;++a)if(s=c[a]){r.push(t.call(s,s.__data__,a,c));i.push(s)}return new Selection(r,i)}function matcher(t){return function(){return this.matches(t)}}function childMatcher(t){return function(e){return e.matches(t)}}var n=Array.prototype.find;function childFind(t){return function(){return n.call(this.children,t)}}function childFirst(){return this.firstElementChild}function selection_selectChild(t){return this.select(null==t?childFirst:childFind("function"===typeof t?t:childMatcher(t)))}var r=Array.prototype.filter;function children(){return Array.from(this.children)}function childrenFilter(t){return function(){return r.call(this.children,t)}}function selection_selectChildren(t){return this.selectAll(null==t?children:childrenFilter("function"===typeof t?t:childMatcher(t)))}function selection_filter(t){"function"!==typeof t&&(t=matcher(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,s=e[i],c=s.length,l=r[i]=[],a=0;a<c;++a)(o=s[a])&&t.call(o,o.__data__,a,s)&&l.push(o);return new Selection(r,this._parents)}function sparse(t){return new Array(t.length)}function selection_enter(){return new Selection(this._enter||this._groups.map(sparse),this._parents)}function EnterNode(t,e){this.ownerDocument=t.ownerDocument;this.namespaceURI=t.namespaceURI;this._next=null;this._parent=t;this.__data__=e}EnterNode.prototype={constructor:EnterNode,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function constant(t){return function(){return t}}function bindIndex(t,e,n,r,i,o){var s,c=0,l=e.length,a=o.length;for(;c<a;++c)if(s=e[c]){s.__data__=o[c];r[c]=s}else n[c]=new EnterNode(t,o[c]);for(;c<l;++c)(s=e[c])&&(i[c]=s)}function bindKey(t,e,n,r,i,o,s){var c,l,a,u=new Map,h=e.length,f=o.length,p=new Array(h);for(c=0;c<h;++c)if(l=e[c]){p[c]=a=s.call(l,l.__data__,c,e)+"";u.has(a)?i[c]=l:u.set(a,l)}for(c=0;c<f;++c){a=s.call(t,o[c],c,o)+"";if(l=u.get(a)){r[c]=l;l.__data__=o[c];u.delete(a)}else n[c]=new EnterNode(t,o[c])}for(c=0;c<h;++c)(l=e[c])&&u.get(p[c])===l&&(i[c]=l)}function datum(t){return t.__data__}function selection_data(t,e){if(!arguments.length)return Array.from(this,datum);var n=e?bindKey:bindIndex,r=this._parents,i=this._groups;"function"!==typeof t&&(t=constant(t));for(var o=i.length,s=new Array(o),c=new Array(o),l=new Array(o),a=0;a<o;++a){var u
|
||
|
|