New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@d3fc/d3fc-chart

Package Overview
Dependencies
Maintainers
3
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@d3fc/d3fc-chart - npm Package Compare versions

Comparing version 2.6.14 to 2.6.15

4

build/d3fc-chart.js

@@ -261,2 +261,6 @@ (function (global, factory) {

base.xValues = () => orient === 'vertical' ? [crossValue] : [baseValue, mainValue];
base.yValues = () => orient !== 'vertical' ? [crossValue] : [baseValue, mainValue];
base.baseValue = (...args) => {

@@ -263,0 +267,0 @@ if (!args.length) {

2

build/d3fc-chart.min.js

@@ -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=(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}},g=(a,b,...c)=>{for(const d of c)a[d]=f(a,b,d);return a};const h=a=>b=>a.reduce((a,b)=>a&&b(a),b);var i=(a,b,...c)=>{const d=h(c);for(const e of Object.keys(b)){const c=d(e);c&&(a[c]=f(a,b,e))}return a},j=a=>a.map(a=>"string"==typeof a?new RegExp(`^${a}$`):a),k=(...a)=>(a=j(a),b=>a.every(a=>!a.test(b))&&b),l=(...a)=>(a=j(a),b=>a.some(a=>a.test(b))&&b);const m=a=>a[0].toUpperCase()+a.slice(1);var n=a=>b=>a+m(b);const o=1e-6;var p=(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",o),k=k.transition(l).style("opacity",o)),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},q=a=>"function"==typeof a?a:()=>a,r=(a,b)=>"left"===a?b/2:"right"===a?-b/2:0,s=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},t=()=>{let a=()=>0,b=a=>a.x,f=a=>a.y,g="center",h=()=>5,j="vertical";const k=s({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=r(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.baseValue=(...b)=>b.length?(a=q(b[0]),k):a,k.crossValue=(...a)=>a.length?(b=q(a[0]),k):b,k.mainValue=(...a)=>a.length?(f=q(a[0]),k):f,k.bandwidth=(...a)=>a.length?(h=q(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 u={red:"#c60",green:"#6c0",black:"#000",gray:"#ddd",darkGray:"#999"};const v=a=>a,w=(a,c,e={})=>{let f=[10],h=null,i=()=>{},j=null,k=6,l=6,m=3;const n=d.line(),o=p("g","tick").key(v),q=p("path","domain"),r=()=>({offset:[0,l+m]}),s=()=>({path:[[0,0],[0,l]]}),t=e.labelOffset||r,u=e.tickPath||s,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),q.transition(d)),d.each((d,e,l)=>{const m=l[e],p=b.select(m);m.__scale__||p.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 s=null==h?A("ticks",f,c.domain()):h,B=null==j?A("tickFormat",f,v):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=q(p,[d]);G.attr("d",n(F)).attr("stroke","#000");const H=o(p,s),g=s.map((a,b)=>t(a,b,s)),I=s.map((a,b)=>u(a,b,s));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},x=(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=w(a,b,{labelOffset:d}),f=a=>e(a);return f.tickCenterLabel=(...a)=>a.length?(c=a[0],f):c,i(f,e),f},y=a=>x("top",a),z=a=>x("bottom",a),A=a=>x("left",a),B=a=>x("right",a);var C=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},D="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;}",E=document.createElement("style");E.setAttribute("type","text/css"),document.querySelector("head").appendChild(E),E.styleSheet?E.styleSheet.cssText+=D:E.textContent+=D;var F=function(a){return"function"==typeof a?a:function(){return a}},G=function(){var a=H.apply(void 0,arguments),c=a.xScale,e=a.yScale,f=a.xAxis,g=a.yAxis,h=F(""),j=F(""),l=F(""),m=F(null),o=F(null),q=F("right"),r=F("bottom"),s=null,t=null,u=C("tickFormat","ticks","tickArguments","tickSize","tickSizeInner","tickSizeOuter","tickValues","tickPadding","tickCenterLabel"),v=function(){},w=C("tickFormat","ticks","tickArguments","tickSize","tickSizeInner","tickSizeOuter","tickValues","tickPadding","tickCenterLabel"),x=function(){},y=function(){},z=p("d3fc-group","cartesian-chart"),A=p("d3fc-canvas","plot-area"),B=p("d3fc-svg","plot-area"),D=p("d3fc-svg","x-axis").key(function(a){return a}),E=p("d3fc-svg","y-axis").key(function(a){return a}),G=p("div","chart-label"),I=p("div","x-label").key(function(a){return a}),J=p("div","y-label").key(function(a){return a}),K=function(a){return function(b){return a.selection?b.transition(a):b}},L=function(a){var k=K(a);a.each(function(a,d,i){var n=z(b.select(i[d]),[a]);n.enter().attr("auto-resize",""),G(n,[r(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)),I(n,[r(a)]).attr("class",function(a){return"x-label ".concat(a,"-label")}).text(j(a)),J(n,[q(a)]).attr("class",function(a){return"y-label ".concat(a,"-label")}).text(l(a)),A(n,s?[a]:[]).on("draw",function(a,d,f){var g=b.select(f[d]).select("canvas").node();s.context(g.getContext("2d")).xScale(c).yScale(e),s(a)}),B(n,t?[a]:[]).on("draw",function(a,d,f){t.xScale(c).yScale(e),k(b.select(f[d])).select("svg").call(t)}),D(n,[r(a)]).attr("class",function(a){return"x-axis ".concat(a,"-axis")}).style("height",m(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(v),k(b.select(e[d])).select("svg").call(u(g))}),E(n,[q(a)]).attr("class",function(a){return"y-axis ".concat(a,"-axis")}).style("width",o(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(x),k(b.select(d[c])).select("svg").call(w(f))}),n.each(function(a,b,c){return c[b].requestRedraw()}),y(n,a,d)})},M=k(/range\w*/,/tickFormat/);return i(L,c,M,n("x")),i(L,e,M,n("y")),i(L,u,n("x")),i(L,w,n("y")),L.xOrient=function(){return arguments.length?(r=F(0>=arguments.length?void 0:arguments[0]),L):r},L.yOrient=function(){return arguments.length?(q=F(0>=arguments.length?void 0:arguments[0]),L):q},L.xDecorate=function(){return arguments.length?(v=0>=arguments.length?void 0:arguments[0],L):v},L.yDecorate=function(){return arguments.length?(x=0>=arguments.length?void 0:arguments[0],L):x},L.chartLabel=function(){return arguments.length?(h=F(0>=arguments.length?void 0:arguments[0]),L):h},L.xLabel=function(){return arguments.length?(j=F(0>=arguments.length?void 0:arguments[0]),L):j},L.yLabel=function(){return arguments.length?(l=F(0>=arguments.length?void 0:arguments[0]),L):l},L.xAxisHeight=function(){return arguments.length?(m=F(0>=arguments.length?void 0:arguments[0]),L):m},L.yAxisWidth=function(){return arguments.length?(o=F(0>=arguments.length?void 0:arguments[0]),L):o},L.canvasPlotArea=function(){return arguments.length?(s=0>=arguments.length?void 0:arguments[0],L):s},L.svgPlotArea=function(){return arguments.length?(t=0>=arguments.length?void 0:arguments[0],L):t},L.decorate=function(){return arguments.length?(y=0>=arguments.length?void 0:arguments[0],L):y},L},H=function(){for(var a={xScale:c.scaleIdentity(),yScale:c.scaleIdentity(),xAxis:{bottom:z,top:y},yAxis:{right:B,left:A}},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])},I=function(a){return"function"==typeof a?a:function(){return a}},J=function(a,b){return function(){var c=I(""),d=b,e=function(){},f=G.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 i(g,f,l(/^x/,/^y/,"chartLabel")),g.yLabel=function(){return arguments.length?(c=I(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}},K=J(function(a,b){return a.svgPlotArea(b)},()=>{const a=t(),c=d.line().x((b,c)=>a.values(b,c).transposedX).y((b,c)=>a.values(b,c).transposedY),e=p("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",u.black),h.attr("d",c),a.decorate()(h,d,f)})};return i(f,a,k("baseValue","bandwidth","align")),g(f,e,"key"),g(f,c,"curve"),f}),L=J(function(a,b){return a.canvasPlotArea(b)},()=>{const a=t(),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=u.black,d.fillStyle="transparent",a.decorate()(d,c),d.fill(),d.stroke(),d.closePath()};return i(c,a,k("baseValue","bandwidth","align")),g(c,b,"curve","context"),c});a.chartCanvasCartesian=L,a.chartCartesian=G,a.chartSvgCartesian=K,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=(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}},g=(a,b,...c)=>{for(const d of c)a[d]=f(a,b,d);return a};const h=a=>b=>a.reduce((a,b)=>a&&b(a),b);var i=(a,b,...c)=>{const d=h(c);for(const e of Object.keys(b)){const c=d(e);c&&(a[c]=f(a,b,e))}return a},j=a=>a.map(a=>"string"==typeof a?new RegExp(`^${a}$`):a),k=(...a)=>(a=j(a),b=>a.every(a=>!a.test(b))&&b),l=(...a)=>(a=j(a),b=>a.some(a=>a.test(b))&&b);const m=a=>a[0].toUpperCase()+a.slice(1);var n=a=>b=>a+m(b);const o=1e-6;var p=(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",o),k=k.transition(l).style("opacity",o)),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},q=a=>"function"==typeof a?a:()=>a,r=(a,b)=>"left"===a?b/2:"right"===a?-b/2:0,s=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},t=()=>{let a=()=>0,b=a=>a.x,f=a=>a.y,g="center",h=()=>5,j="vertical";const k=s({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=r(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=q(b[0]),k):a,k.crossValue=(...a)=>a.length?(b=q(a[0]),k):b,k.mainValue=(...a)=>a.length?(f=q(a[0]),k):f,k.bandwidth=(...a)=>a.length?(h=q(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 u={red:"#c60",green:"#6c0",black:"#000",gray:"#ddd",darkGray:"#999"};const v=a=>a,w=(a,c,e={})=>{let f=[10],h=null,i=()=>{},j=null,k=6,l=6,m=3;const n=d.line(),o=p("g","tick").key(v),q=p("path","domain"),r=()=>({offset:[0,l+m]}),s=()=>({path:[[0,0],[0,l]]}),t=e.labelOffset||r,u=e.tickPath||s,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),q.transition(d)),d.each((d,e,l)=>{const m=l[e],p=b.select(m);m.__scale__||p.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 s=null==h?A("ticks",f,c.domain()):h,B=null==j?A("tickFormat",f,v):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=q(p,[d]);G.attr("d",n(F)).attr("stroke","#000");const H=o(p,s),g=s.map((a,b)=>t(a,b,s)),I=s.map((a,b)=>u(a,b,s));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},x=(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=w(a,b,{labelOffset:d}),f=a=>e(a);return f.tickCenterLabel=(...a)=>a.length?(c=a[0],f):c,i(f,e),f},y=a=>x("top",a),z=a=>x("bottom",a),A=a=>x("left",a),B=a=>x("right",a);var C=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},D="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;}",E=document.createElement("style");E.setAttribute("type","text/css"),document.querySelector("head").appendChild(E),E.styleSheet?E.styleSheet.cssText+=D:E.textContent+=D;var F=function(a){return"function"==typeof a?a:function(){return a}},G=function(){var a=H.apply(void 0,arguments),c=a.xScale,e=a.yScale,f=a.xAxis,g=a.yAxis,h=F(""),j=F(""),l=F(""),m=F(null),o=F(null),q=F("right"),r=F("bottom"),s=null,t=null,u=C("tickFormat","ticks","tickArguments","tickSize","tickSizeInner","tickSizeOuter","tickValues","tickPadding","tickCenterLabel"),v=function(){},w=C("tickFormat","ticks","tickArguments","tickSize","tickSizeInner","tickSizeOuter","tickValues","tickPadding","tickCenterLabel"),x=function(){},y=function(){},z=p("d3fc-group","cartesian-chart"),A=p("d3fc-canvas","plot-area"),B=p("d3fc-svg","plot-area"),D=p("d3fc-svg","x-axis").key(function(a){return a}),E=p("d3fc-svg","y-axis").key(function(a){return a}),G=p("div","chart-label"),I=p("div","x-label").key(function(a){return a}),J=p("div","y-label").key(function(a){return a}),K=function(a){return function(b){return a.selection?b.transition(a):b}},L=function(a){var k=K(a);a.each(function(a,d,i){var n=z(b.select(i[d]),[a]);n.enter().attr("auto-resize",""),G(n,[r(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)),I(n,[r(a)]).attr("class",function(a){return"x-label ".concat(a,"-label")}).text(j(a)),J(n,[q(a)]).attr("class",function(a){return"y-label ".concat(a,"-label")}).text(l(a)),A(n,s?[a]:[]).on("draw",function(a,d,f){var g=b.select(f[d]).select("canvas").node();s.context(g.getContext("2d")).xScale(c).yScale(e),s(a)}),B(n,t?[a]:[]).on("draw",function(a,d,f){t.xScale(c).yScale(e),k(b.select(f[d])).select("svg").call(t)}),D(n,[r(a)]).attr("class",function(a){return"x-axis ".concat(a,"-axis")}).style("height",m(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(v),k(b.select(e[d])).select("svg").call(u(g))}),E(n,[q(a)]).attr("class",function(a){return"y-axis ".concat(a,"-axis")}).style("width",o(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(x),k(b.select(d[c])).select("svg").call(w(f))}),n.each(function(a,b,c){return c[b].requestRedraw()}),y(n,a,d)})},M=k(/range\w*/,/tickFormat/);return i(L,c,M,n("x")),i(L,e,M,n("y")),i(L,u,n("x")),i(L,w,n("y")),L.xOrient=function(){return arguments.length?(r=F(0>=arguments.length?void 0:arguments[0]),L):r},L.yOrient=function(){return arguments.length?(q=F(0>=arguments.length?void 0:arguments[0]),L):q},L.xDecorate=function(){return arguments.length?(v=0>=arguments.length?void 0:arguments[0],L):v},L.yDecorate=function(){return arguments.length?(x=0>=arguments.length?void 0:arguments[0],L):x},L.chartLabel=function(){return arguments.length?(h=F(0>=arguments.length?void 0:arguments[0]),L):h},L.xLabel=function(){return arguments.length?(j=F(0>=arguments.length?void 0:arguments[0]),L):j},L.yLabel=function(){return arguments.length?(l=F(0>=arguments.length?void 0:arguments[0]),L):l},L.xAxisHeight=function(){return arguments.length?(m=F(0>=arguments.length?void 0:arguments[0]),L):m},L.yAxisWidth=function(){return arguments.length?(o=F(0>=arguments.length?void 0:arguments[0]),L):o},L.canvasPlotArea=function(){return arguments.length?(s=0>=arguments.length?void 0:arguments[0],L):s},L.svgPlotArea=function(){return arguments.length?(t=0>=arguments.length?void 0:arguments[0],L):t},L.decorate=function(){return arguments.length?(y=0>=arguments.length?void 0:arguments[0],L):y},L},H=function(){for(var a={xScale:c.scaleIdentity(),yScale:c.scaleIdentity(),xAxis:{bottom:z,top:y},yAxis:{right:B,left:A}},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])},I=function(a){return"function"==typeof a?a:function(){return a}},J=function(a,b){return function(){var c=I(""),d=b,e=function(){},f=G.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 i(g,f,l(/^x/,/^y/,"chartLabel")),g.yLabel=function(){return arguments.length?(c=I(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}},K=J(function(a,b){return a.svgPlotArea(b)},()=>{const a=t(),c=d.line().x((b,c)=>a.values(b,c).transposedX).y((b,c)=>a.values(b,c).transposedY),e=p("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",u.black),h.attr("d",c),a.decorate()(h,d,f)})};return i(f,a,k("baseValue","bandwidth","align")),g(f,e,"key"),g(f,c,"curve"),f}),L=J(function(a,b){return a.canvasPlotArea(b)},()=>{const a=t(),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=u.black,d.fillStyle="transparent",a.decorate()(d,c),d.fill(),d.stroke(),d.closePath()};return i(c,a,k("baseValue","bandwidth","align")),g(c,b,"curve","context"),c});a.chartCanvasCartesian=L,a.chartCartesian=G,a.chartSvgCartesian=K,Object.defineProperty(a,"__esModule",{value:!0})});

@@ -6,2 +6,10 @@ # Change Log

## [2.6.15](https://github.com/d3fc/d3fc/compare/@d3fc/d3fc-chart@2.6.14...@d3fc/d3fc-chart@2.6.15) (2019-11-19)
**Note:** Version bump only for package @d3fc/d3fc-chart
## [2.6.14](https://github.com/d3fc/d3fc/compare/@d3fc/d3fc-chart@2.6.13...@d3fc/d3fc-chart@2.6.14) (2019-09-04)

@@ -8,0 +16,0 @@

{
"name": "@d3fc/d3fc-chart",
"version": "2.6.14",
"version": "2.6.15",
"description": "A simple Cartesian chart component that renders to canvas or SVG.",

@@ -27,3 +27,3 @@ "license": "MIT",

"devDependencies": {
"@d3fc/d3fc-annotation": "^2.4.12",
"@d3fc/d3fc-annotation": "^2.4.13",
"@d3fc/d3fc-extent": "^3.1.6",

@@ -35,5 +35,5 @@ "d3": "^4.2.5"

"@d3fc/d3fc-data-join": "^5.0.10",
"@d3fc/d3fc-element": "^5.2.14",
"@d3fc/d3fc-element": "^5.2.15",
"@d3fc/d3fc-rebind": "^5.0.9",
"@d3fc/d3fc-series": "^4.0.29",
"@d3fc/d3fc-series": "^4.1.0",
"d3-scale": "^1.0.3",

@@ -45,3 +45,3 @@ "d3-selection": "^1.0.2"

},
"gitHead": "d216bebca76b9bde7456f1c06e768bc67814dd2e"
"gitHead": "21a444e11a6f63d2ce64625578fef83d1304050c"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc