Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@d3fc/d3fc-axis

Package Overview
Dependencies
Maintainers
3
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@d3fc/d3fc-axis - npm Package Compare versions

Comparing version 2.2.4 to 2.2.5

184

build/d3fc-axis.js

@@ -7,94 +7,2 @@ (function (global, factory) {

// a string (such as with attr).
// Very small values, when stringified, may be converted to scientific notation and
// cause a temporarily invalid attribute or style property value.
// For example, the number 0.0000001 is converted to the string "1e-7".
// This is particularly noticeable when interpolating opacity values.
// To avoid scientific notation, start or end the transition at 1e-6,
// which is the smallest value that is not stringified in exponential notation."
// - https://github.com/mbostock/d3/wiki/Transitions#d3_interpolateNumber
const effectivelyZero = 1e-6; // Wrapper around d3's selectAll/data data-join, which allows decoration of the result.
// This is achieved by appending the element to the enter selection before exposing it.
// A default transition of fade in/out is also implicitly added but can be modified.
var _dataJoin = ((element, className) => {
element = element || 'g';
let key = (_, i) => i;
let explicitTransition = null;
const dataJoin = function (container, data) {
data = data || (d => d);
const implicitTransition = container.selection ? container : null;
if (implicitTransition) {
container = container.selection();
}
const selected = container.selectAll((d, i, nodes) => Array.from(nodes[i].childNodes).filter(node => node.nodeType === 1)).filter(className == null ? element : `${element}.${className}`);
let update = selected.data(data, key);
const enter = update.enter().append(element).attr('class', className);
let exit = update.exit(); // automatically merge in the enter selection
update = update.merge(enter); // if transitions are enabled apply a default fade in/out transition
const transition = implicitTransition || explicitTransition;
if (transition) {
update = update.transition(transition).style('opacity', 1);
enter.style('opacity', effectivelyZero);
exit = exit.transition(transition).style('opacity', effectivelyZero);
}
exit.remove();
update.enter = () => enter;
update.exit = () => exit;
return update;
};
dataJoin.element = (...args) => {
if (!args.length) {
return element;
}
element = args[0];
return dataJoin;
};
dataJoin.className = (...args) => {
if (!args.length) {
return className;
}
className = args[0];
return dataJoin;
};
dataJoin.key = (...args) => {
if (!args.length) {
return key;
}
key = args[0];
return dataJoin;
};
dataJoin.transition = (...args) => {
if (!args.length) {
return explicitTransition;
}
explicitTransition = args[0];
return dataJoin;
};
return dataJoin;
});
var createReboundMethod = ((target, source, name) => {

@@ -194,2 +102,94 @@ const method = source[name];

// "Caution: avoid interpolating to or from the number zero when the interpolator is used to generate
// a string (such as with attr).
// Very small values, when stringified, may be converted to scientific notation and
// cause a temporarily invalid attribute or style property value.
// For example, the number 0.0000001 is converted to the string "1e-7".
// This is particularly noticeable when interpolating opacity values.
// To avoid scientific notation, start or end the transition at 1e-6,
// which is the smallest value that is not stringified in exponential notation."
// - https://github.com/mbostock/d3/wiki/Transitions#d3_interpolateNumber
const effectivelyZero = 1e-6; // Wrapper around d3's selectAll/data data-join, which allows decoration of the result.
// This is achieved by appending the element to the enter selection before exposing it.
// A default transition of fade in/out is also implicitly added but can be modified.
var _dataJoin = ((element, className) => {
element = element || 'g';
let key = (_, i) => i;
let explicitTransition = null;
const dataJoin = function (container, data) {
data = data || (d => d);
const implicitTransition = container.selection ? container : null;
if (implicitTransition) {
container = container.selection();
}
const selected = container.selectAll((d, i, nodes) => Array.from(nodes[i].childNodes).filter(node => node.nodeType === 1)).filter(className == null ? element : `${element}.${className}`);
let update = selected.data(data, key);
const enter = update.enter().append(element).attr('class', className);
let exit = update.exit(); // automatically merge in the enter selection
update = update.merge(enter); // if transitions are enabled apply a default fade in/out transition
const transition = implicitTransition || explicitTransition;
if (transition) {
update = update.transition(transition).style('opacity', 1);
enter.style('opacity', effectivelyZero);
exit = exit.transition(transition).style('opacity', effectivelyZero);
}
exit.remove();
update.enter = () => enter;
update.exit = () => exit;
return update;
};
dataJoin.element = (...args) => {
if (!args.length) {
return element;
}
element = args[0];
return dataJoin;
};
dataJoin.className = (...args) => {
if (!args.length) {
return className;
}
className = args[0];
return dataJoin;
};
dataJoin.key = (...args) => {
if (!args.length) {
return key;
}
key = args[0];
return dataJoin;
};
dataJoin.transition = (...args) => {
if (!args.length) {
return explicitTransition;
}
explicitTransition = args[0];
return dataJoin;
};
return dataJoin;
});
var identity = function identity(d) {

@@ -196,0 +196,0 @@ return d;

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

(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?b(exports,require("d3-selection"),require("d3-shape")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-shape"],b):(a=a||self,b(a.fc=a.fc||{},a.d3,a.d3))})(this,function(a,b,c){'use strict';var m=Math.floor;function d(a,b){return g(a)||j(a,b)||l()}function e(a){return f(a)||h(a)||k()}function f(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}}function g(a){if(Array.isArray(a))return a}function h(a){if(Symbol.iterator in Object(a)||"[object Arguments]"===Object.prototype.toString.call(a))return Array.from(a)}function j(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!(b&&c.length===b));d=!0);}catch(a){e=!0,f=a}finally{try{d||null==h["return"]||h["return"]()}finally{if(e)throw f}}return c}function k(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function l(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}const n=1e-6;var o=(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",n),k=k.transition(l).style("opacity",n)),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},p=(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}};const q=a=>b=>a.reduce((a,b)=>a&&b(a),b);var r=(a,b,...c)=>{const d=q(c);for(const e of Object.keys(b)){const c=d(e);c&&(a[c]=p(a,b,e))}return a},s=a=>a.map(a=>"string"==typeof a?new RegExp(`^${a}$`):a),t=(...a)=>(a=s(a),b=>a.every(a=>!a.test(b))&&b),u=function(a){return a},v=function(a,f){var g=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},h=[10],i=null,j=function(){},k=null,l=6,m=6,n=3,p=c.line(),q=o("g","tick").key(u),r=o("path","domain"),s=function(){return{offset:[0,m+n]}},t=function(){return{path:[[0,0],[0,m]]}},v=g.labelOffset||s,w=g.tickPath||t,x=function(a,b){var c=Math.round,e=0;return a.bandwidth&&(e=a.bandwidth()/2,a.round()&&(e=c(e))),function(c){return b(a(c)+e,0)}},y=function(a,b){return A()?"translate(".concat(b,", ").concat(a,")"):"translate(".concat(a,", ").concat(b,")")},z=function(a){return A()?a.map(function(a){return[a[1],a[0]]}):a},A=function(){return"left"===a||"right"===a},B=function(a,b,c){return f[a]?f[a].apply(f,b):c},C=function(c){c.selection&&(q.transition(c),r.transition(c)),c.each(function(c,m,n){var o=n[m],s=b.select(o);o.__scale__||s.attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor","right"===a?"start":"left"===a?"end":"middle");var t=o.__scale__||f;o.__scale__=f.copy();var C=null==i?B("ticks",h,f.domain()):i,D=null==k?B("tickFormat",h,u):k,E="bottom"===a||"right"===a?1:-1,F=function(a){var b=d(a,2),c=b[0],e=b[1];return[c,E*e]},G=f.range(),H=z([[G[0],E*l],[G[0],0],[G[1],0],[G[1],E*l]]),I=r(s,[c]);I.attr("d",p(H)).attr("stroke","#000");var J=q(s,C),g=C.map(function(a,b){return v(a,b,C)}),K=C.map(function(a,b){return w(a,b,C)});J.enter().attr("transform",x(t,y)).append("path").attr("stroke","#000"),J.enter().append("text").attr("transform",function(a,b){return y.apply(void 0,e(F(g[b].offset)))}).attr("fill","#000"),J.exit().attr("transform",x(f,y)),J.select("path").attr("visibility",function(a,b){return K[b].hidden&&"hidden"}).attr("d",function(a,b){return p(z(K[b].path.map(F)))}),J.select("text").attr("visibility",function(a,b){return g[b].hidden&&"hidden"}).attr("transform",function(a,b){return y.apply(void 0,e(F(g[b].offset)))}).attr("dy",function(){var b="0em";return A()?b="0.32em":"bottom"===a&&(b="0.71em"),b}).text(D),J.attr("transform",x(f,y)),j(J,c,m)})};return C.tickFormat=function(){return arguments.length?(k=0>=arguments.length?void 0:arguments[0],C):k},C.tickSize=function(){return arguments.length?(m=l=+(0>=arguments.length?void 0:arguments[0]),C):m},C.tickSizeInner=function(){return arguments.length?(m=+(0>=arguments.length?void 0:arguments[0]),C):m},C.tickSizeOuter=function(){return arguments.length?(l=+(0>=arguments.length?void 0:arguments[0]),C):l},C.tickPadding=function(){return arguments.length?(n=0>=arguments.length?void 0:arguments[0],C):n},C.decorate=function(){return arguments.length?(j=0>=arguments.length?void 0:arguments[0],C):j},C.scale=function(){return arguments.length?(f=0>=arguments.length?void 0:arguments[0],C):f},C.ticks=function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];return h=[].concat(b),C},C.tickArguments=function(){return arguments.length?(h=null==(0>=arguments.length?void 0:arguments[0])?[]:e(0>=arguments.length?void 0:arguments[0]),C):h.slice()},C.tickValues=function(){return arguments.length?(i=null==(0>=arguments.length?void 0:arguments[0])?[]:e(0>=arguments.length?void 0:arguments[0]),C):i.slice()},C.orient=function(){return a},C},w=function a(b,c){var d=!1,e=function(a,b,e){var g=0,h=f.tickSizeInner()+f.tickPadding(),i=!1;if(d){var j=c(a),k=b<e.length-1?c(e[b+1]):c.range()[1];g=(k-j)/2,h=f.tickPadding(),i=b===e.length-1&&j===k}return{offset:[g,h],hidden:i}},f=v(b,c,{labelOffset:e}),a=function(a){return f(a)};return a.tickCenterLabel=function(){return arguments.length?(d=0>=arguments.length?void 0:arguments[0],a):d},r(a,f),a},x=function(a,b){var c=null,d=function(a,c,d){if(b.step)return b.step();var e=b(a);return c<d.length-1?b(d[c+1])/e:2*(b.range()[1]-e)},e=function(a,b,e){var g=0;return g=c?c(a,b):d(a,b,e)/2,{path:[[g,0],[g,f.tickSizeInner()]],hidden:b===e.length-1}},f=v(a,b,{labelOffset:function(){return{offset:[0,f.tickPadding()]}},tickPath:e}),g=function(a){f(a)};return g.tickOffset=function(){return arguments.length?(c=0>=arguments.length?void 0:arguments[0],g):c},r(g,f),g},y=function(a){return function(b){var c=Math.max,d=a.ticks?a.ticks():a.domain(),f=b.append("text"),g=d.map(function(a){return f.text(a).node().getBBox()}),h=c.apply(Math,e(g.map(function(a){return a.height}))),i=c.apply(Math,e(g.map(function(a){return a.width})));return f.remove(),{maxHeight:h,maxWidth:i,labelCount:d.length}}};a.axisBottom=function(a){return w("bottom",a)},a.axisLabelOffset=function(a){var b="auto",c=function(){},d=function(){return"left"===a.orient()||"right"===a.orient()},e=function(){return"top"===a.orient()||"left"===a.orient()?-1:1},f=function(c){var f=y(a.scale())(c),g=f.maxHeight,h=f.maxWidth,i=f.labelCount,j=a.scale().range()[1],k="auto"===b?m((d()?g:h)*i/j)+1:b,l=c.select("text"),n=l.attr("transform"),o=function(a){return d()?"translate(".concat(a%k*h*e(),", 0)"):"translate(0, ".concat(a%k*g*e(),")")};l.attr("transform",function(a,b){return"".concat(n," ").concat(o(b))})},g=function(b){return a(b)};return a.decorate(function(a){f(a),c(a)}),g.decorate=function(){return arguments.length?(c=0>=arguments.length?void 0:arguments[0],g):c},g.labelOffsetDepth=function(){return arguments.length?(b=0>=arguments.length?void 0:arguments[0],g):b},r(g,a,t("decorate")),g},a.axisLabelRotate=function(a){var b="auto",c=function(){},d=function(){return"left"===a.orient()||"right"===a.orient()},e=function(){return"top"===a.orient()||"left"===a.orient()?-1:1},f=function(){switch(a.orient()){case"top":case"right":return"start";default:return"end";}},g=function(c){var h,g=Math.min,i=y(a.scale())(c),j=i.maxHeight,k=i.maxWidth,l=i.labelCount,n=l*k;if("auto"===b){var o=a.scale().range()[1];h=o<n?90*g(1,(n/o-.8)/2):0}else h=b;return{rotate:d()?m(e()*(90-h)):m(-h),maxHeight:j,maxWidth:k,anchor:h?f():"middle"}},h=function(a){var b=g(a),c=b.rotate,f=b.maxHeight,h=b.anchor,i=a.select("text"),j=i.attr("transform"),k=e()*m(f/2),l=d()?"translate(".concat(k,", 0)"):"translate(0, ".concat(k,")");i.style("text-anchor",h).attr("transform","".concat(j," ").concat(l," rotate(").concat(c," 0 0)"))},i=function(b){a(b)};return a.decorate(function(a){h(a),c(a)}),i.decorate=function(){return arguments.length?(c=0>=arguments.length?void 0:arguments[0],i):c},i.labelRotate=function(){return arguments.length?(b=0>=arguments.length?void 0:arguments[0],i):b},r(i,a,t("decorate")),i},a.axisLeft=function(a){return w("left",a)},a.axisOrdinalBottom=function(a){return x("bottom",a)},a.axisOrdinalLeft=function(a){return x("left",a)},a.axisOrdinalRight=function(a){return x("right",a)},a.axisOrdinalTop=function(a){return x("top",a)},a.axisRight=function(a){return w("right",a)},a.axisTop=function(a){return w("top",a)},Object.defineProperty(a,"__esModule",{value:!0})});
(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?b(exports,require("d3-selection"),require("d3-shape")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-shape"],b):(a=a||self,b(a.fc=a.fc||{},a.d3,a.d3))})(this,function(a,b,c){'use strict';var m=Math.floor;function d(a,b){return g(a)||j(a,b)||l()}function e(a){return f(a)||h(a)||k()}function f(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}}function g(a){if(Array.isArray(a))return a}function h(a){if(Symbol.iterator in Object(a)||"[object Arguments]"===Object.prototype.toString.call(a))return Array.from(a)}function j(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!(b&&c.length===b));d=!0);}catch(a){e=!0,f=a}finally{try{d||null==h["return"]||h["return"]()}finally{if(e)throw f}}return c}function k(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function l(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var n=(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}};const o=a=>b=>a.reduce((a,b)=>a&&b(a),b);var p=(a,b,...c)=>{const d=o(c);for(const e of Object.keys(b)){const c=d(e);c&&(a[c]=n(a,b,e))}return a},q=a=>a.map(a=>"string"==typeof a?new RegExp(`^${a}$`):a),r=(...a)=>(a=q(a),b=>a.every(a=>!a.test(b))&&b);const s=1e-6;var t=(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",s),k=k.transition(l).style("opacity",s)),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},u=function(a){return a},v=function(a,f){var g=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},h=[10],i=null,j=function(){},k=null,l=6,m=6,n=3,o=c.line(),p=t("g","tick").key(u),q=t("path","domain"),r=function(){return{offset:[0,m+n]}},s=function(){return{path:[[0,0],[0,m]]}},v=g.labelOffset||r,w=g.tickPath||s,x=function(a,b){var c=Math.round,e=0;return a.bandwidth&&(e=a.bandwidth()/2,a.round()&&(e=c(e))),function(c){return b(a(c)+e,0)}},y=function(a,b){return A()?"translate(".concat(b,", ").concat(a,")"):"translate(".concat(a,", ").concat(b,")")},z=function(a){return A()?a.map(function(a){return[a[1],a[0]]}):a},A=function(){return"left"===a||"right"===a},B=function(a,b,c){return f[a]?f[a].apply(f,b):c},C=function(c){c.selection&&(p.transition(c),q.transition(c)),c.each(function(c,m,n){var r=n[m],s=b.select(r);r.__scale__||s.attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor","right"===a?"start":"left"===a?"end":"middle");var t=r.__scale__||f;r.__scale__=f.copy();var C=null==i?B("ticks",h,f.domain()):i,D=null==k?B("tickFormat",h,u):k,E="bottom"===a||"right"===a?1:-1,F=function(a){var b=d(a,2),c=b[0],e=b[1];return[c,E*e]},G=f.range(),H=z([[G[0],E*l],[G[0],0],[G[1],0],[G[1],E*l]]),I=q(s,[c]);I.attr("d",o(H)).attr("stroke","#000");var J=p(s,C),g=C.map(function(a,b){return v(a,b,C)}),K=C.map(function(a,b){return w(a,b,C)});J.enter().attr("transform",x(t,y)).append("path").attr("stroke","#000"),J.enter().append("text").attr("transform",function(a,b){return y.apply(void 0,e(F(g[b].offset)))}).attr("fill","#000"),J.exit().attr("transform",x(f,y)),J.select("path").attr("visibility",function(a,b){return K[b].hidden&&"hidden"}).attr("d",function(a,b){return o(z(K[b].path.map(F)))}),J.select("text").attr("visibility",function(a,b){return g[b].hidden&&"hidden"}).attr("transform",function(a,b){return y.apply(void 0,e(F(g[b].offset)))}).attr("dy",function(){var b="0em";return A()?b="0.32em":"bottom"===a&&(b="0.71em"),b}).text(D),J.attr("transform",x(f,y)),j(J,c,m)})};return C.tickFormat=function(){return arguments.length?(k=0>=arguments.length?void 0:arguments[0],C):k},C.tickSize=function(){return arguments.length?(m=l=+(0>=arguments.length?void 0:arguments[0]),C):m},C.tickSizeInner=function(){return arguments.length?(m=+(0>=arguments.length?void 0:arguments[0]),C):m},C.tickSizeOuter=function(){return arguments.length?(l=+(0>=arguments.length?void 0:arguments[0]),C):l},C.tickPadding=function(){return arguments.length?(n=0>=arguments.length?void 0:arguments[0],C):n},C.decorate=function(){return arguments.length?(j=0>=arguments.length?void 0:arguments[0],C):j},C.scale=function(){return arguments.length?(f=0>=arguments.length?void 0:arguments[0],C):f},C.ticks=function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];return h=[].concat(b),C},C.tickArguments=function(){return arguments.length?(h=null==(0>=arguments.length?void 0:arguments[0])?[]:e(0>=arguments.length?void 0:arguments[0]),C):h.slice()},C.tickValues=function(){return arguments.length?(i=null==(0>=arguments.length?void 0:arguments[0])?[]:e(0>=arguments.length?void 0:arguments[0]),C):i.slice()},C.orient=function(){return a},C},w=function a(b,c){var d=!1,e=function(a,b,e){var g=0,h=f.tickSizeInner()+f.tickPadding(),i=!1;if(d){var j=c(a),k=b<e.length-1?c(e[b+1]):c.range()[1];g=(k-j)/2,h=f.tickPadding(),i=b===e.length-1&&j===k}return{offset:[g,h],hidden:i}},f=v(b,c,{labelOffset:e}),a=function(a){return f(a)};return a.tickCenterLabel=function(){return arguments.length?(d=0>=arguments.length?void 0:arguments[0],a):d},p(a,f),a},x=function(a,b){var c=null,d=function(a,c,d){if(b.step)return b.step();var e=b(a);return c<d.length-1?b(d[c+1])/e:2*(b.range()[1]-e)},e=function(a,b,e){var g=0;return g=c?c(a,b):d(a,b,e)/2,{path:[[g,0],[g,f.tickSizeInner()]],hidden:b===e.length-1}},f=v(a,b,{labelOffset:function(){return{offset:[0,f.tickPadding()]}},tickPath:e}),g=function(a){f(a)};return g.tickOffset=function(){return arguments.length?(c=0>=arguments.length?void 0:arguments[0],g):c},p(g,f),g},y=function(a){return function(b){var c=Math.max,d=a.ticks?a.ticks():a.domain(),f=b.append("text"),g=d.map(function(a){return f.text(a).node().getBBox()}),h=c.apply(Math,e(g.map(function(a){return a.height}))),i=c.apply(Math,e(g.map(function(a){return a.width})));return f.remove(),{maxHeight:h,maxWidth:i,labelCount:d.length}}};a.axisBottom=function(a){return w("bottom",a)},a.axisLabelOffset=function(a){var b="auto",c=function(){},d=function(){return"left"===a.orient()||"right"===a.orient()},e=function(){return"top"===a.orient()||"left"===a.orient()?-1:1},f=function(c){var f=y(a.scale())(c),g=f.maxHeight,h=f.maxWidth,i=f.labelCount,j=a.scale().range()[1],k="auto"===b?m((d()?g:h)*i/j)+1:b,l=c.select("text"),n=l.attr("transform"),o=function(a){return d()?"translate(".concat(a%k*h*e(),", 0)"):"translate(0, ".concat(a%k*g*e(),")")};l.attr("transform",function(a,b){return"".concat(n," ").concat(o(b))})},g=function(b){return a(b)};return a.decorate(function(a){f(a),c(a)}),g.decorate=function(){return arguments.length?(c=0>=arguments.length?void 0:arguments[0],g):c},g.labelOffsetDepth=function(){return arguments.length?(b=0>=arguments.length?void 0:arguments[0],g):b},p(g,a,r("decorate")),g},a.axisLabelRotate=function(a){var b="auto",c=function(){},d=function(){return"left"===a.orient()||"right"===a.orient()},e=function(){return"top"===a.orient()||"left"===a.orient()?-1:1},f=function(){switch(a.orient()){case"top":case"right":return"start";default:return"end";}},g=function(c){var h,g=Math.min,i=y(a.scale())(c),j=i.maxHeight,k=i.maxWidth,l=i.labelCount,n=l*k;if("auto"===b){var o=a.scale().range()[1];h=o<n?90*g(1,(n/o-.8)/2):0}else h=b;return{rotate:d()?m(e()*(90-h)):m(-h),maxHeight:j,maxWidth:k,anchor:h?f():"middle"}},h=function(a){var b=g(a),c=b.rotate,f=b.maxHeight,h=b.anchor,i=a.select("text"),j=i.attr("transform"),k=e()*m(f/2),l=d()?"translate(".concat(k,", 0)"):"translate(0, ".concat(k,")");i.style("text-anchor",h).attr("transform","".concat(j," ").concat(l," rotate(").concat(c," 0 0)"))},i=function(b){a(b)};return a.decorate(function(a){h(a),c(a)}),i.decorate=function(){return arguments.length?(c=0>=arguments.length?void 0:arguments[0],i):c},i.labelRotate=function(){return arguments.length?(b=0>=arguments.length?void 0:arguments[0],i):b},p(i,a,r("decorate")),i},a.axisLeft=function(a){return w("left",a)},a.axisOrdinalBottom=function(a){return x("bottom",a)},a.axisOrdinalLeft=function(a){return x("left",a)},a.axisOrdinalRight=function(a){return x("right",a)},a.axisOrdinalTop=function(a){return x("top",a)},a.axisRight=function(a){return w("right",a)},a.axisTop=function(a){return w("top",a)},Object.defineProperty(a,"__esModule",{value:!0})});

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

## [2.2.5](https://github.com/d3fc/d3fc/compare/@d3fc/d3fc-axis@2.2.4...@d3fc/d3fc-axis@2.2.5) (2019-11-28)
**Note:** Version bump only for package @d3fc/d3fc-axis
## [2.2.4](https://github.com/d3fc/d3fc/compare/@d3fc/d3fc-axis@2.2.3...@d3fc/d3fc-axis@2.2.4) (2019-09-04)

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

{
"name": "@d3fc/d3fc-axis",
"version": "2.2.4",
"version": "2.2.5",
"description": "A drop-in replacement for d3 axis, with support for the d3fc decorate pattern",

@@ -22,3 +22,2 @@ "license": "MIT",

"start": "npm start --prefix ../d3fc -- --configPkg=d3fc-axis",
"lint": "npx eslint src/**/*.js",
"screenshots": "node ../../scripts/screenshot.js"

@@ -30,4 +29,4 @@ },

"dependencies": {
"@d3fc/d3fc-data-join": "^5.0.10",
"@d3fc/d3fc-rebind": "^5.0.9",
"@d3fc/d3fc-data-join": "^5.0.11",
"@d3fc/d3fc-rebind": "^5.0.10",
"d3-scale": "^1.0.3",

@@ -40,3 +39,3 @@ "d3-selection": "^1.0.2",

},
"gitHead": "d216bebca76b9bde7456f1c06e768bc67814dd2e"
"gitHead": "de82a1a109ddce4b5721fc4e0d2039ddd497817d"
}

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

import { dataJoin as _dataJoin } from '@d3fc/d3fc-data-join';
import { rebindAll } from '@d3fc/d3fc-rebind';

@@ -3,0 +2,0 @@ import { axisBase } from './axisBase';

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

import { dataJoin as _dataJoin } from '@d3fc/d3fc-data-join';
import { rebindAll } from '@d3fc/d3fc-rebind';

@@ -3,0 +2,0 @@ import { axisBase } from './axisBase';

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