Socket
Socket
Sign inDemoInstall

@domoinc/utilities

Package Overview
Dependencies
Maintainers
6
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@domoinc/utilities - npm Package Compare versions

Comparing version 4.1.0 to 4.2.0

2

Bookends/start.js
var d3 = require('d3');
var i18n = require('i18n');
var i18n = require('@domoinc/i18n');
var da = {};
module.exports = da;
{
"name": "utilities",
"main": "dist/bundle.js",
"version": "4.1.0",
"version": "4.2.0",
"authors": [

@@ -6,0 +6,0 @@ "Nick Randall <nick.randall@domo.com>"

@@ -37,10 +37,51 @@ /*

var dragBoth = d3.behavior.drag()
.on("drag", scrollBoth);
var dragX = d3.behavior.drag()
.on("drag", scrollX);
var dragY = d3.behavior.drag()
.on("drag", scrollY);
var normalizedScroll = (function() {
function getScrollAmount(event) {
var normalScalar = {};
var init = {};
function validProp(event, props) {
for (var i = 0; i < props.length; i++) {
if (event[props[i]]) return event[props[i]];
}
}
function getNormalizedDelta(coord) {
normalScalar[coord] = 0;
init[coord] = true;
var props = ['delta' + coord.toUpperCase(), 'wheelDelta' + coord.toUpperCase()]
return function(event, sensitivity) {
var delta = validProp(event, props);
if (!delta) return 0;
if (init[coord]) {
normalScalar[coord] = (Math.abs(delta) || 1);
delete init[coord]
}
/*
Trackpad input appears to sometimes be an integer while scroll wheel input is always a decimal.
Integer input is consistent across browsers so simply return the original delta.
*/
if (delta % 1 === 0) {
return delta;
}
if (!sensitivity) sensitivity = 4;
return -sensitivity * delta / normalScalar[coord];
}
}
return {
dx: getNormalizedDelta('x'),
dy: getNormalizedDelta('y')
}
})();
function getScrollAmount(event, sensitivity) {
var elem;

@@ -55,6 +96,4 @@ var bBox;

}
dx = d3.event.deltaX !== undefined ? -d3.event.deltaX : d3.event.wheelDeltaX;
dy = d3.event.deltaY !== undefined ? -d3.event.deltaY : d3.event.wheelDeltaY;
if (dx === undefined) dx = 0;
if (dy === undefined) dy = 0;
dx = normalizedScroll.dx(d3.event, sensitivity);
dy = normalizedScroll.dy(d3.event, sensitivity);
} else {

@@ -69,31 +108,9 @@ dx = d3.event.dx;

x = currentX + dx;
if (x > 0) {
x = 0;
atEdge.left = true;
} else {
atEdge.left = false;
}
if (x < viewWidth - contentWidth) {
x = viewWidth - contentWidth;
atEdge.right = true;
} else {
atEdge.right = false;
}
atEdge.left = x > 0 ? true : false;
atEdge.right = x < viewWidth - contentWidth ? true : false;
}
if (contentHeight > viewHeight) {
y = currentY + dy;
if (y > 0) {
y = 0;
atEdge.top = true;
} else {
atEdge.top = false;
}
if (y < viewHeight - contentHeight) {
y = viewHeight - contentHeight;
atEdge.bottom = true;
} else {
atEdge.bottom = false;
}
atEdge.top = y > 0 ? true : false;
atEdge.bottom = y < viewHeight - contentHeight ? true : false;
}

@@ -113,23 +130,25 @@

function scrollBoth(event) {
var amount = getScrollAmount(event);
svgScroll(amount);
}
function calcScrollAmountThenApply(modifier, sensitivity) {
return function(event) {
var amount = getScrollAmount(event, sensitivity);
function scrollX(event) {
var amount = getScrollAmount(event);
amount.y = currentY;
svgScroll(amount);
}
if (modifier) {
amount = modifier(amount);
}
function scrollY(event) {
var amount = getScrollAmount(event);
amount.x = currentX;
svgScroll(amount);
}
scrollInBounds(amount);
}
}
function forceScrollInBounds() {
function scrollInBounds(amount) {
if (!amount) {
amount = {
x: currentX,
y: currentY
};
}
svgScroll({
x: Math.min(0, Math.max(currentX, viewWidth - contentWidth)),
y: Math.min(0, Math.max(currentY, viewHeight - contentHeight))
x: Math.min(0, Math.max(amount.x, viewWidth - contentWidth)),
y: Math.min(0, Math.max(amount.y, viewHeight - contentHeight))
});

@@ -144,3 +163,3 @@ }

currentY = amount.y;
for (elem in sync) {
for (var elem in sync) {
element = sync[elem];

@@ -157,3 +176,3 @@ isSvg = /svg/.test(element.node()

}
for (elem in syncX) {
for (var elem in syncX) {
element = syncX[elem];

@@ -170,3 +189,3 @@ isSvg = /svg/.test(element.node()

}
for (elem in syncY) {
for (var elem in syncY) {
element = syncY[elem];

@@ -326,3 +345,3 @@ isSvg = /svg/.test(element.node()

for (elem in allSync) {
for (var elem in allSync) {
var element = allSync[elem];

@@ -345,3 +364,3 @@ var rect = element.selectAll('rect.scrollBackground')

for (elem in allSync) {
for (var elem in allSync) {
var element = allSync[elem];

@@ -363,50 +382,50 @@ var rect = element.selectAll('rect.scrollBackground')

svgScroll.sync = function(x) {
if (!arguments.length) return sync;
sync.push(x);
svgScroll.resize();
//If user scrolls on mouse then call scroll function
x.on('wheel', scrollBoth);
// For Safari
x.on('mousewheel', scrollBoth);
// allow drag event for mobile devices
if (draggable) {
x.call(dragBoth);
}
var syncAxis = {
x: {
array: syncX,
scrollAmountModifier: function(amount) {
amount.y = currentY;
return amount;
}
},
y: {
array: syncY,
scrollAmountModifier: function(amount) {
amount.x = currentX;
return amount;
}
},
both: {
array: sync,
scrollAmountModifier: null
}
}
return svgScroll;
};
function syncInit(axis) {
return function(x, sensitivity) {
svgScroll.syncX = function(x) {
if (!arguments.length) return syncX;
syncX.push(x);
svgScroll.resize();
//If user scrolls on mouse then call scroll function
x.on('wheel', scrollX);
// For Safari
x.on('mousewheel', scrollX);
// allow drag event for mobile devices
if (draggable) {
x.call(dragX);
}
if (!arguments.length) return syncAxis[axis].array;
syncAxis[axis].array.push(x);
return svgScroll;
};
var listener = calcScrollAmountThenApply(syncAxis[axis].scrollAmountModifier, sensitivity);
svgScroll.syncY = function(x) {
if (!arguments.length) return syncY;
syncY.push(x);
svgScroll.resize();
//If user scrolls on mouse then call scroll function
x.on('wheel', scrollY);
// For Safari
x.on('mousewheel', scrollY);
// allow drag event for mobile devices
if (draggable) {
x.call(dragY);
}
//If user scrolls on mouse then call scroll function
x.on('wheel', listener);
// For Safari
x.on('mousewheel', listener);
// allow drag event for mobile devices
if (draggable) {
x.call(d3.behavior.drag().on('drag', listener));
}
return svgScroll;
};
return svgScroll;
}
}
svgScroll.sync = syncInit('both');
svgScroll.syncX = syncInit('x');
svgScroll.syncY = syncInit('y');
svgScroll.resize = function() {

@@ -456,3 +475,3 @@ var allSync = sync.concat(syncX)

contentWidth = maxBBox.width;
forceScrollInBounds();
scrollInBounds();

@@ -459,0 +478,0 @@ for (elem in allSync) {

{
"name": "@domoinc/utilities",
"version": "4.1.0",
"version": "4.2.0",
"main": "dist/bundle.js",

@@ -12,4 +12,7 @@ "dependencies": {

"grunt-autoshot": "^0.2.1",
"grunt-contrib-concat": "^0.3.0",
"grunt-contrib-connect": "^0.7.1",
"grunt-contrib-jshint": "~0.7.2",
"grunt-contrib-nodeunit": "*",
"grunt-contrib-uglify": "^0.2.7",
"grunt-contrib-watch": "~0.5.3",

@@ -16,0 +19,0 @@ "grunt-notify": "^0.3.0",

@@ -1,3 +0,3 @@

/*! 2016-01-26
/*! 2016-01-28
* Copyright (c) 2016 Domo Apps Team;*/
function domoUtilTruncateStringToNumCharacters(a,b,c){console.warn("The domoUtilTruncateStringToNumCharacters method has been deprecated. Use d3.domoStrings.trunc instead.");var d=a.length>b,e=d?a.substr(0,b-1):a;return e=c&&d?e.substr(0,e.lastIndexOf(" ")):e,d?e+"...":e}var d3=require("d3"),i18n=require("i18n"),da={};if(module.exports=da,d3.avatar=function(a,b,c,d){function e(){j.style("opacity",1),n.style("opacity",0),m.style("opacity",0)}function f(){j.style("opacity",0),n.style("opacity",1),m.style("opacity",1)}function g(a){return a.split(" ").map(function(a){return a.charAt(0)}).join("").toUpperCase()}var h,i=a.node(),j=d3.select(i),k=i.getBBox();h="number"==typeof d?d+"px":"string"==typeof d?d:"14px";var l=d3.select(i.parentNode),m=l.selectAll("rect.imageCover").data([c]);m.enter().append("rect").attr({"class":"imageCover",x:k.x,y:k.y,width:k.width,height:k.height}).style({fill:"#e4e5e5"}),m.attr({x:k.x,y:k.y,width:k.width,height:k.height});var n=l.selectAll("text.nameInitials").data([c]);n.enter().append("text").text(g(c)).style({fill:"#8a8d8f","font-size":h,"font-weight":400,"font-family":"Open Sans","text-anchor":"middle","pointer-events":"none"}).attr({"class":"nameInitials",x:k.x+k.width/2,y:k.y+k.height/2,dy:function(a){return.35*parseInt(d3.select(this).style("font-size"),10)}}),n.attr({x:k.x+k.width/2,y:k.y+k.height/2}).text(function(a){return g(a)}),a.tween&&a.tween("size",function(){var a=n.style("font-size"),b=d3.interpolate(a,h);return function(a){var c=i.getBBox();m.attr(c),n.style({"font-size":b(a)}).attr({x:c.x+c.width/2,y:c.y+c.height/2,dy:function(a){return.35*parseInt(d3.select(this).style("font-size"),10)}})}});var o=new Image;return o.addEventListener("load",e,!1),o.addEventListener("error",f,!1),o.src=b,j.attr("xlink:href",o.src),this},d3.browser={getInternetExplorerVersion:function(){var a=-1;if("Microsoft Internet Explorer"==navigator.appName){var b=navigator.userAgent,c=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");null!=c.exec(b)&&(a=parseFloat(RegExp.$1))}else if("Netscape"==navigator.appName){var b=navigator.userAgent,c=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})");null!=c.exec(b)&&(a=parseFloat(RegExp.$1))}return a}},da.CalcRGBWithAlphaOnBackground=function(a,b,c){var d=0,e=0,f=0;return d=Math.floor(b*a.r+(1-b)*c.r),e=Math.floor(b*a.g+(1-b)*c.g),f=Math.floor(b*a.b+(1-b)*c.b),"rgb("+d+","+e+","+f+")"},d3.DomoCaretRect=function(a,b,c,d,e,f){return void 0===e&&(e=0),void 0===f&&(f=0),void 0===a&&(a=100),void 0===b&&(b=50),void 0===c&&(c=5),void 0===d&&(d=10),"M"+e+","+f+"l"+-d/2+" "+-(d/2)+"h"+(c-(a/2-d/2))+"a"+c+","+c+" 0 0 1 "+-c+","+-c+"v"+(-b+2*c)+"a"+c+","+c+" 0 0 1 "+c+","+-c+"h"+(a-2*c)+"a"+c+","+c+" 0 0 1 "+c+","+c+"v"+(b-2*c)+"a"+c+","+c+" 0 0 1 "+-c+","+c+"h"+(c-(a/2-d/2))+"l"+-d/2+" "+d/2+"z"},d3.DomoCatigoryIndexGenerator=function(a,b){function c(a,b){var c=[];c.push([-2,0]);for(var d=Math.floor((a[1]-a[0])/b),e=a[0],f=0;b-1>f;f++)c.push([e,e+d]),e+=d;return c.push([e,a[1]+1]),c}var d={numCategories:a,range:b,rangeForEachCatigory:null,getCatigoryIndexForValue:function(a){if(null==d.rangeForEachCatigory&&(d.rangeForEachCatigory=c(d.range,d.numCategories)),void 0==a)return 0;for(var b=0;b<d.rangeForEachCatigory.length;b++)if(d.rangeForEachCatigory[b][0]<=a&&a<d.rangeForEachCatigory[b][1])return b;return console.log("Error: returning index of catigory wasn't found for value:"+a),-1},updateCatigoryRanges:function(a,b){d.range=b,d.numCategories=a,d.rangeForEachCatigory=c(b,a)}};return d},d3.DomoClipPath=function(){function a(){var a=d3.selectAll("[id^="+b+"]").size();return b+"_"+a}var b="DomoClipPath",c={clipsId:null,recentRect:null,appendNewDefsAndDomoClipPath:function(b,d,e){return c.clipsId=a(),c.recentRect=e.append("defs").append("clipPath").attr("id",c.clipsId).append("rect").attr("x",0).attr("y",0),c.updateHeightAndWidthOfClippingRect(b,d),c},getTheRecentlyAppendedDomoClipPathsId:function(){return c.clipsId},updateHeightAndWidthOfClippingRect:function(a,b){return c.height=0>a?0:a,c.width=0>b?0:b,null==c.recentRect?void console.log("clipIt recentRect not set."):void c.recentRect.attr("height",c.height).attr("width",c.width)}};return c},d3.DomoColorRange=function(a){if(4>=a)return{primary:["#73B0D7","#BBE491","#FB8D34","#E45621"].slice(0,a),secondary:["#D9EBFD","#387B26","#FDECAD","#FDECAD"].slice(0,a)};if(17>=a){var b={5:{primary:["#73B0D7","#A0D771","#559E38","#FBAD56","#E45621"],secondary:["#D9EBFD","#DDF4BA","#DDF4BA","#FDECAD","#FDECAD"]},6:{primary:["#90c4e4","#4E8CBA","#A0D771","#559E38","#FBAD56","#E45621"],secondary:["#D9EBFD","#D9EBFD","#DDF4BA","#DDF4BA","#FDECAD","#FDECAD"]},7:{primary:["#90c4e4","#4E8CBA","#A0D771","#559E38","#FCCF84","#E45621","#FB8D34"],secondary:["#D9EBFD","#D9EBFD","#DDF4BA","#DDF4BA","#A43724","#FDECAD","#FDECAD"]},8:{primary:["#90c4e4","#4E8CBA","#BBE491","#559E38","#80C25D","#FCCF84","#E45621","#FB8D34"],secondary:["#D9EBFD","#D9EBFD","#387B26","#DDF4BA","#DDF4BA","#A43724","#FDECAD","#FDECAD"]},9:{primary:["#B7DAF5","#4E8CBA","#73B0D7","#BBE491","#559E38","#80C25D","#FCCF84","#E45621","#FB8D34"],secondary:["#31689B","#D9EBFD","#D9EBFD","#387B26","#DDF4BA","#DDF4BA","#A43724","#FDECAD","#FDECAD"]},10:{primary:["#B7DAF5","#4E8CBA","#73B0D7","#BBE491","#559E38","#80C25D","#FDECAD","#FB8D34","#FCCF84","#E45621"],secondary:["#31689B","#D9EBFD","#D9EBFD","#387B26","#DDF4BA","#DDF4BA","#E45621","#FDECAD","#A43724","#FDECAD"]},11:{primary:["#B7DAF5","#4E8CBA","#73B0D7","#DDF4BA","#80C25D","#BBE491","#559E38","#FDECAD","#FB8D34","#FCCF84","#E45621"],secondary:["#31689B","#D9EBFD","#D9EBFD","#559E38","#DDF4BA","#387B26","#DDF4BA","#E45621","#FDECAD","#A43724","#FDECAD"]},12:{primary:["#D9EBFD","#73B0D7","#B7DAF5","#4E8CBA","#DDF4BA","#80C25D","#BBE491","#559E38","#FDECAD","#FB8D34","#FCCF84","#E45621"],secondary:["#4E8CBA","#D9EBFD","#31689B","#D9EBFD","#559E38","#DDF4BA","#387B26","#DDF4BA","#E45621","#FDECAD","#A43724","#FDECAD"]},13:{primary:["#D9EBFD","#73B0D7","#B7DAF5","#4E8CBA","#DDF4BA","#80C25D","#BBE491","#559E38","#FDECAD","#FB8D34","#FCCF84","#E45621","#FBAD56"],secondary:["#4E8CBA","#D9EBFD","#31689B","#D9EBFD","#559E38","#DDF4BA","#387B26","#DDF4BA","#E45621","#FDECAD","#A43724","#FDECAD","#FDECAD"]},14:{primary:["#D9EBFD","#73B0D7","#B7DAF5","#4E8CBA","#DDF4BA","#80C25D","#BBE491","#559E38","#A0D771","#FDECAD","#FB8D34","#FCCF84","#E45621","#FBAD56"],secondary:["#4E8CBA","#D9EBFD","#31689B","#D9EBFD","#559E38","#DDF4BA","#387B26","#DDF4BA","#DDF4BA","#E45621","#FDECAD","#A43724","#FDECAD","#FDECAD"]},15:{primary:["#D9EBFD","#73B0D7","#B7DAF5","#4E8CBA","#90c4e4","#DDF4BA","#80C25D","#BBE491","#559E38","#A0D771","#FDECAD","#FB8D34","#FCCF84","#E45621","#FBAD56"],secondary:["#4E8CBA","#D9EBFD","#31689B","#D9EBFD","#D9EBFD","#559E38","#DDF4BA","#387B26","#DDF4BA","#DDF4BA","#E45621","#FDECAD","#A43724","#FDECAD","#FDECAD"]},16:{primary:["#D9EBFD","#73B0D7","#B7DAF5","#4E8CBA","#90c4e4","#DDF4BA","#80C25D","#BBE491","#559E38","#A0D771","#FDECAD","#FB8D34","#FCCF84","#E45621","#FBAD56","#A43724"],secondary:["#4E8CBA","#D9EBFD","#31689B","#D9EBFD","#D9EBFD","#559E38","#DDF4BA","#387B26","#DDF4BA","#DDF4BA","#E45621","#FDECAD","#A43724","#FDECAD","#FDECAD","#FDECAD"]},17:{primary:["#D9EBFD","#73B0D7","#B7DAF5","#4E8CBA","#90c4e4","#DDF4BA","#80C25D","#BBE491","#559E38","#A0D771","#387B26","#FDECAD","#FB8D34","#FCCF84","#E45621","#FBAD56","#A43724"],secondary:["#4E8CBA","#D9EBFD","#31689B","#D9EBFD","#D9EBFD","#559E38","#DDF4BA","#387B26","#DDF4BA","#DDF4BA","#DDF4BA","#E45621","#FDECAD","#A43724","#FDECAD","#FDECAD","#FDECAD"]}};return b[a]}return{primary:["#D9EBFD","#73B0D7","#B7DAF5","#4E8CBA","#90c4e4","#31689B","#DDF4BA","#80C25D","#BBE491","#559E38","#A0D771","#387B26","#FDECAD","#FB8D34","#FCCF84","#E45621","#FBAD56","#A43724","#F3E4FE","#B391CA","#DDC8EF","#8F6DC0","#C5ACDE","#7940A1","#FCD7E6","#EE76BF","#FBB6DD","#CF51AC","#F395CD","#A62A92","#D8F4DE","#68BEA8","#ABE4CA","#46998A","#8DD5BE","#227872","#FDDDDD","#FCBCB7","#FD9A93","#FD7F76","#E45850","#C92E25","#F1F2F2","#CACBCC","#B0B1B2","#959899","#7B7E80","#54585A"].slice(0,a),secondary:["#4E8CBA","#D9EBFD","#31689B","#D9EBFD","#D9EBFD","#D9EBFD","#559E38","#DDF4BA","#387B26","#DDF4BA","#DDF4BA","#DDF4BA","#E45621","#FDECAD","#A43724","#FDECAD","#FDECAD","#FDECAD","#8F6DC0","#F3E4FE","#7940A1","#F3E4FE","#F3E4FE","#F3E4FE","#CF51AC","#FCD7E6","#A62A92","#FCD7E6","#FCD7E6","#FCD7E6","#46998A","#D8F4DE","#227872","#D8F4DE","#D8F4DE","#D8F4DE","#FD7F76","#E45850","#C92E25","#FDDDDD","#FCBCB7","#FD9A93","#959899","#7B7E80","#54585A","#F1F2F2","#CACBCC","#B0B1B2"].slice(0,a)}},d3.appendDomoFormattedNumberTextElementToContainer=function(a){var b=a.append("text");return b.append("tspan").attr("id","largeTspan").classed("largeTspan",!0),b.append("tspan").attr("id","smallTspan").classed("smallTspan",!0),b},d3.setDomoFormattedTextElement=function(a,b,c,d,e,f){var g=a.select("#largeTspan"),h=a.select("#smallTspan"),i=i18n.summaryNumberToObject(c);g.style("font-size",d+"px").text(b+String(i.prefix)),h.style("font-size",f+"px").text(i.magnitude+" "+e)},d3.DomoFormatNumber=function(a){return i18n.summaryNumber(a)},d3.DomoGetFontSizeToFitTextInBounds=function(a,b,c,d){for(var e=["14px","10px","8px","0.1px"],f=e.indexOf(d)||0,g=5,h=null;f<e.length&&(a.style("font-size",e[f]),h=a.node().getBBox(),!(h.width<b-g&&h.height<c-g));)f++;return e[f]},d3.DomoGetFontSizeToFitTextInBoundsStartAtSize=function(a,b,c,d){for(var e=5,f=null;d>0&&(a.style("font-size",d+"px"),f=a.node().getBBox(),!(f.width<b-e&&f.height<c-e));)d-=2;return 0>d?0:d},d3.domoIcons={pencil:function(a){return a.append("path").style("fill","#CBCBCC").attr({d:"M10.2,2.9l-8.8,8.8h0l0,0h0l0,0L0,16l4.3-1.4l0,0l0,0l0,0l0,0l8.8-8.8L10.2,2.9z M3.4,12.1l-0.5-0.5l7.2-7.2l0.5,0.5L3.4,12.1z"}),a.append("rect").attr({x:12.2,y:.4,width:3.3,height:4,transform:"matrix(0.707 -0.7072 0.7072 0.707 2.2664 10.3121)"}).style({fill:"#CBCBCC",width:2.7,height:4.1}),a.append("rect").attr({width:17,height:17,opacity:0}).style({fill:"#ffddff"}),a},funnel:function(a){return a.append("path").style({fill:"#444"}).attr({d:"M87.5,27.292c0-6.944-16.789-12.576-37.501-12.576c-20.71,0-37.499,5.632-37.499,12.576c0,0.148,0.018,0.294,0.033,0.441 c-0.006,0.035-0.033,0.046-0.033,0.09c0,0.665,0,1.77,0,2.454c0,0.686,0.324,1.571,0.72,1.968c0.396,0.396,1.441,1.445,2.325,2.331 l27.111,27.188c0,8.948,0,19.865,0,20.237c0,0.634,1.196,3.283,7.345,3.283c6.147,0,7.343-2.489,7.343-3.283 c0-0.467,0-11.375,0-20.294l27.399-27.424c0.883-0.886,1.865-1.868,2.183-2.184c0.314-0.317,0.574-1.043,0.574-1.615 s0-1.678,0-2.455c0-0.069-0.034-0.095-0.046-0.149C87.481,27.685,87.5,27.489,87.5,27.292z M49.999,20.472 c18.605,0,29.207,4.472,31.473,6.82c-2.266,2.349-12.867,6.82-31.473,6.82c-18.604,0-29.205-4.472-31.47-6.82 C20.794,24.943,31.395,20.472,49.999,20.472z"}),a},magnifyingGlass:function(a){return a.append("path").style({fill:"rgb(138, 141, 143)"}).attr({d:"M16.6,15.1c1.2-1.6,2-3.5,2-5.6c0-5-4.1-9.1-9.1-9.1 S0.4,4.4,0.4,9.4s4.1,9.1,9.1,9.1c2.1,0,4.1-0.7,5.6-2l5.1,5.1c0.4,0.4,1,0.4,1.4,0l0.1-0.1c0.4-0.4,0.4-1,0-1.4L16.6,15.1z M9.5,16.6c-4,0-7.2-3.2-7.2-7.2s3.2-7.2,7.2-7.2s7.2,3.2,7.2,7.2S13.4,16.6,9.5,16.6z"}),a},diamond:function(a,b){return a.append("polygon").attr("points","4,0 0,5 4,10 8,5"),void 0===b?a.attr("fill","#CBCBCC"):a.attr(b),a},help:function(){console.log("d3.DomoIcons.pencil( element ): Draws a light grey pencil icon and returns the element passed in.\nExample:\n d3.DomoIcons.pencil( d3.select('g') )\n .attr('transform', 'translate(10,10)');")}},d3.DomoNumberCleanup=function(a,b){var c=d3.DomoFormatNum(+a,b);return c[0]+c[1]},d3.DomoFormatNum=function(a,b){function c(a,b,c){(void 0===c||3>c)&&(c=3);var d=a+"",e=d.indexOf(".");if(-1===e)return[d,b];var f=d.substring(e+1,d.length);f.length>2&&(f=f.substring(0,2));for(var g=d.substring(0,e),h=g+f,i=0;h.length>c&&5e3>i;){var j=h.length-1;h=h.substring(0,j),i++}return h=h.substring(0,e)+"."+h.substring(e,h.length),h.length-1===h.indexOf(".")&&(h=h.substring(0,h.length-1)),[h,b]}return void 0===b&&(b=3),a>=1e15?c(+a/1e15,"Q",b):a>=1e12?c(+a/1e12,"T",b):a>=1e9?c(+a/1e9,"B",b):a>=1e6?c(+a/1e6,"M",b):a>=1e3?c(+a/1e3,"K",b):c(+a,"",b)},d3.roundedRect=function(a,b,c,d,e,f,g,h,i){var j;return j="M"+(a+e)+","+b,j+="h"+(c-2*e),g?j+="a"+e+","+e+" 0 0 1 "+e+","+e:(j+="h"+e,j+="v"+e),j+="v"+(d-2*e),i?j+="a"+e+","+e+" 0 0 1 "+-e+","+e:(j+="v"+e,j+="h"+-e),j+="h"+(2*e-c),h?j+="a"+e+","+e+" 0 0 1 "+-e+","+-e:(j+="h"+-e,j+="v"+-e),j+="v"+(2*e-d),f?j+="a"+e+","+e+" 0 0 1 "+e+","+-e:(j+="v"+-e,j+="h"+e),j+="z"},d3.shapeToGrid=function(a){var b=a.selectAll("path"),c=0,d=d3.select("#defs");b.each(function(){c++;for(var b=this.getBBox(),e=(a.node().getBBox(),d3.select(this).attr("d")),f=d3.select(this).style("fill"),g=d3.select(this.parentNode),h=(d.append("clipPath").attr("id","clip"+c).append("path").attr("d",e),g.append("g").attr("clip-path","url(#clip"+c+")")),i=Math.ceil(b.width/5)+1,j=Math.ceil(b.height/5)+1,k=5*Math.floor(b.x/5),l=5*Math.floor(b.y/5),m=0;j>m;m++)for(var n=0;i>n;n++)h.append("circle").attr("cx",5*n+2.5+k).attr("cy",5*m+2.5+l).attr("r",2).style("fill",f);d3.select(this).remove()})},d3.domoStrings={trunc:function(a,b,c){var d=a.length>b,e=d?a.substr(0,b-1):a;return e=c&&d?e.substr(0,e.lastIndexOf(" ")):e,e=d?e+"...":e},truncToFitVertical:function(a,b){padding=5;var c=!1;str=a.text(),tempBox=a.node().getBoundingClientRect();for(var d=str.length;d>=0&&(a.text(str),tempbox=a.node().getBoundingClientRect(),b-padding<tempbox.height);d--)str=str.substr(0,str.length-1),c=!0;c===!0&&(str=str.substr(0,str.length-1)+"...",a.text(str))},truncToFit:function(a,b){padding=5;var c=!1;str=a.text(),tempBox=a.node().getBoundingClientRect();for(var d=str.length;d>=0&&(a.text(str),tempbox=a.node().getBoundingClientRect(),b-padding<tempbox.width);d--)str=str.substr(0,str.length-1),c=!0;c===!0&&(str=str.substr(0,str.length-1)+"...",a.text(str))},shrinkToFit:function(a,b,c,d){var e,f=5;if(d){for(;d>6&&(a.style("font-size",d+"px"),e=a.node().getBoundingClientRect(),!(e.width<b-f&&e.height<c-f));)d-=2;8>d&&a.style("font-size","0px")}else{for(var g=["14px","12px","10px","8px","0px"],h=0;h!==g.length-1&&(a.style("font-size",g[h]+"px"),e=a.node().getBoundingClientRect(),!(e.width<b-f&&e.height<c-f));)h++;h===g.length-1&&a.style("font-size","0px")}},shrinkToTrunc:function(a,b,c,d,e){str=a.text();var f,g=5;if(d){for(;d>6&&(a.style("font-size",d+"px"),f=a.node().getBoundingClientRect(),!(f.width<b-g&&f.height<c-g));)d-=2;8>d&&(a.style("font-size","8px"),d3.domoStrings.truncToFit(a,b))}else{for(var h=["14px","12px","10px","8px","0px"],i=0;i!==h.length-1&&(a.style("font-size",h[i]+"px"),f=a.node().getBoundingClientRect(),!(f.width<b-g&&f.height<c-g));)i++;i===h.length-1&&(a.style("font-size","8px"),d3.domoStrings.truncToFit(a,b))}},wrapText:function(a,b){var c=5,d=a.text(),e=a.node().getBoundingClientRect().height,f=d.split(" ");if(!(f.length<=1)){for(var g=[],h=f[0],i=h,j=1;j<f.length;j++){i+=" "+f[j],a.text(i);var k=a.node().getBoundingClientRect();k.width<=b-c?h=i:(g.push(h),h=f[j],i=h),j===f.length-1&&g.push(h)}for(a.text(""),j=0;j<g.length;j++){var l=a.append("tspan").text(g[j]);j>0&&l.attr({x:"0px",dy:e+"px"})}}},help:function(){console.log('d3.domoStrings is an object of functions that will alter strings with font shrinking and truncating.\n\ntrunc(string, characters, useWordBoundary): The string to modify and the characters you want to truncate to.\nEx: .text(function(d){ return d3.domoStrings.trunc(d.name, 25)\n\ntruncToFit(textElement, width): textElement is the d3 selection of the text element and width is the width that you want the element to fit inside after truncating.\nEx: d3.selectAll("text").each(function(){ return d3.domoStrings.truncToFit(d3.select(this), 45); });\n\nshrinkToFit(textElement, width, height, size): textElement is the d3 selection of the text element, width is the target width to shrink to, height is the target height, size is the starting size of the font.\nEx: Ex: d3.selectAll("text").each(function(){ return d3.domoStrings.shrinkToFit(d3.select(this), 45, 25, 10); });\n\nshrinkToTrunc(textElement, width, size): textElement is the d3 selection of the text element, width is the target width to shrink to and size is used if you want to define a starting font size to shrink from. If size is null sizes start at 14\nEx: d3.selectAll("text").each(function(){ return d3.domoStrings.truncToFit(d3.select(this), 45, 18); });')}},d3.rightAlignText=function(a){var b=a.node().getBBox();return a.attr("text-anchor","end").attr("transform",function(){return d3.select(this).attr("transform")+"translate("+b.width+",0)"}),a},d3.centerAlignText=function(a){return a.attr("text-anchor","middle").attr("transform",function(){var b=a.node().getBBox();return d3.select(this).attr("transform")+"translate("+b.width/2+",0)"}),a},d3.DomoTransitionEndAll=function(a,b){var c=0;a.each(function(){++c}).each("end",function(){--c||b.apply(this,arguments)})},da.DomoUniqueIdFromPrefix=function(a){function b(a){for(var b=[],d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=d.length,f=0;a>f;++f)b.push(d[c(0,e-1)]);return b.join("")}function c(a,b){return Math.floor(Math.random()*(b-a+1))+a}function d(){return(new Date).getTime()}function e(a){return a+"_"+d()+b(100)+"_"}return e(a)},d3.DomoUniqueIdFromPrefix=da.DomoUniqueIdFromPrefix,d3.scroll=function(){function a(a){var b,c;"drag"!==d3.event.type?(d3.event.stopPropagation&&d3.event.stopPropagation(),b=void 0!==d3.event.deltaX?-d3.event.deltaX:d3.event.wheelDeltaX,c=void 0!==d3.event.deltaY?-d3.event.deltaY:d3.event.wheelDeltaY,void 0===b&&(b=0),void 0===c&&(c=0)):(b=d3.event.dx,c=d3.event.dy);var d=0,e=0;return m>k&&(d=r+b,d>0?(d=0,i.left=!0):i.left=!1,k-m>d?(d=k-m,i.right=!0):i.right=!1),l>j&&(e=s+c,e>0?(e=0,i.top=!0):i.top=!1,j-l>e?(e=j-l,i.bottom=!0):i.bottom=!1),f.dispatch.scrolling(i),(!i.top&&!i.bottom||v)&&g(a),{x:d,y:e}}function b(b){var c=a(b);f(c)}function c(b){var c=a(b);c.y=s,f(c)}function d(b){var c=a(b);c.x=r,f(c)}function e(){f({x:Math.min(0,Math.max(r,k-m)),y:Math.min(0,Math.max(s,j-l))})}function f(a){if(t){var b,c;r=a.x,s=a.y;for(elem in o)c=o[elem],b=/svg/.test(c.node().namespaceURI),b?c.attr("transform","translate("+a.x+", "+a.y+")"):(c.style("transform","translate("+a.x+"px, "+a.y+"px)"),c.style("-webkit-transform","translate("+a.x+"px, "+a.y+"px)"),c.style("-ms-transform","translate("+a.x+"px, "+a.y+"px)"));for(elem in p)c=p[elem],b=/svg/.test(c.node().namespaceURI),b?c.attr("transform","translate("+a.x+", 0)"):(c.style("transform","translate("+a.x+"px, 0px)"),c.style("-webkit-transform","translate("+a.x+"px, 0px)"),c.style("-ms-transform","translate("+a.x+"px, 0px)"));for(elem in q)c=q[elem],b=/svg/.test(c.node().namespaceURI),b?c.attr("transform","translate(0, "+a.y+")"):(c.style("transform","translate(0px, "+a.y+"px)"),c.style("-webkit-transform","translate(0px, "+a.y+"px)"),c.style("-ms-transform","translate(0px, "+a.y+"px)"))}}function g(a){a=d3.event,a.preventDefault&&a.preventDefault(),a.returnValue=!1}var h,i={},j=582,k=1064,l=582,m=1064,n=!0,o=[],p=[],q=[],r=0,s=0,t=!0,u=!1,v=!1,w=d3.behavior.drag().on("drag",b),x=d3.behavior.drag().on("drag",c),y=d3.behavior.drag().on("drag",d);return f.preventDefault=function(a){return v=a===!0,f},f.dispatch=d3.dispatch("scrolling"),f.introAnimation=function(a){return h=a,f},f.run=function(a){a=a?a:h;var b,c,d,e,g=f.sync(),i={},n={},o={},p=a.axis?a.axis:"default",q=a.directionY?a.directionY:"top",r=a.directionX?a.directionX:"left",s=a.duration?a.duration:1e3,t=a.delay?a.delay:0;if(u=void 0!==a.runOnce?a.runOnce:u,!u){switch(p){case"x":g=g.concat(f.syncX()),i.x=-(m-k),i.x=m>k?i.x:0,i.y=0,"right"===r?(d="translate(0,0)",e="translate("+i.x+",0)"):(d="translate("+i.x+",0)",e="translate(0, 0)",i.x=0);break;case"y":g=g.concat(f.syncY()),i.x=0,i.y=j-l,i.y=l>j?i.y:0,"top"===q?(e="translate(0,0)",d="translate(0, "+i.y+")",i.y=0):(e="translate(0,"+i.y+")",d="translate(0,0)");break;default:g=g.concat(f.syncY()).concat(f.syncX()),i.x="right"===r?-(k-m):k-m,i.x=m>k?i.x:0,i.y="bottom"===q?-(j-l):j-l,i.y=l>j?i.y:0}n[r]=i.x,n[q]=i.y,g.map(function(a){a.each(function(a,g){c=d3.select(this),b=/svg/.test(this.namespaceURI),b?(c.attr("transform",d),c.transition().delay(t).duration(s).attr("transform",e).each("end",function(){f({x:i.x,y:i.y})})):(o=c.attr(),c.attr(n),c.attr(o).transition().delay(t).duration(s).each("end",function(){f({x:i.x,y:i.y})}))})}),u=!0}},f.viewHeight=function(a){return arguments.length?(j=a,f):j},f.viewWidth=function(a){return arguments.length?(k=a,f):k},f.contentHeight=function(a){if(!arguments.length)return l;l=a;var b=o.concat(p).concat(q);for(elem in b)var c=b[elem],d=c.selectAll("rect.scrollBackground").attr({height:l});return f},f.contentWidth=function(a){if(!arguments.length)return m;m=a;var b=o.concat(p).concat(q);for(elem in b)var c=b[elem],d=c.selectAll("rect.scrollBackground").attr({width:m});return f},f.draggable=function(a){return n=a,f},f.sync=function(a){return arguments.length?(o.push(a),f.resize(),a.on("wheel",b),a.on("mousewheel",b),n&&a.call(w),f):o},f.syncX=function(a){return arguments.length?(p.push(a),f.resize(),a.on("wheel",c),a.on("mousewheel",c),n&&a.call(x),f):p},f.syncY=function(a){return arguments.length?(q.push(a),f.resize(),a.on("wheel",d),a.on("mousewheel",d),n&&a.call(y),f):q},f.resize=function(){var a,b,c,d=o.concat(p).concat(q),g=0,h=0,i={x:0,y:0,width:0,height:0};for(b in d){c=d[b];var j=/svg/.test(c.node().namespaceURI);j?(c.select("rect.scrollBackground").remove(),a=c.node().getBBox(),a.x<i.x&&(i.x=a.x),a.y<i.y&&(i.y=a.y),a.width>i.width&&(i.width=a.width),a.height>i.height&&(i.height=a.height)):(c.select("div.scrollBackground").remove(),g=parseFloat(window.getComputedStyle(c.node()).width,10),h=parseFloat(window.getComputedStyle(c.node()).height,10),g>i.width&&(i.width=g),h>i.height&&(i.height=h))}l=i.height,m=i.width,e();for(b in d)if(c=d[b],j=/svg/.test(c.node().namespaceURI)){c.selectAll("rect.scrollBackground").data([0]).enter().insert("rect",":first-child").classed("scrollBackground",!0).attr(i).style({opacity:0,"pointer-events":"all"})}else{c.selectAll("div.scrollBackground").data([0]).enter().insert("div",":first-child").classed("scrollBackground",!0).style({opacity:0,display:"block",position:"absolute",width:i.width+"px",height:i.height+"px",top:i.y+"px",left:i.x+"px","pointer-events":"none"})}return f},f.enable=function(a){return arguments.length?(t=a,f):t},f},d3.svgScroll=d3.scroll,d3.hover=function(a){if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))return a;switch(d3.select("html").style({"-webkit-touch-callout":"none","-webkit-user-select":"none"}),a){case"mouseover":return"touchstart";case"mouseout":return"touchend";default:return a}},window.da)for(var key in da)window.da[key]=da[key];else window.da=da;
function domoUtilTruncateStringToNumCharacters(a,b,c){console.warn("The domoUtilTruncateStringToNumCharacters method has been deprecated. Use d3.domoStrings.trunc instead.");var d=a.length>b,e=d?a.substr(0,b-1):a;return e=c&&d?e.substr(0,e.lastIndexOf(" ")):e,d?e+"...":e}var d3=require("d3"),i18n=require("@domoinc/i18n"),da={};if(module.exports=da,d3.avatar=function(a,b,c,d){function e(){j.style("opacity",1),n.style("opacity",0),m.style("opacity",0)}function f(){j.style("opacity",0),n.style("opacity",1),m.style("opacity",1)}function g(a){return a.split(" ").map(function(a){return a.charAt(0)}).join("").toUpperCase()}var h,i=a.node(),j=d3.select(i),k=i.getBBox();h="number"==typeof d?d+"px":"string"==typeof d?d:"14px";var l=d3.select(i.parentNode),m=l.selectAll("rect.imageCover").data([c]);m.enter().append("rect").attr({"class":"imageCover",x:k.x,y:k.y,width:k.width,height:k.height}).style({fill:"#e4e5e5"}),m.attr({x:k.x,y:k.y,width:k.width,height:k.height});var n=l.selectAll("text.nameInitials").data([c]);n.enter().append("text").text(g(c)).style({fill:"#8a8d8f","font-size":h,"font-weight":400,"font-family":"Open Sans","text-anchor":"middle","pointer-events":"none"}).attr({"class":"nameInitials",x:k.x+k.width/2,y:k.y+k.height/2,dy:function(a){return.35*parseInt(d3.select(this).style("font-size"),10)}}),n.attr({x:k.x+k.width/2,y:k.y+k.height/2}).text(function(a){return g(a)}),a.tween&&a.tween("size",function(){var a=n.style("font-size"),b=d3.interpolate(a,h);return function(a){var c=i.getBBox();m.attr(c),n.style({"font-size":b(a)}).attr({x:c.x+c.width/2,y:c.y+c.height/2,dy:function(a){return.35*parseInt(d3.select(this).style("font-size"),10)}})}});var o=new Image;return o.addEventListener("load",e,!1),o.addEventListener("error",f,!1),o.src=b,j.attr("xlink:href",o.src),this},d3.browser={getInternetExplorerVersion:function(){var a=-1;if("Microsoft Internet Explorer"==navigator.appName){var b=navigator.userAgent,c=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");null!=c.exec(b)&&(a=parseFloat(RegExp.$1))}else if("Netscape"==navigator.appName){var b=navigator.userAgent,c=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})");null!=c.exec(b)&&(a=parseFloat(RegExp.$1))}return a}},da.CalcRGBWithAlphaOnBackground=function(a,b,c){var d=0,e=0,f=0;return d=Math.floor(b*a.r+(1-b)*c.r),e=Math.floor(b*a.g+(1-b)*c.g),f=Math.floor(b*a.b+(1-b)*c.b),"rgb("+d+","+e+","+f+")"},d3.DomoCaretRect=function(a,b,c,d,e,f){return void 0===e&&(e=0),void 0===f&&(f=0),void 0===a&&(a=100),void 0===b&&(b=50),void 0===c&&(c=5),void 0===d&&(d=10),"M"+e+","+f+"l"+-d/2+" "+-(d/2)+"h"+(c-(a/2-d/2))+"a"+c+","+c+" 0 0 1 "+-c+","+-c+"v"+(-b+2*c)+"a"+c+","+c+" 0 0 1 "+c+","+-c+"h"+(a-2*c)+"a"+c+","+c+" 0 0 1 "+c+","+c+"v"+(b-2*c)+"a"+c+","+c+" 0 0 1 "+-c+","+c+"h"+(c-(a/2-d/2))+"l"+-d/2+" "+d/2+"z"},d3.DomoCatigoryIndexGenerator=function(a,b){function c(a,b){var c=[];c.push([-2,0]);for(var d=Math.floor((a[1]-a[0])/b),e=a[0],f=0;b-1>f;f++)c.push([e,e+d]),e+=d;return c.push([e,a[1]+1]),c}var d={numCategories:a,range:b,rangeForEachCatigory:null,getCatigoryIndexForValue:function(a){if(null==d.rangeForEachCatigory&&(d.rangeForEachCatigory=c(d.range,d.numCategories)),void 0==a)return 0;for(var b=0;b<d.rangeForEachCatigory.length;b++)if(d.rangeForEachCatigory[b][0]<=a&&a<d.rangeForEachCatigory[b][1])return b;return console.log("Error: returning index of catigory wasn't found for value:"+a),-1},updateCatigoryRanges:function(a,b){d.range=b,d.numCategories=a,d.rangeForEachCatigory=c(b,a)}};return d},d3.DomoClipPath=function(){function a(){var a=d3.selectAll("[id^="+b+"]").size();return b+"_"+a}var b="DomoClipPath",c={clipsId:null,recentRect:null,appendNewDefsAndDomoClipPath:function(b,d,e){return c.clipsId=a(),c.recentRect=e.append("defs").append("clipPath").attr("id",c.clipsId).append("rect").attr("x",0).attr("y",0),c.updateHeightAndWidthOfClippingRect(b,d),c},getTheRecentlyAppendedDomoClipPathsId:function(){return c.clipsId},updateHeightAndWidthOfClippingRect:function(a,b){return c.height=0>a?0:a,c.width=0>b?0:b,null==c.recentRect?void console.log("clipIt recentRect not set."):void c.recentRect.attr("height",c.height).attr("width",c.width)}};return c},d3.DomoColorRange=function(a){if(4>=a)return{primary:["#73B0D7","#BBE491","#FB8D34","#E45621"].slice(0,a),secondary:["#D9EBFD","#387B26","#FDECAD","#FDECAD"].slice(0,a)};if(17>=a){var b={5:{primary:["#73B0D7","#A0D771","#559E38","#FBAD56","#E45621"],secondary:["#D9EBFD","#DDF4BA","#DDF4BA","#FDECAD","#FDECAD"]},6:{primary:["#90c4e4","#4E8CBA","#A0D771","#559E38","#FBAD56","#E45621"],secondary:["#D9EBFD","#D9EBFD","#DDF4BA","#DDF4BA","#FDECAD","#FDECAD"]},7:{primary:["#90c4e4","#4E8CBA","#A0D771","#559E38","#FCCF84","#E45621","#FB8D34"],secondary:["#D9EBFD","#D9EBFD","#DDF4BA","#DDF4BA","#A43724","#FDECAD","#FDECAD"]},8:{primary:["#90c4e4","#4E8CBA","#BBE491","#559E38","#80C25D","#FCCF84","#E45621","#FB8D34"],secondary:["#D9EBFD","#D9EBFD","#387B26","#DDF4BA","#DDF4BA","#A43724","#FDECAD","#FDECAD"]},9:{primary:["#B7DAF5","#4E8CBA","#73B0D7","#BBE491","#559E38","#80C25D","#FCCF84","#E45621","#FB8D34"],secondary:["#31689B","#D9EBFD","#D9EBFD","#387B26","#DDF4BA","#DDF4BA","#A43724","#FDECAD","#FDECAD"]},10:{primary:["#B7DAF5","#4E8CBA","#73B0D7","#BBE491","#559E38","#80C25D","#FDECAD","#FB8D34","#FCCF84","#E45621"],secondary:["#31689B","#D9EBFD","#D9EBFD","#387B26","#DDF4BA","#DDF4BA","#E45621","#FDECAD","#A43724","#FDECAD"]},11:{primary:["#B7DAF5","#4E8CBA","#73B0D7","#DDF4BA","#80C25D","#BBE491","#559E38","#FDECAD","#FB8D34","#FCCF84","#E45621"],secondary:["#31689B","#D9EBFD","#D9EBFD","#559E38","#DDF4BA","#387B26","#DDF4BA","#E45621","#FDECAD","#A43724","#FDECAD"]},12:{primary:["#D9EBFD","#73B0D7","#B7DAF5","#4E8CBA","#DDF4BA","#80C25D","#BBE491","#559E38","#FDECAD","#FB8D34","#FCCF84","#E45621"],secondary:["#4E8CBA","#D9EBFD","#31689B","#D9EBFD","#559E38","#DDF4BA","#387B26","#DDF4BA","#E45621","#FDECAD","#A43724","#FDECAD"]},13:{primary:["#D9EBFD","#73B0D7","#B7DAF5","#4E8CBA","#DDF4BA","#80C25D","#BBE491","#559E38","#FDECAD","#FB8D34","#FCCF84","#E45621","#FBAD56"],secondary:["#4E8CBA","#D9EBFD","#31689B","#D9EBFD","#559E38","#DDF4BA","#387B26","#DDF4BA","#E45621","#FDECAD","#A43724","#FDECAD","#FDECAD"]},14:{primary:["#D9EBFD","#73B0D7","#B7DAF5","#4E8CBA","#DDF4BA","#80C25D","#BBE491","#559E38","#A0D771","#FDECAD","#FB8D34","#FCCF84","#E45621","#FBAD56"],secondary:["#4E8CBA","#D9EBFD","#31689B","#D9EBFD","#559E38","#DDF4BA","#387B26","#DDF4BA","#DDF4BA","#E45621","#FDECAD","#A43724","#FDECAD","#FDECAD"]},15:{primary:["#D9EBFD","#73B0D7","#B7DAF5","#4E8CBA","#90c4e4","#DDF4BA","#80C25D","#BBE491","#559E38","#A0D771","#FDECAD","#FB8D34","#FCCF84","#E45621","#FBAD56"],secondary:["#4E8CBA","#D9EBFD","#31689B","#D9EBFD","#D9EBFD","#559E38","#DDF4BA","#387B26","#DDF4BA","#DDF4BA","#E45621","#FDECAD","#A43724","#FDECAD","#FDECAD"]},16:{primary:["#D9EBFD","#73B0D7","#B7DAF5","#4E8CBA","#90c4e4","#DDF4BA","#80C25D","#BBE491","#559E38","#A0D771","#FDECAD","#FB8D34","#FCCF84","#E45621","#FBAD56","#A43724"],secondary:["#4E8CBA","#D9EBFD","#31689B","#D9EBFD","#D9EBFD","#559E38","#DDF4BA","#387B26","#DDF4BA","#DDF4BA","#E45621","#FDECAD","#A43724","#FDECAD","#FDECAD","#FDECAD"]},17:{primary:["#D9EBFD","#73B0D7","#B7DAF5","#4E8CBA","#90c4e4","#DDF4BA","#80C25D","#BBE491","#559E38","#A0D771","#387B26","#FDECAD","#FB8D34","#FCCF84","#E45621","#FBAD56","#A43724"],secondary:["#4E8CBA","#D9EBFD","#31689B","#D9EBFD","#D9EBFD","#559E38","#DDF4BA","#387B26","#DDF4BA","#DDF4BA","#DDF4BA","#E45621","#FDECAD","#A43724","#FDECAD","#FDECAD","#FDECAD"]}};return b[a]}return{primary:["#D9EBFD","#73B0D7","#B7DAF5","#4E8CBA","#90c4e4","#31689B","#DDF4BA","#80C25D","#BBE491","#559E38","#A0D771","#387B26","#FDECAD","#FB8D34","#FCCF84","#E45621","#FBAD56","#A43724","#F3E4FE","#B391CA","#DDC8EF","#8F6DC0","#C5ACDE","#7940A1","#FCD7E6","#EE76BF","#FBB6DD","#CF51AC","#F395CD","#A62A92","#D8F4DE","#68BEA8","#ABE4CA","#46998A","#8DD5BE","#227872","#FDDDDD","#FCBCB7","#FD9A93","#FD7F76","#E45850","#C92E25","#F1F2F2","#CACBCC","#B0B1B2","#959899","#7B7E80","#54585A"].slice(0,a),secondary:["#4E8CBA","#D9EBFD","#31689B","#D9EBFD","#D9EBFD","#D9EBFD","#559E38","#DDF4BA","#387B26","#DDF4BA","#DDF4BA","#DDF4BA","#E45621","#FDECAD","#A43724","#FDECAD","#FDECAD","#FDECAD","#8F6DC0","#F3E4FE","#7940A1","#F3E4FE","#F3E4FE","#F3E4FE","#CF51AC","#FCD7E6","#A62A92","#FCD7E6","#FCD7E6","#FCD7E6","#46998A","#D8F4DE","#227872","#D8F4DE","#D8F4DE","#D8F4DE","#FD7F76","#E45850","#C92E25","#FDDDDD","#FCBCB7","#FD9A93","#959899","#7B7E80","#54585A","#F1F2F2","#CACBCC","#B0B1B2"].slice(0,a)}},d3.appendDomoFormattedNumberTextElementToContainer=function(a){var b=a.append("text");return b.append("tspan").attr("id","largeTspan").classed("largeTspan",!0),b.append("tspan").attr("id","smallTspan").classed("smallTspan",!0),b},d3.setDomoFormattedTextElement=function(a,b,c,d,e,f){var g=a.select("#largeTspan"),h=a.select("#smallTspan"),i=i18n.summaryNumberToObject(c);g.style("font-size",d+"px").text(b+String(i.prefix)),h.style("font-size",f+"px").text(i.magnitude+" "+e)},d3.DomoFormatNumber=function(a){return i18n.summaryNumber(a)},d3.DomoGetFontSizeToFitTextInBounds=function(a,b,c,d){for(var e=["14px","10px","8px","0.1px"],f=e.indexOf(d)||0,g=5,h=null;f<e.length&&(a.style("font-size",e[f]),h=a.node().getBBox(),!(h.width<b-g&&h.height<c-g));)f++;return e[f]},d3.DomoGetFontSizeToFitTextInBoundsStartAtSize=function(a,b,c,d){for(var e=5,f=null;d>0&&(a.style("font-size",d+"px"),f=a.node().getBBox(),!(f.width<b-e&&f.height<c-e));)d-=2;return 0>d?0:d},d3.domoIcons={pencil:function(a){return a.append("path").style("fill","#CBCBCC").attr({d:"M10.2,2.9l-8.8,8.8h0l0,0h0l0,0L0,16l4.3-1.4l0,0l0,0l0,0l0,0l8.8-8.8L10.2,2.9z M3.4,12.1l-0.5-0.5l7.2-7.2l0.5,0.5L3.4,12.1z"}),a.append("rect").attr({x:12.2,y:.4,width:3.3,height:4,transform:"matrix(0.707 -0.7072 0.7072 0.707 2.2664 10.3121)"}).style({fill:"#CBCBCC",width:2.7,height:4.1}),a.append("rect").attr({width:17,height:17,opacity:0}).style({fill:"#ffddff"}),a},funnel:function(a){return a.append("path").style({fill:"#444"}).attr({d:"M87.5,27.292c0-6.944-16.789-12.576-37.501-12.576c-20.71,0-37.499,5.632-37.499,12.576c0,0.148,0.018,0.294,0.033,0.441 c-0.006,0.035-0.033,0.046-0.033,0.09c0,0.665,0,1.77,0,2.454c0,0.686,0.324,1.571,0.72,1.968c0.396,0.396,1.441,1.445,2.325,2.331 l27.111,27.188c0,8.948,0,19.865,0,20.237c0,0.634,1.196,3.283,7.345,3.283c6.147,0,7.343-2.489,7.343-3.283 c0-0.467,0-11.375,0-20.294l27.399-27.424c0.883-0.886,1.865-1.868,2.183-2.184c0.314-0.317,0.574-1.043,0.574-1.615 s0-1.678,0-2.455c0-0.069-0.034-0.095-0.046-0.149C87.481,27.685,87.5,27.489,87.5,27.292z M49.999,20.472 c18.605,0,29.207,4.472,31.473,6.82c-2.266,2.349-12.867,6.82-31.473,6.82c-18.604,0-29.205-4.472-31.47-6.82 C20.794,24.943,31.395,20.472,49.999,20.472z"}),a},magnifyingGlass:function(a){return a.append("path").style({fill:"rgb(138, 141, 143)"}).attr({d:"M16.6,15.1c1.2-1.6,2-3.5,2-5.6c0-5-4.1-9.1-9.1-9.1 S0.4,4.4,0.4,9.4s4.1,9.1,9.1,9.1c2.1,0,4.1-0.7,5.6-2l5.1,5.1c0.4,0.4,1,0.4,1.4,0l0.1-0.1c0.4-0.4,0.4-1,0-1.4L16.6,15.1z M9.5,16.6c-4,0-7.2-3.2-7.2-7.2s3.2-7.2,7.2-7.2s7.2,3.2,7.2,7.2S13.4,16.6,9.5,16.6z"}),a},diamond:function(a,b){return a.append("polygon").attr("points","4,0 0,5 4,10 8,5"),void 0===b?a.attr("fill","#CBCBCC"):a.attr(b),a},help:function(){console.log("d3.DomoIcons.pencil( element ): Draws a light grey pencil icon and returns the element passed in.\nExample:\n d3.DomoIcons.pencil( d3.select('g') )\n .attr('transform', 'translate(10,10)');")}},d3.DomoNumberCleanup=function(a,b){var c=d3.DomoFormatNum(+a,b);return c[0]+c[1]},d3.DomoFormatNum=function(a,b){function c(a,b,c){(void 0===c||3>c)&&(c=3);var d=a+"",e=d.indexOf(".");if(-1===e)return[d,b];var f=d.substring(e+1,d.length);f.length>2&&(f=f.substring(0,2));for(var g=d.substring(0,e),h=g+f,i=0;h.length>c&&5e3>i;){var j=h.length-1;h=h.substring(0,j),i++}return h=h.substring(0,e)+"."+h.substring(e,h.length),h.length-1===h.indexOf(".")&&(h=h.substring(0,h.length-1)),[h,b]}return void 0===b&&(b=3),a>=1e15?c(+a/1e15,"Q",b):a>=1e12?c(+a/1e12,"T",b):a>=1e9?c(+a/1e9,"B",b):a>=1e6?c(+a/1e6,"M",b):a>=1e3?c(+a/1e3,"K",b):c(+a,"",b)},d3.roundedRect=function(a,b,c,d,e,f,g,h,i){var j;return j="M"+(a+e)+","+b,j+="h"+(c-2*e),g?j+="a"+e+","+e+" 0 0 1 "+e+","+e:(j+="h"+e,j+="v"+e),j+="v"+(d-2*e),i?j+="a"+e+","+e+" 0 0 1 "+-e+","+e:(j+="v"+e,j+="h"+-e),j+="h"+(2*e-c),h?j+="a"+e+","+e+" 0 0 1 "+-e+","+-e:(j+="h"+-e,j+="v"+-e),j+="v"+(2*e-d),f?j+="a"+e+","+e+" 0 0 1 "+e+","+-e:(j+="v"+-e,j+="h"+e),j+="z"},d3.shapeToGrid=function(a){var b=a.selectAll("path"),c=0,d=d3.select("#defs");b.each(function(){c++;for(var b=this.getBBox(),e=(a.node().getBBox(),d3.select(this).attr("d")),f=d3.select(this).style("fill"),g=d3.select(this.parentNode),h=(d.append("clipPath").attr("id","clip"+c).append("path").attr("d",e),g.append("g").attr("clip-path","url(#clip"+c+")")),i=Math.ceil(b.width/5)+1,j=Math.ceil(b.height/5)+1,k=5*Math.floor(b.x/5),l=5*Math.floor(b.y/5),m=0;j>m;m++)for(var n=0;i>n;n++)h.append("circle").attr("cx",5*n+2.5+k).attr("cy",5*m+2.5+l).attr("r",2).style("fill",f);d3.select(this).remove()})},d3.domoStrings={trunc:function(a,b,c){var d=a.length>b,e=d?a.substr(0,b-1):a;return e=c&&d?e.substr(0,e.lastIndexOf(" ")):e,e=d?e+"...":e},truncToFitVertical:function(a,b){padding=5;var c=!1;str=a.text(),tempBox=a.node().getBoundingClientRect();for(var d=str.length;d>=0&&(a.text(str),tempbox=a.node().getBoundingClientRect(),b-padding<tempbox.height);d--)str=str.substr(0,str.length-1),c=!0;c===!0&&(str=str.substr(0,str.length-1)+"...",a.text(str))},truncToFit:function(a,b){padding=5;var c=!1;str=a.text(),tempBox=a.node().getBoundingClientRect();for(var d=str.length;d>=0&&(a.text(str),tempbox=a.node().getBoundingClientRect(),b-padding<tempbox.width);d--)str=str.substr(0,str.length-1),c=!0;c===!0&&(str=str.substr(0,str.length-1)+"...",a.text(str))},shrinkToFit:function(a,b,c,d){var e,f=5;if(d){for(;d>6&&(a.style("font-size",d+"px"),e=a.node().getBoundingClientRect(),!(e.width<b-f&&e.height<c-f));)d-=2;8>d&&a.style("font-size","0px")}else{for(var g=["14px","12px","10px","8px","0px"],h=0;h!==g.length-1&&(a.style("font-size",g[h]+"px"),e=a.node().getBoundingClientRect(),!(e.width<b-f&&e.height<c-f));)h++;h===g.length-1&&a.style("font-size","0px")}},shrinkToTrunc:function(a,b,c,d,e){str=a.text();var f,g=5;if(d){for(;d>6&&(a.style("font-size",d+"px"),f=a.node().getBoundingClientRect(),!(f.width<b-g&&f.height<c-g));)d-=2;8>d&&(a.style("font-size","8px"),d3.domoStrings.truncToFit(a,b))}else{for(var h=["14px","12px","10px","8px","0px"],i=0;i!==h.length-1&&(a.style("font-size",h[i]+"px"),f=a.node().getBoundingClientRect(),!(f.width<b-g&&f.height<c-g));)i++;i===h.length-1&&(a.style("font-size","8px"),d3.domoStrings.truncToFit(a,b))}},wrapText:function(a,b){var c=5,d=a.text(),e=a.node().getBoundingClientRect().height,f=d.split(" ");if(!(f.length<=1)){for(var g=[],h=f[0],i=h,j=1;j<f.length;j++){i+=" "+f[j],a.text(i);var k=a.node().getBoundingClientRect();k.width<=b-c?h=i:(g.push(h),h=f[j],i=h),j===f.length-1&&g.push(h)}for(a.text(""),j=0;j<g.length;j++){var l=a.append("tspan").text(g[j]);j>0&&l.attr({x:"0px",dy:e+"px"})}}},help:function(){console.log('d3.domoStrings is an object of functions that will alter strings with font shrinking and truncating.\n\ntrunc(string, characters, useWordBoundary): The string to modify and the characters you want to truncate to.\nEx: .text(function(d){ return d3.domoStrings.trunc(d.name, 25)\n\ntruncToFit(textElement, width): textElement is the d3 selection of the text element and width is the width that you want the element to fit inside after truncating.\nEx: d3.selectAll("text").each(function(){ return d3.domoStrings.truncToFit(d3.select(this), 45); });\n\nshrinkToFit(textElement, width, height, size): textElement is the d3 selection of the text element, width is the target width to shrink to, height is the target height, size is the starting size of the font.\nEx: Ex: d3.selectAll("text").each(function(){ return d3.domoStrings.shrinkToFit(d3.select(this), 45, 25, 10); });\n\nshrinkToTrunc(textElement, width, size): textElement is the d3 selection of the text element, width is the target width to shrink to and size is used if you want to define a starting font size to shrink from. If size is null sizes start at 14\nEx: d3.selectAll("text").each(function(){ return d3.domoStrings.truncToFit(d3.select(this), 45, 18); });')}},d3.rightAlignText=function(a){var b=a.node().getBBox();return a.attr("text-anchor","end").attr("transform",function(){return d3.select(this).attr("transform")+"translate("+b.width+",0)"}),a},d3.centerAlignText=function(a){return a.attr("text-anchor","middle").attr("transform",function(){var b=a.node().getBBox();return d3.select(this).attr("transform")+"translate("+b.width/2+",0)"}),a},d3.DomoTransitionEndAll=function(a,b){var c=0;a.each(function(){++c}).each("end",function(){--c||b.apply(this,arguments)})},da.DomoUniqueIdFromPrefix=function(a){function b(a){for(var b=[],d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=d.length,f=0;a>f;++f)b.push(d[c(0,e-1)]);return b.join("")}function c(a,b){return Math.floor(Math.random()*(b-a+1))+a}function d(){return(new Date).getTime()}function e(a){return a+"_"+d()+b(100)+"_"}return e(a)},d3.DomoUniqueIdFromPrefix=da.DomoUniqueIdFromPrefix,d3.scroll=function(){function a(a,b){var c,f;"drag"!==d3.event.type?(d3.event.stopPropagation&&d3.event.stopPropagation(),c=v.dx(d3.event,b),f=v.dy(d3.event,b)):(c=d3.event.dx,f=d3.event.dy);var g=0,m=0;return l>j&&(g=q+c,h.left=g>0?!0:!1,h.right=j-l>g?!0:!1),k>i&&(m=r+f,h.top=m>0?!0:!1,h.bottom=i-k>m?!0:!1),d.dispatch.scrolling(h),(!h.top&&!h.bottom||u)&&e(a),{x:g,y:m}}function b(b,d){return function(e){var f=a(e,d);b&&(f=b(f)),c(f)}}function c(a){a||(a={x:q,y:r}),d({x:Math.min(0,Math.max(a.x,j-l)),y:Math.min(0,Math.max(a.y,i-k))})}function d(a){if(s){var b,c;q=a.x,r=a.y;for(var d in n)c=n[d],b=/svg/.test(c.node().namespaceURI),b?c.attr("transform","translate("+a.x+", "+a.y+")"):(c.style("transform","translate("+a.x+"px, "+a.y+"px)"),c.style("-webkit-transform","translate("+a.x+"px, "+a.y+"px)"),c.style("-ms-transform","translate("+a.x+"px, "+a.y+"px)"));for(var d in o)c=o[d],b=/svg/.test(c.node().namespaceURI),b?c.attr("transform","translate("+a.x+", 0)"):(c.style("transform","translate("+a.x+"px, 0px)"),c.style("-webkit-transform","translate("+a.x+"px, 0px)"),c.style("-ms-transform","translate("+a.x+"px, 0px)"));for(var d in p)c=p[d],b=/svg/.test(c.node().namespaceURI),b?c.attr("transform","translate(0, "+a.y+")"):(c.style("transform","translate(0px, "+a.y+"px)"),c.style("-webkit-transform","translate(0px, "+a.y+"px)"),c.style("-ms-transform","translate(0px, "+a.y+"px)"))}}function e(a){a=d3.event,a.preventDefault&&a.preventDefault(),a.returnValue=!1}function f(a){return function(c,e){if(!arguments.length)return w[a].array;w[a].array.push(c);var f=b(w[a].scrollAmountModifier,e);return c.on("wheel",f),c.on("mousewheel",f),m&&c.call(d3.behavior.drag().on("drag",f)),d}}var g,h={},i=582,j=1064,k=582,l=1064,m=!0,n=[],o=[],p=[],q=0,r=0,s=!0,t=!1,u=!1,v=function(){function a(a,b){for(var c=0;c<b.length;c++)if(a[b[c]])return a[b[c]]}function b(b){c[b]=0,d[b]=!0;var e=["delta"+b.toUpperCase(),"wheelDelta"+b.toUpperCase()];return function(f,g){var h=a(f,e);return h?(d[b]&&(c[b]=Math.abs(h)||1,delete d[b]),h%1===0?h:(g||(g=4),-g*h/c[b])):0}}var c={},d={};return{dx:b("x"),dy:b("y")}}();d.preventDefault=function(a){return u=a===!0,d},d.dispatch=d3.dispatch("scrolling"),d.introAnimation=function(a){return g=a,d},d.run=function(a){a=a?a:g;var b,c,e,f,h=d.sync(),m={},n={},o={},p=a.axis?a.axis:"default",q=a.directionY?a.directionY:"top",r=a.directionX?a.directionX:"left",s=a.duration?a.duration:1e3,u=a.delay?a.delay:0;if(t=void 0!==a.runOnce?a.runOnce:t,!t){switch(p){case"x":h=h.concat(d.syncX()),m.x=-(l-j),m.x=l>j?m.x:0,m.y=0,"right"===r?(e="translate(0,0)",f="translate("+m.x+",0)"):(e="translate("+m.x+",0)",f="translate(0, 0)",m.x=0);break;case"y":h=h.concat(d.syncY()),m.x=0,m.y=i-k,m.y=k>i?m.y:0,"top"===q?(f="translate(0,0)",e="translate(0, "+m.y+")",m.y=0):(f="translate(0,"+m.y+")",e="translate(0,0)");break;default:h=h.concat(d.syncY()).concat(d.syncX()),m.x="right"===r?-(j-l):j-l,m.x=l>j?m.x:0,m.y="bottom"===q?-(i-k):i-k,m.y=k>i?m.y:0}n[r]=m.x,n[q]=m.y,h.map(function(a){a.each(function(a,g){c=d3.select(this),b=/svg/.test(this.namespaceURI),b?(c.attr("transform",e),c.transition().delay(u).duration(s).attr("transform",f).each("end",function(){d({x:m.x,y:m.y})})):(o=c.attr(),c.attr(n),c.attr(o).transition().delay(u).duration(s).each("end",function(){d({x:m.x,y:m.y})}))})}),t=!0}},d.viewHeight=function(a){return arguments.length?(i=a,d):i},d.viewWidth=function(a){return arguments.length?(j=a,d):j},d.contentHeight=function(a){if(!arguments.length)return k;k=a;var b=n.concat(o).concat(p);for(var c in b)var e=b[c],f=e.selectAll("rect.scrollBackground").attr({height:k});return d},d.contentWidth=function(a){if(!arguments.length)return l;l=a;var b=n.concat(o).concat(p);for(var c in b)var e=b[c],f=e.selectAll("rect.scrollBackground").attr({width:l});return d},d.draggable=function(a){return m=a,d};var w={x:{array:o,scrollAmountModifier:function(a){return a.y=r,a}},y:{array:p,scrollAmountModifier:function(a){return a.x=q,a}},both:{array:n,scrollAmountModifier:null}};return d.sync=f("both"),d.syncX=f("x"),d.syncY=f("y"),d.resize=function(){var a,b,e,f=n.concat(o).concat(p),g=0,h=0,i={x:0,y:0,width:0,height:0};for(b in f){e=f[b];var j=/svg/.test(e.node().namespaceURI);j?(e.select("rect.scrollBackground").remove(),a=e.node().getBBox(),a.x<i.x&&(i.x=a.x),a.y<i.y&&(i.y=a.y),a.width>i.width&&(i.width=a.width),a.height>i.height&&(i.height=a.height)):(e.select("div.scrollBackground").remove(),g=parseFloat(window.getComputedStyle(e.node()).width,10),h=parseFloat(window.getComputedStyle(e.node()).height,10),g>i.width&&(i.width=g),h>i.height&&(i.height=h))}k=i.height,l=i.width,c();for(b in f)if(e=f[b],j=/svg/.test(e.node().namespaceURI)){e.selectAll("rect.scrollBackground").data([0]).enter().insert("rect",":first-child").classed("scrollBackground",!0).attr(i).style({opacity:0,"pointer-events":"all"})}else{e.selectAll("div.scrollBackground").data([0]).enter().insert("div",":first-child").classed("scrollBackground",!0).style({opacity:0,display:"block",position:"absolute",width:i.width+"px",height:i.height+"px",top:i.y+"px",left:i.x+"px","pointer-events":"none"})}return d},d.enable=function(a){return arguments.length?(s=a,d):s},d},d3.svgScroll=d3.scroll,d3.hover=function(a){if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))return a;switch(d3.select("html").style({"-webkit-touch-callout":"none","-webkit-user-select":"none"}),a){case"mouseover":return"touchstart";case"mouseout":return"touchend";default:return a}},window.da)for(var key in da)window.da[key]=da[key];else window.da=da;

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

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

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