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

d3plus-legend

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3plus-legend - npm Package Compare versions

Comparing version 0.8.8 to 0.8.9

6

build/d3plus-legend.js
/*
d3plus-legend v0.8.8
d3plus-legend v0.8.9
An easy to use javascript chart legend.

@@ -357,2 +357,3 @@ Copyright (c) 2017 D3plus - https://d3plus.org

ticks = d3Array.merge(jenks.map(function (c, i) { return i === jenks.length - 1 ? [c[0], c[c.length - 1]] : [c[0]]; }));
this._colorScale = d3Scale.scaleThreshold()

@@ -431,3 +432,4 @@ .domain(ticks)

function bucketWidth(d, i) {
return Math.abs(axisScale(ticks[i + 1]) - axisScale(d));
var w = Math.abs(axisScale(ticks[i + 1]) - axisScale(d));
return w || 2;
}

@@ -434,0 +436,0 @@

/*
d3plus-legend v0.8.8
d3plus-legend v0.8.9
An easy to use javascript chart legend.

@@ -7,2 +7,2 @@ Copyright (c) 2017 D3plus - https://d3plus.org

*/
(function(t,i){typeof exports==="object"&&typeof module!=="undefined"?i(exports,require("d3-array"),require("d3-interpolate"),require("d3-scale"),require("d3-selection"),require("d3plus-axis"),require("d3plus-color"),require("d3plus-common"),require("d3plus-shape"),require("d3plus-text")):typeof define==="function"&&define.amd?define("d3plus-legend",["exports","d3-array","d3-interpolate","d3-scale","d3-selection","d3plus-axis","d3plus-color","d3plus-common","d3plus-shape","d3plus-text"],i):i(t.d3plus=t.d3plus||{},t.d3Array,t.d3Interpolate,t.d3Scale,t.d3Selection,t.d3plusAxis,t.d3plusColor,t.d3plusCommon,t.shapes,t.d3plusText)})(this,function(t,i,e,n,r,h,s,o,a,l){"use strict";function u(t){return t.slice().sort(function(t,i){return t-i})}function d(t){var i,e=0;for(var n=0;n<t.length;n++){if(n===0||t[n]!==i){i=t[n];e++}}return e}function _(t,i){var e=[];for(var n=0;n<t;n++){var r=[];for(var h=0;h<i;h++){r.push(0)}e.push(r)}return e}function c(t,i,e,n){var r;if(t>0){var h=(e[i]-e[t-1])/(i-t+1);r=n[i]-n[t-1]-(i-t+1)*h*h}else{r=n[i]-e[i]*e[i]/(i+1)}if(r<0){return 0}return r}function g(t,i,e,n,r,h,s){if(t>i){return}var o=Math.floor((t+i)/2);n[e][o]=n[e-1][o-1];r[e][o]=o;var a=e;if(t>e){a=Math.max(a,r[e][t-1]||0)}a=Math.max(a,r[e-1][o]||0);var l=o-1;if(i<n.length-1){l=Math.min(l,r[e][i+1]||0)}for(var u=l;u>=a;--u){var d=c(u,o,h,s);if(d+n[e-1][a-1]>=n[e][o]){break}var _=c(a,o,h,s);var f=_+n[e-1][a-1];if(f<n[e][o]){n[e][o]=f;r[e][o]=a}a++;var p=d+n[e-1][u-1];if(p<n[e][o]){n[e][o]=p;r[e][o]=u}}g(t,o-1,e,n,r,h,s);g(o+1,i,e,n,r,h,s)}function f(t,i,e){var n=i[0].length;var r=t[Math.floor(n/2)];var h=[];var s=[];for(var o=0,a=void 0;o<n;++o){a=t[o]-r;if(o===0){h.push(a);s.push(a*a)}else{h.push(h[o-1]+a);s.push(s[o-1]+a*a)}i[0][o]=c(0,o,h,s);e[0][o]=0}for(var l=1;l<i.length;++l){var u=n-1;if(l<i.length-1){u=l}g(u,n-1,l,i,e,h,s)}}var p=function(t,i){if(i>t.length){throw new Error("Cannot generate more classes than there are data values")}var e=u(t);var n=d(e);if(n===1){return[e]}var r=_(i,e.length),h=_(i,e.length);f(e,h,r);var s=r[0].length-1;var o=[];for(var a=r.length-1;a>=0;a--){var l=r[a][s];o[a]=e.slice(l,s+1);if(a>0){s=l-1}}return o};var v=function(t){function l(){t.call(this);this._axisClass=new h.Axis;this._axisConfig={gridSize:0};this._axisTest=new h.Axis;this._align="middle";this._color="#0C8040";this._data=[];this._duration=600;this._height=200;this._orient="bottom";this._outerBounds={width:0,height:0,x:0,y:0};this._padding=5;this._rectClass=new a.Rect;this._rectConfig={stroke:"#000",strokeWidth:1};this._scale="linear";this._size=10;this._value=o.accessor("value");this._width=400}if(t)l.__proto__=t;l.prototype=Object.create(t&&t.prototype);l.prototype.constructor=l;l.prototype.render=function t(h){var a=this;if(this._select===void 0){this.select(r.select("body").append("svg").attr("width",this._width+"px").attr("height",this._height+"px").node())}var l=["bottom","top"].includes(this._orient);var u=l?"height":"width",d=l?"width":"height",_=l?"x":"y",c=l?"y":"x";this._group=o.elem("g.d3plus-ColorScale",{parent:this._select});var g=i.extent(this._data,this._value);var f=this._color,v;if(!(f instanceof Array)){f=[s.colorLighter(f,.9),s.colorLighter(f,.75),s.colorLighter(f,.5),s.colorLighter(f,.25),f]}if(this._scale==="jenks"){var y=this._data.map(this._value).filter(function(t){return t!==null&&typeof t==="number"});if(y.length<=f.length){var m=n.scaleLinear().domain(i.range(0,y.length-1)).interpolate(e.interpolateHsl).range(f);f=y.slice(0,y.length-1).map(function(t,i){return m(i)})}var w=p(y,f.length);v=i.merge(w.map(function(t,i){return i===w.length-1?[t[0],t[t.length-1]]:[t[0]]}));this._colorScale=n.scaleThreshold().domain(v).range(["black"].concat(f).concat(f[f.length-1]))}else{var x=(g[1]-g[0])/f.length;var C=i.range(g[0],g[1]+x/2,x);if(this._scale==="buckets"){v=C}this._colorScale=n.scaleLinear().domain(C).range(f)}var b=Object.assign({domain:l?g:g.reverse(),duration:this._duration,height:this._height,labels:v,orient:this._orient,padding:this._padding,ticks:v,width:this._width},this._axisConfig);this._axisTest.select(o.elem("g.d3plus-ColorScale-axisTest",{enter:{opacity:0},parent:this._group}).node()).config(b).render();var B=this._axisTest.outerBounds();this._outerBounds[d]=this["_"+d]-this._padding*2;this._outerBounds[u]=B[u]+this._size;this._outerBounds[_]=this._padding;this._outerBounds[c]=this._padding;if(this._align==="middle"){this._outerBounds[c]=(this["_"+u]-this._outerBounds[u])/2}else if(this._align==="end"){this._outerBounds[c]=this["_"+u]-this._padding-this._outerBounds[u]}var H=this._outerBounds[c]+(["bottom","right"].includes(this._orient)?this._size:0)-(b.padding||this._axisClass.padding());this._axisClass.select(o.elem("g.d3plus-ColorScale-axis",{parent:this._group,update:{transform:"translate("+(l?0:H)+", "+(l?H:0)+")"}}).node()).config(b).align("start").render();var D=this._axisTest._d3Scale;var S=D.range();var z=this._group.selectAll("defs").data([0]);var W=z.enter().append("defs");W.append("linearGradient").attr("id","gradient-"+this._uuid);z=W.merge(z);z.select("linearGradient").attr(_+"1",l?"0%":"100%").attr(_+"2",l?"100%":"0%").attr(c+"1","0%").attr(c+"2","0%");var A=z.select("linearGradient").selectAll("stop").data(f);A.enter().append("stop").merge(A).attr("offset",function(t,i){return i/(f.length-1)*100+"%"}).attr("stop-color",String);function k(t,i){return Math.abs(D(v[i+1])-D(t))}this._rectClass.data(v?v.slice(0,v.length-1):[0]).id(function(t,i){return i}).select(o.elem("g.d3plus-ColorScale-Rect",{parent:this._group}).node()).config((T={fill:v?function(t){return a._colorScale(t)}:"url(#gradient-"+this._uuid+")"},T[_]=v?function(t,i){return D(t)+k(t,i)/2-(["left","right"].includes(a._orient)?k(t,i):0)}:S[0]+(S[1]-S[0])/2,T[c]=this._outerBounds[c]+(["top","left"].includes(this._orient)?B[u]:0)+this._size/2,T[d]=v?k:S[1]-S[0],T[u]=this._size,T)).config(this._rectConfig).render();var T;if(h){setTimeout(h,this._duration+100)}return this};l.prototype.axisConfig=function t(i){return arguments.length?(this._axisConfig=Object.assign(this._axisConfig,i),this):this._axisConfig};l.prototype.align=function t(i){return arguments.length?(this._align=i,this):this._align};l.prototype.color=function t(i){return arguments.length?(this._color=i,this):this._color};l.prototype.data=function t(i){return arguments.length?(this._data=i,this):this._data};l.prototype.duration=function t(i){return arguments.length?(this._duration=i,this):this._duration};l.prototype.height=function t(i){return arguments.length?(this._height=i,this):this._height};l.prototype.orient=function t(i){return arguments.length?(this._orient=i,this):this._orient};l.prototype.outerBounds=function t(){return this._outerBounds};l.prototype.padding=function t(i){return arguments.length?(this._padding=i,this):this._padding};l.prototype.rectConfig=function t(i){return arguments.length?(this._rectConfig=Object.assign(this._rectConfig,i),this):this._rectConfig};l.prototype.scale=function t(i){return arguments.length?(this._scale=i,this):this._scale};l.prototype.select=function t(i){return arguments.length?(this._select=r.select(i),this):this._select};l.prototype.size=function t(i){return arguments.length?(this._size=i,this):this._size};l.prototype.value=function t(i){return arguments.length?(this._value=typeof i==="function"?i:o.constant(i),this):this._value};l.prototype.width=function t(i){return arguments.length?(this._width=i,this):this._width};return l}(o.BaseClass);var y=function(t){function e(){var e=this;t.call(this);this._align="center";this._data=[];this._direction="row";this._duration=600;this._height=200;this._id=o.accessor("id");this._label=o.accessor("id");this._lineData=[];this._outerBounds={width:0,height:0,x:0,y:0};this._padding=5;this._shape=o.constant("Rect");this._shapeConfig={duration:this._duration,fill:o.accessor("color"),height:o.constant(10),hitArea:function(t,n){var r=e._lineData[n],h=i.max([r.height,r.shapeHeight]);return{width:r.width+r.shapeWidth,height:h,x:-r.shapeWidth/2,y:-h/2}},labelBounds:function(t,i,n){var r=e._lineData[i],h=n.r!==void 0?n.r:n.width/2;return{width:r.width,height:r.height,x:h+e._padding,y:-r.height/2}},labelConfig:{fontColor:o.constant("#444"),fontFamily:(new l.TextBox).fontFamily(),fontResize:false,fontSize:o.constant(10)},opacity:1,r:o.constant(5),width:o.constant(10),x:function(t,i){var n=e._shapeConfig.width;var r=e._lineData[i].y;var h=e._align==="left"||e._align==="right"&&e._direction==="column"?0:e._align==="center"?(e._outerBounds.width-e._rowWidth(e._lineData.filter(function(t){return r===t.y})))/2:e._outerBounds.width-e._rowWidth(e._lineData.filter(function(t){return r===t.y}));var s=e._lineData.slice(0,i).filter(function(t){return r===t.y});return e._rowWidth(s)+e._padding*(s.length?2:0)+e._outerBounds.x+n(t,i)/2+h},y:function(t,n){var r=e._shapeConfig.height;var h=e._lineData[n];return h.y+e._titleHeight+e._outerBounds.y+i.max(e._lineData.filter(function(t){return h.y===t.y}).map(function(t){return t.height}).concat(e._data.map(function(t,i){return r(t,i)})))/2}};this._titleConfig={fontFamily:"Verdana",fontSize:12,lineHeight:13};this._verticalAlign="middle";this._width=400}if(t)e.__proto__=t;e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.prototype._fetchConfig=function t(i,e,n){var r=this._shapeConfig[i]||this._shapeConfig.labelConfig[i];return typeof r==="function"?r(e,n):r};e.prototype._rowHeight=function t(e){return i.max(e.map(function(t){return t.height}).concat(e.map(function(t){return t.shapeHeight})))+this._padding};e.prototype._rowWidth=function t(e){var n=this;return i.sum(e.map(function(t,i){var r=n._padding*(i===e.length-1?0:t.width?2:1);return t.shapeWidth+t.width+r}))};e.prototype.render=function t(e){var n=this;if(this._select===void 0){this.select(r.select("body").append("svg").attr("width",this._width+"px").attr("height",this._height+"px").node())}if(this._lineHeight===void 0){this._lineHeight=function(t,i){return n._fetchConfig("fontSize",t,i)*1.1}}this._group=o.elem("g.d3plus-Legend",{parent:this._select});var h=this._height;this._titleHeight=0;if(this._title){var s=this._titleConfig.fontFamily,u=this._titleConfig.lineHeight,d=this._titleConfig.fontSize;var _=l.textWrap().fontFamily(s).fontSize(d).lineHeight(u).width(this._width).height(this._height)(this._title);this._titleHeight=u+_.lines.length+this._padding;h-=this._titleHeight}this._lineData=this._data.map(function(t,e){var r=n._fetchConfig("fontFamily",t,e),s=n._lineHeight(t,e),o=n._fetchConfig("fontSize",t,e),a=n._fetchConfig("width",t,e);var u=h-(n._data.length+1)*n._padding,d=n._width;var _=l.textWrap().fontFamily(r).fontSize(o).lineHeight(s).width(d).height(u)(n._label(t,e));_.width=Math.ceil(i.max(_.lines.map(function(t){return l.textWidth(t,{"font-family":r,"font-size":o})})))+o*.75;_.height=Math.ceil(_.lines.length*(s+1));_.og={height:_.height,width:_.width};_.data=t;_.f=r;_.s=o;_.lh=s;_.y=0;_.id=n._id(t,e);_.i=e;_.shapeWidth=a;_.shapeHeight=n._fetchConfig("height",t,e);return _});var c;var g=this._width-this._padding*2;c=this._rowWidth(this._lineData);if(this._direction==="column"||c>g){var f=1,p=[];var v=i.max(this._lineData.map(function(t){return t.words.length}));this._wrapLines=function(){var t=this;f++;if(f>v){return}var e=f===1?this._lineData.slice():this._lineData.filter(function(i){return i.width+i.shapeWidth+t._padding*(i.width?2:1)>g&&i.words.length>=f}).sort(function(t,i){return i.sentence.length-t.sentence.length});if(e.length&&h>e[0].height*f){var n=false;var r=function(t){var r=e[t];var h=r.og.height*f,s=r.og.width*(1.5*(1/f));var o=l.textWrap().fontFamily(r.f).fontSize(r.s).lineHeight(r.lh).width(s).height(h)(r.sentence);if(!o.truncated){r.width=Math.ceil(i.max(o.lines.map(function(t){return l.textWidth(t,{"font-family":r.f,"font-size":r.s})})))+r.s;r.height=o.lines.length*(r.lh+1)}else{n=true;return"break"}};for(var s=0;s<e.length;s++){var o=r(s);if(o==="break")break}if(!n){this._wrapRows()}}else{p=[];return}};this._wrapRows=function(){var t=this;p=[];var e=1,n=0;for(var r=0;r<this._lineData.length;r++){var s=t._lineData[r],o=s.width+t._padding*(s.width?2:1)+s.shapeWidth;if(i.sum(p.map(function(t){return i.max(t,function(t){return i.max([t.height,t.shapeHeight])})}))>h){p=[];break}if(o>g){p=[];t._wrapLines();break}else if(n+o<g){n+=o}else if(t._direction!=="column"){n=o;e++}if(!p[e-1]){p[e-1]=[]}p[e-1].push(s);if(t._direction==="column"){n=0;e++}}};this._wrapRows();if(!p.length||i.sum(p,this._rowHeight.bind(this))+this._padding>h){c=i.sum(this._lineData.map(function(t){return t.shapeWidth+n._padding}))-this._padding;for(var y=0;y<this._lineData.length;y++){n._lineData[y].width=0;n._lineData[y].height=0}this._wrapRows()}if(p.length&&i.sum(p,this._rowHeight.bind(this))+this._padding<h){p.forEach(function(t,e){t.forEach(function(t){if(e){t.y=i.sum(p.slice(0,e),n._rowHeight.bind(n))}})});c=i.max(p,this._rowWidth.bind(this))}}var m=i.max(this._lineData,function(t,e){return i.max([t.height,n._fetchConfig("height",t.data,e)])+t.y})+this._titleHeight,w=c;this._outerBounds.width=w;this._outerBounds.height=m;var x=this._padding,C=this._padding;if(this._align==="center"){x=(this._width-w)/2}else if(this._align==="right"){x=this._width-this._padding-w}if(this._verticalAlign==="middle"){C=(this._height-m)/2}else if(this._verticalAlign==="bottom"){C=this._height-this._padding-m}this._outerBounds.x=x;this._outerBounds.y=C;(new l.TextBox).data(this._title?[{text:this._title}]:[]).duration(this._duration).select(this._group.node()).textAnchor({left:"start",center:"middle",right:"end"}[this._align]).width(this._width-this._padding*2).x(this._padding).y(this._outerBounds.y).config(this._titleConfig).render();this._shapes=[];var b=o.configPrep.bind(this)(this._shapeConfig,"legend"),B={id:function(t){return t.id},label:function(t){return t.label},lineHeight:function(t){return t.lH}};var H=this._data.map(function(t,i){var e={__d3plus__:true,data:t,i:i,id:n._id(t,i),label:n._lineData[i].width?n._label(t,i):false,lH:n._lineHeight(t,i),shape:n._shape(t,i)};return e});this._shapes=[];["Circle","Rect"].forEach(function(t){n._shapes.push((new a[t]).data(H.filter(function(i){return i.shape===t})).duration(n._duration).labelPadding(0).select(n._group.node()).verticalAlign("top").config(o.assign({},b,B)).render())});if(e){setTimeout(e,this._duration+100)}return this};e.prototype.active=function t(i){this._shapes.forEach(function(t){return t.active(i)});return this};e.prototype.align=function t(i){return arguments.length?(this._align=i,this):this._align};e.prototype.data=function t(i){return arguments.length?(this._data=i,this):this._data};e.prototype.direction=function t(i){return arguments.length?(this._direction=i,this):this._direction};e.prototype.duration=function t(i){return arguments.length?(this._duration=i,this):this._duration};e.prototype.height=function t(i){return arguments.length?(this._height=i,this):this._height};e.prototype.hover=function t(i){this._shapes.forEach(function(t){return t.hover(i)});return this};e.prototype.id=function t(i){return arguments.length?(this._id=i,this):this._id};e.prototype.label=function t(i){return arguments.length?(this._label=typeof i==="function"?i:o.constant(i),this):this._label};e.prototype.outerBounds=function t(){return this._outerBounds};e.prototype.padding=function t(i){return arguments.length?(this._padding=i,this):this._padding};e.prototype.select=function t(i){return arguments.length?(this._select=r.select(i),this):this._select};e.prototype.shape=function t(i){return arguments.length?(this._shape=typeof i==="function"?i:o.constant(i),this):this._shape};e.prototype.shapeConfig=function t(i){return arguments.length?(this._shapeConfig=o.assign(this._shapeConfig,i),this):this._shapeConfig};e.prototype.title=function t(i){return arguments.length?(this._title=i,this):this._title};e.prototype.titleConfig=function t(i){return arguments.length?(this._titleConfig=o.assign(this._titleConfig,i),this):this._titleConfig};e.prototype.verticalAlign=function t(i){return arguments.length?(this._verticalAlign=i,this):this._verticalAlign};e.prototype.width=function t(i){return arguments.length?(this._width=i,this):this._width};return e}(o.BaseClass);t.ckmeans=p;t.ColorScale=v;t.Legend=y;Object.defineProperty(t,"__esModule",{value:true})});
(function(t,i){typeof exports==="object"&&typeof module!=="undefined"?i(exports,require("d3-array"),require("d3-interpolate"),require("d3-scale"),require("d3-selection"),require("d3plus-axis"),require("d3plus-color"),require("d3plus-common"),require("d3plus-shape"),require("d3plus-text")):typeof define==="function"&&define.amd?define("d3plus-legend",["exports","d3-array","d3-interpolate","d3-scale","d3-selection","d3plus-axis","d3plus-color","d3plus-common","d3plus-shape","d3plus-text"],i):i(t.d3plus=t.d3plus||{},t.d3Array,t.d3Interpolate,t.d3Scale,t.d3Selection,t.d3plusAxis,t.d3plusColor,t.d3plusCommon,t.shapes,t.d3plusText)})(this,function(t,i,e,n,r,h,s,o,a,l){"use strict";function u(t){return t.slice().sort(function(t,i){return t-i})}function d(t){var i,e=0;for(var n=0;n<t.length;n++){if(n===0||t[n]!==i){i=t[n];e++}}return e}function _(t,i){var e=[];for(var n=0;n<t;n++){var r=[];for(var h=0;h<i;h++){r.push(0)}e.push(r)}return e}function c(t,i,e,n){var r;if(t>0){var h=(e[i]-e[t-1])/(i-t+1);r=n[i]-n[t-1]-(i-t+1)*h*h}else{r=n[i]-e[i]*e[i]/(i+1)}if(r<0){return 0}return r}function g(t,i,e,n,r,h,s){if(t>i){return}var o=Math.floor((t+i)/2);n[e][o]=n[e-1][o-1];r[e][o]=o;var a=e;if(t>e){a=Math.max(a,r[e][t-1]||0)}a=Math.max(a,r[e-1][o]||0);var l=o-1;if(i<n.length-1){l=Math.min(l,r[e][i+1]||0)}for(var u=l;u>=a;--u){var d=c(u,o,h,s);if(d+n[e-1][a-1]>=n[e][o]){break}var _=c(a,o,h,s);var f=_+n[e-1][a-1];if(f<n[e][o]){n[e][o]=f;r[e][o]=a}a++;var p=d+n[e-1][u-1];if(p<n[e][o]){n[e][o]=p;r[e][o]=u}}g(t,o-1,e,n,r,h,s);g(o+1,i,e,n,r,h,s)}function f(t,i,e){var n=i[0].length;var r=t[Math.floor(n/2)];var h=[];var s=[];for(var o=0,a=void 0;o<n;++o){a=t[o]-r;if(o===0){h.push(a);s.push(a*a)}else{h.push(h[o-1]+a);s.push(s[o-1]+a*a)}i[0][o]=c(0,o,h,s);e[0][o]=0}for(var l=1;l<i.length;++l){var u=n-1;if(l<i.length-1){u=l}g(u,n-1,l,i,e,h,s)}}var p=function(t,i){if(i>t.length){throw new Error("Cannot generate more classes than there are data values")}var e=u(t);var n=d(e);if(n===1){return[e]}var r=_(i,e.length),h=_(i,e.length);f(e,h,r);var s=r[0].length-1;var o=[];for(var a=r.length-1;a>=0;a--){var l=r[a][s];o[a]=e.slice(l,s+1);if(a>0){s=l-1}}return o};var v=function(t){function l(){t.call(this);this._axisClass=new h.Axis;this._axisConfig={gridSize:0};this._axisTest=new h.Axis;this._align="middle";this._color="#0C8040";this._data=[];this._duration=600;this._height=200;this._orient="bottom";this._outerBounds={width:0,height:0,x:0,y:0};this._padding=5;this._rectClass=new a.Rect;this._rectConfig={stroke:"#000",strokeWidth:1};this._scale="linear";this._size=10;this._value=o.accessor("value");this._width=400}if(t)l.__proto__=t;l.prototype=Object.create(t&&t.prototype);l.prototype.constructor=l;l.prototype.render=function t(h){var a=this;if(this._select===void 0){this.select(r.select("body").append("svg").attr("width",this._width+"px").attr("height",this._height+"px").node())}var l=["bottom","top"].includes(this._orient);var u=l?"height":"width",d=l?"width":"height",_=l?"x":"y",c=l?"y":"x";this._group=o.elem("g.d3plus-ColorScale",{parent:this._select});var g=i.extent(this._data,this._value);var f=this._color,v;if(!(f instanceof Array)){f=[s.colorLighter(f,.9),s.colorLighter(f,.75),s.colorLighter(f,.5),s.colorLighter(f,.25),f]}if(this._scale==="jenks"){var y=this._data.map(this._value).filter(function(t){return t!==null&&typeof t==="number"});if(y.length<=f.length){var m=n.scaleLinear().domain(i.range(0,y.length-1)).interpolate(e.interpolateHsl).range(f);f=y.slice(0,y.length-1).map(function(t,i){return m(i)})}var w=p(y,f.length);v=i.merge(w.map(function(t,i){return i===w.length-1?[t[0],t[t.length-1]]:[t[0]]}));this._colorScale=n.scaleThreshold().domain(v).range(["black"].concat(f).concat(f[f.length-1]))}else{var x=(g[1]-g[0])/f.length;var C=i.range(g[0],g[1]+x/2,x);if(this._scale==="buckets"){v=C}this._colorScale=n.scaleLinear().domain(C).range(f)}var b=Object.assign({domain:l?g:g.reverse(),duration:this._duration,height:this._height,labels:v,orient:this._orient,padding:this._padding,ticks:v,width:this._width},this._axisConfig);this._axisTest.select(o.elem("g.d3plus-ColorScale-axisTest",{enter:{opacity:0},parent:this._group}).node()).config(b).render();var B=this._axisTest.outerBounds();this._outerBounds[d]=this["_"+d]-this._padding*2;this._outerBounds[u]=B[u]+this._size;this._outerBounds[_]=this._padding;this._outerBounds[c]=this._padding;if(this._align==="middle"){this._outerBounds[c]=(this["_"+u]-this._outerBounds[u])/2}else if(this._align==="end"){this._outerBounds[c]=this["_"+u]-this._padding-this._outerBounds[u]}var H=this._outerBounds[c]+(["bottom","right"].includes(this._orient)?this._size:0)-(b.padding||this._axisClass.padding());this._axisClass.select(o.elem("g.d3plus-ColorScale-axis",{parent:this._group,update:{transform:"translate("+(l?0:H)+", "+(l?H:0)+")"}}).node()).config(b).align("start").render();var D=this._axisTest._d3Scale;var S=D.range();var z=this._group.selectAll("defs").data([0]);var W=z.enter().append("defs");W.append("linearGradient").attr("id","gradient-"+this._uuid);z=W.merge(z);z.select("linearGradient").attr(_+"1",l?"0%":"100%").attr(_+"2",l?"100%":"0%").attr(c+"1","0%").attr(c+"2","0%");var A=z.select("linearGradient").selectAll("stop").data(f);A.enter().append("stop").merge(A).attr("offset",function(t,i){return i/(f.length-1)*100+"%"}).attr("stop-color",String);function k(t,i){var e=Math.abs(D(v[i+1])-D(t));return e||2}this._rectClass.data(v?v.slice(0,v.length-1):[0]).id(function(t,i){return i}).select(o.elem("g.d3plus-ColorScale-Rect",{parent:this._group}).node()).config((T={fill:v?function(t){return a._colorScale(t)}:"url(#gradient-"+this._uuid+")"},T[_]=v?function(t,i){return D(t)+k(t,i)/2-(["left","right"].includes(a._orient)?k(t,i):0)}:S[0]+(S[1]-S[0])/2,T[c]=this._outerBounds[c]+(["top","left"].includes(this._orient)?B[u]:0)+this._size/2,T[d]=v?k:S[1]-S[0],T[u]=this._size,T)).config(this._rectConfig).render();var T;if(h){setTimeout(h,this._duration+100)}return this};l.prototype.axisConfig=function t(i){return arguments.length?(this._axisConfig=Object.assign(this._axisConfig,i),this):this._axisConfig};l.prototype.align=function t(i){return arguments.length?(this._align=i,this):this._align};l.prototype.color=function t(i){return arguments.length?(this._color=i,this):this._color};l.prototype.data=function t(i){return arguments.length?(this._data=i,this):this._data};l.prototype.duration=function t(i){return arguments.length?(this._duration=i,this):this._duration};l.prototype.height=function t(i){return arguments.length?(this._height=i,this):this._height};l.prototype.orient=function t(i){return arguments.length?(this._orient=i,this):this._orient};l.prototype.outerBounds=function t(){return this._outerBounds};l.prototype.padding=function t(i){return arguments.length?(this._padding=i,this):this._padding};l.prototype.rectConfig=function t(i){return arguments.length?(this._rectConfig=Object.assign(this._rectConfig,i),this):this._rectConfig};l.prototype.scale=function t(i){return arguments.length?(this._scale=i,this):this._scale};l.prototype.select=function t(i){return arguments.length?(this._select=r.select(i),this):this._select};l.prototype.size=function t(i){return arguments.length?(this._size=i,this):this._size};l.prototype.value=function t(i){return arguments.length?(this._value=typeof i==="function"?i:o.constant(i),this):this._value};l.prototype.width=function t(i){return arguments.length?(this._width=i,this):this._width};return l}(o.BaseClass);var y=function(t){function e(){var e=this;t.call(this);this._align="center";this._data=[];this._direction="row";this._duration=600;this._height=200;this._id=o.accessor("id");this._label=o.accessor("id");this._lineData=[];this._outerBounds={width:0,height:0,x:0,y:0};this._padding=5;this._shape=o.constant("Rect");this._shapeConfig={duration:this._duration,fill:o.accessor("color"),height:o.constant(10),hitArea:function(t,n){var r=e._lineData[n],h=i.max([r.height,r.shapeHeight]);return{width:r.width+r.shapeWidth,height:h,x:-r.shapeWidth/2,y:-h/2}},labelBounds:function(t,i,n){var r=e._lineData[i],h=n.r!==void 0?n.r:n.width/2;return{width:r.width,height:r.height,x:h+e._padding,y:-r.height/2}},labelConfig:{fontColor:o.constant("#444"),fontFamily:(new l.TextBox).fontFamily(),fontResize:false,fontSize:o.constant(10)},opacity:1,r:o.constant(5),width:o.constant(10),x:function(t,i){var n=e._shapeConfig.width;var r=e._lineData[i].y;var h=e._align==="left"||e._align==="right"&&e._direction==="column"?0:e._align==="center"?(e._outerBounds.width-e._rowWidth(e._lineData.filter(function(t){return r===t.y})))/2:e._outerBounds.width-e._rowWidth(e._lineData.filter(function(t){return r===t.y}));var s=e._lineData.slice(0,i).filter(function(t){return r===t.y});return e._rowWidth(s)+e._padding*(s.length?2:0)+e._outerBounds.x+n(t,i)/2+h},y:function(t,n){var r=e._shapeConfig.height;var h=e._lineData[n];return h.y+e._titleHeight+e._outerBounds.y+i.max(e._lineData.filter(function(t){return h.y===t.y}).map(function(t){return t.height}).concat(e._data.map(function(t,i){return r(t,i)})))/2}};this._titleConfig={fontFamily:"Verdana",fontSize:12,lineHeight:13};this._verticalAlign="middle";this._width=400}if(t)e.__proto__=t;e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.prototype._fetchConfig=function t(i,e,n){var r=this._shapeConfig[i]||this._shapeConfig.labelConfig[i];return typeof r==="function"?r(e,n):r};e.prototype._rowHeight=function t(e){return i.max(e.map(function(t){return t.height}).concat(e.map(function(t){return t.shapeHeight})))+this._padding};e.prototype._rowWidth=function t(e){var n=this;return i.sum(e.map(function(t,i){var r=n._padding*(i===e.length-1?0:t.width?2:1);return t.shapeWidth+t.width+r}))};e.prototype.render=function t(e){var n=this;if(this._select===void 0){this.select(r.select("body").append("svg").attr("width",this._width+"px").attr("height",this._height+"px").node())}if(this._lineHeight===void 0){this._lineHeight=function(t,i){return n._fetchConfig("fontSize",t,i)*1.1}}this._group=o.elem("g.d3plus-Legend",{parent:this._select});var h=this._height;this._titleHeight=0;if(this._title){var s=this._titleConfig.fontFamily,u=this._titleConfig.lineHeight,d=this._titleConfig.fontSize;var _=l.textWrap().fontFamily(s).fontSize(d).lineHeight(u).width(this._width).height(this._height)(this._title);this._titleHeight=u+_.lines.length+this._padding;h-=this._titleHeight}this._lineData=this._data.map(function(t,e){var r=n._fetchConfig("fontFamily",t,e),s=n._lineHeight(t,e),o=n._fetchConfig("fontSize",t,e),a=n._fetchConfig("width",t,e);var u=h-(n._data.length+1)*n._padding,d=n._width;var _=l.textWrap().fontFamily(r).fontSize(o).lineHeight(s).width(d).height(u)(n._label(t,e));_.width=Math.ceil(i.max(_.lines.map(function(t){return l.textWidth(t,{"font-family":r,"font-size":o})})))+o*.75;_.height=Math.ceil(_.lines.length*(s+1));_.og={height:_.height,width:_.width};_.data=t;_.f=r;_.s=o;_.lh=s;_.y=0;_.id=n._id(t,e);_.i=e;_.shapeWidth=a;_.shapeHeight=n._fetchConfig("height",t,e);return _});var c;var g=this._width-this._padding*2;c=this._rowWidth(this._lineData);if(this._direction==="column"||c>g){var f=1,p=[];var v=i.max(this._lineData.map(function(t){return t.words.length}));this._wrapLines=function(){var t=this;f++;if(f>v){return}var e=f===1?this._lineData.slice():this._lineData.filter(function(i){return i.width+i.shapeWidth+t._padding*(i.width?2:1)>g&&i.words.length>=f}).sort(function(t,i){return i.sentence.length-t.sentence.length});if(e.length&&h>e[0].height*f){var n=false;var r=function(t){var r=e[t];var h=r.og.height*f,s=r.og.width*(1.5*(1/f));var o=l.textWrap().fontFamily(r.f).fontSize(r.s).lineHeight(r.lh).width(s).height(h)(r.sentence);if(!o.truncated){r.width=Math.ceil(i.max(o.lines.map(function(t){return l.textWidth(t,{"font-family":r.f,"font-size":r.s})})))+r.s;r.height=o.lines.length*(r.lh+1)}else{n=true;return"break"}};for(var s=0;s<e.length;s++){var o=r(s);if(o==="break")break}if(!n){this._wrapRows()}}else{p=[];return}};this._wrapRows=function(){var t=this;p=[];var e=1,n=0;for(var r=0;r<this._lineData.length;r++){var s=t._lineData[r],o=s.width+t._padding*(s.width?2:1)+s.shapeWidth;if(i.sum(p.map(function(t){return i.max(t,function(t){return i.max([t.height,t.shapeHeight])})}))>h){p=[];break}if(o>g){p=[];t._wrapLines();break}else if(n+o<g){n+=o}else if(t._direction!=="column"){n=o;e++}if(!p[e-1]){p[e-1]=[]}p[e-1].push(s);if(t._direction==="column"){n=0;e++}}};this._wrapRows();if(!p.length||i.sum(p,this._rowHeight.bind(this))+this._padding>h){c=i.sum(this._lineData.map(function(t){return t.shapeWidth+n._padding}))-this._padding;for(var y=0;y<this._lineData.length;y++){n._lineData[y].width=0;n._lineData[y].height=0}this._wrapRows()}if(p.length&&i.sum(p,this._rowHeight.bind(this))+this._padding<h){p.forEach(function(t,e){t.forEach(function(t){if(e){t.y=i.sum(p.slice(0,e),n._rowHeight.bind(n))}})});c=i.max(p,this._rowWidth.bind(this))}}var m=i.max(this._lineData,function(t,e){return i.max([t.height,n._fetchConfig("height",t.data,e)])+t.y})+this._titleHeight,w=c;this._outerBounds.width=w;this._outerBounds.height=m;var x=this._padding,C=this._padding;if(this._align==="center"){x=(this._width-w)/2}else if(this._align==="right"){x=this._width-this._padding-w}if(this._verticalAlign==="middle"){C=(this._height-m)/2}else if(this._verticalAlign==="bottom"){C=this._height-this._padding-m}this._outerBounds.x=x;this._outerBounds.y=C;(new l.TextBox).data(this._title?[{text:this._title}]:[]).duration(this._duration).select(this._group.node()).textAnchor({left:"start",center:"middle",right:"end"}[this._align]).width(this._width-this._padding*2).x(this._padding).y(this._outerBounds.y).config(this._titleConfig).render();this._shapes=[];var b=o.configPrep.bind(this)(this._shapeConfig,"legend"),B={id:function(t){return t.id},label:function(t){return t.label},lineHeight:function(t){return t.lH}};var H=this._data.map(function(t,i){var e={__d3plus__:true,data:t,i:i,id:n._id(t,i),label:n._lineData[i].width?n._label(t,i):false,lH:n._lineHeight(t,i),shape:n._shape(t,i)};return e});this._shapes=[];["Circle","Rect"].forEach(function(t){n._shapes.push((new a[t]).data(H.filter(function(i){return i.shape===t})).duration(n._duration).labelPadding(0).select(n._group.node()).verticalAlign("top").config(o.assign({},b,B)).render())});if(e){setTimeout(e,this._duration+100)}return this};e.prototype.active=function t(i){this._shapes.forEach(function(t){return t.active(i)});return this};e.prototype.align=function t(i){return arguments.length?(this._align=i,this):this._align};e.prototype.data=function t(i){return arguments.length?(this._data=i,this):this._data};e.prototype.direction=function t(i){return arguments.length?(this._direction=i,this):this._direction};e.prototype.duration=function t(i){return arguments.length?(this._duration=i,this):this._duration};e.prototype.height=function t(i){return arguments.length?(this._height=i,this):this._height};e.prototype.hover=function t(i){this._shapes.forEach(function(t){return t.hover(i)});return this};e.prototype.id=function t(i){return arguments.length?(this._id=i,this):this._id};e.prototype.label=function t(i){return arguments.length?(this._label=typeof i==="function"?i:o.constant(i),this):this._label};e.prototype.outerBounds=function t(){return this._outerBounds};e.prototype.padding=function t(i){return arguments.length?(this._padding=i,this):this._padding};e.prototype.select=function t(i){return arguments.length?(this._select=r.select(i),this):this._select};e.prototype.shape=function t(i){return arguments.length?(this._shape=typeof i==="function"?i:o.constant(i),this):this._shape};e.prototype.shapeConfig=function t(i){return arguments.length?(this._shapeConfig=o.assign(this._shapeConfig,i),this):this._shapeConfig};e.prototype.title=function t(i){return arguments.length?(this._title=i,this):this._title};e.prototype.titleConfig=function t(i){return arguments.length?(this._titleConfig=o.assign(this._titleConfig,i),this):this._titleConfig};e.prototype.verticalAlign=function t(i){return arguments.length?(this._verticalAlign=i,this):this._verticalAlign};e.prototype.width=function t(i){return arguments.length?(this._width=i,this):this._width};return e}(o.BaseClass);t.ckmeans=p;t.ColorScale=v;t.Legend=y;Object.defineProperty(t,"__esModule",{value:true})});
{
"name": "d3plus-legend",
"version": "0.8.8",
"version": "0.8.9",
"description": "An easy to use javascript chart legend.",

@@ -27,10 +27,10 @@ "main": "build/d3plus-legend.js",

"d3-array": "^1.2.0",
"d3-interpolate": "^1.1.4",
"d3-scale": "^1.0.4",
"d3-selection": "^1.0.6",
"d3plus-axis": "^0.3.29",
"d3plus-color": "^0.6.0",
"d3plus-common": "^0.6.17",
"d3plus-shape": "^0.13.1",
"d3plus-text": "^0.9.15"
"d3-interpolate": "^1.1.5",
"d3-scale": "^1.0.6",
"d3-selection": "^1.1.0",
"d3plus-axis": "^0.3.30",
"d3plus-color": "^0.6.1",
"d3plus-common": "^0.6.21",
"d3plus-shape": "^0.13.2",
"d3plus-text": "^0.9.18"
},

@@ -37,0 +37,0 @@ "scripts": {

@@ -64,3 +64,3 @@ # d3plus-legend

<a name="ColorScale.axisConfig" href="ColorScale.axisConfig">#</a> ColorScale.**axisConfig**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L213)
<a name="ColorScale.axisConfig" href="ColorScale.axisConfig">#</a> ColorScale.**axisConfig**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L215)

@@ -72,3 +72,3 @@ If *value* is specified, sets the axis configuration of the ColorScale and returns the current class instance. If *value* is not specified, returns the current axis configuration.

<a name="ColorScale.align" href="ColorScale.align">#</a> ColorScale.**align**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L223)
<a name="ColorScale.align" href="ColorScale.align">#</a> ColorScale.**align**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L225)

@@ -80,3 +80,3 @@ If *value* is specified, sets the horizontal alignment to the specified value and returns the current class instance. If *value* is not specified, returns the current horizontal alignment.

<a name="ColorScale.color" href="ColorScale.color">#</a> ColorScale.**color**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L233)
<a name="ColorScale.color" href="ColorScale.color">#</a> ColorScale.**color**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L235)

@@ -88,3 +88,3 @@ Defines the color or colors to be used for the scale. If only a single color is given as a String, then the scale is interpolated by lightening that color. Otherwise, the function expects an Array of color values to be used in order for the scale.

<a name="ColorScale.data" href="ColorScale.data">#</a> ColorScale.**data**([*data*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L243)
<a name="ColorScale.data" href="ColorScale.data">#</a> ColorScale.**data**([*data*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L245)

@@ -96,3 +96,3 @@ If *data* is specified, sets the data array to the specified array and returns the current class instance. If *data* is not specified, returns the current data array. A shape key will be drawn for each object in the array.

<a name="ColorScale.duration" href="ColorScale.duration">#</a> ColorScale.**duration**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L253)
<a name="ColorScale.duration" href="ColorScale.duration">#</a> ColorScale.**duration**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L255)

@@ -104,3 +104,3 @@ If *value* is specified, sets the transition duration of the ColorScale and returns the current class instance. If *value* is not specified, returns the current duration.

<a name="ColorScale.height" href="ColorScale.height">#</a> ColorScale.**height**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L263)
<a name="ColorScale.height" href="ColorScale.height">#</a> ColorScale.**height**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L265)

@@ -112,3 +112,3 @@ If *value* is specified, sets the overall height of the ColorScale and returns the current class instance. If *value* is not specified, returns the current height value.

<a name="ColorScale.orient" href="ColorScale.orient">#</a> ColorScale.**orient**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L273)
<a name="ColorScale.orient" href="ColorScale.orient">#</a> ColorScale.**orient**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L275)

@@ -120,3 +120,3 @@ Sets the flow of the items inside the ColorScale. If no value is passed, the current flow will be returned.

<a name="ColorScale.outerBounds" href="ColorScale.outerBounds">#</a> ColorScale.**outerBounds**() [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L283)
<a name="ColorScale.outerBounds" href="ColorScale.outerBounds">#</a> ColorScale.**outerBounds**() [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L285)

@@ -132,3 +132,3 @@ If called after the elements have been drawn to DOM, will returns the outer bounds of the ColorScale content.

```
<a name="ColorScale.padding" href="ColorScale.padding">#</a> ColorScale.**padding**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L293)
<a name="ColorScale.padding" href="ColorScale.padding">#</a> ColorScale.**padding**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L295)

@@ -140,3 +140,3 @@ If *value* is specified, sets the padding between each key to the specified number and returns the current class instance. If *value* is not specified, returns the current padding value.

<a name="ColorScale.rectConfig" href="ColorScale.rectConfig">#</a> ColorScale.**rectConfig**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L303)
<a name="ColorScale.rectConfig" href="ColorScale.rectConfig">#</a> ColorScale.**rectConfig**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L305)

@@ -148,3 +148,3 @@ Provides access to the config method of the Rect class used to create the different rectangle color buckets.

<a name="ColorScale.scale" href="ColorScale.scale">#</a> ColorScale.**scale**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L313)
<a name="ColorScale.scale" href="ColorScale.scale">#</a> ColorScale.**scale**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L315)

@@ -156,3 +156,3 @@ If *value* is specified, sets the scale of the ColorScale and returns the current class instance. If *value* is not specified, returns the current scale value.

<a name="ColorScale.select" href="ColorScale.select">#</a> ColorScale.**select**([*selector*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L323)
<a name="ColorScale.select" href="ColorScale.select">#</a> ColorScale.**select**([*selector*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L325)

@@ -164,3 +164,3 @@ If *selector* is specified, sets the SVG container element to the specified d3 selector or DOM element and returns the current class instance. If *selector* is not specified, returns the current SVG container element.

<a name="ColorScale.size" href="ColorScale.size">#</a> ColorScale.**size**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L333)
<a name="ColorScale.size" href="ColorScale.size">#</a> ColorScale.**size**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L335)

@@ -172,3 +172,3 @@ The height of horizontal color scales, and width when positioned vertical.

<a name="ColorScale.value" href="ColorScale.value">#</a> ColorScale.**value**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L347)
<a name="ColorScale.value" href="ColorScale.value">#</a> ColorScale.**value**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L349)

@@ -186,3 +186,3 @@ If *value* is specified, sets the value accessor to the specified function or string and returns the current class instance. If *value* is not specified, returns the current value accessor.

```
<a name="ColorScale.width" href="ColorScale.width">#</a> ColorScale.**width**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L357)
<a name="ColorScale.width" href="ColorScale.width">#</a> ColorScale.**width**([*value*]) [<>](https://github.com/d3plus/d3plus-legend/blob/master/src/ColorScale.js#L359)

@@ -377,2 +377,2 @@ If *value* is specified, sets the overall width of the ColorScale and returns the current class instance. If *value* is not specified, returns the current width value.

###### <sub>Documentation generated on Wed, 24 May 2017 16:36:35 GMT</sub>
###### <sub>Documentation generated on Thu, 22 Jun 2017 17:51:10 GMT</sub>

@@ -111,2 +111,3 @@ /**

ticks = merge(jenks.map((c, i) => i === jenks.length - 1 ? [c[0], c[c.length - 1]] : [c[0]]));
this._colorScale = scaleThreshold()

@@ -185,3 +186,4 @@ .domain(ticks)

function bucketWidth(d, i) {
return Math.abs(axisScale(ticks[i + 1]) - axisScale(d));
const w = Math.abs(axisScale(ticks[i + 1]) - axisScale(d));
return w || 2;
}

@@ -188,0 +190,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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