@d3fc/d3fc-series
Advanced tools
Comparing version 4.0.10 to 4.0.11
@@ -1,1 +0,1 @@ | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-selection"),require("d3-shape"),require("d3-scale"),require("d3-path"),require("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-shape","d3-scale","d3-path","d3-array"],t):t(n.fc=n.fc||{},n.d3,n.d3,n.d3,n.d3,n.d3)}(this,function(n,t,e,r,i,o){"use strict";function a(){var n=arguments;return function(t,e){for(var r=0,i=n.length;r<i;r++)if(null==n[r](t,e))return!1;return!0}}var u=function(n,t){n=n||"g";var e=function(n,t){return t},r=null,i=function(i,o){o=o||function(n){return n};var a=i.selection?i:null;a&&(i=i.selection());var u=i.selectAll(function(n,t,e){return Array.from(e[t].childNodes).filter(function(n){return 1===n.nodeType})}).filter(null==t?n:n+"."+t),l=u.data(o,e),c=l.enter().append(n).attr("class",t),f=l.exit();l=l.merge(c);var h=a||r;return h&&(l=l.transition(h).style("opacity",1),c.style("opacity",1e-6),f=f.transition(h).style("opacity",1e-6)),f.remove(),l.enter=function(){return c},l.exit=function(){return f},l};return i.element=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],i):n},i.className=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],i):t},i.key=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],i):e},i.transition=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],i):r},i},l=function(n,t,e){var r=t[e];if("function"!=typeof r)throw new Error("Attempt to rebind "+e+" which isn't a function on the source object");return function(){for(var e=arguments.length,i=Array(e),o=0;o<e;o++)i[o]=arguments[o];var a=r.apply(t,i);return a===t?n:a}},c=function(n,t){for(var e=arguments.length,r=Array(e>2?e-2:0),i=2;i<e;i++)r[i-2]=arguments[i];var o=!0,a=!1,u=void 0;try{for(var c,f=r[Symbol.iterator]();!(o=(c=f.next()).done);o=!0){var h=c.value;n[h]=l(n,t,h)}}catch(n){a=!0,u=n}finally{try{!o&&f.return&&f.return()}finally{if(a)throw u}}return n},f=function(n){return function(t){return n.reduce(function(n,t){return n&&t(n)},t)}},h=function(n,t){for(var e=arguments.length,r=Array(e>2?e-2:0),i=2;i<e;i++)r[i-2]=arguments[i];var o=f(r),a=!0,u=!1,c=void 0;try{for(var h,d=Object.keys(t)[Symbol.iterator]();!(a=(h=d.next()).done);a=!0){var s=h.value,g=o(s);g&&(n[g]=l(n,t,s))}}catch(n){u=!0,c=n}finally{try{!a&&d.return&&d.return()}finally{if(u)throw c}}return n},d=function(n){return n.map(function(n){return"string"==typeof n?new RegExp("^"+n+"$"):n})},s=function(){for(var n=arguments.length,t=Array(n),e=0;e<n;e++)t[e]=arguments[e];return t=d(t),function(n){return t.every(function(t){return!t.test(n)})&&n}},g=function(n){return function(t){return n[t]}},v=function(n){return"function"==typeof n?n:function(){return n}},p=function(n,t){switch(n){case"left":return t/2;case"right":return-t/2;default:return 0}},y=function(n){var t=Object.assign({},n),e=function(){};return Object.keys(t).forEach(function(n){e[n]=function(){return arguments.length?(t[n]=arguments.length<=0?void 0:arguments[0],e):t[n]}}),e},w=function(){var n=function(){return 0},t=function(n){return n.x},e=function(n){return n.y},i="center",o=function(){return 5},u="vertical",l=y({decorate:function(){},defined:function(r,i){return a(n,t,e)(r,i)},xScale:r.scaleIdentity(),yScale:r.scaleIdentity()});return l.values=function(r,a){var c=o(r,a),f=p(i,c),h=l.xScale(),d=l.yScale();if("vertical"===u){var s=d(e(r,a),a),g=d(n(r,a),a),v=h(t(r,a),a)+f;return{d:r,x:v,y:s,y0:g,width:c,height:s-g,origin:[v,s],baseOrigin:[v,g],transposedX:v,transposedY:s}}var y=h(e(r,a),a),w=h(n(r,a),a),m=d(t(r,a),a)+f;return{d:r,x:m,y:y,y0:w,width:c,height:y-w,origin:[y,m],baseOrigin:[w,m],transposedX:y,transposedY:m}},l.baseValue=function(){return arguments.length?(n=v(arguments.length<=0?void 0:arguments[0]),l):n},l.crossValue=function(){return arguments.length?(t=v(arguments.length<=0?void 0:arguments[0]),l):t},l.mainValue=function(){return arguments.length?(e=v(arguments.length<=0?void 0:arguments[0]),l):e},l.bandwidth=function(){return arguments.length?(o=v(arguments.length<=0?void 0:arguments[0]),l):o},l.align=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],l):i},l.orient=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],l):u},l},m={red:"#c60",green:"#6c0",black:"#000",gray:"#ddd",darkGray:"#999"},x=function(){var n=w(),r=e.line().defined(n.defined()).x(function(t,e){return n.values(t,e).transposedX}).y(function(t,e){return n.values(t,e).transposedY}),i=u("path","line"),o=function(e){e.selection&&i.transition(e),e.each(function(e,o,a){var u=i(t.select(a[o]),[e]);u.enter().attr("fill","none").attr("stroke",m.black),u.attr("d",r),n.decorate()(u,e,o)})};return h(o,n,s("baseValue","bandwidth","align")),c(o,i,"key"),c(o,r,"curve"),o},S=function(){var n=w(),t=e.line().defined(n.defined()).x(function(t,e){return n.values(t,e).transposedX}).y(function(t,e){return n.values(t,e).transposedY}),r=function(e){var r=t.context();r.beginPath(),t(e),r.strokeStyle=m.black,r.fillStyle="transparent",n.decorate()(r,e),r.fill(),r.stroke(),r.closePath()};return h(r,n,s("baseValue","bandwidth","align")),c(r,t,"curve","context"),r},b=function(){var n=e.symbol(),r=w(),i=u("g","point"),o=function(n){return"translate("+n[0]+", "+n[1]+")"},a=function(e){e.selection&&i.transition(e),e.each(function(e,a,u){var l=e.filter(r.defined()),c=i(t.select(u[a]),l);c.enter().attr("transform",function(n,t){return o(r.values(n,t).origin)}).attr("fill",m.gray).attr("stroke",m.black).append("path"),c.attr("transform",function(n,t){return o(r.values(n,t).origin)}).select("path").attr("d",n),r.decorate()(c,e,a)})};return h(a,r,s("baseValue","bandwidth","align")),c(a,i,"key"),c(a,n,"type","size"),a},k=function(){var n=e.symbol(),t=w(),r=function(e){var r=e.filter(t.defined()),i=n.context();r.forEach(function(r,o){i.save();var a=t.values(r,o);i.translate(a.origin[0],a.origin[1]),i.beginPath(),n(e),i.strokeStyle=m.black,i.fillStyle=m.gray,t.decorate()(i,r,o),i.fill(),i.stroke(),i.closePath(),i.restore()})};return h(r,t,s("baseValue","bandwidth","align")),c(r,n,"size","type","context"),r},T=function(n){return"function"==typeof n?n:function(){return n}},V=function(){var n=null,t=function(n){return n.date},e=function(n){return n.open},r=function(n){return n.high},o=function(n){return n.low},a=function(n){return n.close},u="vertical",l=T(3),c=function(c){var f=n||i.path();return c.forEach(function(n,i){var c=t(n,i),h=e(n,i),d=r(n,i),s=o(n,i),g=a(n,i),v=l(n,i)/2;"vertical"===u?(f.moveTo(c,s),f.lineTo(c,d),f.moveTo(c,h),f.lineTo(c-v,h),f.moveTo(c,g),f.lineTo(c+v,g)):(f.moveTo(s,c),f.lineTo(d,c),f.moveTo(h,c),f.lineTo(h,c+v),f.moveTo(g,c),f.lineTo(g,c-v))}),n?null:f.toString()};return c.context=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],c):n},c.x=function(){return arguments.length?(t=T(arguments.length<=0?void 0:arguments[0]),c):t},c.open=function(){return arguments.length?(e=T(arguments.length<=0?void 0:arguments[0]),c):e},c.high=function(){return arguments.length?(r=T(arguments.length<=0?void 0:arguments[0]),c):r},c.low=function(){return arguments.length?(o=T(arguments.length<=0?void 0:arguments[0]),c):o},c.close=function(){return arguments.length?(a=T(arguments.length<=0?void 0:arguments[0]),c):a},c.width=function(){return arguments.length?(l=T(arguments.length<=0?void 0:arguments[0]),c):l},c.orient=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],c):u},c},A=function(){var n=null,t=function(n){return n.x},e=function(n){return n.y},r="center",o="center",a=function(n){return n.height},u=T(3),l=function(l,c){var f=n||i.path();return l.forEach(function(n,i){var l=t.call(this,n,c||i),h=e.call(this,n,c||i),d=a.call(this,n,c||i),s=u.call(this,n,c||i),g=void 0;switch(r){case"left":g=s;break;case"right":g=0;break;case"center":g=s/2;break;default:throw new Error("Invalid horizontal alignment "+r)}var v=void 0;switch(o){case"bottom":v=-d;break;case"top":v=0;break;case"center":v=d/2;break;default:throw new Error("Invalid vertical alignment "+o)}f.rect(l-g,h-v,s,d)},this),n?null:f.toString()};return l.context=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],l):n},l.x=function(){return arguments.length?(t=T(arguments.length<=0?void 0:arguments[0]),l):t},l.y=function(){return arguments.length?(e=T(arguments.length<=0?void 0:arguments[0]),l):e},l.width=function(){return arguments.length?(u=T(arguments.length<=0?void 0:arguments[0]),l):u},l.horizontalAlign=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],l):r},l.height=function(){return arguments.length?(a=T(arguments.length<=0?void 0:arguments[0]),l):a},l.verticalAlign=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],l):o},l},E=function(){var n=null,t=function(n){return n.date},e=function(n){return n.open},r=function(n){return n.high},o=function(n){return n.low},a=function(n){return n.close},u=T(3),l=function(l){var c=n||i.path();return l.forEach(function(n,i){var l=t(n,i),f=e(n,i),h=r(n,i),d=o(n,i),s=a(n,i),g=u(n,i),v=g/2;c.rect(l-v,f,g,s-f),c.moveTo(l,Math.min(s,f)),c.lineTo(l,h),c.moveTo(l,Math.max(s,f)),c.lineTo(l,d)}),n?null:c.toString()};return l.context=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],l):n},l.x=function(){return arguments.length?(t=T(arguments.length<=0?void 0:arguments[0]),l):t},l.open=function(){return arguments.length?(e=T(arguments.length<=0?void 0:arguments[0]),l):e},l.high=function(){return arguments.length?(r=T(arguments.length<=0?void 0:arguments[0]),l):r},l.low=function(){return arguments.length?(o=T(arguments.length<=0?void 0:arguments[0]),l):o},l.close=function(){return arguments.length?(a=T(arguments.length<=0?void 0:arguments[0]),l):a},l.width=function(){return arguments.length?(u=T(arguments.length<=0?void 0:arguments[0]),l):u},l},P=function(){var n=null,t=function(n){return n.value},e=function(n){return n.median},r=function(n){return n.upperQuartile},o=function(n){return n.lowerQuartile},a=function(n){return n.high},u=function(n){return n.low},l="vertical",c=T(5),f=T(.5),h=function(h){var d=n||i.path();return h.forEach(function(n,i){var h=t(n,i),s=c(n,i),g=s/2,v=s*f(n,i),p=v/2,y=a(n,i),w=r(n,i),m=e(n,i),x=o(n,i),S=u(n,i),b=x-w;"vertical"===l?(d.moveTo(h-p,y),d.lineTo(h+p,y),d.moveTo(h,y),d.lineTo(h,w),d.rect(h-g,w,s,b),d.moveTo(h-g,m),d.lineTo(h+g,m),d.moveTo(h,x),d.lineTo(h,S),d.moveTo(h-p,S),d.lineTo(h+p,S)):(d.moveTo(S,h-p),d.lineTo(S,h+p),d.moveTo(S,h),d.lineTo(x,h),d.rect(x,h-g,-b,s),d.moveTo(m,h-g),d.lineTo(m,h+g),d.moveTo(w,h),d.lineTo(y,h),d.moveTo(y,h-p),d.lineTo(y,h+p))}),n?null:d.toString()};return h.context=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],h):n},h.value=function(){return arguments.length?(t=T(arguments.length<=0?void 0:arguments[0]),h):t},h.median=function(){return arguments.length?(e=T(arguments.length<=0?void 0:arguments[0]),h):e},h.upperQuartile=function(){return arguments.length?(r=T(arguments.length<=0?void 0:arguments[0]),h):r},h.lowerQuartile=function(){return arguments.length?(o=T(arguments.length<=0?void 0:arguments[0]),h):o},h.high=function(){return arguments.length?(a=T(arguments.length<=0?void 0:arguments[0]),h):a},h.low=function(){return arguments.length?(u=T(arguments.length<=0?void 0:arguments[0]),h):u},h.width=function(){return arguments.length?(c=T(arguments.length<=0?void 0:arguments[0]),h):c},h.orient=function(){return arguments.length?(l=arguments.length<=0?void 0:arguments[0],h):l},h.cap=function(){return arguments.length?(f=T(arguments.length<=0?void 0:arguments[0]),h):f},h},Q=function(){var n=null,t=function(n){return n.x},e=function(n){return n.high},r=function(n){return n.low},o="vertical",a=T(5),u=function(u){var l=n||i.path();return u.forEach(function(n,i){var u=t(n,i),c=a(n,i),f=c/2,h=e(n,i),d=r(n,i);"vertical"===o?(l.moveTo(u-f,h),l.lineTo(u+f,h),l.moveTo(u,h),l.lineTo(u,d),l.moveTo(u-f,d),l.lineTo(u+f,d)):(l.moveTo(d,u-f),l.lineTo(d,u+f),l.moveTo(d,u),l.lineTo(h,u),l.moveTo(h,u-f),l.lineTo(h,u+f))}),n?null:l.toString()};return u.context=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],u):n},u.value=function(){return arguments.length?(t=T(arguments.length<=0?void 0:arguments[0]),u):t},u.high=function(){return arguments.length?(e=T(arguments.length<=0?void 0:arguments[0]),u):e},u.low=function(){return arguments.length?(r=T(arguments.length<=0?void 0:arguments[0]),u):r},u.width=function(){return arguments.length?(a=T(arguments.length<=0?void 0:arguments[0]),u):a},u.orient=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],u):o},u},I=function(){var n=A().x(0).y(0),e=w(),r=u("g","bar"),i=function(n){return"vertical"===e.orient()?n.height:n.width},o=function(n){return"vertical"===e.orient()?n.width:n.height},a=function(n){return"translate("+n[0]+", "+n[1]+")"},l=function(u){u.selection&&r.transition(u),u.each(function(u,l,c){var f=e.orient();if("vertical"!==f&&"horizontal"!==f)throw new Error("The bar series does not support an orientation of "+f);var h=u.filter(e.defined()),d=h.map(e.values);n.width(0).height(0),"vertical"===e.orient()?(n.verticalAlign("top"),n.horizontalAlign("center")):(n.horizontalAlign("right"),n.verticalAlign("center"));var s=r(t.select(c[l]),h);s.enter().attr("transform",function(n,t){return a(d[t].baseOrigin)}).attr("class","bar "+e.orient()).attr("fill",m.darkGray).append("path").attr("d",function(t,e){return o(n)(d[e].width),n([t])}),s.attr("transform",function(n,t){return a(d[t].origin)}).select("path").attr("d",function(t,e){return o(n)(d[e].width),i(n)(-d[e].height),n([t])}),e.decorate()(s,h,l)})};return h(l,e),c(l,r,"key"),l},B=function(){var n=w(),t=A().x(0).y(0),e=function(t){return"vertical"===n.orient()?t.height:t.width},r=function(t){return"vertical"===n.orient()?t.width:t.height},i=function(i){var o=t.context(),a=i.filter(n.defined()),u=a.map(n.values);"vertical"===n.orient()?(t.verticalAlign("top"),t.horizontalAlign("center")):(t.horizontalAlign("right"),t.verticalAlign("center")),u.forEach(function(i,a){o.save(),o.beginPath(),o.translate(i.origin[0],i.origin[1]),e(t)(-i.height),r(t)(i.width),t([i]),o.fillStyle=m.darkGray,o.strokeStyle="transparent",n.decorate()(o,i.d,a),o.fill(),o.stroke(),o.closePath(),o.restore()})};return h(i,n),c(i,t,"context"),i},C=function(){var n=function(n){return n.high},t=function(n){return n.low},e=function(n){return n.cross},i="vertical",o="center",u=function(){return 5},l=y({decorate:function(){},defined:function(r,i){return a(t,n,e)(r,i)},xScale:r.scaleIdentity(),yScale:r.scaleIdentity()});return l.values=function(r,a){var c=u(r,a),f=p(o,c),h=l.xScale(),d=l.yScale();if("vertical"===i){var s=d(n(r,a));return{origin:[h(e(r,a))+f,s],high:0,low:d(t(r,a))-s,width:c}}var g=h(t(r,a));return{origin:[g,d(e(r,a))+f],high:h(n(r,a))-g,low:0,width:c}},l.orient=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],l):i},l.lowValue=function(){return arguments.length?(t=v(arguments.length<=0?void 0:arguments[0]),l):t},l.highValue=function(){return arguments.length?(n=v(arguments.length<=0?void 0:arguments[0]),l):n},l.crossValue=function(){return arguments.length?(e=v(arguments.length<=0?void 0:arguments[0]),l):e},l.bandwidth=function(){return arguments.length?(u=v(arguments.length<=0?void 0:arguments[0]),l):u},l.align=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],l):o},l},O=function(){var n=C(),e=u("g","error-bar"),r=Q().value(0),i=function(n){return function(t){return n.selection?t.transition(n):t}},o=function(n){return"translate("+n.origin[0]+", "+n.origin[1]+")"},a=function(a){a.selection&&e.transition(a);var u=i(a);a.each(function(i,a,l){var c=i.filter(n.defined()),f=c.map(n.values),h=e(t.select(l[a]),c);h.enter().attr("stroke",m.black).attr("fill",m.gray).attr("transform",function(t,e){return o(n.values(t,e))+" scale(1e-6, 1)"}).append("path"),r.orient(n.orient()),h.each(function(n,e,i){var a=f[e];r.high(a.high).low(a.low).width(a.width),u(t.select(i[e])).attr("transform",o(a)+" scale(1)").select("path").attr("d",r([n]))}),n.decorate()(h,i,a)})};return h(a,n),c(a,e,"key"),a},z=function(){var n=C(),t=Q().value(0),e=function(e){var r=e.filter(n.defined()),i=t.context();t.orient(n.orient()),r.forEach(function(e,r){i.save();var o=n.values(e,r);i.translate(o.origin[0],o.origin[1]),i.beginPath(),t.high(o.high).width(o.width).low(o.low)([e]),i.strokeStyle=m.black,i.fillStyle=m.gray,n.decorate()(i,e,r),i.fill(),i.stroke(),i.closePath(),i.restore()})};return h(e,n),c(e,t,"context"),e},G=function(){var n=w(),r=e.area().defined(n.defined()),i=u("path","area"),o=function(e){e.selection&&i.transition(e),e.each(function(e,o,a){var u=e.map(n.values);r.x(function(n,t){return u[t].transposedX}).y(function(n,t){return u[t].transposedY});var l="vertical"===n.orient()?"y":"x";r[l+"0"](function(n,t){return u[t].y0}),r[l+"1"](function(n,t){return u[t].y});var c=i(t.select(a[o]),[e]);c.enter().attr("fill",m.gray),c.attr("d",r),n.decorate()(c,e,o)})};return h(o,n,s("bandwidth","align")),c(o,i,"key"),c(o,r,"curve"),o},F=function(){var n=w(),t=e.area().defined(n.defined()),r=function(e){var r=t.context(),i=e.map(n.values);t.x(function(n,t){return i[t].transposedX}).y(function(n,t){return i[t].transposedY});var o="vertical"===n.orient()?"y":"x";t[o+"0"](function(n,t){return i[t].y0}),t[o+"1"](function(n,t){return i[t].y}),r.beginPath(),t(e),r.fillStyle=m.gray,r.strokeStyle="transparent",n.decorate()(r,e),r.fill(),r.stroke(),r.closePath()};return h(r,n,s("bandwidth","align")),c(r,t,"curve","context"),r},j=function(){var n=void 0,t=function(n){return n.date},e=function(n){return n.open},i=function(n){return n.high},o=function(n){return n.low},u=function(n){return n.close},l=function(){return 5},c="center",f=function(e,r){return n.xScale()(t(e,r))};return n=y({decorate:function(){},defined:function(n,r){return a(t,e,o,i,u)(n,r)},xScale:r.scaleIdentity(),yScale:r.scaleIdentity()}),n.values=function(t,r){var a=u(t,r),h=e(t,r),d=l(t,r),s=p(c,d),g="";return a>h?g="up":a<h&&(g="down"),{cross:f(t,r)+s,open:n.yScale()(h),high:n.yScale()(i(t,r)),low:n.yScale()(o(t,r)),close:n.yScale()(a),width:d,direction:g}},n.crossValue=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],n):t},n.openValue=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],n):e},n.highValue=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],n):i},n.lowValue=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],n):o},n.yValue=n.closeValue=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],n):u},n.bandwidth=function(){return arguments.length?(l=v(arguments.length<=0?void 0:arguments[0]),n):l},n.align=function(){return arguments.length?(c=arguments.length<=0?void 0:arguments[0],n):c},n},D=function(n,e){var r=j(),i=u("g",e),o=function(n){return"translate("+n.cross+", "+n.high+")"},a=function(n){return function(t){return n.selection?t.transition(n):t}},l=function(u){u.selection&&i.transition(u);var l=a(u);u.each(function(a,u,c){var f=a.filter(r.defined()),h=i(t.select(c[u]),f);h.enter().attr("transform",function(n,t){return o(r.values(n,t))+" scale(1e-6, 1)"}).append("path"),h.each(function(i,a,u){var c=r.values(i,a),f="up"===c.direction?m.green:m.red,h=l(t.select(u[a])).attr("class",e+" "+c.direction).attr("stroke",f).attr("fill",f).attr("transform",function(){return o(c)+" scale(1)"});n.x(0).width(c.width).open(function(){return c.open-c.high}).high(0).low(function(){return c.low-c.high}).close(function(){return c.close-c.high}),h.select("path").attr("d",n([i]))}),r.decorate()(h,a,u)})};return c(l,i,"key"),h(l,r),l},M=function(){return D(E(),"candlestick")},X=function(n){var t=j(),e=function(e){var r=e.filter(t.defined()),i=n.context();r.forEach(function(e,r){i.save();var o=t.values(e,r);i.translate(o.cross,o.high),i.beginPath(),n.x(0).open(function(){return o.open-o.high}).width(o.width).high(0).low(function(){return o.low-o.high}).close(function(){return o.close-o.high})([e]);var a="up"===o.direction?m.green:m.red;i.strokeStyle=a,i.fillStyle=a,t.decorate()(i,e,r),i.fill(),i.stroke(),i.closePath(),i.restore()})};return c(e,n,"context"),h(e,t),e},Y=function(){return X(E())},q=function(){var n=function(n){return n.upperQuartile},t=function(n){return n.lowerQuartile},e=function(n){return n.high},i=function(n){return n.low},o=function(n){return n.value},u=function(n){return n.median},l="vertical",c="center",f=function(){return 5},h=y({decorate:function(){},defined:function(r,l){return a(i,e,t,n,o,u)(r,l)},xScale:r.scaleIdentity(),yScale:r.scaleIdentity()});return h.values=function(r,a){var d=f(r,a),s=p(c,d),g=h.xScale(),v=h.yScale();if("vertical"===l){var y=v(e(r,a));return{origin:[g(o(r,a))+s,y],high:0,upperQuartile:v(n(r,a))-y,median:v(u(r,a))-y,lowerQuartile:v(t(r,a))-y,low:v(i(r,a))-y,width:d}}var w=g(i(r,a));return{origin:[w,v(o(r,a))+s],high:g(e(r,a))-w,upperQuartile:g(n(r,a))-w,median:g(u(r,a))-w,lowerQuartile:g(t(r,a))-w,low:0,width:d}},h.orient=function(){return arguments.length?(l=arguments.length<=0?void 0:arguments[0],h):l},h.lowerQuartileValue=function(){return arguments.length?(t=v(arguments.length<=0?void 0:arguments[0]),h):t},h.upperQuartileValue=function(){return arguments.length?(n=v(arguments.length<=0?void 0:arguments[0]),h):n},h.lowValue=function(){return arguments.length?(i=v(arguments.length<=0?void 0:arguments[0]),h):i},h.highValue=function(){return arguments.length?(e=v(arguments.length<=0?void 0:arguments[0]),h):e},h.crossValue=function(){return arguments.length?(o=v(arguments.length<=0?void 0:arguments[0]),h):o},h.medianValue=function(){return arguments.length?(u=v(arguments.length<=0?void 0:arguments[0]),h):u},h.bandwidth=function(){return arguments.length?(f=v(arguments.length<=0?void 0:arguments[0]),h):f},h.align=function(){return arguments.length?(c=arguments.length<=0?void 0:arguments[0],h):c},h},L=function(){var n=q(),e=u("g","box-plot"),r=P().value(0),i=function(n){return function(t){return n.selection?t.transition(n):t}},o=function(n){return"translate("+n.origin[0]+", "+n.origin[1]+")"},a=function(a){a.selection&&e.transition(a);var u=i(a);a.each(function(i,a,l){var c=i.filter(n.defined()),f=e(t.select(l[a]),c);f.enter().attr("stroke",m.black).attr("fill",m.gray).attr("transform",function(t,e){return o(n.values(t,e))+" scale(1e-6, 1)"}).append("path"),r.orient(n.orient()),f.each(function(e,i,a){var l=n.values(e,i);r.median(l.median).upperQuartile(l.upperQuartile).lowerQuartile(l.lowerQuartile).width(l.width).high(l.high).low(l.low),u(t.select(a[i])).attr("transform",o(l)).select("path").attr("d",r([e]))}),n.decorate()(f,i,a)})};return h(a,n),c(a,e,"key"),c(a,r,"cap"),a},R=function(){var n=q(),t=P().value(0),e=function(e){var r=e.filter(n.defined()),i=t.context();t.orient(n.orient()),r.forEach(function(e,r){i.save();var o=n.values(e,r);i.translate(o.origin[0],o.origin[1]),i.beginPath(),t.median(o.median).upperQuartile(o.upperQuartile).lowerQuartile(o.lowerQuartile).high(o.high).width(o.width).low(o.low)([e]),i.fillStyle=m.gray,i.strokeStyle=m.black,n.decorate()(i,e,r),i.fill(),i.stroke(),i.closePath(),i.restore()})};return h(e,n),c(e,t,"cap","context"),e},H=function(){return D(V(),"ohlc")},N=function(){return X(V())},_=function(){var n=[],t=function(n){return n},e=function(n,t){return t},i=y({decorate:function(){},xScale:r.scaleIdentity(),yScale:r.scaleIdentity()});return i.mapping=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],i):t},i.key=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],i):e},i.series=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],i):n},i},$=function(){var n=_(),e=u("g"),r=u("g","multi"),i=function(i){i.selection&&(r.transition(i),e.transition(i));var o=n.mapping(),a=n.series(),u=n.xScale(),l=n.yScale();i.each(function(i,c,f){var h=r(t.select(f[c]),a);h.each(function(n,r,c){n.xScale(u).yScale(l);var f=o(i,r,a);e(t.select(c[r]),[f]).call(n)}),(h.selection?h.selection():h).order(),n.decorate()(h,i,c)})};return h(i,n),c(i,r,"key"),i},J=function(){var n=null,t=_(),e=function(e){var r=t.mapping(),i=t.series(),o=t.xScale(),a=t.yScale();i.forEach(function(u,l){var c=r(e,l,i);u.context(n).xScale(o).yScale(a);var f=u.decorate();u.decorate(function(n,r,i){t.decorate()(n,e,l),f(n,r,i)}),u(c),u.decorate(f)})};return e.context=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],e):n},h(e,t),e},K=function(n){var t=function(){return 50},e="center",i=r.scaleBand(),a=y({decorate:function(){},xScale:r.scaleLinear()});return a.offsetScaleForDatum=function(n,r,a){var u=t(r,a),l=p(e,u),c=u/2;return i.domain(o.range(0,n.length)).range([-c+l,c+l])},a.bandwidth=function(){return arguments.length?(t=v(arguments.length<=0?void 0:arguments[0]),a):t},a.align=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],a):e},h(a,i,g({paddingInner:"paddingOuter"})),a},U=function(n){var e=K(),r=u("g","grouped"),i=function(i){i.selection&&r.transition(i),i.each(function(i,o,a){var u=r(t.select(a[o]),i);u.enter().append("g"),u.select("g").each(function(r,o,a){var u=t.select(a[o]),l=function(n,t){var r=e.offsetScaleForDatum(i,n,t);return e.xScale()(n)+r(o)+r.bandwidth()/2};n.xScale(l),n.bandwidth&&n.bandwidth(function(n,t){return e.offsetScaleForDatum(i,n,t).bandwidth()}),n.decorate(function(n,t){return e.decorate()(n,t,o)}),u.call(n)})})};return h(i,n,s("decorate","xScale")),h(i,e,s("offsetScaleForDatum")),i},W=function(n){var t=K(),e=function(e){e.forEach(function(r,i){var o=function(n,r){var o=t.offsetScaleForDatum(e,n,r);return t.xScale()(n)+o(i)+o.bandwidth()/2};n.xScale(o),n.bandwidth&&n.bandwidth(function(n,r){return t.offsetScaleForDatum(e,n,r).bandwidth()}),n.decorate(function(n,e){return t.decorate()(n,e,i)}),n(r)})};return h(e,n,s("decorate","xScale")),h(e,t,s("configureOffsetScale","configureOffset")),e},Z=function(){var n="vertical",e=x(),r=$(),i=function(i){return i.each(function(i,o,a){"vertical"===n?r.series(i[0].map(function(n){return e})).mapping(function(n,t){return n.map(function(n){return n[t]})}):r.series(i.map(function(n){return e})).mapping(function(n,t){return n[t]}),t.select(a[o]).call(r)})};return i.series=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],i):e},i.orient=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],i):n},h(i,r,s("series","mapping")),i},nn=function(){var n="vertical",t=S(),e=J(),r=function(r){"vertical"===n?e.series(r[0].map(function(n){return t})).mapping(function(n,t){return n.map(function(n){return n[t]})}):e.series(r.map(function(n){return t})).mapping(function(n,t){return n[t]}),e(r)};return r.series=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],r):t},r.orient=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],r):n},h(r,e,s("series","mapping")),r},tn=function(n){if(Array.isArray(n)){for(var t=0,e=Array(n.length);t<n.length;t++)e[t]=n[t];return e}return Array.from(n)},en=function(n){return n.sort(o.ascending).filter(function(n,t,e){return-1===e.indexOf(n,t+1)})},rn=function(n){var e=.75,r=function(n){if(n.length<=1)return 10;n=en(n);var t=o.pairs(n).map(function(n){return Math.abs(n[0]-n[1])}),r=o.min(t);return e*r},i=function(t,e,i){if(t.bandwidth)return t.bandwidth();var o,a=Array.isArray(e)?(o=[]).concat.apply(o,tn(e)):e,u=a.filter(n.defined()).map(i()).map(t);return r(u)},a=function(e){var r=function(t){if(n.xBandwidth&&n.yBandwidth)n.xBandwidth(i(n.xScale(),t,n.xValue)),n.yBandwidth(i(n.yScale(),t,n.yValue));else{var e=n.orient&&"horizontal"===n.orient()?n.yScale():n.xScale();n.bandwidth(i(e,t,n.crossValue))}};e instanceof t.selection?e.each(function(e,i,o){r(e),n(t.select(o[i]))}):(r(e),n(e))};return h(a,n),a.widthFraction=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],a):e},a},on=function(){var n=function(n){return n.x},t=function(n){return n.y},e=function(n){return n.color},i=function(){return 5},u=function(){return 5},l=r.interpolateViridis,c=y({decorate:function(){},defined:function(r,i){return a(n,t,e)(r,i)},xScale:r.scaleIdentity(),yScale:r.scaleIdentity()});return c.pathGenerator=A().x(0).y(0),c.colorScale=function(n){var t=n.map(e);return r.scaleLinear().domain([o.min(t),o.max(t)])},c.values=function(r,o){return{x:c.xScale()(n(r,o)),y:c.yScale()(t(r,o)),colorValue:e(r,o),width:u(r,o),height:i(r,o)}},c.xValue=function(){return arguments.length?(n=v(arguments.length<=0?void 0:arguments[0]),c):n},c.yValue=function(){return arguments.length?(t=v(arguments.length<=0?void 0:arguments[0]),c):t},c.colorValue=function(){return arguments.length?(e=v(arguments.length<=0?void 0:arguments[0]),c):e},c.colorInterpolate=function(){return arguments.length?(l=arguments.length<=0?void 0:arguments[0],c):l},c.xBandwidth=function(){return arguments.length?(u=v(arguments.length<=0?void 0:arguments[0]),c):u},c.yBandwidth=function(){return arguments.length?(i=v(arguments.length<=0?void 0:arguments[0]),c):i},h(c,c.pathGenerator,g({horizontalAlign:"xAlign",verticalAlign:"yAlign"})),c},an=function(){var n=on(),e=u("g","box"),r=function(n){return"translate("+n.x+", "+n.y+")"},i=function(i){i.each(function(i,o,a){var u=i.filter(n.defined()),l=n.colorValue(),c=n.colorInterpolate(),f=n.colorScale(u),h=e(t.select(a[o]),u);h.enter().append("path").attr("stroke","transparent"),h.attr("transform",function(t,e){return r(n.values(t,e))}).select("path").attr("d",function(t,e){return n.pathGenerator.width(n.values(t,e).width).height(n.values(t,e).height)([t])}).attr("fill",function(n,t){return c(f(l(n,t)))}),n.decorate()(h,i,o)})};return h(i,n),i},un=function(){var n=on(),t=function(t){var e=t.filter(n.defined()),r=(n.colorValue(),n.colorInterpolate()),i=n.colorScale(e),o=n.pathGenerator.context();e.forEach(function(t,e){o.save(),o.beginPath();var a=n.values(t,e);o.translate(a.x,a.y),o.fillStyle=r(i(a.colorValue)),o.strokeStyle="transparent",n.pathGenerator.height(a.height).width(a.width)([t]),n.decorate()(o,t,e),o.fill(),o.stroke(),o.closePath(),o.restore()})};return c(t,n.pathGenerator,"context"),h(t,n),t};n.seriesSvgLine=x,n.seriesCanvasLine=S,n.seriesSvgPoint=b,n.seriesCanvasPoint=k,n.seriesSvgBar=I,n.seriesCanvasBar=B,n.seriesSvgErrorBar=O,n.seriesCanvasErrorBar=z,n.seriesSvgArea=G,n.seriesCanvasArea=F,n.seriesSvgCandlestick=M,n.seriesCanvasCandlestick=Y,n.seriesSvgBoxPlot=L,n.seriesCanvasBoxPlot=R,n.seriesSvgOhlc=H,n.seriesCanvasOhlc=N,n.seriesSvgMulti=$,n.seriesCanvasMulti=J,n.seriesSvgGrouped=U,n.seriesCanvasGrouped=W,n.seriesSvgRepeat=Z,n.seriesCanvasRepeat=nn,n.autoBandwidth=rn,n.seriesSvgHeatmap=an,n.seriesCanvasHeatmap=un,Object.defineProperty(n,"__esModule",{value:!0})}); | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-selection"),require("d3-shape"),require("d3-scale"),require("d3-path"),require("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-shape","d3-scale","d3-path","d3-array"],t):t(n.fc=n.fc||{},n.d3,n.d3,n.d3,n.d3,n.d3)}(this,function(n,t,e,r,i,o){"use strict";function a(){var n=arguments;return function(t,e){for(var r=0,i=n.length;r<i;r++)if(null==n[r](t,e))return!1;return!0}}var u=function(n,t){n=n||"g";var e=function(n,t){return t},r=null,i=function(i,o){o=o||function(n){return n};var a=i.selection?i:null;a&&(i=i.selection());var u=i.selectAll(function(n,t,e){return Array.from(e[t].childNodes).filter(function(n){return 1===n.nodeType})}).filter(null==t?n:n+"."+t),l=u.data(o,e),c=l.enter().append(n).attr("class",t),f=l.exit();l=l.merge(c);var h=a||r;return h&&(l=l.transition(h).style("opacity",1),c.style("opacity",1e-6),f=f.transition(h).style("opacity",1e-6)),f.remove(),l.enter=function(){return c},l.exit=function(){return f},l};return i.element=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],i):n},i.className=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],i):t},i.key=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],i):e},i.transition=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],i):r},i},l=function(n,t,e){var r=t[e];if("function"!=typeof r)throw new Error("Attempt to rebind "+e+" which isn't a function on the source object");return function(){for(var e=arguments.length,i=Array(e),o=0;o<e;o++)i[o]=arguments[o];var a=r.apply(t,i);return a===t?n:a}},c=function(n,t){for(var e=arguments.length,r=Array(e>2?e-2:0),i=2;i<e;i++)r[i-2]=arguments[i];var o=!0,a=!1,u=void 0;try{for(var c,f=r[Symbol.iterator]();!(o=(c=f.next()).done);o=!0){var h=c.value;n[h]=l(n,t,h)}}catch(n){a=!0,u=n}finally{try{!o&&f.return&&f.return()}finally{if(a)throw u}}return n},f=function(n){return function(t){return n.reduce(function(n,t){return n&&t(n)},t)}},h=function(n,t){for(var e=arguments.length,r=Array(e>2?e-2:0),i=2;i<e;i++)r[i-2]=arguments[i];var o=f(r),a=!0,u=!1,c=void 0;try{for(var h,d=Object.keys(t)[Symbol.iterator]();!(a=(h=d.next()).done);a=!0){var s=h.value,g=o(s);g&&(n[g]=l(n,t,s))}}catch(n){u=!0,c=n}finally{try{!a&&d.return&&d.return()}finally{if(u)throw c}}return n},d=function(n){return n.map(function(n){return"string"==typeof n?new RegExp("^"+n+"$"):n})},s=function(){for(var n=arguments.length,t=Array(n),e=0;e<n;e++)t[e]=arguments[e];return t=d(t),function(n){return t.every(function(t){return!t.test(n)})&&n}},g=function(n){return function(t){return n[t]}},v=function(n){return"function"==typeof n?n:function(){return n}},p=function(n,t){switch(n){case"left":return t/2;case"right":return-t/2;default:return 0}},y=function(n){var t=Object.assign({},n),e=function(){};return Object.keys(t).forEach(function(n){e[n]=function(){return arguments.length?(t[n]=arguments.length<=0?void 0:arguments[0],e):t[n]}}),e},w=function(){var n=function(){return 0},t=function(n){return n.x},e=function(n){return n.y},i="center",o=function(){return 5},u="vertical",l=y({decorate:function(){},defined:function(r,i){return a(n,t,e)(r,i)},xScale:r.scaleIdentity(),yScale:r.scaleIdentity()});return l.values=function(r,a){var c=o(r,a),f=p(i,c),h=l.xScale(),d=l.yScale();if("vertical"===u){var s=d(e(r,a),a),g=d(n(r,a),a),v=h(t(r,a),a)+f;return{d:r,x:v,y:s,y0:g,width:c,height:s-g,origin:[v,s],baseOrigin:[v,g],transposedX:v,transposedY:s}}var y=h(e(r,a),a),w=h(n(r,a),a),m=d(t(r,a),a)+f;return{d:r,x:m,y:y,y0:w,width:c,height:y-w,origin:[y,m],baseOrigin:[w,m],transposedX:y,transposedY:m}},l.baseValue=function(){return arguments.length?(n=v(arguments.length<=0?void 0:arguments[0]),l):n},l.crossValue=function(){return arguments.length?(t=v(arguments.length<=0?void 0:arguments[0]),l):t},l.mainValue=function(){return arguments.length?(e=v(arguments.length<=0?void 0:arguments[0]),l):e},l.bandwidth=function(){return arguments.length?(o=v(arguments.length<=0?void 0:arguments[0]),l):o},l.align=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],l):i},l.orient=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],l):u},l},m={red:"#c60",green:"#6c0",black:"#000",gray:"#ddd",darkGray:"#999"},x=function(){var n=w(),r=e.line().x(function(t,e){return n.values(t,e).transposedX}).y(function(t,e){return n.values(t,e).transposedY}),i=u("path","line"),o=function(e){e.selection&&i.transition(e),r.defined(n.defined()),e.each(function(e,o,a){var u=i(t.select(a[o]),[e]);u.enter().attr("fill","none").attr("stroke",m.black),u.attr("d",r),n.decorate()(u,e,o)})};return h(o,n,s("baseValue","bandwidth","align")),c(o,i,"key"),c(o,r,"curve"),o},S=function(){var n=w(),t=e.line().x(function(t,e){return n.values(t,e).transposedX}).y(function(t,e){return n.values(t,e).transposedY}),r=function(e){var r=t.context();r.beginPath(),t.defined(n.defined())(e),r.strokeStyle=m.black,r.fillStyle="transparent",n.decorate()(r,e),r.fill(),r.stroke(),r.closePath()};return h(r,n,s("baseValue","bandwidth","align")),c(r,t,"curve","context"),r},b=function(){var n=e.symbol(),r=w(),i=u("g","point"),o=function(n){return"translate("+n[0]+", "+n[1]+")"},a=function(e){e.selection&&i.transition(e),e.each(function(e,a,u){var l=e.filter(r.defined()),c=i(t.select(u[a]),l);c.enter().attr("transform",function(n,t){return o(r.values(n,t).origin)}).attr("fill",m.gray).attr("stroke",m.black).append("path"),c.attr("transform",function(n,t){return o(r.values(n,t).origin)}).select("path").attr("d",n),r.decorate()(c,e,a)})};return h(a,r,s("baseValue","bandwidth","align")),c(a,i,"key"),c(a,n,"type","size"),a},k=function(){var n=e.symbol(),t=w(),r=function(e){var r=e.filter(t.defined()),i=n.context();r.forEach(function(r,o){i.save();var a=t.values(r,o);i.translate(a.origin[0],a.origin[1]),i.beginPath(),n(e),i.strokeStyle=m.black,i.fillStyle=m.gray,t.decorate()(i,r,o),i.fill(),i.stroke(),i.closePath(),i.restore()})};return h(r,t,s("baseValue","bandwidth","align")),c(r,n,"size","type","context"),r},T=function(n){return"function"==typeof n?n:function(){return n}},V=function(){var n=null,t=function(n){return n.date},e=function(n){return n.open},r=function(n){return n.high},o=function(n){return n.low},a=function(n){return n.close},u="vertical",l=T(3),c=function(c){var f=n||i.path();return c.forEach(function(n,i){var c=t(n,i),h=e(n,i),d=r(n,i),s=o(n,i),g=a(n,i),v=l(n,i)/2;"vertical"===u?(f.moveTo(c,s),f.lineTo(c,d),f.moveTo(c,h),f.lineTo(c-v,h),f.moveTo(c,g),f.lineTo(c+v,g)):(f.moveTo(s,c),f.lineTo(d,c),f.moveTo(h,c),f.lineTo(h,c+v),f.moveTo(g,c),f.lineTo(g,c-v))}),n?null:f.toString()};return c.context=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],c):n},c.x=function(){return arguments.length?(t=T(arguments.length<=0?void 0:arguments[0]),c):t},c.open=function(){return arguments.length?(e=T(arguments.length<=0?void 0:arguments[0]),c):e},c.high=function(){return arguments.length?(r=T(arguments.length<=0?void 0:arguments[0]),c):r},c.low=function(){return arguments.length?(o=T(arguments.length<=0?void 0:arguments[0]),c):o},c.close=function(){return arguments.length?(a=T(arguments.length<=0?void 0:arguments[0]),c):a},c.width=function(){return arguments.length?(l=T(arguments.length<=0?void 0:arguments[0]),c):l},c.orient=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],c):u},c},A=function(){var n=null,t=function(n){return n.x},e=function(n){return n.y},r="center",o="center",a=function(n){return n.height},u=T(3),l=function(l,c){var f=n||i.path();return l.forEach(function(n,i){var l=t.call(this,n,c||i),h=e.call(this,n,c||i),d=a.call(this,n,c||i),s=u.call(this,n,c||i),g=void 0;switch(r){case"left":g=s;break;case"right":g=0;break;case"center":g=s/2;break;default:throw new Error("Invalid horizontal alignment "+r)}var v=void 0;switch(o){case"bottom":v=-d;break;case"top":v=0;break;case"center":v=d/2;break;default:throw new Error("Invalid vertical alignment "+o)}f.rect(l-g,h-v,s,d)},this),n?null:f.toString()};return l.context=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],l):n},l.x=function(){return arguments.length?(t=T(arguments.length<=0?void 0:arguments[0]),l):t},l.y=function(){return arguments.length?(e=T(arguments.length<=0?void 0:arguments[0]),l):e},l.width=function(){return arguments.length?(u=T(arguments.length<=0?void 0:arguments[0]),l):u},l.horizontalAlign=function(){return arguments.length?(r=arguments.length<=0?void 0:arguments[0],l):r},l.height=function(){return arguments.length?(a=T(arguments.length<=0?void 0:arguments[0]),l):a},l.verticalAlign=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],l):o},l},E=function(){var n=null,t=function(n){return n.date},e=function(n){return n.open},r=function(n){return n.high},o=function(n){return n.low},a=function(n){return n.close},u=T(3),l=function(l){var c=n||i.path();return l.forEach(function(n,i){var l=t(n,i),f=e(n,i),h=r(n,i),d=o(n,i),s=a(n,i),g=u(n,i),v=g/2;c.rect(l-v,f,g,s-f),c.moveTo(l,Math.min(s,f)),c.lineTo(l,h),c.moveTo(l,Math.max(s,f)),c.lineTo(l,d)}),n?null:c.toString()};return l.context=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],l):n},l.x=function(){return arguments.length?(t=T(arguments.length<=0?void 0:arguments[0]),l):t},l.open=function(){return arguments.length?(e=T(arguments.length<=0?void 0:arguments[0]),l):e},l.high=function(){return arguments.length?(r=T(arguments.length<=0?void 0:arguments[0]),l):r},l.low=function(){return arguments.length?(o=T(arguments.length<=0?void 0:arguments[0]),l):o},l.close=function(){return arguments.length?(a=T(arguments.length<=0?void 0:arguments[0]),l):a},l.width=function(){return arguments.length?(u=T(arguments.length<=0?void 0:arguments[0]),l):u},l},P=function(){var n=null,t=function(n){return n.value},e=function(n){return n.median},r=function(n){return n.upperQuartile},o=function(n){return n.lowerQuartile},a=function(n){return n.high},u=function(n){return n.low},l="vertical",c=T(5),f=T(.5),h=function(h){var d=n||i.path();return h.forEach(function(n,i){var h=t(n,i),s=c(n,i),g=s/2,v=s*f(n,i),p=v/2,y=a(n,i),w=r(n,i),m=e(n,i),x=o(n,i),S=u(n,i),b=x-w;"vertical"===l?(d.moveTo(h-p,y),d.lineTo(h+p,y),d.moveTo(h,y),d.lineTo(h,w),d.rect(h-g,w,s,b),d.moveTo(h-g,m),d.lineTo(h+g,m),d.moveTo(h,x),d.lineTo(h,S),d.moveTo(h-p,S),d.lineTo(h+p,S)):(d.moveTo(S,h-p),d.lineTo(S,h+p),d.moveTo(S,h),d.lineTo(x,h),d.rect(x,h-g,-b,s),d.moveTo(m,h-g),d.lineTo(m,h+g),d.moveTo(w,h),d.lineTo(y,h),d.moveTo(y,h-p),d.lineTo(y,h+p))}),n?null:d.toString()};return h.context=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],h):n},h.value=function(){return arguments.length?(t=T(arguments.length<=0?void 0:arguments[0]),h):t},h.median=function(){return arguments.length?(e=T(arguments.length<=0?void 0:arguments[0]),h):e},h.upperQuartile=function(){return arguments.length?(r=T(arguments.length<=0?void 0:arguments[0]),h):r},h.lowerQuartile=function(){return arguments.length?(o=T(arguments.length<=0?void 0:arguments[0]),h):o},h.high=function(){return arguments.length?(a=T(arguments.length<=0?void 0:arguments[0]),h):a},h.low=function(){return arguments.length?(u=T(arguments.length<=0?void 0:arguments[0]),h):u},h.width=function(){return arguments.length?(c=T(arguments.length<=0?void 0:arguments[0]),h):c},h.orient=function(){return arguments.length?(l=arguments.length<=0?void 0:arguments[0],h):l},h.cap=function(){return arguments.length?(f=T(arguments.length<=0?void 0:arguments[0]),h):f},h},Q=function(){var n=null,t=function(n){return n.x},e=function(n){return n.high},r=function(n){return n.low},o="vertical",a=T(5),u=function(u){var l=n||i.path();return u.forEach(function(n,i){var u=t(n,i),c=a(n,i),f=c/2,h=e(n,i),d=r(n,i);"vertical"===o?(l.moveTo(u-f,h),l.lineTo(u+f,h),l.moveTo(u,h),l.lineTo(u,d),l.moveTo(u-f,d),l.lineTo(u+f,d)):(l.moveTo(d,u-f),l.lineTo(d,u+f),l.moveTo(d,u),l.lineTo(h,u),l.moveTo(h,u-f),l.lineTo(h,u+f))}),n?null:l.toString()};return u.context=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],u):n},u.value=function(){return arguments.length?(t=T(arguments.length<=0?void 0:arguments[0]),u):t},u.high=function(){return arguments.length?(e=T(arguments.length<=0?void 0:arguments[0]),u):e},u.low=function(){return arguments.length?(r=T(arguments.length<=0?void 0:arguments[0]),u):r},u.width=function(){return arguments.length?(a=T(arguments.length<=0?void 0:arguments[0]),u):a},u.orient=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],u):o},u},I=function(){var n=A().x(0).y(0),e=w(),r=u("g","bar"),i=function(n){return"vertical"===e.orient()?n.height:n.width},o=function(n){return"vertical"===e.orient()?n.width:n.height},a=function(n){return"translate("+n[0]+", "+n[1]+")"},l=function(u){u.selection&&r.transition(u),u.each(function(u,l,c){var f=e.orient();if("vertical"!==f&&"horizontal"!==f)throw new Error("The bar series does not support an orientation of "+f);var h=u.filter(e.defined()),d=h.map(e.values);n.width(0).height(0),"vertical"===e.orient()?(n.verticalAlign("top"),n.horizontalAlign("center")):(n.horizontalAlign("right"),n.verticalAlign("center"));var s=r(t.select(c[l]),h);s.enter().attr("transform",function(n,t){return a(d[t].baseOrigin)}).attr("class","bar "+e.orient()).attr("fill",m.darkGray).append("path").attr("d",function(t,e){return o(n)(d[e].width),n([t])}),s.attr("transform",function(n,t){return a(d[t].origin)}).select("path").attr("d",function(t,e){return o(n)(d[e].width),i(n)(-d[e].height),n([t])}),e.decorate()(s,h,l)})};return h(l,e),c(l,r,"key"),l},B=function(){var n=w(),t=A().x(0).y(0),e=function(t){return"vertical"===n.orient()?t.height:t.width},r=function(t){return"vertical"===n.orient()?t.width:t.height},i=function(i){var o=t.context(),a=i.filter(n.defined()),u=a.map(n.values);"vertical"===n.orient()?(t.verticalAlign("top"),t.horizontalAlign("center")):(t.horizontalAlign("right"),t.verticalAlign("center")),u.forEach(function(i,a){o.save(),o.beginPath(),o.translate(i.origin[0],i.origin[1]),e(t)(-i.height),r(t)(i.width),t([i]),o.fillStyle=m.darkGray,o.strokeStyle="transparent",n.decorate()(o,i.d,a),o.fill(),o.stroke(),o.closePath(),o.restore()})};return h(i,n),c(i,t,"context"),i},C=function(){var n=function(n){return n.high},t=function(n){return n.low},e=function(n){return n.cross},i="vertical",o="center",u=function(){return 5},l=y({decorate:function(){},defined:function(r,i){return a(t,n,e)(r,i)},xScale:r.scaleIdentity(),yScale:r.scaleIdentity()});return l.values=function(r,a){var c=u(r,a),f=p(o,c),h=l.xScale(),d=l.yScale();if("vertical"===i){var s=d(n(r,a));return{origin:[h(e(r,a))+f,s],high:0,low:d(t(r,a))-s,width:c}}var g=h(t(r,a));return{origin:[g,d(e(r,a))+f],high:h(n(r,a))-g,low:0,width:c}},l.orient=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],l):i},l.lowValue=function(){return arguments.length?(t=v(arguments.length<=0?void 0:arguments[0]),l):t},l.highValue=function(){return arguments.length?(n=v(arguments.length<=0?void 0:arguments[0]),l):n},l.crossValue=function(){return arguments.length?(e=v(arguments.length<=0?void 0:arguments[0]),l):e},l.bandwidth=function(){return arguments.length?(u=v(arguments.length<=0?void 0:arguments[0]),l):u},l.align=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],l):o},l},O=function(){var n=C(),e=u("g","error-bar"),r=Q().value(0),i=function(n){return function(t){return n.selection?t.transition(n):t}},o=function(n){return"translate("+n.origin[0]+", "+n.origin[1]+")"},a=function(a){a.selection&&e.transition(a);var u=i(a);a.each(function(i,a,l){var c=i.filter(n.defined()),f=c.map(n.values),h=e(t.select(l[a]),c);h.enter().attr("stroke",m.black).attr("fill",m.gray).attr("transform",function(t,e){return o(n.values(t,e))+" scale(1e-6, 1)"}).append("path"),r.orient(n.orient()),h.each(function(n,e,i){var a=f[e];r.high(a.high).low(a.low).width(a.width),u(t.select(i[e])).attr("transform",o(a)+" scale(1)").select("path").attr("d",r([n]))}),n.decorate()(h,i,a)})};return h(a,n),c(a,e,"key"),a},z=function(){var n=C(),t=Q().value(0),e=function(e){var r=e.filter(n.defined()),i=t.context();t.orient(n.orient()),r.forEach(function(e,r){i.save();var o=n.values(e,r);i.translate(o.origin[0],o.origin[1]),i.beginPath(),t.high(o.high).width(o.width).low(o.low)([e]),i.strokeStyle=m.black,i.fillStyle=m.gray,n.decorate()(i,e,r),i.fill(),i.stroke(),i.closePath(),i.restore()})};return h(e,n),c(e,t,"context"),e},G=function(){var n=w(),r=e.area(),i=u("path","area"),o=function(e){e.selection&&i.transition(e),r.defined(n.defined()),e.each(function(e,o,a){var u=e.map(n.values);r.x(function(n,t){return u[t].transposedX}).y(function(n,t){return u[t].transposedY});var l="vertical"===n.orient()?"y":"x";r[l+"0"](function(n,t){return u[t].y0}),r[l+"1"](function(n,t){return u[t].y});var c=i(t.select(a[o]),[e]);c.enter().attr("fill",m.gray),c.attr("d",r),n.decorate()(c,e,o)})};return h(o,n,s("bandwidth","align")),c(o,i,"key"),c(o,r,"curve"),o},F=function(){var n=w(),t=e.area(),r=function(e){var r=t.context();t.defined(n.defined());var i=e.map(n.values);t.x(function(n,t){return i[t].transposedX}).y(function(n,t){return i[t].transposedY});var o="vertical"===n.orient()?"y":"x";t[o+"0"](function(n,t){return i[t].y0}),t[o+"1"](function(n,t){return i[t].y}),r.beginPath(),t(e),r.fillStyle=m.gray,r.strokeStyle="transparent",n.decorate()(r,e),r.fill(),r.stroke(),r.closePath()};return h(r,n,s("bandwidth","align")),c(r,t,"curve","context"),r},j=function(){var n=void 0,t=function(n){return n.date},e=function(n){return n.open},i=function(n){return n.high},o=function(n){return n.low},u=function(n){return n.close},l=function(){return 5},c="center",f=function(e,r){return n.xScale()(t(e,r))};return n=y({decorate:function(){},defined:function(n,r){return a(t,e,o,i,u)(n,r)},xScale:r.scaleIdentity(),yScale:r.scaleIdentity()}),n.values=function(t,r){var a=u(t,r),h=e(t,r),d=l(t,r),s=p(c,d),g="";return a>h?g="up":a<h&&(g="down"),{cross:f(t,r)+s,open:n.yScale()(h),high:n.yScale()(i(t,r)),low:n.yScale()(o(t,r)),close:n.yScale()(a),width:d,direction:g}},n.crossValue=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],n):t},n.openValue=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],n):e},n.highValue=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],n):i},n.lowValue=function(){return arguments.length?(o=arguments.length<=0?void 0:arguments[0],n):o},n.yValue=n.closeValue=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],n):u},n.bandwidth=function(){return arguments.length?(l=v(arguments.length<=0?void 0:arguments[0]),n):l},n.align=function(){return arguments.length?(c=arguments.length<=0?void 0:arguments[0],n):c},n},D=function(n,e){var r=j(),i=u("g",e),o=function(n){return"translate("+n.cross+", "+n.high+")"},a=function(n){return function(t){return n.selection?t.transition(n):t}},l=function(u){u.selection&&i.transition(u);var l=a(u);u.each(function(a,u,c){var f=a.filter(r.defined()),h=i(t.select(c[u]),f);h.enter().attr("transform",function(n,t){return o(r.values(n,t))+" scale(1e-6, 1)"}).append("path"),h.each(function(i,a,u){var c=r.values(i,a),f="up"===c.direction?m.green:m.red,h=l(t.select(u[a])).attr("class",e+" "+c.direction).attr("stroke",f).attr("fill",f).attr("transform",function(){return o(c)+" scale(1)"});n.x(0).width(c.width).open(function(){return c.open-c.high}).high(0).low(function(){return c.low-c.high}).close(function(){return c.close-c.high}),h.select("path").attr("d",n([i]))}),r.decorate()(h,a,u)})};return c(l,i,"key"),h(l,r),l},M=function(){return D(E(),"candlestick")},X=function(n){var t=j(),e=function(e){var r=e.filter(t.defined()),i=n.context();r.forEach(function(e,r){i.save();var o=t.values(e,r);i.translate(o.cross,o.high),i.beginPath(),n.x(0).open(function(){return o.open-o.high}).width(o.width).high(0).low(function(){return o.low-o.high}).close(function(){return o.close-o.high})([e]);var a="up"===o.direction?m.green:m.red;i.strokeStyle=a,i.fillStyle=a,t.decorate()(i,e,r),i.fill(),i.stroke(),i.closePath(),i.restore()})};return c(e,n,"context"),h(e,t),e},Y=function(){return X(E())},q=function(){var n=function(n){return n.upperQuartile},t=function(n){return n.lowerQuartile},e=function(n){return n.high},i=function(n){return n.low},o=function(n){return n.value},u=function(n){return n.median},l="vertical",c="center",f=function(){return 5},h=y({decorate:function(){},defined:function(r,l){return a(i,e,t,n,o,u)(r,l)},xScale:r.scaleIdentity(),yScale:r.scaleIdentity()});return h.values=function(r,a){var d=f(r,a),s=p(c,d),g=h.xScale(),v=h.yScale();if("vertical"===l){var y=v(e(r,a));return{origin:[g(o(r,a))+s,y],high:0,upperQuartile:v(n(r,a))-y,median:v(u(r,a))-y,lowerQuartile:v(t(r,a))-y,low:v(i(r,a))-y,width:d}}var w=g(i(r,a));return{origin:[w,v(o(r,a))+s],high:g(e(r,a))-w,upperQuartile:g(n(r,a))-w,median:g(u(r,a))-w,lowerQuartile:g(t(r,a))-w,low:0,width:d}},h.orient=function(){return arguments.length?(l=arguments.length<=0?void 0:arguments[0],h):l},h.lowerQuartileValue=function(){return arguments.length?(t=v(arguments.length<=0?void 0:arguments[0]),h):t},h.upperQuartileValue=function(){return arguments.length?(n=v(arguments.length<=0?void 0:arguments[0]),h):n},h.lowValue=function(){return arguments.length?(i=v(arguments.length<=0?void 0:arguments[0]),h):i},h.highValue=function(){return arguments.length?(e=v(arguments.length<=0?void 0:arguments[0]),h):e},h.crossValue=function(){return arguments.length?(o=v(arguments.length<=0?void 0:arguments[0]),h):o},h.medianValue=function(){return arguments.length?(u=v(arguments.length<=0?void 0:arguments[0]),h):u},h.bandwidth=function(){return arguments.length?(f=v(arguments.length<=0?void 0:arguments[0]),h):f},h.align=function(){return arguments.length?(c=arguments.length<=0?void 0:arguments[0],h):c},h},L=function(){var n=q(),e=u("g","box-plot"),r=P().value(0),i=function(n){return function(t){return n.selection?t.transition(n):t}},o=function(n){return"translate("+n.origin[0]+", "+n.origin[1]+")"},a=function(a){a.selection&&e.transition(a);var u=i(a);a.each(function(i,a,l){var c=i.filter(n.defined()),f=e(t.select(l[a]),c);f.enter().attr("stroke",m.black).attr("fill",m.gray).attr("transform",function(t,e){return o(n.values(t,e))+" scale(1e-6, 1)"}).append("path"),r.orient(n.orient()),f.each(function(e,i,a){var l=n.values(e,i);r.median(l.median).upperQuartile(l.upperQuartile).lowerQuartile(l.lowerQuartile).width(l.width).high(l.high).low(l.low),u(t.select(a[i])).attr("transform",o(l)).select("path").attr("d",r([e]))}),n.decorate()(f,i,a)})};return h(a,n),c(a,e,"key"),c(a,r,"cap"),a},R=function(){var n=q(),t=P().value(0),e=function(e){var r=e.filter(n.defined()),i=t.context();t.orient(n.orient()),r.forEach(function(e,r){i.save();var o=n.values(e,r);i.translate(o.origin[0],o.origin[1]),i.beginPath(),t.median(o.median).upperQuartile(o.upperQuartile).lowerQuartile(o.lowerQuartile).high(o.high).width(o.width).low(o.low)([e]),i.fillStyle=m.gray,i.strokeStyle=m.black,n.decorate()(i,e,r),i.fill(),i.stroke(),i.closePath(),i.restore()})};return h(e,n),c(e,t,"cap","context"),e},H=function(){return D(V(),"ohlc")},N=function(){return X(V())},_=function(){var n=[],t=function(n){return n},e=function(n,t){return t},i=y({decorate:function(){},xScale:r.scaleIdentity(),yScale:r.scaleIdentity()});return i.mapping=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],i):t},i.key=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],i):e},i.series=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],i):n},i},$=function(){var n=_(),e=u("g"),r=u("g","multi"),i=function(i){i.selection&&(r.transition(i),e.transition(i));var o=n.mapping(),a=n.series(),u=n.xScale(),l=n.yScale();i.each(function(i,c,f){var h=r(t.select(f[c]),a);h.each(function(n,r,c){n.xScale(u).yScale(l);var f=o(i,r,a);e(t.select(c[r]),[f]).call(n)}),(h.selection?h.selection():h).order(),n.decorate()(h,i,c)})};return h(i,n),c(i,r,"key"),i},J=function(){var n=null,t=_(),e=function(e){var r=t.mapping(),i=t.series(),o=t.xScale(),a=t.yScale();i.forEach(function(u,l){var c=r(e,l,i);u.context(n).xScale(o).yScale(a);var f=u.decorate();u.decorate(function(n,r,i){t.decorate()(n,e,l),f(n,r,i)}),u(c),u.decorate(f)})};return e.context=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],e):n},h(e,t),e},K=function(n){var t=function(){return 50},e="center",i=r.scaleBand(),a=y({decorate:function(){},xScale:r.scaleLinear()});return a.offsetScaleForDatum=function(n,r,a){var u=t(r,a),l=p(e,u),c=u/2;return i.domain(o.range(0,n.length)).range([-c+l,c+l])},a.bandwidth=function(){return arguments.length?(t=v(arguments.length<=0?void 0:arguments[0]),a):t},a.align=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],a):e},h(a,i,g({paddingInner:"paddingOuter"})),a},U=function(n){var e=K(),r=u("g","grouped"),i=function(i){i.selection&&r.transition(i),i.each(function(i,o,a){var u=r(t.select(a[o]),i);u.enter().append("g"),u.select("g").each(function(r,o,a){var u=t.select(a[o]),l=function(n,t){var r=e.offsetScaleForDatum(i,n,t);return e.xScale()(n)+r(o)+r.bandwidth()/2};n.xScale(l),n.bandwidth&&n.bandwidth(function(n,t){return e.offsetScaleForDatum(i,n,t).bandwidth()}),n.decorate(function(n,t){return e.decorate()(n,t,o)}),u.call(n)})})};return h(i,n,s("decorate","xScale")),h(i,e,s("offsetScaleForDatum")),i},W=function(n){var t=K(),e=function(e){e.forEach(function(r,i){var o=function(n,r){var o=t.offsetScaleForDatum(e,n,r);return t.xScale()(n)+o(i)+o.bandwidth()/2};n.xScale(o),n.bandwidth&&n.bandwidth(function(n,r){return t.offsetScaleForDatum(e,n,r).bandwidth()}),n.decorate(function(n,e){return t.decorate()(n,e,i)}),n(r)})};return h(e,n,s("decorate","xScale")),h(e,t,s("configureOffsetScale","configureOffset")),e},Z=function(){var n="vertical",e=x(),r=$(),i=function(i){return i.each(function(i,o,a){"vertical"===n?r.series(i[0].map(function(n){return e})).mapping(function(n,t){return n.map(function(n){return n[t]})}):r.series(i.map(function(n){return e})).mapping(function(n,t){return n[t]}),t.select(a[o]).call(r)})};return i.series=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],i):e},i.orient=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],i):n},h(i,r,s("series","mapping")),i},nn=function(){var n="vertical",t=S(),e=J(),r=function(r){"vertical"===n?e.series(r[0].map(function(n){return t})).mapping(function(n,t){return n.map(function(n){return n[t]})}):e.series(r.map(function(n){return t})).mapping(function(n,t){return n[t]}),e(r)};return r.series=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],r):t},r.orient=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],r):n},h(r,e,s("series","mapping")),r},tn=function(n){if(Array.isArray(n)){for(var t=0,e=Array(n.length);t<n.length;t++)e[t]=n[t];return e}return Array.from(n)},en=function(n){return n.sort(o.ascending).filter(function(n,t,e){return-1===e.indexOf(n,t+1)})},rn=function(n){var e=.75,r=function(n){if(n.length<=1)return 10;n=en(n);var t=o.pairs(n).map(function(n){return Math.abs(n[0]-n[1])}),r=o.min(t);return e*r},i=function(t,e,i){if(t.bandwidth)return t.bandwidth();var o,a=Array.isArray(e)?(o=[]).concat.apply(o,tn(e)):e,u=a.filter(n.defined()).map(i()).map(t);return r(u)},a=function(e){var r=function(t){if(n.xBandwidth&&n.yBandwidth)n.xBandwidth(i(n.xScale(),t,n.xValue)),n.yBandwidth(i(n.yScale(),t,n.yValue));else{var e=n.orient&&"horizontal"===n.orient()?n.yScale():n.xScale();n.bandwidth(i(e,t,n.crossValue))}};e instanceof t.selection?e.each(function(e,i,o){r(e),n(t.select(o[i]))}):(r(e),n(e))};return h(a,n),a.widthFraction=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],a):e},a},on=function(){var n=function(n){return n.x},t=function(n){return n.y},e=function(n){return n.color},i=function(){return 5},u=function(){return 5},l=r.interpolateViridis,c=y({decorate:function(){},defined:function(r,i){return a(n,t,e)(r,i)},xScale:r.scaleIdentity(),yScale:r.scaleIdentity()});return c.pathGenerator=A().x(0).y(0),c.colorScale=function(n){var t=n.map(e);return r.scaleLinear().domain([o.min(t),o.max(t)])},c.values=function(r,o){return{x:c.xScale()(n(r,o)),y:c.yScale()(t(r,o)),colorValue:e(r,o),width:u(r,o),height:i(r,o)}},c.xValue=function(){return arguments.length?(n=v(arguments.length<=0?void 0:arguments[0]),c):n},c.yValue=function(){return arguments.length?(t=v(arguments.length<=0?void 0:arguments[0]),c):t},c.colorValue=function(){return arguments.length?(e=v(arguments.length<=0?void 0:arguments[0]),c):e},c.colorInterpolate=function(){return arguments.length?(l=arguments.length<=0?void 0:arguments[0],c):l},c.xBandwidth=function(){return arguments.length?(u=v(arguments.length<=0?void 0:arguments[0]),c):u},c.yBandwidth=function(){return arguments.length?(i=v(arguments.length<=0?void 0:arguments[0]),c):i},h(c,c.pathGenerator,g({horizontalAlign:"xAlign",verticalAlign:"yAlign"})),c},an=function(){var n=on(),e=u("g","box"),r=function(n){return"translate("+n.x+", "+n.y+")"},i=function(i){i.each(function(i,o,a){var u=i.filter(n.defined()),l=n.colorValue(),c=n.colorInterpolate(),f=n.colorScale(u),h=e(t.select(a[o]),u);h.enter().append("path").attr("stroke","transparent"),h.attr("transform",function(t,e){return r(n.values(t,e))}).select("path").attr("d",function(t,e){return n.pathGenerator.width(n.values(t,e).width).height(n.values(t,e).height)([t])}).attr("fill",function(n,t){return c(f(l(n,t)))}),n.decorate()(h,i,o)})};return h(i,n),i},un=function(){var n=on(),t=function(t){var e=t.filter(n.defined()),r=(n.colorValue(),n.colorInterpolate()),i=n.colorScale(e),o=n.pathGenerator.context();e.forEach(function(t,e){o.save(),o.beginPath();var a=n.values(t,e);o.translate(a.x,a.y),o.fillStyle=r(i(a.colorValue)),o.strokeStyle="transparent",n.pathGenerator.height(a.height).width(a.width)([t]),n.decorate()(o,t,e),o.fill(),o.stroke(),o.closePath(),o.restore()})};return c(t,n.pathGenerator,"context"),h(t,n),t};n.seriesSvgLine=x,n.seriesCanvasLine=S,n.seriesSvgPoint=b,n.seriesCanvasPoint=k,n.seriesSvgBar=I,n.seriesCanvasBar=B,n.seriesSvgErrorBar=O,n.seriesCanvasErrorBar=z,n.seriesSvgArea=G,n.seriesCanvasArea=F,n.seriesSvgCandlestick=M,n.seriesCanvasCandlestick=Y,n.seriesSvgBoxPlot=L,n.seriesCanvasBoxPlot=R,n.seriesSvgOhlc=H,n.seriesCanvasOhlc=N,n.seriesSvgMulti=$,n.seriesCanvasMulti=J,n.seriesSvgGrouped=U,n.seriesCanvasGrouped=W,n.seriesSvgRepeat=Z,n.seriesCanvasRepeat=nn,n.autoBandwidth=rn,n.seriesSvgHeatmap=an,n.seriesCanvasHeatmap=un,Object.defineProperty(n,"__esModule",{value:!0})}); |
@@ -6,2 +6,13 @@ # Change Log | ||
<a name="4.0.11"></a> | ||
## [4.0.11](https://github.com/d3fc/d3fc/compare/@d3fc/d3fc-series@4.0.10...@d3fc/d3fc-series@4.0.11) (2018-09-14) | ||
### Bug Fixes | ||
* ensure line and area series support defined ([d318219](https://github.com/d3fc/d3fc/commit/d318219)) | ||
<a name="4.0.10"></a> | ||
@@ -8,0 +19,0 @@ ## [4.0.10](https://github.com/d3fc/d3fc/compare/@d3fc/d3fc-series@4.0.9...@d3fc/d3fc-series@4.0.10) (2018-08-29) |
@@ -20,2 +20,3 @@ var width = 500; | ||
.yScale(yScale) | ||
.defined((_, i) => i % 20 !== 0) | ||
.crossValue(function(_, i) { return i; }) | ||
@@ -36,2 +37,3 @@ .mainValue(function(d) { return d; }); | ||
.yScale(yScale) | ||
.defined((_, i) => i % 20 !== 0) | ||
.context(ctx) | ||
@@ -38,0 +40,0 @@ .crossValue(function(_, i) { return i; }) |
@@ -20,2 +20,3 @@ var width = 500; | ||
.yScale(yScale) | ||
.defined((_, i) => i % 20 !== 0) | ||
.crossValue(function(_, i) { return i; }) | ||
@@ -36,2 +37,3 @@ .mainValue(function(d) { return d; }); | ||
.yScale(yScale) | ||
.defined((_, i) => i % 20 !== 0) | ||
.context(ctx) | ||
@@ -38,0 +40,0 @@ .crossValue(function(_, i) { return i; }) |
{ | ||
"name": "@d3fc/d3fc-series", | ||
"version": "4.0.10", | ||
"version": "4.0.11", | ||
"description": "A collection of components for rendering data series to SVG and canvas, including line, bar, OHLC, candlestick and more", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -9,4 +9,3 @@ import {area as areaShape} from 'd3-shape'; | ||
const areaData = areaShape() | ||
.defined(base.defined()); | ||
const areaData = areaShape(); | ||
@@ -16,2 +15,4 @@ const area = (data) => { | ||
areaData.defined(base.defined()); | ||
const projectedData = data.map(base.values); | ||
@@ -18,0 +19,0 @@ areaData.x((_, i) => projectedData[i].transposedX) |
@@ -10,3 +10,2 @@ import {line as lineShape} from 'd3-shape'; | ||
const lineData = lineShape() | ||
.defined(base.defined()) | ||
.x((d, i) => base.values(d, i).transposedX) | ||
@@ -19,3 +18,3 @@ .y((d, i) => base.values(d, i).transposedY); | ||
context.beginPath(); | ||
lineData(data); | ||
lineData.defined(base.defined())(data); | ||
context.strokeStyle = colors.black; | ||
@@ -22,0 +21,0 @@ context.fillStyle = 'transparent'; |
@@ -11,4 +11,3 @@ import {dataJoin} from '@d3fc/d3fc-data-join'; | ||
const areaData = areaShape() | ||
.defined(base.defined()); | ||
const areaData = areaShape(); | ||
@@ -23,2 +22,4 @@ const join = dataJoin('path', 'area'); | ||
areaData.defined(base.defined()); | ||
selection.each((data, index, group) => { | ||
@@ -25,0 +26,0 @@ |
@@ -12,3 +12,2 @@ import {dataJoin} from '@d3fc/d3fc-data-join'; | ||
const lineData = lineShape() | ||
.defined(base.defined()) | ||
.x((d, i) => base.values(d, i).transposedX) | ||
@@ -25,2 +24,4 @@ .y((d, i) => base.values(d, i).transposedY); | ||
lineData.defined(base.defined()); | ||
selection.each((data, index, group) => { | ||
@@ -27,0 +28,0 @@ const path = join(select(group[index]), [data]); |
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
407395
4810