@redsift/d3-rs-theme
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -7,3 +7,3 @@ (function (global, factory) { | ||
var version = "0.4.1"; | ||
var version = "0.4.2"; | ||
@@ -343,2 +343,6 @@ var L_TH = 64; | ||
function interopDefault(ex) { | ||
return ex && typeof ex === 'object' && 'default' in ex ? ex['default'] : ex; | ||
} | ||
function createCommonjsModule(fn, module) { | ||
@@ -455,3 +459,3 @@ return module = { exports: {} }, fn(module, module.exports), module.exports; | ||
var BezierEasing = (index && typeof index === 'object' && 'default' in index ? index['default'] : index); | ||
var BezierEasing = interopDefault(index); | ||
@@ -622,3 +626,2 @@ var duration = 400; | ||
blur = 0.6, | ||
sharpness = -0.1, | ||
strength = 0.8; | ||
@@ -644,3 +647,3 @@ | ||
.attr('type', 'discrete') | ||
.attr('tableValues', "0.0 0.08 0.75 1.0"); | ||
.attr('tableValues', "0.0 0.18 0.75 1.0"); | ||
}); | ||
@@ -652,13 +655,6 @@ | ||
filter.append('feComponentTransfer') | ||
.attr('result', 'TRANSFER') | ||
.append('feFuncA') | ||
.attr('type', 'discrete'); | ||
filter.append('feConvolveMatrix') | ||
.attr('result', 'SHARP') | ||
.attr('order', '3, 3') | ||
.attr('preserveAlpha', true) | ||
.attr('kernelMatrix', " 1 -1 1 " + | ||
"-1 " + sharpness + " -1 " + | ||
" 1 -1 1"); | ||
filter.append('feFlood') | ||
@@ -673,3 +669,3 @@ .attr('rect', '') | ||
filter.append('feBlend') | ||
.attr('in', 'SHARP') | ||
.attr('in', 'TRANSFER') | ||
.attr('in2', 'FILL') | ||
@@ -676,0 +672,0 @@ .attr('mode', 'multiply'); |
@@ -1,2 +0,2 @@ | ||
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(t.d3_rs_theme=t.d3_rs_theme||{})}(this,function(t){"use strict";function r(t){var r=t[0]/255,e=t[1]/255,n=t[2]/255;r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var a=.4124*r+.3576*e+.1805*n,i=.2126*r+.7152*e+.0722*n,o=.0193*r+.1192*e+.9505*n;return[100*a,100*i,100*o]}function e(t){var e,n,a,i=r(t),o=i[0],u=i[1],f=i[2];return o/=95.047,u/=100,f/=108.883,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,u=u>.008856?Math.pow(u,1/3):7.787*u+16/116,f=f>.008856?Math.pow(f,1/3):7.787*f+16/116,e=116*u-16,n=500*(o-u),a=200*(u-f),[e,n,a]}function n(t){var r,e,n,a,i=t[0],o=t[1],u=t[2];return i<=8?(e=100*i/903.3,a=7.787*(e/100)+16/116):(e=100*Math.pow((i+16)/116,3),a=Math.pow(e/100,1/3)),r=r/95.047<=.008856?r=95.047*(o/500+a-16/116)/7.787:95.047*Math.pow(o/500+a,3),n=n/108.883<=.008859?n=108.883*(a-u/200-16/116)/7.787:108.883*Math.pow(a-u/200,3),[r,e,n]}function a(t){var r,e,n,a=t[0]/100,i=t[1]/100,o=t[2]/100;return r=3.2406*a+i*-1.5372+o*-.4986,e=a*-.9689+1.8758*i+.0415*o,n=.0557*a+i*-.204+1.057*o,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r*=12.92,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,r=Math.min(Math.max(0,r),1),e=Math.min(Math.max(0,e),1),n=Math.min(Math.max(0,n),1),[255*r,255*e,255*n]}function i(t){return a(n(t)).map(function(t){return Math.round(t)})}function o(t){return"#"+t[0].toString(16)+t[1].toString(16)+t[2].toString(16)}function u(t){var r=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(r,function(t,r,e,n){return r+r+e+e+n+n});var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:[0,0,0]}function f(t){if("string"==typeof t||t instanceof String)return Math.abs(t.split("").reduce(function(t,r){return t=(t<<5)-t+r.charCodeAt(0),t&t},0));if("number"==typeof t){var r=t%1;if(0===r)return t}return null}function l(t,r){("string"==typeof t||t instanceof String)&&(t=u(t));var n=e(t);return n[0]=n[0]*r,i(n)}function s(t,r){return null==r&&(r=Math.random),function(e){var n=f(e);return null==n?n=Math.floor(r()*t.length):n%=t.length,t[n]}}function c(t,r){return r={exports:{}},t(r,r.exports),r.exports}function d(){return P(.175,.885,.335,1.155)}function h(t,r,e,n){function a(i){var o=i.selection?i.selection():i,u=void 0!==i.selection,f=o.select("defs");f.empty()&&(f=o.append("defs"));var l=f.select(a.self());l.empty()&&(l=f.append("filter").attr("filterUnits","objectBoundingBox").attr("x","0%").attr("y","0%").attr("width","100%").attr("height","100%").attr("id",t),r(l)),e(l),u===!0&&(l=l.transition(i)),n(l)}return a.id=function(){return t},a.self=function(){return"#"+t},a.url=function(){return"url(#"+t+")"},a.css=function(){return"fill: "+a.url()+";"},a}function p(t){var r=1,e=R.light.shadow,n=3,a="10";null==t&&(t="filter-shadow-"+D,D++);var i=h(t,function(t){t.append("feMorphology").attr("operator","dilate").attr("in","SourceAlpha").attr("result","TEMPLATE"),t.append("feFlood").attr("result","COLOUR"),t.append("feComposite").attr("in","COLOUR").attr("in2","TEMPLATE").attr("operator","in").attr("result","TEMPLATE_COLOUR"),t.append("feGaussianBlur").attr("result","BG");var r=t.append("feMerge");r.append("feMergeNode").attr("in","BG"),r.append("feMergeNode").attr("in","SourceGraphic")},function(t){t.attr("x","-"+a+"%").attr("y","-"+a+"%").attr("width",2*a+100+"%").attr("height",2*a+100+"%")},function(t){t.select("feMorphology").attr("radius",r),t.select("feFlood").attr("flood-color",e),t.select("feGaussianBlur").attr("stdDeviation",n)});return i.morphRadius=function(t){return arguments.length?(r=t,i):r},i.color=function(t){return arguments.length?(e=t,i):e},i.blurRadius=function(t){return arguments.length?(n=t,i):n},i.padding=function(t){return arguments.length?(a=t,i):a},i}function g(t){var r=1;null==t&&(t="filter-greyscale-"+D,D++);var e=h(t,function(t){t.append("feColorMatrix").attr("type","matrix")},function(){},function(t){var e=1/3,n=e*r,a=1-2*n;t.select("feColorMatrix").attr("values",a+" "+n+" "+n+" 0 0 "+n+" "+a+" "+n+" 0 0 "+n+" "+n+" "+a+" 0 0 0 0 0 1 0")});return e.strength=function(t){return arguments.length?(r=t,e):r},e}function m(t){var r=L.standard[L.names.grey],e=.6,n=-.1,a=.8;null==t&&(t="filter-emboss-"+D,D++);var i=h(t,function(t){t.append("feColorMatrix").attr("type","matrix").attr("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0");var r=t.append("feComponentTransfer");["feFuncR","feFuncG","feFuncB"].forEach(function(t){r.append(t).attr("type","discrete").attr("tableValues","0.0 0.08 0.75 1.0")}),t.append("feGaussianBlur").attr("stdDeviation",e),t.append("feComponentTransfer").append("feFuncA").attr("type","discrete"),t.append("feConvolveMatrix").attr("result","SHARP").attr("order","3, 3").attr("preserveAlpha",!0).attr("kernelMatrix"," 1 -1 1 -1 "+n+" -1 1 -1 1"),t.append("feFlood").attr("rect","").attr("x","0%").attr("y","0%").attr("width","100%").attr("height","100%").attr("result","FILL"),t.append("feBlend").attr("in","SHARP").attr("in2","FILL").attr("mode","multiply")},function(){},function(t){t.select("feFlood").attr("flood-color",r),t.select("feFuncA").attr("tableValues","0.0 "+a)});return i.color=function(t){return arguments.length?(r=t,i):r},i.strength=function(t){return arguments.length?(a=t,i):a},i}function w(t){function r(o){var l=o.selection?o.selection():o,s=l.select("defs");s.empty()&&(s=l.append("defs"));var c=t+"-inner",d=s.select("#"+c);d.empty()&&(d=s.append("pattern").attr("id",c).attr("x",0).attr("y",0).attr("patternUnits","userSpaceOnUse"),d.append("rect")),d.attr("width",e).attr("height",e).attr("patternTransform","rotate("+n+")"),d.select("rect").attr("x",i).attr("y",i).attr("width",a).attr("height",a).attr("fill",f);var h=s.select(r.self());h.empty()&&(h=s.append("pattern").attr("id",t).attr("x",0).attr("y",0).attr("width","100%").attr("height","100%").attr("patternUnits","objectBoundingBox"),h.append("rect").attr("class","pattern-background").attr("x",0).attr("y",0).attr("width","100%").attr("height","100%"),h.append("rect").attr("class","pattern-foreground").attr("x",0).attr("y",0).attr("width","100%").attr("height","100%").attr("fill","url(#"+c+")")),h.select("rect.pattern-background").attr("fill",u)}var e=8,n=45,a=5,i=(e-a)/2,o=2*Math.sqrt(e),u="transparent",f=R.light.highlight;return null==t&&(t="pattern-diagonals-"+H,H++),r.id=function(){return t},r.self=function(){return"#"+t},r.size=function(){return o},r.align=function(t){return Math.round(o*Math.ceil(t/o))},r.url=function(){return"url(#"+t+")"},r.css=function(){return"fill: "+r.url()+";"},r.foreground=function(t){return arguments.length?(f=t,r):f},r.background=function(t){return arguments.length?(u=t,r):u},r}function y(t,r){function e(r){var l=r.selection?r.selection():r,s=l.select("defs");s.empty()&&(s=l.append("defs"));var c=s.select(e.self());c.empty()&&(c=s.append("pattern").attr("id",t).attr("patternUnits","userSpaceOnUse"),c.append("rect").attr("class","pattern-background"),c.append("rect").attr("class","pattern-foreground")),c.attr("width",n).attr("height",n).attr("patternTransform","translate("+a*Math.sin(o*(Math.PI/180))+",0),rotate("+o+")"),c.select("rect.pattern-background").attr("width",n).attr("height",n).attr("fill",u),c.select("rect.pattern-foreground").attr("width",a).attr("height",i).attr("fill",f)}null==r&&(r={});var n=r.size||4,a=r.width||3,i=r.height||3,o=r.angle||45,u="transparent",f=R.light.highlight;return null==t&&(t="pattern-diagonals-"+H,H++),e.id=function(){return t},e.self=function(){return"#"+t},e.url=function(){return"url(#"+t+")"},e.css=function(){return"fill: "+e.url()+";"},e.size=function(t){return arguments.length?(n=t,e):n},e.width=function(t){return arguments.length?(a=t,e):a},e.height=function(t){return arguments.length?(i=t,e):i},e.angle=function(t){return arguments.length?(o=t,e):o},e.foreground=function(t){return arguments.length?(f=t,e):f},e.background=function(t){return arguments.length?(u=t,e):u},e}function v(t){return t<414?"12px":"14px"}var b="0.4.1",M=64,x={lightness:l,light:function(t){return o(l(t,1.6))},medium:function(t){return o(l(t,1.3))}},F={white:function(t){("string"==typeof t||t instanceof String)&&(t=u(t));var r=e(t);return r[0]<M}},C={lightness:function(t){var r=t.map(function(t){var r=t;return Array.isArray(t)||(r=u(t)),[e(r),t]}),n=r.sort(function(t,r){return t[0][0]<r[0][0]?-1:t[0][0]>r[0][0]?-1:0});return n.map(function(t){return t[1]})}},A=["#00ce5c","#d800a2","#00d9d2","#AF5100","#bfbfbf","#DE0000","#F0DE00","#9200ff","#ED9200","#00aeff"],S=["#56d58e","#d95cba","#63eae4","#C78348","#d6d6d6","#E06363","#FFF741","#965ede","#FCBB54","#73c5eb"],k=["#a5e6c3","#eda3da","#9af8f4","#EDC19C","#e5e5e5","#F5AAAA","#F7EFC3","#c6a8ef","#F8D296","#addbf0"],E={green:0,pink:1,aqua:2,brown:3,grey:4,red:5,yellow:6,purple:7,orange:8,blue:9},z={standard:S,darker:A,lighter:k,names:E},B=["#e11010","#0ab93a","#1671f4","#cacaca"],I=["#6a0000","#087927","#0b49a2","#828282"],U={red:0,green:1,blue:2,grey:3},L={standard:B,darker:I,names:U},O=["light","dark"],R={light:{background:"#ffffff",text:"#262626",axis:"#262626",grid:"#e0e0e0",highlight:"rgba(225,16,16,0.5)",lowlight:"rgba(127,127,127,0.3)",shadow:"rgba(127,127,127,0.4)",fillOpacity:.33,negative:{background:"rgba(0, 0, 0, 0.66)",text:"#ffffff"}},dark:{background:"#333333",text:"#ffffff",axis:"#ffffff",grid:"#6d6d6d",highlight:"rgba(225,16,16,0.5)",lowlight:"rgba(127,127,127,0.5)",shadow:"rgba(255,255,255,0.4)",fillOpacity:.33,negative:{background:"rgba(255, 255, 255, 0.85)",text:"#262626"}}},T=c(function(t){function r(t,r){return 1-3*r+3*t}function e(t,r){return 3*r-6*t}function n(t){return 3*t}function a(t,a,i){return((r(a,i)*t+e(a,i))*t+n(a))*t}function i(t,a,i){return 3*r(a,i)*t*t+2*e(a,i)*t+n(a)}function o(t,r,e,n,i){var o,u,f=0;do u=r+(e-r)/2,o=a(u,n,i)-t,o>0?e=u:r=u;while(Math.abs(o)>s&&++f<c);return u}function u(t,r,e,n){for(var o=0;o<f;++o){var u=i(r,e,n);if(0===u)return r;var l=a(r,e,n)-t;r-=l/u}return r}var f=4,l=.001,s=1e-7,c=10,d=11,h=1/(d-1),p="function"==typeof Float32Array;t.exports=function(t,r,e,n){function f(r){for(var n=0,a=1,f=d-1;a!==f&&s[a]<=r;++a)n+=h;--a;var c=(r-s[a])/(s[a+1]-s[a]),p=n+c*h,g=i(p,t,e);return g>=l?u(r,p,t,e):0===g?p:o(r,n,n+h,t,e)}if(!(0<=t&&t<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");var s=p?new Float32Array(d):new Array(d);if(t!==r||e!==n)for(var c=0;c<d;++c)s[c]=a(c*h,t,e);return function(i){return t===r&&e===n?i:0===i?0:1===i?1:a(f(i),r,n)}}}),P=T&&"object"==typeof T&&"default"in T?T["default"]:T,j=400,D=1,G=33.75,_={diagonal1:{angle:G,width:5,height:4,size:5},diagonal2:{angle:G,width:5,height:2,size:5},diagonal3:{angle:G,width:5,height:3,size:5},crosshatch1:{angle:45,width:4,height:4,size:5},crosshatch2:{angle:45,width:3,height:4,size:5},crosshatch3:{angle:45,width:3,height:3,size:5},blocks:{angle:0,width:3,height:4,size:5},redsift:{angle:G,width:3,height:3,size:5}},H=1,W={outline:.5,data:2.5,axis:1,grid:2},q={grid:"2,2"},N='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',V={fixed:{cssImport:"@import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:300,500);",weightMonochrome:300,weightColor:500,sizeForWidth:v,family:'"Source Code Pro", Consolas, "Liberation Mono", Menlo, Courier, monospace'},variable:{cssImport:"@import url(https://fonts.googleapis.com/css?family=Raleway:400,500);",weightMonochrome:400,weightColor:500,sizeForWidth:v,family:'"Raleway", "Trebuchet MS", '+N},brand:{cssImport:"@import url(https://fonts.googleapis.com/css?family=Electrolize);",weightMonochrome:400,weightColor:400,sizeForWidth:v,family:'"Electrolize", '+N}};t.version=b,t.transform=x,t.random=s,t.contrasts=F,t.sort=C,t.themes=O,t.presentation10=z,t.brand=L,t.display=R,t.duration=j,t.easing=d,t.shadow=p,t.greyscale=g,t.emboss=m,t.angle=G,t.patterns=_,t.diagonals=y,t.highlights=w,t.widths=W,t.dashes=q,t.fonts=V,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(t.d3_rs_theme=t.d3_rs_theme||{})}(this,function(t){"use strict";function r(t){var r=t[0]/255,e=t[1]/255,n=t[2]/255;r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var a=.4124*r+.3576*e+.1805*n,i=.2126*r+.7152*e+.0722*n,o=.0193*r+.1192*e+.9505*n;return[100*a,100*i,100*o]}function e(t){var e,n,a,i=r(t),o=i[0],u=i[1],f=i[2];return o/=95.047,u/=100,f/=108.883,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,u=u>.008856?Math.pow(u,1/3):7.787*u+16/116,f=f>.008856?Math.pow(f,1/3):7.787*f+16/116,e=116*u-16,n=500*(o-u),a=200*(u-f),[e,n,a]}function n(t){var r,e,n,a,i=t[0],o=t[1],u=t[2];return i<=8?(e=100*i/903.3,a=7.787*(e/100)+16/116):(e=100*Math.pow((i+16)/116,3),a=Math.pow(e/100,1/3)),r=r/95.047<=.008856?r=95.047*(o/500+a-16/116)/7.787:95.047*Math.pow(o/500+a,3),n=n/108.883<=.008859?n=108.883*(a-u/200-16/116)/7.787:108.883*Math.pow(a-u/200,3),[r,e,n]}function a(t){var r,e,n,a=t[0]/100,i=t[1]/100,o=t[2]/100;return r=3.2406*a+i*-1.5372+o*-.4986,e=a*-.9689+1.8758*i+.0415*o,n=.0557*a+i*-.204+1.057*o,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r*=12.92,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,r=Math.min(Math.max(0,r),1),e=Math.min(Math.max(0,e),1),n=Math.min(Math.max(0,n),1),[255*r,255*e,255*n]}function i(t){return a(n(t)).map(function(t){return Math.round(t)})}function o(t){return"#"+t[0].toString(16)+t[1].toString(16)+t[2].toString(16)}function u(t){var r=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(r,function(t,r,e,n){return r+r+e+e+n+n});var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:[0,0,0]}function f(t){if("string"==typeof t||t instanceof String)return Math.abs(t.split("").reduce(function(t,r){return t=(t<<5)-t+r.charCodeAt(0),t&t},0));if("number"==typeof t){var r=t%1;if(0===r)return t}return null}function l(t,r){("string"==typeof t||t instanceof String)&&(t=u(t));var n=e(t);return n[0]=n[0]*r,i(n)}function s(t,r){return null==r&&(r=Math.random),function(e){var n=f(e);return null==n?n=Math.floor(r()*t.length):n%=t.length,t[n]}}function c(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function d(t,r){return r={exports:{}},t(r,r.exports),r.exports}function h(){return D(.175,.885,.335,1.155)}function p(t,r,e,n){function a(i){var o=i.selection?i.selection():i,u=void 0!==i.selection,f=o.select("defs");f.empty()&&(f=o.append("defs"));var l=f.select(a.self());l.empty()&&(l=f.append("filter").attr("filterUnits","objectBoundingBox").attr("x","0%").attr("y","0%").attr("width","100%").attr("height","100%").attr("id",t),r(l)),e(l),u===!0&&(l=l.transition(i)),n(l)}return a.id=function(){return t},a.self=function(){return"#"+t},a.url=function(){return"url(#"+t+")"},a.css=function(){return"fill: "+a.url()+";"},a}function g(t){var r=1,e=O.light.shadow,n=3,a="10";null==t&&(t="filter-shadow-"+P,P++);var i=p(t,function(t){t.append("feMorphology").attr("operator","dilate").attr("in","SourceAlpha").attr("result","TEMPLATE"),t.append("feFlood").attr("result","COLOUR"),t.append("feComposite").attr("in","COLOUR").attr("in2","TEMPLATE").attr("operator","in").attr("result","TEMPLATE_COLOUR"),t.append("feGaussianBlur").attr("result","BG");var r=t.append("feMerge");r.append("feMergeNode").attr("in","BG"),r.append("feMergeNode").attr("in","SourceGraphic")},function(t){t.attr("x","-"+a+"%").attr("y","-"+a+"%").attr("width",2*a+100+"%").attr("height",2*a+100+"%")},function(t){t.select("feMorphology").attr("radius",r),t.select("feFlood").attr("flood-color",e),t.select("feGaussianBlur").attr("stdDeviation",n)});return i.morphRadius=function(t){return arguments.length?(r=t,i):r},i.color=function(t){return arguments.length?(e=t,i):e},i.blurRadius=function(t){return arguments.length?(n=t,i):n},i.padding=function(t){return arguments.length?(a=t,i):a},i}function m(t){var r=1;null==t&&(t="filter-greyscale-"+P,P++);var e=p(t,function(t){t.append("feColorMatrix").attr("type","matrix")},function(){},function(t){var e=1/3,n=e*r,a=1-2*n;t.select("feColorMatrix").attr("values",a+" "+n+" "+n+" 0 0 "+n+" "+a+" "+n+" 0 0 "+n+" "+n+" "+a+" 0 0 0 0 0 1 0")});return e.strength=function(t){return arguments.length?(r=t,e):r},e}function w(t){var r=U.standard[U.names.grey],e=.6,n=.8;null==t&&(t="filter-emboss-"+P,P++);var a=p(t,function(t){t.append("feColorMatrix").attr("type","matrix").attr("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0");var r=t.append("feComponentTransfer");["feFuncR","feFuncG","feFuncB"].forEach(function(t){r.append(t).attr("type","discrete").attr("tableValues","0.0 0.18 0.75 1.0")}),t.append("feGaussianBlur").attr("stdDeviation",e),t.append("feComponentTransfer").attr("result","TRANSFER").append("feFuncA").attr("type","discrete"),t.append("feFlood").attr("rect","").attr("x","0%").attr("y","0%").attr("width","100%").attr("height","100%").attr("result","FILL"),t.append("feBlend").attr("in","TRANSFER").attr("in2","FILL").attr("mode","multiply")},function(){},function(t){t.select("feFlood").attr("flood-color",r),t.select("feFuncA").attr("tableValues","0.0 "+n)});return a.color=function(t){return arguments.length?(r=t,a):r},a.strength=function(t){return arguments.length?(n=t,a):n},a}function y(t){function r(o){var l=o.selection?o.selection():o,s=l.select("defs");s.empty()&&(s=l.append("defs"));var c=t+"-inner",d=s.select("#"+c);d.empty()&&(d=s.append("pattern").attr("id",c).attr("x",0).attr("y",0).attr("patternUnits","userSpaceOnUse"),d.append("rect")),d.attr("width",e).attr("height",e).attr("patternTransform","rotate("+n+")"),d.select("rect").attr("x",i).attr("y",i).attr("width",a).attr("height",a).attr("fill",f);var h=s.select(r.self());h.empty()&&(h=s.append("pattern").attr("id",t).attr("x",0).attr("y",0).attr("width","100%").attr("height","100%").attr("patternUnits","objectBoundingBox"),h.append("rect").attr("class","pattern-background").attr("x",0).attr("y",0).attr("width","100%").attr("height","100%"),h.append("rect").attr("class","pattern-foreground").attr("x",0).attr("y",0).attr("width","100%").attr("height","100%").attr("fill","url(#"+c+")")),h.select("rect.pattern-background").attr("fill",u)}var e=8,n=45,a=5,i=(e-a)/2,o=2*Math.sqrt(e),u="transparent",f=O.light.highlight;return null==t&&(t="pattern-diagonals-"+W,W++),r.id=function(){return t},r.self=function(){return"#"+t},r.size=function(){return o},r.align=function(t){return Math.round(o*Math.ceil(t/o))},r.url=function(){return"url(#"+t+")"},r.css=function(){return"fill: "+r.url()+";"},r.foreground=function(t){return arguments.length?(f=t,r):f},r.background=function(t){return arguments.length?(u=t,r):u},r}function v(t,r){function e(r){var l=r.selection?r.selection():r,s=l.select("defs");s.empty()&&(s=l.append("defs"));var c=s.select(e.self());c.empty()&&(c=s.append("pattern").attr("id",t).attr("patternUnits","userSpaceOnUse"),c.append("rect").attr("class","pattern-background"),c.append("rect").attr("class","pattern-foreground")),c.attr("width",n).attr("height",n).attr("patternTransform","translate("+a*Math.sin(o*(Math.PI/180))+",0),rotate("+o+")"),c.select("rect.pattern-background").attr("width",n).attr("height",n).attr("fill",u),c.select("rect.pattern-foreground").attr("width",a).attr("height",i).attr("fill",f)}null==r&&(r={});var n=r.size||4,a=r.width||3,i=r.height||3,o=r.angle||45,u="transparent",f=O.light.highlight;return null==t&&(t="pattern-diagonals-"+W,W++),e.id=function(){return t},e.self=function(){return"#"+t},e.url=function(){return"url(#"+t+")"},e.css=function(){return"fill: "+e.url()+";"},e.size=function(t){return arguments.length?(n=t,e):n},e.width=function(t){return arguments.length?(a=t,e):a},e.height=function(t){return arguments.length?(i=t,e):i},e.angle=function(t){return arguments.length?(o=t,e):o},e.foreground=function(t){return arguments.length?(f=t,e):f},e.background=function(t){return arguments.length?(u=t,e):u},e}function b(t){return t<414?"12px":"14px"}var M="0.4.2",x=64,F={lightness:l,light:function(t){return o(l(t,1.6))},medium:function(t){return o(l(t,1.3))}},C={white:function(t){("string"==typeof t||t instanceof String)&&(t=u(t));var r=e(t);return r[0]<x}},A={lightness:function(t){var r=t.map(function(t){var r=t;return Array.isArray(t)||(r=u(t)),[e(r),t]}),n=r.sort(function(t,r){return t[0][0]<r[0][0]?-1:t[0][0]>r[0][0]?-1:0});return n.map(function(t){return t[1]})}},E=["#00ce5c","#d800a2","#00d9d2","#AF5100","#bfbfbf","#DE0000","#F0DE00","#9200ff","#ED9200","#00aeff"],S=["#56d58e","#d95cba","#63eae4","#C78348","#d6d6d6","#E06363","#FFF741","#965ede","#FCBB54","#73c5eb"],k=["#a5e6c3","#eda3da","#9af8f4","#EDC19C","#e5e5e5","#F5AAAA","#F7EFC3","#c6a8ef","#F8D296","#addbf0"],z={green:0,pink:1,aqua:2,brown:3,grey:4,red:5,yellow:6,purple:7,orange:8,blue:9},B={standard:S,darker:E,lighter:k,names:z},R=["#e11010","#0ab93a","#1671f4","#cacaca"],T=["#6a0000","#087927","#0b49a2","#828282"],I={red:0,green:1,blue:2,grey:3},U={standard:R,darker:T,names:I},L=["light","dark"],O={light:{background:"#ffffff",text:"#262626",axis:"#262626",grid:"#e0e0e0",highlight:"rgba(225,16,16,0.5)",lowlight:"rgba(127,127,127,0.3)",shadow:"rgba(127,127,127,0.4)",fillOpacity:.33,negative:{background:"rgba(0, 0, 0, 0.66)",text:"#ffffff"}},dark:{background:"#333333",text:"#ffffff",axis:"#ffffff",grid:"#6d6d6d",highlight:"rgba(225,16,16,0.5)",lowlight:"rgba(127,127,127,0.5)",shadow:"rgba(255,255,255,0.4)",fillOpacity:.33,negative:{background:"rgba(255, 255, 255, 0.85)",text:"#262626"}}},j=d(function(t){function r(t,r){return 1-3*r+3*t}function e(t,r){return 3*r-6*t}function n(t){return 3*t}function a(t,a,i){return((r(a,i)*t+e(a,i))*t+n(a))*t}function i(t,a,i){return 3*r(a,i)*t*t+2*e(a,i)*t+n(a)}function o(t,r,e,n,i){var o,u,f=0;do u=r+(e-r)/2,o=a(u,n,i)-t,o>0?e=u:r=u;while(Math.abs(o)>s&&++f<c);return u}function u(t,r,e,n){for(var o=0;o<f;++o){var u=i(r,e,n);if(0===u)return r;var l=a(r,e,n)-t;r-=l/u}return r}var f=4,l=.001,s=1e-7,c=10,d=11,h=1/(d-1),p="function"==typeof Float32Array;t.exports=function(t,r,e,n){function f(r){for(var n=0,a=1,f=d-1;a!==f&&s[a]<=r;++a)n+=h;--a;var c=(r-s[a])/(s[a+1]-s[a]),p=n+c*h,g=i(p,t,e);return g>=l?u(r,p,t,e):0===g?p:o(r,n,n+h,t,e)}if(!(0<=t&&t<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");var s=p?new Float32Array(d):new Array(d);if(t!==r||e!==n)for(var c=0;c<d;++c)s[c]=a(c*h,t,e);return function(i){return t===r&&e===n?i:0===i?0:1===i?1:a(f(i),r,n)}}}),D=c(j),G=400,P=1,_=33.75,N={diagonal1:{angle:_,width:5,height:4,size:5},diagonal2:{angle:_,width:5,height:2,size:5},diagonal3:{angle:_,width:5,height:3,size:5},crosshatch1:{angle:45,width:4,height:4,size:5},crosshatch2:{angle:45,width:3,height:4,size:5},crosshatch3:{angle:45,width:3,height:3,size:5},blocks:{angle:0,width:3,height:4,size:5},redsift:{angle:_,width:3,height:3,size:5}},W=1,q={outline:.5,data:2.5,axis:1,grid:2},V={grid:"2,2"},$='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',H={fixed:{cssImport:"@import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:300,500);",weightMonochrome:300,weightColor:500,sizeForWidth:b,family:'"Source Code Pro", Consolas, "Liberation Mono", Menlo, Courier, monospace'},variable:{cssImport:"@import url(https://fonts.googleapis.com/css?family=Raleway:400,500);",weightMonochrome:400,weightColor:500,sizeForWidth:b,family:'"Raleway", "Trebuchet MS", '+$},brand:{cssImport:"@import url(https://fonts.googleapis.com/css?family=Electrolize);",weightMonochrome:400,weightColor:400,sizeForWidth:b,family:'"Electrolize", '+$}};t.version=M,t.transform=F,t.random=s,t.contrasts=C,t.sort=A,t.themes=L,t.presentation10=B,t.brand=U,t.display=O,t.duration=G,t.easing=h,t.shadow=g,t.greyscale=m,t.emboss=w,t.angle=_,t.patterns=N,t.diagonals=v,t.highlights=y,t.widths=q,t.dashes=V,t.fonts=H,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=d3-rs-theme.umd-es2015.min.js.map |
{ | ||
"name": "@redsift/d3-rs-theme", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Package for the Red Sift default color palette, fonts, curves and patterns.", | ||
@@ -41,3 +41,3 @@ "keywords": [ | ||
"gulp-sourcemaps": "^2.0.0-alpha", | ||
"gulp-uglify": "^1.5.4", | ||
"gulp-uglify": "^2.0.0", | ||
"gulp-util": "^3.0.7", | ||
@@ -47,3 +47,3 @@ "rollup": "^0.34.1", | ||
"rollup-plugin-json": "^2.0.0", | ||
"rollup-plugin-node-resolve": "^1.7.1", | ||
"rollup-plugin-node-resolve": "^2.0.0", | ||
"rollup-plugin-commonjs": "^3.1.0", | ||
@@ -50,0 +50,0 @@ "rollup-stream": "^1.11.0", |
@@ -161,3 +161,2 @@ import { display, brand } from './palettes' | ||
blur = 0.6, | ||
sharpness = -0.1, | ||
strength = 0.8; | ||
@@ -183,3 +182,3 @@ | ||
.attr('type', 'discrete') | ||
.attr('tableValues', `0.0 0.08 0.75 1.0`); | ||
.attr('tableValues', `0.0 0.18 0.75 1.0`); | ||
}); | ||
@@ -191,13 +190,6 @@ | ||
filter.append('feComponentTransfer') | ||
.attr('result', 'TRANSFER') | ||
.append('feFuncA') | ||
.attr('type', 'discrete'); | ||
filter.append('feConvolveMatrix') | ||
.attr('result', 'SHARP') | ||
.attr('order', '3, 3') | ||
.attr('preserveAlpha', true) | ||
.attr('kernelMatrix', ` 1 -1 1 ` + | ||
`-1 ${sharpness} -1 ` + | ||
` 1 -1 1`); | ||
filter.append('feFlood') | ||
@@ -212,3 +204,3 @@ .attr('rect', '') | ||
filter.append('feBlend') | ||
.attr('in', 'SHARP') | ||
.attr('in', 'TRANSFER') | ||
.attr('in2', 'FILL') | ||
@@ -215,0 +207,0 @@ .attr('mode', 'multiply'); |
Sorry, the diff of this file is not supported yet
1051869
1697