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

d3-axis

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-axis - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

297

build/d3-axis.js

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

// https://d3js.org/d3-axis/ Version 1.0.3. Copyright 2016 Mike Bostock.
// https://d3js.org/d3-axis/ Version 1.0.4. Copyright 2016 Mike Bostock.
(function (global, factory) {

@@ -6,187 +6,188 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :

(factory((global.d3 = global.d3 || {})));
}(this, function (exports) { 'use strict';
}(this, (function (exports) { 'use strict';
var slice = Array.prototype.slice;
var slice = Array.prototype.slice;
function identity(x) {
return x;
}
var identity = function(x) {
return x;
};
var top = 1;
var right = 2;
var bottom = 3;
var left = 4;
var epsilon = 1e-6;
function translateX(scale0, scale1, d) {
var x = scale0(d);
return "translate(" + (isFinite(x) ? x : scale1(d)) + ",0)";
}
var top = 1;
var right = 2;
var bottom = 3;
var left = 4;
var epsilon = 1e-6;
function translateY(scale0, scale1, d) {
var y = scale0(d);
return "translate(0," + (isFinite(y) ? y : scale1(d)) + ")";
}
function translateX(scale0, scale1, d) {
var x = scale0(d);
return "translate(" + (isFinite(x) ? x : scale1(d)) + ",0)";
}
function center(scale) {
var offset = scale.bandwidth() / 2;
if (scale.round()) offset = Math.round(offset);
return function(d) {
return scale(d) + offset;
};
}
function translateY(scale0, scale1, d) {
var y = scale0(d);
return "translate(0," + (isFinite(y) ? y : scale1(d)) + ")";
}
function entering() {
return !this.__axis;
}
function center(scale) {
var offset = scale.bandwidth() / 2;
if (scale.round()) offset = Math.round(offset);
return function(d) {
return scale(d) + offset;
};
}
function axis(orient, scale) {
var tickArguments = [],
tickValues = null,
tickFormat = null,
tickSizeInner = 6,
tickSizeOuter = 6,
tickPadding = 3;
function entering() {
return !this.__axis;
}
function axis(context) {
var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,
format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity) : tickFormat,
spacing = Math.max(tickSizeInner, 0) + tickPadding,
transform = orient === top || orient === bottom ? translateX : translateY,
range = scale.range(),
range0 = range[0] + 0.5,
range1 = range[range.length - 1] + 0.5,
position = (scale.bandwidth ? center : identity)(scale.copy()),
selection = context.selection ? context.selection() : context,
path = selection.selectAll(".domain").data([null]),
tick = selection.selectAll(".tick").data(values, scale).order(),
tickExit = tick.exit(),
tickEnter = tick.enter().append("g").attr("class", "tick"),
line = tick.select("line"),
text = tick.select("text"),
k = orient === top || orient === left ? -1 : 1,
x, y = orient === left || orient === right ? (x = "x", "y") : (x = "y", "x");
function axis(orient, scale) {
var tickArguments = [],
tickValues = null,
tickFormat = null,
tickSizeInner = 6,
tickSizeOuter = 6,
tickPadding = 3;
path = path.merge(path.enter().insert("path", ".tick")
.attr("class", "domain")
.attr("stroke", "#000"));
function axis(context) {
var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,
format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity) : tickFormat,
spacing = Math.max(tickSizeInner, 0) + tickPadding,
transform = orient === top || orient === bottom ? translateX : translateY,
range = scale.range(),
range0 = range[0] + 0.5,
range1 = range[range.length - 1] + 0.5,
position = (scale.bandwidth ? center : identity)(scale.copy()),
selection = context.selection ? context.selection() : context,
path = selection.selectAll(".domain").data([null]),
tick = selection.selectAll(".tick").data(values, scale).order(),
tickExit = tick.exit(),
tickEnter = tick.enter().append("g").attr("class", "tick"),
line = tick.select("line"),
text = tick.select("text"),
k = orient === top || orient === left ? -1 : 1,
x, y = orient === left || orient === right ? (x = "x", "y") : (x = "y", "x");
tick = tick.merge(tickEnter);
path = path.merge(path.enter().insert("path", ".tick")
.attr("class", "domain")
.attr("stroke", "#000"));
line = line.merge(tickEnter.append("line")
.attr("stroke", "#000")
.attr(x + "2", k * tickSizeInner)
.attr(y + "1", 0.5)
.attr(y + "2", 0.5));
tick = tick.merge(tickEnter);
text = text.merge(tickEnter.append("text")
.attr("fill", "#000")
.attr(x, k * spacing)
.attr(y, 0.5)
.attr("dy", orient === top ? "0em" : orient === bottom ? "0.71em" : "0.32em"));
line = line.merge(tickEnter.append("line")
.attr("stroke", "#000")
.attr(x + "2", k * tickSizeInner)
.attr(y + "1", 0.5)
.attr(y + "2", 0.5));
if (context !== selection) {
path = path.transition(context);
tick = tick.transition(context);
line = line.transition(context);
text = text.transition(context);
text = text.merge(tickEnter.append("text")
.attr("fill", "#000")
.attr(x, k * spacing)
.attr(y, 0.5)
.attr("dy", orient === top ? "0em" : orient === bottom ? "0.71em" : "0.32em"));
tickExit = tickExit.transition(context)
.attr("opacity", epsilon)
.attr("transform", function(d) { return transform(position, this.parentNode.__axis || position, d); });
if (context !== selection) {
path = path.transition(context);
tick = tick.transition(context);
line = line.transition(context);
text = text.transition(context);
tickEnter
.attr("opacity", epsilon)
.attr("transform", function(d) { return transform(this.parentNode.__axis || position, position, d); });
}
tickExit = tickExit.transition(context)
.attr("opacity", epsilon)
.attr("transform", function(d) { return transform(position, this.parentNode.__axis || position, d); });
tickExit.remove();
tickEnter
.attr("opacity", epsilon)
.attr("transform", function(d) { return transform(this.parentNode.__axis || position, position, d); });
}
path
.attr("d", orient === left || orient == right
? "M" + k * tickSizeOuter + "," + range0 + "H0.5V" + range1 + "H" + k * tickSizeOuter
: "M" + range0 + "," + k * tickSizeOuter + "V0.5H" + range1 + "V" + k * tickSizeOuter);
tickExit.remove();
tick
.attr("opacity", 1)
.attr("transform", function(d) { return transform(position, position, d); });
path
.attr("d", orient === left || orient == right
? "M" + k * tickSizeOuter + "," + range0 + "H0.5V" + range1 + "H" + k * tickSizeOuter
: "M" + range0 + "," + k * tickSizeOuter + "V0.5H" + range1 + "V" + k * tickSizeOuter);
line
.attr(x + "2", k * tickSizeInner);
tick
.attr("opacity", 1)
.attr("transform", function(d) { return transform(position, position, d); });
text
.attr(x, k * spacing)
.text(format);
line
.attr(x + "2", k * tickSizeInner);
selection.filter(entering)
.attr("fill", "none")
.attr("font-size", 10)
.attr("font-family", "sans-serif")
.attr("text-anchor", orient === right ? "start" : orient === left ? "end" : "middle");
text
.attr(x, k * spacing)
.text(format);
selection
.each(function() { this.__axis = position; });
}
selection.filter(entering)
.attr("fill", "none")
.attr("font-size", 10)
.attr("font-family", "sans-serif")
.attr("text-anchor", orient === right ? "start" : orient === left ? "end" : "middle");
axis.scale = function(_) {
return arguments.length ? (scale = _, axis) : scale;
};
selection
.each(function() { this.__axis = position; });
}
axis.ticks = function() {
return tickArguments = slice.call(arguments), axis;
};
axis.scale = function(_) {
return arguments.length ? (scale = _, axis) : scale;
};
axis.tickArguments = function(_) {
return arguments.length ? (tickArguments = _ == null ? [] : slice.call(_), axis) : tickArguments.slice();
};
axis.ticks = function() {
return tickArguments = slice.call(arguments), axis;
};
axis.tickValues = function(_) {
return arguments.length ? (tickValues = _ == null ? null : slice.call(_), axis) : tickValues && tickValues.slice();
};
axis.tickArguments = function(_) {
return arguments.length ? (tickArguments = _ == null ? [] : slice.call(_), axis) : tickArguments.slice();
};
axis.tickFormat = function(_) {
return arguments.length ? (tickFormat = _, axis) : tickFormat;
};
axis.tickValues = function(_) {
return arguments.length ? (tickValues = _ == null ? null : slice.call(_), axis) : tickValues && tickValues.slice();
};
axis.tickSize = function(_) {
return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;
};
axis.tickFormat = function(_) {
return arguments.length ? (tickFormat = _, axis) : tickFormat;
};
axis.tickSizeInner = function(_) {
return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;
};
axis.tickSize = function(_) {
return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;
};
axis.tickSizeOuter = function(_) {
return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;
};
axis.tickSizeInner = function(_) {
return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;
};
axis.tickPadding = function(_) {
return arguments.length ? (tickPadding = +_, axis) : tickPadding;
};
axis.tickSizeOuter = function(_) {
return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;
};
return axis;
}
axis.tickPadding = function(_) {
return arguments.length ? (tickPadding = +_, axis) : tickPadding;
};
function axisTop(scale) {
return axis(top, scale);
}
return axis;
}
function axisRight(scale) {
return axis(right, scale);
}
function axisTop(scale) {
return axis(top, scale);
}
function axisBottom(scale) {
return axis(bottom, scale);
}
function axisRight(scale) {
return axis(right, scale);
}
function axisLeft(scale) {
return axis(left, scale);
}
function axisBottom(scale) {
return axis(bottom, scale);
}
exports.axisTop = axisTop;
exports.axisRight = axisRight;
exports.axisBottom = axisBottom;
exports.axisLeft = axisLeft;
function axisLeft(scale) {
return axis(left, scale);
}
Object.defineProperty(exports, '__esModule', { value: true });
exports.axisTop = axisTop;
exports.axisRight = axisRight;
exports.axisBottom = axisBottom;
exports.axisLeft = axisLeft;
}));
Object.defineProperty(exports, '__esModule', { value: true });
})));

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

// https://d3js.org/d3-axis/ Version 1.0.3. Copyright 2016 Mike Bostock.
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.d3=t.d3||{})}(this,function(t){"use strict";function n(t){return t}function e(t,n,e){var r=t(e);return"translate("+(isFinite(r)?r:n(e))+",0)"}function r(t,n,e){var r=t(e);return"translate(0,"+(isFinite(r)?r:n(e))+")"}function i(t){var n=t.bandwidth()/2;return t.round()&&(n=Math.round(n)),function(e){return t(e)+n}}function a(){return!this.__axis}function o(t,o){function u(u){var f,_=null==l?o.ticks?o.ticks.apply(o,c):o.domain():l,v=null==s?o.tickFormat?o.tickFormat.apply(o,c):n:s,F=Math.max(g,0)+y,M=t===d||t===m?e:r,b=o.range(),z=b[0]+.5,A=b[b.length-1]+.5,V=(o.bandwidth?i:n)(o.copy()),H=u.selection?u.selection():u,S=H.selectAll(".domain").data([null]),j=H.selectAll(".tick").data(_,o).order(),w=j.exit(),N=j.enter().append("g").attr("class","tick"),O=j.select("line"),P=j.select("text"),B=t===d||t===h?-1:1,I=t===h||t===p?(f="x","y"):(f="y","x");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","#000")),j=j.merge(N),O=O.merge(N.append("line").attr("stroke","#000").attr(f+"2",B*g).attr(I+"1",.5).attr(I+"2",.5)),P=P.merge(N.append("text").attr("fill","#000").attr(f,B*F).attr(I,.5).attr("dy",t===d?"0em":t===m?"0.71em":"0.32em")),u!==H&&(S=S.transition(u),j=j.transition(u),O=O.transition(u),P=P.transition(u),w=w.transition(u).attr("opacity",x).attr("transform",function(t){return M(V,this.parentNode.__axis||V,t)}),N.attr("opacity",x).attr("transform",function(t){return M(this.parentNode.__axis||V,V,t)})),w.remove(),S.attr("d",t===h||t==p?"M"+B*k+","+z+"H0.5V"+A+"H"+B*k:"M"+z+","+B*k+"V0.5H"+A+"V"+B*k),j.attr("opacity",1).attr("transform",function(t){return M(V,V,t)}),O.attr(f+"2",B*g),P.attr(f,B*F).text(v),H.filter(a).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===p?"start":t===h?"end":"middle"),H.each(function(){this.__axis=V})}var c=[],l=null,s=null,g=6,k=6,y=3;return u.scale=function(t){return arguments.length?(o=t,u):o},u.ticks=function(){return c=f.call(arguments),u},u.tickArguments=function(t){return arguments.length?(c=null==t?[]:f.call(t),u):c.slice()},u.tickValues=function(t){return arguments.length?(l=null==t?null:f.call(t),u):l&&l.slice()},u.tickFormat=function(t){return arguments.length?(s=t,u):s},u.tickSize=function(t){return arguments.length?(g=k=+t,u):g},u.tickSizeInner=function(t){return arguments.length?(g=+t,u):g},u.tickSizeOuter=function(t){return arguments.length?(k=+t,u):k},u.tickPadding=function(t){return arguments.length?(y=+t,u):y},u}function u(t){return o(d,t)}function c(t){return o(p,t)}function l(t){return o(m,t)}function s(t){return o(h,t)}var f=Array.prototype.slice,d=1,p=2,m=3,h=4,x=1e-6;t.axisTop=u,t.axisRight=c,t.axisBottom=l,t.axisLeft=s,Object.defineProperty(t,"__esModule",{value:!0})});
// https://d3js.org/d3-axis/ Version 1.0.4. Copyright 2016 Mike Bostock.
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.d3=t.d3||{})}(this,function(t){"use strict";function n(t,n,e){var r=t(e);return"translate("+(isFinite(r)?r:n(e))+",0)"}function e(t,n,e){var r=t(e);return"translate(0,"+(isFinite(r)?r:n(e))+")"}function r(t){var n=t.bandwidth()/2;return t.round()&&(n=Math.round(n)),function(e){return t(e)+n}}function i(){return!this.__axis}function a(t,a){function o(o){var s,_=null==c?a.ticks?a.ticks.apply(a,u):a.domain():c,v=null==l?a.tickFormat?a.tickFormat.apply(a,u):f:l,F=Math.max(g,0)+y,M=t===d||t===m?n:e,b=a.range(),z=b[0]+.5,A=b[b.length-1]+.5,V=(a.bandwidth?r:f)(a.copy()),H=o.selection?o.selection():o,S=H.selectAll(".domain").data([null]),j=H.selectAll(".tick").data(_,a).order(),w=j.exit(),N=j.enter().append("g").attr("class","tick"),O=j.select("line"),P=j.select("text"),B=t===d||t===h?-1:1,I=t===h||t===p?(s="x","y"):(s="y","x");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","#000")),j=j.merge(N),O=O.merge(N.append("line").attr("stroke","#000").attr(s+"2",B*g).attr(I+"1",.5).attr(I+"2",.5)),P=P.merge(N.append("text").attr("fill","#000").attr(s,B*F).attr(I,.5).attr("dy",t===d?"0em":t===m?"0.71em":"0.32em")),o!==H&&(S=S.transition(o),j=j.transition(o),O=O.transition(o),P=P.transition(o),w=w.transition(o).attr("opacity",x).attr("transform",function(t){return M(V,this.parentNode.__axis||V,t)}),N.attr("opacity",x).attr("transform",function(t){return M(this.parentNode.__axis||V,V,t)})),w.remove(),S.attr("d",t===h||t==p?"M"+B*k+","+z+"H0.5V"+A+"H"+B*k:"M"+z+","+B*k+"V0.5H"+A+"V"+B*k),j.attr("opacity",1).attr("transform",function(t){return M(V,V,t)}),O.attr(s+"2",B*g),P.attr(s,B*F).text(v),H.filter(i).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===p?"start":t===h?"end":"middle"),H.each(function(){this.__axis=V})}var u=[],c=null,l=null,g=6,k=6,y=3;return o.scale=function(t){return arguments.length?(a=t,o):a},o.ticks=function(){return u=s.call(arguments),o},o.tickArguments=function(t){return arguments.length?(u=null==t?[]:s.call(t),o):u.slice()},o.tickValues=function(t){return arguments.length?(c=null==t?null:s.call(t),o):c&&c.slice()},o.tickFormat=function(t){return arguments.length?(l=t,o):l},o.tickSize=function(t){return arguments.length?(g=k=+t,o):g},o.tickSizeInner=function(t){return arguments.length?(g=+t,o):g},o.tickSizeOuter=function(t){return arguments.length?(k=+t,o):k},o.tickPadding=function(t){return arguments.length?(y=+t,o):y},o}function o(t){return a(d,t)}function u(t){return a(p,t)}function c(t){return a(m,t)}function l(t){return a(h,t)}var s=Array.prototype.slice,f=function(t){return t},d=1,p=2,m=3,h=4,x=1e-6;t.axisTop=o,t.axisRight=u,t.axisBottom=c,t.axisLeft=l,Object.defineProperty(t,"__esModule",{value:!0})});
{
"name": "d3-axis",
"version": "1.0.3",
"version": "1.0.4",
"description": "Displays automatic reference lines for scales.",

@@ -33,5 +33,5 @@ "keywords": [

"d3-scale": "1",
"eslint": "2",
"eslint": "3",
"package-preamble": "0.0",
"rollup": "0.34",
"rollup": "0.36",
"tape": "4",

@@ -38,0 +38,0 @@ "uglify-js": "2"

@@ -68,27 +68,27 @@ # d3-axis

<a name="axisTop" href="#axisTop">#</a> d3.<b>axisTop</b>(<i>scale</i>)
<a name="axisTop" href="#axisTop">#</a> d3.<b>axisTop</b>(<i>scale</i>) [<>](https://github.com/d3/d3-axis/blob/master/src/axis.js#L159 "Source")
Constructs a new top-oriented axis generator for the given [scale](https://github.com/d3/d3-scale), with empty [tick arguments](#axis_ticks), a [tick size](#axis_tickSize) of 6 and [padding](#axis_tickPadding) of 3. In this orientation, ticks are drawn above the horizontal domain path.
<a name="axisRight" href="#axisRight">#</a> d3.<b>axisRight</b>(<i>scale</i>)
<a name="axisRight" href="#axisRight">#</a> d3.<b>axisRight</b>(<i>scale</i>) [<>](https://github.com/d3/d3-axis/blob/master/src/axis.js#L163 "Source")
Constructs a new right-oriented axis generator for the given [scale](https://github.com/d3/d3-scale), with empty [tick arguments](#axis_ticks), a [tick size](#axis_tickSize) of 6 and [padding](#axis_tickPadding) of 3. In this orientation, ticks are drawn to the right of the vertical domain path.
<a name="axisBottom" href="#axisBottom">#</a> d3.<b>axisBottom</b>(<i>scale</i>)
<a name="axisBottom" href="#axisBottom">#</a> d3.<b>axisBottom</b>(<i>scale</i>) [<>](https://github.com/d3/d3-axis/blob/master/src/axis.js#L167 "Source")
Constructs a new bottom-oriented axis generator for the given [scale](https://github.com/d3/d3-scale), with empty [tick arguments](#axis_ticks), a [tick size](#axis_tickSize) of 6 and [padding](#axis_tickPadding) of 3. In this orientation, ticks are drawn below the horizontal domain path.
<a name="axisLeft" href="#axisLeft">#</a> d3.<b>axisLeft</b>(<i>scale</i>)
<a name="axisLeft" href="#axisLeft">#</a> d3.<b>axisLeft</b>(<i>scale</i>) [<>](https://github.com/d3/d3-axis/blob/master/src/axis.js#L171 "Source")
Constructs a new left-oriented axis generator for the given [scale](https://github.com/d3/d3-scale), with empty [tick arguments](#axis_ticks), a [tick size](#axis_tickSize) of 6 and [padding](#axis_tickPadding) of 3. In this orientation, ticks are drawn to the left of the vertical domain path.
<a name="_axis" href="#_axis">#</a> <i>axis</i>(<i>context</i>)
<a name="_axis" href="#_axis">#</a> <i>axis</i>(<i>context</i>) [<>](https://github.com/d3/d3-axis/blob/master/src/axis.js#L40 "Source")
Render the axis to the given *context*, which may be either a [selection](https://github.com/d3/d3-selection) of SVG containers (either SVG or G elements) or a corresponding [transition](https://github.com/d3/d3-transition).
<a name="axis_scale" href="#axis_scale">#</a> <i>axis</i>.<b>scale</b>([<i>scale</i>])
<a name="axis_scale" href="#axis_scale">#</a> <i>axis</i>.<b>scale</b>([<i>scale</i>]) [<>](https://github.com/d3/d3-axis/blob/master/src/axis.js#L120 "Source")
If *scale* is specified, sets the [scale](https://github.com/d3/d3-scale) and returns the axis. If *scale* is not specified, returns the current scale.
<a name="axis_ticks" href="#axis_ticks">#</a> <i>axis</i>.<b>ticks</b>(<i>arguments…</i>)
<a name="axis_ticks" href="#axis_ticks">#</a> <i>axis</i>.<b>ticks</b>(<i>arguments…</i>) [<>](https://github.com/d3/d3-axis/blob/master/src/axis.js#L124 "Source")
<br><a href="#axis_ticks">#</a> <i>axis</i>.<b>ticks</b>([<i>count</i>[, <i>specifier</i>]])

@@ -123,3 +123,3 @@ <br><a href="#axis_ticks">#</a> <i>axis</i>.<b>ticks</b>([<i>interval</i>[, <i>specifier</i>]])

<a name="axis_tickArguments" href="#axis_tickArguments">#</a> <i>axis</i>.<b>tickArguments</b>([<i>arguments</i>])
<a name="axis_tickArguments" href="#axis_tickArguments">#</a> <i>axis</i>.<b>tickArguments</b>([<i>arguments</i>]) [<>](https://github.com/d3/d3-axis/blob/master/src/axis.js#L128 "Source")

@@ -142,3 +142,3 @@ If *arguments* are specified, sets the *arguments* that will be passed to [*scale*.ticks](https://github.com/d3/d3-scale#continuous_ticks) and [*scale*.tickFormat](https://github.com/d3/d3-scale#continuous_tickFormat) when the axis is [rendered](#_axis), and returns the axis generator. The meaning of the *arguments* depends on the [axis’ scale](#axis_scale) type: most commonly, the arguments are a suggested *count* for the number of ticks (or a [time *interval*](https://github.com/d3/d3-time) for time scales), and an optional [format *specifier*](https://github.com/d3/d3-format) to customize how the tick values are formatted. This method is a convenient alternative to setting the tick values explicitly via [*axis*.tickValues](#axis_tickValues), and setting the tick format explicitly via [*axis*.tickFormat](#axis_tickFormat). If *arguments* is not specified, returns the current tick arguments, which defaults to the empty array.

<a name="axis_tickValues" href="#axis_tickValues">#</a> <i>axis</i>.<b>tickValues</b>([<i>values</i>])
<a name="axis_tickValues" href="#axis_tickValues">#</a> <i>axis</i>.<b>tickValues</b>([<i>values</i>]) [<>](https://github.com/d3/d3-axis/blob/master/src/axis.js#L132 "Source")

@@ -154,3 +154,3 @@ If a *values* array is specified, the specified values are used for ticks rather than using the scale’s automatic tick generator. If *values* is null, clears any previously-set explicit tick values and reverts back to the scale’s tick generator. If *values* is not specified, returns the current tick values, which defaults to null. For example, to generate ticks at specific values:

<a name="axis_tickFormat" href="#axis_tickFormat">#</a> <i>axis</i>.<b>tickFormat</b>([<i>format</i>])
<a name="axis_tickFormat" href="#axis_tickFormat">#</a> <i>axis</i>.<b>tickFormat</b>([<i>format</i>]) [<>](https://github.com/d3/d3-axis/blob/master/src/axis.js#L136 "Source")

@@ -173,16 +173,16 @@ If *format* is specified, sets the tick format function and returns the axis. If *format* is not specified, returns the current format function, which defaults to null. A null format indicates that the scale’s default formatter should be used, which is generated by calling [*scale*.tickFormat](https://github.com/d3/d3-scale#continuous_tickFormat). In this case, the arguments specified by [*axis*.tickArguments](#axis_tickArguments) are likewise passed to *scale*.tickFormat.

<a name="axis_tickSize" href="#axis_tickSize">#</a> <i>axis</i>.<b>tickSize</b>([<i>size</i>])
<a name="axis_tickSize" href="#axis_tickSize">#</a> <i>axis</i>.<b>tickSize</b>([<i>size</i>]) [<>](https://github.com/d3/d3-axis/blob/master/src/axis.js#L140 "Source")
If *size* is specified, sets the [inner](#axis_tickSizeInner) and [outer](#axis_tickSizeOuter) tick size to the specified value and returns the axis. If *size* is not specified, returns the current inner tick size, which defaults to 6.
<a name="axis_tickSizeInner" href="#axis_tickSizeInner">#</a> <i>axis</i>.<b>tickSizeInner</b>([<i>size</i>])
<a name="axis_tickSizeInner" href="#axis_tickSizeInner">#</a> <i>axis</i>.<b>tickSizeInner</b>([<i>size</i>]) [<>](https://github.com/d3/d3-axis/blob/master/src/axis.js#L144 "Source")
If *size* is specified, sets the inner tick size to the specified value and returns the axis. If *size* is not specified, returns the current inner tick size, which defaults to 6. The inner tick size controls the length of the tick lines, offset from the native position of the axis.
<a name="axis_tickSizeOuter" href="#axis_tickSizeOuter">#</a> <i>axis</i>.<b>tickSizeOuter</b>([<i>size</i>])
<a name="axis_tickSizeOuter" href="#axis_tickSizeOuter">#</a> <i>axis</i>.<b>tickSizeOuter</b>([<i>size</i>]) [<>](https://github.com/d3/d3-axis/blob/master/src/axis.js#L148 "Source")
If *size* is specified, sets the outer tick size to the specified value and returns the axis. If *size* is not specified, returns the current outer tick size, which defaults to 6. The outer tick size controls the length of the square ends of the domain path, offset from the native position of the axis. Thus, the “outer ticks” are not actually ticks but part of the domain path, and their position is determined by the associated scale’s domain extent. Thus, outer ticks may overlap with the first or last inner tick. An outer tick size of 0 suppresses the square ends of the domain path, instead producing a straight line.
<a name="axis_tickPadding" href="#axis_tickPadding">#</a> <i>axis</i>.<b>tickPadding</b>([<i>padding</i>])
<a name="axis_tickPadding" href="#axis_tickPadding">#</a> <i>axis</i>.<b>tickPadding</b>([<i>padding</i>]) [<>](https://github.com/d3/d3-axis/blob/master/src/axis.js#L152 "Source")
If *padding* is specified, sets the padding to the specified value in pixels and returns the axis. If *padding* is not specified, returns the current padding which defaults to 3 pixels.

Sorry, the diff of this file is not supported yet

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