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 0.4.0 to 0.4.1

6

build/d3-axis.js

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

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

@@ -61,3 +61,3 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :

tickExit = tick.exit(),
tickEnter = tick.enter().append("g", ".domain").attr("class", "tick"),
tickEnter = tick.enter().append("g").attr("class", "tick"),
line = tick.select("line"),

@@ -68,3 +68,3 @@ text = tick.select("text"),

path = path.merge(path.enter().append("path")
path = path.merge(path.enter().insert("path", ".tick")
.attr("class", "domain")

@@ -71,0 +71,0 @@ .attr("stroke", "#000"));

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

// https://d3js.org/d3-axis/ Version 0.4.0. 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 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,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=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",".domain").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().append("path").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")),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 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 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 0.4.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})});
{
"name": "d3-axis",
"version": "0.4.0",
"version": "0.4.1",
"description": "Displays automatic reference lines for scales.",

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

@@ -36,2 +36,34 @@ # d3-axis

The elements created by the axis are considered part of its public API. You can apply external stylesheets or modify the generated axis elements to customize the axis appearance. An axis consists of a [path element](https://www.w3.org/TR/SVG/paths.html#PathElement) of class “domain” representing the extent of the scale’s domain, followed by transformed [g elements](https://www.w3.org/TR/SVG/struct.html#Groups) of class “tick” representing each of the scale’s ticks. Each tick has a [line element](https://www.w3.org/TR/SVG/shapes.html#LineElement) to draw the tick line, and a [text element](https://www.w3.org/TR/SVG/text.html#TextElement) for the tick label. For example, here is a typical bottom-oriented axis:
```html
<g fill="none" font-size="10" font-family="sans-serif" text-anchor="middle">
<path class="domain" stroke="#000" d="M0.5,6V0.5H880.5V6"></path>
<g class="tick" opacity="1" transform="translate(0,0)">
<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>
</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>
</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>
</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>
</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>
</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>
</g>
</g>
```
<a name="axisTop" href="#axisTop">#</a> d3.<b>axisTop</b>(<i>scale</i>)

@@ -38,0 +70,0 @@

@@ -52,3 +52,3 @@ import {slice} from "./array";

tickExit = tick.exit(),
tickEnter = tick.enter().append("g", ".domain").attr("class", "tick"),
tickEnter = tick.enter().append("g").attr("class", "tick"),
line = tick.select("line"),

@@ -59,3 +59,3 @@ text = tick.select("text"),

path = path.merge(path.enter().append("path")
path = path.merge(path.enter().insert("path", ".tick")
.attr("class", "domain")

@@ -62,0 +62,0 @@ .attr("stroke", "#000"));

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