@d3fc/d3fc-chart
Advanced tools
Comparing version 2.7.5 to 2.7.6
@@ -1015,6 +1015,6 @@ (function (global, factory) { | ||
context.beginPath(); | ||
lineData.defined(base.defined())(data); | ||
context.strokeStyle = colors.black; | ||
context.fillStyle = 'transparent'; | ||
base.decorate()(context, data); | ||
lineData.defined(base.defined())(data); | ||
context.fill(); | ||
@@ -1021,0 +1021,0 @@ context.stroke(); |
@@ -1,1 +0,1 @@ | ||
(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?b(exports,require("d3-selection"),require("d3-scale"),require("d3-shape"),require("d3-path"),require("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-scale","d3-shape","d3-path","d3-array"],b):(a=a||self,b(a.fc=a.fc||{},a.d3,a.d3,a.d3,a.d3,a.d3))})(this,function(a,b,c,d){'use strict';function e(){const a=arguments;return function(b,d){for(let e=0,c=a.length;e<c;e++)if(null==a[e](b,d))return!1;return!0}}var f="default"in c?c["default"]:c,g="default"in d?d["default"]:d,h=(a,b,c)=>{const d=b[c];if("function"!=typeof d)throw new Error(`Attempt to rebind ${c} which isn't a function on the source object`);return(...c)=>{var e=d.apply(b,c);return e===b?a:e}},i=(a,b,...c)=>{for(const d of c)a[d]=h(a,b,d);return a};const j=a=>b=>a.reduce((a,b)=>a&&b(a),b);var k=(a,b,...c)=>{const d=j(c);for(const e of Object.keys(b)){const c=d(e);c&&(a[c]=h(a,b,e))}return a},l=a=>a.map(a=>"string"==typeof a?new RegExp(`^${a}$`):a),m=(...a)=>(a=l(a),b=>a.every(a=>!a.test(b))&&b),n=(...a)=>(a=l(a),b=>a.some(a=>a.test(b))&&b);const o=a=>a[0].toUpperCase()+a.slice(1);var p=a=>b=>a+o(b);const q=1e-6;var r=(a,b)=>{a=a||"g";let c=(a,b)=>b,d=null;const e=function(e,f){f=f||(a=>a);const g=e.selection?e:null;g&&(e=e.selection());const h=e.selectAll((a,b,c)=>Array.from(c[b].childNodes).filter(a=>1===a.nodeType)).filter(null==b?a:`${a}.${b}`);let i=h.data(f,c);const j=i.enter().append(a).attr("class",b);let k=i.exit();i=i.merge(j);const l=g||d;return l&&(i=i.transition(l).style("opacity",1),j.style("opacity",q),k=k.transition(l).style("opacity",q)),k.remove(),i.enter=()=>j,i.exit=()=>k,i};return e.element=(...b)=>b.length?(a=b[0],e):a,e.className=(...a)=>a.length?(b=a[0],e):b,e.key=(...a)=>a.length?(c=a[0],e):c,e.transition=(...a)=>a.length?(d=a[0],e):d,e};const s=a=>a,t=(a,c,e={})=>{let f=[10],h=null,i=()=>{},j=null,k=6,l=6,m=3;const n=d.line(),o=r("g","tick").key(s),p=r("path","domain"),q=()=>({offset:[0,l+m]}),t=()=>({path:[[0,0],[0,l]]}),u=e.labelOffset||q,v=e.tickPath||t,w=(a,b)=>{var c=Math.round;let e=0;return a.bandwidth&&(e=a.bandwidth()/2,a.round()&&(e=c(e))),c=>b(a(c)+e,0)},x=(a,b)=>z()?`translate(${b}, ${a})`:`translate(${a}, ${b})`,y=a=>z()?a.map(a=>[a[1],a[0]]):a,z=()=>"left"===a||"right"===a,A=(a,b,d)=>c[a]?c[a].apply(c,b):d,B=d=>{d.selection&&(o.transition(d),p.transition(d)),d.each((d,e,l)=>{const m=l[e],q=b.select(m);m.__scale__||q.attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor","right"===a?"start":"left"===a?"end":"middle");const r=m.__scale__||c;m.__scale__=c.copy();const t=null==h?A("ticks",f,c.domain()):h,B=null==j?A("tickFormat",f,s):j,C="bottom"===a||"right"===a?1:-1,D=([a,b])=>[a,C*b],E=c.range(),F=y([[E[0],C*k],[E[0],0],[E[1],0],[E[1],C*k]]),G=p(q,[d]);G.attr("d",n(F)).attr("stroke","#000");const H=o(q,t),g=t.map((a,b)=>u(a,b,t)),I=t.map((a,b)=>v(a,b,t));H.enter().attr("transform",w(r,x)).append("path").attr("stroke","#000"),H.enter().append("text").attr("transform",(a,b)=>x(...D(g[b].offset))).attr("fill","#000"),H.exit().attr("transform",w(c,x)),H.select("path").attr("visibility",(a,b)=>I[b].hidden&&"hidden").attr("d",(a,b)=>n(y(I[b].path.map(D)))),H.select("text").attr("visibility",(a,b)=>g[b].hidden&&"hidden").attr("transform",(a,b)=>x(...D(g[b].offset))).attr("dy",()=>{let b="0em";return z()?b="0.32em":"bottom"===a&&(b="0.71em"),b}).text(B),H.attr("transform",w(c,x)),i(H,d,e)})};return B.tickFormat=(...a)=>a.length?(j=a[0],B):j,B.tickSize=(...a)=>a.length?(l=k=+a[0],B):l,B.tickSizeInner=(...a)=>a.length?(l=+a[0],B):l,B.tickSizeOuter=(...a)=>a.length?(k=+a[0],B):k,B.tickPadding=(...a)=>a.length?(m=a[0],B):m,B.decorate=(...a)=>a.length?(i=a[0],B):i,B.scale=(...a)=>a.length?(c=a[0],B):c,B.ticks=(...a)=>(f=[...a],B),B.tickArguments=(...a)=>a.length?(f=null==a[0]?[]:[...a[0]],B):f.slice(),B.tickValues=(...a)=>a.length?(h=null==a[0]?[]:[...a[0]],B):h.slice(),B.orient=()=>a,B},u=(a,b)=>{let c=!1;const d=(a,d,f)=>{let g=0,h=e.tickSizeInner()+e.tickPadding(),i=!1;if(c){const c=b(a),j=d<f.length-1?b(f[d+1]):b.range()[1];g=(j-c)/2,h=e.tickPadding(),i=d===f.length-1&&c===j}return{offset:[g,h],hidden:i}},e=t(a,b,{labelOffset:d}),f=a=>e(a);return f.tickCenterLabel=(...a)=>a.length?(c=a[0],f):c,k(f,e),f},v=a=>u("top",a),w=a=>u("bottom",a),x=a=>u("left",a),y=a=>u("right",a);var z=function(){for(var a={},b=function(b){for(var c,d=0,e=Object.keys(a);d<e.length;d++)c=e[d],b[c].apply(null,a[c]);return b},c=arguments.length,d=Array(c),e=0;e<c;e++)d[e]=arguments[e];for(var f=function(){var c=h[g];b[c]=function(){for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return e.length?(a[c]=e,b):a[c]}},g=0,h=d;g<h.length;g++)f();return b},A="d3fc-group.cartesian-chart{width:100%;height:100%;overflow:hidden;display:grid;display:-ms-grid;grid-template-columns:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);-ms-grid-columns:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);grid-template-rows:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);-ms-grid-rows:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);}\nd3fc-group.cartesian-chart>.top-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:3;-ms-grid-column:3;grid-row:1;-ms-grid-row:1;}\nd3fc-group.cartesian-chart>.top-axis{height:2em;grid-column:3;-ms-grid-column:3;grid-row:2;-ms-grid-row:2;}\nd3fc-group.cartesian-chart>.left-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:1;-ms-grid-column:1;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.left-axis{width:3em;grid-column:2;-ms-grid-column:2;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.plot-area{overflow:hidden;grid-column:3;-ms-grid-column:3;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.right-axis{width:3em;grid-column:4;-ms-grid-column:4;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.right-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:5;-ms-grid-column:5;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.bottom-axis{height:2em;grid-column:3;-ms-grid-column:3;grid-row:4;-ms-grid-row:4;}\nd3fc-group.cartesian-chart>.bottom-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:3;-ms-grid-column:3;grid-row:5;-ms-grid-row:5;}\nd3fc-group.cartesian-chart>.y-label{display:flex;transform:rotate(-90deg);width:1em;white-space:nowrap;justify-content:center;}",B=document.createElement("style");B.setAttribute("type","text/css"),document.querySelector("head").appendChild(B),B.styleSheet?B.styleSheet.cssText+=A:B.textContent+=A;var C=function(a){return"function"==typeof a?a:function(){return a}},D=function(){var a=E.apply(void 0,arguments),c=a.xScale,e=a.yScale,f=a.xAxis,g=a.yAxis,h=C(""),i=C(""),j=C(""),l=C(null),n=C(null),o=C("right"),q=C("bottom"),s=null,t=null,u=null,v=z("tickFormat","ticks","tickArguments","tickSize","tickSizeInner","tickSizeOuter","tickValues","tickPadding","tickCenterLabel"),w=function(){},x=z("tickFormat","ticks","tickArguments","tickSize","tickSizeInner","tickSizeOuter","tickValues","tickPadding","tickCenterLabel"),y=function(){},A=function(){},B=r("d3fc-group","cartesian-chart"),D=r("d3fc-canvas","gl-plot-area"),F=r("d3fc-canvas","canvas-plot-area"),G=r("d3fc-svg","plot-area"),H=r("d3fc-svg","x-axis").key(function(a){return a}),I=r("d3fc-svg","y-axis").key(function(a){return a}),J=r("div","chart-label"),K=r("div","x-label").key(function(a){return a}),L=r("div","y-label").key(function(a){return a}),M=function(a){return function(b){return a.selection?b.transition(a):b}},N=function(a){var k=M(a);a.each(function(a,d,m){var p=B(b.select(m[d]),[a]);p.enter().attr("auto-resize",""),J(p,[q(a)]).attr("class",function(a){return"top"===a?"chart-label bottom-label":"chart-label top-label"}).style("margin-bottom",function(a){return"top"===a?0:"1em"}).style("margin-top",function(a){return"top"===a?"1em":0}).text(h(a)),K(p,[q(a)]).attr("class",function(a){return"x-label ".concat(a,"-label")}).text(i(a)),L(p,[o(a)]).attr("class",function(a){return"y-label ".concat(a,"-label")}).text(j(a)),D(p,s?[a]:[]).attr("set-webgl-viewport","").classed("plot-area",!0).on("draw",function(a,d,f){var g=b.select(f[d]).select("canvas").node();s.context(g.getContext("webgl")).xScale(c).yScale(e),s(a)}),F(p,t?[a]:[]).classed("plot-area",!0).on("draw",function(a,d,f){var g=b.select(f[d]).select("canvas").node();t.context(g.getContext("2d")).xScale(c).yScale(e),t(a)}),G(p,u?[a]:[]).on("draw",function(a,d,f){u.xScale(c).yScale(e),k(b.select(f[d])).select("svg").call(u)}),H(p,[q(a)]).attr("class",function(a){return"x-axis ".concat(a,"-axis")}).style("height",l(a)).on("measure",function(a,d,e){var f=b.event.detail,g=f.width,h=f.height;"top"===a&&b.select(e[d]).select("svg").attr("viewBox","0 ".concat(-h," ").concat(g," ").concat(h)),c.range([0,g])}).on("draw",function(a,d,e){var g="top"===a?f.top(c):f.bottom(c);g.decorate(w),k(b.select(e[d])).select("svg").call(v(g))}),I(p,[o(a)]).attr("class",function(a){return"y-axis ".concat(a,"-axis")}).style("width",n(a)).on("measure",function(a,c,d){var f=b.event.detail,g=f.width,h=f.height;"left"===a&&b.select(d[c]).select("svg").attr("viewBox","".concat(-g," 0 ").concat(g," ").concat(h)),e.range([h,0])}).on("draw",function(a,c,d){var f="left"===a?g.left(e):g.right(e);f.decorate(y),k(b.select(d[c])).select("svg").call(x(f))}),p.each(function(a,b,c){return c[b].requestRedraw()}),A(p,a,d)})},O=m(/range\w*/,/tickFormat/);return k(N,c,O,p("x")),k(N,e,O,p("y")),k(N,v,p("x")),k(N,x,p("y")),N.xOrient=function(){return arguments.length?(q=C(0>=arguments.length?void 0:arguments[0]),N):q},N.yOrient=function(){return arguments.length?(o=C(0>=arguments.length?void 0:arguments[0]),N):o},N.xDecorate=function(){return arguments.length?(w=0>=arguments.length?void 0:arguments[0],N):w},N.yDecorate=function(){return arguments.length?(y=0>=arguments.length?void 0:arguments[0],N):y},N.chartLabel=function(){return arguments.length?(h=C(0>=arguments.length?void 0:arguments[0]),N):h},N.xLabel=function(){return arguments.length?(i=C(0>=arguments.length?void 0:arguments[0]),N):i},N.yLabel=function(){return arguments.length?(j=C(0>=arguments.length?void 0:arguments[0]),N):j},N.xAxisHeight=function(){return arguments.length?(l=C(0>=arguments.length?void 0:arguments[0]),N):l},N.yAxisWidth=function(){return arguments.length?(n=C(0>=arguments.length?void 0:arguments[0]),N):n},N.webglPlotArea=function(){return arguments.length?(s=0>=arguments.length?void 0:arguments[0],N):s},N.canvasPlotArea=function(){return arguments.length?(t=0>=arguments.length?void 0:arguments[0],N):t},N.svgPlotArea=function(){return arguments.length?(u=0>=arguments.length?void 0:arguments[0],N):u},N.decorate=function(){return arguments.length?(A=0>=arguments.length?void 0:arguments[0],N):A},N},E=function(){for(var a={xScale:c.scaleIdentity(),yScale:c.scaleIdentity(),xAxis:{bottom:w,top:v},yAxis:{right:y,left:x}},b=arguments.length,d=Array(b),e=0;e<b;e++)d[e]=arguments[e];return 1!==d.length||d[0].domain||d[0].range?Object.assign(a,{xScale:d[0]||a.xScale,yScale:d[1]||a.yScale}):Object.assign(a,d[0])},F=function(a){return"function"==typeof a?a:function(){return a}},G=function(a,b){return function(){var c=F(""),d=b,e=function(){},f=D.apply(void 0,arguments),g=function(b){a(f,d),f.decorate(function(a,b,d){a.enter().select(".x-label").style("height","1em").style("line-height","1em");var g=f.yOrient()(b);a.enter().append("div").attr("class","y-label-container").style("grid-column","left"===g?1:5).style("-ms-grid-column","left"===g?1:5).style("grid-row",3).style("-ms-grid-row",3).style("width","1em").style("display","flex").style("align-items","center").style("justify-content","center").style("white-space","nowrap").append("div").attr("class","y-label").style("transform","rotate(-90deg)"),a.select(".y-label-container>.y-label").text(c),e(a,b,d)}),b.call(f)};return k(g,f,n(/^x/,/^y/,"chartLabel")),g.yLabel=function(){return arguments.length?(c=F(0>=arguments.length?void 0:arguments[0]),g):c},g.plotArea=function(){return arguments.length?(d=0>=arguments.length?void 0:arguments[0],g):d},g.decorate=function(){return arguments.length?(e=0>=arguments.length?void 0:arguments[0],g):e},g}},H=a=>"function"==typeof a?a:()=>a,I=(a,b)=>"left"===a?b/2:"right"===a?-b/2:0,J=a=>{const b=Object.assign({},a),c=()=>{};return Object.keys(b).forEach(a=>{c[a]=(...d)=>d.length?(b[a]=d[0],c):b[a]}),c},K=()=>{let a=()=>0,b=a=>a.x,f=a=>a.y,g="center",h=()=>5,j="vertical";const k=J({decorate:()=>{},defined:(c,d)=>e(a,b,f)(c,d),xScale:c.scaleIdentity(),yScale:c.scaleIdentity()});return k.values=(c,d)=>{const e=h(c,d),i=I(g,e),l=k.xScale(),m=k.yScale();if("vertical"===j){const g=m(f(c,d),d),h=m(a(c,d),d),j=l(b(c,d),d)+i;return{d:c,x:j,y:g,y0:h,width:e,height:g-h,origin:[j,g],baseOrigin:[j,h],transposedX:j,transposedY:g}}else{const g=l(f(c,d),d),h=l(a(c,d),d),j=m(b(c,d),d)+i;return{d:c,x:j,y:g,y0:h,width:e,height:g-h,origin:[g,j],baseOrigin:[h,j],transposedX:g,transposedY:j}}},k.xValues=()=>"vertical"===j?[b]:[a,f],k.yValues=()=>"vertical"===j?[a,f]:[b],k.baseValue=(...b)=>b.length?(a=H(b[0]),k):a,k.crossValue=(...a)=>a.length?(b=H(a[0]),k):b,k.mainValue=(...a)=>a.length?(f=H(a[0]),k):f,k.bandwidth=(...a)=>a.length?(h=H(a[0]),k):h,k.align=(...a)=>a.length?(g=a[0],k):g,k.orient=(...a)=>a.length?(j=a[0],k):j,k};var L={red:"#c60",green:"#6c0",black:"#000",gray:"#ddd",darkGray:"#999"},M=G(function(a,b){return a.svgPlotArea(b)},()=>{const a=K(),c=d.line().x((b,c)=>a.values(b,c).transposedX).y((b,c)=>a.values(b,c).transposedY),e=r("path","line"),f=d=>{d.selection&&e.transition(d),c.defined(a.defined()),d.each((d,f,g)=>{const h=e(b.select(g[f]),[d]);h.enter().attr("fill","none").attr("stroke",L.black),h.attr("d",c),a.decorate()(h,d,f)})};return k(f,a,m("baseValue","bandwidth","align")),i(f,e,"key"),i(f,c,"curve"),f}),N=G(function(a,b){return a.canvasPlotArea(b)},()=>{const a=K(),b=d.line().x((b,c)=>a.values(b,c).transposedX).y((b,c)=>a.values(b,c).transposedY),c=c=>{const d=b.context();d.beginPath(),b.defined(a.defined())(c),d.strokeStyle=L.black,d.fillStyle="transparent",a.decorate()(d,c),d.fill(),d.stroke(),d.closePath()};return k(c,a,m("baseValue","bandwidth","align")),i(c,b,"curve","context"),c});a.chartCanvasCartesian=N,a.chartCartesian=D,a.chartSvgCartesian=M,Object.defineProperty(a,"__esModule",{value:!0})}); | ||
(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?b(exports,require("d3-selection"),require("d3-scale"),require("d3-shape"),require("d3-path"),require("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-scale","d3-shape","d3-path","d3-array"],b):(a=a||self,b(a.fc=a.fc||{},a.d3,a.d3,a.d3,a.d3,a.d3))})(this,function(a,b,c,d){'use strict';function e(){const a=arguments;return function(b,d){for(let e=0,c=a.length;e<c;e++)if(null==a[e](b,d))return!1;return!0}}var f="default"in c?c["default"]:c,g="default"in d?d["default"]:d,h=(a,b,c)=>{const d=b[c];if("function"!=typeof d)throw new Error(`Attempt to rebind ${c} which isn't a function on the source object`);return(...c)=>{var e=d.apply(b,c);return e===b?a:e}},i=(a,b,...c)=>{for(const d of c)a[d]=h(a,b,d);return a};const j=a=>b=>a.reduce((a,b)=>a&&b(a),b);var k=(a,b,...c)=>{const d=j(c);for(const e of Object.keys(b)){const c=d(e);c&&(a[c]=h(a,b,e))}return a},l=a=>a.map(a=>"string"==typeof a?new RegExp(`^${a}$`):a),m=(...a)=>(a=l(a),b=>a.every(a=>!a.test(b))&&b),n=(...a)=>(a=l(a),b=>a.some(a=>a.test(b))&&b);const o=a=>a[0].toUpperCase()+a.slice(1);var p=a=>b=>a+o(b);const q=1e-6;var r=(a,b)=>{a=a||"g";let c=(a,b)=>b,d=null;const e=function(e,f){f=f||(a=>a);const g=e.selection?e:null;g&&(e=e.selection());const h=e.selectAll((a,b,c)=>Array.from(c[b].childNodes).filter(a=>1===a.nodeType)).filter(null==b?a:`${a}.${b}`);let i=h.data(f,c);const j=i.enter().append(a).attr("class",b);let k=i.exit();i=i.merge(j);const l=g||d;return l&&(i=i.transition(l).style("opacity",1),j.style("opacity",q),k=k.transition(l).style("opacity",q)),k.remove(),i.enter=()=>j,i.exit=()=>k,i};return e.element=(...b)=>b.length?(a=b[0],e):a,e.className=(...a)=>a.length?(b=a[0],e):b,e.key=(...a)=>a.length?(c=a[0],e):c,e.transition=(...a)=>a.length?(d=a[0],e):d,e};const s=a=>a,t=(a,c,e={})=>{let f=[10],h=null,i=()=>{},j=null,k=6,l=6,m=3;const n=d.line(),o=r("g","tick").key(s),p=r("path","domain"),q=()=>({offset:[0,l+m]}),t=()=>({path:[[0,0],[0,l]]}),u=e.labelOffset||q,v=e.tickPath||t,w=(a,b)=>{var c=Math.round;let e=0;return a.bandwidth&&(e=a.bandwidth()/2,a.round()&&(e=c(e))),c=>b(a(c)+e,0)},x=(a,b)=>z()?`translate(${b}, ${a})`:`translate(${a}, ${b})`,y=a=>z()?a.map(a=>[a[1],a[0]]):a,z=()=>"left"===a||"right"===a,A=(a,b,d)=>c[a]?c[a].apply(c,b):d,B=d=>{d.selection&&(o.transition(d),p.transition(d)),d.each((d,e,l)=>{const m=l[e],q=b.select(m);m.__scale__||q.attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor","right"===a?"start":"left"===a?"end":"middle");const r=m.__scale__||c;m.__scale__=c.copy();const t=null==h?A("ticks",f,c.domain()):h,B=null==j?A("tickFormat",f,s):j,C="bottom"===a||"right"===a?1:-1,D=([a,b])=>[a,C*b],E=c.range(),F=y([[E[0],C*k],[E[0],0],[E[1],0],[E[1],C*k]]),G=p(q,[d]);G.attr("d",n(F)).attr("stroke","#000");const H=o(q,t),g=t.map((a,b)=>u(a,b,t)),I=t.map((a,b)=>v(a,b,t));H.enter().attr("transform",w(r,x)).append("path").attr("stroke","#000"),H.enter().append("text").attr("transform",(a,b)=>x(...D(g[b].offset))).attr("fill","#000"),H.exit().attr("transform",w(c,x)),H.select("path").attr("visibility",(a,b)=>I[b].hidden&&"hidden").attr("d",(a,b)=>n(y(I[b].path.map(D)))),H.select("text").attr("visibility",(a,b)=>g[b].hidden&&"hidden").attr("transform",(a,b)=>x(...D(g[b].offset))).attr("dy",()=>{let b="0em";return z()?b="0.32em":"bottom"===a&&(b="0.71em"),b}).text(B),H.attr("transform",w(c,x)),i(H,d,e)})};return B.tickFormat=(...a)=>a.length?(j=a[0],B):j,B.tickSize=(...a)=>a.length?(l=k=+a[0],B):l,B.tickSizeInner=(...a)=>a.length?(l=+a[0],B):l,B.tickSizeOuter=(...a)=>a.length?(k=+a[0],B):k,B.tickPadding=(...a)=>a.length?(m=a[0],B):m,B.decorate=(...a)=>a.length?(i=a[0],B):i,B.scale=(...a)=>a.length?(c=a[0],B):c,B.ticks=(...a)=>(f=[...a],B),B.tickArguments=(...a)=>a.length?(f=null==a[0]?[]:[...a[0]],B):f.slice(),B.tickValues=(...a)=>a.length?(h=null==a[0]?[]:[...a[0]],B):h.slice(),B.orient=()=>a,B},u=(a,b)=>{let c=!1;const d=(a,d,f)=>{let g=0,h=e.tickSizeInner()+e.tickPadding(),i=!1;if(c){const c=b(a),j=d<f.length-1?b(f[d+1]):b.range()[1];g=(j-c)/2,h=e.tickPadding(),i=d===f.length-1&&c===j}return{offset:[g,h],hidden:i}},e=t(a,b,{labelOffset:d}),f=a=>e(a);return f.tickCenterLabel=(...a)=>a.length?(c=a[0],f):c,k(f,e),f},v=a=>u("top",a),w=a=>u("bottom",a),x=a=>u("left",a),y=a=>u("right",a);var z=function(){for(var a={},b=function(b){for(var c,d=0,e=Object.keys(a);d<e.length;d++)c=e[d],b[c].apply(null,a[c]);return b},c=arguments.length,d=Array(c),e=0;e<c;e++)d[e]=arguments[e];for(var f=function(){var c=h[g];b[c]=function(){for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return e.length?(a[c]=e,b):a[c]}},g=0,h=d;g<h.length;g++)f();return b},A="d3fc-group.cartesian-chart{width:100%;height:100%;overflow:hidden;display:grid;display:-ms-grid;grid-template-columns:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);-ms-grid-columns:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);grid-template-rows:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);-ms-grid-rows:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);}\nd3fc-group.cartesian-chart>.top-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:3;-ms-grid-column:3;grid-row:1;-ms-grid-row:1;}\nd3fc-group.cartesian-chart>.top-axis{height:2em;grid-column:3;-ms-grid-column:3;grid-row:2;-ms-grid-row:2;}\nd3fc-group.cartesian-chart>.left-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:1;-ms-grid-column:1;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.left-axis{width:3em;grid-column:2;-ms-grid-column:2;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.plot-area{overflow:hidden;grid-column:3;-ms-grid-column:3;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.right-axis{width:3em;grid-column:4;-ms-grid-column:4;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.right-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:5;-ms-grid-column:5;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.bottom-axis{height:2em;grid-column:3;-ms-grid-column:3;grid-row:4;-ms-grid-row:4;}\nd3fc-group.cartesian-chart>.bottom-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:3;-ms-grid-column:3;grid-row:5;-ms-grid-row:5;}\nd3fc-group.cartesian-chart>.y-label{display:flex;transform:rotate(-90deg);width:1em;white-space:nowrap;justify-content:center;}",B=document.createElement("style");B.setAttribute("type","text/css"),document.querySelector("head").appendChild(B),B.styleSheet?B.styleSheet.cssText+=A:B.textContent+=A;var C=function(a){return"function"==typeof a?a:function(){return a}},D=function(){var a=E.apply(void 0,arguments),c=a.xScale,e=a.yScale,f=a.xAxis,g=a.yAxis,h=C(""),i=C(""),j=C(""),l=C(null),n=C(null),o=C("right"),q=C("bottom"),s=null,t=null,u=null,v=z("tickFormat","ticks","tickArguments","tickSize","tickSizeInner","tickSizeOuter","tickValues","tickPadding","tickCenterLabel"),w=function(){},x=z("tickFormat","ticks","tickArguments","tickSize","tickSizeInner","tickSizeOuter","tickValues","tickPadding","tickCenterLabel"),y=function(){},A=function(){},B=r("d3fc-group","cartesian-chart"),D=r("d3fc-canvas","gl-plot-area"),F=r("d3fc-canvas","canvas-plot-area"),G=r("d3fc-svg","plot-area"),H=r("d3fc-svg","x-axis").key(function(a){return a}),I=r("d3fc-svg","y-axis").key(function(a){return a}),J=r("div","chart-label"),K=r("div","x-label").key(function(a){return a}),L=r("div","y-label").key(function(a){return a}),M=function(a){return function(b){return a.selection?b.transition(a):b}},N=function(a){var k=M(a);a.each(function(a,d,m){var p=B(b.select(m[d]),[a]);p.enter().attr("auto-resize",""),J(p,[q(a)]).attr("class",function(a){return"top"===a?"chart-label bottom-label":"chart-label top-label"}).style("margin-bottom",function(a){return"top"===a?0:"1em"}).style("margin-top",function(a){return"top"===a?"1em":0}).text(h(a)),K(p,[q(a)]).attr("class",function(a){return"x-label ".concat(a,"-label")}).text(i(a)),L(p,[o(a)]).attr("class",function(a){return"y-label ".concat(a,"-label")}).text(j(a)),D(p,s?[a]:[]).attr("set-webgl-viewport","").classed("plot-area",!0).on("draw",function(a,d,f){var g=b.select(f[d]).select("canvas").node();s.context(g.getContext("webgl")).xScale(c).yScale(e),s(a)}),F(p,t?[a]:[]).classed("plot-area",!0).on("draw",function(a,d,f){var g=b.select(f[d]).select("canvas").node();t.context(g.getContext("2d")).xScale(c).yScale(e),t(a)}),G(p,u?[a]:[]).on("draw",function(a,d,f){u.xScale(c).yScale(e),k(b.select(f[d])).select("svg").call(u)}),H(p,[q(a)]).attr("class",function(a){return"x-axis ".concat(a,"-axis")}).style("height",l(a)).on("measure",function(a,d,e){var f=b.event.detail,g=f.width,h=f.height;"top"===a&&b.select(e[d]).select("svg").attr("viewBox","0 ".concat(-h," ").concat(g," ").concat(h)),c.range([0,g])}).on("draw",function(a,d,e){var g="top"===a?f.top(c):f.bottom(c);g.decorate(w),k(b.select(e[d])).select("svg").call(v(g))}),I(p,[o(a)]).attr("class",function(a){return"y-axis ".concat(a,"-axis")}).style("width",n(a)).on("measure",function(a,c,d){var f=b.event.detail,g=f.width,h=f.height;"left"===a&&b.select(d[c]).select("svg").attr("viewBox","".concat(-g," 0 ").concat(g," ").concat(h)),e.range([h,0])}).on("draw",function(a,c,d){var f="left"===a?g.left(e):g.right(e);f.decorate(y),k(b.select(d[c])).select("svg").call(x(f))}),p.each(function(a,b,c){return c[b].requestRedraw()}),A(p,a,d)})},O=m(/range\w*/,/tickFormat/);return k(N,c,O,p("x")),k(N,e,O,p("y")),k(N,v,p("x")),k(N,x,p("y")),N.xOrient=function(){return arguments.length?(q=C(0>=arguments.length?void 0:arguments[0]),N):q},N.yOrient=function(){return arguments.length?(o=C(0>=arguments.length?void 0:arguments[0]),N):o},N.xDecorate=function(){return arguments.length?(w=0>=arguments.length?void 0:arguments[0],N):w},N.yDecorate=function(){return arguments.length?(y=0>=arguments.length?void 0:arguments[0],N):y},N.chartLabel=function(){return arguments.length?(h=C(0>=arguments.length?void 0:arguments[0]),N):h},N.xLabel=function(){return arguments.length?(i=C(0>=arguments.length?void 0:arguments[0]),N):i},N.yLabel=function(){return arguments.length?(j=C(0>=arguments.length?void 0:arguments[0]),N):j},N.xAxisHeight=function(){return arguments.length?(l=C(0>=arguments.length?void 0:arguments[0]),N):l},N.yAxisWidth=function(){return arguments.length?(n=C(0>=arguments.length?void 0:arguments[0]),N):n},N.webglPlotArea=function(){return arguments.length?(s=0>=arguments.length?void 0:arguments[0],N):s},N.canvasPlotArea=function(){return arguments.length?(t=0>=arguments.length?void 0:arguments[0],N):t},N.svgPlotArea=function(){return arguments.length?(u=0>=arguments.length?void 0:arguments[0],N):u},N.decorate=function(){return arguments.length?(A=0>=arguments.length?void 0:arguments[0],N):A},N},E=function(){for(var a={xScale:c.scaleIdentity(),yScale:c.scaleIdentity(),xAxis:{bottom:w,top:v},yAxis:{right:y,left:x}},b=arguments.length,d=Array(b),e=0;e<b;e++)d[e]=arguments[e];return 1!==d.length||d[0].domain||d[0].range?Object.assign(a,{xScale:d[0]||a.xScale,yScale:d[1]||a.yScale}):Object.assign(a,d[0])},F=function(a){return"function"==typeof a?a:function(){return a}},G=function(a,b){return function(){var c=F(""),d=b,e=function(){},f=D.apply(void 0,arguments),g=function(b){a(f,d),f.decorate(function(a,b,d){a.enter().select(".x-label").style("height","1em").style("line-height","1em");var g=f.yOrient()(b);a.enter().append("div").attr("class","y-label-container").style("grid-column","left"===g?1:5).style("-ms-grid-column","left"===g?1:5).style("grid-row",3).style("-ms-grid-row",3).style("width","1em").style("display","flex").style("align-items","center").style("justify-content","center").style("white-space","nowrap").append("div").attr("class","y-label").style("transform","rotate(-90deg)"),a.select(".y-label-container>.y-label").text(c),e(a,b,d)}),b.call(f)};return k(g,f,n(/^x/,/^y/,"chartLabel")),g.yLabel=function(){return arguments.length?(c=F(0>=arguments.length?void 0:arguments[0]),g):c},g.plotArea=function(){return arguments.length?(d=0>=arguments.length?void 0:arguments[0],g):d},g.decorate=function(){return arguments.length?(e=0>=arguments.length?void 0:arguments[0],g):e},g}},H=a=>"function"==typeof a?a:()=>a,I=(a,b)=>"left"===a?b/2:"right"===a?-b/2:0,J=a=>{const b=Object.assign({},a),c=()=>{};return Object.keys(b).forEach(a=>{c[a]=(...d)=>d.length?(b[a]=d[0],c):b[a]}),c},K=()=>{let a=()=>0,b=a=>a.x,f=a=>a.y,g="center",h=()=>5,j="vertical";const k=J({decorate:()=>{},defined:(c,d)=>e(a,b,f)(c,d),xScale:c.scaleIdentity(),yScale:c.scaleIdentity()});return k.values=(c,d)=>{const e=h(c,d),i=I(g,e),l=k.xScale(),m=k.yScale();if("vertical"===j){const g=m(f(c,d),d),h=m(a(c,d),d),j=l(b(c,d),d)+i;return{d:c,x:j,y:g,y0:h,width:e,height:g-h,origin:[j,g],baseOrigin:[j,h],transposedX:j,transposedY:g}}else{const g=l(f(c,d),d),h=l(a(c,d),d),j=m(b(c,d),d)+i;return{d:c,x:j,y:g,y0:h,width:e,height:g-h,origin:[g,j],baseOrigin:[h,j],transposedX:g,transposedY:j}}},k.xValues=()=>"vertical"===j?[b]:[a,f],k.yValues=()=>"vertical"===j?[a,f]:[b],k.baseValue=(...b)=>b.length?(a=H(b[0]),k):a,k.crossValue=(...a)=>a.length?(b=H(a[0]),k):b,k.mainValue=(...a)=>a.length?(f=H(a[0]),k):f,k.bandwidth=(...a)=>a.length?(h=H(a[0]),k):h,k.align=(...a)=>a.length?(g=a[0],k):g,k.orient=(...a)=>a.length?(j=a[0],k):j,k};var L={red:"#c60",green:"#6c0",black:"#000",gray:"#ddd",darkGray:"#999"},M=G(function(a,b){return a.svgPlotArea(b)},()=>{const a=K(),c=d.line().x((b,c)=>a.values(b,c).transposedX).y((b,c)=>a.values(b,c).transposedY),e=r("path","line"),f=d=>{d.selection&&e.transition(d),c.defined(a.defined()),d.each((d,f,g)=>{const h=e(b.select(g[f]),[d]);h.enter().attr("fill","none").attr("stroke",L.black),h.attr("d",c),a.decorate()(h,d,f)})};return k(f,a,m("baseValue","bandwidth","align")),i(f,e,"key"),i(f,c,"curve"),f}),N=G(function(a,b){return a.canvasPlotArea(b)},()=>{const a=K(),b=d.line().x((b,c)=>a.values(b,c).transposedX).y((b,c)=>a.values(b,c).transposedY),c=c=>{const d=b.context();d.beginPath(),d.strokeStyle=L.black,d.fillStyle="transparent",a.decorate()(d,c),b.defined(a.defined())(c),d.fill(),d.stroke(),d.closePath()};return k(c,a,m("baseValue","bandwidth","align")),i(c,b,"curve","context"),c});a.chartCanvasCartesian=N,a.chartCartesian=D,a.chartSvgCartesian=M,Object.defineProperty(a,"__esModule",{value:!0})}); |
@@ -6,2 +6,10 @@ # Change Log | ||
## [2.7.6](https://github.com/d3fc/d3fc/compare/@d3fc/d3fc-chart@2.7.5...@d3fc/d3fc-chart@2.7.6) (2020-01-21) | ||
**Note:** Version bump only for package @d3fc/d3fc-chart | ||
## [2.7.5](https://github.com/d3fc/d3fc/compare/@d3fc/d3fc-chart@2.7.4...@d3fc/d3fc-chart@2.7.5) (2020-01-21) | ||
@@ -8,0 +16,0 @@ |
{ | ||
"name": "@d3fc/d3fc-chart", | ||
"version": "2.7.5", | ||
"version": "2.7.6", | ||
"description": "A simple Cartesian chart component that renders to canvas or SVG.", | ||
@@ -26,3 +26,3 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@d3fc/d3fc-annotation": "^2.4.20", | ||
"@d3fc/d3fc-annotation": "^2.4.21", | ||
"@d3fc/d3fc-extent": "^3.1.7", | ||
@@ -34,5 +34,5 @@ "d3": "^4.2.5" | ||
"@d3fc/d3fc-data-join": "^5.0.11", | ||
"@d3fc/d3fc-element": "^5.3.5", | ||
"@d3fc/d3fc-element": "^5.3.6", | ||
"@d3fc/d3fc-rebind": "^5.0.10", | ||
"@d3fc/d3fc-series": "^4.3.4", | ||
"@d3fc/d3fc-series": "^4.3.5", | ||
"d3-scale": "^1.0.3", | ||
@@ -44,3 +44,3 @@ "d3-selection": "^1.0.2" | ||
}, | ||
"gitHead": "4c8367c200d13afbb0652c9e39b6983b92b46686" | ||
"gitHead": "786820bdc99d786554a7177d783ec25ce8af214a" | ||
} |
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
155776
Updated@d3fc/d3fc-element@^5.3.6
Updated@d3fc/d3fc-series@^4.3.5