UNPKG

cttv.spinner

Version:

CTTV spinner in SVG format

1 lines 1.26 kB
!function e(t,r,n){function s(o,a){if(!r[o]){if(!t[o]){var u="function"==typeof require&&require;if(!a&&u)return u(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){var r=t[o][1][e];return s(r?r:e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o<n.length;o++)s(n[o]);return s}({1:[function(e,t,r){t.exports=e("./index.js")},{"./index.js":2}],2:[function(e,t,r){t.exports=spinner=e("./src/spinner.js")},{"./src/spinner.js":3}],3:[function(e,t,r){var n=function(){"use strict";var e={size:50,stroke:3,cssClass:"cttv-spinner-component",angle:Math.PI},t=function(t){var r=~~(e.size/2),n=d3.select(t);n.selectAll("*").remove();var s=n.append("svg").attr("width",e.size).attr("height",e.size).attr("class",e.cssClass).append("g"),i=d3.svg.arc().innerRadius(r-e.stroke).outerRadius(r).startAngle(0).endAngle(e.angle);s.append("path").attr("d",i).attr("transform","translate("+r+","+r+")")};return t.size=function(t){return arguments.length?(e.size=t,this):e.size},t.stroke=function(t){return arguments.length?(e.stroke=t,this):e.stroke},t.angle=function(t){return arguments.length?(e.angle=t,this):e.angle},t};t.exports=r=n},{}]},{},[1]);