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

9

build/d3-axis.js

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

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

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

function center(scale) {
var width = scale.bandwidth() / 2;
var offset = scale.bandwidth() / 2;
if (scale.round()) offset = Math.round(offset);
return function(d) {
return scale(d) + width;
return scale(d) + offset;
};

@@ -84,3 +85,3 @@ }

.attr(y, 0.5)
.attr("dy", orient === top ? "0em" : orient === bottom ? ".71em" : ".32em"));
.attr("dy", orient === top ? "0em" : orient === bottom ? "0.71em" : "0.32em"));

@@ -87,0 +88,0 @@ if (context !== selection) {

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

// https://d3js.org/d3-axis/ Version 1.0.1. 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 function(e){return t(e)+n}}function a(){return!this.__axis}function o(t,o){function c(c){var f,_=null==l?o.ticks?o.ticks.apply(o,u):o.domain():l,v=null==s?o.tickFormat?o.tickFormat.apply(o,u):n:s,F=Math.max(g,0)+y,b=t===d||t===m?e:r,z=o.range(),A=z[0]+.5,M=z[z.length-1]+.5,V=(o.bandwidth?i:n)(o.copy()),H=c.selection?c.selection():c,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?".71em":".32em")),c!==H&&(S=S.transition(c),j=j.transition(c),O=O.transition(c),P=P.transition(c),w=w.transition(c).attr("opacity",x).attr("transform",function(t){return b(V,this.parentNode.__axis||V,t)}),N.attr("opacity",x).attr("transform",function(t){return b(this.parentNode.__axis||V,V,t)})),w.remove(),S.attr("d",t===h||t==p?"M"+B*k+","+A+"H0.5V"+M+"H"+B*k:"M"+A+","+B*k+"V0.5H"+M+"V"+B*k),j.attr("opacity",1).attr("transform",function(t){return b(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 u=[],l=null,s=null,g=6,k=6,y=3;return c.scale=function(t){return arguments.length?(o=t,c):o},c.ticks=function(){return u=f.call(arguments),c},c.tickArguments=function(t){return arguments.length?(u=null==t?[]:f.call(t),c):u.slice()},c.tickValues=function(t){return arguments.length?(l=null==t?null:f.call(t),c):l&&l.slice()},c.tickFormat=function(t){return arguments.length?(s=t,c):s},c.tickSize=function(t){return arguments.length?(g=k=+t,c):g},c.tickSizeInner=function(t){return arguments.length?(g=+t,c):g},c.tickSizeOuter=function(t){return arguments.length?(k=+t,c):k},c.tickPadding=function(t){return arguments.length?(y=+t,c):y},c}function c(t){return o(d,t)}function u(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=c,t.axisRight=u,t.axisBottom=l,t.axisLeft=s,Object.defineProperty(t,"__esModule",{value:!0})});
// https://d3js.org/d3-axis/ Version 1.0.2. 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})});
{
"name": "d3-axis",
"version": "1.0.1",
"version": "1.0.2",
"description": "Displays automatic reference lines for scales.",

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

@@ -43,23 +43,23 @@ # d3-axis

<line stroke="#000" y2="6" x1="0.5" x2="0.5"></line>
<text fill="#000" y="9" x="0.5" dy=".71em">0.0</text>
<text fill="#000" y="9" x="0.5" dy="0.71em">0.0</text>
</g>
<g class="tick" opacity="1" transform="translate(176,0)">
<line stroke="#000" y2="6" x1="0.5" x2="0.5"></line>
<text fill="#000" y="9" x="0.5" dy=".71em">0.2</text>
<text fill="#000" y="9" x="0.5" dy="0.71em">0.2</text>
</g>
<g class="tick" opacity="1" transform="translate(352,0)">
<line stroke="#000" y2="6" x1="0.5" x2="0.5"></line>
<text fill="#000" y="9" x="0.5" dy=".71em">0.4</text>
<text fill="#000" y="9" x="0.5" dy="0.71em">0.4</text>
</g>
<g class="tick" opacity="1" transform="translate(528,0)">
<line stroke="#000" y2="6" x1="0.5" x2="0.5"></line>
<text fill="#000" y="9" x="0.5" dy=".71em">0.6</text>
<text fill="#000" y="9" x="0.5" dy="0.71em">0.6</text>
</g>
<g class="tick" opacity="1" transform="translate(704,0)">
<line stroke="#000" y2="6" x1="0.5" x2="0.5"></line>
<text fill="#000" y="9" x="0.5" dy=".71em">0.8</text>
<text fill="#000" y="9" x="0.5" dy="0.71em">0.8</text>
</g>
<g class="tick" opacity="1" transform="translate(880,0)">
<line stroke="#000" y2="6" x1="0.5" x2="0.5"></line>
<text fill="#000" y="9" x="0.5" dy=".71em">1.0</text>
<text fill="#000" y="9" x="0.5" dy="0.71em">1.0</text>
</g>

@@ -66,0 +66,0 @@ </g>

@@ -21,5 +21,6 @@ import {slice} from "./array";

function center(scale) {
var width = scale.bandwidth() / 2;
var offset = scale.bandwidth() / 2;
if (scale.round()) offset = Math.round(offset);
return function(d) {
return scale(d) + width;
return scale(d) + offset;
};

@@ -75,3 +76,3 @@ }

.attr(y, 0.5)
.attr("dy", orient === top ? "0em" : orient === bottom ? ".71em" : ".32em"));
.attr("dy", orient === top ? "0em" : orient === bottom ? "0.71em" : "0.32em"));

@@ -78,0 +79,0 @@ if (context !== selection) {

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