@d3fc/d3fc-series
Advanced tools
Comparing version 4.3.7 to 4.3.8
@@ -1,2 +0,2 @@ | ||
(function(e,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports,require("d3-shape"),require("d3-selection"),require("d3-scale"),require("d3-path"),require("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-shape","d3-selection","d3-scale","d3-path","d3-array"],a):(e=e||self,a(e.fc=e.fc||{},e.d3,e.d3,e.d3,e.d3,e.d3))})(this,function(e,a,t,n,l,r){'use strict';var u=Math.max,f=Math.min,p=Math.abs;function o(){var e=arguments;return function(a,t){for(var n=0,l=e.length;n<l;n++)if(null==e[n](a,t))return!1;return!0}}function h(e){return c(e)||s(e)||g()}function c(e){if(Array.isArray(e)){for(var a=0,t=Array(e.length);a<e.length;a++)t[a]=e[a];return t}}function s(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function g(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var y="default"in a?a["default"]:a,m="default"in n?n["default"]:n;const x=1e-6;var S=(e,a)=>{e=e||"g";let t=(e,a)=>a,n=null;const l=function(l,i){i=i||(e=>e);const d=l.selection?l:null;d&&(l=l.selection());const r=l.selectAll((e,a,t)=>Array.from(t[a].childNodes).filter(e=>1===e.nodeType)).filter(null==a?e:`${e}.${a}`);let o=r.data(i,t);const h=o.enter().append(e).attr("class",a);let c=o.exit();o=o.merge(h);const s=d||n;return s&&(o=o.transition(s).style("opacity",1),h.style("opacity",x),c=c.transition(s).style("opacity",x)),c.remove(),o.enter=()=>h,o.exit=()=>c,o};return l.element=(...a)=>a.length?(e=a[0],l):e,l.className=(...e)=>e.length?(a=e[0],l):a,l.key=(...e)=>e.length?(t=e[0],l):t,l.transition=(...e)=>e.length?(n=e[0],l):n,l},v=(e,a,t)=>{const n=a[t];if("function"!=typeof n)throw new Error(`Attempt to rebind ${t} which isn't a function on the source object`);return(...t)=>{var l=n.apply(a,t);return l===a?e:l}},b=(e,a,...t)=>{for(const n of t)e[n]=v(e,a,n);return e};const w=e=>a=>e.reduce((e,a)=>e&&a(e),a);var V=(e,a,...t)=>{const n=w(t);for(const l of Object.keys(a)){const t=n(l);t&&(e[t]=v(e,a,l))}return e},T=e=>e.map(e=>"string"==typeof e?new RegExp(`^${e}$`):e),A=(...e)=>(e=T(e),a=>e.every(e=>!e.test(a))&&a),B=e=>a=>e[a],E=function(e){return"function"==typeof e?e:function(){return e}},P=function(e,a){return"left"===e?a/2:"right"===e?-a/2:0},k=function(e){var a=Object.assign({},e),t=function(){};return Object.keys(a).forEach(function(e){t[e]=function(){return arguments.length?(a[e]=0>=arguments.length?void 0:arguments[0],t):a[e]}}),t},I=function(){var e=function(){return 0},a=function(e){return e.x},t=function(e){return e.y},l="center",r=function(){return 5},h="vertical",c=k({decorate:function(){},defined:function(n,l){return o(e,a,t)(n,l)},xScale:n.scaleIdentity(),yScale:n.scaleIdentity()});return c.values=function(n,d){var i=r(n,d),o=P(l,i),s=c.xScale(),g=c.yScale();if("vertical"===h){var u=g(t(n,d),d),f=g(e(n,d),d),p=s(a(n,d),d)+o;return{d:n,x:p,y:u,y0:f,width:i,height:u-f,origin:[p,u],baseOrigin:[p,f],transposedX:p,transposedY:u}}var y=s(t(n,d),d),m=s(e(n,d),d),x=g(a(n,d),d)+o;return{d:n,x:x,y:y,y0:m,width:i,height:y-m,origin:[y,x],baseOrigin:[m,x],transposedX:y,transposedY:x}},c.xValues=function(){return"vertical"===h?[a]:[e,t]},c.yValues=function(){return"vertical"===h?[e,t]:[a]},c.baseValue=function(){return arguments.length?(e=E(0>=arguments.length?void 0:arguments[0]),c):e},c.crossValue=function(){return arguments.length?(a=E(0>=arguments.length?void 0:arguments[0]),c):a},c.mainValue=function(){return arguments.length?(t=E(0>=arguments.length?void 0:arguments[0]),c):t},c.bandwidth=function(){return arguments.length?(r=E(0>=arguments.length?void 0:arguments[0]),c):r},c.align=function(){return arguments.length?(l=0>=arguments.length?void 0:arguments[0],c):l},c.orient=function(){return arguments.length?(h=0>=arguments.length?void 0:arguments[0],c):h},c},C={red:"#c60",green:"#6c0",black:"#000",gray:"#ddd",darkGray:"#999"},H=function(){var e=I(),n=a.line().x(function(a,t){return e.values(a,t).transposedX}).y(function(a,t){return e.values(a,t).transposedY}),l=S("path","line"),i=function(a){a.selection&&l.transition(a),n.defined(e.defined()),a.each(function(a,i,d){var r=l(t.select(d[i]),[a]);r.enter().attr("fill","none").attr("stroke",C.black),r.attr("d",n),e.decorate()(r,a,i)})};return V(i,e,A("baseValue","bandwidth","align")),b(i,l,"key"),b(i,n,"curve"),i},R=function(){var e=I(),t=a.line().x(function(a,t){return e.values(a,t).transposedX}).y(function(a,t){return e.values(a,t).transposedY}),n=function(a){var n=t.context();n.beginPath(),n.strokeStyle=C.black,n.fillStyle="transparent",e.decorate()(n,a),t.defined(e.defined())(a),n.fill(),n.stroke(),n.closePath()};return V(n,e,A("baseValue","bandwidth","align")),b(n,t,"curve","context"),n},L=()=>{const e={},a={},t=(t,n,l,i)=>{Object.keys(e).forEach(a=>{e[a](t,n,a,l,i)}),Object.keys(a).forEach(e=>{a[e](t,n,e)})};return t.attribute=(...a)=>1===a.length?e[a[0]]:(e[a[0]]=a[1],t),t.uniform=(...e)=>1===e.length?a[e[0]]:(a[e[0]]=e[1],t),t};const Q={FLOAT:5126};var z=()=>{let e=null,a=1,t=Q.FLOAT,n=!1,l=0,i=0;const d=(a,t,n)=>{null==e&&(e=a.createBuffer()),a.bindBuffer(a.ARRAY_BUFFER,e);const l=a.getAttribLocation(t,n);a.vertexAttribPointer(l,d.size(),d.type(),d.normalized(),d.stride(),d.offset()),a.enableVertexAttribArray(l)};return d.buffer=(...a)=>a.length?(e=a[0],d):e,d.size=(...e)=>e.length?(a=e[0],d):a,d.type=(...e)=>e.length?(t=e[0],d):t,d.normalized=(...e)=>e.length?(n=e[0],d):n,d.stride=(...e)=>e.length?(l=e[0],d):l,d.offset=(...e)=>e.length?(i=e[0],d):i,d},W=()=>{const e=z();let a=(e,a,t,n,l)=>e[l],t=null,n=0;const l=(n,l)=>{const i=e.size(),d=e.offset(),r=new Float32Array(d+n*l*i);let o=0;for(let e=0;e<n;e++)for(let n=0;n<l;n++)for(let l=0;l<i;l++)r[d+o++]=a(t,e,n,l,o);return r},i=(a,t,i,d,r)=>{if(!(n>=r)){const o=l(r,d);e(a,t,i),a.bindBuffer(a.ARRAY_BUFFER,e.buffer()),a.bufferData(a.ARRAY_BUFFER,o,a.DYNAMIC_DRAW),n=r}};return i.value=(...e)=>e.length?(a=e[0],n=0,i):a,i.data=(...e)=>e.length?(t=e[0],n=0,i):t,V(i,e,A("buffer")),i},N=e=>{let a=e,t=!0,n=(e,t,n)=>{const l=e.getUniformLocation(t,n);if(a instanceof Array)switch(a.length){case 1:e.uniform1fv(l,a);break;case 2:e.uniform2fv(l,a);break;case 3:e.uniform3fv(l,a);break;case 4:e.uniform4fv(l,a);break;default:throw new Error(`Uniform supports up to 4 elements. ${a.length} provided.`);}else e.uniform1f(l,a)};const l=(e,a,l)=>{t&&(t=!1,n(e,a,l))};return l.bind=(...e)=>e.length?(n=e[0],l):n,l.data=(...e)=>e.length?(a=e[0],t=!0,l):a,l},Y=e=>{function a(e,a){e.push(a)}function t(e,a,t){const n=e.indexOf(t);e.splice(0<=n?n:e.length,0,a)}function n(e,a){const t=e.indexOf(a);-1===t&&e.push(a)}const l=[],i=[],d=()=>e(l.join("\n"),i.join("\n"));return d.appendHeader=e=>(a(l,e),d),d.insertHeader=(e,a)=>(t(l,e,a),d),d.appendHeaderIfNotExists=e=>(n(l,e),d),d.appendBody=e=>(a(i,e),d),d.insertBody=(e,a)=>(t(i,e,a),d),d.appendBodyIfNotExists=e=>(n(i,e),d),d};const G=(e,a)=>` | ||
(function(e,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports,require("d3-shape"),require("d3-selection"),require("d3-scale"),require("d3-path"),require("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-shape","d3-selection","d3-scale","d3-path","d3-array"],a):(e=e||self,a(e.fc=e.fc||{},e.d3,e.d3,e.d3,e.d3,e.d3))})(this,function(e,a,t,n,l,r){'use strict';var u=Math.max,f=Math.min,p=Math.abs;function o(){var e=arguments;return function(a,t){for(var n=0,l=e.length;n<l;n++)if(null==e[n](a,t))return!1;return!0}}function h(e){return c(e)||s(e)||g()}function c(e){if(Array.isArray(e)){for(var a=0,t=Array(e.length);a<e.length;a++)t[a]=e[a];return t}}function s(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function g(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var y="default"in a?a["default"]:a,m="default"in n?n["default"]:n;const S=1e-6;var v=(e,a)=>{e=e||"g";let t=(e,a)=>a,n=null;const l=function(l,i){i=i||(e=>e);const d=l.selection?l:null;d&&(l=l.selection());const r=l.selectAll((e,a,t)=>Array.from(t[a].childNodes).filter(e=>1===e.nodeType)).filter(null==a?e:`${e}.${a}`);let o=r.data(i,t);const h=o.enter().append(e).attr("class",a);let c=o.exit();o=o.merge(h);const s=d||n;return s&&(o=o.transition(s).style("opacity",1),h.style("opacity",S),c=c.transition(s).style("opacity",S)),c.remove(),o.enter=()=>h,o.exit=()=>c,o};return l.element=(...a)=>a.length?(e=a[0],l):e,l.className=(...e)=>e.length?(a=e[0],l):a,l.key=(...e)=>e.length?(t=e[0],l):t,l.transition=(...e)=>e.length?(n=e[0],l):n,l},x=(e,a,t)=>{const n=a[t];if("function"!=typeof n)throw new Error(`Attempt to rebind ${t} which isn't a function on the source object`);return(...t)=>{var l=n.apply(a,t);return l===a?e:l}},b=(e,a,...t)=>{for(const n of t)e[n]=x(e,a,n);return e};const w=e=>a=>e.reduce((e,a)=>e&&a(e),a);var V=(e,a,...t)=>{const n=w(t);for(const l of Object.keys(a)){const t=n(l);t&&(e[t]=x(e,a,l))}return e},T=e=>e.map(e=>"string"==typeof e?new RegExp(`^${e}$`):e),A=(...e)=>(e=T(e),a=>e.every(e=>!e.test(a))&&a),B=e=>a=>e[a],E=function(e){return"function"==typeof e?e:function(){return e}},P=function(e,a){return"left"===e?a/2:"right"===e?-a/2:0},k=function(e){var a=Object.assign({},e),t=function(){};return Object.keys(a).forEach(function(e){t[e]=function(){return arguments.length?(a[e]=0>=arguments.length?void 0:arguments[0],t):a[e]}}),t},I=function(){var e=function(){return 0},a=function(e){return e.x},t=function(e){return e.y},l="center",r=function(){return 5},h="vertical",c=k({decorate:function(){},defined:function(n,l){return o(e,a,t)(n,l)},xScale:n.scaleIdentity(),yScale:n.scaleIdentity()});return c.values=function(n,d){var i=r(n,d),o=P(l,i),s=c.xScale(),g=c.yScale();if("vertical"===h){var u=g(t(n,d),d),f=g(e(n,d),d),p=s(a(n,d),d)+o;return{d:n,x:p,y:u,y0:f,width:i,height:u-f,origin:[p,u],baseOrigin:[p,f],transposedX:p,transposedY:u}}var y=s(t(n,d),d),m=s(e(n,d),d),S=g(a(n,d),d)+o;return{d:n,x:S,y:y,y0:m,width:i,height:y-m,origin:[y,S],baseOrigin:[m,S],transposedX:y,transposedY:S}},c.xValues=function(){return"vertical"===h?[a]:[e,t]},c.yValues=function(){return"vertical"===h?[e,t]:[a]},c.baseValue=function(){return arguments.length?(e=E(0>=arguments.length?void 0:arguments[0]),c):e},c.crossValue=function(){return arguments.length?(a=E(0>=arguments.length?void 0:arguments[0]),c):a},c.mainValue=function(){return arguments.length?(t=E(0>=arguments.length?void 0:arguments[0]),c):t},c.bandwidth=function(){return arguments.length?(r=E(0>=arguments.length?void 0:arguments[0]),c):r},c.align=function(){return arguments.length?(l=0>=arguments.length?void 0:arguments[0],c):l},c.orient=function(){return arguments.length?(h=0>=arguments.length?void 0:arguments[0],c):h},c},z={red:"#c60",green:"#6c0",black:"#000",gray:"#ddd",darkGray:"#999"},C=function(){var e=I(),n=a.line().x(function(a,t){return e.values(a,t).transposedX}).y(function(a,t){return e.values(a,t).transposedY}),l=v("path","line"),i=function(a){a.selection&&l.transition(a),n.defined(e.defined()),a.each(function(a,i,d){var r=l(t.select(d[i]),[a]);r.enter().attr("fill","none").attr("stroke",z.black),r.attr("d",n),e.decorate()(r,a,i)})};return V(i,e,A("baseValue","bandwidth","align")),b(i,l,"key"),b(i,n,"curve"),i},H=function(){var e=I(),t=a.line().x(function(a,t){return e.values(a,t).transposedX}).y(function(a,t){return e.values(a,t).transposedY}),n=function(a){var n=t.context();n.beginPath(),n.strokeStyle=z.black,n.fillStyle="transparent",e.decorate()(n,a),t.defined(e.defined())(a),n.fill(),n.stroke(),n.closePath()};return V(n,e,A("baseValue","bandwidth","align")),b(n,t,"curve","context"),n},R=()=>{const e={},a={},t=(t,n,l,i)=>{Object.keys(e).forEach(a=>{e[a](t,n,a,l,i)}),Object.keys(a).forEach(e=>{a[e](t,n,e)})};return t.attribute=(...a)=>1===a.length?e[a[0]]:(e[a[0]]=a[1],t),t.uniform=(...e)=>1===e.length?a[e[0]]:(a[e[0]]=e[1],t),t};const L={FLOAT:5126};var Q=()=>{let e=null,a=1,t=L.FLOAT,n=!1,l=0,i=0,d=0;const r=(a,t,n)=>{null!=e&&a.isBuffer(e)||(e=a.createBuffer(),d=0),a.bindBuffer(a.ARRAY_BUFFER,e);const l=a.getAttribLocation(t,n);a.vertexAttribPointer(l,r.size(),r.type(),r.normalized(),r.stride(),r.offset()),a.enableVertexAttribArray(l)};return r.validSize=(...e)=>e.length?(d=e[0],r):d,r.buffer=(...a)=>a.length?(e=a[0],d=0,r):e,r.size=(...e)=>e.length?(a=e[0],d=0,r):a,r.type=(...e)=>e.length?(t=e[0],d=0,r):t,r.normalized=(...e)=>e.length?(n=e[0],d=0,r):n,r.stride=(...e)=>e.length?(l=e[0],d=0,r):l,r.offset=(...e)=>e.length?(i=e[0],d=0,r):i,r},W=()=>{const e=Q();let a=(e,a,t,n,l)=>e[l],t=null;const n=(n,l)=>{const i=e.size(),d=e.offset(),r=new Float32Array(d+n*l*i);let o=0;for(let e=0;e<n;e++)for(let n=0;n<l;n++)for(let l=0;l<i;l++)r[d+o++]=a(t,e,n,l,o);return r},l=(a,t,l,i,d)=>{if(e(a,t,l),!(e.validSize()>=d)){const t=n(d,i);a.bindBuffer(a.ARRAY_BUFFER,e.buffer()),a.bufferData(a.ARRAY_BUFFER,t,a.DYNAMIC_DRAW),e.validSize(d)}};return l.value=(...t)=>t.length?(a=t[0],e.validSize(0),l):a,l.data=(...a)=>a.length?(t=a[0],e.validSize(0),l):t,V(l,e,A("buffer")),l},N=e=>{let a=e,t=!0,n=(e,t,n)=>{const l=e.getUniformLocation(t,n);if(a instanceof Array)switch(a.length){case 1:e.uniform1fv(l,a);break;case 2:e.uniform2fv(l,a);break;case 3:e.uniform3fv(l,a);break;case 4:e.uniform4fv(l,a);break;default:throw new Error(`Uniform supports up to 4 elements. ${a.length} provided.`);}else e.uniform1f(l,a)};const l=(e,a,l)=>{t&&(t=!1,n(e,a,l))};return l.bind=(...e)=>e.length?(n=e[0],l):n,l.data=(...e)=>e.length?(a=e[0],t=!0,l):a,l},Y=e=>{function a(e,a){e.push(a)}function t(e,a,t){const n=e.indexOf(t);e.splice(0<=n?n:e.length,0,a)}function n(e,a){const t=e.indexOf(a);-1===t&&e.push(a)}const l=[],i=[],d=()=>e(l.join("\n"),i.join("\n"));return d.appendHeader=e=>(a(l,e),d),d.insertHeader=(e,a)=>(t(l,e,a),d),d.appendHeaderIfNotExists=e=>(n(l,e),d),d.appendBody=e=>(a(i,e),d),d.insertBody=(e,a)=>(t(i,e,a),d),d.appendBodyIfNotExists=e=>(n(i,e),d),d};const G=(e,a)=>` | ||
precision mediump float; | ||
@@ -16,3 +16,3 @@ float inf = 1.0 / 0.0; | ||
Fragment Shader : ${a}`)}return d}function t(e,a){const t=n.createShader(a);if(n.shaderSource(t,e),n.compileShader(t),!n.getShaderParameter(t,n.COMPILE_STATUS)){const a=n.getShaderInfoLog(t);throw n.deleteShader(t),new Error(`Failed to compile shader : ${a} | ||
Shader : ${e}`)}return t}let n=null,l=null,i=null,d=null,r=_.TRIANGLES,o=L(),h=1;const c=t=>{const c=i(),s=d();e(l,c,s)&&(n.isProgram(l)&&n.deleteProgram(l),l=a(c,s)),n.useProgram(l),o.uniform("uScreen",N([n.canvas.width,n.canvas.height])),o(n,l,h,t),n.drawArrays(r,0,t*h)};return c.context=(...e)=>e.length?(n=e[0],c):n,c.buffers=(...e)=>e.length?(o=e[0],c):o,c.vertexShader=(...e)=>e.length?(i=e[0],c):i,c.fragmentShader=(...e)=>e.length?(d=e[0],c):d,c.mode=(...e)=>e.length?(r=e[0],c):r,c.verticesPerElement=(...e)=>e.length?(h=e[0],c):h,c},D=()=>{let e=[0,1],a=[-1,1],t=0;const n=()=>{};return n.domain=(...a)=>a.length?(e=a[0],n):e,n.range=(...e)=>e.length?(a=e[0],n):a,n.coordinate=(...e)=>e.length?(t=e[0],n):t,n},X=()=>{function e(e){e.vertexShader().appendHeader(`uniform vec4 ${t()}Offset;`).appendHeader(`uniform vec4 ${t()}Scale;`),n.scaleComponent(e,"gl_Position")}const a=D(),t=()=>`linear${a.coordinate()}`,n=n=>{e(n);const l=a.domain()[1]-a.domain()[0],i=a.range()[1]-a.range()[0],d=a.range()[0]*(l/i)-a.domain()[0],r=[0,0,0,0],o=[1,1,1,1];r[a.coordinate()]=d,o[a.coordinate()]=i/l,n.buffers().uniform(`${t()}Offset`,N(r)).uniform(`${t()}Scale`,N(o))};return n.scaleComponent=(e,a)=>(e.vertexShader().appendBody(`${a} = ${a} + ${t()}Offset;`).appendBody(`${a} = ${a} * ${t()}Scale;`),n),V(n,a),n},U=()=>{function e(e,a){var t=Math.log10;return t(e)/t(a)}function a(e){e.vertexShader().appendHeader(`uniform vec4 ${l()}Offset;`).appendHeader(`uniform vec4 ${l()}Scale;`).appendHeader(`uniform vec4 ${l()}Include;`).appendHeader(`uniform float ${l()}Base;`),i.scaleComponent(e,"gl_Position")}const t=D();let n=10;const l=()=>`log${t.coordinate()}`,i=i=>{a(i);const d=e(t.domain()[1],n)-e(t.domain()[0],n),r=t.range()[1]-t.range()[0],o=r/d,h=t.range()[0]-o*e(t.domain()[0],n),c=[0,0,0,0],s=[0,0,0,0],g=[0,0,0,0];c[t.coordinate()]=h,s[t.coordinate()]=o,g[t.coordinate()]=1,i.buffers().uniform(`${l()}Offset`,N(c)).uniform(`${l()}Scale`,N(s)).uniform(`${l()}Include`,N(g)).uniform(`${l()}Base`,N(n))};return i.scaleComponent=(e,a)=>{const t=`${l()}Offset + (${l()}Scale * clamp(log(${a}) / log(${l()}Base), -inf, inf))`;return e.vertexShader().appendBody(`${a} = (${l()}Include * (${t})) + ((1.0 - ${l()}Include) * ${a});`),i},i.base=(...e)=>e.length?(n=e[0],i):n,V(i,t),i},M=()=>{function e(a,t){var e=Math.pow,n=Math.sign;return n(a)*e(p(a),t)}function a(e){e.vertexShader().appendHeader(`uniform vec4 ${l()}Offset;`).appendHeader(`uniform vec4 ${l()}Scale;`).appendHeader(`uniform vec4 ${l()}Include;`).appendHeader(`uniform float ${l()}Exp;`),i.scaleComponent(e,"gl_Position")}const t=D();let n=1;const l=()=>`pow${t.coordinate()}`,i=i=>{a(i);const d=e(t.domain()[1],n)-e(t.domain()[0],n),r=t.range()[1]-t.range()[0],o=r/d,h=t.range()[0]-o*e(t.domain()[0],n),c=[0,0,0,0],s=[0,0,0,0],g=[0,0,0,0];c[t.coordinate()]=h,s[t.coordinate()]=o,g[t.coordinate()]=1,i.buffers().uniform(`${l()}Offset`,N(c)).uniform(`${l()}Scale`,N(s)).uniform(`${l()}Include`,N(g)).uniform(`${l()}Exp`,N(n))};return i.scaleComponent=(e,a)=>{const t=`${l()}Offset + (${l()}Scale * sign(${a}) * pow(abs(gl_Position), vec4(${l()}Exp)))`;return e.vertexShader().appendBody(`${a} = (${l()}Include * (${t})) + ((1.0 - ${l()}Include) * ${a});`),i},i.exponent=(...e)=>e.length?(n=e[0],i):n,V(i,t),i},j=e=>{let a=m.scaleIdentity(),t=null;const n=e.copy.toString();return n===m.scaleLinear().copy.toString()?t=X().domain(e.domain()):n===m.scaleLog().copy.toString()?t=U().domain(e.domain()).base(e.base()):n===m.scalePow().copy.toString()?t=M().domain(e.domain()).exponent(e.exponent()):n===m.scaleTime().copy.toString()?t=X().domain(e.domain()):(t=X().domain(e.range()),a=e),{scale:a,glScale:t}};const q={header:`attribute float aXValue; | ||
Shader : ${e}`)}return t}let n=null,l=null,i=null,d=null,r=_.TRIANGLES,o=R(),h=1;const c=t=>{const c=i(),s=d();e(l,c,s)&&(n.isProgram(l)&&n.deleteProgram(l),l=a(c,s)),n.useProgram(l),o.uniform("uScreen",N([n.canvas.width,n.canvas.height])),o(n,l,h,t),n.drawArrays(r,0,t*h)};return c.context=(...e)=>e.length?(n=e[0],c):n,c.buffers=(...e)=>e.length?(o=e[0],c):o,c.vertexShader=(...e)=>e.length?(i=e[0],c):i,c.fragmentShader=(...e)=>e.length?(d=e[0],c):d,c.mode=(...e)=>e.length?(r=e[0],c):r,c.verticesPerElement=(...e)=>e.length?(h=e[0],c):h,c},D=()=>{let e=[0,1],a=[-1,1],t=0;const n=()=>{};return n.domain=(...a)=>a.length?(e=a[0],n):e,n.range=(...e)=>e.length?(a=e[0],n):a,n.coordinate=(...e)=>e.length?(t=e[0],n):t,n},X=()=>{function e(e){e.vertexShader().appendHeader(`uniform vec4 ${t()}Offset;`).appendHeader(`uniform vec4 ${t()}Scale;`),n.scaleComponent(e,"gl_Position")}const a=D(),t=()=>`linear${a.coordinate()}`,n=n=>{e(n);const l=a.domain()[1]-a.domain()[0],i=a.range()[1]-a.range()[0],d=a.range()[0]*(l/i)-a.domain()[0],r=[0,0,0,0],o=[1,1,1,1];r[a.coordinate()]=d,o[a.coordinate()]=i/l,n.buffers().uniform(`${t()}Offset`,N(r)).uniform(`${t()}Scale`,N(o))};return n.scaleComponent=(e,a)=>(e.vertexShader().appendBody(`${a} = ${a} + ${t()}Offset;`).appendBody(`${a} = ${a} * ${t()}Scale;`),n),V(n,a),n},U=()=>{function e(e,a){var t=Math.log10;return t(e)/t(a)}function a(e){e.vertexShader().appendHeader(`uniform vec4 ${l()}Offset;`).appendHeader(`uniform vec4 ${l()}Scale;`).appendHeader(`uniform vec4 ${l()}Include;`).appendHeader(`uniform float ${l()}Base;`),i.scaleComponent(e,"gl_Position")}const t=D();let n=10;const l=()=>`log${t.coordinate()}`,i=i=>{a(i);const d=e(t.domain()[1],n)-e(t.domain()[0],n),r=t.range()[1]-t.range()[0],o=r/d,h=t.range()[0]-o*e(t.domain()[0],n),c=[0,0,0,0],s=[0,0,0,0],g=[0,0,0,0];c[t.coordinate()]=h,s[t.coordinate()]=o,g[t.coordinate()]=1,i.buffers().uniform(`${l()}Offset`,N(c)).uniform(`${l()}Scale`,N(s)).uniform(`${l()}Include`,N(g)).uniform(`${l()}Base`,N(n))};return i.scaleComponent=(e,a)=>{const t=`${l()}Offset + (${l()}Scale * clamp(log(${a}) / log(${l()}Base), -inf, inf))`;return e.vertexShader().appendBody(`${a} = (${l()}Include * (${t})) + ((1.0 - ${l()}Include) * ${a});`),i},i.base=(...e)=>e.length?(n=e[0],i):n,V(i,t),i},M=()=>{function e(a,t){var e=Math.pow,n=Math.sign;return n(a)*e(p(a),t)}function a(e){e.vertexShader().appendHeader(`uniform vec4 ${l()}Offset;`).appendHeader(`uniform vec4 ${l()}Scale;`).appendHeader(`uniform vec4 ${l()}Include;`).appendHeader(`uniform float ${l()}Exp;`),i.scaleComponent(e,"gl_Position")}const t=D();let n=1;const l=()=>`pow${t.coordinate()}`,i=i=>{a(i);const d=e(t.domain()[1],n)-e(t.domain()[0],n),r=t.range()[1]-t.range()[0],o=r/d,h=t.range()[0]-o*e(t.domain()[0],n),c=[0,0,0,0],s=[0,0,0,0],g=[0,0,0,0];c[t.coordinate()]=h,s[t.coordinate()]=o,g[t.coordinate()]=1,i.buffers().uniform(`${l()}Offset`,N(c)).uniform(`${l()}Scale`,N(s)).uniform(`${l()}Include`,N(g)).uniform(`${l()}Exp`,N(n))};return i.scaleComponent=(e,a)=>{const t=`${l()}Offset + (${l()}Scale * sign(${a}) * pow(abs(gl_Position), vec4(${l()}Exp)))`;return e.vertexShader().appendBody(`${a} = (${l()}Include * (${t})) + ((1.0 - ${l()}Include) * ${a});`),i},i.exponent=(...e)=>e.length?(n=e[0],i):n,V(i,t),i},j=e=>{let a=m.scaleIdentity(),t=null;const n=e.copy.toString();return n===m.scaleLinear().copy.toString()?t=X().domain(e.domain()):n===m.scaleLog().copy.toString()?t=U().domain(e.domain()).base(e.base()):n===m.scalePow().copy.toString()?t=M().domain(e.domain()).exponent(e.exponent()):n===m.scaleTime().copy.toString()?t=X().domain(e.domain()):(t=X().domain(e.range()),a=e),{scale:a,glScale:t}};const q={header:`attribute float aXValue; | ||
attribute float aYValue; | ||
@@ -230,3 +230,3 @@ attribute float aSize; | ||
discard; | ||
}`};var pe=()=>{const e=Y(G),a=Y(F);return e.appendHeader(q.header).appendBody(q.body),a.appendHeader(re.header).appendBody(re.body),{vertex:()=>e,fragment:()=>a}},ye=()=>{const e=Y(G),a=Y(F);return e.appendHeader(K.header).appendBody(K.body),a.appendHeader(oe.header).appendBody(oe.body),{vertex:()=>e,fragment:()=>a}},me=()=>{const e=Y(G),a=Y(F);return e.appendHeader(Z.header).appendBody(Z.body),a.appendHeader(he.header).appendBody(he.body),{vertex:()=>e,fragment:()=>a}},xe=()=>{const e=Y(G),a=Y(F);return e.appendHeader($.header).appendBody($.body),a.appendHeader(ce.header).appendBody(ce.body),{vertex:()=>e,fragment:()=>a}},Se=e=>{switch(e){case y.symbolCircle:return pe();case y.symbolSquare:return ye();case y.symbolTriangle:return me();case y.symbolCross:return xe();default:throw new Error(`Unrecognised symbol: ${e}`);}},ve=()=>{let e=1;const a=a=>{a.buffers().uniform("uLineWidth",N(e))};return a.lineWidth=(...t)=>t.length?(e=t[0],a):e,a},be=()=>{const e=z();let a=(e,a)=>e[a],t=null,n=0;const l=(n,l)=>{const i=e.size(),d=e.offset(),r=new Float32Array(d+n*l*i);let o=0;for(let e=d;e<=r.length;e+=l*i)r.fill(a(t,o),e,e+l*i),o++;return r},i=(t,i,d,r,o)=>{if(!(n>=o)){if(e(t,i,d),"function"==typeof a){const a=l(o,r);t.bindBuffer(t.ARRAY_BUFFER,e.buffer()),t.bufferData(t.ARRAY_BUFFER,a,t.DYNAMIC_DRAW)}else if(!Array.isArray(a))throw new Error(`Expected function or array, received: ${a}`);else if(a.length===e.size()){const e=t.getAttribLocation(i,d);t[`vertexAttrib${a.length}fv`](e,a),t.disableVertexAttribArray(e)}else throw new Error(`Expected array of length: ${e.size()}, recieved array of length: ${a.length}`);n=o}};return i.value=(...e)=>e.length?(a=e[0],n=0,i):a,i.data=(...e)=>e.length?(t=e[0],n=0,i):t,V(i,e,A("buffer")),i},we=()=>{let e=D(),a=D(),t=pe(),n=()=>{};const l=be(),i=be(),d=be(),r=O().mode(_.POINTS);r.buffers().attribute("aXValue",l).attribute("aYValue",i).attribute("aSize",d);const o=l=>{r.vertexShader(t.vertex()).fragmentShader(t.fragment()),e.coordinate(0),e(r),a.coordinate(1),a(r),n(r),r(l)};return o.xValues=e=>(l.data(e),o),o.yValues=e=>(i.data(e),o),o.sizes=e=>(d.data(e),o),o.decorate=(...e)=>e.length?(n=e[0],o):n,o.xScale=(...a)=>a.length?(e=a[0],o):e,o.yScale=(...e)=>e.length?(a=e[0],o):a,o.type=(...e)=>e.length?(t=e[0],o):t,b(o,r,"context"),o},Ve=()=>{const e=Y(G),a=Y(F);return e.appendHeader(te.header).appendBody(te.body),a.appendHeader(fe.header).appendBody(fe.body),{vertex:()=>e,fragment:()=>a}},Te=()=>{let e=D(),a=D(),t=()=>{};const n=ve(),l=be(),i=be().value((e,a)=>e[f(a+1,e.length-1)]),d=be().value((e,a)=>e[u(a-1,0)]),r=be(),o=be().value((e,a)=>e[f(a+1,e.length-1)]),h=be().value((e,a)=>e[u(a-1,0)]),c=W().size(2).data([[-1,-1],[1,-1],[-1,1],[1,1]]).value((e,a,t,n)=>e[t][n]),s=W().value((e,a,t)=>{const n=e[a];if(1>=t){const t=0===a?n:e[a-1];return n?t:n}else{const t=a===e.length-1?n:e[a+1];return n?t:n}}),g=O().mode(_.TRIANGLE_STRIP).verticesPerElement(4);g.buffers().attribute("aXValue",l).attribute("aNextXValue",i).attribute("aPrevXValue",d).attribute("aYValue",r).attribute("aNextYValue",o).attribute("aPrevYValue",h).attribute("aCorner",c).attribute("aDefined",s);const p=l=>{const i=Ve();g.vertexShader(i.vertex()).fragmentShader(i.fragment()),e.coordinate(0),e(g),a.coordinate(1),a(g),e.scaleComponent(g,"next"),a.scaleComponent(g,"next"),e.scaleComponent(g,"prev"),a.scaleComponent(g,"prev"),g.vertexShader().appendBody(ne.body),n(g),t(g),g(l)};return p.xValues=e=>(l.data(e),i.data(e),d.data(e),p),p.yValues=e=>(r.data(e),o.data(e),h.data(e),p),p.defined=e=>(s.data(e),p),p.decorate=(...e)=>e.length?(t=e[0],p):t,p.xScale=(...a)=>a.length?(e=a[0],p):e,p.yScale=(...e)=>e.length?(a=e[0],p):a,b(p,g,"context"),b(p,n,"lineWidth"),p},Ae=()=>{const e=Y(G),a=Y(F);return e.appendHeader(ee.header).appendBody(ee.body),a.appendHeader(ge.header).appendBody(ge.body),{vertex:()=>e,fragment:()=>a}},Be=()=>{const e=O().verticesPerElement(18);let a=D(),t=D();const n=ve();let l=()=>{};const i=be(),d=be(),r=be(),o=be(),h=be(),c=be(),s=W().size(3).data([[0,-2,-1],[0,-2,1],[0,2,1],[0,-2,-1],[0,2,-1],[0,2,1],[-1,-1,-1],[-1,-1,1],[0,-1,1],[-1,-1,-1],[0,-1,-1],[0,-1,1],[1,1,1],[0,1,1],[0,1,-1],[0,1,-1],[1,1,-1],[1,1,1]]).value((e,a,t,n)=>e[t][n]),g=g=>{const u=Ae();e.vertexShader(u.vertex()).fragmentShader(u.fragment()).mode(_.TRIANGLES),e.buffers().attribute("aXValue",i).attribute("aHigh",d).attribute("aOpen",r).attribute("aClose",o).attribute("aLow",h).attribute("aBandwidth",c).attribute("aCorner",s),a.coordinate(0),a(e),t.coordinate(1),t(e),n(e),e.vertexShader().appendBody(` | ||
}`};var pe=()=>{const e=Y(G),a=Y(F);return e.appendHeader(q.header).appendBody(q.body),a.appendHeader(re.header).appendBody(re.body),{vertex:()=>e,fragment:()=>a}},ye=()=>{const e=Y(G),a=Y(F);return e.appendHeader(K.header).appendBody(K.body),a.appendHeader(oe.header).appendBody(oe.body),{vertex:()=>e,fragment:()=>a}},me=()=>{const e=Y(G),a=Y(F);return e.appendHeader(Z.header).appendBody(Z.body),a.appendHeader(he.header).appendBody(he.body),{vertex:()=>e,fragment:()=>a}},Se=()=>{const e=Y(G),a=Y(F);return e.appendHeader($.header).appendBody($.body),a.appendHeader(ce.header).appendBody(ce.body),{vertex:()=>e,fragment:()=>a}},ve=e=>{switch(e){case y.symbolCircle:return pe();case y.symbolSquare:return ye();case y.symbolTriangle:return me();case y.symbolCross:return Se();default:throw new Error(`Unrecognised symbol: ${e}`);}},xe=()=>{let e=1;const a=a=>{a.buffers().uniform("uLineWidth",N(e))};return a.lineWidth=(...t)=>t.length?(e=t[0],a):e,a},be=()=>{const e=Q();let a=(e,a)=>e[a],t=null;const n=(n,l)=>{const i=e.size(),d=e.offset(),r=new Float32Array(d+n*l*i);let o=0;for(let e=d;e<=r.length;e+=l*i)r.fill(a(t,o),e,e+l*i),o++;return r},l=(t,l,i,d,r)=>{if(e(t,l,i),!(e.validSize()>=r)){if("function"==typeof a){const a=n(r,d);t.bindBuffer(t.ARRAY_BUFFER,e.buffer()),t.bufferData(t.ARRAY_BUFFER,a,t.DYNAMIC_DRAW)}else if(!Array.isArray(a))throw new Error(`Expected function or array, received: ${a}`);else if(a.length===e.size()){const e=t.getAttribLocation(l,i);t[`vertexAttrib${a.length}fv`](e,a),t.disableVertexAttribArray(e)}else throw new Error(`Expected array of length: ${e.size()}, recieved array of length: ${a.length}`);e.validSize(r)}};return l.value=(...t)=>t.length?(a=t[0],e.validSize(0),l):a,l.data=(...a)=>a.length?(t=a[0],e.validSize(0),l):t,V(l,e,A("buffer")),l},we=()=>{let e=D(),a=D(),t=pe(),n=()=>{};const l=be(),i=be(),d=be(),r=O().mode(_.POINTS);r.buffers().attribute("aXValue",l).attribute("aYValue",i).attribute("aSize",d);const o=l=>{r.vertexShader(t.vertex()).fragmentShader(t.fragment()),e.coordinate(0),e(r),a.coordinate(1),a(r),n(r),r(l)};return o.xValues=e=>(l.data(e),o),o.yValues=e=>(i.data(e),o),o.sizes=e=>(d.data(e),o),o.decorate=(...e)=>e.length?(n=e[0],o):n,o.xScale=(...a)=>a.length?(e=a[0],o):e,o.yScale=(...e)=>e.length?(a=e[0],o):a,o.type=(...e)=>e.length?(t=e[0],o):t,b(o,r,"context"),o},Ve=()=>{const e=Y(G),a=Y(F);return e.appendHeader(te.header).appendBody(te.body),a.appendHeader(fe.header).appendBody(fe.body),{vertex:()=>e,fragment:()=>a}},Te=()=>{let e=D(),a=D(),t=()=>{};const n=xe(),l=be(),i=be().value((e,a)=>e[f(a+1,e.length-1)]),d=be().value((e,a)=>e[u(a-1,0)]),r=be(),o=be().value((e,a)=>e[f(a+1,e.length-1)]),h=be().value((e,a)=>e[u(a-1,0)]),c=W().size(2).data([[-1,-1],[1,-1],[-1,1],[1,1]]).value((e,a,t,n)=>e[t][n]),s=W().value((e,a,t)=>{const n=e[a];if(1>=t){const t=0===a?n:e[a-1];return n?t:n}else{const t=a===e.length-1?n:e[a+1];return n?t:n}}),g=O().mode(_.TRIANGLE_STRIP).verticesPerElement(4);g.buffers().attribute("aXValue",l).attribute("aNextXValue",i).attribute("aPrevXValue",d).attribute("aYValue",r).attribute("aNextYValue",o).attribute("aPrevYValue",h).attribute("aCorner",c).attribute("aDefined",s);const p=l=>{const i=Ve();g.vertexShader(i.vertex()).fragmentShader(i.fragment()),e.coordinate(0),e(g),a.coordinate(1),a(g),e.scaleComponent(g,"next"),a.scaleComponent(g,"next"),e.scaleComponent(g,"prev"),a.scaleComponent(g,"prev"),g.vertexShader().appendBody(ne.body),n(g),t(g),g(l)};return p.xValues=e=>(l.data(e),i.data(e),d.data(e),p),p.yValues=e=>(r.data(e),o.data(e),h.data(e),p),p.defined=e=>(s.data(e),p),p.decorate=(...e)=>e.length?(t=e[0],p):t,p.xScale=(...a)=>a.length?(e=a[0],p):e,p.yScale=(...e)=>e.length?(a=e[0],p):a,b(p,g,"context"),b(p,n,"lineWidth"),p},Ae=()=>{const e=Y(G),a=Y(F);return e.appendHeader(ee.header).appendBody(ee.body),a.appendHeader(ge.header).appendBody(ge.body),{vertex:()=>e,fragment:()=>a}},Be=()=>{const e=O().verticesPerElement(18);let a=D(),t=D();const n=xe();let l=()=>{};const i=be(),d=be(),r=be(),o=be(),h=be(),c=be(),s=W().size(3).data([[0,-2,-1],[0,-2,1],[0,2,1],[0,-2,-1],[0,2,-1],[0,2,1],[-1,-1,-1],[-1,-1,1],[0,-1,1],[-1,-1,-1],[0,-1,-1],[0,-1,1],[1,1,1],[0,1,1],[0,1,-1],[0,1,-1],[1,1,-1],[1,1,1]]).value((e,a,t,n)=>e[t][n]),g=g=>{const u=Ae();e.vertexShader(u.vertex()).fragmentShader(u.fragment()).mode(_.TRIANGLES),e.buffers().attribute("aXValue",i).attribute("aHigh",d).attribute("aOpen",r).attribute("aClose",o).attribute("aLow",h).attribute("aBandwidth",c).attribute("aCorner",s),a.coordinate(0),a(e),t.coordinate(1),t(e),n(e),e.vertexShader().appendBody(` | ||
gl_Position.x += xModifier / uScreen.x; | ||
@@ -236,11 +236,11 @@ gl_Position.y += yModifier / uScreen.y; | ||
gl_Position.x += xModifier / uScreen.x * 2.0; | ||
`),n(e),e(h)};return h.xValues=e=>(l.data(e),h),h.y0Values=e=>(d.data(e),h),h.yValues=e=>(i.data(e),h),h.widths=e=>(r.data(e),h),h.xScale=(...e)=>e.length?(a=e[0],h):a,h.yScale=(...e)=>e.length?(t=e[0],h):t,h.decorate=(...e)=>e.length?(n=e[0],h):n,b(h,e,"context"),h},ke=()=>{const e=Y(G),a=Y(F);return e.appendHeader(le.header).appendBody(le.body),{vertex:()=>e,fragment:()=>a}},Ie=()=>{const e=O().verticesPerElement(18);let a=D(),t=D();const n=ve(),l=be(),i=be(),d=be(),r=be(),o=W().size(3).data([[0,1,1],[0,1,-1],[0,-1,-1],[0,1,1],[0,-1,1],[0,-1,-1],[1,-1,1],[1,-1,-1],[-1,-1,-1],[1,-1,1],[-1,-1,1],[-1,-1,-1],[-1,1,-1],[-1,1,1],[1,1,1],[-1,1,-1],[1,1,-1],[1,1,1]]).value((e,a,t,n)=>e[t][n]),h=h=>{const c=ke();e.vertexShader(c.vertex()).fragmentShader(c.fragment()).mode(_.TRIANGLES),e.buffers().attribute("aXValue",l).attribute("aHighValue",i).attribute("aLowValue",d).attribute("aBandwidth",r).attribute("aCorner",o),a.coordinate(0),a(e),t.coordinate(1),t(e),n(e),e.vertexShader().appendBody(` | ||
`),n(e),e(h)};return h.xValues=e=>(l.data(e),h),h.y0Values=e=>(d.data(e),h),h.yValues=e=>(i.data(e),h),h.widths=e=>(r.data(e),h),h.xScale=(...e)=>e.length?(a=e[0],h):a,h.yScale=(...e)=>e.length?(t=e[0],h):t,h.decorate=(...e)=>e.length?(n=e[0],h):n,b(h,e,"context"),h},ke=()=>{const e=Y(G),a=Y(F);return e.appendHeader(le.header).appendBody(le.body),{vertex:()=>e,fragment:()=>a}},Ie=()=>{const e=O().verticesPerElement(18);let a=D(),t=D();const n=xe(),l=be(),i=be(),d=be(),r=be(),o=W().size(3).data([[0,1,1],[0,1,-1],[0,-1,-1],[0,1,1],[0,-1,1],[0,-1,-1],[1,-1,1],[1,-1,-1],[-1,-1,-1],[1,-1,1],[-1,-1,1],[-1,-1,-1],[-1,1,-1],[-1,1,1],[1,1,1],[-1,1,-1],[1,1,-1],[1,1,1]]).value((e,a,t,n)=>e[t][n]),h=h=>{const c=ke();e.vertexShader(c.vertex()).fragmentShader(c.fragment()).mode(_.TRIANGLES),e.buffers().attribute("aXValue",l).attribute("aHighValue",i).attribute("aLowValue",d).attribute("aBandwidth",r).attribute("aCorner",o),a.coordinate(0),a(e),t.coordinate(1),t(e),n(e),e.vertexShader().appendBody(` | ||
gl_Position.x += xModifier / uScreen.x * 2.0; | ||
gl_Position.y += yModifier / uScreen.y * 2.0; | ||
`),e(h)};return h.xValues=e=>(l.data(e),h),h.highValues=e=>(i.data(e),h),h.lowValues=e=>(d.data(e),h),h.bandwidth=e=>(r.data(e),h),h.xScale=(...e)=>e.length?(a=e[0],h):a,h.yScale=(...e)=>e.length?(t=e[0],h):t,b(h,e,"context"),b(h,n,"lineWidth"),h},Ce=()=>{const e=Y(G),a=Y(F);return e.appendHeader(ie.header).appendBody(ie.body),a.appendHeader(ue.header).appendBody(ue.body),{vertex:()=>e,fragment:()=>a}},He=()=>{let e=D(),a=D(),t=()=>{};const n=be().value((e,a)=>e[f(a+1,e.length-1)]),l=be(),i=be().value((e,a)=>e[f(a+1,e.length-1)]),d=be(),r=be().value((e,a)=>e[f(a+1,e.length-1)]),o=be(),h=W().size(3).data([[0,0,0],[0,1,0],[1,1,1],[0,0,1],[1,0,0],[1,1,0]]).value((e,a,t,n)=>e[t][n]),c=W().value((e,a)=>{const t=e[a],n=a===e.length-1?0:e[a+1];return t?n:t}),s=O().mode(_.TRIANGLES).verticesPerElement(6);s.buffers().attribute("aXValue",n).attribute("aXPrevValue",l).attribute("aYValue",i).attribute("aYPrevValue",d).attribute("aY0Value",r).attribute("aY0PrevValue",o).attribute("aCorner",h).attribute("aDefined",c);const g=n=>{const l=Ce();s.vertexShader(l.vertex()).fragmentShader(l.fragment()),e.coordinate(0),e(s),a.coordinate(1),a(s),t(s),s(n-1)};return g.xValues=e=>(n.data(e),l.data(e),g),g.yValues=e=>(i.data(e),d.data(e),g),g.y0Values=e=>(r.data(e),o.data(e),g),g.defined=e=>(c.data(e),g),g.decorate=(...e)=>e.length?(t=e[0],g):t,g.xScale=(...a)=>a.length?(e=a[0],g):e,g.yScale=(...e)=>e.length?(a=e[0],g):a,b(g,s,"context"),g},Re=()=>{const e=Y(G),a=Y(F);return e.appendHeader(J.header).appendBody(J.body),a.appendHeader(se.header).appendBody(se.body),{vertex:()=>e,fragment:()=>a}},Le=()=>{const e=O().verticesPerElement(12);let a=D(),t=D();const n=ve();let l=()=>{};const i=be(),d=be(),r=be(),o=be(),h=be(),c=be(),s=W().size(3).data([[0,2,1],[0,2,-1],[0,-2,-1],[0,2,1],[0,-2,1],[0,-2,-1],[1,-1,0],[-1,-1,0],[-1,1,0],[1,-1,0],[1,1,0],[-1,1,0]]).value((e,a,t,n)=>e[t][n]),g=g=>{const u=Re();e.vertexShader(u.vertex()).fragmentShader(u.fragment()).mode(_.TRIANGLES),e.buffers().attribute("aXValue",i).attribute("aHigh",d).attribute("aOpen",r).attribute("aClose",o).attribute("aLow",h).attribute("aBandwidth",c).attribute("aCorner",s),a.coordinate(0),a(e),t.coordinate(1),t(e),n(e),e.vertexShader().appendBody(` | ||
`),e(h)};return h.xValues=e=>(l.data(e),h),h.highValues=e=>(i.data(e),h),h.lowValues=e=>(d.data(e),h),h.bandwidth=e=>(r.data(e),h),h.xScale=(...e)=>e.length?(a=e[0],h):a,h.yScale=(...e)=>e.length?(t=e[0],h):t,b(h,e,"context"),b(h,n,"lineWidth"),h},ze=()=>{const e=Y(G),a=Y(F);return e.appendHeader(ie.header).appendBody(ie.body),a.appendHeader(ue.header).appendBody(ue.body),{vertex:()=>e,fragment:()=>a}},Ce=()=>{let e=D(),a=D(),t=()=>{};const n=be().value((e,a)=>e[f(a+1,e.length-1)]),l=be(),i=be().value((e,a)=>e[f(a+1,e.length-1)]),d=be(),r=be().value((e,a)=>e[f(a+1,e.length-1)]),o=be(),h=W().size(3).data([[0,0,0],[0,1,0],[1,1,1],[0,0,1],[1,0,0],[1,1,0]]).value((e,a,t,n)=>e[t][n]),c=W().value((e,a)=>{const t=e[a],n=a===e.length-1?0:e[a+1];return t?n:t}),s=O().mode(_.TRIANGLES).verticesPerElement(6);s.buffers().attribute("aXValue",n).attribute("aXPrevValue",l).attribute("aYValue",i).attribute("aYPrevValue",d).attribute("aY0Value",r).attribute("aY0PrevValue",o).attribute("aCorner",h).attribute("aDefined",c);const g=n=>{const l=ze();s.vertexShader(l.vertex()).fragmentShader(l.fragment()),e.coordinate(0),e(s),a.coordinate(1),a(s),t(s),s(n-1)};return g.xValues=e=>(n.data(e),l.data(e),g),g.yValues=e=>(i.data(e),d.data(e),g),g.y0Values=e=>(r.data(e),o.data(e),g),g.defined=e=>(c.data(e),g),g.decorate=(...e)=>e.length?(t=e[0],g):t,g.xScale=(...a)=>a.length?(e=a[0],g):e,g.yScale=(...e)=>e.length?(a=e[0],g):a,b(g,s,"context"),g},He=()=>{const e=Y(G),a=Y(F);return e.appendHeader(J.header).appendBody(J.body),a.appendHeader(se.header).appendBody(se.body),{vertex:()=>e,fragment:()=>a}},Re=()=>{const e=O().verticesPerElement(12);let a=D(),t=D();const n=xe();let l=()=>{};const i=be(),d=be(),r=be(),o=be(),h=be(),c=be(),s=W().size(3).data([[0,2,1],[0,2,-1],[0,-2,-1],[0,2,1],[0,-2,1],[0,-2,-1],[1,-1,0],[-1,-1,0],[-1,1,0],[1,-1,0],[1,1,0],[-1,1,0]]).value((e,a,t,n)=>e[t][n]),g=g=>{const u=He();e.vertexShader(u.vertex()).fragmentShader(u.fragment()).mode(_.TRIANGLES),e.buffers().attribute("aXValue",i).attribute("aHigh",d).attribute("aOpen",r).attribute("aClose",o).attribute("aLow",h).attribute("aBandwidth",c).attribute("aCorner",s),a.coordinate(0),a(e),t.coordinate(1),t(e),n(e),e.vertexShader().appendBody(` | ||
gl_Position.x += xModifier / uScreen.x; | ||
gl_Position.y += yModifier / uScreen.y; | ||
`),l(e),e(g)};return g.xValues=e=>(i.data(e),g),g.openValues=e=>(r.data(e),g),g.highValues=e=>(d.data(e),g),g.lowValues=e=>(h.data(e),g),g.closeValues=e=>(o.data(e),g),g.bandwidth=e=>(c.data(e),g),g.decorate=(...e)=>e.length?(l=e[0],g):l,g.xScale=(...e)=>e.length?(a=e[0],g):a,g.yScale=(...e)=>e.length?(t=e[0],g):t,b(g,e,"context"),b(g,n,"lineWidth"),g},Qe=()=>{const e=Y(G),a=Y(F);return e.appendHeader(de.header).appendBody(de.body),{vertex:()=>e,fragment:()=>a}},ze=()=>{const e=O().verticesPerElement(54);let a=D(),t=D();const n=ve(),l=be(),i=W().data({median:null,upperQuartile:null,lowerQuartile:null,high:null,low:null}).value((e,a,t)=>[18,19,20,21,22,23].includes(t)?e.median[a]:[8,10,11,12,13,14,15,16,17,30,31,33,36,37,39].includes(t)?e.upperQuartile[a]:[24,25,26,27,28,29,32,34,35,38,40,41,42,43,45].includes(t)?e.lowerQuartile[a]:[0,1,2,3,4,5,6,7,9].includes(t)?e.high[a]:[44,46,47,48,49,50,51,52,53].includes(t)?e.low[a]:0),d=W().data([0,0,0,0,0,0,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,-1,1,1,-1,-1,1,-1,1,1,-1,-1,1,0,0,0,0,0,0]).value((e,a,t)=>e[t]),r=W().data([1,1,-1,1,-1,-1,-1,-1,1,-1,1,1,1,1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,1,-1,1,-1,-1,-1,-1,1,-1,1,1,1,1,-1,1,-1,-1]).value((e,a,t)=>e[t]),o=W().data({bandwidth:null,capWidth:null}).value((e,a,t)=>{if(5>=t||48<=t){const n=e.capWidth[a];return[0,3,4,48,51,52].includes(t)?-n:n}if(11<t&&42>t){const n=e.bandwidth[a];return[12,15,16,18,21,22,24,27,28,30,31,32,33,34,35].includes(t)?-n:n}return 0}),h=h=>{const c=Qe();e.vertexShader(c.vertex()).fragmentShader(c.fragment()).mode(_.TRIANGLES),e.buffers().attribute("aXValue",l).attribute("aYValue",i).attribute("aXDirection",d).attribute("aYDirection",r).attribute("aBandwidth",o),a.coordinate(0),a(e),t.coordinate(1),t(e),n(e),e.vertexShader().appendBody(` | ||
`),l(e),e(g)};return g.xValues=e=>(i.data(e),g),g.openValues=e=>(r.data(e),g),g.highValues=e=>(d.data(e),g),g.lowValues=e=>(h.data(e),g),g.closeValues=e=>(o.data(e),g),g.bandwidth=e=>(c.data(e),g),g.decorate=(...e)=>e.length?(l=e[0],g):l,g.xScale=(...e)=>e.length?(a=e[0],g):a,g.yScale=(...e)=>e.length?(t=e[0],g):t,b(g,e,"context"),b(g,n,"lineWidth"),g},Le=()=>{const e=Y(G),a=Y(F);return e.appendHeader(de.header).appendBody(de.body),{vertex:()=>e,fragment:()=>a}},Qe=()=>{const e=O().verticesPerElement(54);let a=D(),t=D();const n=xe(),l=be(),i=W().data({median:null,upperQuartile:null,lowerQuartile:null,high:null,low:null}).value((e,a,t)=>[18,19,20,21,22,23].includes(t)?e.median[a]:[8,10,11,12,13,14,15,16,17,30,31,33,36,37,39].includes(t)?e.upperQuartile[a]:[24,25,26,27,28,29,32,34,35,38,40,41,42,43,45].includes(t)?e.lowerQuartile[a]:[0,1,2,3,4,5,6,7,9].includes(t)?e.high[a]:[44,46,47,48,49,50,51,52,53].includes(t)?e.low[a]:0),d=W().data([0,0,0,0,0,0,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,-1,1,1,-1,-1,1,-1,1,1,-1,-1,1,0,0,0,0,0,0]).value((e,a,t)=>e[t]),r=W().data([1,1,-1,1,-1,-1,-1,-1,1,-1,1,1,1,1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,1,-1,1,-1,-1,-1,-1,1,-1,1,1,1,1,-1,1,-1,-1]).value((e,a,t)=>e[t]),o=W().data({bandwidth:null,capWidth:null}).value((e,a,t)=>{if(5>=t||48<=t){const n=e.capWidth[a];return[0,3,4,48,51,52].includes(t)?-n:n}if(11<t&&42>t){const n=e.bandwidth[a];return[12,15,16,18,21,22,24,27,28,30,31,32,33,34,35].includes(t)?-n:n}return 0}),h=h=>{const c=Le();e.vertexShader(c.vertex()).fragmentShader(c.fragment()).mode(_.TRIANGLES),e.buffers().attribute("aXValue",l).attribute("aYValue",i).attribute("aXDirection",d).attribute("aYDirection",r).attribute("aBandwidth",o),a.coordinate(0),a(e),t.coordinate(1),t(e),n(e),e.vertexShader().appendBody(` | ||
gl_Position.x += ((uLineWidth * aXDirection) + aBandwidth) / uScreen.x; | ||
gl_Position.y += (uLineWidth * aYDirection) / uScreen.y; | ||
`),e(h)};return h.xValues=e=>(l.data(e),h),h.medianValues=e=>{const a=i.data();return i.data({...a,median:e}),h},h.upperQuartileValues=e=>{const a=i.data();return i.data({...a,upperQuartile:e}),h},h.lowerQuartileValues=e=>{const a=i.data();return i.data({...a,lowerQuartile:e}),h},h.highValues=e=>{const a=i.data();return i.data({...a,high:e}),h},h.lowValues=e=>{const a=i.data();return i.data({...a,low:e}),h},h.bandwidth=e=>{const a=o.data();return o.data({...a,bandwidth:e}),h},h.capWidth=e=>{const a=o.data();return o.data({...a,capWidth:e}),h},h.xScale=(...e)=>e.length?(a=e[0],h):a,h.yScale=(...e)=>e.length?(t=e[0],h):t,b(h,e,"context"),b(h,n,"lineWidth"),h},We=e=>"function"==typeof e?e:()=>e,Ne=()=>{let e=null,a=e=>e.date,t=e=>e.open,n=e=>e.high,r=e=>e.low,o=e=>e.close,h="vertical",c=We(3);const s=function(i){const s=e||l.path();return i.forEach(function(e,l){const i=a(e,l),d=t(e,l),g=n(e,l),u=r(e,l),f=o(e,l),p=c(e,l)/2;"vertical"===h?(s.moveTo(i,u),s.lineTo(i,g),s.moveTo(i,d),s.lineTo(i-p,d),s.moveTo(i,f),s.lineTo(i+p,f)):(s.moveTo(u,i),s.lineTo(g,i),s.moveTo(d,i),s.lineTo(d,i+p),s.moveTo(f,i),s.lineTo(f,i-p))}),e?null:s.toString()};return s.context=(...a)=>a.length?(e=a[0],s):e,s.x=(...e)=>e.length?(a=We(e[0]),s):a,s.open=(...e)=>e.length?(t=We(e[0]),s):t,s.high=(...e)=>e.length?(n=We(e[0]),s):n,s.low=(...e)=>e.length?(r=We(e[0]),s):r,s.close=(...e)=>e.length?(o=We(e[0]),s):o,s.width=(...e)=>e.length?(c=We(e[0]),s):c,s.orient=(...e)=>e.length?(h=e[0],s):h,s},Ye=()=>{let e=null,a=e=>e.x,t=e=>e.y,n="center",i="center",r=e=>e.height,o=We(3);const h=function(d,h){const c=e||l.path();return d.forEach(function(e,l){const d=a.call(this,e,h||l),s=t.call(this,e,h||l),g=r.call(this,e,h||l),u=o.call(this,e,h||l);let f;switch(n){case"left":f=u;break;case"right":f=0;break;case"center":f=u/2;break;default:throw new Error("Invalid horizontal alignment "+n);}let p;switch(i){case"bottom":p=-g;break;case"top":p=0;break;case"center":p=g/2;break;default:throw new Error("Invalid vertical alignment "+i);}c.rect(d-f,s-p,u,g)},this),e?null:c.toString()};return h.context=(...a)=>a.length?(e=a[0],h):e,h.x=(...e)=>e.length?(a=We(e[0]),h):a,h.y=(...e)=>e.length?(t=We(e[0]),h):t,h.width=(...e)=>e.length?(o=We(e[0]),h):o,h.horizontalAlign=(...e)=>e.length?(n=e[0],h):n,h.height=(...e)=>e.length?(r=We(e[0]),h):r,h.verticalAlign=(...e)=>e.length?(i=e[0],h):i,h},Ge=()=>{let e=null,a=e=>e.date,t=e=>e.open,n=e=>e.high,r=e=>e.low,o=e=>e.close,h=We(3);const c=function(i){const c=e||l.path();return i.forEach(function(e,l){const i=a(e,l),d=t(e,l),s=n(e,l),g=r(e,l),p=o(e,l),y=h(e,l);c.rect(i-y/2,d,y,p-d),c.moveTo(i,f(p,d)),c.lineTo(i,s),c.moveTo(i,u(p,d)),c.lineTo(i,g)}),e?null:c.toString()};return c.context=(...a)=>a.length?(e=a[0],c):e,c.x=(...e)=>e.length?(a=We(e[0]),c):a,c.open=(...e)=>e.length?(t=We(e[0]),c):t,c.high=(...e)=>e.length?(n=We(e[0]),c):n,c.low=(...e)=>e.length?(r=We(e[0]),c):r,c.close=(...e)=>e.length?(o=We(e[0]),c):o,c.width=(...e)=>e.length?(h=We(e[0]),c):h,c},Fe=()=>{let e=null,a=e=>e.value,t=e=>e.median,n=e=>e.upperQuartile,r=e=>e.lowerQuartile,o=e=>e.high,h=e=>e.low,c="vertical",s=We(5),g=We(.5);const u=function(i){const u=e||l.path();return i.forEach(function(e,l){const i=a(e,l),d=s(e,l),f=d/2,p=d*g(e,l),y=p/2,m=o(e,l),x=n(e,l),S=t(e,l),v=r(e,l),b=h(e,l),w=v-x;"vertical"===c?(u.moveTo(i-y,m),u.lineTo(i+y,m),u.moveTo(i,m),u.lineTo(i,x),u.rect(i-f,x,d,w),u.moveTo(i-f,S),u.lineTo(i+f,S),u.moveTo(i,v),u.lineTo(i,b),u.moveTo(i-y,b),u.lineTo(i+y,b)):(u.moveTo(b,i-y),u.lineTo(b,i+y),u.moveTo(b,i),u.lineTo(v,i),u.rect(v,i-f,-w,d),u.moveTo(S,i-f),u.lineTo(S,i+f),u.moveTo(x,i),u.lineTo(m,i),u.moveTo(m,i-y),u.lineTo(m,i+y))}),e?null:u.toString()};return u.context=(...a)=>a.length?(e=a[0],u):e,u.value=(...e)=>e.length?(a=We(e[0]),u):a,u.median=(...e)=>e.length?(t=We(e[0]),u):t,u.upperQuartile=(...e)=>e.length?(n=We(e[0]),u):n,u.lowerQuartile=(...e)=>e.length?(r=We(e[0]),u):r,u.high=(...e)=>e.length?(o=We(e[0]),u):o,u.low=(...e)=>e.length?(h=We(e[0]),u):h,u.width=(...e)=>e.length?(s=We(e[0]),u):s,u.orient=(...e)=>e.length?(c=e[0],u):c,u.cap=(...e)=>e.length?(g=We(e[0]),u):g,u},_e=()=>{let e=null,a=e=>e.x,t=e=>e.high,n=e=>e.low,r="vertical",o=We(5);const h=function(i){const h=e||l.path();return i.forEach(function(e,l){const i=a(e,l),d=o(e,l),c=d/2,s=t(e,l),g=n(e,l);"vertical"===r?(h.moveTo(i-c,s),h.lineTo(i+c,s),h.moveTo(i,s),h.lineTo(i,g),h.moveTo(i-c,g),h.lineTo(i+c,g)):(h.moveTo(g,i-c),h.lineTo(g,i+c),h.moveTo(g,i),h.lineTo(s,i),h.moveTo(s,i-c),h.lineTo(s,i+c))}),e?null:h.toString()};return h.context=(...a)=>a.length?(e=a[0],h):e,h.value=(...e)=>e.length?(a=We(e[0]),h):a,h.high=(...e)=>e.length?(t=We(e[0]),h):t,h.low=(...e)=>e.length?(n=We(e[0]),h):n,h.width=(...e)=>e.length?(o=We(e[0]),h):o,h.orient=(...e)=>e.length?(r=e[0],h):r,h},Oe=function(){var e=function(e){return e.high},a=function(e){return e.low},t=function(e){return e.cross},l="vertical",r="center",h=function(){return 5},c=k({decorate:function(){},defined:function(n,l){return o(a,e,t)(n,l)},xScale:n.scaleIdentity(),yScale:n.scaleIdentity()});return c.values=function(n,d){var i=h(n,d),o=P(r,i),s=c.xScale(),g=c.yScale();if("vertical"===l){var u=g(e(n,d));return{origin:[s(t(n,d))+o,u],high:0,low:g(a(n,d))-u,width:i}}var f=s(a(n,d));return{origin:[f,g(t(n,d))+o],high:s(e(n,d))-f,low:0,width:i}},c.xValues=function(){return"vertical"===l?[t]:[e,a]},c.yValues=function(){return"vertical"===l?[e,a]:[t]},c.orient=function(){return arguments.length?(l=0>=arguments.length?void 0:arguments[0],c):l},c.lowValue=function(){return arguments.length?(a=E(0>=arguments.length?void 0:arguments[0]),c):a},c.highValue=function(){return arguments.length?(e=E(0>=arguments.length?void 0:arguments[0]),c):e},c.crossValue=function(){return arguments.length?(t=E(0>=arguments.length?void 0:arguments[0]),c):t},c.bandwidth=function(){return arguments.length?(h=E(0>=arguments.length?void 0:arguments[0]),c):h},c.align=function(){return arguments.length?(r=0>=arguments.length?void 0:arguments[0],c):r},c},De=function(){var e,a=function(e){return e.date},t=function(e){return e.open},l=function(e){return e.high},r=function(e){return e.low},h=function(e){return e.close},c=function(){return 5},s="center",g=function(t,n){return e.xScale()(a(t,n))};return e=k({decorate:function(){},defined:function(e,n){return o(a,t,r,l,h)(e,n)},xScale:n.scaleIdentity(),yScale:n.scaleIdentity()}),e.values=function(a,n){var i=h(a,n),d=t(a,n),o=c(a,n),u=P(s,o),f="";return i>d?f="up":i<d&&(f="down"),{cross:g(a,n)+u,open:e.yScale()(d),high:e.yScale()(l(a,n)),low:e.yScale()(r(a,n)),close:e.yScale()(i),width:o,direction:f}},e.xValues=function(){return[a]},e.yValues=function(){return[t,l,r,h]},e.crossValue=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],e):a},e.openValue=function(){return arguments.length?(t=0>=arguments.length?void 0:arguments[0],e):t},e.highValue=function(){return arguments.length?(l=0>=arguments.length?void 0:arguments[0],e):l},e.lowValue=function(){return arguments.length?(r=0>=arguments.length?void 0:arguments[0],e):r},e.yValue=e.closeValue=function(){return arguments.length?(h=0>=arguments.length?void 0:arguments[0],e):h},e.bandwidth=function(){return arguments.length?(c=E(0>=arguments.length?void 0:arguments[0]),e):c},e.align=function(){return arguments.length?(s=0>=arguments.length?void 0:arguments[0],e):s},e},Xe=function(e,a){var n=De(),l=S("g",a),r=function(e){return"translate("+e.cross+", "+e.high+")"},o=function(e){return function(a){return e.selection?a.transition(e):a}},h=function(i){i.selection&&l.transition(i);var h=o(i);i.each(function(i,d,o){var c=i.filter(n.defined()),s=l(t.select(o[d]),c);s.enter().attr("transform",function(e,a){return r(n.values(e,a))+" scale(1e-6, 1)"}).append("path"),s.each(function(l,d,i){var o=n.values(l,d),c="up"===o.direction?C.green:C.red,s=h(t.select(i[d])).attr("class",a+" "+o.direction).attr("stroke",c).attr("fill",c).attr("transform",function(){return r(o)+" scale(1)"});e.x(0).width(o.width).open(function(){return o.open-o.high}).high(0).low(function(){return o.low-o.high}).close(function(){return o.close-o.high}),s.select("path").attr("d",e([l]))}),n.decorate()(s,i,d)})};return b(h,l,"key"),V(h,n),h},Ue=function(e){var a=De(),t=function(t){var n=t.filter(a.defined()),l=e.context();n.forEach(function(t,n){l.save();var i=a.values(t,n);l.translate(i.cross,i.high),l.beginPath(),e.x(0).open(function(){return i.open-i.high}).width(i.width).high(0).low(function(){return i.low-i.high}).close(function(){return i.close-i.high})([t]);var d="up"===i.direction?C.green:C.red;l.strokeStyle=d,l.fillStyle=d,a.decorate()(l,t,n),l.fill(),l.stroke(),l.closePath(),l.restore()})};return b(t,e,"context"),V(t,a),t},Me=function(e){var a=De(),t=function(t){var n=t.filter(a.defined()),l=j(a.xScale()),r=j(a.yScale()),o=new Float32Array(n.length),h=new Float32Array(n.length),c=new Float32Array(n.length),s=new Float32Array(n.length),g=new Float32Array(n.length),u=new Float32Array(n.length);n.forEach(function(e,t){o[t]=l.scale(a.crossValue()(e,t)),h[t]=r.scale(a.openValue()(e,t)),c[t]=r.scale(a.highValue()(e,t)),s[t]=r.scale(a.lowValue()(e,t)),g[t]=r.scale(a.closeValue()(e,t)),u[t]=a.bandwidth()(e,t)}),e.xValues(o).openValues(h).highValues(c).lowValues(s).closeValues(g).bandwidth(u).xScale(l.glScale).yScale(r.glScale).decorate(function(e){return a.decorate()(e,n,0)}),e(n.length)};return V(t,a,A("align")),b(t,e,"context","lineWidth"),t},je=function(){var e=function(e){return e.upperQuartile},a=function(e){return e.lowerQuartile},t=function(e){return e.high},l=function(e){return e.low},r=function(e){return e.value},h=function(e){return e.median},c="vertical",s="center",g=function(){return 5},u=k({decorate:function(){},defined:function(n,d){return o(l,t,a,e,r,h)(n,d)},xScale:n.scaleIdentity(),yScale:n.scaleIdentity()});return u.values=function(n,d){var i=g(n,d),o=P(s,i),f=u.xScale(),p=u.yScale();if("vertical"===c){var m=p(t(n,d));return{origin:[f(r(n,d))+o,m],high:0,upperQuartile:p(e(n,d))-m,median:p(h(n,d))-m,lowerQuartile:p(a(n,d))-m,low:p(l(n,d))-m,width:i}}var y=f(l(n,d));return{origin:[y,p(r(n,d))+o],high:f(t(n,d))-y,upperQuartile:f(e(n,d))-y,median:f(h(n,d))-y,lowerQuartile:f(a(n,d))-y,low:0,width:i}},u.xValues=function(){return"vertical"===c?[r]:[e,a,t,l,h]},u.yValues=function(){return"vertical"===c?[e,a,t,l,h]:[r]},u.orient=function(){return arguments.length?(c=0>=arguments.length?void 0:arguments[0],u):c},u.lowerQuartileValue=function(){return arguments.length?(a=E(0>=arguments.length?void 0:arguments[0]),u):a},u.upperQuartileValue=function(){return arguments.length?(e=E(0>=arguments.length?void 0:arguments[0]),u):e},u.lowValue=function(){return arguments.length?(l=E(0>=arguments.length?void 0:arguments[0]),u):l},u.highValue=function(){return arguments.length?(t=E(0>=arguments.length?void 0:arguments[0]),u):t},u.crossValue=function(){return arguments.length?(r=E(0>=arguments.length?void 0:arguments[0]),u):r},u.medianValue=function(){return arguments.length?(h=E(0>=arguments.length?void 0:arguments[0]),u):h},u.bandwidth=function(){return arguments.length?(g=E(0>=arguments.length?void 0:arguments[0]),u):g},u.align=function(){return arguments.length?(s=0>=arguments.length?void 0:arguments[0],u):s},u},qe=function(){var e=[],a=function(e){return e},t=function(e,a){return a},l=k({decorate:function(){},xScale:n.scaleIdentity(),yScale:n.scaleIdentity()});return l.xValues=function(){return e.map(function(e){return e.xValues()}).reduce(function(e,a){return e.concat(a)})},l.yValues=function(){return e.map(function(e){return e.yValues()}).reduce(function(e,a){return e.concat(a)})},l.mapping=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],l):a},l.key=function(){return arguments.length?(t=0>=arguments.length?void 0:arguments[0],l):t},l.series=function(){return arguments.length?(e=0>=arguments.length?void 0:arguments[0],l):e},l},Ke=function(){var e=qe(),a=S("g"),n=S("g","multi"),l=function(l){l.selection&&(n.transition(l),a.transition(l));var i=e.mapping(),d=e.series(),r=e.xScale(),o=e.yScale();l.each(function(l,h,c){var s=n(t.select(c[h]),d);s.each(function(e,n,h){e.xScale(r).yScale(o);var c=i(l,n,d),s=a(t.select(h[n]),[c]);s.call(e)});var g=s.selection?s.selection():s;g.order(),e.decorate()(s,l,h)})};return V(l,e),b(l,n,"key"),l},Ze=function(){var e=null,a=qe(),t=function(t){var n=a.mapping(),l=a.series(),i=a.xScale(),d=a.yScale();l.forEach(function(r,o){var h=n(t,o,l);r.context(e).xScale(i).yScale(d);var s;r.decorate?(s=r.decorate(),r.decorate(function(e,n,l){a.decorate()(e,t,o),s(e,n,l)})):a.decorate()(e,t,o),r(h),s&&r.decorate(s)})};return t.context=function(){return arguments.length?(e=0>=arguments.length?void 0:arguments[0],t):e},V(t,a),t},$e=function(){var e=function(){return 50},a="center",t=n.scaleBand(),l=k({decorate:function(){},xScale:n.scaleLinear(),yScale:n.scaleLinear()});return l.offsetScaleForDatum=function(n,l,d){var i=e(l,d),o=P(a,i),h=i/2;return t.domain(r.range(0,n.length)).range([-h+o,h+o])},l.bandwidth=function(){return arguments.length?(e=E(0>=arguments.length?void 0:arguments[0]),l):e},l.align=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],l):a},V(l,t,B({paddingInner:"paddingOuter"})),l},Je=function(){var e="vertical",a=R(),t=Ze(),n=function(n){"vertical"===e?t.series(n[0].map(function(){return a})).mapping(function(e,a){return e.map(function(e){return e[a]})}):t.series(n.map(function(){return a})).mapping(function(e,a){return e[a]}),t(n)};return n.series=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],n):a},n.orient=function(){return arguments.length?(e=0>=arguments.length?void 0:arguments[0],n):e},V(n,t,A("series","mapping")),n},ea=function(e){return e.sort(r.ascending).filter(function(e,a,t){return-1===t.indexOf(e,a+1)})},aa=function(){var e=function(e){return e.x},a=function(e){return e.y},t=function(e){return e.color},l=function(){return 5},h=function(){return 5},c=n.interpolateViridis,s=k({decorate:function(){},defined:function(n,l){return o(e,a,t)(n,l)},xScale:n.scaleIdentity(),yScale:n.scaleIdentity()});return s.pathGenerator=Ye().x(0).y(0),s.colorScale=function(e){var a=e.map(t);return n.scaleLinear().domain([r.min(a),r.max(a)])},s.values=function(n,d){return{x:s.xScale()(e(n,d)),y:s.yScale()(a(n,d)),colorValue:t(n,d),width:h(n,d),height:l(n,d)}},s.xValues=function(){return[e]},s.yValues=function(){return[a]},s.xValue=function(){return arguments.length?(e=E(0>=arguments.length?void 0:arguments[0]),s):e},s.yValue=function(){return arguments.length?(a=E(0>=arguments.length?void 0:arguments[0]),s):a},s.colorValue=function(){return arguments.length?(t=E(0>=arguments.length?void 0:arguments[0]),s):t},s.colorInterpolate=function(){return arguments.length?(c=0>=arguments.length?void 0:arguments[0],s):c},s.xBandwidth=function(){return arguments.length?(h=E(0>=arguments.length?void 0:arguments[0]),s):h},s.yBandwidth=function(){return arguments.length?(l=E(0>=arguments.length?void 0:arguments[0]),s):l},V(s,s.pathGenerator,B({horizontalAlign:"xAlign",verticalAlign:"yAlign"})),s};e.autoBandwidth=function(e){var a=.75,n=function(e){if(1>=e.length)return 10;e=ea(e);var t=r.pairs(e).map(function(e){return p(e[0]-e[1])}),n=r.min(t);return a*n},l=function(a,t,l){if(a.bandwidth)return a.bandwidth();var i,d=Array.isArray(t)?(i=[]).concat.apply(i,h(t)):t,r=d.filter(e.defined()).map(l()).map(a),o=n(r);return o},i=function(a){var n=function(a){if(e.xBandwidth&&e.yBandwidth)e.xBandwidth(l(e.xScale(),a,e.xValue)),e.yBandwidth(l(e.yScale(),a,e.yValue));else{var t=e.orient&&"horizontal"===e.orient()?e.yScale():e.xScale();e.bandwidth(l(t,a,e.crossValue))}};a instanceof t.selection?a.each(function(a,l,i){n(a),e(t.select(i[l]))}):(n(a),e(a))};return V(i,e),i.widthFraction=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],i):a},i},e.seriesCanvasArea=function(){var e=I(),t=a.area(),n=function(a){var n=t.context();t.defined(e.defined());var l=a.map(e.values);t.x(function(e,a){return l[a].transposedX}).y(function(e,a){return l[a].transposedY});var i="vertical"===e.orient()?"y":"x";t[i+"0"](function(e,a){return l[a].y0}),t[i+"1"](function(e,a){return l[a].y}),n.beginPath(),n.fillStyle=C.gray,n.strokeStyle="transparent",e.decorate()(n,a),t(a),n.fill(),n.stroke(),n.closePath()};return V(n,e,A("bandwidth","align")),b(n,t,"curve","context"),n},e.seriesCanvasBar=function(){var e=I(),a=Ye().x(0).y(0),t=function(a){return"vertical"===e.orient()?a.height:a.width},n=function(a){return"vertical"===e.orient()?a.width:a.height},l=function(l){var d=a.context(),r=l.filter(e.defined()),o=r.map(e.values);"vertical"===e.orient()?(a.verticalAlign("top"),a.horizontalAlign("center")):(a.horizontalAlign("right"),a.verticalAlign("center")),o.forEach(function(l,r){d.save(),d.beginPath(),d.translate(l.origin[0],l.origin[1]),d.fillStyle=C.darkGray,d.strokeStyle="transparent",e.decorate()(d,l.d,r),t(a)(-l.height),n(a)(l.width),a([l]),d.fill(),d.stroke(),d.closePath(),d.restore()})};return V(l,e),b(l,a,"context"),l},e.seriesCanvasBoxPlot=function(){var e=je(),a=Fe().value(0),t=function(t){var n=t.filter(e.defined()),l=a.context();a.orient(e.orient()),n.forEach(function(t,n){l.save();var i=e.values(t,n);l.translate(i.origin[0],i.origin[1]),l.beginPath(),l.fillStyle=C.gray,l.strokeStyle=C.black,e.decorate()(l,t,n),a.median(i.median).upperQuartile(i.upperQuartile).lowerQuartile(i.lowerQuartile).high(i.high).width(i.width).low(i.low)([t]),l.fill(),l.stroke(),l.closePath(),l.restore()})};return V(t,e),b(t,a,"cap","context"),t},e.seriesCanvasCandlestick=function(){return Ue(Ge())},e.seriesCanvasErrorBar=function(){var e=Oe(),a=_e().value(0),t=function(t){var n=t.filter(e.defined()),l=a.context();a.orient(e.orient()),n.forEach(function(t,n){l.save();var i=e.values(t,n);l.translate(i.origin[0],i.origin[1]),l.beginPath(),l.strokeStyle=C.black,l.fillStyle=C.gray,e.decorate()(l,t,n),a.high(i.high).width(i.width).low(i.low)([t]),l.fill(),l.stroke(),l.closePath(),l.restore()})};return V(t,e),b(t,a,"context"),t},e.seriesCanvasGrouped=function(e){var a=$e(),t=function(t){t.forEach(function(n,l){var r="horizontal"!==e.orient(),o=function(e,n){var i=a.offsetScaleForDatum(t,e,n),d=r?a.xScale():a.yScale();return d(e)+i(l)+i.bandwidth()/2};r?(e.xScale(o),e.yScale(a.yScale())):(e.yScale(o),e.xScale(a.xScale())),e.bandwidth&&e.bandwidth(function(e,n){return a.offsetScaleForDatum(t,e,n).bandwidth()}),e.decorate(function(e,t){return a.decorate()(e,t,l)}),e(n)})};return V(t,e,A("decorate","xScale","yScale")),V(t,a,A("offsetScaleForDatum")),t},e.seriesCanvasHeatmap=function(){var e=aa(),a=function(a){var t=a.filter(e.defined()),n=e.colorInterpolate(),l=e.colorScale(t),r=e.pathGenerator.context();t.forEach(function(a,t){r.save(),r.beginPath();var i=e.values(a,t);r.translate(i.x,i.y),r.fillStyle=n(l(i.colorValue)),r.strokeStyle="transparent",e.decorate()(r,a,t),e.pathGenerator.height(i.height).width(i.width)([a]),r.fill(),r.stroke(),r.closePath(),r.restore()})};return b(a,e.pathGenerator,"context"),V(a,e),a},e.seriesCanvasLine=R,e.seriesCanvasMulti=Ze,e.seriesCanvasOhlc=function(){return Ue(Ne())},e.seriesCanvasPoint=function(){var e=a.symbol(),t=I(),n=function(a){var n=a.filter(t.defined()),l=e.context();n.forEach(function(a,n){l.save();var i=t.values(a,n);l.translate(i.origin[0],i.origin[1]),l.beginPath(),l.strokeStyle=C.black,l.fillStyle=C.gray,t.decorate()(l,a,n),e(a,n),l.fill(),l.stroke(),l.closePath(),l.restore()})};return V(n,t,A("baseValue","bandwidth","align")),b(n,e,"size","type","context"),n},e.seriesCanvasRepeat=Je,e.seriesSvgArea=function(){var e=I(),n=a.area(),l=S("path","area"),i=function(a){a.selection&&l.transition(a),n.defined(e.defined()),a.each(function(a,i,d){var r=a.map(e.values);n.x(function(e,a){return r[a].transposedX}).y(function(e,a){return r[a].transposedY});var o="vertical"===e.orient()?"y":"x";n[o+"0"](function(e,a){return r[a].y0}),n[o+"1"](function(e,a){return r[a].y});var h=l(t.select(d[i]),[a]);h.enter().attr("fill",C.gray),h.attr("d",n),e.decorate()(h,a,i)})};return V(i,e,A("bandwidth","align")),b(i,l,"key"),b(i,n,"curve"),i},e.seriesSvgBar=function(){var e=Ye().x(0).y(0),a=I(),n=S("g","bar"),l=function(e){return"vertical"===a.orient()?e.height:e.width},r=function(e){return"vertical"===a.orient()?e.width:e.height},o=function(e){return"translate("+e[0]+", "+e[1]+")"},h=function(i){i.selection&&n.transition(i),i.each(function(i,d,h){var c=a.orient();if("vertical"!==c&&"horizontal"!==c)throw new Error("The bar series does not support an orientation of "+c);var s=i.filter(a.defined()),u=s.map(a.values);e.width(0).height(0),"vertical"===a.orient()?(e.verticalAlign("top"),e.horizontalAlign("center")):(e.horizontalAlign("right"),e.verticalAlign("center"));var f=n(t.select(h[d]),s);f.enter().attr("transform",function(e,a){return o(u[a].baseOrigin)}).attr("class","bar "+a.orient()).attr("fill",C.darkGray).append("path").attr("d",function(a,t){return r(e)(u[t].width),e([a])}),f.attr("transform",function(e,a){return o(u[a].origin)}).select("path").attr("d",function(a,t){return r(e)(u[t].width),l(e)(-u[t].height),e([a])}),a.decorate()(f,s,d)})};return V(h,a),b(h,n,"key"),h},e.seriesSvgBoxPlot=function(){var e=je(),a=S("g","box-plot"),n=Fe().value(0),l=function(e){return function(a){return e.selection?a.transition(e):a}},r=function(e){return"translate("+e.origin[0]+", "+e.origin[1]+")"},o=function(i){i.selection&&a.transition(i);var o=l(i);i.each(function(l,i,d){var h=l.filter(e.defined()),c=a(t.select(d[i]),h);c.enter().attr("stroke",C.black).attr("fill",C.gray).attr("transform",function(a,t){return r(e.values(a,t))+" scale(1e-6, 1)"}).append("path"),n.orient(e.orient()),c.each(function(a,l,i){var d=e.values(a,l);n.median(d.median).upperQuartile(d.upperQuartile).lowerQuartile(d.lowerQuartile).width(d.width).high(d.high).low(d.low),o(t.select(i[l])).attr("transform",r(d)).select("path").attr("d",n([a]))}),e.decorate()(c,l,i)})};return V(o,e),b(o,a,"key"),b(o,n,"cap"),o},e.seriesSvgCandlestick=function(){return Xe(Ge(),"candlestick")},e.seriesSvgErrorBar=function(){var e=Oe(),a=S("g","error-bar"),n=_e().value(0),l=function(e){return function(a){return e.selection?a.transition(e):a}},r=function(e){return"translate("+e.origin[0]+", "+e.origin[1]+")"},o=function(i){i.selection&&a.transition(i);var o=l(i);i.each(function(l,i,d){var h=l.filter(e.defined()),c=h.map(e.values),s=a(t.select(d[i]),h);s.enter().attr("stroke",C.black).attr("fill",C.gray).attr("transform",function(a,t){return r(e.values(a,t))+" scale(1e-6, 1)"}).append("path"),n.orient(e.orient()),s.each(function(e,a,l){var i=c[a];n.high(i.high).low(i.low).width(i.width),o(t.select(l[a])).attr("transform",r(i)+" scale(1)").select("path").attr("d",n([e]))}),e.decorate()(s,l,i)})};return V(o,e),b(o,a,"key"),o},e.seriesSvgGrouped=function(e){var a=$e(),n=S("g","grouped"),l=function(l){l.selection&&n.transition(l),l.each(function(l,i,d){var r=n(t.select(d[i]),l);r.enter().append("g"),r.select("g").each(function(n,r,o){var h=t.select(o[r]),c="horizontal"!==e.orient(),s=function(e,t){var n=a.offsetScaleForDatum(l,e,t),i=c?a.xScale():a.yScale();return i(e)+n(r)+n.bandwidth()/2};c?(e.xScale(s),e.yScale(a.yScale())):(e.yScale(s),e.xScale(a.xScale())),e.bandwidth&&e.bandwidth(function(e,t){return a.offsetScaleForDatum(l,e,t).bandwidth()}),e.decorate(function(e,t){return a.decorate()(e,t,r)}),h.call(e)})})};return V(l,e,A("decorate","xScale","yScale")),V(l,a,A("offsetScaleForDatum")),l},e.seriesSvgHeatmap=function(){var e=aa(),a=S("g","box"),n=function(e){return"translate("+e.x+", "+e.y+")"},l=function(l){l.each(function(l,i,d){var r=l.filter(e.defined()),o=e.colorValue(),h=e.colorInterpolate(),c=e.colorScale(r),s=a(t.select(d[i]),r);s.enter().append("path").attr("stroke","transparent"),s.attr("transform",function(a,t){return n(e.values(a,t))}).select("path").attr("d",function(a,t){return e.pathGenerator.width(e.values(a,t).width).height(e.values(a,t).height)([a])}).attr("fill",function(e,a){return h(c(o(e,a)))}),e.decorate()(s,l,i)})};return V(l,e),l},e.seriesSvgLine=H,e.seriesSvgMulti=Ke,e.seriesSvgOhlc=function(){return Xe(Ne(),"ohlc")},e.seriesSvgPoint=function(){var e=a.symbol(),n=I(),l=S("g","point"),r=function(e){return"translate("+e[0]+", "+e[1]+")"},o=function(a){a.selection&&l.transition(a),a.each(function(a,i,d){var o=a.filter(n.defined()),h=l(t.select(d[i]),o);h.enter().attr("transform",function(e,a){return r(n.values(e,a).origin)}).attr("fill",C.gray).attr("stroke",C.black).append("path"),h.attr("transform",function(e,a){return r(n.values(e,a).origin)}).select("path").attr("d",e),n.decorate()(h,a,i)})};return V(o,n,A("baseValue","bandwidth","align")),b(o,l,"key"),b(o,e,"type","size"),o},e.seriesSvgRepeat=function(){var e="vertical",a=H(),n=Ke(),l=function(l){return l.each(function(l,i,d){"vertical"===e?n.series(l[0].map(function(){return a})).mapping(function(e,a){return e.map(function(e){return e[a]})}):n.series(l.map(function(){return a})).mapping(function(e,a){return e[a]}),t.select(d[i]).call(n)})};return l.series=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],l):a},l.orient=function(){return arguments.length?(e=0>=arguments.length?void 0:arguments[0],l):e},V(l,n,A("series","mapping")),l},e.seriesWebglArea=function(){var e=I(),a=He(),t=function(t){var n=j(e.xScale()),l=j(e.yScale()),r=new Float32Array(t.length),o=new Float32Array(t.length),h=new Float32Array(t.length),c=new Float32Array(t.length);t.forEach(function(a,t){r[t]=n.scale(e.crossValue()(a,t)),o[t]=l.scale(e.mainValue()(a,t)),h[t]=l.scale(e.baseValue()(a,t)),c[t]=e.defined()(a,t)}),a.xValues(r).yValues(o).y0Values(h).defined(c).xScale(n.glScale).yScale(l.glScale).decorate(function(a){return e.decorate()(a,t,0)}),a(t.length)};return V(t,e,A("bandwidth","align")),b(t,a,"context"),t},e.seriesWebglBar=function(){var e=I(),a=Pe(),t=function(t){var n=t.filter(e.defined()),l=j(e.xScale()),r=j(e.yScale()),o=new Float32Array(n.length),h=new Float32Array(n.length),c=new Float32Array(n.length),s=new Float32Array(n.length);n.forEach(function(a,t){o[t]=l.scale(e.crossValue()(a,t)),s[t]=l.scale(e.bandwidth()(a,t)),h[t]=r.scale(e.baseValue()(a,t)),c[t]=r.scale(e.mainValue()(a,t))}),a.xValues(o).y0Values(h).yValues(c).widths(s).xScale(l.glScale).yScale(r.glScale).decorate(function(a){e.decorate()(a,n,0)}),a(n.length)};return V(t,e,A("align")),b(t,a,"context"),t},e.seriesWebglBoxPlot=function(){var e=je(),a=E(.5),t=ze(),n=function(n){var l=n.filter(e.defined()),r=j(e.xScale()),o=j(e.yScale()),h=new Float32Array(l.length),c=new Float32Array(l.length),s=new Float32Array(l.length),g=new Float32Array(l.length),u=new Float32Array(l.length),f=new Float32Array(l.length),p=new Float32Array(l.length),y=new Float32Array(l.length);l.forEach(function(t,n){h[n]=r.scale(e.crossValue()(t,n)),c[n]=o.scale(e.medianValue()(t,n)),s[n]=o.scale(e.upperQuartileValue()(t,n)),g[n]=r.scale(e.lowerQuartileValue()(t,n)),u[n]=o.scale(e.highValue()(t,n)),f[n]=o.scale(e.lowValue()(t,n)),p[n]=e.bandwidth()(t,n),y[n]=p[n]*a(t,n)}),t.xValues(h).medianValues(c).upperQuartileValues(s).lowerQuartileValues(g).highValues(u).lowValues(f).bandwidth(p).capWidth(y).xScale(r.glScale).yScale(o.glScale),t(l.length)};return n.cap=function(){return arguments.length?(a=E(0>=arguments.length?void 0:arguments[0]),n):a},V(n,e,A("align")),b(n,t,"context","lineWidth"),n},e.seriesWebglCandlestick=function(){return Me(Le())},e.seriesWebglErrorBar=function(){var e=Oe(),a=Ie(),t=function(t){var n=t.filter(e.defined()),l=j(e.xScale()),r=j(e.yScale()),o=new Float32Array(n.length),h=new Float32Array(n.length),c=new Float32Array(n.length),s=new Float32Array(n.length);n.forEach(function(a,t){o[t]=l.scale(e.crossValue()(a,t)),h[t]=r.scale(e.highValue()(a,t)),c[t]=r.scale(e.lowValue()(a,t)),s[t]=e.bandwidth()(a,t)}),a.xValues(o).highValues(h).lowValues(c).bandwidth(s).xScale(l.glScale).yScale(r.glScale),a(n.length)};return V(t,e,A("align")),b(t,a,"context","lineWidth"),t},e.seriesWebglLine=function(){function e(){return"vertical"===a.orient()?{x:a.crossValue(),y:a.mainValue(),defined:a.defined()}:{x:a.mainValue(),y:a.crossValue(),defined:a.defined()}}var a=I(),t=Te(),n=function(n){var l=j(a.xScale()),r=j(a.yScale()),o=e(),h=new Float32Array(n.length),c=new Float32Array(n.length),s=new Float32Array(n.length);n.forEach(function(e,a){h[a]=l.scale(o.x(e,a)),c[a]=r.scale(o.y(e,a)),s[a]=o.defined(e,a)}),t.xValues(h).yValues(c).defined(s).xScale(l.glScale).yScale(r.glScale).decorate(function(e){a.decorate()(e,n,0)}),t(n.length)};return V(n,a,A("baseValue","bandwidth","align")),b(n,t,"context","lineWidth"),n},e.seriesWebglMulti=Ze,e.seriesWebglOhlc=function(){return Me(Be())},e.seriesWebglPoint=function(){function e(){return"vertical"===a.orient()?{x:a.crossValue(),y:a.mainValue()}:{x:a.mainValue(),y:a.crossValue()}}var a=I(),t=64,n=y.symbolCircle,l=we(),i=function(i){var d=i.filter(a.defined()),r=j(a.xScale()),o=j(a.yScale()),h=Se(n),c=e(),s=new Float32Array(d.length),g=new Float32Array(d.length),u=new Float32Array(d.length);d.forEach(function(e,a){var n="function"==typeof t?t:function(){return t};s[a]=r.scale(c.x(e,a)),g[a]=o.scale(c.y(e,a)),u[a]=n(e)}),l.xValues(s).yValues(g).sizes(u).xScale(r.glScale).yScale(o.glScale).type(h).decorate(function(e){return a.decorate()(e,d,0)}),l(d.length)};return i.size=function(){return arguments.length?(t=0>=arguments.length?void 0:arguments[0],i):t},i.type=function(){return arguments.length?(n=0>=arguments.length?void 0:arguments[0],i):n},V(i,a,A("baseValue","bandwidth","align")),b(i,l,"context"),i},e.seriesWebglRepeat=Je,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
`),e(h)};return h.xValues=e=>(l.data(e),h),h.medianValues=e=>{const a=i.data();return i.data({...a,median:e}),h},h.upperQuartileValues=e=>{const a=i.data();return i.data({...a,upperQuartile:e}),h},h.lowerQuartileValues=e=>{const a=i.data();return i.data({...a,lowerQuartile:e}),h},h.highValues=e=>{const a=i.data();return i.data({...a,high:e}),h},h.lowValues=e=>{const a=i.data();return i.data({...a,low:e}),h},h.bandwidth=e=>{const a=o.data();return o.data({...a,bandwidth:e}),h},h.capWidth=e=>{const a=o.data();return o.data({...a,capWidth:e}),h},h.xScale=(...e)=>e.length?(a=e[0],h):a,h.yScale=(...e)=>e.length?(t=e[0],h):t,b(h,e,"context"),b(h,n,"lineWidth"),h},We=e=>"function"==typeof e?e:()=>e,Ne=()=>{let e=null,a=e=>e.date,t=e=>e.open,n=e=>e.high,r=e=>e.low,o=e=>e.close,h="vertical",c=We(3);const s=function(i){const s=e||l.path();return i.forEach(function(e,l){const i=a(e,l),d=t(e,l),g=n(e,l),u=r(e,l),f=o(e,l),p=c(e,l)/2;"vertical"===h?(s.moveTo(i,u),s.lineTo(i,g),s.moveTo(i,d),s.lineTo(i-p,d),s.moveTo(i,f),s.lineTo(i+p,f)):(s.moveTo(u,i),s.lineTo(g,i),s.moveTo(d,i),s.lineTo(d,i+p),s.moveTo(f,i),s.lineTo(f,i-p))}),e?null:s.toString()};return s.context=(...a)=>a.length?(e=a[0],s):e,s.x=(...e)=>e.length?(a=We(e[0]),s):a,s.open=(...e)=>e.length?(t=We(e[0]),s):t,s.high=(...e)=>e.length?(n=We(e[0]),s):n,s.low=(...e)=>e.length?(r=We(e[0]),s):r,s.close=(...e)=>e.length?(o=We(e[0]),s):o,s.width=(...e)=>e.length?(c=We(e[0]),s):c,s.orient=(...e)=>e.length?(h=e[0],s):h,s},Ye=()=>{let e=null,a=e=>e.x,t=e=>e.y,n="center",i="center",r=e=>e.height,o=We(3);const h=function(d,h){const c=e||l.path();return d.forEach(function(e,l){const d=a.call(this,e,h||l),s=t.call(this,e,h||l),g=r.call(this,e,h||l),u=o.call(this,e,h||l);let f;switch(n){case"left":f=u;break;case"right":f=0;break;case"center":f=u/2;break;default:throw new Error("Invalid horizontal alignment "+n);}let p;switch(i){case"bottom":p=-g;break;case"top":p=0;break;case"center":p=g/2;break;default:throw new Error("Invalid vertical alignment "+i);}c.rect(d-f,s-p,u,g)},this),e?null:c.toString()};return h.context=(...a)=>a.length?(e=a[0],h):e,h.x=(...e)=>e.length?(a=We(e[0]),h):a,h.y=(...e)=>e.length?(t=We(e[0]),h):t,h.width=(...e)=>e.length?(o=We(e[0]),h):o,h.horizontalAlign=(...e)=>e.length?(n=e[0],h):n,h.height=(...e)=>e.length?(r=We(e[0]),h):r,h.verticalAlign=(...e)=>e.length?(i=e[0],h):i,h},Ge=()=>{let e=null,a=e=>e.date,t=e=>e.open,n=e=>e.high,r=e=>e.low,o=e=>e.close,h=We(3);const c=function(i){const c=e||l.path();return i.forEach(function(e,l){const i=a(e,l),d=t(e,l),s=n(e,l),g=r(e,l),p=o(e,l),y=h(e,l);c.rect(i-y/2,d,y,p-d),c.moveTo(i,f(p,d)),c.lineTo(i,s),c.moveTo(i,u(p,d)),c.lineTo(i,g)}),e?null:c.toString()};return c.context=(...a)=>a.length?(e=a[0],c):e,c.x=(...e)=>e.length?(a=We(e[0]),c):a,c.open=(...e)=>e.length?(t=We(e[0]),c):t,c.high=(...e)=>e.length?(n=We(e[0]),c):n,c.low=(...e)=>e.length?(r=We(e[0]),c):r,c.close=(...e)=>e.length?(o=We(e[0]),c):o,c.width=(...e)=>e.length?(h=We(e[0]),c):h,c},Fe=()=>{let e=null,a=e=>e.value,t=e=>e.median,n=e=>e.upperQuartile,r=e=>e.lowerQuartile,o=e=>e.high,h=e=>e.low,c="vertical",s=We(5),g=We(.5);const u=function(i){const u=e||l.path();return i.forEach(function(e,l){const i=a(e,l),d=s(e,l),f=d/2,p=d*g(e,l),y=p/2,m=o(e,l),S=n(e,l),v=t(e,l),x=r(e,l),b=h(e,l),w=x-S;"vertical"===c?(u.moveTo(i-y,m),u.lineTo(i+y,m),u.moveTo(i,m),u.lineTo(i,S),u.rect(i-f,S,d,w),u.moveTo(i-f,v),u.lineTo(i+f,v),u.moveTo(i,x),u.lineTo(i,b),u.moveTo(i-y,b),u.lineTo(i+y,b)):(u.moveTo(b,i-y),u.lineTo(b,i+y),u.moveTo(b,i),u.lineTo(x,i),u.rect(x,i-f,-w,d),u.moveTo(v,i-f),u.lineTo(v,i+f),u.moveTo(S,i),u.lineTo(m,i),u.moveTo(m,i-y),u.lineTo(m,i+y))}),e?null:u.toString()};return u.context=(...a)=>a.length?(e=a[0],u):e,u.value=(...e)=>e.length?(a=We(e[0]),u):a,u.median=(...e)=>e.length?(t=We(e[0]),u):t,u.upperQuartile=(...e)=>e.length?(n=We(e[0]),u):n,u.lowerQuartile=(...e)=>e.length?(r=We(e[0]),u):r,u.high=(...e)=>e.length?(o=We(e[0]),u):o,u.low=(...e)=>e.length?(h=We(e[0]),u):h,u.width=(...e)=>e.length?(s=We(e[0]),u):s,u.orient=(...e)=>e.length?(c=e[0],u):c,u.cap=(...e)=>e.length?(g=We(e[0]),u):g,u},_e=()=>{let e=null,a=e=>e.x,t=e=>e.high,n=e=>e.low,r="vertical",o=We(5);const h=function(i){const h=e||l.path();return i.forEach(function(e,l){const i=a(e,l),d=o(e,l),c=d/2,s=t(e,l),g=n(e,l);"vertical"===r?(h.moveTo(i-c,s),h.lineTo(i+c,s),h.moveTo(i,s),h.lineTo(i,g),h.moveTo(i-c,g),h.lineTo(i+c,g)):(h.moveTo(g,i-c),h.lineTo(g,i+c),h.moveTo(g,i),h.lineTo(s,i),h.moveTo(s,i-c),h.lineTo(s,i+c))}),e?null:h.toString()};return h.context=(...a)=>a.length?(e=a[0],h):e,h.value=(...e)=>e.length?(a=We(e[0]),h):a,h.high=(...e)=>e.length?(t=We(e[0]),h):t,h.low=(...e)=>e.length?(n=We(e[0]),h):n,h.width=(...e)=>e.length?(o=We(e[0]),h):o,h.orient=(...e)=>e.length?(r=e[0],h):r,h},Oe=function(){var e=function(e){return e.high},a=function(e){return e.low},t=function(e){return e.cross},l="vertical",r="center",h=function(){return 5},c=k({decorate:function(){},defined:function(n,l){return o(a,e,t)(n,l)},xScale:n.scaleIdentity(),yScale:n.scaleIdentity()});return c.values=function(n,d){var i=h(n,d),o=P(r,i),s=c.xScale(),g=c.yScale();if("vertical"===l){var u=g(e(n,d));return{origin:[s(t(n,d))+o,u],high:0,low:g(a(n,d))-u,width:i}}var f=s(a(n,d));return{origin:[f,g(t(n,d))+o],high:s(e(n,d))-f,low:0,width:i}},c.xValues=function(){return"vertical"===l?[t]:[e,a]},c.yValues=function(){return"vertical"===l?[e,a]:[t]},c.orient=function(){return arguments.length?(l=0>=arguments.length?void 0:arguments[0],c):l},c.lowValue=function(){return arguments.length?(a=E(0>=arguments.length?void 0:arguments[0]),c):a},c.highValue=function(){return arguments.length?(e=E(0>=arguments.length?void 0:arguments[0]),c):e},c.crossValue=function(){return arguments.length?(t=E(0>=arguments.length?void 0:arguments[0]),c):t},c.bandwidth=function(){return arguments.length?(h=E(0>=arguments.length?void 0:arguments[0]),c):h},c.align=function(){return arguments.length?(r=0>=arguments.length?void 0:arguments[0],c):r},c},De=function(){var e,a=function(e){return e.date},t=function(e){return e.open},l=function(e){return e.high},r=function(e){return e.low},h=function(e){return e.close},c=function(){return 5},s="center",g=function(t,n){return e.xScale()(a(t,n))};return e=k({decorate:function(){},defined:function(e,n){return o(a,t,r,l,h)(e,n)},xScale:n.scaleIdentity(),yScale:n.scaleIdentity()}),e.values=function(a,n){var i=h(a,n),d=t(a,n),o=c(a,n),u=P(s,o),f="";return i>d?f="up":i<d&&(f="down"),{cross:g(a,n)+u,open:e.yScale()(d),high:e.yScale()(l(a,n)),low:e.yScale()(r(a,n)),close:e.yScale()(i),width:o,direction:f}},e.xValues=function(){return[a]},e.yValues=function(){return[t,l,r,h]},e.crossValue=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],e):a},e.openValue=function(){return arguments.length?(t=0>=arguments.length?void 0:arguments[0],e):t},e.highValue=function(){return arguments.length?(l=0>=arguments.length?void 0:arguments[0],e):l},e.lowValue=function(){return arguments.length?(r=0>=arguments.length?void 0:arguments[0],e):r},e.yValue=e.closeValue=function(){return arguments.length?(h=0>=arguments.length?void 0:arguments[0],e):h},e.bandwidth=function(){return arguments.length?(c=E(0>=arguments.length?void 0:arguments[0]),e):c},e.align=function(){return arguments.length?(s=0>=arguments.length?void 0:arguments[0],e):s},e},Xe=function(e,a){var n=De(),l=v("g",a),r=function(e){return"translate("+e.cross+", "+e.high+")"},o=function(e){return function(a){return e.selection?a.transition(e):a}},h=function(i){i.selection&&l.transition(i);var h=o(i);i.each(function(i,d,o){var c=i.filter(n.defined()),s=l(t.select(o[d]),c);s.enter().attr("transform",function(e,a){return r(n.values(e,a))+" scale(1e-6, 1)"}).append("path"),s.each(function(l,d,i){var o=n.values(l,d),c="up"===o.direction?z.green:z.red,s=h(t.select(i[d])).attr("class",a+" "+o.direction).attr("stroke",c).attr("fill",c).attr("transform",function(){return r(o)+" scale(1)"});e.x(0).width(o.width).open(function(){return o.open-o.high}).high(0).low(function(){return o.low-o.high}).close(function(){return o.close-o.high}),s.select("path").attr("d",e([l]))}),n.decorate()(s,i,d)})};return b(h,l,"key"),V(h,n),h},Ue=function(e){var a=De(),t=function(t){var n=t.filter(a.defined()),l=e.context();n.forEach(function(t,n){l.save();var i=a.values(t,n);l.translate(i.cross,i.high),l.beginPath(),e.x(0).open(function(){return i.open-i.high}).width(i.width).high(0).low(function(){return i.low-i.high}).close(function(){return i.close-i.high})([t]);var d="up"===i.direction?z.green:z.red;l.strokeStyle=d,l.fillStyle=d,a.decorate()(l,t,n),l.fill(),l.stroke(),l.closePath(),l.restore()})};return b(t,e,"context"),V(t,a),t},Me=function(e){var a=De(),t=function(t){var n=t.filter(a.defined()),l=j(a.xScale()),r=j(a.yScale()),o=new Float32Array(n.length),h=new Float32Array(n.length),c=new Float32Array(n.length),s=new Float32Array(n.length),g=new Float32Array(n.length),u=new Float32Array(n.length);n.forEach(function(e,t){o[t]=l.scale(a.crossValue()(e,t)),h[t]=r.scale(a.openValue()(e,t)),c[t]=r.scale(a.highValue()(e,t)),s[t]=r.scale(a.lowValue()(e,t)),g[t]=r.scale(a.closeValue()(e,t)),u[t]=a.bandwidth()(e,t)}),e.xValues(o).openValues(h).highValues(c).lowValues(s).closeValues(g).bandwidth(u).xScale(l.glScale).yScale(r.glScale).decorate(function(e){return a.decorate()(e,n,0)}),e(n.length)};return V(t,a,A("align")),b(t,e,"context","lineWidth"),t},je=function(){var e=function(e){return e.upperQuartile},a=function(e){return e.lowerQuartile},t=function(e){return e.high},l=function(e){return e.low},r=function(e){return e.value},h=function(e){return e.median},c="vertical",s="center",g=function(){return 5},u=k({decorate:function(){},defined:function(n,d){return o(l,t,a,e,r,h)(n,d)},xScale:n.scaleIdentity(),yScale:n.scaleIdentity()});return u.values=function(n,d){var i=g(n,d),o=P(s,i),f=u.xScale(),p=u.yScale();if("vertical"===c){var m=p(t(n,d));return{origin:[f(r(n,d))+o,m],high:0,upperQuartile:p(e(n,d))-m,median:p(h(n,d))-m,lowerQuartile:p(a(n,d))-m,low:p(l(n,d))-m,width:i}}var y=f(l(n,d));return{origin:[y,p(r(n,d))+o],high:f(t(n,d))-y,upperQuartile:f(e(n,d))-y,median:f(h(n,d))-y,lowerQuartile:f(a(n,d))-y,low:0,width:i}},u.xValues=function(){return"vertical"===c?[r]:[e,a,t,l,h]},u.yValues=function(){return"vertical"===c?[e,a,t,l,h]:[r]},u.orient=function(){return arguments.length?(c=0>=arguments.length?void 0:arguments[0],u):c},u.lowerQuartileValue=function(){return arguments.length?(a=E(0>=arguments.length?void 0:arguments[0]),u):a},u.upperQuartileValue=function(){return arguments.length?(e=E(0>=arguments.length?void 0:arguments[0]),u):e},u.lowValue=function(){return arguments.length?(l=E(0>=arguments.length?void 0:arguments[0]),u):l},u.highValue=function(){return arguments.length?(t=E(0>=arguments.length?void 0:arguments[0]),u):t},u.crossValue=function(){return arguments.length?(r=E(0>=arguments.length?void 0:arguments[0]),u):r},u.medianValue=function(){return arguments.length?(h=E(0>=arguments.length?void 0:arguments[0]),u):h},u.bandwidth=function(){return arguments.length?(g=E(0>=arguments.length?void 0:arguments[0]),u):g},u.align=function(){return arguments.length?(s=0>=arguments.length?void 0:arguments[0],u):s},u},qe=function(){var e=[],a=function(e){return e},t=function(e,a){return a},l=k({decorate:function(){},xScale:n.scaleIdentity(),yScale:n.scaleIdentity()});return l.xValues=function(){return e.map(function(e){return e.xValues()}).reduce(function(e,a){return e.concat(a)})},l.yValues=function(){return e.map(function(e){return e.yValues()}).reduce(function(e,a){return e.concat(a)})},l.mapping=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],l):a},l.key=function(){return arguments.length?(t=0>=arguments.length?void 0:arguments[0],l):t},l.series=function(){return arguments.length?(e=0>=arguments.length?void 0:arguments[0],l):e},l},Ke=function(){var e=qe(),a=v("g"),n=v("g","multi"),l=function(l){l.selection&&(n.transition(l),a.transition(l));var i=e.mapping(),d=e.series(),r=e.xScale(),o=e.yScale();l.each(function(l,h,c){var s=n(t.select(c[h]),d);s.each(function(e,n,h){e.xScale(r).yScale(o);var c=i(l,n,d),s=a(t.select(h[n]),[c]);s.call(e)});var g=s.selection?s.selection():s;g.order(),e.decorate()(s,l,h)})};return V(l,e),b(l,n,"key"),l},Ze=function(){var e=null,a=qe(),t=function(t){var n=a.mapping(),l=a.series(),i=a.xScale(),d=a.yScale();l.forEach(function(r,o){var h=n(t,o,l);r.context(e).xScale(i).yScale(d);var s;r.decorate?(s=r.decorate(),r.decorate(function(e,n,l){a.decorate()(e,t,o),s(e,n,l)})):a.decorate()(e,t,o),r(h),s&&r.decorate(s)})};return t.context=function(){return arguments.length?(e=0>=arguments.length?void 0:arguments[0],t):e},V(t,a),t},$e=function(){var e=function(){return 50},a="center",t=n.scaleBand(),l=k({decorate:function(){},xScale:n.scaleLinear(),yScale:n.scaleLinear()});return l.offsetScaleForDatum=function(n,l,d){var i=e(l,d),o=P(a,i),h=i/2;return t.domain(r.range(0,n.length)).range([-h+o,h+o])},l.bandwidth=function(){return arguments.length?(e=E(0>=arguments.length?void 0:arguments[0]),l):e},l.align=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],l):a},V(l,t,B({paddingInner:"paddingOuter"})),l},Je=function(){var e="vertical",a=H(),t=Ze(),n=function(n){"vertical"===e?t.series(n[0].map(function(){return a})).mapping(function(e,a){return e.map(function(e){return e[a]})}):t.series(n.map(function(){return a})).mapping(function(e,a){return e[a]}),t(n)};return n.series=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],n):a},n.orient=function(){return arguments.length?(e=0>=arguments.length?void 0:arguments[0],n):e},V(n,t,A("series","mapping")),n},ea=function(e){return e.sort(r.ascending).filter(function(e,a,t){return-1===t.indexOf(e,a+1)})},aa=function(){var e=function(e){return e.x},a=function(e){return e.y},t=function(e){return e.color},l=function(){return 5},h=function(){return 5},c=n.interpolateViridis,s=k({decorate:function(){},defined:function(n,l){return o(e,a,t)(n,l)},xScale:n.scaleIdentity(),yScale:n.scaleIdentity()});return s.pathGenerator=Ye().x(0).y(0),s.colorScale=function(e){var a=e.map(t);return n.scaleLinear().domain([r.min(a),r.max(a)])},s.values=function(n,d){return{x:s.xScale()(e(n,d)),y:s.yScale()(a(n,d)),colorValue:t(n,d),width:h(n,d),height:l(n,d)}},s.xValues=function(){return[e]},s.yValues=function(){return[a]},s.xValue=function(){return arguments.length?(e=E(0>=arguments.length?void 0:arguments[0]),s):e},s.yValue=function(){return arguments.length?(a=E(0>=arguments.length?void 0:arguments[0]),s):a},s.colorValue=function(){return arguments.length?(t=E(0>=arguments.length?void 0:arguments[0]),s):t},s.colorInterpolate=function(){return arguments.length?(c=0>=arguments.length?void 0:arguments[0],s):c},s.xBandwidth=function(){return arguments.length?(h=E(0>=arguments.length?void 0:arguments[0]),s):h},s.yBandwidth=function(){return arguments.length?(l=E(0>=arguments.length?void 0:arguments[0]),s):l},V(s,s.pathGenerator,B({horizontalAlign:"xAlign",verticalAlign:"yAlign"})),s};e.autoBandwidth=function(e){var a=.75,n=function(e){if(1>=e.length)return 10;e=ea(e);var t=r.pairs(e).map(function(e){return p(e[0]-e[1])}),n=r.min(t);return a*n},l=function(a,t,l){if(a.bandwidth)return a.bandwidth();var i,d=Array.isArray(t)?(i=[]).concat.apply(i,h(t)):t,r=d.filter(e.defined()).map(l()).map(a),o=n(r);return o},i=function(a){var n=function(a){if(e.xBandwidth&&e.yBandwidth)e.xBandwidth(l(e.xScale(),a,e.xValue)),e.yBandwidth(l(e.yScale(),a,e.yValue));else{var t=e.orient&&"horizontal"===e.orient()?e.yScale():e.xScale();e.bandwidth(l(t,a,e.crossValue))}};a instanceof t.selection?a.each(function(a,l,i){n(a),e(t.select(i[l]))}):(n(a),e(a))};return V(i,e),i.widthFraction=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],i):a},i},e.seriesCanvasArea=function(){var e=I(),t=a.area(),n=function(a){var n=t.context();t.defined(e.defined());var l=a.map(e.values);t.x(function(e,a){return l[a].transposedX}).y(function(e,a){return l[a].transposedY});var i="vertical"===e.orient()?"y":"x";t[i+"0"](function(e,a){return l[a].y0}),t[i+"1"](function(e,a){return l[a].y}),n.beginPath(),n.fillStyle=z.gray,n.strokeStyle="transparent",e.decorate()(n,a),t(a),n.fill(),n.stroke(),n.closePath()};return V(n,e,A("bandwidth","align")),b(n,t,"curve","context"),n},e.seriesCanvasBar=function(){var e=I(),a=Ye().x(0).y(0),t=function(a){return"vertical"===e.orient()?a.height:a.width},n=function(a){return"vertical"===e.orient()?a.width:a.height},l=function(l){var d=a.context(),r=l.filter(e.defined()),o=r.map(e.values);"vertical"===e.orient()?(a.verticalAlign("top"),a.horizontalAlign("center")):(a.horizontalAlign("right"),a.verticalAlign("center")),o.forEach(function(l,r){d.save(),d.beginPath(),d.translate(l.origin[0],l.origin[1]),d.fillStyle=z.darkGray,d.strokeStyle="transparent",e.decorate()(d,l.d,r),t(a)(-l.height),n(a)(l.width),a([l]),d.fill(),d.stroke(),d.closePath(),d.restore()})};return V(l,e),b(l,a,"context"),l},e.seriesCanvasBoxPlot=function(){var e=je(),a=Fe().value(0),t=function(t){var n=t.filter(e.defined()),l=a.context();a.orient(e.orient()),n.forEach(function(t,n){l.save();var i=e.values(t,n);l.translate(i.origin[0],i.origin[1]),l.beginPath(),l.fillStyle=z.gray,l.strokeStyle=z.black,e.decorate()(l,t,n),a.median(i.median).upperQuartile(i.upperQuartile).lowerQuartile(i.lowerQuartile).high(i.high).width(i.width).low(i.low)([t]),l.fill(),l.stroke(),l.closePath(),l.restore()})};return V(t,e),b(t,a,"cap","context"),t},e.seriesCanvasCandlestick=function(){return Ue(Ge())},e.seriesCanvasErrorBar=function(){var e=Oe(),a=_e().value(0),t=function(t){var n=t.filter(e.defined()),l=a.context();a.orient(e.orient()),n.forEach(function(t,n){l.save();var i=e.values(t,n);l.translate(i.origin[0],i.origin[1]),l.beginPath(),l.strokeStyle=z.black,l.fillStyle=z.gray,e.decorate()(l,t,n),a.high(i.high).width(i.width).low(i.low)([t]),l.fill(),l.stroke(),l.closePath(),l.restore()})};return V(t,e),b(t,a,"context"),t},e.seriesCanvasGrouped=function(e){var a=$e(),t=function(t){t.forEach(function(n,l){var r="horizontal"!==e.orient(),o=function(e,n){var i=a.offsetScaleForDatum(t,e,n),d=r?a.xScale():a.yScale();return d(e)+i(l)+i.bandwidth()/2};r?(e.xScale(o),e.yScale(a.yScale())):(e.yScale(o),e.xScale(a.xScale())),e.bandwidth&&e.bandwidth(function(e,n){return a.offsetScaleForDatum(t,e,n).bandwidth()}),e.decorate(function(e,t){return a.decorate()(e,t,l)}),e(n)})};return V(t,e,A("decorate","xScale","yScale")),V(t,a,A("offsetScaleForDatum")),t},e.seriesCanvasHeatmap=function(){var e=aa(),a=function(a){var t=a.filter(e.defined()),n=e.colorInterpolate(),l=e.colorScale(t),r=e.pathGenerator.context();t.forEach(function(a,t){r.save(),r.beginPath();var i=e.values(a,t);r.translate(i.x,i.y),r.fillStyle=n(l(i.colorValue)),r.strokeStyle="transparent",e.decorate()(r,a,t),e.pathGenerator.height(i.height).width(i.width)([a]),r.fill(),r.stroke(),r.closePath(),r.restore()})};return b(a,e.pathGenerator,"context"),V(a,e),a},e.seriesCanvasLine=H,e.seriesCanvasMulti=Ze,e.seriesCanvasOhlc=function(){return Ue(Ne())},e.seriesCanvasPoint=function(){var e=a.symbol(),t=I(),n=function(a){var n=a.filter(t.defined()),l=e.context();n.forEach(function(a,n){l.save();var i=t.values(a,n);l.translate(i.origin[0],i.origin[1]),l.beginPath(),l.strokeStyle=z.black,l.fillStyle=z.gray,t.decorate()(l,a,n),e(a,n),l.fill(),l.stroke(),l.closePath(),l.restore()})};return V(n,t,A("baseValue","bandwidth","align")),b(n,e,"size","type","context"),n},e.seriesCanvasRepeat=Je,e.seriesSvgArea=function(){var e=I(),n=a.area(),l=v("path","area"),i=function(a){a.selection&&l.transition(a),n.defined(e.defined()),a.each(function(a,i,d){var r=a.map(e.values);n.x(function(e,a){return r[a].transposedX}).y(function(e,a){return r[a].transposedY});var o="vertical"===e.orient()?"y":"x";n[o+"0"](function(e,a){return r[a].y0}),n[o+"1"](function(e,a){return r[a].y});var h=l(t.select(d[i]),[a]);h.enter().attr("fill",z.gray),h.attr("d",n),e.decorate()(h,a,i)})};return V(i,e,A("bandwidth","align")),b(i,l,"key"),b(i,n,"curve"),i},e.seriesSvgBar=function(){var e=Ye().x(0).y(0),a=I(),n=v("g","bar"),l=function(e){return"vertical"===a.orient()?e.height:e.width},r=function(e){return"vertical"===a.orient()?e.width:e.height},o=function(e){return"translate("+e[0]+", "+e[1]+")"},h=function(i){i.selection&&n.transition(i),i.each(function(i,d,h){var c=a.orient();if("vertical"!==c&&"horizontal"!==c)throw new Error("The bar series does not support an orientation of "+c);var s=i.filter(a.defined()),u=s.map(a.values);e.width(0).height(0),"vertical"===a.orient()?(e.verticalAlign("top"),e.horizontalAlign("center")):(e.horizontalAlign("right"),e.verticalAlign("center"));var f=n(t.select(h[d]),s);f.enter().attr("transform",function(e,a){return o(u[a].baseOrigin)}).attr("class","bar "+a.orient()).attr("fill",z.darkGray).append("path").attr("d",function(a,t){return r(e)(u[t].width),e([a])}),f.attr("transform",function(e,a){return o(u[a].origin)}).select("path").attr("d",function(a,t){return r(e)(u[t].width),l(e)(-u[t].height),e([a])}),a.decorate()(f,s,d)})};return V(h,a),b(h,n,"key"),h},e.seriesSvgBoxPlot=function(){var e=je(),a=v("g","box-plot"),n=Fe().value(0),l=function(e){return function(a){return e.selection?a.transition(e):a}},r=function(e){return"translate("+e.origin[0]+", "+e.origin[1]+")"},o=function(i){i.selection&&a.transition(i);var o=l(i);i.each(function(l,i,d){var h=l.filter(e.defined()),c=a(t.select(d[i]),h);c.enter().attr("stroke",z.black).attr("fill",z.gray).attr("transform",function(a,t){return r(e.values(a,t))+" scale(1e-6, 1)"}).append("path"),n.orient(e.orient()),c.each(function(a,l,i){var d=e.values(a,l);n.median(d.median).upperQuartile(d.upperQuartile).lowerQuartile(d.lowerQuartile).width(d.width).high(d.high).low(d.low),o(t.select(i[l])).attr("transform",r(d)).select("path").attr("d",n([a]))}),e.decorate()(c,l,i)})};return V(o,e),b(o,a,"key"),b(o,n,"cap"),o},e.seriesSvgCandlestick=function(){return Xe(Ge(),"candlestick")},e.seriesSvgErrorBar=function(){var e=Oe(),a=v("g","error-bar"),n=_e().value(0),l=function(e){return function(a){return e.selection?a.transition(e):a}},r=function(e){return"translate("+e.origin[0]+", "+e.origin[1]+")"},o=function(i){i.selection&&a.transition(i);var o=l(i);i.each(function(l,i,d){var h=l.filter(e.defined()),c=h.map(e.values),s=a(t.select(d[i]),h);s.enter().attr("stroke",z.black).attr("fill",z.gray).attr("transform",function(a,t){return r(e.values(a,t))+" scale(1e-6, 1)"}).append("path"),n.orient(e.orient()),s.each(function(e,a,l){var i=c[a];n.high(i.high).low(i.low).width(i.width),o(t.select(l[a])).attr("transform",r(i)+" scale(1)").select("path").attr("d",n([e]))}),e.decorate()(s,l,i)})};return V(o,e),b(o,a,"key"),o},e.seriesSvgGrouped=function(e){var a=$e(),n=v("g","grouped"),l=function(l){l.selection&&n.transition(l),l.each(function(l,i,d){var r=n(t.select(d[i]),l);r.enter().append("g"),r.select("g").each(function(n,r,o){var h=t.select(o[r]),c="horizontal"!==e.orient(),s=function(e,t){var n=a.offsetScaleForDatum(l,e,t),i=c?a.xScale():a.yScale();return i(e)+n(r)+n.bandwidth()/2};c?(e.xScale(s),e.yScale(a.yScale())):(e.yScale(s),e.xScale(a.xScale())),e.bandwidth&&e.bandwidth(function(e,t){return a.offsetScaleForDatum(l,e,t).bandwidth()}),e.decorate(function(e,t){return a.decorate()(e,t,r)}),h.call(e)})})};return V(l,e,A("decorate","xScale","yScale")),V(l,a,A("offsetScaleForDatum")),l},e.seriesSvgHeatmap=function(){var e=aa(),a=v("g","box"),n=function(e){return"translate("+e.x+", "+e.y+")"},l=function(l){l.each(function(l,i,d){var r=l.filter(e.defined()),o=e.colorValue(),h=e.colorInterpolate(),c=e.colorScale(r),s=a(t.select(d[i]),r);s.enter().append("path").attr("stroke","transparent"),s.attr("transform",function(a,t){return n(e.values(a,t))}).select("path").attr("d",function(a,t){return e.pathGenerator.width(e.values(a,t).width).height(e.values(a,t).height)([a])}).attr("fill",function(e,a){return h(c(o(e,a)))}),e.decorate()(s,l,i)})};return V(l,e),l},e.seriesSvgLine=C,e.seriesSvgMulti=Ke,e.seriesSvgOhlc=function(){return Xe(Ne(),"ohlc")},e.seriesSvgPoint=function(){var e=a.symbol(),n=I(),l=v("g","point"),r=function(e){return"translate("+e[0]+", "+e[1]+")"},o=function(a){a.selection&&l.transition(a),a.each(function(a,i,d){var o=a.filter(n.defined()),h=l(t.select(d[i]),o);h.enter().attr("transform",function(e,a){return r(n.values(e,a).origin)}).attr("fill",z.gray).attr("stroke",z.black).append("path"),h.attr("transform",function(e,a){return r(n.values(e,a).origin)}).select("path").attr("d",e),n.decorate()(h,a,i)})};return V(o,n,A("baseValue","bandwidth","align")),b(o,l,"key"),b(o,e,"type","size"),o},e.seriesSvgRepeat=function(){var e="vertical",a=C(),n=Ke(),l=function(l){return l.each(function(l,i,d){"vertical"===e?n.series(l[0].map(function(){return a})).mapping(function(e,a){return e.map(function(e){return e[a]})}):n.series(l.map(function(){return a})).mapping(function(e,a){return e[a]}),t.select(d[i]).call(n)})};return l.series=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],l):a},l.orient=function(){return arguments.length?(e=0>=arguments.length?void 0:arguments[0],l):e},V(l,n,A("series","mapping")),l},e.seriesWebglArea=function(){var e=I(),a=Ce(),t=function(t){var n=j(e.xScale()),l=j(e.yScale()),r=new Float32Array(t.length),o=new Float32Array(t.length),h=new Float32Array(t.length),c=new Float32Array(t.length);t.forEach(function(a,t){r[t]=n.scale(e.crossValue()(a,t)),o[t]=l.scale(e.mainValue()(a,t)),h[t]=l.scale(e.baseValue()(a,t)),c[t]=e.defined()(a,t)}),a.xValues(r).yValues(o).y0Values(h).defined(c).xScale(n.glScale).yScale(l.glScale).decorate(function(a){return e.decorate()(a,t,0)}),a(t.length)};return V(t,e,A("bandwidth","align")),b(t,a,"context"),t},e.seriesWebglBar=function(){var e=I(),a=Pe(),t=function(t){var n=t.filter(e.defined()),l=j(e.xScale()),r=j(e.yScale()),o=new Float32Array(n.length),h=new Float32Array(n.length),c=new Float32Array(n.length),s=new Float32Array(n.length);n.forEach(function(a,t){o[t]=l.scale(e.crossValue()(a,t)),s[t]=l.scale(e.bandwidth()(a,t)),h[t]=r.scale(e.baseValue()(a,t)),c[t]=r.scale(e.mainValue()(a,t))}),a.xValues(o).y0Values(h).yValues(c).widths(s).xScale(l.glScale).yScale(r.glScale).decorate(function(a){e.decorate()(a,n,0)}),a(n.length)};return V(t,e,A("align")),b(t,a,"context"),t},e.seriesWebglBoxPlot=function(){var e=je(),a=E(.5),t=Qe(),n=function(n){var l=n.filter(e.defined()),r=j(e.xScale()),o=j(e.yScale()),h=new Float32Array(l.length),c=new Float32Array(l.length),s=new Float32Array(l.length),g=new Float32Array(l.length),u=new Float32Array(l.length),f=new Float32Array(l.length),p=new Float32Array(l.length),y=new Float32Array(l.length);l.forEach(function(t,n){h[n]=r.scale(e.crossValue()(t,n)),c[n]=o.scale(e.medianValue()(t,n)),s[n]=o.scale(e.upperQuartileValue()(t,n)),g[n]=r.scale(e.lowerQuartileValue()(t,n)),u[n]=o.scale(e.highValue()(t,n)),f[n]=o.scale(e.lowValue()(t,n)),p[n]=e.bandwidth()(t,n),y[n]=p[n]*a(t,n)}),t.xValues(h).medianValues(c).upperQuartileValues(s).lowerQuartileValues(g).highValues(u).lowValues(f).bandwidth(p).capWidth(y).xScale(r.glScale).yScale(o.glScale),t(l.length)};return n.cap=function(){return arguments.length?(a=E(0>=arguments.length?void 0:arguments[0]),n):a},V(n,e,A("align")),b(n,t,"context","lineWidth"),n},e.seriesWebglCandlestick=function(){return Me(Re())},e.seriesWebglErrorBar=function(){var e=Oe(),a=Ie(),t=function(t){var n=t.filter(e.defined()),l=j(e.xScale()),r=j(e.yScale()),o=new Float32Array(n.length),h=new Float32Array(n.length),c=new Float32Array(n.length),s=new Float32Array(n.length);n.forEach(function(a,t){o[t]=l.scale(e.crossValue()(a,t)),h[t]=r.scale(e.highValue()(a,t)),c[t]=r.scale(e.lowValue()(a,t)),s[t]=e.bandwidth()(a,t)}),a.xValues(o).highValues(h).lowValues(c).bandwidth(s).xScale(l.glScale).yScale(r.glScale),a(n.length)};return V(t,e,A("align")),b(t,a,"context","lineWidth"),t},e.seriesWebglLine=function(){function e(){return"vertical"===a.orient()?{x:a.crossValue(),y:a.mainValue(),defined:a.defined()}:{x:a.mainValue(),y:a.crossValue(),defined:a.defined()}}var a=I(),t=Te(),n=function(n){var l=j(a.xScale()),r=j(a.yScale()),o=e(),h=new Float32Array(n.length),c=new Float32Array(n.length),s=new Float32Array(n.length);n.forEach(function(e,a){h[a]=l.scale(o.x(e,a)),c[a]=r.scale(o.y(e,a)),s[a]=o.defined(e,a)}),t.xValues(h).yValues(c).defined(s).xScale(l.glScale).yScale(r.glScale).decorate(function(e){a.decorate()(e,n,0)}),t(n.length)};return V(n,a,A("baseValue","bandwidth","align")),b(n,t,"context","lineWidth"),n},e.seriesWebglMulti=Ze,e.seriesWebglOhlc=function(){return Me(Be())},e.seriesWebglPoint=function(){function e(){return"vertical"===a.orient()?{x:a.crossValue(),y:a.mainValue()}:{x:a.mainValue(),y:a.crossValue()}}var a=I(),t=64,n=y.symbolCircle,l=we(),i=function(i){var d=i.filter(a.defined()),r=j(a.xScale()),o=j(a.yScale()),h=ve(n),c=e(),s=new Float32Array(d.length),g=new Float32Array(d.length),u=new Float32Array(d.length);d.forEach(function(e,a){var n="function"==typeof t?t:function(){return t};s[a]=r.scale(c.x(e,a)),g[a]=o.scale(c.y(e,a)),u[a]=n(e)}),l.xValues(s).yValues(g).sizes(u).xScale(r.glScale).yScale(o.glScale).type(h).decorate(function(e){return a.decorate()(e,d,0)}),l(d.length)};return i.size=function(){return arguments.length?(t=0>=arguments.length?void 0:arguments[0],i):t},i.type=function(){return arguments.length?(n=0>=arguments.length?void 0:arguments[0],i):n},V(i,a,A("baseValue","bandwidth","align")),b(i,l,"context"),i},e.seriesWebglRepeat=Je,Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -6,2 +6,10 @@ # Change Log | ||
## [4.3.8](https://github.com/d3fc/d3fc/compare/@d3fc/d3fc-series@4.3.7...@d3fc/d3fc-series@4.3.8) (2020-01-24) | ||
**Note:** Version bump only for package @d3fc/d3fc-series | ||
## [4.3.7](https://github.com/d3fc/d3fc/compare/@d3fc/d3fc-series@4.3.6...@d3fc/d3fc-series@4.3.7) (2020-01-22) | ||
@@ -8,0 +16,0 @@ |
{ | ||
"name": "@d3fc/d3fc-series", | ||
"version": "4.3.7", | ||
"version": "4.3.8", | ||
"description": "A collection of components for rendering data series to SVG and canvas, including line, bar, OHLC, candlestick and more", | ||
@@ -35,3 +35,3 @@ "license": "MIT", | ||
"@d3fc/d3fc-shape": "^5.0.19", | ||
"@d3fc/d3fc-webgl": "^1.3.2", | ||
"@d3fc/d3fc-webgl": "^1.3.3", | ||
"d3-array": "^1.0.0", | ||
@@ -45,3 +45,3 @@ "d3-scale": "^1.0.1", | ||
}, | ||
"gitHead": "2dbc0e344f81c0784d0c658d48b13f45f98e70f9" | ||
"gitHead": "c9280ea65994ef03f13de0d879eabf0db98ce0d3" | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
545667
7803
Updated@d3fc/d3fc-webgl@^1.3.3