@equinor/videx-wellog
Version:
Visualisation components for wellbore log data
1 lines • 178 kB
JavaScript
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports):"function"==typeof define&&define.amd?define(["exports"],factory):factory((global="undefined"!=typeof globalThis?globalThis:global||self)["videx-wellog"]={})}(this,(function(exports){"use strict";var xhtml="http://www.w3.org/1999/xhtml",namespaces={svg:"http://www.w3.org/2000/svg",xhtml:xhtml,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function namespace(name){var prefix=name+="",i=prefix.indexOf(":");return i>=0&&"xmlns"!==(prefix=name.slice(0,i))&&(name=name.slice(i+1)),namespaces.hasOwnProperty(prefix)?{space:namespaces[prefix],local:name}:name}function creatorInherit(name){return function(){var document=this.ownerDocument,uri=this.namespaceURI;return uri===xhtml&&document.documentElement.namespaceURI===xhtml?document.createElement(name):document.createElementNS(uri,name)}}function creatorFixed(fullname){return function(){return this.ownerDocument.createElementNS(fullname.space,fullname.local)}}function creator(name){var fullname=namespace(name);return(fullname.local?creatorFixed:creatorInherit)(fullname)}function none(){}function selector(selector){return null==selector?none:function(){return this.querySelector(selector)}}function empty(){return[]}function selectorAll(selector){return null==selector?empty:function(){return this.querySelectorAll(selector)}}function arrayAll(select){return function(){return function(x){return null==x?[]:Array.isArray(x)?x:Array.from(x)}(select.apply(this,arguments))}}function matcher(selector){return function(){return this.matches(selector)}}function childMatcher(selector){return function(node){return node.matches(selector)}}var find=Array.prototype.find;function childFirst(){return this.firstElementChild}var filter=Array.prototype.filter;function children(){return Array.from(this.children)}function sparse(update){return new Array(update.length)}function EnterNode(parent,datum){this.ownerDocument=parent.ownerDocument,this.namespaceURI=parent.namespaceURI,this._next=null,this._parent=parent,this.__data__=datum}function bindIndex(parent,group,enter,update,exit,data){for(var node,i=0,groupLength=group.length,dataLength=data.length;i<dataLength;++i)(node=group[i])?(node.__data__=data[i],update[i]=node):enter[i]=new EnterNode(parent,data[i]);for(;i<groupLength;++i)(node=group[i])&&(exit[i]=node)}function bindKey(parent,group,enter,update,exit,data,key){var i,node,keyValue,nodeByKeyValue=new Map,groupLength=group.length,dataLength=data.length,keyValues=new Array(groupLength);for(i=0;i<groupLength;++i)(node=group[i])&&(keyValues[i]=keyValue=key.call(node,node.__data__,i,group)+"",nodeByKeyValue.has(keyValue)?exit[i]=node:nodeByKeyValue.set(keyValue,node));for(i=0;i<dataLength;++i)keyValue=key.call(parent,data[i],i,data)+"",(node=nodeByKeyValue.get(keyValue))?(update[i]=node,node.__data__=data[i],nodeByKeyValue.delete(keyValue)):enter[i]=new EnterNode(parent,data[i]);for(i=0;i<groupLength;++i)(node=group[i])&&nodeByKeyValue.get(keyValues[i])===node&&(exit[i]=node)}function datum(node){return node.__data__}function arraylike(data){return"object"==typeof data&&"length"in data?data:Array.from(data)}function ascending$1(a,b){return a<b?-1:a>b?1:a>=b?0:NaN}function attrRemove$1(name){return function(){this.removeAttribute(name)}}function attrRemoveNS$1(fullname){return function(){this.removeAttributeNS(fullname.space,fullname.local)}}function attrConstant$1(name,value){return function(){this.setAttribute(name,value)}}function attrConstantNS$1(fullname,value){return function(){this.setAttributeNS(fullname.space,fullname.local,value)}}function attrFunction$1(name,value){return function(){var v=value.apply(this,arguments);null==v?this.removeAttribute(name):this.setAttribute(name,v)}}function attrFunctionNS$1(fullname,value){return function(){var v=value.apply(this,arguments);null==v?this.removeAttributeNS(fullname.space,fullname.local):this.setAttributeNS(fullname.space,fullname.local,v)}}function defaultView(node){return node.ownerDocument&&node.ownerDocument.defaultView||node.document&&node||node.defaultView}function styleRemove$1(name){return function(){this.style.removeProperty(name)}}function styleConstant$1(name,value,priority){return function(){this.style.setProperty(name,value,priority)}}function styleFunction$1(name,value,priority){return function(){var v=value.apply(this,arguments);null==v?this.style.removeProperty(name):this.style.setProperty(name,v,priority)}}function styleValue(node,name){return node.style.getPropertyValue(name)||defaultView(node).getComputedStyle(node,null).getPropertyValue(name)}function propertyRemove(name){return function(){delete this[name]}}function propertyConstant(name,value){return function(){this[name]=value}}function propertyFunction(name,value){return function(){var v=value.apply(this,arguments);null==v?delete this[name]:this[name]=v}}function classArray(string){return string.trim().split(/^|\s+/)}function classList(node){return node.classList||new ClassList(node)}function ClassList(node){this._node=node,this._names=classArray(node.getAttribute("class")||"")}function classedAdd(node,names){for(var list=classList(node),i=-1,n=names.length;++i<n;)list.add(names[i])}function classedRemove(node,names){for(var list=classList(node),i=-1,n=names.length;++i<n;)list.remove(names[i])}function classedTrue(names){return function(){classedAdd(this,names)}}function classedFalse(names){return function(){classedRemove(this,names)}}function classedFunction(names,value){return function(){(value.apply(this,arguments)?classedAdd:classedRemove)(this,names)}}function textRemove(){this.textContent=""}function textConstant$1(value){return function(){this.textContent=value}}function textFunction$1(value){return function(){var v=value.apply(this,arguments);this.textContent=null==v?"":v}}function htmlRemove(){this.innerHTML=""}function htmlConstant(value){return function(){this.innerHTML=value}}function htmlFunction(value){return function(){var v=value.apply(this,arguments);this.innerHTML=null==v?"":v}}function raise(){this.nextSibling&&this.parentNode.appendChild(this)}function lower(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function constantNull(){return null}function remove(){var parent=this.parentNode;parent&&parent.removeChild(this)}function selection_cloneShallow(){var clone=this.cloneNode(!1),parent=this.parentNode;return parent?parent.insertBefore(clone,this.nextSibling):clone}function selection_cloneDeep(){var clone=this.cloneNode(!0),parent=this.parentNode;return parent?parent.insertBefore(clone,this.nextSibling):clone}function onRemove(typename){return function(){var on=this.__on;if(on){for(var o,j=0,i=-1,m=on.length;j<m;++j)o=on[j],typename.type&&o.type!==typename.type||o.name!==typename.name?on[++i]=o:this.removeEventListener(o.type,o.listener,o.options);++i?on.length=i:delete this.__on}}}function onAdd(typename,value,options){return function(){var o,on=this.__on,listener=function(listener){return function(event){listener.call(this,event,this.__data__)}}(value);if(on)for(var j=0,m=on.length;j<m;++j)if((o=on[j]).type===typename.type&&o.name===typename.name)return this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=listener,o.options=options),void(o.value=value);this.addEventListener(typename.type,listener,options),o={type:typename.type,name:typename.name,value:value,listener:listener,options:options},on?on.push(o):this.__on=[o]}}function dispatchEvent(node,type,params){var window=defaultView(node),event=window.CustomEvent;"function"==typeof event?event=new event(type,params):(event=window.document.createEvent("Event"),params?(event.initEvent(type,params.bubbles,params.cancelable),event.detail=params.detail):event.initEvent(type,!1,!1)),node.dispatchEvent(event)}function dispatchConstant(type,params){return function(){return dispatchEvent(this,type,params)}}function dispatchFunction(type,params){return function(){return dispatchEvent(this,type,params.apply(this,arguments))}}EnterNode.prototype={constructor:EnterNode,appendChild:function(child){return this._parent.insertBefore(child,this._next)},insertBefore:function(child,next){return this._parent.insertBefore(child,next)},querySelector:function(selector){return this._parent.querySelector(selector)},querySelectorAll:function(selector){return this._parent.querySelectorAll(selector)}},ClassList.prototype={add:function(name){this._names.indexOf(name)<0&&(this._names.push(name),this._node.setAttribute("class",this._names.join(" ")))},remove:function(name){var i=this._names.indexOf(name);i>=0&&(this._names.splice(i,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(name){return this._names.indexOf(name)>=0}};var root=[null];function Selection$1(groups,parents){this._groups=groups,this._parents=parents}function selection(){return new Selection$1([[document.documentElement]],root)}function select(selector){return"string"==typeof selector?new Selection$1([[document.querySelector(selector)]],[document.documentElement]):new Selection$1([[selector]],root)}function pointer(event,node){if(event=function(event){let sourceEvent;for(;sourceEvent=event.sourceEvent;)event=sourceEvent;return event}(event),void 0===node&&(node=event.currentTarget),node){var svg=node.ownerSVGElement||node;if(svg.createSVGPoint){var point=svg.createSVGPoint();return point.x=event.clientX,point.y=event.clientY,[(point=point.matrixTransform(node.getScreenCTM().inverse())).x,point.y]}if(node.getBoundingClientRect){var rect=node.getBoundingClientRect();return[event.clientX-rect.left-node.clientLeft,event.clientY-rect.top-node.clientTop]}}return[event.pageX,event.pageY]}Selection$1.prototype=selection.prototype={constructor:Selection$1,select:function(select){"function"!=typeof select&&(select=selector(select));for(var groups=this._groups,m=groups.length,subgroups=new Array(m),j=0;j<m;++j)for(var node,subnode,group=groups[j],n=group.length,subgroup=subgroups[j]=new Array(n),i=0;i<n;++i)(node=group[i])&&(subnode=select.call(node,node.__data__,i,group))&&("__data__"in node&&(subnode.__data__=node.__data__),subgroup[i]=subnode);return new Selection$1(subgroups,this._parents)},selectAll:function(select){select="function"==typeof select?arrayAll(select):selectorAll(select);for(var groups=this._groups,m=groups.length,subgroups=[],parents=[],j=0;j<m;++j)for(var node,group=groups[j],n=group.length,i=0;i<n;++i)(node=group[i])&&(subgroups.push(select.call(node,node.__data__,i,group)),parents.push(node));return new Selection$1(subgroups,parents)},selectChild:function(match){return this.select(null==match?childFirst:function(match){return function(){return find.call(this.children,match)}}("function"==typeof match?match:childMatcher(match)))},selectChildren:function(match){return this.selectAll(null==match?children:function(match){return function(){return filter.call(this.children,match)}}("function"==typeof match?match:childMatcher(match)))},filter:function(match){"function"!=typeof match&&(match=matcher(match));for(var groups=this._groups,m=groups.length,subgroups=new Array(m),j=0;j<m;++j)for(var node,group=groups[j],n=group.length,subgroup=subgroups[j]=[],i=0;i<n;++i)(node=group[i])&&match.call(node,node.__data__,i,group)&&subgroup.push(node);return new Selection$1(subgroups,this._parents)},data:function(value,key){if(!arguments.length)return Array.from(this,datum);var bind=key?bindKey:bindIndex,parents=this._parents,groups=this._groups;"function"!=typeof value&&(value=function(x){return function(){return x}}(value));for(var m=groups.length,update=new Array(m),enter=new Array(m),exit=new Array(m),j=0;j<m;++j){var parent=parents[j],group=groups[j],groupLength=group.length,data=arraylike(value.call(parent,parent&&parent.__data__,j,parents)),dataLength=data.length,enterGroup=enter[j]=new Array(dataLength),updateGroup=update[j]=new Array(dataLength);bind(parent,group,enterGroup,updateGroup,exit[j]=new Array(groupLength),data,key);for(var previous,next,i0=0,i1=0;i0<dataLength;++i0)if(previous=enterGroup[i0]){for(i0>=i1&&(i1=i0+1);!(next=updateGroup[i1])&&++i1<dataLength;);previous._next=next||null}}return(update=new Selection$1(update,parents))._enter=enter,update._exit=exit,update},enter:function(){return new Selection$1(this._enter||this._groups.map(sparse),this._parents)},exit:function(){return new Selection$1(this._exit||this._groups.map(sparse),this._parents)},join:function(onenter,onupdate,onexit){var enter=this.enter(),update=this,exit=this.exit();return"function"==typeof onenter?(enter=onenter(enter))&&(enter=enter.selection()):enter=enter.append(onenter+""),null!=onupdate&&(update=onupdate(update))&&(update=update.selection()),null==onexit?exit.remove():onexit(exit),enter&&update?enter.merge(update).order():update},merge:function(context){for(var selection=context.selection?context.selection():context,groups0=this._groups,groups1=selection._groups,m0=groups0.length,m1=groups1.length,m=Math.min(m0,m1),merges=new Array(m0),j=0;j<m;++j)for(var node,group0=groups0[j],group1=groups1[j],n=group0.length,merge=merges[j]=new Array(n),i=0;i<n;++i)(node=group0[i]||group1[i])&&(merge[i]=node);for(;j<m0;++j)merges[j]=groups0[j];return new Selection$1(merges,this._parents)},selection:function(){return this},order:function(){for(var groups=this._groups,j=-1,m=groups.length;++j<m;)for(var node,group=groups[j],i=group.length-1,next=group[i];--i>=0;)(node=group[i])&&(next&&4^node.compareDocumentPosition(next)&&next.parentNode.insertBefore(node,next),next=node);return this},sort:function(compare){function compareNode(a,b){return a&&b?compare(a.__data__,b.__data__):!a-!b}compare||(compare=ascending$1);for(var groups=this._groups,m=groups.length,sortgroups=new Array(m),j=0;j<m;++j){for(var node,group=groups[j],n=group.length,sortgroup=sortgroups[j]=new Array(n),i=0;i<n;++i)(node=group[i])&&(sortgroup[i]=node);sortgroup.sort(compareNode)}return new Selection$1(sortgroups,this._parents).order()},call:function(){var callback=arguments[0];return arguments[0]=this,callback.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var groups=this._groups,j=0,m=groups.length;j<m;++j)for(var group=groups[j],i=0,n=group.length;i<n;++i){var node=group[i];if(node)return node}return null},size:function(){let size=0;for(const node of this)++size;return size},empty:function(){return!this.node()},each:function(callback){for(var groups=this._groups,j=0,m=groups.length;j<m;++j)for(var node,group=groups[j],i=0,n=group.length;i<n;++i)(node=group[i])&&callback.call(node,node.__data__,i,group);return this},attr:function(name,value){var fullname=namespace(name);if(arguments.length<2){var node=this.node();return fullname.local?node.getAttributeNS(fullname.space,fullname.local):node.getAttribute(fullname)}return this.each((null==value?fullname.local?attrRemoveNS$1:attrRemove$1:"function"==typeof value?fullname.local?attrFunctionNS$1:attrFunction$1:fullname.local?attrConstantNS$1:attrConstant$1)(fullname,value))},style:function(name,value,priority){return arguments.length>1?this.each((null==value?styleRemove$1:"function"==typeof value?styleFunction$1:styleConstant$1)(name,value,null==priority?"":priority)):styleValue(this.node(),name)},property:function(name,value){return arguments.length>1?this.each((null==value?propertyRemove:"function"==typeof value?propertyFunction:propertyConstant)(name,value)):this.node()[name]},classed:function(name,value){var names=classArray(name+"");if(arguments.length<2){for(var list=classList(this.node()),i=-1,n=names.length;++i<n;)if(!list.contains(names[i]))return!1;return!0}return this.each(("function"==typeof value?classedFunction:value?classedTrue:classedFalse)(names,value))},text:function(value){return arguments.length?this.each(null==value?textRemove:("function"==typeof value?textFunction$1:textConstant$1)(value)):this.node().textContent},html:function(value){return arguments.length?this.each(null==value?htmlRemove:("function"==typeof value?htmlFunction:htmlConstant)(value)):this.node().innerHTML},raise:function(){return this.each(raise)},lower:function(){return this.each(lower)},append:function(name){var create="function"==typeof name?name:creator(name);return this.select((function(){return this.appendChild(create.apply(this,arguments))}))},insert:function(name,before){var create="function"==typeof name?name:creator(name),select=null==before?constantNull:"function"==typeof before?before:selector(before);return this.select((function(){return this.insertBefore(create.apply(this,arguments),select.apply(this,arguments)||null)}))},remove:function(){return this.each(remove)},clone:function(deep){return this.select(deep?selection_cloneDeep:selection_cloneShallow)},datum:function(value){return arguments.length?this.property("__data__",value):this.node().__data__},on:function(typename,value,options){var i,t,typenames=function(typenames){return typenames.trim().split(/^|\s+/).map((function(t){var name="",i=t.indexOf(".");return i>=0&&(name=t.slice(i+1),t=t.slice(0,i)),{type:t,name:name}}))}(typename+""),n=typenames.length;if(!(arguments.length<2)){for(on=value?onAdd:onRemove,i=0;i<n;++i)this.each(on(typenames[i],value,options));return this}var on=this.node().__on;if(on)for(var o,j=0,m=on.length;j<m;++j)for(i=0,o=on[j];i<n;++i)if((t=typenames[i]).type===o.type&&t.name===o.name)return o.value},dispatch:function(type,params){return this.each(("function"==typeof params?dispatchFunction:dispatchConstant)(type,params))},[Symbol.iterator]:function*(){for(var groups=this._groups,j=0,m=groups.length;j<m;++j)for(var node,group=groups[j],i=0,n=group.length;i<n;++i)(node=group[i])&&(yield node)}};var noop={value:function(){}};function dispatch(){for(var t,i=0,n=arguments.length,_={};i<n;++i){if(!(t=arguments[i]+"")||t in _||/[\s.]/.test(t))throw new Error("illegal type: "+t);_[t]=[]}return new Dispatch(_)}function Dispatch(_){this._=_}function get$1(type,name){for(var c,i=0,n=type.length;i<n;++i)if((c=type[i]).name===name)return c.value}function set$1(type,name,callback){for(var i=0,n=type.length;i<n;++i)if(type[i].name===name){type[i]=noop,type=type.slice(0,i).concat(type.slice(i+1));break}return null!=callback&&type.push({name:name,value:callback}),type}Dispatch.prototype=dispatch.prototype={constructor:Dispatch,on:function(typename,callback){var t,types,_=this._,T=(types=_,(typename+"").trim().split(/^|\s+/).map((function(t){var name="",i=t.indexOf(".");if(i>=0&&(name=t.slice(i+1),t=t.slice(0,i)),t&&!types.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:name}}))),i=-1,n=T.length;if(!(arguments.length<2)){if(null!=callback&&"function"!=typeof callback)throw new Error("invalid callback: "+callback);for(;++i<n;)if(t=(typename=T[i]).type)_[t]=set$1(_[t],typename.name,callback);else if(null==callback)for(t in _)_[t]=set$1(_[t],typename.name,null);return this}for(;++i<n;)if((t=(typename=T[i]).type)&&(t=get$1(_[t],typename.name)))return t},copy:function(){var copy={},_=this._;for(var t in _)copy[t]=_[t].slice();return new Dispatch(copy)},call:function(type,that){if((n=arguments.length-2)>0)for(var n,t,args=new Array(n),i=0;i<n;++i)args[i]=arguments[i+2];if(!this._.hasOwnProperty(type))throw new Error("unknown type: "+type);for(i=0,n=(t=this._[type]).length;i<n;++i)t[i].value.apply(that,args)},apply:function(type,that,args){if(!this._.hasOwnProperty(type))throw new Error("unknown type: "+type);for(var t=this._[type],i=0,n=t.length;i<n;++i)t[i].value.apply(that,args)}};const nonpassivecapture={capture:!0,passive:!1};function noevent$1(event){event.preventDefault(),event.stopImmediatePropagation()}function define(constructor,factory,prototype){constructor.prototype=factory.prototype=prototype,prototype.constructor=constructor}function extend(parent,definition){var prototype=Object.create(parent.prototype);for(var key in definition)prototype[key]=definition[key];return prototype}function Color(){}var brighter=1/.7,reI="\\s*([+-]?\\d+)\\s*",reN="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",reP="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",reHex=/^#([0-9a-f]{3,8})$/,reRgbInteger=new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`),reRgbPercent=new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`),reRgbaInteger=new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`),reRgbaPercent=new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`),reHslPercent=new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`),reHslaPercent=new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`),named={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function color_formatHex(){return this.rgb().formatHex()}function color_formatRgb(){return this.rgb().formatRgb()}function color(format){var m,l;return format=(format+"").trim().toLowerCase(),(m=reHex.exec(format))?(l=m[1].length,m=parseInt(m[1],16),6===l?rgbn(m):3===l?new Rgb(m>>8&15|m>>4&240,m>>4&15|240&m,(15&m)<<4|15&m,1):8===l?rgba(m>>24&255,m>>16&255,m>>8&255,(255&m)/255):4===l?rgba(m>>12&15|m>>8&240,m>>8&15|m>>4&240,m>>4&15|240&m,((15&m)<<4|15&m)/255):null):(m=reRgbInteger.exec(format))?new Rgb(m[1],m[2],m[3],1):(m=reRgbPercent.exec(format))?new Rgb(255*m[1]/100,255*m[2]/100,255*m[3]/100,1):(m=reRgbaInteger.exec(format))?rgba(m[1],m[2],m[3],m[4]):(m=reRgbaPercent.exec(format))?rgba(255*m[1]/100,255*m[2]/100,255*m[3]/100,m[4]):(m=reHslPercent.exec(format))?hsla(m[1],m[2]/100,m[3]/100,1):(m=reHslaPercent.exec(format))?hsla(m[1],m[2]/100,m[3]/100,m[4]):named.hasOwnProperty(format)?rgbn(named[format]):"transparent"===format?new Rgb(NaN,NaN,NaN,0):null}function rgbn(n){return new Rgb(n>>16&255,n>>8&255,255&n,1)}function rgba(r,g,b,a){return a<=0&&(r=g=b=NaN),new Rgb(r,g,b,a)}function rgb(r,g,b,opacity){return 1===arguments.length?((o=r)instanceof Color||(o=color(o)),o?new Rgb((o=o.rgb()).r,o.g,o.b,o.opacity):new Rgb):new Rgb(r,g,b,null==opacity?1:opacity);var o}function Rgb(r,g,b,opacity){this.r=+r,this.g=+g,this.b=+b,this.opacity=+opacity}function rgb_formatHex(){return`#${hex(this.r)}${hex(this.g)}${hex(this.b)}`}function rgb_formatRgb(){const a=clampa(this.opacity);return`${1===a?"rgb(":"rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${1===a?")":`, ${a})`}`}function clampa(opacity){return isNaN(opacity)?1:Math.max(0,Math.min(1,opacity))}function clampi(value){return Math.max(0,Math.min(255,Math.round(value)||0))}function hex(value){return((value=clampi(value))<16?"0":"")+value.toString(16)}function hsla(h,s,l,a){return a<=0?h=s=l=NaN:l<=0||l>=1?h=s=NaN:s<=0&&(h=NaN),new Hsl(h,s,l,a)}function hslConvert(o){if(o instanceof Hsl)return new Hsl(o.h,o.s,o.l,o.opacity);if(o instanceof Color||(o=color(o)),!o)return new Hsl;if(o instanceof Hsl)return o;var r=(o=o.rgb()).r/255,g=o.g/255,b=o.b/255,min=Math.min(r,g,b),max=Math.max(r,g,b),h=NaN,s=max-min,l=(max+min)/2;return s?(h=r===max?(g-b)/s+6*(g<b):g===max?(b-r)/s+2:(r-g)/s+4,s/=l<.5?max+min:2-max-min,h*=60):s=l>0&&l<1?0:h,new Hsl(h,s,l,o.opacity)}function Hsl(h,s,l,opacity){this.h=+h,this.s=+s,this.l=+l,this.opacity=+opacity}function clamph(value){return(value=(value||0)%360)<0?value+360:value}function clampt(value){return Math.max(0,Math.min(1,value||0))}function hsl2rgb(h,m1,m2){return 255*(h<60?m1+(m2-m1)*h/60:h<180?m2:h<240?m1+(m2-m1)*(240-h)/60:m1)}define(Color,color,{copy(channels){return Object.assign(new this.constructor,this,channels)},displayable(){return this.rgb().displayable()},hex:color_formatHex,formatHex:color_formatHex,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return hslConvert(this).formatHsl()},formatRgb:color_formatRgb,toString:color_formatRgb}),define(Rgb,rgb,extend(Color,{brighter(k){return k=null==k?brighter:Math.pow(brighter,k),new Rgb(this.r*k,this.g*k,this.b*k,this.opacity)},darker(k){return k=null==k?.7:Math.pow(.7,k),new Rgb(this.r*k,this.g*k,this.b*k,this.opacity)},rgb(){return this},clamp(){return new Rgb(clampi(this.r),clampi(this.g),clampi(this.b),clampa(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rgb_formatHex,formatHex:rgb_formatHex,formatHex8:function(){return`#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:rgb_formatRgb,toString:rgb_formatRgb})),define(Hsl,(function(h,s,l,opacity){return 1===arguments.length?hslConvert(h):new Hsl(h,s,l,null==opacity?1:opacity)}),extend(Color,{brighter(k){return k=null==k?brighter:Math.pow(brighter,k),new Hsl(this.h,this.s,this.l*k,this.opacity)},darker(k){return k=null==k?.7:Math.pow(.7,k),new Hsl(this.h,this.s,this.l*k,this.opacity)},rgb(){var h=this.h%360+360*(this.h<0),s=isNaN(h)||isNaN(this.s)?0:this.s,l=this.l,m2=l+(l<.5?l:1-l)*s,m1=2*l-m2;return new Rgb(hsl2rgb(h>=240?h-240:h+120,m1,m2),hsl2rgb(h,m1,m2),hsl2rgb(h<120?h+240:h-120,m1,m2),this.opacity)},clamp(){return new Hsl(clamph(this.h),clampt(this.s),clampt(this.l),clampa(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const a=clampa(this.opacity);return`${1===a?"hsl(":"hsla("}${clamph(this.h)}, ${100*clampt(this.s)}%, ${100*clampt(this.l)}%${1===a?")":`, ${a})`}`}}));var constant$2=x=>()=>x;function gamma(y){return 1==(y=+y)?nogamma:function(a,b){return b-a?function(a,b,y){return a=Math.pow(a,y),b=Math.pow(b,y)-a,y=1/y,function(t){return Math.pow(a+t*b,y)}}(a,b,y):constant$2(isNaN(a)?b:a)}}function nogamma(a,b){var d=b-a;return d?function(a,d){return function(t){return a+t*d}}(a,d):constant$2(isNaN(a)?b:a)}var interpolateRgb=function rgbGamma(y){var color=gamma(y);function rgb$1(start,end){var r=color((start=rgb(start)).r,(end=rgb(end)).r),g=color(start.g,end.g),b=color(start.b,end.b),opacity=nogamma(start.opacity,end.opacity);return function(t){return start.r=r(t),start.g=g(t),start.b=b(t),start.opacity=opacity(t),start+""}}return rgb$1.gamma=rgbGamma,rgb$1}(1);function numberArray(a,b){b||(b=[]);var i,n=a?Math.min(b.length,a.length):0,c=b.slice();return function(t){for(i=0;i<n;++i)c[i]=a[i]*(1-t)+b[i]*t;return c}}function genericArray(a,b){var i,nb=b?b.length:0,na=a?Math.min(nb,a.length):0,x=new Array(na),c=new Array(nb);for(i=0;i<na;++i)x[i]=interpolate$1(a[i],b[i]);for(;i<nb;++i)c[i]=b[i];return function(t){for(i=0;i<na;++i)c[i]=x[i](t);return c}}function date(a,b){var d=new Date;return a=+a,b=+b,function(t){return d.setTime(a*(1-t)+b*t),d}}function interpolateNumber(a,b){return a=+a,b=+b,function(t){return a*(1-t)+b*t}}function object(a,b){var k,i={},c={};for(k in null!==a&&"object"==typeof a||(a={}),null!==b&&"object"==typeof b||(b={}),b)k in a?i[k]=interpolate$1(a[k],b[k]):c[k]=b[k];return function(t){for(k in i)c[k]=i[k](t);return c}}var reA=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,reB=new RegExp(reA.source,"g");function interpolateString(a,b){var am,bm,bs,bi=reA.lastIndex=reB.lastIndex=0,i=-1,s=[],q=[];for(a+="",b+="";(am=reA.exec(a))&&(bm=reB.exec(b));)(bs=bm.index)>bi&&(bs=b.slice(bi,bs),s[i]?s[i]+=bs:s[++i]=bs),(am=am[0])===(bm=bm[0])?s[i]?s[i]+=bm:s[++i]=bm:(s[++i]=null,q.push({i:i,x:interpolateNumber(am,bm)})),bi=reB.lastIndex;return bi<b.length&&(bs=b.slice(bi),s[i]?s[i]+=bs:s[++i]=bs),s.length<2?q[0]?function(b){return function(t){return b(t)+""}}(q[0].x):function(b){return function(){return b}}(b):(b=q.length,function(t){for(var o,i=0;i<b;++i)s[(o=q[i]).i]=o.x(t);return s.join("")})}function interpolate$1(a,b){var c,t=typeof b;return null==b||"boolean"===t?constant$2(b):("number"===t?interpolateNumber:"string"===t?(c=color(b))?(b=c,interpolateRgb):interpolateString:b instanceof color?interpolateRgb:b instanceof Date?date:function(x){return ArrayBuffer.isView(x)&&!(x instanceof DataView)}(b)?numberArray:Array.isArray(b)?genericArray:"function"!=typeof b.valueOf&&"function"!=typeof b.toString||isNaN(b)?object:interpolateNumber)(a,b)}function interpolateRound(a,b){return a=+a,b=+b,function(t){return Math.round(a*(1-t)+b*t)}}var svgNode,degrees=180/Math.PI,identity$3={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function decompose(a,b,c,d,e,f){var scaleX,scaleY,skewX;return(scaleX=Math.sqrt(a*a+b*b))&&(a/=scaleX,b/=scaleX),(skewX=a*c+b*d)&&(c-=a*skewX,d-=b*skewX),(scaleY=Math.sqrt(c*c+d*d))&&(c/=scaleY,d/=scaleY,skewX/=scaleY),a*d<b*c&&(a=-a,b=-b,skewX=-skewX,scaleX=-scaleX),{translateX:e,translateY:f,rotate:Math.atan2(b,a)*degrees,skewX:Math.atan(skewX)*degrees,scaleX:scaleX,scaleY:scaleY}}function interpolateTransform(parse,pxComma,pxParen,degParen){function pop(s){return s.length?s.pop()+" ":""}return function(a,b){var s=[],q=[];return a=parse(a),b=parse(b),function(xa,ya,xb,yb,s,q){if(xa!==xb||ya!==yb){var i=s.push("translate(",null,pxComma,null,pxParen);q.push({i:i-4,x:interpolateNumber(xa,xb)},{i:i-2,x:interpolateNumber(ya,yb)})}else(xb||yb)&&s.push("translate("+xb+pxComma+yb+pxParen)}(a.translateX,a.translateY,b.translateX,b.translateY,s,q),function(a,b,s,q){a!==b?(a-b>180?b+=360:b-a>180&&(a+=360),q.push({i:s.push(pop(s)+"rotate(",null,degParen)-2,x:interpolateNumber(a,b)})):b&&s.push(pop(s)+"rotate("+b+degParen)}(a.rotate,b.rotate,s,q),function(a,b,s,q){a!==b?q.push({i:s.push(pop(s)+"skewX(",null,degParen)-2,x:interpolateNumber(a,b)}):b&&s.push(pop(s)+"skewX("+b+degParen)}(a.skewX,b.skewX,s,q),function(xa,ya,xb,yb,s,q){if(xa!==xb||ya!==yb){var i=s.push(pop(s)+"scale(",null,",",null,")");q.push({i:i-4,x:interpolateNumber(xa,xb)},{i:i-2,x:interpolateNumber(ya,yb)})}else 1===xb&&1===yb||s.push(pop(s)+"scale("+xb+","+yb+")")}(a.scaleX,a.scaleY,b.scaleX,b.scaleY,s,q),a=b=null,function(t){for(var o,i=-1,n=q.length;++i<n;)s[(o=q[i]).i]=o.x(t);return s.join("")}}}var interpolateTransformCss=interpolateTransform((function(value){const m=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(value+"");return m.isIdentity?identity$3:decompose(m.a,m.b,m.c,m.d,m.e,m.f)}),"px, ","px)","deg)"),interpolateTransformSvg=interpolateTransform((function(value){return null==value?identity$3:(svgNode||(svgNode=document.createElementNS("http://www.w3.org/2000/svg","g")),svgNode.setAttribute("transform",value),(value=svgNode.transform.baseVal.consolidate())?decompose((value=value.matrix).a,value.b,value.c,value.d,value.e,value.f):identity$3)}),", ",")",")");function cosh(x){return((x=Math.exp(x))+1/x)/2}var taskHead,taskTail,interpolateZoom=function zoomRho(rho,rho2,rho4){function zoom(p0,p1){var i,S,ux0=p0[0],uy0=p0[1],w0=p0[2],ux1=p1[0],uy1=p1[1],w1=p1[2],dx=ux1-ux0,dy=uy1-uy0,d2=dx*dx+dy*dy;if(d2<1e-12)S=Math.log(w1/w0)/rho,i=function(t){return[ux0+t*dx,uy0+t*dy,w0*Math.exp(rho*t*S)]};else{var d1=Math.sqrt(d2),b0=(w1*w1-w0*w0+rho4*d2)/(2*w0*rho2*d1),b1=(w1*w1-w0*w0-rho4*d2)/(2*w1*rho2*d1),r0=Math.log(Math.sqrt(b0*b0+1)-b0),r1=Math.log(Math.sqrt(b1*b1+1)-b1);S=(r1-r0)/rho,i=function(t){var s=t*S,coshr0=cosh(r0),u=w0/(rho2*d1)*(coshr0*function(x){return((x=Math.exp(2*x))-1)/(x+1)}(rho*s+r0)-function(x){return((x=Math.exp(x))-1/x)/2}(r0));return[ux0+u*dx,uy0+u*dy,w0*coshr0/cosh(rho*s+r0)]}}return i.duration=1e3*S*rho/Math.SQRT2,i}return zoom.rho=function(_){var _1=Math.max(.001,+_),_2=_1*_1;return zoomRho(_1,_2,_2*_2)},zoom}(Math.SQRT2,2,4),frame=0,timeout$1=0,interval=0,pokeDelay=1e3,clockLast=0,clockNow=0,clockSkew=0,clock="object"==typeof performance&&performance.now?performance:Date,setFrame="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(f){setTimeout(f,17)};function now(){return clockNow||(setFrame(clearNow),clockNow=clock.now()+clockSkew)}function clearNow(){clockNow=0}function Timer(){this._call=this._time=this._next=null}function timer(callback,delay,time){var t=new Timer;return t.restart(callback,delay,time),t}function wake(){clockNow=(clockLast=clock.now())+clockSkew,frame=timeout$1=0;try{!function(){now(),++frame;for(var e,t=taskHead;t;)(e=clockNow-t._time)>=0&&t._call.call(null,e),t=t._next;--frame}()}finally{frame=0,function(){var t0,t2,t1=taskHead,time=1/0;for(;t1;)t1._call?(time>t1._time&&(time=t1._time),t0=t1,t1=t1._next):(t2=t1._next,t1._next=null,t1=t0?t0._next=t2:taskHead=t2);taskTail=t0,sleep(time)}(),clockNow=0}}function poke(){var now=clock.now(),delay=now-clockLast;delay>pokeDelay&&(clockSkew-=delay,clockLast=now)}function sleep(time){frame||(timeout$1&&(timeout$1=clearTimeout(timeout$1)),time-clockNow>24?(time<1/0&&(timeout$1=setTimeout(wake,time-clock.now()-clockSkew)),interval&&(interval=clearInterval(interval))):(interval||(clockLast=clock.now(),interval=setInterval(poke,pokeDelay)),frame=1,setFrame(wake)))}function timeout(callback,delay,time){var t=new Timer;return delay=null==delay?0:+delay,t.restart((function(elapsed){t.stop(),callback(elapsed+delay)}),delay,time),t}Timer.prototype=timer.prototype={constructor:Timer,restart:function(callback,delay,time){if("function"!=typeof callback)throw new TypeError("callback is not a function");time=(null==time?now():+time)+(null==delay?0:+delay),this._next||taskTail===this||(taskTail?taskTail._next=this:taskHead=this,taskTail=this),this._call=callback,this._time=time,sleep()},stop:function(){this._call&&(this._call=null,this._time=1/0,sleep())}};var emptyOn=dispatch("start","end","cancel","interrupt"),emptyTween=[],CREATED=0,SCHEDULED=1,STARTING=2,STARTED=3,RUNNING=4,ENDING=5,ENDED=6;function schedule(node,name,id,index,group,timing){var schedules=node.__transition;if(schedules){if(id in schedules)return}else node.__transition={};!function(node,id,self){var tween,schedules=node.__transition;function schedule(elapsed){self.state=SCHEDULED,self.timer.restart(start,self.delay,self.time),self.delay<=elapsed&&start(elapsed-self.delay)}function start(elapsed){var i,j,n,o;if(self.state!==SCHEDULED)return stop();for(i in schedules)if((o=schedules[i]).name===self.name){if(o.state===STARTED)return timeout(start);o.state===RUNNING?(o.state=ENDED,o.timer.stop(),o.on.call("interrupt",node,node.__data__,o.index,o.group),delete schedules[i]):+i<id&&(o.state=ENDED,o.timer.stop(),o.on.call("cancel",node,node.__data__,o.index,o.group),delete schedules[i])}if(timeout((function(){self.state===STARTED&&(self.state=RUNNING,self.timer.restart(tick,self.delay,self.time),tick(elapsed))})),self.state=STARTING,self.on.call("start",node,node.__data__,self.index,self.group),self.state===STARTING){for(self.state=STARTED,tween=new Array(n=self.tween.length),i=0,j=-1;i<n;++i)(o=self.tween[i].value.call(node,node.__data__,self.index,self.group))&&(tween[++j]=o);tween.length=j+1}}function tick(elapsed){for(var t=elapsed<self.duration?self.ease.call(null,elapsed/self.duration):(self.timer.restart(stop),self.state=ENDING,1),i=-1,n=tween.length;++i<n;)tween[i].call(node,t);self.state===ENDING&&(self.on.call("end",node,node.__data__,self.index,self.group),stop())}function stop(){for(var i in self.state=ENDED,self.timer.stop(),delete schedules[id],schedules)return;delete node.__transition}schedules[id]=self,self.timer=timer(schedule,0,self.time)}(node,id,{name:name,index:index,group:group,on:emptyOn,tween:emptyTween,time:timing.time,delay:timing.delay,duration:timing.duration,ease:timing.ease,timer:null,state:CREATED})}function init(node,id){var schedule=get(node,id);if(schedule.state>CREATED)throw new Error("too late; already scheduled");return schedule}function set(node,id){var schedule=get(node,id);if(schedule.state>STARTED)throw new Error("too late; already running");return schedule}function get(node,id){var schedule=node.__transition;if(!schedule||!(schedule=schedule[id]))throw new Error("transition not found");return schedule}function interrupt(node,name){var schedule,active,i,schedules=node.__transition,empty=!0;if(schedules){for(i in name=null==name?null:name+"",schedules)(schedule=schedules[i]).name===name?(active=schedule.state>STARTING&&schedule.state<ENDING,schedule.state=ENDED,schedule.timer.stop(),schedule.on.call(active?"interrupt":"cancel",node,node.__data__,schedule.index,schedule.group),delete schedules[i]):empty=!1;empty&&delete node.__transition}}function tweenRemove(id,name){var tween0,tween1;return function(){var schedule=set(this,id),tween=schedule.tween;if(tween!==tween0)for(var i=0,n=(tween1=tween0=tween).length;i<n;++i)if(tween1[i].name===name){(tween1=tween1.slice()).splice(i,1);break}schedule.tween=tween1}}function tweenFunction(id,name,value){var tween0,tween1;if("function"!=typeof value)throw new Error;return function(){var schedule=set(this,id),tween=schedule.tween;if(tween!==tween0){tween1=(tween0=tween).slice();for(var t={name:name,value:value},i=0,n=tween1.length;i<n;++i)if(tween1[i].name===name){tween1[i]=t;break}i===n&&tween1.push(t)}schedule.tween=tween1}}function tweenValue(transition,name,value){var id=transition._id;return transition.each((function(){var schedule=set(this,id);(schedule.value||(schedule.value={}))[name]=value.apply(this,arguments)})),function(node){return get(node,id).value[name]}}function interpolate(a,b){var c;return("number"==typeof b?interpolateNumber:b instanceof color?interpolateRgb:(c=color(b))?(b=c,interpolateRgb):interpolateString)(a,b)}function attrRemove(name){return function(){this.removeAttribute(name)}}function attrRemoveNS(fullname){return function(){this.removeAttributeNS(fullname.space,fullname.local)}}function attrConstant(name,interpolate,value1){var string00,interpolate0,string1=value1+"";return function(){var string0=this.getAttribute(name);return string0===string1?null:string0===string00?interpolate0:interpolate0=interpolate(string00=string0,value1)}}function attrConstantNS(fullname,interpolate,value1){var string00,interpolate0,string1=value1+"";return function(){var string0=this.getAttributeNS(fullname.space,fullname.local);return string0===string1?null:string0===string00?interpolate0:interpolate0=interpolate(string00=string0,value1)}}function attrFunction(name,interpolate,value){var string00,string10,interpolate0;return function(){var string0,string1,value1=value(this);if(null!=value1)return(string0=this.getAttribute(name))===(string1=value1+"")?null:string0===string00&&string1===string10?interpolate0:(string10=string1,interpolate0=interpolate(string00=string0,value1));this.removeAttribute(name)}}function attrFunctionNS(fullname,interpolate,value){var string00,string10,interpolate0;return function(){var string0,string1,value1=value(this);if(null!=value1)return(string0=this.getAttributeNS(fullname.space,fullname.local))===(string1=value1+"")?null:string0===string00&&string1===string10?interpolate0:(string10=string1,interpolate0=interpolate(string00=string0,value1));this.removeAttributeNS(fullname.space,fullname.local)}}function attrTweenNS(fullname,value){var t0,i0;function tween(){var i=value.apply(this,arguments);return i!==i0&&(t0=(i0=i)&&function(fullname,i){return function(t){this.setAttributeNS(fullname.space,fullname.local,i.call(this,t))}}(fullname,i)),t0}return tween._value=value,tween}function attrTween(name,value){var t0,i0;function tween(){var i=value.apply(this,arguments);return i!==i0&&(t0=(i0=i)&&function(name,i){return function(t){this.setAttribute(name,i.call(this,t))}}(name,i)),t0}return tween._value=value,tween}function delayFunction(id,value){return function(){init(this,id).delay=+value.apply(this,arguments)}}function delayConstant(id,value){return value=+value,function(){init(this,id).delay=value}}function durationFunction(id,value){return function(){set(this,id).duration=+value.apply(this,arguments)}}function durationConstant(id,value){return value=+value,function(){set(this,id).duration=value}}var Selection=selection.prototype.constructor;function styleRemove(name){return function(){this.style.removeProperty(name)}}var id=0;function Transition(groups,parents,name,id){this._groups=groups,this._parents=parents,this._name=name,this._id=id}function newId(){return++id}var selection_prototype=selection.prototype;Transition.prototype={constructor:Transition,select:function(select){var name=this._name,id=this._id;"function"!=typeof select&&(select=selector(select));for(var groups=this._groups,m=groups.length,subgroups=new Array(m),j=0;j<m;++j)for(var node,subnode,group=groups[j],n=group.length,subgroup=subgroups[j]=new Array(n),i=0;i<n;++i)(node=group[i])&&(subnode=select.call(node,node.__data__,i,group))&&("__data__"in node&&(subnode.__data__=node.__data__),subgroup[i]=subnode,schedule(subgroup[i],name,id,i,subgroup,get(node,id)));return new Transition(subgroups,this._parents,name,id)},selectAll:function(select){var name=this._name,id=this._id;"function"!=typeof select&&(select=selectorAll(select));for(var groups=this._groups,m=groups.length,subgroups=[],parents=[],j=0;j<m;++j)for(var node,group=groups[j],n=group.length,i=0;i<n;++i)if(node=group[i]){for(var child,children=select.call(node,node.__data__,i,group),inherit=get(node,id),k=0,l=children.length;k<l;++k)(child=children[k])&&schedule(child,name,id,k,children,inherit);subgroups.push(children),parents.push(node)}return new Transition(subgroups,parents,name,id)},selectChild:selection_prototype.selectChild,selectChildren:selection_prototype.selectChildren,filter:function(match){"function"!=typeof match&&(match=matcher(match));for(var groups=this._groups,m=groups.length,subgroups=new Array(m),j=0;j<m;++j)for(var node,group=groups[j],n=group.length,subgroup=subgroups[j]=[],i=0;i<n;++i)(node=group[i])&&match.call(node,node.__data__,i,group)&&subgroup.push(node);return new Transition(subgroups,this._parents,this._name,this._id)},merge:function(transition){if(transition._id!==this._id)throw new Error;for(var groups0=this._groups,groups1=transition._groups,m0=groups0.length,m1=groups1.length,m=Math.min(m0,m1),merges=new Array(m0),j=0;j<m;++j)for(var node,group0=groups0[j],group1=groups1[j],n=group0.length,merge=merges[j]=new Array(n),i=0;i<n;++i)(node=group0[i]||group1[i])&&(merge[i]=node);for(;j<m0;++j)merges[j]=groups0[j];return new Transition(merges,this._parents,this._name,this._id)},selection:function(){return new Selection(this._groups,this._parents)},transition:function(){for(var name=this._name,id0=this._id,id1=newId(),groups=this._groups,m=groups.length,j=0;j<m;++j)for(var node,group=groups[j],n=group.length,i=0;i<n;++i)if(node=group[i]){var inherit=get(node,id0);schedule(node,name,id1,i,group,{time:inherit.time+inherit.delay+inherit.duration,delay:0,duration:inherit.duration,ease:inherit.ease})}return new Transition(groups,this._parents,name,id1)},call:selection_prototype.call,nodes:selection_prototype.nodes,node:selection_prototype.node,size:selection_prototype.size,empty:selection_prototype.empty,each:selection_prototype.each,on:function(name,listener){var id=this._id;return arguments.length<2?get(this.node(),id).on.on(name):this.each(function(id,name,listener){var on0,on1,sit=function(name){return(name+"").trim().split(/^|\s+/).every((function(t){var i=t.indexOf(".");return i>=0&&(t=t.slice(0,i)),!t||"start"===t}))}(name)?init:set;return function(){var schedule=sit(this,id),on=schedule.on;on!==on0&&(on1=(on0=on).copy()).on(name,listener),schedule.on=on1}}(id,name,listener))},attr:function(name,value){var fullname=namespace(name),i="transform"===fullname?interpolateTransformSvg:interpolate;return this.attrTween(name,"function"==typeof value?(fullname.local?attrFunctionNS:attrFunction)(fullname,i,tweenValue(this,"attr."+name,value)):null==value?(fullname.local?attrRemoveNS:attrRemove)(fullname):(fullname.local?attrConstantNS:attrConstant)(fullname,i,value))},attrTween:function(name,value){var key="attr."+name;if(arguments.length<2)return(key=this.tween(key))&&key._value;if(null==value)return this.tween(key,null);if("function"!=typeof value)throw new Error;var fullname=namespace(name);return this.tween(key,(fullname.local?attrTweenNS:attrTween)(fullname,value))},style:function(name,value,priority){var i="transform"==(name+="")?interpolateTransformCss:interpolate;return null==value?this.styleTween(name,function(name,interpolate){var string00,string10,interpolate0;return function(){var string0=styleValue(this,name),string1=(this.style.removeProperty(name),styleValue(this,name));return string0===string1?null:string0===string00&&string1===string10?interpolate0:interpolate0=interpolate(string00=string0,string10=string1)}}(name,i)).on("end.style."+name,styleRemove(name)):"function"==typeof value?this.styleTween(name,function(name,interpolate,value){var string00,string10,interpolate0;return function(){var string0=styleValue(this,name),value1=value(this),string1=value1+"";return null==value1&&(this.style.removeProperty(name),string1=value1=styleValue(this,name)),string0===string1?null:string0===string00&&string1===string10?interpolate0:(string10=string1,interpolate0=interpolate(string00=string0,value1))}}(name,i,tweenValue(this,"style."+name,value))).each(function(id,name){var on0,on1,listener0,remove,key="style."+name,event="end."+key;return function(){var schedule=set(this,id),on=schedule.on,listener=null==schedule.value[key]?remove||(remove=styleRemove(name)):void 0;on===on0&&listener0===listener||(on1=(on0=on).copy()).on(event,listener0=listener),schedule.on=on1}}(this._id,name)):this.styleTween(name,function(name,interpolate,value1){var string00,interpolate0,string1=value1+"";return function(){var string0=styleValue(this,name);return string0===string1?null:string0===string00?interpolate0:interpolate0=interpolate(string00=string0,value1)}}(name,i,value),priority).on("end.style."+name,null)},styleTween:function(name,value,priority){var key="style."+(name+="");if(arguments.length<2)return(key=this.tween(key))&&key._value;if(null==value)return this.tween(key,null);if("function"!=typeof value)throw new Error;return this.tween(key,function(name,value,priority){var t,i0;function tween(){var i=value.apply(this,arguments);return i!==i0&&(t=(i0=i)&&function(name,i,priority){return function(t){this.style.setProperty(name,i.call(this,t),priority)}}(name,i,priority)),t}return tween._value=value,tween}(name,value,null==priority?"":priority))},text:function(value){return this.tween("text","function"==typeof value?function(value){return function(){var value1=value(this);this.textContent=null==value1?"":value1}}(tweenValue(this,"text",value)):function(value){return function(){this.textContent=value}}(null==value?"":value+""))},textTween:function(value){var key="text";if(arguments.length<1)return(key=this.tween(key))&&key._value;if(null==value)return this.tween(key,null);if("function"!=typeof value)throw new Error;return this.tween(key,function(value){var t0,i0;function tween(){var i=value.apply(this,arguments);return i!==i0&&(t0=(i0=i)&&function(i){return function(t){this.textContent=i.call(this,t)}}(i)),t0}return tween._value=value,tween}(value))},remove:function(){return this.on("end.remove",function(id){return function(){var parent=this.parentNode;for(var i in this.__transition)if(+i!==id)return;parent&&parent.removeChild(this)}}(this._id))},tween:function(name,value){var id=this._id;if(name+="",arguments.length<2){for(var t,tween=get(this.node(),id).tween,i=0,n=tween.length;i<n;++i)if((t=tween[i]).name===name)return t.value;return null}return this.each((null==value?tweenRemove:tweenFunction)(id,name,value))},delay:function(value){var id=this._id;return arguments.length?this.each(("function"==typeof value?delayFunction:delayConstant)(id,value)):get(this.node(),id).delay},duration:function(value){var id=this._id;return arguments.length?this.each(("function"==typeof