Initial commit
This commit is contained in:
193
node_modules/d3-axis/build/d3-axis.js
generated
vendored
Normal file
193
node_modules/d3-axis/build/d3-axis.js
generated
vendored
Normal file
@@ -0,0 +1,193 @@
|
||||
// https://d3js.org/d3-axis/ Version 1.0.8. Copyright 2017 Mike Bostock.
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(factory((global.d3 = global.d3 || {})));
|
||||
}(this, (function (exports) { 'use strict';
|
||||
|
||||
var slice = Array.prototype.slice;
|
||||
|
||||
var identity = function(x) {
|
||||
return x;
|
||||
};
|
||||
|
||||
var top = 1;
|
||||
var right = 2;
|
||||
var bottom = 3;
|
||||
var left = 4;
|
||||
var epsilon = 1e-6;
|
||||
|
||||
function translateX(x) {
|
||||
return "translate(" + (x + 0.5) + ",0)";
|
||||
}
|
||||
|
||||
function translateY(y) {
|
||||
return "translate(0," + (y + 0.5) + ")";
|
||||
}
|
||||
|
||||
function number(scale) {
|
||||
return function(d) {
|
||||
return +scale(d);
|
||||
};
|
||||
}
|
||||
|
||||
function center(scale) {
|
||||
var offset = Math.max(0, scale.bandwidth() - 1) / 2; // Adjust for 0.5px offset.
|
||||
if (scale.round()) offset = Math.round(offset);
|
||||
return function(d) {
|
||||
return +scale(d) + offset;
|
||||
};
|
||||
}
|
||||
|
||||
function entering() {
|
||||
return !this.__axis;
|
||||
}
|
||||
|
||||
function axis(orient, scale) {
|
||||
var tickArguments = [],
|
||||
tickValues = null,
|
||||
tickFormat = null,
|
||||
tickSizeInner = 6,
|
||||
tickSizeOuter = 6,
|
||||
tickPadding = 3,
|
||||
k = orient === top || orient === left ? -1 : 1,
|
||||
x = orient === left || orient === right ? "x" : "y",
|
||||
transform = orient === top || orient === bottom ? translateX : translateY;
|
||||
|
||||
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,
|
||||
range = scale.range(),
|
||||
range0 = +range[0] + 0.5,
|
||||
range1 = +range[range.length - 1] + 0.5,
|
||||
position = (scale.bandwidth ? center : number)(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");
|
||||
|
||||
path = path.merge(path.enter().insert("path", ".tick")
|
||||
.attr("class", "domain")
|
||||
.attr("stroke", "#000"));
|
||||
|
||||
tick = tick.merge(tickEnter);
|
||||
|
||||
line = line.merge(tickEnter.append("line")
|
||||
.attr("stroke", "#000")
|
||||
.attr(x + "2", k * tickSizeInner));
|
||||
|
||||
text = text.merge(tickEnter.append("text")
|
||||
.attr("fill", "#000")
|
||||
.attr(x, k * spacing)
|
||||
.attr("dy", orient === top ? "0em" : orient === bottom ? "0.71em" : "0.32em"));
|
||||
|
||||
if (context !== selection) {
|
||||
path = path.transition(context);
|
||||
tick = tick.transition(context);
|
||||
line = line.transition(context);
|
||||
text = text.transition(context);
|
||||
|
||||
tickExit = tickExit.transition(context)
|
||||
.attr("opacity", epsilon)
|
||||
.attr("transform", function(d) { return isFinite(d = position(d)) ? transform(d) : this.getAttribute("transform"); });
|
||||
|
||||
tickEnter
|
||||
.attr("opacity", epsilon)
|
||||
.attr("transform", function(d) { var p = this.parentNode.__axis; return transform(p && isFinite(p = p(d)) ? p : position(d)); });
|
||||
}
|
||||
|
||||
tickExit.remove();
|
||||
|
||||
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);
|
||||
|
||||
tick
|
||||
.attr("opacity", 1)
|
||||
.attr("transform", function(d) { return transform(position(d)); });
|
||||
|
||||
line
|
||||
.attr(x + "2", k * tickSizeInner);
|
||||
|
||||
text
|
||||
.attr(x, k * spacing)
|
||||
.text(format);
|
||||
|
||||
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");
|
||||
|
||||
selection
|
||||
.each(function() { this.__axis = position; });
|
||||
}
|
||||
|
||||
axis.scale = function(_) {
|
||||
return arguments.length ? (scale = _, axis) : scale;
|
||||
};
|
||||
|
||||
axis.ticks = function() {
|
||||
return tickArguments = slice.call(arguments), axis;
|
||||
};
|
||||
|
||||
axis.tickArguments = function(_) {
|
||||
return arguments.length ? (tickArguments = _ == null ? [] : slice.call(_), axis) : tickArguments.slice();
|
||||
};
|
||||
|
||||
axis.tickValues = function(_) {
|
||||
return arguments.length ? (tickValues = _ == null ? null : slice.call(_), axis) : tickValues && tickValues.slice();
|
||||
};
|
||||
|
||||
axis.tickFormat = function(_) {
|
||||
return arguments.length ? (tickFormat = _, axis) : tickFormat;
|
||||
};
|
||||
|
||||
axis.tickSize = function(_) {
|
||||
return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;
|
||||
};
|
||||
|
||||
axis.tickSizeInner = function(_) {
|
||||
return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;
|
||||
};
|
||||
|
||||
axis.tickSizeOuter = function(_) {
|
||||
return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;
|
||||
};
|
||||
|
||||
axis.tickPadding = function(_) {
|
||||
return arguments.length ? (tickPadding = +_, axis) : tickPadding;
|
||||
};
|
||||
|
||||
return axis;
|
||||
}
|
||||
|
||||
function axisTop(scale) {
|
||||
return axis(top, scale);
|
||||
}
|
||||
|
||||
function axisRight(scale) {
|
||||
return axis(right, scale);
|
||||
}
|
||||
|
||||
function axisBottom(scale) {
|
||||
return axis(bottom, scale);
|
||||
}
|
||||
|
||||
function axisLeft(scale) {
|
||||
return axis(left, scale);
|
||||
}
|
||||
|
||||
exports.axisTop = axisTop;
|
||||
exports.axisRight = axisRight;
|
||||
exports.axisBottom = axisBottom;
|
||||
exports.axisLeft = axisLeft;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
2
node_modules/d3-axis/build/d3-axis.min.js
generated
vendored
Normal file
2
node_modules/d3-axis/build/d3-axis.min.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
// https://d3js.org/d3-axis/ Version 1.0.8. Copyright 2017 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"translate("+(t+.5)+",0)"}function e(t){return"translate(0,"+(t+.5)+")"}function r(t){return function(n){return+t(n)}}function i(t){var n=Math.max(0,t.bandwidth()-1)/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(n){var e=null==l?o.ticks?o.ticks.apply(o,c):o.domain():l,u=null==s?o.tickFormat?o.tickFormat.apply(o,c):d:s,f=Math.max(k,0)+_,A=o.range(),F=+A[0]+.5,z=+A[A.length-1]+.5,V=(o.bandwidth?i:r)(o.copy()),H=n.selection?n.selection():n,S=H.selectAll(".domain").data([null]),j=H.selectAll(".tick").data(e,o).order(),w=j.exit(),O=j.enter().append("g").attr("class","tick"),P=j.select("line"),B=j.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","#000")),j=j.merge(O),P=P.merge(O.append("line").attr("stroke","#000").attr(M+"2",v*k)),B=B.merge(O.append("text").attr("fill","#000").attr(M,v*f).attr("dy",t===m?"0em":t===h?"0.71em":"0.32em")),n!==H&&(S=S.transition(n),j=j.transition(n),P=P.transition(n),B=B.transition(n),w=w.transition(n).attr("opacity",x).attr("transform",function(t){return isFinite(t=V(t))?b(t):this.getAttribute("transform")}),O.attr("opacity",x).attr("transform",function(t){var n=this.parentNode.__axis;return b(n&&isFinite(n=n(t))?n:V(t))})),w.remove(),S.attr("d",t===g||t==p?"M"+v*y+","+F+"H0.5V"+z+"H"+v*y:"M"+F+","+v*y+"V0.5H"+z+"V"+v*y),j.attr("opacity",1).attr("transform",function(t){return b(V(t))}),P.attr(M+"2",v*k),B.attr(M,v*f).text(u),H.filter(a).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===p?"start":t===g?"end":"middle"),H.each(function(){this.__axis=V})}var c=[],l=null,s=null,k=6,y=6,_=3,v=t===m||t===g?-1:1,M=t===g||t===p?"x":"y",b=t===m||t===h?n:e;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?(k=y=+t,u):k},u.tickSizeInner=function(t){return arguments.length?(k=+t,u):k},u.tickSizeOuter=function(t){return arguments.length?(y=+t,u):y},u.tickPadding=function(t){return arguments.length?(_=+t,u):_},u}function u(t){return o(m,t)}function c(t){return o(p,t)}function l(t){return o(h,t)}function s(t){return o(g,t)}var f=Array.prototype.slice,d=function(t){return t},m=1,p=2,h=3,g=4,x=1e-6;t.axisTop=u,t.axisRight=c,t.axisBottom=l,t.axisLeft=s,Object.defineProperty(t,"__esModule",{value:!0})});
|
||||
Reference in New Issue
Block a user