d3plus-priestley
Advanced tools
Comparing version 0.3.5 to 0.4.0
/* | ||
d3plus-priestley v0.3.5 | ||
d3plus-priestley v0.4.0 | ||
A reusable Priestley timeline built on D3. | ||
@@ -224,3 +224,3 @@ Copyright (c) 2020 D3plus - https://d3plus.org | ||
})('versions', []).push({ | ||
version: '3.6.4', | ||
version: '3.6.5', | ||
mode: 'global', | ||
@@ -968,38 +968,64 @@ copyright: '© 2020 Denis Pushkarev (zloirock.ru)' | ||
(function () { | ||
var serializeXML = function (node, output) { | ||
var nodeType = node.nodeType; | ||
if (nodeType === 3) { | ||
output.push(node.textContent.replace(/&/, '&').replace(/</, '<').replace('>', '>')); | ||
} else if (nodeType === 1) { | ||
output.push('<', node.tagName); | ||
try { | ||
if (typeof SVGElement === 'undefined' || Boolean(SVGElement.prototype.innerHTML)) { | ||
return; | ||
} | ||
} catch (e) { | ||
return; | ||
} | ||
function serializeNode (node) { | ||
switch (node.nodeType) { | ||
case 1: | ||
return serializeElementNode(node); | ||
case 3: | ||
return serializeTextNode(node); | ||
case 8: | ||
return serializeCommentNode(node); | ||
} | ||
} | ||
function serializeTextNode (node) { | ||
return node.textContent.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>'); | ||
} | ||
function serializeCommentNode (node) { | ||
return '<!--' + node.nodeValue + '-->' | ||
} | ||
function serializeElementNode (node) { | ||
var output = ''; | ||
output += '<' + node.tagName; | ||
if (node.hasAttributes()) { | ||
[].forEach.call(node.attributes, function(attrNode){ | ||
output.push(' ', attrNode.item.name, '=\'', attrNode.item.value, '\''); | ||
}); | ||
[].forEach.call(node.attributes, function(attrNode) { | ||
output += ' ' + attrNode.name + '="' + attrNode.value + '"'; | ||
}); | ||
} | ||
output += '>'; | ||
if (node.hasChildNodes()) { | ||
output.push('>'); | ||
[].forEach.call(node.childNodes, function(childNode){ | ||
serializeXML(childNode, output); | ||
}); | ||
output.push('</', node.tagName, '>'); | ||
} else { | ||
output.push('/>'); | ||
[].forEach.call(node.childNodes, function(childNode) { | ||
output += serializeNode(childNode); | ||
}); | ||
} | ||
} else if (nodeType == 8) { | ||
output.push('<!--', node.nodeValue, '-->'); | ||
} | ||
}; | ||
output += '</' + node.tagName + '>'; | ||
return output; | ||
} | ||
Object.defineProperty(SVGElement.prototype, 'innerHTML', { | ||
get: function () { | ||
var output = []; | ||
var childNode = this.firstChild; | ||
while (childNode) { | ||
serializeXML(childNode, output); | ||
childNode = childNode.nextSibling; | ||
} | ||
return output.join(''); | ||
var output = ''; | ||
[].forEach.call(this.childNodes, function(childNode) { | ||
output += serializeNode(childNode); | ||
}); | ||
return output; | ||
}, | ||
set: function (markupText) { | ||
set: function (markup) { | ||
while (this.firstChild) { | ||
@@ -1013,11 +1039,12 @@ this.removeChild(this.firstChild); | ||
var sXML = '<svg xmlns=\'http://www.w3.org/2000/svg\' xmlns:xlink=\'http://www.w3.org/1999/xlink\'>' + markupText + '</svg>'; | ||
var sXML = '<svg xmlns=\'http://www.w3.org/2000/svg\' xmlns:xlink=\'http://www.w3.org/1999/xlink\'>' + markup + '</svg>'; | ||
var svgDocElement = dXML.parseFromString(sXML, 'text/xml').documentElement; | ||
var childNode = svgDocElement.firstChild; | ||
while (childNode) { | ||
this.appendChild(this.ownerDocument.importNode(childNode, true)); | ||
childNode = childNode.nextSibling; | ||
} | ||
} catch (e) {} } | ||
[].forEach.call(svgDocElement.childNodes, function(childNode) { | ||
this.appendChild(this.ownerDocument.importNode(childNode, true)); | ||
}.bind(this)); | ||
} catch (e) { | ||
throw new Error('Error parsing markup string'); | ||
} | ||
} | ||
}); | ||
@@ -1098,2 +1125,15 @@ | ||
function _isNativeReflectConstruct() { | ||
if (typeof Reflect === "undefined" || !Reflect.construct) return false; | ||
if (Reflect.construct.sham) return false; | ||
if (typeof Proxy === "function") return true; | ||
try { | ||
Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); | ||
return true; | ||
} catch (e) { | ||
return false; | ||
} | ||
} | ||
function _assertThisInitialized(self) { | ||
@@ -1115,2 +1155,21 @@ if (self === void 0) { | ||
function _createSuper(Derived) { | ||
var hasNativeReflectConstruct = _isNativeReflectConstruct(); | ||
return function _createSuperInternal() { | ||
var Super = _getPrototypeOf(Derived), | ||
result; | ||
if (hasNativeReflectConstruct) { | ||
var NewTarget = _getPrototypeOf(this).constructor; | ||
result = Reflect.construct(Super, arguments, NewTarget); | ||
} else { | ||
result = Super.apply(this, arguments); | ||
} | ||
return _possibleConstructorReturn(this, result); | ||
}; | ||
} | ||
function _superPropBase(object, property) { | ||
@@ -1155,2 +1214,4 @@ while (!Object.prototype.hasOwnProperty.call(object, property)) { | ||
var _super = _createSuper(Priestley); | ||
/** | ||
@@ -1166,3 +1227,3 @@ @memberof Priestley | ||
_this = _possibleConstructorReturn(this, _getPrototypeOf(Priestley).call(this)); | ||
_this = _super.call(this); | ||
_this._axis = new d3plusAxis.Axis().align("end").orient("bottom"); | ||
@@ -1331,5 +1392,3 @@ _this._axisConfig = { | ||
this._end = d3plusCommon.accessor(_); | ||
if (!this._aggs[_]) this._aggs[_] = function (a) { | ||
return d3Array.max(a); | ||
}; | ||
if (!this._aggs[_]) this._aggs[_] = d3Array.max; | ||
} | ||
@@ -1376,5 +1435,3 @@ return this; | ||
this._start = d3plusCommon.accessor(_); | ||
if (!this._aggs[_]) this._aggs[_] = function (a) { | ||
return d3Array.min(a); | ||
}; | ||
if (!this._aggs[_]) this._aggs[_] = d3Array.min; | ||
} | ||
@@ -1381,0 +1438,0 @@ return this; |
/* | ||
d3plus-priestley v0.3.5 | ||
d3plus-priestley v0.4.0 | ||
A reusable Priestley timeline built on D3. | ||
@@ -7,2 +7,2 @@ Copyright (c) 2020 D3plus - https://d3plus.org | ||
*/ | ||
(function(t){typeof define==="function"&&define.amd?define(t):t()})(function(){"use strict";var t=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function r(t,r){return r={exports:{}},t(r,r.exports),r.exports}var e=function(t){return t&&t.Math==Math&&t};var l=e(typeof globalThis=="object"&&globalThis)||e(typeof window=="object"&&window)||e(typeof self=="object"&&self)||e(typeof t=="object"&&t)||Function("return this")();var o=function(t){try{return!!t()}catch(t){return true}};var d=!o(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7});var n={}.propertyIsEnumerable;var i=Object.getOwnPropertyDescriptor;var a=i&&!n.call({1:2},1);var u=a?function t(r){var e=i(this,r);return!!e&&e.enumerable}:n;var p={f:u};var f=function(t,r){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:r}};var s={}.toString;var c=function(t){return s.call(t).slice(8,-1)};var v="".split;var _=o(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return c(t)=="String"?v.call(t,""):Object(t)}:Object;var h=function(t){if(t==undefined)throw TypeError("Can't call method on "+t);return t};var g=function(t){return _(h(t))};var y=function(t){return typeof t==="object"?t!==null:typeof t==="function"};var m=function(t,r){if(!y(t))return t;var e,n;if(r&&typeof(e=t.toString)=="function"&&!y(n=e.call(t)))return n;if(typeof(e=t.valueOf)=="function"&&!y(n=e.call(t)))return n;if(!r&&typeof(e=t.toString)=="function"&&!y(n=e.call(t)))return n;throw TypeError("Can't convert object to primitive value")};var b={}.hasOwnProperty;var w=function(t,r){return b.call(t,r)};var O=l.document;var S=y(O)&&y(O.createElement);var x=function(t){return S?O.createElement(t):{}};var j=!d&&!o(function(){return Object.defineProperty(x("div"),"a",{get:function(){return 7}}).a!=7});var C=Object.getOwnPropertyDescriptor;var E=d?C:function t(r,e){r=g(r);e=m(e,true);if(j)try{return C(r,e)}catch(t){}if(w(r,e))return f(!p.f.call(r,e),r[e])};var P={f:E};var T=function(t){if(!y(t)){throw TypeError(String(t)+" is not an object")}return t};var A=Object.defineProperty;var k=d?A:function t(r,e,n){T(r);e=m(e,true);T(n);if(j)try{return A(r,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");if("value"in n)r[e]=n.value;return r};var M={f:k};var I=d?function(t,r,e){return M.f(t,r,f(1,e))}:function(t,r,e){t[r]=e;return t};var R=function(r,e){try{I(l,r,e)}catch(t){l[r]=e}return e};var L="__core-js_shared__";var D=l[L]||R(L,{});var N=D;var q=Function.toString;if(typeof N.inspectSource!="function"){N.inspectSource=function(t){return q.call(t)}}var z=N.inspectSource;var F=l.WeakMap;var W=typeof F==="function"&&/native code/.test(z(F));var V=r(function(t){(t.exports=function(t,r){return N[t]||(N[t]=r!==undefined?r:{})})("versions",[]).push({version:"3.6.4",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})});var G=0;var B=Math.random();var H=function(t){return"Symbol("+String(t===undefined?"":t)+")_"+(++G+B).toString(36)};var K=V("keys");var X=function(t){return K[t]||(K[t]=H(t))};var Y={};var J=l.WeakMap;var Q,U,Z;var $=function(t){return Z(t)?U(t):Q(t,{})};var tt=function(e){return function(t){var r;if(!y(t)||(r=U(t)).type!==e){throw TypeError("Incompatible receiver, "+e+" required")}return r}};if(W){var rt=new J;var et=rt.get;var nt=rt.has;var it=rt.set;Q=function(t,r){it.call(rt,t,r);return r};U=function(t){return et.call(rt,t)||{}};Z=function(t){return nt.call(rt,t)}}else{var at=X("state");Y[at]=true;Q=function(t,r){I(t,at,r);return r};U=function(t){return w(t,at)?t[at]:{}};Z=function(t){return w(t,at)}}var ot={set:Q,get:U,has:Z,enforce:$,getterFor:tt};var ut=r(function(t){var r=ot.get;var u=ot.enforce;var f=String(String).split("String");(t.exports=function(t,r,e,n){var i=n?!!n.unsafe:false;var a=n?!!n.enumerable:false;var o=n?!!n.noTargetGet:false;if(typeof e=="function"){if(typeof r=="string"&&!w(e,"name"))I(e,"name",r);u(e).source=f.join(typeof r=="string"?r:"")}if(t===l){if(a)t[r]=e;else R(r,e);return}else if(!i){delete t[r]}else if(!o&&t[r]){a=true}if(a)t[r]=e;else I(t,r,e)})(Function.prototype,"toString",function t(){return typeof this=="function"&&r(this).source||z(this)})});var ft=l;var st=function(t){return typeof t=="function"?t:undefined};var ct=function(t,r){return arguments.length<2?st(ft[t])||st(l[t]):ft[t]&&ft[t][r]||l[t]&&l[t][r]};var lt=Math.ceil;var vt=Math.floor;var dt=function(t){return isNaN(t=+t)?0:(t>0?vt:lt)(t)};var pt=Math.min;var ht=function(t){return t>0?pt(dt(t),9007199254740991):0};var gt=Math.max;var yt=Math.min;var mt=function(t,r){var e=dt(t);return e<0?gt(e+r,0):yt(e,r)};var bt=function(u){return function(t,r,e){var n=g(t);var i=ht(n.length);var a=mt(e,i);var o;if(u&&r!=r)while(i>a){o=n[a++];if(o!=o)return true}else for(;i>a;a++){if((u||a in n)&&n[a]===r)return u||a||0}return!u&&-1}};var _t={includes:bt(true),indexOf:bt(false)};var wt=_t.indexOf;var Ot=function(t,r){var e=g(t);var n=0;var i=[];var a;for(a in e)!w(Y,a)&&w(e,a)&&i.push(a);while(r.length>n)if(w(e,a=r[n++])){~wt(i,a)||i.push(a)}return i};var St=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"];var xt=St.concat("length","prototype");var jt=Object.getOwnPropertyNames||function t(r){return Ot(r,xt)};var Ct={f:jt};var Et=Object.getOwnPropertySymbols;var Pt={f:Et};var Tt=ct("Reflect","ownKeys")||function t(r){var e=Ct.f(T(r));var n=Pt.f;return n?e.concat(n(r)):e};var At=function(t,r){var e=Tt(r);var n=M.f;var i=P.f;for(var a=0;a<e.length;a++){var o=e[a];if(!w(t,o))n(t,o,i(r,o))}};var kt=/#|\.prototype\./;var Mt=function(t,r){var e=Rt[It(t)];return e==Dt?true:e==Lt?false:typeof r=="function"?o(r):!!r};var It=Mt.normalize=function(t){return String(t).replace(kt,".").toLowerCase()};var Rt=Mt.data={};var Lt=Mt.NATIVE="N";var Dt=Mt.POLYFILL="P";var Nt=Mt;var qt=P.f;var zt=function(t,r){var e=t.target;var n=t.global;var i=t.stat;var a,o,u,f,s,c;if(n){o=l}else if(i){o=l[e]||R(e,{})}else{o=(l[e]||{}).prototype}if(o)for(u in r){s=r[u];if(t.noTargetGet){c=qt(o,u);f=c&&c.value}else f=o[u];a=Nt(n?u:e+(i?".":"#")+u,t.forced);if(!a&&f!==undefined){if(typeof s===typeof f)continue;At(s,f)}if(t.sham||f&&f.sham){I(s,"sham",true)}ut(o,u,s,t)}};var Ft=function(t){if(typeof t!="function"){throw TypeError(String(t)+" is not a function")}return t};var Wt=function(n,i,t){Ft(n);if(i===undefined)return n;switch(t){case 0:return function(){return n.call(i)};case 1:return function(t){return n.call(i,t)};case 2:return function(t,r){return n.call(i,t,r)};case 3:return function(t,r,e){return n.call(i,t,r,e)}}return function(){return n.apply(i,arguments)}};var Vt=function(t){return Object(h(t))};var Gt=Array.isArray||function t(r){return c(r)=="Array"};var Bt=!!Object.getOwnPropertySymbols&&!o(function(){return!String(Symbol())});var Ht=Bt&&!Symbol.sham&&typeof Symbol.iterator=="symbol";var Kt=V("wks");var Xt=l.Symbol;var Yt=Ht?Xt:Xt&&Xt.withoutSetter||H;var Jt=function(t){if(!w(Kt,t)){if(Bt&&w(Xt,t))Kt[t]=Xt[t];else Kt[t]=Yt("Symbol."+t)}return Kt[t]};var Qt=Jt("species");var Ut=function(t,r){var e;if(Gt(t)){e=t.constructor;if(typeof e=="function"&&(e===Array||Gt(e.prototype)))e=undefined;else if(y(e)){e=e[Qt];if(e===null)e=undefined}}return new(e===undefined?Array:e)(r===0?0:r)};var Zt=[].push;var $t=function(d){var p=d==1;var h=d==2;var g=d==3;var y=d==4;var m=d==6;var b=d==5||m;return function(t,r,e,n){var i=Vt(t);var a=_(i);var o=Wt(r,e,3);var u=ht(a.length);var f=0;var s=n||Ut;var c=p?s(t,u):h?s(t,0):undefined;var l,v;for(;u>f;f++)if(b||f in a){l=a[f];v=o(l,f,i);if(d){if(p)c[f]=v;else if(v)switch(d){case 3:return true;case 5:return l;case 6:return f;case 2:Zt.call(c,l)}else if(y)return false}}return m?-1:g||y?y:c}};var tr={forEach:$t(0),map:$t(1),filter:$t(2),some:$t(3),every:$t(4),find:$t(5),findIndex:$t(6)};var rr=Object.keys||function t(r){return Ot(r,St)};var er=d?Object.defineProperties:function t(r,e){T(r);var n=rr(e);var i=n.length;var a=0;var o;while(i>a)M.f(r,o=n[a++],e[o]);return r};var nr=ct("document","documentElement");var ir=">";var ar="<";var or="prototype";var ur="script";var fr=X("IE_PROTO");var sr=function(){};var cr=function(t){return ar+ur+ir+t+ar+"/"+ur+ir};var lr=function(t){t.write(cr(""));t.close();var r=t.parentWindow.Object;t=null;return r};var vr=function(){var t=x("iframe");var r="java"+ur+":";var e;t.style.display="none";nr.appendChild(t);t.src=String(r);e=t.contentWindow.document;e.open();e.write(cr("document.F=Object"));e.close();return e.F};var dr;var pr=function(){try{dr=document.domain&&new ActiveXObject("htmlfile")}catch(t){}pr=dr?lr(dr):vr();var t=St.length;while(t--)delete pr[or][St[t]];return pr()};Y[fr]=true;var hr=Object.create||function t(r,e){var n;if(r!==null){sr[or]=T(r);n=new sr;sr[or]=null;n[fr]=r}else n=pr();return e===undefined?n:er(n,e)};var gr=Jt("unscopables");var yr=Array.prototype;if(yr[gr]==undefined){M.f(yr,gr,{configurable:true,value:hr(null)})}var mr=function(t){yr[gr][t]=true};var br=Object.defineProperty;var _r={};var wr=function(t){throw t};var Or=function(t,r){if(w(_r,t))return _r[t];if(!r)r={};var e=[][t];var n=w(r,"ACCESSORS")?r.ACCESSORS:false;var i=w(r,0)?r[0]:wr;var a=w(r,1)?r[1]:undefined;return _r[t]=!!e&&!o(function(){if(n&&!d)return true;var t={length:-1};if(n)br(t,1,{enumerable:true,get:wr});else t[1]=1;e.call(t,i,a)})};var Sr=tr.find;var xr="find";var jr=true;var Cr=Or(xr);if(xr in[])Array(1)[xr](function(){jr=false});zt({target:"Array",proto:true,forced:jr||!Cr},{find:function t(r){return Sr(this,r,arguments.length>1?arguments[1]:undefined)}});mr(xr);var Er=_t.includes;var Pr=Or("indexOf",{ACCESSORS:true,1:0});zt({target:"Array",proto:true,forced:!Pr},{includes:function t(r){return Er(this,r,arguments.length>1?arguments[1]:undefined)}});mr("includes");var Tr=Object.assign;var Ar=Object.defineProperty;var kr=!Tr||o(function(){if(d&&Tr({b:1},Tr(Ar({},"a",{enumerable:true,get:function(){Ar(this,"b",{value:3,enumerable:false})}}),{b:2})).b!==1)return true;var t={};var r={};var e=Symbol();var n="abcdefghijklmnopqrst";t[e]=7;n.split("").forEach(function(t){r[t]=t});return Tr({},t)[e]!=7||rr(Tr({},r)).join("")!=n})?function t(r,e){var n=Vt(r);var i=arguments.length;var a=1;var o=Pt.f;var u=p.f;while(i>a){var f=_(arguments[a++]);var s=o?rr(f).concat(o(f)):rr(f);var c=s.length;var l=0;var v;while(c>l){v=s[l++];if(!d||u.call(f,v))n[v]=f[v]}}return n}:Tr;zt({target:"Object",stat:true,forced:Object.assign!==kr},{assign:kr});var Mr=Jt("match");var Ir=function(t){var r;return y(t)&&((r=t[Mr])!==undefined?!!r:c(t)=="RegExp")};var Rr=function(t){if(Ir(t)){throw TypeError("The method doesn't accept regular expressions")}return t};var Lr=Jt("match");var Dr=function(r){var e=/./;try{"/./"[r](e)}catch(t){try{e[Lr]=false;return"/./"[r](e)}catch(t){}}return false};zt({target:"String",proto:true,forced:!Dr("includes")},{includes:function t(r){return!!~String(h(this)).indexOf(Rr(r),arguments.length>1?arguments[1]:undefined)}});var Nr=P.f;var qr="".startsWith;var zr=Math.min;var Fr=Dr("startsWith");var Wr=!Fr&&!!function(){var t=Nr(String.prototype,"startsWith");return t&&!t.writable}();zt({target:"String",proto:true,forced:!Wr&&!Fr},{startsWith:function t(r){var e=String(h(this));Rr(r);var n=ht(zr(arguments.length>1?arguments[1]:undefined,e.length));var i=String(r);return qr?qr.call(e,i,n):e.slice(n,n+i.length)===i}});if(typeof window!=="undefined"){(function(){var n=function(t,r){var e=t.nodeType;if(e===3){r.push(t.textContent.replace(/&/,"&").replace(/</,"<").replace(">",">"))}else if(e===1){r.push("<",t.tagName);if(t.hasAttributes()){[].forEach.call(t.attributes,function(t){r.push(" ",t.item.name,"='",t.item.value,"'")})}if(t.hasChildNodes()){r.push(">");[].forEach.call(t.childNodes,function(t){n(t,r)});r.push("</",t.tagName,">")}else{r.push("/>")}}else if(e==8){r.push("\x3c!--",t.nodeValue,"--\x3e")}};Object.defineProperty(SVGElement.prototype,"innerHTML",{get:function(){var t=[];var r=this.firstChild;while(r){n(r,t);r=r.nextSibling}return t.join("")},set:function(t){while(this.firstChild){this.removeChild(this.firstChild)}try{var r=new DOMParser;r.async=false;var e="<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>"+t+"</svg>";var n=r.parseFromString(e,"text/xml").documentElement;var i=n.firstChild;while(i){this.appendChild(this.ownerDocument.importNode(i,true));i=i.nextSibling}}catch(t){}}});Object.defineProperty(SVGElement.prototype,"innerSVG",{get:function(){return this.innerHTML},set:function(t){this.innerHTML=t}})})()}});(function(t,r){typeof exports==="object"&&typeof module!=="undefined"?r(exports,require("d3-array"),require("d3-collection"),require("d3-scale"),require("d3plus-axis"),require("d3plus-common"),require("d3plus-shape"),require("d3plus-viz")):typeof define==="function"&&define.amd?define("d3plus-priestley",["exports","d3-array","d3-collection","d3-scale","d3plus-axis","d3plus-common","d3plus-shape","d3plus-viz"],r):(t=t||self,r(t.d3plus={},t.d3Array,t.d3Collection,t.d3Scale,t.d3plusAxis,t.d3plusCommon,t.d3plusShape,t.d3plusViz))})(this,function(t,g,y,m,b,_,w,r){"use strict";function e(t,r){if(!(t instanceof r)){throw new TypeError("Cannot call a class as a function")}}function n(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(t,n.key,n)}}function i(t,r,e){if(r)n(t.prototype,r);if(e)n(t,e);return t}function a(t,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function")}t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:true,configurable:true}});if(r)o(t,r)}function O(t){O=Object.setPrototypeOf?Object.getPrototypeOf:function t(r){return r.__proto__||Object.getPrototypeOf(r)};return O(t)}function o(t,r){o=Object.setPrototypeOf||function t(r,e){r.__proto__=e;return r};return o(t,r)}function u(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function f(t,r){if(r&&(typeof r==="object"||typeof r==="function")){return r}return u(t)}function s(t,r){while(!Object.prototype.hasOwnProperty.call(t,r)){t=O(t);if(t===null)break}return t}function S(t,r,e){if(typeof Reflect!=="undefined"&&Reflect.get){S=Reflect.get}else{S=function t(r,e,n){var i=s(r,e);if(!i)return;var a=Object.getOwnPropertyDescriptor(i,e);if(a.get){return a.get.call(n)}return a.value}}return S(t,r,e||t)}var c=function(t){a(h,t);function h(){var n;e(this,h);n=f(this,O(h).call(this));n._axis=(new b.Axis).align("end").orient("bottom");n._axisConfig={scale:"time"};n._axisTest=(new b.Axis).align("end").gridSize(0).orient("bottom");n.end("end");n._paddingInner=.05;n._paddingOuter=.05;n._shapeConfig=_.assign({},n._shapeConfig,{ariaLabel:function t(r,e){return"".concat(n._drawLabel(r,e),", ").concat(n._start(r,e)," - ").concat(n._end(r,e),".")}});n.start("start");return n}i(h,[{key:"_draw",value:function t(r){var e=this;S(O(h.prototype),"_draw",this).call(this,r);if(!this._filteredData)return this;var n=this._filteredData.map(function(t,r){return{__d3plus__:true,data:t,end:e._axisConfig.scale==="time"?b.date(e._end(t,r)):e._end(t,r),i:r,id:e._id(t,r),start:e._axisConfig.scale==="time"?b.date(e._start(t,r)):e._start(t,r)}}).filter(function(t){return t.end-t.start>0}).sort(function(t,r){return t.start-r.start});var i;if(this._groupBy.length>1&&this._drawDepth>0){var a=y.nest();var o=function t(r){a.key(function(t){return e._groupBy[r](t.data,t.i)})};for(var u=0;u<this._drawDepth;u++){o(u)}i=a.entries(n)}else i=[{values:n}];var f=0;i.forEach(function(t){var e=[];t.values.forEach(function(r){e=e.map(function(t){return t<=r.start?false:t});var t=e.indexOf(false);if(t<0){r.lane=f+e.length;e.push(r.end)}else{e[t]=r.end;r.lane=f+t}});f+=e.length});var s={domain:[g.min(n,function(t){return t.start})||0,g.max(n,function(t){return t.end})||0],height:this._height-this._margin.top-this._margin.bottom,width:this._width-this._margin.left-this._margin.right};var c="translate(".concat(this._margin.left,", ").concat(this._margin.top,")");this._axisTest.config(s).config(this._axisConfig).select(_.elem("g.d3plus-priestley-axis-test",{parent:this._select,enter:{opacity:0}}).node()).render();this._axis.config(s).config(this._axisConfig).select(_.elem("g.d3plus-priestley-axis",{parent:this._select,enter:{transform:c},update:{transform:c}}).node()).render();var l=this._axisTest._padding;var v=this._axis._d3Scale;var d=m.scaleBand().domain(g.range(0,f,1)).paddingInner(this._paddingInner).paddingOuter(this._paddingOuter).rangeRound([this._height-this._margin.bottom-this._axisTest.outerBounds().height-l,this._margin.top+l]);var p=d.bandwidth();this._shapes.push((new w.Rect).data(n).duration(this._duration).height(p).label(function(t,r){return e._drawLabel(t.data,r)}).select(_.elem("g.d3plus-priestley-shapes",{parent:this._select}).node()).width(function(t){var r=Math.abs(v(t.end)-v(t.start));return r>2?r-2:r}).x(function(t){return v(t.start)+(v(t.end)-v(t.start))/2}).y(function(t){return d(t.lane)+p/2}).config(_.configPrep.bind(this)(this._shapeConfig,"shape","Rect")).render());return this}},{key:"axisConfig",value:function t(r){return arguments.length?(this._axisConfig=_.assign(this._axisConfig,r),this):this._axisConfig}},{key:"end",value:function t(r){if(arguments.length){if(typeof r==="function")this._end=r;else{this._end=_.accessor(r);if(!this._aggs[r])this._aggs[r]=function(t){return g.max(t)}}return this}else return this._end}},{key:"paddingInner",value:function t(r){return arguments.length?(this._paddingInner=r,this):this._paddingInner}},{key:"paddingOuter",value:function t(r){return arguments.length?(this._paddingOuter=r,this):this._paddingOuter}},{key:"start",value:function t(r){if(arguments.length){if(typeof r==="function")this._start=r;else{this._start=_.accessor(r);if(!this._aggs[r])this._aggs[r]=function(t){return g.min(t)}}return this}else return this._start}}]);return h}(r.Viz);t.Priestley=c;Object.defineProperty(t,"__esModule",{value:true})}); | ||
(function(t){typeof define==="function"&&define.amd?define(t):t()})(function(){"use strict";var t=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function r(t,r){return r={exports:{}},t(r,r.exports),r.exports}var e=function(t){return t&&t.Math==Math&&t};var l=e(typeof globalThis=="object"&&globalThis)||e(typeof window=="object"&&window)||e(typeof self=="object"&&self)||e(typeof t=="object"&&t)||Function("return this")();var o=function(t){try{return!!t()}catch(t){return true}};var d=!o(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7});var n={}.propertyIsEnumerable;var i=Object.getOwnPropertyDescriptor;var a=i&&!n.call({1:2},1);var u=a?function t(r){var e=i(this,r);return!!e&&e.enumerable}:n;var p={f:u};var f=function(t,r){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:r}};var c={}.toString;var s=function(t){return c.call(t).slice(8,-1)};var v="".split;var _=o(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return s(t)=="String"?v.call(t,""):Object(t)}:Object;var h=function(t){if(t==undefined)throw TypeError("Can't call method on "+t);return t};var g=function(t){return _(h(t))};var y=function(t){return typeof t==="object"?t!==null:typeof t==="function"};var m=function(t,r){if(!y(t))return t;var e,n;if(r&&typeof(e=t.toString)=="function"&&!y(n=e.call(t)))return n;if(typeof(e=t.valueOf)=="function"&&!y(n=e.call(t)))return n;if(!r&&typeof(e=t.toString)=="function"&&!y(n=e.call(t)))return n;throw TypeError("Can't convert object to primitive value")};var b={}.hasOwnProperty;var w=function(t,r){return b.call(t,r)};var O=l.document;var S=y(O)&&y(O.createElement);var x=function(t){return S?O.createElement(t):{}};var j=!d&&!o(function(){return Object.defineProperty(x("div"),"a",{get:function(){return 7}}).a!=7});var E=Object.getOwnPropertyDescriptor;var P=d?E:function t(r,e){r=g(r);e=m(e,true);if(j)try{return E(r,e)}catch(t){}if(w(r,e))return f(!p.f.call(r,e),r[e])};var C={f:P};var T=function(t){if(!y(t)){throw TypeError(String(t)+" is not an object")}return t};var k=Object.defineProperty;var A=d?k:function t(r,e,n){T(r);e=m(e,true);T(n);if(j)try{return k(r,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");if("value"in n)r[e]=n.value;return r};var M={f:A};var R=d?function(t,r,e){return M.f(t,r,f(1,e))}:function(t,r,e){t[r]=e;return t};var I=function(r,e){try{R(l,r,e)}catch(t){l[r]=e}return e};var D="__core-js_shared__";var L=l[D]||I(D,{});var N=L;var q=Function.toString;if(typeof N.inspectSource!="function"){N.inspectSource=function(t){return q.call(t)}}var V=N.inspectSource;var z=l.WeakMap;var F=typeof z==="function"&&/native code/.test(V(z));var W=r(function(t){(t.exports=function(t,r){return N[t]||(N[t]=r!==undefined?r:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})});var G=0;var B=Math.random();var H=function(t){return"Symbol("+String(t===undefined?"":t)+")_"+(++G+B).toString(36)};var K=W("keys");var X=function(t){return K[t]||(K[t]=H(t))};var Y={};var J=l.WeakMap;var Q,U,Z;var $=function(t){return Z(t)?U(t):Q(t,{})};var tt=function(e){return function(t){var r;if(!y(t)||(r=U(t)).type!==e){throw TypeError("Incompatible receiver, "+e+" required")}return r}};if(F){var rt=new J;var et=rt.get;var nt=rt.has;var it=rt.set;Q=function(t,r){it.call(rt,t,r);return r};U=function(t){return et.call(rt,t)||{}};Z=function(t){return nt.call(rt,t)}}else{var at=X("state");Y[at]=true;Q=function(t,r){R(t,at,r);return r};U=function(t){return w(t,at)?t[at]:{}};Z=function(t){return w(t,at)}}var ot={set:Q,get:U,has:Z,enforce:$,getterFor:tt};var ut=r(function(t){var r=ot.get;var u=ot.enforce;var f=String(String).split("String");(t.exports=function(t,r,e,n){var i=n?!!n.unsafe:false;var a=n?!!n.enumerable:false;var o=n?!!n.noTargetGet:false;if(typeof e=="function"){if(typeof r=="string"&&!w(e,"name"))R(e,"name",r);u(e).source=f.join(typeof r=="string"?r:"")}if(t===l){if(a)t[r]=e;else I(r,e);return}else if(!i){delete t[r]}else if(!o&&t[r]){a=true}if(a)t[r]=e;else R(t,r,e)})(Function.prototype,"toString",function t(){return typeof this=="function"&&r(this).source||V(this)})});var ft=l;var ct=function(t){return typeof t=="function"?t:undefined};var st=function(t,r){return arguments.length<2?ct(ft[t])||ct(l[t]):ft[t]&&ft[t][r]||l[t]&&l[t][r]};var lt=Math.ceil;var vt=Math.floor;var dt=function(t){return isNaN(t=+t)?0:(t>0?vt:lt)(t)};var pt=Math.min;var ht=function(t){return t>0?pt(dt(t),9007199254740991):0};var gt=Math.max;var yt=Math.min;var mt=function(t,r){var e=dt(t);return e<0?gt(e+r,0):yt(e,r)};var bt=function(u){return function(t,r,e){var n=g(t);var i=ht(n.length);var a=mt(e,i);var o;if(u&&r!=r)while(i>a){o=n[a++];if(o!=o)return true}else for(;i>a;a++){if((u||a in n)&&n[a]===r)return u||a||0}return!u&&-1}};var _t={includes:bt(true),indexOf:bt(false)};var wt=_t.indexOf;var Ot=function(t,r){var e=g(t);var n=0;var i=[];var a;for(a in e)!w(Y,a)&&w(e,a)&&i.push(a);while(r.length>n)if(w(e,a=r[n++])){~wt(i,a)||i.push(a)}return i};var St=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"];var xt=St.concat("length","prototype");var jt=Object.getOwnPropertyNames||function t(r){return Ot(r,xt)};var Et={f:jt};var Pt=Object.getOwnPropertySymbols;var Ct={f:Pt};var Tt=st("Reflect","ownKeys")||function t(r){var e=Et.f(T(r));var n=Ct.f;return n?e.concat(n(r)):e};var kt=function(t,r){var e=Tt(r);var n=M.f;var i=C.f;for(var a=0;a<e.length;a++){var o=e[a];if(!w(t,o))n(t,o,i(r,o))}};var At=/#|\.prototype\./;var Mt=function(t,r){var e=It[Rt(t)];return e==Lt?true:e==Dt?false:typeof r=="function"?o(r):!!r};var Rt=Mt.normalize=function(t){return String(t).replace(At,".").toLowerCase()};var It=Mt.data={};var Dt=Mt.NATIVE="N";var Lt=Mt.POLYFILL="P";var Nt=Mt;var qt=C.f;var Vt=function(t,r){var e=t.target;var n=t.global;var i=t.stat;var a,o,u,f,c,s;if(n){o=l}else if(i){o=l[e]||I(e,{})}else{o=(l[e]||{}).prototype}if(o)for(u in r){c=r[u];if(t.noTargetGet){s=qt(o,u);f=s&&s.value}else f=o[u];a=Nt(n?u:e+(i?".":"#")+u,t.forced);if(!a&&f!==undefined){if(typeof c===typeof f)continue;kt(c,f)}if(t.sham||f&&f.sham){R(c,"sham",true)}ut(o,u,c,t)}};var zt=function(t){if(typeof t!="function"){throw TypeError(String(t)+" is not a function")}return t};var Ft=function(n,i,t){zt(n);if(i===undefined)return n;switch(t){case 0:return function(){return n.call(i)};case 1:return function(t){return n.call(i,t)};case 2:return function(t,r){return n.call(i,t,r)};case 3:return function(t,r,e){return n.call(i,t,r,e)}}return function(){return n.apply(i,arguments)}};var Wt=function(t){return Object(h(t))};var Gt=Array.isArray||function t(r){return s(r)=="Array"};var Bt=!!Object.getOwnPropertySymbols&&!o(function(){return!String(Symbol())});var Ht=Bt&&!Symbol.sham&&typeof Symbol.iterator=="symbol";var Kt=W("wks");var Xt=l.Symbol;var Yt=Ht?Xt:Xt&&Xt.withoutSetter||H;var Jt=function(t){if(!w(Kt,t)){if(Bt&&w(Xt,t))Kt[t]=Xt[t];else Kt[t]=Yt("Symbol."+t)}return Kt[t]};var Qt=Jt("species");var Ut=function(t,r){var e;if(Gt(t)){e=t.constructor;if(typeof e=="function"&&(e===Array||Gt(e.prototype)))e=undefined;else if(y(e)){e=e[Qt];if(e===null)e=undefined}}return new(e===undefined?Array:e)(r===0?0:r)};var Zt=[].push;var $t=function(d){var p=d==1;var h=d==2;var g=d==3;var y=d==4;var m=d==6;var b=d==5||m;return function(t,r,e,n){var i=Wt(t);var a=_(i);var o=Ft(r,e,3);var u=ht(a.length);var f=0;var c=n||Ut;var s=p?c(t,u):h?c(t,0):undefined;var l,v;for(;u>f;f++)if(b||f in a){l=a[f];v=o(l,f,i);if(d){if(p)s[f]=v;else if(v)switch(d){case 3:return true;case 5:return l;case 6:return f;case 2:Zt.call(s,l)}else if(y)return false}}return m?-1:g||y?y:s}};var tr={forEach:$t(0),map:$t(1),filter:$t(2),some:$t(3),every:$t(4),find:$t(5),findIndex:$t(6)};var rr=Object.keys||function t(r){return Ot(r,St)};var er=d?Object.defineProperties:function t(r,e){T(r);var n=rr(e);var i=n.length;var a=0;var o;while(i>a)M.f(r,o=n[a++],e[o]);return r};var nr=st("document","documentElement");var ir=">";var ar="<";var or="prototype";var ur="script";var fr=X("IE_PROTO");var cr=function(){};var sr=function(t){return ar+ur+ir+t+ar+"/"+ur+ir};var lr=function(t){t.write(sr(""));t.close();var r=t.parentWindow.Object;t=null;return r};var vr=function(){var t=x("iframe");var r="java"+ur+":";var e;t.style.display="none";nr.appendChild(t);t.src=String(r);e=t.contentWindow.document;e.open();e.write(sr("document.F=Object"));e.close();return e.F};var dr;var pr=function(){try{dr=document.domain&&new ActiveXObject("htmlfile")}catch(t){}pr=dr?lr(dr):vr();var t=St.length;while(t--)delete pr[or][St[t]];return pr()};Y[fr]=true;var hr=Object.create||function t(r,e){var n;if(r!==null){cr[or]=T(r);n=new cr;cr[or]=null;n[fr]=r}else n=pr();return e===undefined?n:er(n,e)};var gr=Jt("unscopables");var yr=Array.prototype;if(yr[gr]==undefined){M.f(yr,gr,{configurable:true,value:hr(null)})}var mr=function(t){yr[gr][t]=true};var br=Object.defineProperty;var _r={};var wr=function(t){throw t};var Or=function(t,r){if(w(_r,t))return _r[t];if(!r)r={};var e=[][t];var n=w(r,"ACCESSORS")?r.ACCESSORS:false;var i=w(r,0)?r[0]:wr;var a=w(r,1)?r[1]:undefined;return _r[t]=!!e&&!o(function(){if(n&&!d)return true;var t={length:-1};if(n)br(t,1,{enumerable:true,get:wr});else t[1]=1;e.call(t,i,a)})};var Sr=tr.find;var xr="find";var jr=true;var Er=Or(xr);if(xr in[])Array(1)[xr](function(){jr=false});Vt({target:"Array",proto:true,forced:jr||!Er},{find:function t(r){return Sr(this,r,arguments.length>1?arguments[1]:undefined)}});mr(xr);var Pr=_t.includes;var Cr=Or("indexOf",{ACCESSORS:true,1:0});Vt({target:"Array",proto:true,forced:!Cr},{includes:function t(r){return Pr(this,r,arguments.length>1?arguments[1]:undefined)}});mr("includes");var Tr=Object.assign;var kr=Object.defineProperty;var Ar=!Tr||o(function(){if(d&&Tr({b:1},Tr(kr({},"a",{enumerable:true,get:function(){kr(this,"b",{value:3,enumerable:false})}}),{b:2})).b!==1)return true;var t={};var r={};var e=Symbol();var n="abcdefghijklmnopqrst";t[e]=7;n.split("").forEach(function(t){r[t]=t});return Tr({},t)[e]!=7||rr(Tr({},r)).join("")!=n})?function t(r,e){var n=Wt(r);var i=arguments.length;var a=1;var o=Ct.f;var u=p.f;while(i>a){var f=_(arguments[a++]);var c=o?rr(f).concat(o(f)):rr(f);var s=c.length;var l=0;var v;while(s>l){v=c[l++];if(!d||u.call(f,v))n[v]=f[v]}}return n}:Tr;Vt({target:"Object",stat:true,forced:Object.assign!==Ar},{assign:Ar});var Mr=Jt("match");var Rr=function(t){var r;return y(t)&&((r=t[Mr])!==undefined?!!r:s(t)=="RegExp")};var Ir=function(t){if(Rr(t)){throw TypeError("The method doesn't accept regular expressions")}return t};var Dr=Jt("match");var Lr=function(r){var e=/./;try{"/./"[r](e)}catch(t){try{e[Dr]=false;return"/./"[r](e)}catch(t){}}return false};Vt({target:"String",proto:true,forced:!Lr("includes")},{includes:function t(r){return!!~String(h(this)).indexOf(Ir(r),arguments.length>1?arguments[1]:undefined)}});var Nr=C.f;var qr="".startsWith;var Vr=Math.min;var zr=Lr("startsWith");var Fr=!zr&&!!function(){var t=Nr(String.prototype,"startsWith");return t&&!t.writable}();Vt({target:"String",proto:true,forced:!Fr&&!zr},{startsWith:function t(r){var e=String(h(this));Ir(r);var n=ht(Vr(arguments.length>1?arguments[1]:undefined,e.length));var i=String(r);return qr?qr.call(e,i,n):e.slice(n,n+i.length)===i}});if(typeof window!=="undefined"){(function(){try{if(typeof SVGElement==="undefined"||Boolean(SVGElement.prototype.innerHTML)){return}}catch(t){return}function e(t){switch(t.nodeType){case 1:return i(t);case 3:return r(t);case 8:return n(t)}}function r(t){return t.textContent.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function n(t){return"\x3c!--"+t.nodeValue+"--\x3e"}function i(t){var r="";r+="<"+t.tagName;if(t.hasAttributes()){[].forEach.call(t.attributes,function(t){r+=" "+t.name+'="'+t.value+'"'})}r+=">";if(t.hasChildNodes()){[].forEach.call(t.childNodes,function(t){r+=e(t)})}r+="</"+t.tagName+">";return r}Object.defineProperty(SVGElement.prototype,"innerHTML",{get:function(){var r="";[].forEach.call(this.childNodes,function(t){r+=e(t)});return r},set:function(t){while(this.firstChild){this.removeChild(this.firstChild)}try{var r=new DOMParser;r.async=false;var e="<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>"+t+"</svg>";var n=r.parseFromString(e,"text/xml").documentElement;[].forEach.call(n.childNodes,function(t){this.appendChild(this.ownerDocument.importNode(t,true))}.bind(this))}catch(t){throw new Error("Error parsing markup string")}}});Object.defineProperty(SVGElement.prototype,"innerSVG",{get:function(){return this.innerHTML},set:function(t){this.innerHTML=t}})})()}});(function(t,r){typeof exports==="object"&&typeof module!=="undefined"?r(exports,require("d3-array"),require("d3-collection"),require("d3-scale"),require("d3plus-axis"),require("d3plus-common"),require("d3plus-shape"),require("d3plus-viz")):typeof define==="function"&&define.amd?define("d3plus-priestley",["exports","d3-array","d3-collection","d3-scale","d3plus-axis","d3plus-common","d3plus-shape","d3plus-viz"],r):(t=t||self,r(t.d3plus={},t.d3Array,t.d3Collection,t.d3Scale,t.d3plusAxis,t.d3plusCommon,t.d3plusShape,t.d3plusViz))})(this,function(t,g,y,m,b,_,w,r){"use strict";function e(t,r){if(!(t instanceof r)){throw new TypeError("Cannot call a class as a function")}}function n(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(t,n.key,n)}}function i(t,r,e){if(r)n(t.prototype,r);if(e)n(t,e);return t}function a(t,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function")}t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:true,configurable:true}});if(r)o(t,r)}function O(t){O=Object.setPrototypeOf?Object.getPrototypeOf:function t(r){return r.__proto__||Object.getPrototypeOf(r)};return O(t)}function o(t,r){o=Object.setPrototypeOf||function t(r,e){r.__proto__=e;return r};return o(t,r)}function u(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(t){return false}}function f(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function c(t,r){if(r&&(typeof r==="object"||typeof r==="function")){return r}return f(t)}function s(i){var a=u();return function t(){var r=O(i),e;if(a){var n=O(this).constructor;e=Reflect.construct(r,arguments,n)}else{e=r.apply(this,arguments)}return c(this,e)}}function l(t,r){while(!Object.prototype.hasOwnProperty.call(t,r)){t=O(t);if(t===null)break}return t}function S(t,r,e){if(typeof Reflect!=="undefined"&&Reflect.get){S=Reflect.get}else{S=function t(r,e,n){var i=l(r,e);if(!i)return;var a=Object.getOwnPropertyDescriptor(i,e);if(a.get){return a.get.call(n)}return a.value}}return S(t,r,e||t)}var v=function(t){a(h,t);var r=s(h);function h(){var n;e(this,h);n=r.call(this);n._axis=(new b.Axis).align("end").orient("bottom");n._axisConfig={scale:"time"};n._axisTest=(new b.Axis).align("end").gridSize(0).orient("bottom");n.end("end");n._paddingInner=.05;n._paddingOuter=.05;n._shapeConfig=_.assign({},n._shapeConfig,{ariaLabel:function t(r,e){return"".concat(n._drawLabel(r,e),", ").concat(n._start(r,e)," - ").concat(n._end(r,e),".")}});n.start("start");return n}i(h,[{key:"_draw",value:function t(r){var e=this;S(O(h.prototype),"_draw",this).call(this,r);if(!this._filteredData)return this;var n=this._filteredData.map(function(t,r){return{__d3plus__:true,data:t,end:e._axisConfig.scale==="time"?b.date(e._end(t,r)):e._end(t,r),i:r,id:e._id(t,r),start:e._axisConfig.scale==="time"?b.date(e._start(t,r)):e._start(t,r)}}).filter(function(t){return t.end-t.start>0}).sort(function(t,r){return t.start-r.start});var i;if(this._groupBy.length>1&&this._drawDepth>0){var a=y.nest();var o=function t(r){a.key(function(t){return e._groupBy[r](t.data,t.i)})};for(var u=0;u<this._drawDepth;u++){o(u)}i=a.entries(n)}else i=[{values:n}];var f=0;i.forEach(function(t){var e=[];t.values.forEach(function(r){e=e.map(function(t){return t<=r.start?false:t});var t=e.indexOf(false);if(t<0){r.lane=f+e.length;e.push(r.end)}else{e[t]=r.end;r.lane=f+t}});f+=e.length});var c={domain:[g.min(n,function(t){return t.start})||0,g.max(n,function(t){return t.end})||0],height:this._height-this._margin.top-this._margin.bottom,width:this._width-this._margin.left-this._margin.right};var s="translate(".concat(this._margin.left,", ").concat(this._margin.top,")");this._axisTest.config(c).config(this._axisConfig).select(_.elem("g.d3plus-priestley-axis-test",{parent:this._select,enter:{opacity:0}}).node()).render();this._axis.config(c).config(this._axisConfig).select(_.elem("g.d3plus-priestley-axis",{parent:this._select,enter:{transform:s},update:{transform:s}}).node()).render();var l=this._axisTest._padding;var v=this._axis._d3Scale;var d=m.scaleBand().domain(g.range(0,f,1)).paddingInner(this._paddingInner).paddingOuter(this._paddingOuter).rangeRound([this._height-this._margin.bottom-this._axisTest.outerBounds().height-l,this._margin.top+l]);var p=d.bandwidth();this._shapes.push((new w.Rect).data(n).duration(this._duration).height(p).label(function(t,r){return e._drawLabel(t.data,r)}).select(_.elem("g.d3plus-priestley-shapes",{parent:this._select}).node()).width(function(t){var r=Math.abs(v(t.end)-v(t.start));return r>2?r-2:r}).x(function(t){return v(t.start)+(v(t.end)-v(t.start))/2}).y(function(t){return d(t.lane)+p/2}).config(_.configPrep.bind(this)(this._shapeConfig,"shape","Rect")).render());return this}},{key:"axisConfig",value:function t(r){return arguments.length?(this._axisConfig=_.assign(this._axisConfig,r),this):this._axisConfig}},{key:"end",value:function t(r){if(arguments.length){if(typeof r==="function")this._end=r;else{this._end=_.accessor(r);if(!this._aggs[r])this._aggs[r]=g.max}return this}else return this._end}},{key:"paddingInner",value:function t(r){return arguments.length?(this._paddingInner=r,this):this._paddingInner}},{key:"paddingOuter",value:function t(r){return arguments.length?(this._paddingOuter=r,this):this._paddingOuter}},{key:"start",value:function t(r){if(arguments.length){if(typeof r==="function")this._start=r;else{this._start=_.accessor(r);if(!this._aggs[r])this._aggs[r]=g.min}return this}else return this._start}}]);return h}(r.Viz);t.Priestley=v;Object.defineProperty(t,"__esModule",{value:true})}); |
@@ -9,6 +9,2 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } | ||
@@ -18,4 +14,2 @@ | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
@@ -25,2 +19,12 @@ | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
/** | ||
@@ -46,2 +50,4 @@ @external Viz | ||
var _super = _createSuper(Priestley); | ||
/** | ||
@@ -57,3 +63,3 @@ @memberof Priestley | ||
_this = _possibleConstructorReturn(this, _getPrototypeOf(Priestley).call(this)); | ||
_this = _super.call(this); | ||
_this._axis = new Axis().align("end").orient("bottom"); | ||
@@ -222,5 +228,3 @@ _this._axisConfig = { | ||
this._end = accessor(_); | ||
if (!this._aggs[_]) this._aggs[_] = function (a) { | ||
return max(a); | ||
}; | ||
if (!this._aggs[_]) this._aggs[_] = max; | ||
} | ||
@@ -267,5 +271,3 @@ return this; | ||
this._start = accessor(_); | ||
if (!this._aggs[_]) this._aggs[_] = function (a) { | ||
return min(a); | ||
}; | ||
if (!this._aggs[_]) this._aggs[_] = min; | ||
} | ||
@@ -272,0 +274,0 @@ return this; |
{ | ||
"name": "d3plus-priestley", | ||
"version": "0.3.5", | ||
"version": "0.4.0", | ||
"description": "A reusable Priestley timeline built on D3.", | ||
@@ -30,6 +30,6 @@ "main": "build/d3plus-priestley.js", | ||
"d3-scale": "^2.1.2", | ||
"d3plus-axis": "^0.4.18", | ||
"d3plus-common": "^0.6.60", | ||
"d3plus-shape": "^0.16.13", | ||
"d3plus-viz": "^0.12.50" | ||
"d3plus-axis": "^0.6.0", | ||
"d3plus-common": "^0.7.0", | ||
"d3plus-shape": "^0.17.0", | ||
"d3plus-viz": "^0.13.1" | ||
}, | ||
@@ -46,3 +46,3 @@ "scripts": { | ||
"devDependencies": { | ||
"d3plus-dev": "^0.7.4" | ||
"d3plus-dev": "^0.7.6" | ||
}, | ||
@@ -49,0 +49,0 @@ "module": "es/index", |
@@ -12,3 +12,3 @@ # d3plus-priestley | ||
```html | ||
<script src="https://d3plus.org/js/d3plus-priestley.v0.3.full.min.js"></script> | ||
<script src="https://d3plus.org/js/d3plus-priestley.v0.4.full.min.js"></script> | ||
``` | ||
@@ -121,2 +121,2 @@ | ||
###### <sub>Documentation generated on Tue, 03 Mar 2020 17:19:17 GMT</sub> | ||
###### <sub>Documentation generated on Tue, 14 Jul 2020 21:42:12 GMT</sub> |
Sorry, the diff of this file is not supported yet
101593
1447
+ Addedd3plus-axis@0.6.3(transitive)
+ Addedd3plus-color@0.7.0(transitive)
+ Addedd3plus-common@0.7.0(transitive)
+ Addedd3plus-form@0.3.0(transitive)
+ Addedd3plus-legend@0.9.3(transitive)
+ Addedd3plus-shape@0.17.0(transitive)
+ Addedd3plus-text@0.10.1(transitive)
+ Addedd3plus-timeline@0.5.0(transitive)
+ Addedd3plus-tooltip@0.4.0(transitive)
+ Addedd3plus-viz@0.13.5(transitive)
- Removedd3plus-axis@0.4.190.5.4(transitive)
- Removedd3plus-color@0.6.7(transitive)
- Removedd3plus-common@0.6.61(transitive)
- Removedd3plus-form@0.2.8(transitive)
- Removedd3plus-legend@0.8.35(transitive)
- Removedd3plus-shape@0.16.16(transitive)
- Removedd3plus-text@0.9.52(transitive)
- Removedd3plus-timeline@0.4.13(transitive)
- Removedd3plus-tooltip@0.3.14(transitive)
- Removedd3plus-viz@0.12.58(transitive)
Updatedd3plus-axis@^0.6.0
Updatedd3plus-common@^0.7.0
Updatedd3plus-shape@^0.17.0
Updatedd3plus-viz@^0.13.1