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.1 to 2.6.2

test/stroreSpec.js

10

build/d3fc-chart.js

@@ -865,3 +865,3 @@ (function (global, factory) {

target[key](data[key]);
target[key].apply(null, data[key]);
}

@@ -888,6 +888,10 @@ } catch (err) {

store[name] = function () {
if (!arguments.length) {
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
if (!args.length) {
return data[name];
}
data[name] = arguments.length <= 0 ? undefined : arguments[0];
data[name] = args;
return store;

@@ -894,0 +898,0 @@ };

@@ -1,1 +0,1 @@

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(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"],n):n(t.fc=t.fc||{},t.d3,t.d3,t.d3,t.d3,t.d3)}(this,function(t,n,e,r,i,o){"use strict";function a(){var t=arguments;return function(n,e){for(var r=0,i=t.length;r<i;r++)if(null==t[r](n,e))return!1;return!0}}var c=function(t,n,e){var r=n[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(n,i);return a===n?t:a}},u=function(t,n){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 l,f=r[Symbol.iterator]();!(o=(l=f.next()).done);o=!0){var s=l.value;t[s]=c(t,n,s)}}catch(t){a=!0,u=t}finally{try{!o&&f.return&&f.return()}finally{if(a)throw u}}return t},l=function(t){return function(n){return t.reduce(function(t,n){return t&&n(t)},n)}},f=function(t,n){for(var e=arguments.length,r=Array(e>2?e-2:0),i=2;i<e;i++)r[i-2]=arguments[i];var o=l(r),a=!0,u=!1,f=void 0;try{for(var s,d=Object.keys(n)[Symbol.iterator]();!(a=(s=d.next()).done);a=!0){var g=s.value,h=o(g);h&&(t[h]=c(t,n,g))}}catch(t){u=!0,f=t}finally{try{!a&&d.return&&d.return()}finally{if(u)throw f}}return t},s=function(t){return t.map(function(t){return"string"==typeof t?new RegExp("^"+t+"$"):t})},d=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];return n=s(n),function(t){return n.every(function(n){return!n.test(t)})&&t}},g=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];return n=s(n),function(t){return n.some(function(n){return n.test(t)})&&t}},h=function(t){return t[0].toUpperCase()+t.slice(1)},m=function(t){return function(n){return t+h(n)}},v=function(t,n){t=t||"g";var e=function(t,n){return n},r=null,i=function(i,o){o=o||function(t){return t};var a=i.selection?i:null;a&&(i=i.selection());var c=i.selectAll(function(t,n,e){return Array.from(e[n].childNodes).filter(function(t){return 1===t.nodeType})}).filter(null==n?t:t+"."+n),u=c.data(o,e),l=u.enter().append(t).attr("class",n),f=u.exit();u=u.merge(l);var s=a||r;return s&&(u=u.transition(s).style("opacity",1),l.style("opacity",1e-6),f=f.transition(s).style("opacity",1e-6)),f.remove(),u.enter=function(){return l},u.exit=function(){return f},u};return i.element=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],i):t},i.className=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],i):n},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},y=function(t){return"function"==typeof t?t:function(){return t}},p=function(t,n){switch(t){case"left":return n/2;case"right":return-n/2;default:return 0}},x=function(t){var n=Object.assign({},t),e=function(){};return Object.keys(n).forEach(function(t){e[t]=function(){return arguments.length?(n[t]=arguments.length<=0?void 0:arguments[0],e):n[t]}}),e},b=function(){var t=function(){return 0},n=function(t){return t.x},r=function(t){return t.y},i="center",o=function(){return 5},c="vertical",u=x({decorate:function(){},defined:function(e,i){return a(t,n,r)(e,i)},xScale:e.scaleIdentity(),yScale:e.scaleIdentity()});return u.values=function(e,a){var l=o(e,a),f=p(i,l),s=u.xScale(),d=u.yScale();if("vertical"===c){var g=d(r(e,a),a),h=d(t(e,a),a),m=s(n(e,a),a)+f;return{d:e,x:m,y:g,y0:h,width:l,height:g-h,origin:[m,g],baseOrigin:[m,h],transposedX:m,transposedY:g}}var v=s(r(e,a),a),y=s(t(e,a),a),x=d(n(e,a),a)+f;return{d:e,x:x,y:v,y0:y,width:l,height:v-y,origin:[v,x],baseOrigin:[y,x],transposedX:v,transposedY:x}},u.baseValue=function(){return arguments.length?(t=y(arguments.length<=0?void 0:arguments[0]),u):t},u.crossValue=function(){return arguments.length?(n=y(arguments.length<=0?void 0:arguments[0]),u):n},u.mainValue=function(){return arguments.length?(r=y(arguments.length<=0?void 0:arguments[0]),u):r},u.bandwidth=function(){return arguments.length?(o=y(arguments.length<=0?void 0:arguments[0]),u):o},u.align=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],u):i},u.orient=function(){return arguments.length?(c=arguments.length<=0?void 0:arguments[0],u):c},u},w={red:"#c60",green:"#6c0",black:"#000",gray:"#ddd",darkGray:"#999"},k=function(){var t=b(),e=r.line().x(function(n,e){return t.values(n,e).transposedX}).y(function(n,e){return t.values(n,e).transposedY}),i=v("path","line"),o=function(r){r.selection&&i.transition(r),e.defined(t.defined()),r.each(function(r,o,a){var c=i(n.select(a[o]),[r]);c.enter().attr("fill","none").attr("stroke",w.black),c.attr("d",e),t.decorate()(c,r,o)})};return f(o,t,d("baseValue","bandwidth","align")),u(o,i,"key"),u(o,e,"curve"),o},S=function(){var t=b(),n=r.line().x(function(n,e){return t.values(n,e).transposedX}).y(function(n,e){return t.values(n,e).transposedY}),e=function(e){var r=n.context();r.beginPath(),n.defined(t.defined())(e),r.strokeStyle=w.black,r.fillStyle="transparent",t.decorate()(r,e),r.fill(),r.stroke(),r.closePath()};return f(e,t,d("baseValue","bandwidth","align")),u(e,n,"curve","context"),e},A=function(){function t(t,n){var e=[],r=!0,i=!1,o=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(e.push(a.value),!n||e.length!==n);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&c.return&&c.return()}finally{if(i)throw o}}return e}return function(n,e){if(Array.isArray(n))return n;if(Symbol.iterator in Object(n))return t(n,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),O=function(t){if(Array.isArray(t)){for(var n=0,e=Array(t.length);n<t.length;n++)e[n]=t[n];return e}return Array.from(t)},j=function(t){return t},_=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=[10],a=null,c=function(){},u=null,l=6,f=6,s=3,d=r.line(),g=v("g","tick").key(j),h=v("path","domain"),m=function(){return{offset:[0,f+s]}},y=function(){return{path:[[0,0],[0,f]]}},p=i.labelOffset||m,x=i.tickPath||y,b=function(t,n){var e=0;return t.bandwidth&&(e=t.bandwidth()/2,t.round()&&(e=Math.round(e))),function(r){return n(t(r)+e,0)}},w=function(t,n){return S()?"translate("+n+", "+t+")":"translate("+t+", "+n+")"},k=function(t){return S()?t.map(function(t){return[t[1],t[0]]}):t},S=function(){return"left"===t||"right"===t},_=function(t,n,r){return e[t]?e[t].apply(e,n):r},P=function(r){r.selection&&(g.transition(r),h.transition(r)),r.each(function(r,i,f){var s=f[i],m=n.select(s);s.__scale__||m.attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor","right"===t?"start":"left"===t?"end":"middle");var v=s.__scale__||e;s.__scale__=e.copy();var y=null==a?_("ticks",o,e.domain()):a,P=null==u?_("tickFormat",o,j):u,z="bottom"===t||"right"===t?1:-1,C=function(t){var n=A(t,2),e=n[0],r=n[1];return[e,z*r]},I=e.range(),L=k([[I[0],z*l],[I[0],0],[I[1],0],[I[1],z*l]]);h(m,[r]).attr("d",d(L)).attr("stroke","#000");var V=g(m,y),q=y.map(function(t,n){return p(t,n,y)}),E=y.map(function(t,n){return x(t,n,y)});V.enter().attr("transform",b(v,w)).append("path").attr("stroke","#000"),V.enter().append("text").attr("transform",function(t,n){return w.apply(void 0,O(C(q[n].offset)))}).attr("fill","#000"),V.exit().attr("transform",b(e,w)),V.select("path").attr("visibility",function(t,n){return E[n].hidden&&"hidden"}).attr("d",function(t,n){return d(k(E[n].path.map(C)))}),V.select("text").attr("visibility",function(t,n){return q[n].hidden&&"hidden"}).attr("transform",function(t,n){return w.apply(void 0,O(C(q[n].offset)))}).attr("dy",function(){var n="0em";return S()?n="0.32em":"bottom"===t&&(n="0.71em"),n}).text(P),V.attr("transform",b(e,w)),c(V,r,i)})};return P.tickFormat=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],P):u},P.tickSize=function(){return arguments.length?(f=l=Number(arguments.length<=0?void 0:arguments[0]),P):f},P.tickSizeInner=function(){return arguments.length?(f=Number(arguments.length<=0?void 0:arguments[0]),P):f},P.tickSizeOuter=function(){return arguments.length?(l=Number(arguments.length<=0?void 0:arguments[0]),P):l},P.tickPadding=function(){return arguments.length?(s=arguments.length<=0?void 0:arguments[0],P):s},P.decorate=function(){return arguments.length?(c=arguments.length<=0?void 0:arguments[0],P):c},P.scale=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],P):e},P.ticks=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];return o=[].concat(n),P},P.tickArguments=function(){return arguments.length?(o=null==(arguments.length<=0?void 0:arguments[0])?[]:[].concat(O(arguments.length<=0?void 0:arguments[0])),P):o.slice()},P.tickValues=function(){return arguments.length?(a=null==(arguments.length<=0?void 0:arguments[0])?[]:[].concat(O(arguments.length<=0?void 0:arguments[0])),P):a.slice()},P.orient=function(){return t},P},P=function(t,n){var e=!1,r=function(t,r,o){var a=0,c=i.tickSizeInner()+i.tickPadding(),u=!1;if(e){var l=n(t),f=r<o.length-1?n(o[r+1]):n.range()[1];a=(f-l)/2,c=i.tickPadding(),u=r===o.length-1&&l===f}return{offset:[a,c],hidden:u}},i=_(t,n,{labelOffset:r}),o=function(t){return i(t)};return o.tickCenterLabel=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],o):e},f(o,i),o},z=function(t){return P("top",t)},C=function(t){return P("bottom",t)},I=function(t){return P("left",t)},L=function(t){return P("right",t)},V=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];var r={},i=function(t){var n=!0,e=!1,i=void 0;try{for(var o,a=Object.keys(r)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var c=o.value;t[c](r[c])}}catch(t){e=!0,i=t}finally{try{!n&&a.return&&a.return()}finally{if(e)throw i}}return t},o=!0,a=!1,c=void 0;try{for(var u,l=n[Symbol.iterator]();!(o=(u=l.next()).done);o=!0){var f=u.value;!function(t){i[t]=function(){return arguments.length?(r[t]=arguments.length<=0?void 0:arguments[0],i):r[t]}}(f)}}catch(t){a=!0,c=t}finally{try{!o&&l.return&&l.return()}finally{if(a)throw c}}return i},q="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+=q:E.textContent+=q;var F=function(t){return"function"==typeof t?t:function(){return t}},N=function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];var i=X.apply(void 0,e),o=i.xScale,a=i.yScale,c=i.xAxis,u=i.yAxis,l=F(""),s=F(""),g=F(""),h=F(null),y=F(null),p=F("right"),x=F("bottom"),b=null,w=null,k=V("tickFormat","ticks","tickArguments","tickSize","tickSizeInner","tickSizeOuter","tickValues","tickPadding","tickCenterLabel"),S=function(){},A=V("tickFormat","ticks","tickArguments","tickSize","tickSizeInner","tickSizeOuter","tickValues","tickPadding","tickCenterLabel"),O=function(){},j=function(){},_=v("d3fc-group","cartesian-chart"),P=v("d3fc-canvas","plot-area"),z=v("d3fc-svg","plot-area"),C=v("d3fc-svg","x-axis").key(function(t){return t}),I=v("d3fc-svg","y-axis").key(function(t){return t}),L=v("div","chart-label"),q=v("div","x-label").key(function(t){return t}),E=v("div","y-label").key(function(t){return t}),N=function(t){return function(n){return t.selection?n.transition(t):n}},Y=function(t){var e=N(t);t.each(function(t,r,i){var f=_(n.select(i[r]),[t]);f.enter().attr("auto-resize",""),L(f,[x(t)]).attr("class",function(t){return"top"===t?"bottom-label":"top-label"}).style("margin-bottom",function(t){return"top"===t?0:"1em"}).style("margin-top",function(t){return"top"===t?"1em":0}).text(l(t)),q(f,[x(t)]).attr("class",function(t){return"x-label "+t+"-label"}).text(s(t)),E(f,[p(t)]).attr("class",function(t){return"y-label "+t+"-label"}).text(g(t)),P(f,b?[t]:[]).on("draw",function(t,e,r){var i=n.select(r[e]).select("canvas").node();b.context(i.getContext("2d")).xScale(o).yScale(a),b(t)}),z(f,w?[t]:[]).on("draw",function(t,r,i){w.xScale(o).yScale(a),e(n.select(i[r])).select("svg").call(w)}),C(f,[x(t)]).attr("class",function(t){return"x-axis "+t+"-axis"}).style("height",h(t)).on("measure",function(t,e,r){var i=n.event.detail,a=i.width,c=i.height;"top"===t&&n.select(r[e]).select("svg").attr("viewBox","0 "+-c+" "+a+" "+c),o.range([0,a])}).on("draw",function(t,r,i){var a="top"===t?c.top(o):c.bottom(o);a.decorate(S),e(n.select(i[r])).select("svg").call(k(a))}),I(f,[p(t)]).attr("class",function(t){return"y-axis "+t+"-axis"}).style("width",y(t)).on("measure",function(t,e,r){var i=n.event.detail,o=i.width,c=i.height;"left"===t&&n.select(r[e]).select("svg").attr("viewBox",-o+" 0 "+o+" "+c),a.range([c,0])}).on("draw",function(t,r,i){var o="left"===t?u.left(a):u.right(a);o.decorate(O),e(n.select(i[r])).select("svg").call(A(o))}),f.each(function(t,n,e){return e[n].requestRedraw()}),j(f,t,r)})},T=d(/range\w*/,/tickFormat/);return f(Y,o,T,m("x")),f(Y,a,T,m("y")),f(Y,k,m("x")),f(Y,A,m("y")),Y.xOrient=function(){return arguments.length?(x=F(arguments.length<=0?void 0:arguments[0]),Y):x},Y.yOrient=function(){return arguments.length?(p=F(arguments.length<=0?void 0:arguments[0]),Y):p},Y.xDecorate=function(){return arguments.length?(S=arguments.length<=0?void 0:arguments[0],Y):S},Y.yDecorate=function(){return arguments.length?(O=arguments.length<=0?void 0:arguments[0],Y):O},Y.chartLabel=function(){return arguments.length?(l=F(arguments.length<=0?void 0:arguments[0]),Y):l},Y.xLabel=function(){return arguments.length?(s=F(arguments.length<=0?void 0:arguments[0]),Y):s},Y.yLabel=function(){return arguments.length?(g=F(arguments.length<=0?void 0:arguments[0]),Y):g},Y.xAxisHeight=function(){return arguments.length?(h=F(arguments.length<=0?void 0:arguments[0]),Y):h},Y.yAxisWidth=function(){return arguments.length?(y=F(arguments.length<=0?void 0:arguments[0]),Y):y},Y.canvasPlotArea=function(){return arguments.length?(b=arguments.length<=0?void 0:arguments[0],Y):b},Y.svgPlotArea=function(){return arguments.length?(w=arguments.length<=0?void 0:arguments[0],Y):w},Y.decorate=function(){return arguments.length?(j=arguments.length<=0?void 0:arguments[0],Y):j},Y},X=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];var i={xScale:e.scaleIdentity(),yScale:e.scaleIdentity(),xAxis:{bottom:C,top:z},yAxis:{right:L,left:I}};return 1!==n.length||n[0].domain||n[0].range?Object.assign(i,{xScale:n[0]||i.xScale,yScale:n[1]||i.yScale}):Object.assign(i,n[0])},Y=function(t){return"function"==typeof t?t:function(){return t}},T=function(t,n){return function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];var o=Y(""),a=n,c=function(){},u=N.apply(void 0,r),l=function(n){t(u,a),u.decorate(function(t,n,e){t.enter().select(".x-label").style("height","1em").style("line-height","1em");var r=u.yOrient()(n);t.enter().append("div").attr("class","y-label-container").style("grid-column","left"===r?1:5).style("-ms-grid-column","left"===r?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)"),t.select(".y-label-container>.y-label").text(o),c(t,n,e)}),n.call(u)};return f(l,u,g(/^x/,/^y/,"chartLabel")),l.yLabel=function(){return arguments.length?(o=Y(arguments.length<=0?void 0:arguments[0]),l):o},l.plotArea=function(){return arguments.length?(a=arguments.length<=0?void 0:arguments[0],l):a},l.decorate=function(){return arguments.length?(c=arguments.length<=0?void 0:arguments[0],l):c},l}},B=T(function(t,n){return t.svgPlotArea(n)},k),D=T(function(t,n){return t.canvasPlotArea(n)},S);t.chartSvgCartesian=B,t.chartCanvasCartesian=D,t.chartCartesian=N,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(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"],n):n(t.fc=t.fc||{},t.d3,t.d3,t.d3,t.d3,t.d3)}(this,function(t,n,e,r,i,o){"use strict";function a(){var t=arguments;return function(n,e){for(var r=0,i=t.length;r<i;r++)if(null==t[r](n,e))return!1;return!0}}var c=function(t,n,e){var r=n[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(n,i);return a===n?t:a}},u=function(t,n){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 l,f=r[Symbol.iterator]();!(o=(l=f.next()).done);o=!0){var s=l.value;t[s]=c(t,n,s)}}catch(t){a=!0,u=t}finally{try{!o&&f.return&&f.return()}finally{if(a)throw u}}return t},l=function(t){return function(n){return t.reduce(function(t,n){return t&&n(t)},n)}},f=function(t,n){for(var e=arguments.length,r=Array(e>2?e-2:0),i=2;i<e;i++)r[i-2]=arguments[i];var o=l(r),a=!0,u=!1,f=void 0;try{for(var s,d=Object.keys(n)[Symbol.iterator]();!(a=(s=d.next()).done);a=!0){var g=s.value,h=o(g);h&&(t[h]=c(t,n,g))}}catch(t){u=!0,f=t}finally{try{!a&&d.return&&d.return()}finally{if(u)throw f}}return t},s=function(t){return t.map(function(t){return"string"==typeof t?new RegExp("^"+t+"$"):t})},d=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];return n=s(n),function(t){return n.every(function(n){return!n.test(t)})&&t}},g=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];return n=s(n),function(t){return n.some(function(n){return n.test(t)})&&t}},h=function(t){return t[0].toUpperCase()+t.slice(1)},m=function(t){return function(n){return t+h(n)}},v=function(t,n){t=t||"g";var e=function(t,n){return n},r=null,i=function(i,o){o=o||function(t){return t};var a=i.selection?i:null;a&&(i=i.selection());var c=i.selectAll(function(t,n,e){return Array.from(e[n].childNodes).filter(function(t){return 1===t.nodeType})}).filter(null==n?t:t+"."+n),u=c.data(o,e),l=u.enter().append(t).attr("class",n),f=u.exit();u=u.merge(l);var s=a||r;return s&&(u=u.transition(s).style("opacity",1),l.style("opacity",1e-6),f=f.transition(s).style("opacity",1e-6)),f.remove(),u.enter=function(){return l},u.exit=function(){return f},u};return i.element=function(){return arguments.length?(t=arguments.length<=0?void 0:arguments[0],i):t},i.className=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],i):n},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},y=function(t){return"function"==typeof t?t:function(){return t}},p=function(t,n){switch(t){case"left":return n/2;case"right":return-n/2;default:return 0}},x=function(t){var n=Object.assign({},t),e=function(){};return Object.keys(n).forEach(function(t){e[t]=function(){return arguments.length?(n[t]=arguments.length<=0?void 0:arguments[0],e):n[t]}}),e},b=function(){var t=function(){return 0},n=function(t){return t.x},r=function(t){return t.y},i="center",o=function(){return 5},c="vertical",u=x({decorate:function(){},defined:function(e,i){return a(t,n,r)(e,i)},xScale:e.scaleIdentity(),yScale:e.scaleIdentity()});return u.values=function(e,a){var l=o(e,a),f=p(i,l),s=u.xScale(),d=u.yScale();if("vertical"===c){var g=d(r(e,a),a),h=d(t(e,a),a),m=s(n(e,a),a)+f;return{d:e,x:m,y:g,y0:h,width:l,height:g-h,origin:[m,g],baseOrigin:[m,h],transposedX:m,transposedY:g}}var v=s(r(e,a),a),y=s(t(e,a),a),x=d(n(e,a),a)+f;return{d:e,x:x,y:v,y0:y,width:l,height:v-y,origin:[v,x],baseOrigin:[y,x],transposedX:v,transposedY:x}},u.baseValue=function(){return arguments.length?(t=y(arguments.length<=0?void 0:arguments[0]),u):t},u.crossValue=function(){return arguments.length?(n=y(arguments.length<=0?void 0:arguments[0]),u):n},u.mainValue=function(){return arguments.length?(r=y(arguments.length<=0?void 0:arguments[0]),u):r},u.bandwidth=function(){return arguments.length?(o=y(arguments.length<=0?void 0:arguments[0]),u):o},u.align=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],u):i},u.orient=function(){return arguments.length?(c=arguments.length<=0?void 0:arguments[0],u):c},u},w={red:"#c60",green:"#6c0",black:"#000",gray:"#ddd",darkGray:"#999"},k=function(){var t=b(),e=r.line().x(function(n,e){return t.values(n,e).transposedX}).y(function(n,e){return t.values(n,e).transposedY}),i=v("path","line"),o=function(r){r.selection&&i.transition(r),e.defined(t.defined()),r.each(function(r,o,a){var c=i(n.select(a[o]),[r]);c.enter().attr("fill","none").attr("stroke",w.black),c.attr("d",e),t.decorate()(c,r,o)})};return f(o,t,d("baseValue","bandwidth","align")),u(o,i,"key"),u(o,e,"curve"),o},S=function(){var t=b(),n=r.line().x(function(n,e){return t.values(n,e).transposedX}).y(function(n,e){return t.values(n,e).transposedY}),e=function(e){var r=n.context();r.beginPath(),n.defined(t.defined())(e),r.strokeStyle=w.black,r.fillStyle="transparent",t.decorate()(r,e),r.fill(),r.stroke(),r.closePath()};return f(e,t,d("baseValue","bandwidth","align")),u(e,n,"curve","context"),e},A=function(){function t(t,n){var e=[],r=!0,i=!1,o=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(e.push(a.value),!n||e.length!==n);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&c.return&&c.return()}finally{if(i)throw o}}return e}return function(n,e){if(Array.isArray(n))return n;if(Symbol.iterator in Object(n))return t(n,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),O=function(t){if(Array.isArray(t)){for(var n=0,e=Array(t.length);n<t.length;n++)e[n]=t[n];return e}return Array.from(t)},j=function(t){return t},_=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=[10],a=null,c=function(){},u=null,l=6,f=6,s=3,d=r.line(),g=v("g","tick").key(j),h=v("path","domain"),m=function(){return{offset:[0,f+s]}},y=function(){return{path:[[0,0],[0,f]]}},p=i.labelOffset||m,x=i.tickPath||y,b=function(t,n){var e=0;return t.bandwidth&&(e=t.bandwidth()/2,t.round()&&(e=Math.round(e))),function(r){return n(t(r)+e,0)}},w=function(t,n){return S()?"translate("+n+", "+t+")":"translate("+t+", "+n+")"},k=function(t){return S()?t.map(function(t){return[t[1],t[0]]}):t},S=function(){return"left"===t||"right"===t},_=function(t,n,r){return e[t]?e[t].apply(e,n):r},P=function(r){r.selection&&(g.transition(r),h.transition(r)),r.each(function(r,i,f){var s=f[i],m=n.select(s);s.__scale__||m.attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor","right"===t?"start":"left"===t?"end":"middle");var v=s.__scale__||e;s.__scale__=e.copy();var y=null==a?_("ticks",o,e.domain()):a,P=null==u?_("tickFormat",o,j):u,z="bottom"===t||"right"===t?1:-1,C=function(t){var n=A(t,2),e=n[0],r=n[1];return[e,z*r]},I=e.range(),L=k([[I[0],z*l],[I[0],0],[I[1],0],[I[1],z*l]]);h(m,[r]).attr("d",d(L)).attr("stroke","#000");var V=g(m,y),q=y.map(function(t,n){return p(t,n,y)}),E=y.map(function(t,n){return x(t,n,y)});V.enter().attr("transform",b(v,w)).append("path").attr("stroke","#000"),V.enter().append("text").attr("transform",function(t,n){return w.apply(void 0,O(C(q[n].offset)))}).attr("fill","#000"),V.exit().attr("transform",b(e,w)),V.select("path").attr("visibility",function(t,n){return E[n].hidden&&"hidden"}).attr("d",function(t,n){return d(k(E[n].path.map(C)))}),V.select("text").attr("visibility",function(t,n){return q[n].hidden&&"hidden"}).attr("transform",function(t,n){return w.apply(void 0,O(C(q[n].offset)))}).attr("dy",function(){var n="0em";return S()?n="0.32em":"bottom"===t&&(n="0.71em"),n}).text(P),V.attr("transform",b(e,w)),c(V,r,i)})};return P.tickFormat=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],P):u},P.tickSize=function(){return arguments.length?(f=l=Number(arguments.length<=0?void 0:arguments[0]),P):f},P.tickSizeInner=function(){return arguments.length?(f=Number(arguments.length<=0?void 0:arguments[0]),P):f},P.tickSizeOuter=function(){return arguments.length?(l=Number(arguments.length<=0?void 0:arguments[0]),P):l},P.tickPadding=function(){return arguments.length?(s=arguments.length<=0?void 0:arguments[0],P):s},P.decorate=function(){return arguments.length?(c=arguments.length<=0?void 0:arguments[0],P):c},P.scale=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],P):e},P.ticks=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];return o=[].concat(n),P},P.tickArguments=function(){return arguments.length?(o=null==(arguments.length<=0?void 0:arguments[0])?[]:[].concat(O(arguments.length<=0?void 0:arguments[0])),P):o.slice()},P.tickValues=function(){return arguments.length?(a=null==(arguments.length<=0?void 0:arguments[0])?[]:[].concat(O(arguments.length<=0?void 0:arguments[0])),P):a.slice()},P.orient=function(){return t},P},P=function(t,n){var e=!1,r=function(t,r,o){var a=0,c=i.tickSizeInner()+i.tickPadding(),u=!1;if(e){var l=n(t),f=r<o.length-1?n(o[r+1]):n.range()[1];a=(f-l)/2,c=i.tickPadding(),u=r===o.length-1&&l===f}return{offset:[a,c],hidden:u}},i=_(t,n,{labelOffset:r}),o=function(t){return i(t)};return o.tickCenterLabel=function(){return arguments.length?(e=arguments.length<=0?void 0:arguments[0],o):e},f(o,i),o},z=function(t){return P("top",t)},C=function(t){return P("bottom",t)},I=function(t){return P("left",t)},L=function(t){return P("right",t)},V=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];var r={},i=function(t){var n=!0,e=!1,i=void 0;try{for(var o,a=Object.keys(r)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var c=o.value;t[c].apply(null,r[c])}}catch(t){e=!0,i=t}finally{try{!n&&a.return&&a.return()}finally{if(e)throw i}}return t},o=!0,a=!1,c=void 0;try{for(var u,l=n[Symbol.iterator]();!(o=(u=l.next()).done);o=!0){var f=u.value;!function(t){i[t]=function(){for(var n=arguments.length,e=Array(n),o=0;o<n;o++)e[o]=arguments[o];return e.length?(r[t]=e,i):r[t]}}(f)}}catch(t){a=!0,c=t}finally{try{!o&&l.return&&l.return()}finally{if(a)throw c}}return i},q="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+=q:E.textContent+=q;var F=function(t){return"function"==typeof t?t:function(){return t}},N=function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];var i=X.apply(void 0,e),o=i.xScale,a=i.yScale,c=i.xAxis,u=i.yAxis,l=F(""),s=F(""),g=F(""),h=F(null),y=F(null),p=F("right"),x=F("bottom"),b=null,w=null,k=V("tickFormat","ticks","tickArguments","tickSize","tickSizeInner","tickSizeOuter","tickValues","tickPadding","tickCenterLabel"),S=function(){},A=V("tickFormat","ticks","tickArguments","tickSize","tickSizeInner","tickSizeOuter","tickValues","tickPadding","tickCenterLabel"),O=function(){},j=function(){},_=v("d3fc-group","cartesian-chart"),P=v("d3fc-canvas","plot-area"),z=v("d3fc-svg","plot-area"),C=v("d3fc-svg","x-axis").key(function(t){return t}),I=v("d3fc-svg","y-axis").key(function(t){return t}),L=v("div","chart-label"),q=v("div","x-label").key(function(t){return t}),E=v("div","y-label").key(function(t){return t}),N=function(t){return function(n){return t.selection?n.transition(t):n}},Y=function(t){var e=N(t);t.each(function(t,r,i){var f=_(n.select(i[r]),[t]);f.enter().attr("auto-resize",""),L(f,[x(t)]).attr("class",function(t){return"top"===t?"bottom-label":"top-label"}).style("margin-bottom",function(t){return"top"===t?0:"1em"}).style("margin-top",function(t){return"top"===t?"1em":0}).text(l(t)),q(f,[x(t)]).attr("class",function(t){return"x-label "+t+"-label"}).text(s(t)),E(f,[p(t)]).attr("class",function(t){return"y-label "+t+"-label"}).text(g(t)),P(f,b?[t]:[]).on("draw",function(t,e,r){var i=n.select(r[e]).select("canvas").node();b.context(i.getContext("2d")).xScale(o).yScale(a),b(t)}),z(f,w?[t]:[]).on("draw",function(t,r,i){w.xScale(o).yScale(a),e(n.select(i[r])).select("svg").call(w)}),C(f,[x(t)]).attr("class",function(t){return"x-axis "+t+"-axis"}).style("height",h(t)).on("measure",function(t,e,r){var i=n.event.detail,a=i.width,c=i.height;"top"===t&&n.select(r[e]).select("svg").attr("viewBox","0 "+-c+" "+a+" "+c),o.range([0,a])}).on("draw",function(t,r,i){var a="top"===t?c.top(o):c.bottom(o);a.decorate(S),e(n.select(i[r])).select("svg").call(k(a))}),I(f,[p(t)]).attr("class",function(t){return"y-axis "+t+"-axis"}).style("width",y(t)).on("measure",function(t,e,r){var i=n.event.detail,o=i.width,c=i.height;"left"===t&&n.select(r[e]).select("svg").attr("viewBox",-o+" 0 "+o+" "+c),a.range([c,0])}).on("draw",function(t,r,i){var o="left"===t?u.left(a):u.right(a);o.decorate(O),e(n.select(i[r])).select("svg").call(A(o))}),f.each(function(t,n,e){return e[n].requestRedraw()}),j(f,t,r)})},T=d(/range\w*/,/tickFormat/);return f(Y,o,T,m("x")),f(Y,a,T,m("y")),f(Y,k,m("x")),f(Y,A,m("y")),Y.xOrient=function(){return arguments.length?(x=F(arguments.length<=0?void 0:arguments[0]),Y):x},Y.yOrient=function(){return arguments.length?(p=F(arguments.length<=0?void 0:arguments[0]),Y):p},Y.xDecorate=function(){return arguments.length?(S=arguments.length<=0?void 0:arguments[0],Y):S},Y.yDecorate=function(){return arguments.length?(O=arguments.length<=0?void 0:arguments[0],Y):O},Y.chartLabel=function(){return arguments.length?(l=F(arguments.length<=0?void 0:arguments[0]),Y):l},Y.xLabel=function(){return arguments.length?(s=F(arguments.length<=0?void 0:arguments[0]),Y):s},Y.yLabel=function(){return arguments.length?(g=F(arguments.length<=0?void 0:arguments[0]),Y):g},Y.xAxisHeight=function(){return arguments.length?(h=F(arguments.length<=0?void 0:arguments[0]),Y):h},Y.yAxisWidth=function(){return arguments.length?(y=F(arguments.length<=0?void 0:arguments[0]),Y):y},Y.canvasPlotArea=function(){return arguments.length?(b=arguments.length<=0?void 0:arguments[0],Y):b},Y.svgPlotArea=function(){return arguments.length?(w=arguments.length<=0?void 0:arguments[0],Y):w},Y.decorate=function(){return arguments.length?(j=arguments.length<=0?void 0:arguments[0],Y):j},Y},X=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];var i={xScale:e.scaleIdentity(),yScale:e.scaleIdentity(),xAxis:{bottom:C,top:z},yAxis:{right:L,left:I}};return 1!==n.length||n[0].domain||n[0].range?Object.assign(i,{xScale:n[0]||i.xScale,yScale:n[1]||i.yScale}):Object.assign(i,n[0])},Y=function(t){return"function"==typeof t?t:function(){return t}},T=function(t,n){return function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];var o=Y(""),a=n,c=function(){},u=N.apply(void 0,r),l=function(n){t(u,a),u.decorate(function(t,n,e){t.enter().select(".x-label").style("height","1em").style("line-height","1em");var r=u.yOrient()(n);t.enter().append("div").attr("class","y-label-container").style("grid-column","left"===r?1:5).style("-ms-grid-column","left"===r?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)"),t.select(".y-label-container>.y-label").text(o),c(t,n,e)}),n.call(u)};return f(l,u,g(/^x/,/^y/,"chartLabel")),l.yLabel=function(){return arguments.length?(o=Y(arguments.length<=0?void 0:arguments[0]),l):o},l.plotArea=function(){return arguments.length?(a=arguments.length<=0?void 0:arguments[0],l):a},l.decorate=function(){return arguments.length?(c=arguments.length<=0?void 0:arguments[0],l):c},l}},B=T(function(t,n){return t.svgPlotArea(n)},k),D=T(function(t,n){return t.canvasPlotArea(n)},S);t.chartSvgCartesian=B,t.chartCanvasCartesian=D,t.chartCartesian=N,Object.defineProperty(t,"__esModule",{value:!0})});

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

<a name="2.6.2"></a>
## [2.6.2](https://github.com/d3fc/d3fc/compare/@d3fc/d3fc-chart@2.6.1...@d3fc/d3fc-chart@2.6.2) (2019-05-29)
### Bug Fixes
* property store correctly applies values from multiple argument functions ([#1281](https://github.com/d3fc/d3fc/issues/1281)) ([642c3ff](https://github.com/d3fc/d3fc/commit/642c3ff))
<a name="2.6.1"></a>

@@ -8,0 +19,0 @@ ## [2.6.1](https://github.com/d3fc/d3fc/compare/@d3fc/d3fc-chart@2.6.0...@d3fc/d3fc-chart@2.6.1) (2019-05-28)

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

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -6,3 +6,3 @@ export default (...names) => {

for (const key of Object.keys(data)) {
target[key](data[key]);
target[key].apply(null, data[key]);
}

@@ -17,3 +17,3 @@ return target;

}
data[name] = args[0];
data[name] = args;
return store;

@@ -20,0 +20,0 @@ };

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