From 69b393f9d3cf8f95593d93bfea4ccf561aa9251f Mon Sep 17 00:00:00 2001 From: konstantin Date: Mon, 8 Dec 2014 14:25:03 +0300 Subject: [PATCH] release 0.2.1 --- bower.json | 2 +- build/plugins/tauCharts.tooltip.js | 28 +- build/plugins/tauCharts.tooltip.min.js | 4 +- build/tauCharts.color-brewer.js | 646 ++++++++++++------------- build/tauCharts.color-brewer.min.js | 2 +- build/tauCharts.js | 518 +++++++++++--------- build/tauCharts.min.js | 2 +- component.json | 2 +- package.json | 2 +- 9 files changed, 625 insertions(+), 581 deletions(-) diff --git a/bower.json b/bower.json index bf7e2230b..78c8d0eb8 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "tauCharts", - "version": "0.2.1", + "version": "0.2.2", "homepage": "https://github.com/TargetProcess/tauCharts", "description": "Simple charts library based on d3", "keywords": [ diff --git a/build/plugins/tauCharts.tooltip.js b/build/plugins/tauCharts.tooltip.js index c1cbddfed..ff3b28118 100644 --- a/build/plugins/tauCharts.tooltip.js +++ b/build/plugins/tauCharts.tooltip.js @@ -128,29 +128,39 @@ return _.compact(fields.concat(y, x).reverse()); }, + isLine: function (data) { + return data.elementData.key && Array.isArray(data.elementData.values); + }, onElementMouseOver: function (chart, data) { clearInterval(this._interval); - var coord = d3.mouse(data.element); var key = this._generateKey(data.cellData.$where); - var item = _.min(this._dataWithCoords[key], function (a) { - return this._calculateLength(a.x, a.y, coord[0], coord[1]); - }, this); + var coord = d3.mouse(data.element); + var item = data.elementData; + var isLine = this.isLine(data); + if (isLine) { + var dataWithCoord = this._dataWithCoords[key]; + var filteredData = dataWithCoord.filter(function (value) { + return _.contains(item.values, value.item); + }); + var itemWithCoord = _.min(filteredData, function (a) { + return this._calculateLength(a.x, a.y, coord[0], coord[1]); + }, this); + item = itemWithCoord.item; + this._drawPoint(d3.select(data.element.parentNode), itemWithCoord.x, itemWithCoord.y, this._unitMeta[key].options.color.get(data.elementData.key)); + } if (this._currentElement === item) { return; } - if (data.elementData.key && Array.isArray(data.elementData.values)) { - this._drawPoint(d3.select(data.element.parentNode), item.x, item.y, this._unitMeta[key].options.color.get(data.elementData.key)); - } var content = this._elementTooltip.querySelectorAll('.i-role-content'); if (content[0]) { var fields = this._getFields(this._unitMeta[key]); - content[0].innerHTML = this.render(item.item, fields); + content[0].innerHTML = this.render(item, fields); } else { console.log('template should contain i-role-content class'); } this._show(); - this._currentElement = item.item; + this._currentElement = item; }, onElementMouseOut: function () { this._hide(); diff --git a/build/plugins/tauCharts.tooltip.min.js b/build/plugins/tauCharts.tooltip.min.js index 99c9229a8..975495273 100644 --- a/build/plugins/tauCharts.tooltip.min.js +++ b/build/plugins/tauCharts.tooltip.min.js @@ -1,4 +1,4 @@ -/*! tauCharts - v0.2.1 - 2014-12-08 +/*! tauCharts - v0.2.2 - 2014-12-08 * https://github.com/TargetProcess/tauCharts * Copyright (c) 2014 Taucraft Limited; Licensed Creative Commons */ -!function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){{require("tauCharts")}module.exports=a()}else a(this.tauCharts)}(function(a){function b(a){return a=a||{},{template:['
','
Exclude
'].join(""),itemTemplate:['
','
<%=label%>
','
<%=value%>
',"
"].join(""),onExcludeData:function(){},_drawPoint:function(a,b,c,d){this.circle&&this.circle.remove(),this.circle=a.append("circle").attr("cx",b).attr("cy",c).attr("class",d).attr("r",4),this.circle.node().addEventListener("mouseover",function(){clearTimeout(this._interval)}.bind(this),!1),this.circle.node().addEventListener("mouseleave",function(){this._hide()}.bind(this),!1)},init:function(b){this._chart=b,this._dataFields=a.fields,c.extend(this,c.omit(a,"fields")),this._interval=null,this._dataWithCoords={},this._unitMeta={},this._templateItem=c.template(this.itemTemplate),this._tooltip=b.addBalloon({spacing:5,auto:!0}),this._elementTooltip=this._tooltip.getElement();var d=this._elementTooltip;d.addEventListener("mouseover",function(){clearTimeout(this._interval)}.bind(this),!1),d.addEventListener("mouseleave",function(){this._hide()}.bind(this),!1),d.addEventListener("click",function(a){var b=a.target;b.classList.contains("i-role-exclude")&&(this._exclude(),this._hide())}.bind(this),!1),d.insertAdjacentHTML("afterbegin",this.template)},onUnitReady:function(a,b){if(b.type&&0===b.type.indexOf("ELEMENT")){var c=this._generateKey(b.$where);this._unitMeta[c]=b;var d=b.partition();this._dataWithCoords[c]=d.map(function(a){return{x:b.options.xScale(a[b.x.scaleDim]),y:b.options.yScale(a[b.y.scaleDim]),item:a}},this)}},render:function(a,b){return b.map(function(b){var d=a[b],e=c.isNull(d)||c.isUndefined(d)?"No "+b:d;return this._templateItem({label:b,value:e})},this).join("")},_exclude:function(){var a=this._chart.getData();this._chart.setData(c.without(a,this._currentElement)),this.onExcludeData(this._currentElement)},_calculateLength:function(a,b,c,d){return(c-a)*(c-a)+(d-b)*(d-b)},_generateKey:function(a){return JSON.stringify(a)},_getFields:function(a){if(this._dataFields)return this._dataFields;for(var b=[a.size.scaleDim,a.color.scaleDim],d=[],e=[];a=a.parentUnit;)d.push(a.x.scaleDim),e.push(a.y.scaleDim);return c.compact(b.concat(e,d).reverse())},onElementMouseOver:function(a,b){clearInterval(this._interval);var e=d.mouse(b.element),f=this._generateKey(b.cellData.$where),g=c.min(this._dataWithCoords[f],function(a){return this._calculateLength(a.x,a.y,e[0],e[1])},this);if(this._currentElement!==g){b.elementData.key&&Array.isArray(b.elementData.values)&&this._drawPoint(d.select(b.element.parentNode),g.x,g.y,this._unitMeta[f].options.color.get(b.elementData.key));var h=this._elementTooltip.querySelectorAll(".i-role-content");if(h[0]){var i=this._getFields(this._unitMeta[f]);h[0].innerHTML=this.render(g.item,i)}else console.log("template should contain i-role-content class");this._show(),this._currentElement=g.item}},onElementMouseOut:function(){this._hide()},_show:function(){this._tooltip.show();var a=d.mouse(this._elementTooltip.parentNode);this._tooltip.position(a[0],a[1]).updateSize()},_hide:function(){this._interval=setTimeout(function(){this._currentElement=null,this._tooltip.hide(),this.circle&&this.circle.remove()}.bind(this),300)},_destroyTooltip:function(){this.circle&&this.circle.remove(),this._tooltip.destroy()},destroy:function(){this._destroyTooltip()}}}var c=a.api._,d=a.api.d3;a.api.plugins.add("tooltip",b)}); \ No newline at end of file +!function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){{require("tauCharts")}module.exports=a()}else a(this.tauCharts)}(function(a){function b(a){return a=a||{},{template:['
','
Exclude
'].join(""),itemTemplate:['
','
<%=label%>
','
<%=value%>
',"
"].join(""),onExcludeData:function(){},_drawPoint:function(a,b,c,d){this.circle&&this.circle.remove(),this.circle=a.append("circle").attr("cx",b).attr("cy",c).attr("class",d).attr("r",4),this.circle.node().addEventListener("mouseover",function(){clearTimeout(this._interval)}.bind(this),!1),this.circle.node().addEventListener("mouseleave",function(){this._hide()}.bind(this),!1)},init:function(b){this._chart=b,this._dataFields=a.fields,c.extend(this,c.omit(a,"fields")),this._interval=null,this._dataWithCoords={},this._unitMeta={},this._templateItem=c.template(this.itemTemplate),this._tooltip=b.addBalloon({spacing:5,auto:!0}),this._elementTooltip=this._tooltip.getElement();var d=this._elementTooltip;d.addEventListener("mouseover",function(){clearTimeout(this._interval)}.bind(this),!1),d.addEventListener("mouseleave",function(){this._hide()}.bind(this),!1),d.addEventListener("click",function(a){var b=a.target;b.classList.contains("i-role-exclude")&&(this._exclude(),this._hide())}.bind(this),!1),d.insertAdjacentHTML("afterbegin",this.template)},onUnitReady:function(a,b){if(b.type&&0===b.type.indexOf("ELEMENT")){var c=this._generateKey(b.$where);this._unitMeta[c]=b;var d=b.partition();this._dataWithCoords[c]=d.map(function(a){return{x:b.options.xScale(a[b.x.scaleDim]),y:b.options.yScale(a[b.y.scaleDim]),item:a}},this)}},render:function(a,b){return b.map(function(b){var d=a[b],e=c.isNull(d)||c.isUndefined(d)?"No "+b:d;return this._templateItem({label:b,value:e})},this).join("")},_exclude:function(){var a=this._chart.getData();this._chart.setData(c.without(a,this._currentElement)),this.onExcludeData(this._currentElement)},_calculateLength:function(a,b,c,d){return(c-a)*(c-a)+(d-b)*(d-b)},_generateKey:function(a){return JSON.stringify(a)},_getFields:function(a){if(this._dataFields)return this._dataFields;for(var b=[a.size.scaleDim,a.color.scaleDim],d=[],e=[];a=a.parentUnit;)d.push(a.x.scaleDim),e.push(a.y.scaleDim);return c.compact(b.concat(e,d).reverse())},isLine:function(a){return a.elementData.key&&Array.isArray(a.elementData.values)},onElementMouseOver:function(a,b){clearInterval(this._interval);var e=this._generateKey(b.cellData.$where),f=d.mouse(b.element),g=b.elementData,h=this.isLine(b);if(h){var i=this._dataWithCoords[e],j=i.filter(function(a){return c.contains(g.values,a.item)}),k=c.min(j,function(a){return this._calculateLength(a.x,a.y,f[0],f[1])},this);g=k.item,this._drawPoint(d.select(b.element.parentNode),k.x,k.y,this._unitMeta[e].options.color.get(b.elementData.key))}if(this._currentElement!==g){var l=this._elementTooltip.querySelectorAll(".i-role-content");if(l[0]){var m=this._getFields(this._unitMeta[e]);l[0].innerHTML=this.render(g,m)}else console.log("template should contain i-role-content class");this._show(),this._currentElement=g}},onElementMouseOut:function(){this._hide()},_show:function(){this._tooltip.show();var a=d.mouse(this._elementTooltip.parentNode);this._tooltip.position(a[0],a[1]).updateSize()},_hide:function(){this._interval=setTimeout(function(){this._currentElement=null,this._tooltip.hide(),this.circle&&this.circle.remove()}.bind(this),300)},_destroyTooltip:function(){this.circle&&this.circle.remove(),this._tooltip.destroy()},destroy:function(){this._destroyTooltip()}}}var c=a.api._,d=a.api.d3;a.api.plugins.add("tooltip",b)}); \ No newline at end of file diff --git a/build/tauCharts.color-brewer.js b/build/tauCharts.color-brewer.js index 749b9cd7b..90215ee69 100644 --- a/build/tauCharts.color-brewer.js +++ b/build/tauCharts.color-brewer.js @@ -1,324 +1,324 @@ -(function (definition) { - if (typeof define === "function" && define.amd) { - define(['tauCharts'], function (tauCharts) { - return definition(tauCharts); - }); - } else if (typeof module === "object" && module.exports) { - var tauCharts = require('tauCharts'); - module.exports = definition(tauCharts); - } else { - definition(this.tauCharts); - } -})(function (tauCharts) { - // This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/). - var colorbrewer = { - YlGn: { - 3: ["#f7fcb9", "#addd8e", "#31a354"], - 4: ["#ffffcc", "#c2e699", "#78c679", "#238443"], - 5: ["#ffffcc", "#c2e699", "#78c679", "#31a354", "#006837"], - 6: ["#ffffcc", "#d9f0a3", "#addd8e", "#78c679", "#31a354", "#006837"], - 7: ["#ffffcc", "#d9f0a3", "#addd8e", "#78c679", "#41ab5d", "#238443", "#005a32"], - 8: ["#ffffe5", "#f7fcb9", "#d9f0a3", "#addd8e", "#78c679", "#41ab5d", "#238443", "#005a32"], - 9: ["#ffffe5", "#f7fcb9", "#d9f0a3", "#addd8e", "#78c679", "#41ab5d", "#238443", "#006837", "#004529"] - }, YlGnBu: { - 3: ["#edf8b1", "#7fcdbb", "#2c7fb8"], - 4: ["#ffffcc", "#a1dab4", "#41b6c4", "#225ea8"], - 5: ["#ffffcc", "#a1dab4", "#41b6c4", "#2c7fb8", "#253494"], - 6: ["#ffffcc", "#c7e9b4", "#7fcdbb", "#41b6c4", "#2c7fb8", "#253494"], - 7: ["#ffffcc", "#c7e9b4", "#7fcdbb", "#41b6c4", "#1d91c0", "#225ea8", "#0c2c84"], - 8: ["#ffffd9", "#edf8b1", "#c7e9b4", "#7fcdbb", "#41b6c4", "#1d91c0", "#225ea8", "#0c2c84"], - 9: ["#ffffd9", "#edf8b1", "#c7e9b4", "#7fcdbb", "#41b6c4", "#1d91c0", "#225ea8", "#253494", "#081d58"] - }, GnBu: { - 3: ["#e0f3db", "#a8ddb5", "#43a2ca"], - 4: ["#f0f9e8", "#bae4bc", "#7bccc4", "#2b8cbe"], - 5: ["#f0f9e8", "#bae4bc", "#7bccc4", "#43a2ca", "#0868ac"], - 6: ["#f0f9e8", "#ccebc5", "#a8ddb5", "#7bccc4", "#43a2ca", "#0868ac"], - 7: ["#f0f9e8", "#ccebc5", "#a8ddb5", "#7bccc4", "#4eb3d3", "#2b8cbe", "#08589e"], - 8: ["#f7fcf0", "#e0f3db", "#ccebc5", "#a8ddb5", "#7bccc4", "#4eb3d3", "#2b8cbe", "#08589e"], - 9: ["#f7fcf0", "#e0f3db", "#ccebc5", "#a8ddb5", "#7bccc4", "#4eb3d3", "#2b8cbe", "#0868ac", "#084081"] - }, BuGn: { - 3: ["#e5f5f9", "#99d8c9", "#2ca25f"], - 4: ["#edf8fb", "#b2e2e2", "#66c2a4", "#238b45"], - 5: ["#edf8fb", "#b2e2e2", "#66c2a4", "#2ca25f", "#006d2c"], - 6: ["#edf8fb", "#ccece6", "#99d8c9", "#66c2a4", "#2ca25f", "#006d2c"], - 7: ["#edf8fb", "#ccece6", "#99d8c9", "#66c2a4", "#41ae76", "#238b45", "#005824"], - 8: ["#f7fcfd", "#e5f5f9", "#ccece6", "#99d8c9", "#66c2a4", "#41ae76", "#238b45", "#005824"], - 9: ["#f7fcfd", "#e5f5f9", "#ccece6", "#99d8c9", "#66c2a4", "#41ae76", "#238b45", "#006d2c", "#00441b"] - }, PuBuGn: { - 3: ["#ece2f0", "#a6bddb", "#1c9099"], - 4: ["#f6eff7", "#bdc9e1", "#67a9cf", "#02818a"], - 5: ["#f6eff7", "#bdc9e1", "#67a9cf", "#1c9099", "#016c59"], - 6: ["#f6eff7", "#d0d1e6", "#a6bddb", "#67a9cf", "#1c9099", "#016c59"], - 7: ["#f6eff7", "#d0d1e6", "#a6bddb", "#67a9cf", "#3690c0", "#02818a", "#016450"], - 8: ["#fff7fb", "#ece2f0", "#d0d1e6", "#a6bddb", "#67a9cf", "#3690c0", "#02818a", "#016450"], - 9: ["#fff7fb", "#ece2f0", "#d0d1e6", "#a6bddb", "#67a9cf", "#3690c0", "#02818a", "#016c59", "#014636"] - }, PuBu: { - 3: ["#ece7f2", "#a6bddb", "#2b8cbe"], - 4: ["#f1eef6", "#bdc9e1", "#74a9cf", "#0570b0"], - 5: ["#f1eef6", "#bdc9e1", "#74a9cf", "#2b8cbe", "#045a8d"], - 6: ["#f1eef6", "#d0d1e6", "#a6bddb", "#74a9cf", "#2b8cbe", "#045a8d"], - 7: ["#f1eef6", "#d0d1e6", "#a6bddb", "#74a9cf", "#3690c0", "#0570b0", "#034e7b"], - 8: ["#fff7fb", "#ece7f2", "#d0d1e6", "#a6bddb", "#74a9cf", "#3690c0", "#0570b0", "#034e7b"], - 9: ["#fff7fb", "#ece7f2", "#d0d1e6", "#a6bddb", "#74a9cf", "#3690c0", "#0570b0", "#045a8d", "#023858"] - }, BuPu: { - 3: ["#e0ecf4", "#9ebcda", "#8856a7"], - 4: ["#edf8fb", "#b3cde3", "#8c96c6", "#88419d"], - 5: ["#edf8fb", "#b3cde3", "#8c96c6", "#8856a7", "#810f7c"], - 6: ["#edf8fb", "#bfd3e6", "#9ebcda", "#8c96c6", "#8856a7", "#810f7c"], - 7: ["#edf8fb", "#bfd3e6", "#9ebcda", "#8c96c6", "#8c6bb1", "#88419d", "#6e016b"], - 8: ["#f7fcfd", "#e0ecf4", "#bfd3e6", "#9ebcda", "#8c96c6", "#8c6bb1", "#88419d", "#6e016b"], - 9: ["#f7fcfd", "#e0ecf4", "#bfd3e6", "#9ebcda", "#8c96c6", "#8c6bb1", "#88419d", "#810f7c", "#4d004b"] - }, RdPu: { - 3: ["#fde0dd", "#fa9fb5", "#c51b8a"], - 4: ["#feebe2", "#fbb4b9", "#f768a1", "#ae017e"], - 5: ["#feebe2", "#fbb4b9", "#f768a1", "#c51b8a", "#7a0177"], - 6: ["#feebe2", "#fcc5c0", "#fa9fb5", "#f768a1", "#c51b8a", "#7a0177"], - 7: ["#feebe2", "#fcc5c0", "#fa9fb5", "#f768a1", "#dd3497", "#ae017e", "#7a0177"], - 8: ["#fff7f3", "#fde0dd", "#fcc5c0", "#fa9fb5", "#f768a1", "#dd3497", "#ae017e", "#7a0177"], - 9: ["#fff7f3", "#fde0dd", "#fcc5c0", "#fa9fb5", "#f768a1", "#dd3497", "#ae017e", "#7a0177", "#49006a"] - }, PuRd: { - 3: ["#e7e1ef", "#c994c7", "#dd1c77"], - 4: ["#f1eef6", "#d7b5d8", "#df65b0", "#ce1256"], - 5: ["#f1eef6", "#d7b5d8", "#df65b0", "#dd1c77", "#980043"], - 6: ["#f1eef6", "#d4b9da", "#c994c7", "#df65b0", "#dd1c77", "#980043"], - 7: ["#f1eef6", "#d4b9da", "#c994c7", "#df65b0", "#e7298a", "#ce1256", "#91003f"], - 8: ["#f7f4f9", "#e7e1ef", "#d4b9da", "#c994c7", "#df65b0", "#e7298a", "#ce1256", "#91003f"], - 9: ["#f7f4f9", "#e7e1ef", "#d4b9da", "#c994c7", "#df65b0", "#e7298a", "#ce1256", "#980043", "#67001f"] - }, OrRd: { - 3: ["#fee8c8", "#fdbb84", "#e34a33"], - 4: ["#fef0d9", "#fdcc8a", "#fc8d59", "#d7301f"], - 5: ["#fef0d9", "#fdcc8a", "#fc8d59", "#e34a33", "#b30000"], - 6: ["#fef0d9", "#fdd49e", "#fdbb84", "#fc8d59", "#e34a33", "#b30000"], - 7: ["#fef0d9", "#fdd49e", "#fdbb84", "#fc8d59", "#ef6548", "#d7301f", "#990000"], - 8: ["#fff7ec", "#fee8c8", "#fdd49e", "#fdbb84", "#fc8d59", "#ef6548", "#d7301f", "#990000"], - 9: ["#fff7ec", "#fee8c8", "#fdd49e", "#fdbb84", "#fc8d59", "#ef6548", "#d7301f", "#b30000", "#7f0000"] - }, YlOrRd: { - 3: ["#ffeda0", "#feb24c", "#f03b20"], - 4: ["#ffffb2", "#fecc5c", "#fd8d3c", "#e31a1c"], - 5: ["#ffffb2", "#fecc5c", "#fd8d3c", "#f03b20", "#bd0026"], - 6: ["#ffffb2", "#fed976", "#feb24c", "#fd8d3c", "#f03b20", "#bd0026"], - 7: ["#ffffb2", "#fed976", "#feb24c", "#fd8d3c", "#fc4e2a", "#e31a1c", "#b10026"], - 8: ["#ffffcc", "#ffeda0", "#fed976", "#feb24c", "#fd8d3c", "#fc4e2a", "#e31a1c", "#b10026"], - 9: ["#ffffcc", "#ffeda0", "#fed976", "#feb24c", "#fd8d3c", "#fc4e2a", "#e31a1c", "#bd0026", "#800026"] - }, YlOrBr: { - 3: ["#fff7bc", "#fec44f", "#d95f0e"], - 4: ["#ffffd4", "#fed98e", "#fe9929", "#cc4c02"], - 5: ["#ffffd4", "#fed98e", "#fe9929", "#d95f0e", "#993404"], - 6: ["#ffffd4", "#fee391", "#fec44f", "#fe9929", "#d95f0e", "#993404"], - 7: ["#ffffd4", "#fee391", "#fec44f", "#fe9929", "#ec7014", "#cc4c02", "#8c2d04"], - 8: ["#ffffe5", "#fff7bc", "#fee391", "#fec44f", "#fe9929", "#ec7014", "#cc4c02", "#8c2d04"], - 9: ["#ffffe5", "#fff7bc", "#fee391", "#fec44f", "#fe9929", "#ec7014", "#cc4c02", "#993404", "#662506"] - }, Purples: { - 3: ["#efedf5", "#bcbddc", "#756bb1"], - 4: ["#f2f0f7", "#cbc9e2", "#9e9ac8", "#6a51a3"], - 5: ["#f2f0f7", "#cbc9e2", "#9e9ac8", "#756bb1", "#54278f"], - 6: ["#f2f0f7", "#dadaeb", "#bcbddc", "#9e9ac8", "#756bb1", "#54278f"], - 7: ["#f2f0f7", "#dadaeb", "#bcbddc", "#9e9ac8", "#807dba", "#6a51a3", "#4a1486"], - 8: ["#fcfbfd", "#efedf5", "#dadaeb", "#bcbddc", "#9e9ac8", "#807dba", "#6a51a3", "#4a1486"], - 9: ["#fcfbfd", "#efedf5", "#dadaeb", "#bcbddc", "#9e9ac8", "#807dba", "#6a51a3", "#54278f", "#3f007d"] - }, Blues: { - 3: ["#deebf7", "#9ecae1", "#3182bd"], - 4: ["#eff3ff", "#bdd7e7", "#6baed6", "#2171b5"], - 5: ["#eff3ff", "#bdd7e7", "#6baed6", "#3182bd", "#08519c"], - 6: ["#eff3ff", "#c6dbef", "#9ecae1", "#6baed6", "#3182bd", "#08519c"], - 7: ["#eff3ff", "#c6dbef", "#9ecae1", "#6baed6", "#4292c6", "#2171b5", "#084594"], - 8: ["#f7fbff", "#deebf7", "#c6dbef", "#9ecae1", "#6baed6", "#4292c6", "#2171b5", "#084594"], - 9: ["#f7fbff", "#deebf7", "#c6dbef", "#9ecae1", "#6baed6", "#4292c6", "#2171b5", "#08519c", "#08306b"] - }, Greens: { - 3: ["#e5f5e0", "#a1d99b", "#31a354"], - 4: ["#edf8e9", "#bae4b3", "#74c476", "#238b45"], - 5: ["#edf8e9", "#bae4b3", "#74c476", "#31a354", "#006d2c"], - 6: ["#edf8e9", "#c7e9c0", "#a1d99b", "#74c476", "#31a354", "#006d2c"], - 7: ["#edf8e9", "#c7e9c0", "#a1d99b", "#74c476", "#41ab5d", "#238b45", "#005a32"], - 8: ["#f7fcf5", "#e5f5e0", "#c7e9c0", "#a1d99b", "#74c476", "#41ab5d", "#238b45", "#005a32"], - 9: ["#f7fcf5", "#e5f5e0", "#c7e9c0", "#a1d99b", "#74c476", "#41ab5d", "#238b45", "#006d2c", "#00441b"] - }, Oranges: { - 3: ["#fee6ce", "#fdae6b", "#e6550d"], - 4: ["#feedde", "#fdbe85", "#fd8d3c", "#d94701"], - 5: ["#feedde", "#fdbe85", "#fd8d3c", "#e6550d", "#a63603"], - 6: ["#feedde", "#fdd0a2", "#fdae6b", "#fd8d3c", "#e6550d", "#a63603"], - 7: ["#feedde", "#fdd0a2", "#fdae6b", "#fd8d3c", "#f16913", "#d94801", "#8c2d04"], - 8: ["#fff5eb", "#fee6ce", "#fdd0a2", "#fdae6b", "#fd8d3c", "#f16913", "#d94801", "#8c2d04"], - 9: ["#fff5eb", "#fee6ce", "#fdd0a2", "#fdae6b", "#fd8d3c", "#f16913", "#d94801", "#a63603", "#7f2704"] - }, Reds: { - 3: ["#fee0d2", "#fc9272", "#de2d26"], - 4: ["#fee5d9", "#fcae91", "#fb6a4a", "#cb181d"], - 5: ["#fee5d9", "#fcae91", "#fb6a4a", "#de2d26", "#a50f15"], - 6: ["#fee5d9", "#fcbba1", "#fc9272", "#fb6a4a", "#de2d26", "#a50f15"], - 7: ["#fee5d9", "#fcbba1", "#fc9272", "#fb6a4a", "#ef3b2c", "#cb181d", "#99000d"], - 8: ["#fff5f0", "#fee0d2", "#fcbba1", "#fc9272", "#fb6a4a", "#ef3b2c", "#cb181d", "#99000d"], - 9: ["#fff5f0", "#fee0d2", "#fcbba1", "#fc9272", "#fb6a4a", "#ef3b2c", "#cb181d", "#a50f15", "#67000d"] - }, Greys: { - 3: ["#f0f0f0", "#bdbdbd", "#636363"], - 4: ["#f7f7f7", "#cccccc", "#969696", "#525252"], - 5: ["#f7f7f7", "#cccccc", "#969696", "#636363", "#252525"], - 6: ["#f7f7f7", "#d9d9d9", "#bdbdbd", "#969696", "#636363", "#252525"], - 7: ["#f7f7f7", "#d9d9d9", "#bdbdbd", "#969696", "#737373", "#525252", "#252525"], - 8: ["#ffffff", "#f0f0f0", "#d9d9d9", "#bdbdbd", "#969696", "#737373", "#525252", "#252525"], - 9: ["#ffffff", "#f0f0f0", "#d9d9d9", "#bdbdbd", "#969696", "#737373", "#525252", "#252525", "#000000"] - }, PuOr: { - 3: ["#f1a340", "#f7f7f7", "#998ec3"], - 4: ["#e66101", "#fdb863", "#b2abd2", "#5e3c99"], - 5: ["#e66101", "#fdb863", "#f7f7f7", "#b2abd2", "#5e3c99"], - 6: ["#b35806", "#f1a340", "#fee0b6", "#d8daeb", "#998ec3", "#542788"], - 7: ["#b35806", "#f1a340", "#fee0b6", "#f7f7f7", "#d8daeb", "#998ec3", "#542788"], - 8: ["#b35806", "#e08214", "#fdb863", "#fee0b6", "#d8daeb", "#b2abd2", "#8073ac", "#542788"], - 9: ["#b35806", "#e08214", "#fdb863", "#fee0b6", "#f7f7f7", "#d8daeb", "#b2abd2", "#8073ac", "#542788"], - 10: ["#7f3b08", "#b35806", "#e08214", "#fdb863", "#fee0b6", "#d8daeb", "#b2abd2", "#8073ac", "#542788", "#2d004b"], - 11: ["#7f3b08", "#b35806", "#e08214", "#fdb863", "#fee0b6", "#f7f7f7", "#d8daeb", "#b2abd2", "#8073ac", "#542788", "#2d004b"] - }, BrBG: { - 3: ["#d8b365", "#f5f5f5", "#5ab4ac"], - 4: ["#a6611a", "#dfc27d", "#80cdc1", "#018571"], - 5: ["#a6611a", "#dfc27d", "#f5f5f5", "#80cdc1", "#018571"], - 6: ["#8c510a", "#d8b365", "#f6e8c3", "#c7eae5", "#5ab4ac", "#01665e"], - 7: ["#8c510a", "#d8b365", "#f6e8c3", "#f5f5f5", "#c7eae5", "#5ab4ac", "#01665e"], - 8: ["#8c510a", "#bf812d", "#dfc27d", "#f6e8c3", "#c7eae5", "#80cdc1", "#35978f", "#01665e"], - 9: ["#8c510a", "#bf812d", "#dfc27d", "#f6e8c3", "#f5f5f5", "#c7eae5", "#80cdc1", "#35978f", "#01665e"], - 10: ["#543005", "#8c510a", "#bf812d", "#dfc27d", "#f6e8c3", "#c7eae5", "#80cdc1", "#35978f", "#01665e", "#003c30"], - 11: ["#543005", "#8c510a", "#bf812d", "#dfc27d", "#f6e8c3", "#f5f5f5", "#c7eae5", "#80cdc1", "#35978f", "#01665e", "#003c30"] - }, PRGn: { - 3: ["#af8dc3", "#f7f7f7", "#7fbf7b"], - 4: ["#7b3294", "#c2a5cf", "#a6dba0", "#008837"], - 5: ["#7b3294", "#c2a5cf", "#f7f7f7", "#a6dba0", "#008837"], - 6: ["#762a83", "#af8dc3", "#e7d4e8", "#d9f0d3", "#7fbf7b", "#1b7837"], - 7: ["#762a83", "#af8dc3", "#e7d4e8", "#f7f7f7", "#d9f0d3", "#7fbf7b", "#1b7837"], - 8: ["#762a83", "#9970ab", "#c2a5cf", "#e7d4e8", "#d9f0d3", "#a6dba0", "#5aae61", "#1b7837"], - 9: ["#762a83", "#9970ab", "#c2a5cf", "#e7d4e8", "#f7f7f7", "#d9f0d3", "#a6dba0", "#5aae61", "#1b7837"], - 10: ["#40004b", "#762a83", "#9970ab", "#c2a5cf", "#e7d4e8", "#d9f0d3", "#a6dba0", "#5aae61", "#1b7837", "#00441b"], - 11: ["#40004b", "#762a83", "#9970ab", "#c2a5cf", "#e7d4e8", "#f7f7f7", "#d9f0d3", "#a6dba0", "#5aae61", "#1b7837", "#00441b"] - }, PiYG: { - 3: ["#e9a3c9", "#f7f7f7", "#a1d76a"], - 4: ["#d01c8b", "#f1b6da", "#b8e186", "#4dac26"], - 5: ["#d01c8b", "#f1b6da", "#f7f7f7", "#b8e186", "#4dac26"], - 6: ["#c51b7d", "#e9a3c9", "#fde0ef", "#e6f5d0", "#a1d76a", "#4d9221"], - 7: ["#c51b7d", "#e9a3c9", "#fde0ef", "#f7f7f7", "#e6f5d0", "#a1d76a", "#4d9221"], - 8: ["#c51b7d", "#de77ae", "#f1b6da", "#fde0ef", "#e6f5d0", "#b8e186", "#7fbc41", "#4d9221"], - 9: ["#c51b7d", "#de77ae", "#f1b6da", "#fde0ef", "#f7f7f7", "#e6f5d0", "#b8e186", "#7fbc41", "#4d9221"], - 10: ["#8e0152", "#c51b7d", "#de77ae", "#f1b6da", "#fde0ef", "#e6f5d0", "#b8e186", "#7fbc41", "#4d9221", "#276419"], - 11: ["#8e0152", "#c51b7d", "#de77ae", "#f1b6da", "#fde0ef", "#f7f7f7", "#e6f5d0", "#b8e186", "#7fbc41", "#4d9221", "#276419"] - }, RdBu: { - 3: ["#ef8a62", "#f7f7f7", "#67a9cf"], - 4: ["#ca0020", "#f4a582", "#92c5de", "#0571b0"], - 5: ["#ca0020", "#f4a582", "#f7f7f7", "#92c5de", "#0571b0"], - 6: ["#b2182b", "#ef8a62", "#fddbc7", "#d1e5f0", "#67a9cf", "#2166ac"], - 7: ["#b2182b", "#ef8a62", "#fddbc7", "#f7f7f7", "#d1e5f0", "#67a9cf", "#2166ac"], - 8: ["#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#d1e5f0", "#92c5de", "#4393c3", "#2166ac"], - 9: ["#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#f7f7f7", "#d1e5f0", "#92c5de", "#4393c3", "#2166ac"], - 10: ["#67001f", "#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#d1e5f0", "#92c5de", "#4393c3", "#2166ac", "#053061"], - 11: ["#67001f", "#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#f7f7f7", "#d1e5f0", "#92c5de", "#4393c3", "#2166ac", "#053061"] - }, RdGy: { - 3: ["#ef8a62", "#ffffff", "#999999"], - 4: ["#ca0020", "#f4a582", "#bababa", "#404040"], - 5: ["#ca0020", "#f4a582", "#ffffff", "#bababa", "#404040"], - 6: ["#b2182b", "#ef8a62", "#fddbc7", "#e0e0e0", "#999999", "#4d4d4d"], - 7: ["#b2182b", "#ef8a62", "#fddbc7", "#ffffff", "#e0e0e0", "#999999", "#4d4d4d"], - 8: ["#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#e0e0e0", "#bababa", "#878787", "#4d4d4d"], - 9: ["#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#ffffff", "#e0e0e0", "#bababa", "#878787", "#4d4d4d"], - 10: ["#67001f", "#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#e0e0e0", "#bababa", "#878787", "#4d4d4d", "#1a1a1a"], - 11: ["#67001f", "#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#ffffff", "#e0e0e0", "#bababa", "#878787", "#4d4d4d", "#1a1a1a"] - }, RdYlBu: { - 3: ["#fc8d59", "#ffffbf", "#91bfdb"], - 4: ["#d7191c", "#fdae61", "#abd9e9", "#2c7bb6"], - 5: ["#d7191c", "#fdae61", "#ffffbf", "#abd9e9", "#2c7bb6"], - 6: ["#d73027", "#fc8d59", "#fee090", "#e0f3f8", "#91bfdb", "#4575b4"], - 7: ["#d73027", "#fc8d59", "#fee090", "#ffffbf", "#e0f3f8", "#91bfdb", "#4575b4"], - 8: ["#d73027", "#f46d43", "#fdae61", "#fee090", "#e0f3f8", "#abd9e9", "#74add1", "#4575b4"], - 9: ["#d73027", "#f46d43", "#fdae61", "#fee090", "#ffffbf", "#e0f3f8", "#abd9e9", "#74add1", "#4575b4"], - 10: ["#a50026", "#d73027", "#f46d43", "#fdae61", "#fee090", "#e0f3f8", "#abd9e9", "#74add1", "#4575b4", "#313695"], - 11: ["#a50026", "#d73027", "#f46d43", "#fdae61", "#fee090", "#ffffbf", "#e0f3f8", "#abd9e9", "#74add1", "#4575b4", "#313695"] - }, Spectral: { - 3: ["#fc8d59", "#ffffbf", "#99d594"], - 4: ["#d7191c", "#fdae61", "#abdda4", "#2b83ba"], - 5: ["#d7191c", "#fdae61", "#ffffbf", "#abdda4", "#2b83ba"], - 6: ["#d53e4f", "#fc8d59", "#fee08b", "#e6f598", "#99d594", "#3288bd"], - 7: ["#d53e4f", "#fc8d59", "#fee08b", "#ffffbf", "#e6f598", "#99d594", "#3288bd"], - 8: ["#d53e4f", "#f46d43", "#fdae61", "#fee08b", "#e6f598", "#abdda4", "#66c2a5", "#3288bd"], - 9: ["#d53e4f", "#f46d43", "#fdae61", "#fee08b", "#ffffbf", "#e6f598", "#abdda4", "#66c2a5", "#3288bd"], - 10: ["#9e0142", "#d53e4f", "#f46d43", "#fdae61", "#fee08b", "#e6f598", "#abdda4", "#66c2a5", "#3288bd", "#5e4fa2"], - 11: ["#9e0142", "#d53e4f", "#f46d43", "#fdae61", "#fee08b", "#ffffbf", "#e6f598", "#abdda4", "#66c2a5", "#3288bd", "#5e4fa2"] - }, RdYlGn: { - 3: ["#fc8d59", "#ffffbf", "#91cf60"], - 4: ["#d7191c", "#fdae61", "#a6d96a", "#1a9641"], - 5: ["#d7191c", "#fdae61", "#ffffbf", "#a6d96a", "#1a9641"], - 6: ["#d73027", "#fc8d59", "#fee08b", "#d9ef8b", "#91cf60", "#1a9850"], - 7: ["#d73027", "#fc8d59", "#fee08b", "#ffffbf", "#d9ef8b", "#91cf60", "#1a9850"], - 8: ["#d73027", "#f46d43", "#fdae61", "#fee08b", "#d9ef8b", "#a6d96a", "#66bd63", "#1a9850"], - 9: ["#d73027", "#f46d43", "#fdae61", "#fee08b", "#ffffbf", "#d9ef8b", "#a6d96a", "#66bd63", "#1a9850"], - 10: ["#a50026", "#d73027", "#f46d43", "#fdae61", "#fee08b", "#d9ef8b", "#a6d96a", "#66bd63", "#1a9850", "#006837"], - 11: ["#a50026", "#d73027", "#f46d43", "#fdae61", "#fee08b", "#ffffbf", "#d9ef8b", "#a6d96a", "#66bd63", "#1a9850", "#006837"] - }, Accent: { - 3: ["#7fc97f", "#beaed4", "#fdc086"], - 4: ["#7fc97f", "#beaed4", "#fdc086", "#ffff99"], - 5: ["#7fc97f", "#beaed4", "#fdc086", "#ffff99", "#386cb0"], - 6: ["#7fc97f", "#beaed4", "#fdc086", "#ffff99", "#386cb0", "#f0027f"], - 7: ["#7fc97f", "#beaed4", "#fdc086", "#ffff99", "#386cb0", "#f0027f", "#bf5b17"], - 8: ["#7fc97f", "#beaed4", "#fdc086", "#ffff99", "#386cb0", "#f0027f", "#bf5b17", "#666666"] - }, Dark2: { - 3: ["#1b9e77", "#d95f02", "#7570b3"], - 4: ["#1b9e77", "#d95f02", "#7570b3", "#e7298a"], - 5: ["#1b9e77", "#d95f02", "#7570b3", "#e7298a", "#66a61e"], - 6: ["#1b9e77", "#d95f02", "#7570b3", "#e7298a", "#66a61e", "#e6ab02"], - 7: ["#1b9e77", "#d95f02", "#7570b3", "#e7298a", "#66a61e", "#e6ab02", "#a6761d"], - 8: ["#1b9e77", "#d95f02", "#7570b3", "#e7298a", "#66a61e", "#e6ab02", "#a6761d", "#666666"] - }, Paired: { - 3: ["#a6cee3", "#1f78b4", "#b2df8a"], - 4: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c"], - 5: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99"], - 6: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", "#e31a1c"], - 7: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", "#e31a1c", "#fdbf6f"], - 8: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", "#e31a1c", "#fdbf6f", "#ff7f00"], - 9: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", "#e31a1c", "#fdbf6f", "#ff7f00", "#cab2d6"], - 10: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", "#e31a1c", "#fdbf6f", "#ff7f00", "#cab2d6", "#6a3d9a"], - 11: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", "#e31a1c", "#fdbf6f", "#ff7f00", "#cab2d6", "#6a3d9a", "#ffff99"], - 12: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", "#e31a1c", "#fdbf6f", "#ff7f00", "#cab2d6", "#6a3d9a", "#ffff99", "#b15928"] - }, Pastel1: { - 3: ["#fbb4ae", "#b3cde3", "#ccebc5"], - 4: ["#fbb4ae", "#b3cde3", "#ccebc5", "#decbe4"], - 5: ["#fbb4ae", "#b3cde3", "#ccebc5", "#decbe4", "#fed9a6"], - 6: ["#fbb4ae", "#b3cde3", "#ccebc5", "#decbe4", "#fed9a6", "#ffffcc"], - 7: ["#fbb4ae", "#b3cde3", "#ccebc5", "#decbe4", "#fed9a6", "#ffffcc", "#e5d8bd"], - 8: ["#fbb4ae", "#b3cde3", "#ccebc5", "#decbe4", "#fed9a6", "#ffffcc", "#e5d8bd", "#fddaec"], - 9: ["#fbb4ae", "#b3cde3", "#ccebc5", "#decbe4", "#fed9a6", "#ffffcc", "#e5d8bd", "#fddaec", "#f2f2f2"] - }, Pastel2: { - 3: ["#b3e2cd", "#fdcdac", "#cbd5e8"], - 4: ["#b3e2cd", "#fdcdac", "#cbd5e8", "#f4cae4"], - 5: ["#b3e2cd", "#fdcdac", "#cbd5e8", "#f4cae4", "#e6f5c9"], - 6: ["#b3e2cd", "#fdcdac", "#cbd5e8", "#f4cae4", "#e6f5c9", "#fff2ae"], - 7: ["#b3e2cd", "#fdcdac", "#cbd5e8", "#f4cae4", "#e6f5c9", "#fff2ae", "#f1e2cc"], - 8: ["#b3e2cd", "#fdcdac", "#cbd5e8", "#f4cae4", "#e6f5c9", "#fff2ae", "#f1e2cc", "#cccccc"] - }, Set1: { - 3: ["#e41a1c", "#377eb8", "#4daf4a"], - 4: ["#e41a1c", "#377eb8", "#4daf4a", "#984ea3"], - 5: ["#e41a1c", "#377eb8", "#4daf4a", "#984ea3", "#ff7f00"], - 6: ["#e41a1c", "#377eb8", "#4daf4a", "#984ea3", "#ff7f00", "#ffff33"], - 7: ["#e41a1c", "#377eb8", "#4daf4a", "#984ea3", "#ff7f00", "#ffff33", "#a65628"], - 8: ["#e41a1c", "#377eb8", "#4daf4a", "#984ea3", "#ff7f00", "#ffff33", "#a65628", "#f781bf"], - 9: ["#e41a1c", "#377eb8", "#4daf4a", "#984ea3", "#ff7f00", "#ffff33", "#a65628", "#f781bf", "#999999"] - }, Set2: { - 3: ["#66c2a5", "#fc8d62", "#8da0cb"], - 4: ["#66c2a5", "#fc8d62", "#8da0cb", "#e78ac3"], - 5: ["#66c2a5", "#fc8d62", "#8da0cb", "#e78ac3", "#a6d854"], - 6: ["#66c2a5", "#fc8d62", "#8da0cb", "#e78ac3", "#a6d854", "#ffd92f"], - 7: ["#66c2a5", "#fc8d62", "#8da0cb", "#e78ac3", "#a6d854", "#ffd92f", "#e5c494"], - 8: ["#66c2a5", "#fc8d62", "#8da0cb", "#e78ac3", "#a6d854", "#ffd92f", "#e5c494", "#b3b3b3"] - }, Set3: { - 3: ["#8dd3c7", "#ffffb3", "#bebada"], - 4: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072"], - 5: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3"], - 6: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462"], - 7: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462", "#b3de69"], - 8: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462", "#b3de69", "#fccde5"], - 9: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462", "#b3de69", "#fccde5", "#d9d9d9"], - 10: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462", "#b3de69", "#fccde5", "#d9d9d9", "#bc80bd"], - 11: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462", "#b3de69", "#fccde5", "#d9d9d9", "#bc80bd", "#ccebc5"], - 12: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462", "#b3de69", "#fccde5", "#d9d9d9", "#bc80bd", "#ccebc5", "#ffed6f"] - } - }; - var tauBrewer = function (hueSet, colorNumber) { - return colorbrewer[hueSet][colorNumber].map(function (element, index) { - return hueSet + ' ' + 'q' + index + '-' + colorNumber; - }); - }; - tauCharts.api.colorBrewers.add('tauBrewer', tauBrewer); - return tauBrewer; +(function (definition) { + if (typeof define === "function" && define.amd) { + define(['tauCharts'], function (tauCharts) { + return definition(tauCharts); + }); + } else if (typeof module === "object" && module.exports) { + var tauCharts = require('tauCharts'); + module.exports = definition(tauCharts); + } else { + definition(this.tauCharts); + } +})(function (tauCharts) { + // This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/). + var colorbrewer = { + YlGn: { + 3: ["#f7fcb9", "#addd8e", "#31a354"], + 4: ["#ffffcc", "#c2e699", "#78c679", "#238443"], + 5: ["#ffffcc", "#c2e699", "#78c679", "#31a354", "#006837"], + 6: ["#ffffcc", "#d9f0a3", "#addd8e", "#78c679", "#31a354", "#006837"], + 7: ["#ffffcc", "#d9f0a3", "#addd8e", "#78c679", "#41ab5d", "#238443", "#005a32"], + 8: ["#ffffe5", "#f7fcb9", "#d9f0a3", "#addd8e", "#78c679", "#41ab5d", "#238443", "#005a32"], + 9: ["#ffffe5", "#f7fcb9", "#d9f0a3", "#addd8e", "#78c679", "#41ab5d", "#238443", "#006837", "#004529"] + }, YlGnBu: { + 3: ["#edf8b1", "#7fcdbb", "#2c7fb8"], + 4: ["#ffffcc", "#a1dab4", "#41b6c4", "#225ea8"], + 5: ["#ffffcc", "#a1dab4", "#41b6c4", "#2c7fb8", "#253494"], + 6: ["#ffffcc", "#c7e9b4", "#7fcdbb", "#41b6c4", "#2c7fb8", "#253494"], + 7: ["#ffffcc", "#c7e9b4", "#7fcdbb", "#41b6c4", "#1d91c0", "#225ea8", "#0c2c84"], + 8: ["#ffffd9", "#edf8b1", "#c7e9b4", "#7fcdbb", "#41b6c4", "#1d91c0", "#225ea8", "#0c2c84"], + 9: ["#ffffd9", "#edf8b1", "#c7e9b4", "#7fcdbb", "#41b6c4", "#1d91c0", "#225ea8", "#253494", "#081d58"] + }, GnBu: { + 3: ["#e0f3db", "#a8ddb5", "#43a2ca"], + 4: ["#f0f9e8", "#bae4bc", "#7bccc4", "#2b8cbe"], + 5: ["#f0f9e8", "#bae4bc", "#7bccc4", "#43a2ca", "#0868ac"], + 6: ["#f0f9e8", "#ccebc5", "#a8ddb5", "#7bccc4", "#43a2ca", "#0868ac"], + 7: ["#f0f9e8", "#ccebc5", "#a8ddb5", "#7bccc4", "#4eb3d3", "#2b8cbe", "#08589e"], + 8: ["#f7fcf0", "#e0f3db", "#ccebc5", "#a8ddb5", "#7bccc4", "#4eb3d3", "#2b8cbe", "#08589e"], + 9: ["#f7fcf0", "#e0f3db", "#ccebc5", "#a8ddb5", "#7bccc4", "#4eb3d3", "#2b8cbe", "#0868ac", "#084081"] + }, BuGn: { + 3: ["#e5f5f9", "#99d8c9", "#2ca25f"], + 4: ["#edf8fb", "#b2e2e2", "#66c2a4", "#238b45"], + 5: ["#edf8fb", "#b2e2e2", "#66c2a4", "#2ca25f", "#006d2c"], + 6: ["#edf8fb", "#ccece6", "#99d8c9", "#66c2a4", "#2ca25f", "#006d2c"], + 7: ["#edf8fb", "#ccece6", "#99d8c9", "#66c2a4", "#41ae76", "#238b45", "#005824"], + 8: ["#f7fcfd", "#e5f5f9", "#ccece6", "#99d8c9", "#66c2a4", "#41ae76", "#238b45", "#005824"], + 9: ["#f7fcfd", "#e5f5f9", "#ccece6", "#99d8c9", "#66c2a4", "#41ae76", "#238b45", "#006d2c", "#00441b"] + }, PuBuGn: { + 3: ["#ece2f0", "#a6bddb", "#1c9099"], + 4: ["#f6eff7", "#bdc9e1", "#67a9cf", "#02818a"], + 5: ["#f6eff7", "#bdc9e1", "#67a9cf", "#1c9099", "#016c59"], + 6: ["#f6eff7", "#d0d1e6", "#a6bddb", "#67a9cf", "#1c9099", "#016c59"], + 7: ["#f6eff7", "#d0d1e6", "#a6bddb", "#67a9cf", "#3690c0", "#02818a", "#016450"], + 8: ["#fff7fb", "#ece2f0", "#d0d1e6", "#a6bddb", "#67a9cf", "#3690c0", "#02818a", "#016450"], + 9: ["#fff7fb", "#ece2f0", "#d0d1e6", "#a6bddb", "#67a9cf", "#3690c0", "#02818a", "#016c59", "#014636"] + }, PuBu: { + 3: ["#ece7f2", "#a6bddb", "#2b8cbe"], + 4: ["#f1eef6", "#bdc9e1", "#74a9cf", "#0570b0"], + 5: ["#f1eef6", "#bdc9e1", "#74a9cf", "#2b8cbe", "#045a8d"], + 6: ["#f1eef6", "#d0d1e6", "#a6bddb", "#74a9cf", "#2b8cbe", "#045a8d"], + 7: ["#f1eef6", "#d0d1e6", "#a6bddb", "#74a9cf", "#3690c0", "#0570b0", "#034e7b"], + 8: ["#fff7fb", "#ece7f2", "#d0d1e6", "#a6bddb", "#74a9cf", "#3690c0", "#0570b0", "#034e7b"], + 9: ["#fff7fb", "#ece7f2", "#d0d1e6", "#a6bddb", "#74a9cf", "#3690c0", "#0570b0", "#045a8d", "#023858"] + }, BuPu: { + 3: ["#e0ecf4", "#9ebcda", "#8856a7"], + 4: ["#edf8fb", "#b3cde3", "#8c96c6", "#88419d"], + 5: ["#edf8fb", "#b3cde3", "#8c96c6", "#8856a7", "#810f7c"], + 6: ["#edf8fb", "#bfd3e6", "#9ebcda", "#8c96c6", "#8856a7", "#810f7c"], + 7: ["#edf8fb", "#bfd3e6", "#9ebcda", "#8c96c6", "#8c6bb1", "#88419d", "#6e016b"], + 8: ["#f7fcfd", "#e0ecf4", "#bfd3e6", "#9ebcda", "#8c96c6", "#8c6bb1", "#88419d", "#6e016b"], + 9: ["#f7fcfd", "#e0ecf4", "#bfd3e6", "#9ebcda", "#8c96c6", "#8c6bb1", "#88419d", "#810f7c", "#4d004b"] + }, RdPu: { + 3: ["#fde0dd", "#fa9fb5", "#c51b8a"], + 4: ["#feebe2", "#fbb4b9", "#f768a1", "#ae017e"], + 5: ["#feebe2", "#fbb4b9", "#f768a1", "#c51b8a", "#7a0177"], + 6: ["#feebe2", "#fcc5c0", "#fa9fb5", "#f768a1", "#c51b8a", "#7a0177"], + 7: ["#feebe2", "#fcc5c0", "#fa9fb5", "#f768a1", "#dd3497", "#ae017e", "#7a0177"], + 8: ["#fff7f3", "#fde0dd", "#fcc5c0", "#fa9fb5", "#f768a1", "#dd3497", "#ae017e", "#7a0177"], + 9: ["#fff7f3", "#fde0dd", "#fcc5c0", "#fa9fb5", "#f768a1", "#dd3497", "#ae017e", "#7a0177", "#49006a"] + }, PuRd: { + 3: ["#e7e1ef", "#c994c7", "#dd1c77"], + 4: ["#f1eef6", "#d7b5d8", "#df65b0", "#ce1256"], + 5: ["#f1eef6", "#d7b5d8", "#df65b0", "#dd1c77", "#980043"], + 6: ["#f1eef6", "#d4b9da", "#c994c7", "#df65b0", "#dd1c77", "#980043"], + 7: ["#f1eef6", "#d4b9da", "#c994c7", "#df65b0", "#e7298a", "#ce1256", "#91003f"], + 8: ["#f7f4f9", "#e7e1ef", "#d4b9da", "#c994c7", "#df65b0", "#e7298a", "#ce1256", "#91003f"], + 9: ["#f7f4f9", "#e7e1ef", "#d4b9da", "#c994c7", "#df65b0", "#e7298a", "#ce1256", "#980043", "#67001f"] + }, OrRd: { + 3: ["#fee8c8", "#fdbb84", "#e34a33"], + 4: ["#fef0d9", "#fdcc8a", "#fc8d59", "#d7301f"], + 5: ["#fef0d9", "#fdcc8a", "#fc8d59", "#e34a33", "#b30000"], + 6: ["#fef0d9", "#fdd49e", "#fdbb84", "#fc8d59", "#e34a33", "#b30000"], + 7: ["#fef0d9", "#fdd49e", "#fdbb84", "#fc8d59", "#ef6548", "#d7301f", "#990000"], + 8: ["#fff7ec", "#fee8c8", "#fdd49e", "#fdbb84", "#fc8d59", "#ef6548", "#d7301f", "#990000"], + 9: ["#fff7ec", "#fee8c8", "#fdd49e", "#fdbb84", "#fc8d59", "#ef6548", "#d7301f", "#b30000", "#7f0000"] + }, YlOrRd: { + 3: ["#ffeda0", "#feb24c", "#f03b20"], + 4: ["#ffffb2", "#fecc5c", "#fd8d3c", "#e31a1c"], + 5: ["#ffffb2", "#fecc5c", "#fd8d3c", "#f03b20", "#bd0026"], + 6: ["#ffffb2", "#fed976", "#feb24c", "#fd8d3c", "#f03b20", "#bd0026"], + 7: ["#ffffb2", "#fed976", "#feb24c", "#fd8d3c", "#fc4e2a", "#e31a1c", "#b10026"], + 8: ["#ffffcc", "#ffeda0", "#fed976", "#feb24c", "#fd8d3c", "#fc4e2a", "#e31a1c", "#b10026"], + 9: ["#ffffcc", "#ffeda0", "#fed976", "#feb24c", "#fd8d3c", "#fc4e2a", "#e31a1c", "#bd0026", "#800026"] + }, YlOrBr: { + 3: ["#fff7bc", "#fec44f", "#d95f0e"], + 4: ["#ffffd4", "#fed98e", "#fe9929", "#cc4c02"], + 5: ["#ffffd4", "#fed98e", "#fe9929", "#d95f0e", "#993404"], + 6: ["#ffffd4", "#fee391", "#fec44f", "#fe9929", "#d95f0e", "#993404"], + 7: ["#ffffd4", "#fee391", "#fec44f", "#fe9929", "#ec7014", "#cc4c02", "#8c2d04"], + 8: ["#ffffe5", "#fff7bc", "#fee391", "#fec44f", "#fe9929", "#ec7014", "#cc4c02", "#8c2d04"], + 9: ["#ffffe5", "#fff7bc", "#fee391", "#fec44f", "#fe9929", "#ec7014", "#cc4c02", "#993404", "#662506"] + }, Purples: { + 3: ["#efedf5", "#bcbddc", "#756bb1"], + 4: ["#f2f0f7", "#cbc9e2", "#9e9ac8", "#6a51a3"], + 5: ["#f2f0f7", "#cbc9e2", "#9e9ac8", "#756bb1", "#54278f"], + 6: ["#f2f0f7", "#dadaeb", "#bcbddc", "#9e9ac8", "#756bb1", "#54278f"], + 7: ["#f2f0f7", "#dadaeb", "#bcbddc", "#9e9ac8", "#807dba", "#6a51a3", "#4a1486"], + 8: ["#fcfbfd", "#efedf5", "#dadaeb", "#bcbddc", "#9e9ac8", "#807dba", "#6a51a3", "#4a1486"], + 9: ["#fcfbfd", "#efedf5", "#dadaeb", "#bcbddc", "#9e9ac8", "#807dba", "#6a51a3", "#54278f", "#3f007d"] + }, Blues: { + 3: ["#deebf7", "#9ecae1", "#3182bd"], + 4: ["#eff3ff", "#bdd7e7", "#6baed6", "#2171b5"], + 5: ["#eff3ff", "#bdd7e7", "#6baed6", "#3182bd", "#08519c"], + 6: ["#eff3ff", "#c6dbef", "#9ecae1", "#6baed6", "#3182bd", "#08519c"], + 7: ["#eff3ff", "#c6dbef", "#9ecae1", "#6baed6", "#4292c6", "#2171b5", "#084594"], + 8: ["#f7fbff", "#deebf7", "#c6dbef", "#9ecae1", "#6baed6", "#4292c6", "#2171b5", "#084594"], + 9: ["#f7fbff", "#deebf7", "#c6dbef", "#9ecae1", "#6baed6", "#4292c6", "#2171b5", "#08519c", "#08306b"] + }, Greens: { + 3: ["#e5f5e0", "#a1d99b", "#31a354"], + 4: ["#edf8e9", "#bae4b3", "#74c476", "#238b45"], + 5: ["#edf8e9", "#bae4b3", "#74c476", "#31a354", "#006d2c"], + 6: ["#edf8e9", "#c7e9c0", "#a1d99b", "#74c476", "#31a354", "#006d2c"], + 7: ["#edf8e9", "#c7e9c0", "#a1d99b", "#74c476", "#41ab5d", "#238b45", "#005a32"], + 8: ["#f7fcf5", "#e5f5e0", "#c7e9c0", "#a1d99b", "#74c476", "#41ab5d", "#238b45", "#005a32"], + 9: ["#f7fcf5", "#e5f5e0", "#c7e9c0", "#a1d99b", "#74c476", "#41ab5d", "#238b45", "#006d2c", "#00441b"] + }, Oranges: { + 3: ["#fee6ce", "#fdae6b", "#e6550d"], + 4: ["#feedde", "#fdbe85", "#fd8d3c", "#d94701"], + 5: ["#feedde", "#fdbe85", "#fd8d3c", "#e6550d", "#a63603"], + 6: ["#feedde", "#fdd0a2", "#fdae6b", "#fd8d3c", "#e6550d", "#a63603"], + 7: ["#feedde", "#fdd0a2", "#fdae6b", "#fd8d3c", "#f16913", "#d94801", "#8c2d04"], + 8: ["#fff5eb", "#fee6ce", "#fdd0a2", "#fdae6b", "#fd8d3c", "#f16913", "#d94801", "#8c2d04"], + 9: ["#fff5eb", "#fee6ce", "#fdd0a2", "#fdae6b", "#fd8d3c", "#f16913", "#d94801", "#a63603", "#7f2704"] + }, Reds: { + 3: ["#fee0d2", "#fc9272", "#de2d26"], + 4: ["#fee5d9", "#fcae91", "#fb6a4a", "#cb181d"], + 5: ["#fee5d9", "#fcae91", "#fb6a4a", "#de2d26", "#a50f15"], + 6: ["#fee5d9", "#fcbba1", "#fc9272", "#fb6a4a", "#de2d26", "#a50f15"], + 7: ["#fee5d9", "#fcbba1", "#fc9272", "#fb6a4a", "#ef3b2c", "#cb181d", "#99000d"], + 8: ["#fff5f0", "#fee0d2", "#fcbba1", "#fc9272", "#fb6a4a", "#ef3b2c", "#cb181d", "#99000d"], + 9: ["#fff5f0", "#fee0d2", "#fcbba1", "#fc9272", "#fb6a4a", "#ef3b2c", "#cb181d", "#a50f15", "#67000d"] + }, Greys: { + 3: ["#f0f0f0", "#bdbdbd", "#636363"], + 4: ["#f7f7f7", "#cccccc", "#969696", "#525252"], + 5: ["#f7f7f7", "#cccccc", "#969696", "#636363", "#252525"], + 6: ["#f7f7f7", "#d9d9d9", "#bdbdbd", "#969696", "#636363", "#252525"], + 7: ["#f7f7f7", "#d9d9d9", "#bdbdbd", "#969696", "#737373", "#525252", "#252525"], + 8: ["#ffffff", "#f0f0f0", "#d9d9d9", "#bdbdbd", "#969696", "#737373", "#525252", "#252525"], + 9: ["#ffffff", "#f0f0f0", "#d9d9d9", "#bdbdbd", "#969696", "#737373", "#525252", "#252525", "#000000"] + }, PuOr: { + 3: ["#f1a340", "#f7f7f7", "#998ec3"], + 4: ["#e66101", "#fdb863", "#b2abd2", "#5e3c99"], + 5: ["#e66101", "#fdb863", "#f7f7f7", "#b2abd2", "#5e3c99"], + 6: ["#b35806", "#f1a340", "#fee0b6", "#d8daeb", "#998ec3", "#542788"], + 7: ["#b35806", "#f1a340", "#fee0b6", "#f7f7f7", "#d8daeb", "#998ec3", "#542788"], + 8: ["#b35806", "#e08214", "#fdb863", "#fee0b6", "#d8daeb", "#b2abd2", "#8073ac", "#542788"], + 9: ["#b35806", "#e08214", "#fdb863", "#fee0b6", "#f7f7f7", "#d8daeb", "#b2abd2", "#8073ac", "#542788"], + 10: ["#7f3b08", "#b35806", "#e08214", "#fdb863", "#fee0b6", "#d8daeb", "#b2abd2", "#8073ac", "#542788", "#2d004b"], + 11: ["#7f3b08", "#b35806", "#e08214", "#fdb863", "#fee0b6", "#f7f7f7", "#d8daeb", "#b2abd2", "#8073ac", "#542788", "#2d004b"] + }, BrBG: { + 3: ["#d8b365", "#f5f5f5", "#5ab4ac"], + 4: ["#a6611a", "#dfc27d", "#80cdc1", "#018571"], + 5: ["#a6611a", "#dfc27d", "#f5f5f5", "#80cdc1", "#018571"], + 6: ["#8c510a", "#d8b365", "#f6e8c3", "#c7eae5", "#5ab4ac", "#01665e"], + 7: ["#8c510a", "#d8b365", "#f6e8c3", "#f5f5f5", "#c7eae5", "#5ab4ac", "#01665e"], + 8: ["#8c510a", "#bf812d", "#dfc27d", "#f6e8c3", "#c7eae5", "#80cdc1", "#35978f", "#01665e"], + 9: ["#8c510a", "#bf812d", "#dfc27d", "#f6e8c3", "#f5f5f5", "#c7eae5", "#80cdc1", "#35978f", "#01665e"], + 10: ["#543005", "#8c510a", "#bf812d", "#dfc27d", "#f6e8c3", "#c7eae5", "#80cdc1", "#35978f", "#01665e", "#003c30"], + 11: ["#543005", "#8c510a", "#bf812d", "#dfc27d", "#f6e8c3", "#f5f5f5", "#c7eae5", "#80cdc1", "#35978f", "#01665e", "#003c30"] + }, PRGn: { + 3: ["#af8dc3", "#f7f7f7", "#7fbf7b"], + 4: ["#7b3294", "#c2a5cf", "#a6dba0", "#008837"], + 5: ["#7b3294", "#c2a5cf", "#f7f7f7", "#a6dba0", "#008837"], + 6: ["#762a83", "#af8dc3", "#e7d4e8", "#d9f0d3", "#7fbf7b", "#1b7837"], + 7: ["#762a83", "#af8dc3", "#e7d4e8", "#f7f7f7", "#d9f0d3", "#7fbf7b", "#1b7837"], + 8: ["#762a83", "#9970ab", "#c2a5cf", "#e7d4e8", "#d9f0d3", "#a6dba0", "#5aae61", "#1b7837"], + 9: ["#762a83", "#9970ab", "#c2a5cf", "#e7d4e8", "#f7f7f7", "#d9f0d3", "#a6dba0", "#5aae61", "#1b7837"], + 10: ["#40004b", "#762a83", "#9970ab", "#c2a5cf", "#e7d4e8", "#d9f0d3", "#a6dba0", "#5aae61", "#1b7837", "#00441b"], + 11: ["#40004b", "#762a83", "#9970ab", "#c2a5cf", "#e7d4e8", "#f7f7f7", "#d9f0d3", "#a6dba0", "#5aae61", "#1b7837", "#00441b"] + }, PiYG: { + 3: ["#e9a3c9", "#f7f7f7", "#a1d76a"], + 4: ["#d01c8b", "#f1b6da", "#b8e186", "#4dac26"], + 5: ["#d01c8b", "#f1b6da", "#f7f7f7", "#b8e186", "#4dac26"], + 6: ["#c51b7d", "#e9a3c9", "#fde0ef", "#e6f5d0", "#a1d76a", "#4d9221"], + 7: ["#c51b7d", "#e9a3c9", "#fde0ef", "#f7f7f7", "#e6f5d0", "#a1d76a", "#4d9221"], + 8: ["#c51b7d", "#de77ae", "#f1b6da", "#fde0ef", "#e6f5d0", "#b8e186", "#7fbc41", "#4d9221"], + 9: ["#c51b7d", "#de77ae", "#f1b6da", "#fde0ef", "#f7f7f7", "#e6f5d0", "#b8e186", "#7fbc41", "#4d9221"], + 10: ["#8e0152", "#c51b7d", "#de77ae", "#f1b6da", "#fde0ef", "#e6f5d0", "#b8e186", "#7fbc41", "#4d9221", "#276419"], + 11: ["#8e0152", "#c51b7d", "#de77ae", "#f1b6da", "#fde0ef", "#f7f7f7", "#e6f5d0", "#b8e186", "#7fbc41", "#4d9221", "#276419"] + }, RdBu: { + 3: ["#ef8a62", "#f7f7f7", "#67a9cf"], + 4: ["#ca0020", "#f4a582", "#92c5de", "#0571b0"], + 5: ["#ca0020", "#f4a582", "#f7f7f7", "#92c5de", "#0571b0"], + 6: ["#b2182b", "#ef8a62", "#fddbc7", "#d1e5f0", "#67a9cf", "#2166ac"], + 7: ["#b2182b", "#ef8a62", "#fddbc7", "#f7f7f7", "#d1e5f0", "#67a9cf", "#2166ac"], + 8: ["#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#d1e5f0", "#92c5de", "#4393c3", "#2166ac"], + 9: ["#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#f7f7f7", "#d1e5f0", "#92c5de", "#4393c3", "#2166ac"], + 10: ["#67001f", "#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#d1e5f0", "#92c5de", "#4393c3", "#2166ac", "#053061"], + 11: ["#67001f", "#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#f7f7f7", "#d1e5f0", "#92c5de", "#4393c3", "#2166ac", "#053061"] + }, RdGy: { + 3: ["#ef8a62", "#ffffff", "#999999"], + 4: ["#ca0020", "#f4a582", "#bababa", "#404040"], + 5: ["#ca0020", "#f4a582", "#ffffff", "#bababa", "#404040"], + 6: ["#b2182b", "#ef8a62", "#fddbc7", "#e0e0e0", "#999999", "#4d4d4d"], + 7: ["#b2182b", "#ef8a62", "#fddbc7", "#ffffff", "#e0e0e0", "#999999", "#4d4d4d"], + 8: ["#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#e0e0e0", "#bababa", "#878787", "#4d4d4d"], + 9: ["#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#ffffff", "#e0e0e0", "#bababa", "#878787", "#4d4d4d"], + 10: ["#67001f", "#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#e0e0e0", "#bababa", "#878787", "#4d4d4d", "#1a1a1a"], + 11: ["#67001f", "#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#ffffff", "#e0e0e0", "#bababa", "#878787", "#4d4d4d", "#1a1a1a"] + }, RdYlBu: { + 3: ["#fc8d59", "#ffffbf", "#91bfdb"], + 4: ["#d7191c", "#fdae61", "#abd9e9", "#2c7bb6"], + 5: ["#d7191c", "#fdae61", "#ffffbf", "#abd9e9", "#2c7bb6"], + 6: ["#d73027", "#fc8d59", "#fee090", "#e0f3f8", "#91bfdb", "#4575b4"], + 7: ["#d73027", "#fc8d59", "#fee090", "#ffffbf", "#e0f3f8", "#91bfdb", "#4575b4"], + 8: ["#d73027", "#f46d43", "#fdae61", "#fee090", "#e0f3f8", "#abd9e9", "#74add1", "#4575b4"], + 9: ["#d73027", "#f46d43", "#fdae61", "#fee090", "#ffffbf", "#e0f3f8", "#abd9e9", "#74add1", "#4575b4"], + 10: ["#a50026", "#d73027", "#f46d43", "#fdae61", "#fee090", "#e0f3f8", "#abd9e9", "#74add1", "#4575b4", "#313695"], + 11: ["#a50026", "#d73027", "#f46d43", "#fdae61", "#fee090", "#ffffbf", "#e0f3f8", "#abd9e9", "#74add1", "#4575b4", "#313695"] + }, Spectral: { + 3: ["#fc8d59", "#ffffbf", "#99d594"], + 4: ["#d7191c", "#fdae61", "#abdda4", "#2b83ba"], + 5: ["#d7191c", "#fdae61", "#ffffbf", "#abdda4", "#2b83ba"], + 6: ["#d53e4f", "#fc8d59", "#fee08b", "#e6f598", "#99d594", "#3288bd"], + 7: ["#d53e4f", "#fc8d59", "#fee08b", "#ffffbf", "#e6f598", "#99d594", "#3288bd"], + 8: ["#d53e4f", "#f46d43", "#fdae61", "#fee08b", "#e6f598", "#abdda4", "#66c2a5", "#3288bd"], + 9: ["#d53e4f", "#f46d43", "#fdae61", "#fee08b", "#ffffbf", "#e6f598", "#abdda4", "#66c2a5", "#3288bd"], + 10: ["#9e0142", "#d53e4f", "#f46d43", "#fdae61", "#fee08b", "#e6f598", "#abdda4", "#66c2a5", "#3288bd", "#5e4fa2"], + 11: ["#9e0142", "#d53e4f", "#f46d43", "#fdae61", "#fee08b", "#ffffbf", "#e6f598", "#abdda4", "#66c2a5", "#3288bd", "#5e4fa2"] + }, RdYlGn: { + 3: ["#fc8d59", "#ffffbf", "#91cf60"], + 4: ["#d7191c", "#fdae61", "#a6d96a", "#1a9641"], + 5: ["#d7191c", "#fdae61", "#ffffbf", "#a6d96a", "#1a9641"], + 6: ["#d73027", "#fc8d59", "#fee08b", "#d9ef8b", "#91cf60", "#1a9850"], + 7: ["#d73027", "#fc8d59", "#fee08b", "#ffffbf", "#d9ef8b", "#91cf60", "#1a9850"], + 8: ["#d73027", "#f46d43", "#fdae61", "#fee08b", "#d9ef8b", "#a6d96a", "#66bd63", "#1a9850"], + 9: ["#d73027", "#f46d43", "#fdae61", "#fee08b", "#ffffbf", "#d9ef8b", "#a6d96a", "#66bd63", "#1a9850"], + 10: ["#a50026", "#d73027", "#f46d43", "#fdae61", "#fee08b", "#d9ef8b", "#a6d96a", "#66bd63", "#1a9850", "#006837"], + 11: ["#a50026", "#d73027", "#f46d43", "#fdae61", "#fee08b", "#ffffbf", "#d9ef8b", "#a6d96a", "#66bd63", "#1a9850", "#006837"] + }, Accent: { + 3: ["#7fc97f", "#beaed4", "#fdc086"], + 4: ["#7fc97f", "#beaed4", "#fdc086", "#ffff99"], + 5: ["#7fc97f", "#beaed4", "#fdc086", "#ffff99", "#386cb0"], + 6: ["#7fc97f", "#beaed4", "#fdc086", "#ffff99", "#386cb0", "#f0027f"], + 7: ["#7fc97f", "#beaed4", "#fdc086", "#ffff99", "#386cb0", "#f0027f", "#bf5b17"], + 8: ["#7fc97f", "#beaed4", "#fdc086", "#ffff99", "#386cb0", "#f0027f", "#bf5b17", "#666666"] + }, Dark2: { + 3: ["#1b9e77", "#d95f02", "#7570b3"], + 4: ["#1b9e77", "#d95f02", "#7570b3", "#e7298a"], + 5: ["#1b9e77", "#d95f02", "#7570b3", "#e7298a", "#66a61e"], + 6: ["#1b9e77", "#d95f02", "#7570b3", "#e7298a", "#66a61e", "#e6ab02"], + 7: ["#1b9e77", "#d95f02", "#7570b3", "#e7298a", "#66a61e", "#e6ab02", "#a6761d"], + 8: ["#1b9e77", "#d95f02", "#7570b3", "#e7298a", "#66a61e", "#e6ab02", "#a6761d", "#666666"] + }, Paired: { + 3: ["#a6cee3", "#1f78b4", "#b2df8a"], + 4: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c"], + 5: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99"], + 6: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", "#e31a1c"], + 7: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", "#e31a1c", "#fdbf6f"], + 8: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", "#e31a1c", "#fdbf6f", "#ff7f00"], + 9: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", "#e31a1c", "#fdbf6f", "#ff7f00", "#cab2d6"], + 10: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", "#e31a1c", "#fdbf6f", "#ff7f00", "#cab2d6", "#6a3d9a"], + 11: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", "#e31a1c", "#fdbf6f", "#ff7f00", "#cab2d6", "#6a3d9a", "#ffff99"], + 12: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", "#e31a1c", "#fdbf6f", "#ff7f00", "#cab2d6", "#6a3d9a", "#ffff99", "#b15928"] + }, Pastel1: { + 3: ["#fbb4ae", "#b3cde3", "#ccebc5"], + 4: ["#fbb4ae", "#b3cde3", "#ccebc5", "#decbe4"], + 5: ["#fbb4ae", "#b3cde3", "#ccebc5", "#decbe4", "#fed9a6"], + 6: ["#fbb4ae", "#b3cde3", "#ccebc5", "#decbe4", "#fed9a6", "#ffffcc"], + 7: ["#fbb4ae", "#b3cde3", "#ccebc5", "#decbe4", "#fed9a6", "#ffffcc", "#e5d8bd"], + 8: ["#fbb4ae", "#b3cde3", "#ccebc5", "#decbe4", "#fed9a6", "#ffffcc", "#e5d8bd", "#fddaec"], + 9: ["#fbb4ae", "#b3cde3", "#ccebc5", "#decbe4", "#fed9a6", "#ffffcc", "#e5d8bd", "#fddaec", "#f2f2f2"] + }, Pastel2: { + 3: ["#b3e2cd", "#fdcdac", "#cbd5e8"], + 4: ["#b3e2cd", "#fdcdac", "#cbd5e8", "#f4cae4"], + 5: ["#b3e2cd", "#fdcdac", "#cbd5e8", "#f4cae4", "#e6f5c9"], + 6: ["#b3e2cd", "#fdcdac", "#cbd5e8", "#f4cae4", "#e6f5c9", "#fff2ae"], + 7: ["#b3e2cd", "#fdcdac", "#cbd5e8", "#f4cae4", "#e6f5c9", "#fff2ae", "#f1e2cc"], + 8: ["#b3e2cd", "#fdcdac", "#cbd5e8", "#f4cae4", "#e6f5c9", "#fff2ae", "#f1e2cc", "#cccccc"] + }, Set1: { + 3: ["#e41a1c", "#377eb8", "#4daf4a"], + 4: ["#e41a1c", "#377eb8", "#4daf4a", "#984ea3"], + 5: ["#e41a1c", "#377eb8", "#4daf4a", "#984ea3", "#ff7f00"], + 6: ["#e41a1c", "#377eb8", "#4daf4a", "#984ea3", "#ff7f00", "#ffff33"], + 7: ["#e41a1c", "#377eb8", "#4daf4a", "#984ea3", "#ff7f00", "#ffff33", "#a65628"], + 8: ["#e41a1c", "#377eb8", "#4daf4a", "#984ea3", "#ff7f00", "#ffff33", "#a65628", "#f781bf"], + 9: ["#e41a1c", "#377eb8", "#4daf4a", "#984ea3", "#ff7f00", "#ffff33", "#a65628", "#f781bf", "#999999"] + }, Set2: { + 3: ["#66c2a5", "#fc8d62", "#8da0cb"], + 4: ["#66c2a5", "#fc8d62", "#8da0cb", "#e78ac3"], + 5: ["#66c2a5", "#fc8d62", "#8da0cb", "#e78ac3", "#a6d854"], + 6: ["#66c2a5", "#fc8d62", "#8da0cb", "#e78ac3", "#a6d854", "#ffd92f"], + 7: ["#66c2a5", "#fc8d62", "#8da0cb", "#e78ac3", "#a6d854", "#ffd92f", "#e5c494"], + 8: ["#66c2a5", "#fc8d62", "#8da0cb", "#e78ac3", "#a6d854", "#ffd92f", "#e5c494", "#b3b3b3"] + }, Set3: { + 3: ["#8dd3c7", "#ffffb3", "#bebada"], + 4: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072"], + 5: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3"], + 6: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462"], + 7: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462", "#b3de69"], + 8: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462", "#b3de69", "#fccde5"], + 9: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462", "#b3de69", "#fccde5", "#d9d9d9"], + 10: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462", "#b3de69", "#fccde5", "#d9d9d9", "#bc80bd"], + 11: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462", "#b3de69", "#fccde5", "#d9d9d9", "#bc80bd", "#ccebc5"], + 12: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462", "#b3de69", "#fccde5", "#d9d9d9", "#bc80bd", "#ccebc5", "#ffed6f"] + } + }; + var tauBrewer = function (hueSet, colorNumber) { + return colorbrewer[hueSet][colorNumber].map(function (element, index) { + return hueSet + ' ' + 'q' + index + '-' + colorNumber; + }); + }; + tauCharts.api.colorBrewers.add('tauBrewer', tauBrewer); + return tauBrewer; }); \ No newline at end of file diff --git a/build/tauCharts.color-brewer.min.js b/build/tauCharts.color-brewer.min.js index 6de7ec329..25d0c2096 100644 --- a/build/tauCharts.color-brewer.min.js +++ b/build/tauCharts.color-brewer.min.js @@ -1,4 +1,4 @@ -/*! tauCharts - v0.2.1 - 2014-12-08 +/*! tauCharts - v0.2.2 - 2014-12-08 * https://github.com/TargetProcess/tauCharts * Copyright (c) 2014 Taucraft Limited; Licensed Creative Commons */ !function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){var b={YlGn:{3:["#f7fcb9","#addd8e","#31a354"],4:["#ffffcc","#c2e699","#78c679","#238443"],5:["#ffffcc","#c2e699","#78c679","#31a354","#006837"],6:["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],7:["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],8:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],9:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]},YlGnBu:{3:["#edf8b1","#7fcdbb","#2c7fb8"],4:["#ffffcc","#a1dab4","#41b6c4","#225ea8"],5:["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],6:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],7:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],8:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],9:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]},GnBu:{3:["#e0f3db","#a8ddb5","#43a2ca"],4:["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],5:["#f0f9e8","#bae4bc","#7bccc4","#43a2ca","#0868ac"],6:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#43a2ca","#0868ac"],7:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],8:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],9:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"]},BuGn:{3:["#e5f5f9","#99d8c9","#2ca25f"],4:["#edf8fb","#b2e2e2","#66c2a4","#238b45"],5:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],6:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#2ca25f","#006d2c"],7:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],8:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],9:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"]},PuBuGn:{3:["#ece2f0","#a6bddb","#1c9099"],4:["#f6eff7","#bdc9e1","#67a9cf","#02818a"],5:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"],6:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#1c9099","#016c59"],7:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],8:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],9:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"]},PuBu:{3:["#ece7f2","#a6bddb","#2b8cbe"],4:["#f1eef6","#bdc9e1","#74a9cf","#0570b0"],5:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],6:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#2b8cbe","#045a8d"],7:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],8:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],9:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"]},BuPu:{3:["#e0ecf4","#9ebcda","#8856a7"],4:["#edf8fb","#b3cde3","#8c96c6","#88419d"],5:["#edf8fb","#b3cde3","#8c96c6","#8856a7","#810f7c"],6:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8856a7","#810f7c"],7:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],8:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],9:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"]},RdPu:{3:["#fde0dd","#fa9fb5","#c51b8a"],4:["#feebe2","#fbb4b9","#f768a1","#ae017e"],5:["#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177"],6:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#c51b8a","#7a0177"],7:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],8:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],9:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"]},PuRd:{3:["#e7e1ef","#c994c7","#dd1c77"],4:["#f1eef6","#d7b5d8","#df65b0","#ce1256"],5:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],6:["#f1eef6","#d4b9da","#c994c7","#df65b0","#dd1c77","#980043"],7:["#f1eef6","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],8:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],9:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"]},OrRd:{3:["#fee8c8","#fdbb84","#e34a33"],4:["#fef0d9","#fdcc8a","#fc8d59","#d7301f"],5:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],6:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#e34a33","#b30000"],7:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],8:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],9:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"]},YlOrRd:{3:["#ffeda0","#feb24c","#f03b20"],4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]},YlOrBr:{3:["#fff7bc","#fec44f","#d95f0e"],4:["#ffffd4","#fed98e","#fe9929","#cc4c02"],5:["#ffffd4","#fed98e","#fe9929","#d95f0e","#993404"],6:["#ffffd4","#fee391","#fec44f","#fe9929","#d95f0e","#993404"],7:["#ffffd4","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],8:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],9:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"]},Purples:{3:["#efedf5","#bcbddc","#756bb1"],4:["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"],5:["#f2f0f7","#cbc9e2","#9e9ac8","#756bb1","#54278f"],6:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#756bb1","#54278f"],7:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],8:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],9:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]},Blues:{3:["#deebf7","#9ecae1","#3182bd"],4:["#eff3ff","#bdd7e7","#6baed6","#2171b5"],5:["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],6:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],7:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],8:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],9:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]},Greens:{3:["#e5f5e0","#a1d99b","#31a354"],4:["#edf8e9","#bae4b3","#74c476","#238b45"],5:["#edf8e9","#bae4b3","#74c476","#31a354","#006d2c"],6:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"],7:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],8:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],9:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]},Oranges:{3:["#fee6ce","#fdae6b","#e6550d"],4:["#feedde","#fdbe85","#fd8d3c","#d94701"],5:["#feedde","#fdbe85","#fd8d3c","#e6550d","#a63603"],6:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#e6550d","#a63603"],7:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],8:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],9:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]},Reds:{3:["#fee0d2","#fc9272","#de2d26"],4:["#fee5d9","#fcae91","#fb6a4a","#cb181d"],5:["#fee5d9","#fcae91","#fb6a4a","#de2d26","#a50f15"],6:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#de2d26","#a50f15"],7:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],8:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],9:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]},Greys:{3:["#f0f0f0","#bdbdbd","#636363"],4:["#f7f7f7","#cccccc","#969696","#525252"],5:["#f7f7f7","#cccccc","#969696","#636363","#252525"],6:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#636363","#252525"],7:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],8:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],9:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]},PuOr:{3:["#f1a340","#f7f7f7","#998ec3"],4:["#e66101","#fdb863","#b2abd2","#5e3c99"],5:["#e66101","#fdb863","#f7f7f7","#b2abd2","#5e3c99"],6:["#b35806","#f1a340","#fee0b6","#d8daeb","#998ec3","#542788"],7:["#b35806","#f1a340","#fee0b6","#f7f7f7","#d8daeb","#998ec3","#542788"],8:["#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788"],9:["#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788"],10:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],11:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"]},BrBG:{3:["#d8b365","#f5f5f5","#5ab4ac"],4:["#a6611a","#dfc27d","#80cdc1","#018571"],5:["#a6611a","#dfc27d","#f5f5f5","#80cdc1","#018571"],6:["#8c510a","#d8b365","#f6e8c3","#c7eae5","#5ab4ac","#01665e"],7:["#8c510a","#d8b365","#f6e8c3","#f5f5f5","#c7eae5","#5ab4ac","#01665e"],8:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e"],9:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e"],10:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],11:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]},PRGn:{3:["#af8dc3","#f7f7f7","#7fbf7b"],4:["#7b3294","#c2a5cf","#a6dba0","#008837"],5:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],6:["#762a83","#af8dc3","#e7d4e8","#d9f0d3","#7fbf7b","#1b7837"],7:["#762a83","#af8dc3","#e7d4e8","#f7f7f7","#d9f0d3","#7fbf7b","#1b7837"],8:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837"],9:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837"],10:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],11:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]},PiYG:{3:["#e9a3c9","#f7f7f7","#a1d76a"],4:["#d01c8b","#f1b6da","#b8e186","#4dac26"],5:["#d01c8b","#f1b6da","#f7f7f7","#b8e186","#4dac26"],6:["#c51b7d","#e9a3c9","#fde0ef","#e6f5d0","#a1d76a","#4d9221"],7:["#c51b7d","#e9a3c9","#fde0ef","#f7f7f7","#e6f5d0","#a1d76a","#4d9221"],8:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221"],9:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221"],10:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],11:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]},RdBu:{3:["#ef8a62","#f7f7f7","#67a9cf"],4:["#ca0020","#f4a582","#92c5de","#0571b0"],5:["#ca0020","#f4a582","#f7f7f7","#92c5de","#0571b0"],6:["#b2182b","#ef8a62","#fddbc7","#d1e5f0","#67a9cf","#2166ac"],7:["#b2182b","#ef8a62","#fddbc7","#f7f7f7","#d1e5f0","#67a9cf","#2166ac"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]},RdGy:{3:["#ef8a62","#ffffff","#999999"],4:["#ca0020","#f4a582","#bababa","#404040"],5:["#ca0020","#f4a582","#ffffff","#bababa","#404040"],6:["#b2182b","#ef8a62","#fddbc7","#e0e0e0","#999999","#4d4d4d"],7:["#b2182b","#ef8a62","#fddbc7","#ffffff","#e0e0e0","#999999","#4d4d4d"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"]},RdYlBu:{3:["#fc8d59","#ffffbf","#91bfdb"],4:["#d7191c","#fdae61","#abd9e9","#2c7bb6"],5:["#d7191c","#fdae61","#ffffbf","#abd9e9","#2c7bb6"],6:["#d73027","#fc8d59","#fee090","#e0f3f8","#91bfdb","#4575b4"],7:["#d73027","#fc8d59","#fee090","#ffffbf","#e0f3f8","#91bfdb","#4575b4"],8:["#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4"],9:["#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]},Spectral:{3:["#fc8d59","#ffffbf","#99d594"],4:["#d7191c","#fdae61","#abdda4","#2b83ba"],5:["#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"],6:["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"],7:["#d53e4f","#fc8d59","#fee08b","#ffffbf","#e6f598","#99d594","#3288bd"],8:["#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],9:["#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd"],10:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],11:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]},RdYlGn:{3:["#fc8d59","#ffffbf","#91cf60"],4:["#d7191c","#fdae61","#a6d96a","#1a9641"],5:["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"],6:["#d73027","#fc8d59","#fee08b","#d9ef8b","#91cf60","#1a9850"],7:["#d73027","#fc8d59","#fee08b","#ffffbf","#d9ef8b","#91cf60","#1a9850"],8:["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],9:["#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]},Accent:{3:["#7fc97f","#beaed4","#fdc086"],4:["#7fc97f","#beaed4","#fdc086","#ffff99"],5:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0"],6:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f"],7:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17"],8:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"]},Dark2:{3:["#1b9e77","#d95f02","#7570b3"],4:["#1b9e77","#d95f02","#7570b3","#e7298a"],5:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e"],6:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02"],7:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d"],8:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"]},Paired:{3:["#a6cee3","#1f78b4","#b2df8a"],4:["#a6cee3","#1f78b4","#b2df8a","#33a02c"],5:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],6:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],7:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],8:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],9:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],10:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],11:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],12:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"]},Pastel1:{3:["#fbb4ae","#b3cde3","#ccebc5"],4:["#fbb4ae","#b3cde3","#ccebc5","#decbe4"],5:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6"],6:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc"],7:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],8:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],9:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Pastel2:{3:["#b3e2cd","#fdcdac","#cbd5e8"],4:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],5:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],6:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],7:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],8:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"]},Set1:{3:["#e41a1c","#377eb8","#4daf4a"],4:["#e41a1c","#377eb8","#4daf4a","#984ea3"],5:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],6:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],7:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],8:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],9:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]},Set2:{3:["#66c2a5","#fc8d62","#8da0cb"],4:["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],5:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],6:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],7:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],8:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"]},Set3:{3:["#8dd3c7","#ffffb3","#bebada"],4:["#8dd3c7","#ffffb3","#bebada","#fb8072"],5:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],6:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],7:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],8:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],9:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],10:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],11:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],12:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"]}},c=function(a,c){return b[a][c].map(function(b,d){return a+" q"+d+"-"+c})};return a.api.colorBrewers.add("tauBrewer",c),c}); \ No newline at end of file diff --git a/build/tauCharts.js b/build/tauCharts.js index 8235e0f00..022bbc892 100644 --- a/build/tauCharts.js +++ b/build/tauCharts.js @@ -1,16 +1,16 @@ -/*! tauCharts - v0.2.1 - 2014-12-08 +/*! tauCharts - v0.2.2 - 2014-12-08 * https://github.com/TargetProcess/tauCharts * Copyright (c) 2014 Taucraft Limited; Licensed Creative Commons */ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - define(['underscore', 'd3'],function(_,d3){return factory(_, d3);}); - } else if (typeof module === "object" && module.exports) { - var _ = require('underscore'); - var d3 = require('d3'); - module.exports = factory(_); - } else { - root.tauCharts = factory(root._, root.d3); - } +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define(['underscore', 'd3'],function(_,d3){return factory(_, d3);}); + } else if (typeof module === "object" && module.exports) { + var _ = require('underscore'); + var d3 = require('d3'); + module.exports = factory(_); + } else { + root.tauCharts = factory(root._, root.d3); + } }(this, function (_, d3) {/** * @license almond 0.3.0 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. @@ -443,12 +443,12 @@ var requirejs, require, define; define("../node_modules/almond/almond", function(){}); -/** - * Internal method to return CSS value for given element and property - */ define('utils/utils-dom',["exports"], function (exports) { + /** + * Internal method to return CSS value for given element and property + */ var utilsDom = { getScrollbarWidth: function () { var div = document.createElement("div"); @@ -539,7 +539,6 @@ define('dsl-reader',["exports"], function (exports) { var _classProps = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; @@ -554,7 +553,6 @@ define('dsl-reader',["exports"], function (exports) { writable: true, value: function (spec) { var _this = this; - var buildRecursively = function (unit) { return _this.UnitsRegistry.get(unit.type).walk(_this.domain.mix(unit), buildRecursively); }; @@ -628,7 +626,6 @@ define('dsl-reader',["exports"], function (exports) { writable: true, value: function (styledGraph, target, chart) { var _this2 = this; - styledGraph.options.container = target; var renderRecursively = function (unit) { _this2.UnitsRegistry.get(unit.type).draw(_this2.domain.mix(unit), function (childUnit) { @@ -660,7 +657,6 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { var CSS_PREFIX = _const.CSS_PREFIX; - // jshint ignore: start var classes = function (el) { return { @@ -673,12 +669,14 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { }; }; + + var indexOf = function (arr, obj) { return arr.indexOf(obj); }; - /** - * Globals. + /** + * Globals. */ var win = window; var doc = win.document; @@ -686,13 +684,13 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { var docEl = doc.documentElement; var verticalPlaces = ["top", "bottom"]; - /** - * Poor man's shallow object extend. - * - * @param {Object} a - * @param {Object} b - * - * @return {Object} + /** + * Poor man's shallow object extend. + * + * @param {Object} a + * @param {Object} b + * + * @return {Object} */ function extend(a, b) { for (var key in b) { @@ -702,24 +700,24 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { return a; } - /** - * Checks whether object is window. - * - * @param {Object} obj - * - * @return {Boolean} + /** + * Checks whether object is window. + * + * @param {Object} obj + * + * @return {Boolean} */ function isWin(obj) { return obj && obj.setInterval != null; } - /** - * Returns element's object with `left`, `top`, `bottom`, `right`, `width`, and `height` - * properties indicating the position and dimensions of element on a page. - * - * @param {Element} element - * - * @return {Object} + /** + * Returns element's object with `left`, `top`, `bottom`, `right`, `width`, and `height` + * properties indicating the position and dimensions of element on a page. + * + * @param {Element} element + * + * @return {Object} */ function position(element) { var winTop = win.pageYOffset || docEl.scrollTop; @@ -745,32 +743,32 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { return box; } - /** - * Parse integer from strings like '-50px'. - * - * @param {Mixed} value - * - * @return {Integer} + /** + * Parse integer from strings like '-50px'. + * + * @param {Mixed} value + * + * @return {Integer} */ function parsePx(value) { return 0 | Math.round(String(value).replace(/[^\-0-9.]/g, "")); } - /** - * Get computed style of element. - * - * @param {Element} element - * - * @type {String} + /** + * Get computed style of element. + * + * @param {Element} element + * + * @type {String} */ var style = win.getComputedStyle; - /** - * Returns transition duration of element in ms. - * - * @param {Element} element - * - * @return {Integer} + /** + * Returns transition duration of element in ms. + * + * @param {Element} element + * + * @return {Integer} */ function transitionDuration(element) { var duration = String(style(element, transitionDuration.propName)); @@ -795,13 +793,13 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { } }()); var objectCreate = Object.create; - /** - * Tooltip construnctor. - * - * @param {String|Element} content - * @param {Object} options - * - * @return {Tooltip} + /** + * Tooltip construnctor. + * + * @param {String|Element} content + * @param {Object} options + * + * @return {Tooltip} */ function Tooltip(content, options) { if (!(this instanceof Tooltip)) { @@ -813,10 +811,10 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { this.content(content); } - /** - * Creates a tooltip element. - * - * @return {Void} + /** + * Creates a tooltip element. + * + * @return {Void} */ Tooltip.prototype._createElement = function () { this.element = doc.createElement("div"); @@ -831,35 +829,35 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { } }; - /** - * Changes tooltip's type class type. - * - * @param {String} name - * - * @return {Tooltip} + /** + * Changes tooltip's type class type. + * + * @param {String} name + * + * @return {Tooltip} */ Tooltip.prototype.type = function (name) { return this.changeClassType("type", name); }; - /** - * Changes tooltip's effect class type. - * - * @param {String} name - * - * @return {Tooltip} + /** + * Changes tooltip's effect class type. + * + * @param {String} name + * + * @return {Tooltip} */ Tooltip.prototype.effect = function (name) { return this.changeClassType("effect", name); }; - /** - * Changes class type. - * - * @param {String} propName - * @param {String} newClass - * - * @return {Tooltip} + /** + * Changes class type. + * + * @param {String} propName + * @param {String} newClass + * + * @return {Tooltip} */ Tooltip.prototype.changeClassType = function (propName, newClass) { propName += "Class"; @@ -873,10 +871,10 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { return this; }; - /** - * Updates tooltip's dimensions. - * - * @return {Tooltip} + /** + * Updates tooltip's dimensions. + * + * @return {Tooltip} */ Tooltip.prototype.updateSize = function () { if (this.hidden) { @@ -897,15 +895,15 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { return this; }; - /** - * Change tooltip content. - * - * When tooltip is visible, its size is automatically - * synced and tooltip correctly repositioned. - * - * @param {String|Element} content - * - * @return {Tooltip} + /** + * Change tooltip content. + * + * When tooltip is visible, its size is automatically + * synced and tooltip correctly repositioned. + * + * @param {String|Element} content + * + * @return {Tooltip} */ Tooltip.prototype.content = function (content) { if (typeof content === "object") { @@ -918,14 +916,14 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { return this; }; - /** - * Pick new place tooltip should be displayed at. - * - * When the tooltip is visible, it is automatically positioned there. - * - * @param {String} place - * - * @return {Tooltip} + /** + * Pick new place tooltip should be displayed at. + * + * When the tooltip is visible, it is automatically positioned there. + * + * @param {String} place + * + * @return {Tooltip} */ Tooltip.prototype.place = function (place) { this.options.place = place; @@ -935,12 +933,12 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { return this; }; - /** - * Attach tooltip to an element. - * - * @param {Element} element - * - * @return {Tooltip} + /** + * Attach tooltip to an element. + * + * @param {Element} element + * + * @return {Tooltip} */ Tooltip.prototype.attach = function (element) { this.attachedTo = element; @@ -950,10 +948,10 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { return this; }; - /** - * Detach tooltip from element. - * - * @return {Tooltip} + /** + * Detach tooltip from element. + * + * @return {Tooltip} */ Tooltip.prototype.detach = function () { this.hide(); @@ -961,12 +959,12 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { return this; }; - /** - * Pick the most reasonable place for target position. - * - * @param {Object} target - * - * @return {Tooltip} + /** + * Pick the most reasonable place for target position. + * + * @param {Object} target + * + * @return {Tooltip} */ Tooltip.prototype._pickPlace = function (target) { if (!this.options.auto) { @@ -984,22 +982,21 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { } switch (place[1]) { case "left": - if (target.right - this.width <= winPos.left) { place[1] = "right"; } break; case "right": - if (target.left + this.width >= winPos.right) { place[1] = "left"; } break; - default: if (target.left + target.width / 2 + this.width / 2 >= winPos.right) { - place[1] = "left"; - } else if (target.right - target.width / 2 - this.width / 2 <= winPos.left) { - place[1] = "right"; - } + default: + if (target.left + target.width / 2 + this.width / 2 >= winPos.right) { + place[1] = "left"; + } else if (target.right - target.width / 2 - this.width / 2 <= winPos.left) { + place[1] = "right"; + } } } else { if (target.left - this.width - spacing <= winPos.left) { @@ -1009,35 +1006,34 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { } switch (place[1]) { case "top": - if (target.bottom - this.height <= winPos.top) { place[1] = "bottom"; } break; case "bottom": - if (target.top + this.height >= winPos.bottom) { place[1] = "top"; } break; - default: if (target.top + target.height / 2 + this.height / 2 >= winPos.bottom) { - place[1] = "top"; - } else if (target.bottom - target.height / 2 - this.height / 2 <= winPos.top) { - place[1] = "bottom"; - } + default: + if (target.top + target.height / 2 + this.height / 2 >= winPos.bottom) { + place[1] = "top"; + } else if (target.bottom - target.height / 2 - this.height / 2 <= winPos.top) { + place[1] = "bottom"; + } } } return place.join("-"); }; - /** - * Position the element to an element or a specific coordinates. - * - * @param {Integer|Element} x - * @param {Integer} y - * - * @return {Tooltip} + /** + * Position the element to an element or a specific coordinates. + * + * @param {Integer|Element} x + * @param {Integer} y + * + * @return {Tooltip} */ Tooltip.prototype.position = function (x, y) { if (this.attachedTo) { @@ -1073,65 +1069,53 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { var top, left; switch (this.curPlace) { case "top": - top = target.top - this.height - spacing; left = target.left + target.width / 2 - this.width / 2; break; case "top-left": - top = target.top - this.height - spacing; left = target.right - this.width; break; case "top-right": - top = target.top - this.height - spacing; left = target.left; break; case "bottom": - top = target.bottom + spacing; left = target.left + target.width / 2 - this.width / 2; break; case "bottom-left": - top = target.bottom + spacing; left = target.right - this.width; break; case "bottom-right": - top = target.bottom + spacing; left = target.left; break; case "left": - top = target.top + target.height / 2 - this.height / 2; left = target.left - this.width - spacing; break; case "left-top": - top = target.bottom - this.height; left = target.left - this.width - spacing; break; case "left-bottom": - top = target.top; left = target.left - this.width - spacing; break; case "right": - top = target.top + target.height / 2 - this.height / 2; left = target.right + spacing; break; case "right-top": - top = target.bottom - this.height; left = target.right + spacing; break; case "right-bottom": - top = target.top; left = target.right + spacing; break; @@ -1144,13 +1128,13 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { return this; }; - /** - * Show the tooltip. - * - * @param {Integer|Element} x - * @param {Integer} y - * - * @return {Tooltip} + /** + * Show the tooltip. + * + * @param {Integer|Element} x + * @param {Integer} y + * + * @return {Tooltip} */ Tooltip.prototype.show = function (x, y) { x = this.attachedTo ? this.attachedTo : x; @@ -1188,10 +1172,10 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { return this.element; }; - /** - * Hide the tooltip. - * - * @return {Tooltip} + /** + * Hide the tooltip. + * + * @return {Tooltip} */ Tooltip.prototype.hide = function () { if (this.hidden) { @@ -1238,10 +1222,10 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { this.element = this.options = null; }; - /** - * Make the tip window resize aware. - * - * @return {Void} + /** + * Make the tip window resize aware. + * + * @return {Void} */ Tooltip.prototype._aware = function () { var index = indexOf(Tooltip.winAware, this); @@ -1250,10 +1234,10 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { } }; - /** - * Remove the window resize awareness. - * - * @return {Void} + /** + * Remove the window resize awareness. + * + * @return {Void} */ Tooltip.prototype._unaware = function () { var index = indexOf(Tooltip.winAware, this); @@ -1262,10 +1246,10 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { } }; - /** - * Handles repositioning of tooltips on window resize. - * - * @return {Void} + /** + * Handles repositioning of tooltips on window resize. + * + * @return {Void} */ Tooltip.reposition = (function () { var rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || function (fn) { @@ -1297,17 +1281,17 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { window.addEventListener("resize", Tooltip.reposition); window.addEventListener("scroll", Tooltip.reposition); - /** - * Array with dynamic class types. - * - * @type {Array} + /** + * Array with dynamic class types. + * + * @type {Array} */ Tooltip.classTypes = ["type", "effect"]; - /** - * Default options for Tooltip constructor. - * - * @type {Object} + /** + * Default options for Tooltip constructor. + * + * @type {Object} */ Tooltip.defaults = { baseClass: CSS_PREFIX + "tooltip", // Base tooltip class name. @@ -1326,17 +1310,17 @@ define('event',["exports"], function (exports) { var _classProps = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; var NULL_HANDLER = {}; var events = {}; - /** - * Creates new type of event or returns existing one, if it was created before. - * @param {string} eventName - * @return {function(..eventArgs)} + + /** + * Creates new type of event or returns existing one, if it was created before. + * @param {string} eventName + * @return {function(..eventArgs)} */ function createDispatcher(eventName) { var eventFunction = events[eventName]; @@ -1391,8 +1375,18 @@ define('event',["exports"], function (exports) { return eventFunction; } + /** + * Base class for event dispatching. It provides interface for instance + * to add and remove handler for desired events, and call it when event happens. + * @class + */ + var Emitter = (function () { - var Emitter = function Emitter() { + var Emitter = + /** + * @constructor + */ + function Emitter() { this.handler = null; this.emit_destroy = createDispatcher("destroy"); }; @@ -1400,6 +1394,13 @@ define('event',["exports"], function (exports) { _classProps(Emitter, null, { addHandler: { writable: true, + + + /** + * Adds new event handler to object. + * @param {object} callbacks Callback set. + * @param {object=} context Context object. + */ value: function (callbacks, context) { context = context || this; // add handler @@ -1427,6 +1428,14 @@ define('event',["exports"], function (exports) { }, removeHandler: { writable: true, + + + /** + * Removes event handler set from object. For this operation parameters + * must be the same (equivalent) as used for addHandler method. + * @param {object} callbacks Callback set. + * @param {object=} context Context object. + */ value: function (callbacks, context) { var cursor = this; var prev; @@ -1446,10 +1455,17 @@ define('event',["exports"], function (exports) { return; } } + + } }, destroy: { writable: true, + + + /** + * @destructor + */ value: function () { // fire object destroy event handlers this.emit_destroy(); @@ -1541,12 +1557,10 @@ define('utils/utils',["exports"], function (exports) { exports.utils = utils; }); -/* jshint ignore:start */ define('formatter-registry',["exports", "d3"], function (exports, _d3) { var d3 = _d3; - /* jshint ignore:end */ var FORMATS_MAP = { "x-num-auto": function (x) { @@ -1599,9 +1613,9 @@ define('formatter-registry',["exports", "d3"], function (exports, _d3) { FORMATS_MAP["x-time-hour"] = FORMATS_MAP["x-time-auto"]; FORMATS_MAP["x-time-day"] = FORMATS_MAP["x-time-auto"]; FORMATS_MAP["x-time-week"] = FORMATS_MAP["x-time-auto"]; - FORMATS_MAP["x-time-month"] = FORMATS_MAP["month"]; - FORMATS_MAP["x-time-quarter"] = FORMATS_MAP["quarter"]; - FORMATS_MAP["x-time-year"] = FORMATS_MAP["year"]; + FORMATS_MAP["x-time-month"] = FORMATS_MAP.month; + FORMATS_MAP["x-time-quarter"] = FORMATS_MAP.quarter; + FORMATS_MAP["x-time-year"] = FORMATS_MAP.year; /* jshint ignore:end */ var FormatterRegistry = { @@ -1647,7 +1661,6 @@ define('utils/utils-draw',["exports", "../utils/utils", "../formatter-registry", var FormatterRegistry = _formatterRegistry.FormatterRegistry; var _ = _underscore; var d3 = _d3; - /* jshint ignore:end */ var translate = function (left, top) { @@ -1660,6 +1673,7 @@ define('utils/utils-draw',["exports", "../utils/utils", "../formatter-registry", return _.contains(["bottom", "top"], scaleOrient.toLowerCase()) ? "h" : "v"; }; + var cutText = function (textString, widthLimit) { textString.each(function () { var textD3 = d3.select(this); @@ -1950,6 +1964,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var utilsDraw = _utilsUtilsDraw.utilsDraw; var FormatterRegistry = _formatterRegistry.FormatterRegistry; + var applyCustomProps = function (targetUnit, customUnit) { var guide = customUnit.guide || {}; var guide_x = guide.hasOwnProperty("x") ? guide.x : {}; @@ -2183,6 +2198,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var yMeta = meta.scaleMeta(unit.y, yScaleOptions); var yValues = yMeta.values; + unit.guide.x.tickFormat = unit.guide.x.tickFormat || getTickFormat(dimX, xMeta, settings.defaultFormats); unit.guide.y.tickFormat = unit.guide.y.tickFormat || getTickFormat(dimY, yMeta, settings.defaultFormats); @@ -2193,6 +2209,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var maxYTickSize = getMaxTickLabelSize(yValues, FormatterRegistry.get(unit.guide.y.tickFormat, unit.guide.x.tickFormatNullAlias), settings.getAxisTickLabelSize, settings.yAxisTickLabelLimit); + var xAxisPadding = selectorPredicates.isLeafParent ? settings.xAxisPadding : 0; var yAxisPadding = selectorPredicates.isLeafParent ? settings.yAxisPadding : 0; @@ -2238,6 +2255,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var distToXAxisLabel = settings.distToXAxisLabel; var distToYAxisLabel = settings.distToYAxisLabel; + var xTickLabelW = Math.min(settings.xAxisTickLabelLimit, (isXVertical ? maxXTickSize.height : maxXTickSize.width)); unit.guide.x.density = settings.xDensityKoeff * xTickLabelW; @@ -2246,12 +2264,15 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var yTickLabelH = Math.min(settings.yAxisTickLabelLimit, koeffLinesCount * maxYTickSize.height); unit.guide.y.density = settings.yDensityKoeff * yTickLabelH; + unit.guide.x.label.padding = (unit.guide.x.label.text) ? (xFontH + distToXAxisLabel) : 0; unit.guide.y.label.padding = (unit.guide.y.label.text) ? (yFontW + distToYAxisLabel) : 0; + var xLabelPadding = (unit.guide.x.label.text) ? (unit.guide.x.label.padding + xFontLabelHeight) : (xFontH); var yLabelPadding = (unit.guide.y.label.text) ? (unit.guide.y.label.padding + yFontLabelHeight) : (yFontW); + unit.guide.padding.b = xAxisPadding + xLabelPadding; unit.guide.padding.l = yAxisPadding + yLabelPadding; @@ -2282,6 +2303,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", }, srcSpec); }; + var fnTraverseSpec = function (orig, specUnitRef, transformRules) { var xRef = utilsDraw.applyNodeDefaults(specUnitRef); xRef = transformRules(createSelectorPredicates(xRef), xRef); @@ -2367,6 +2389,8 @@ define('layout-engine-factory',["exports", "./utils/utils", "./utils/utils-draw" var utilsDraw = _utilsUtilsDraw.utilsDraw; var TMatrix = _matrix.TMatrix; + + var specUnitSummary = function (spec, boxOpt) { var box = boxOpt ? boxOpt : { depth: -1, paddings: [] }; var p = spec.guide.padding; @@ -2485,20 +2509,21 @@ define('layout-engine-factory',["exports", "./utils/utils", "./utils/utils-draw" exports.LayoutEngineFactory = LayoutEngineFactory; }); -//plugins -/** @class - * @extends Plugin */ define('plugins',["exports"], function (exports) { var _classProps = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; + //plugins + /** @class + * @extends Plugin */ var Plugins = (function () { - var Plugins = function Plugins(plugins, chart) { + var Plugins = + /** @constructs */ + function Plugins(plugins, chart) { this.chart = chart; this._plugins = plugins.map(this.initPlugin, this); }; @@ -2508,7 +2533,6 @@ define('plugins',["exports"], function (exports) { writable: true, value: function (plugin) { var _this = this; - if (plugin.init) { plugin.init(this.chart); } @@ -2541,6 +2565,7 @@ define('plugins',["exports"], function (exports) { }; }; + exports.propagateDatumEvents = propagateDatumEvents; exports.Plugins = Plugins; }); @@ -2637,7 +2662,6 @@ define('unit-domain-mixin',["exports", "./unit-domain-period-generator", "./util var _classProps = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; @@ -2645,7 +2669,6 @@ define('unit-domain-mixin',["exports", "./unit-domain-period-generator", "./util var utils = _utilsUtils.utils; var _ = _underscore; var d3 = _d3; - /* jshint ignore:end */ var autoScaleMethods = { @@ -2919,6 +2942,7 @@ define('data-processor',["exports", "./utils/utils"], function (exports, _utilsU var utils = _utilsUtils.utils; + var DataProcessor = { isYFunctionOfX: function (data, xFields, yFields) { var isRelationAFunction = true; @@ -3070,7 +3094,6 @@ define('charts/tau.plot',["exports", "../dsl-reader", "../api/balloon", "../even var _classProps = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; @@ -3158,6 +3181,17 @@ define('charts/tau.plot',["exports", "../dsl-reader", "../api/balloon", "../even }, addBalloon: { writable: true, + /* addLine (conf) { + var unitContainer = this._spec.unit.unit; + while(true) { + if(unitContainer[0].unit) { + unitContainer = unitContainer[0].unit; + } else { + break; + } + } + unitContainer.push(conf); + }*/ value: function (conf) { return new Tooltip("", conf || {}); } @@ -3183,6 +3217,7 @@ define('charts/tau.plot',["exports", "../dsl-reader", "../api/balloon", "../even } containerNode.innerHTML = ""; + var domainMixin = new UnitDomainMixin(this.config.spec.dimensions, this.config.data); var specEngine = SpecEngineFactory.get(this.config.settings.specEngine, this.config.settings); @@ -3229,6 +3264,7 @@ define('charts/tau.plot',["exports", "../dsl-reader", "../api/balloon", "../even size.height = screenH - scrollH; size.width = screenW - scrollW; + // optimize full spec depending on size var localSettings = this.config.settings; var traverseToDeep = function (root, size) { @@ -3263,6 +3299,7 @@ define('charts/tau.plot',["exports", "../dsl-reader", "../api/balloon", "../even traverseToDeep(fullSpec.unit, size); + var reader = new DSLReader(domainMixin, UnitsRegistry); var logicXGraph = reader.buildGraph(fullSpec); @@ -3312,6 +3349,7 @@ define('charts/tau.chart',["exports", "./tau.plot", "../utils/utils", "../data-p var utils = _utilsUtils.utils; var DataProcessor = _dataProcessor.DataProcessor; + var convertAxis = function (data) { return (!data) ? null : data; }; @@ -3540,6 +3578,7 @@ define('elements/coords',["exports", "../utils/utils-draw", "../const", "../util var utils = _utilsUtils.utils; var TMatrix = _matrix.TMatrix; + var FacetAlgebra = { CROSS: function (root, dimX, dimY) { var domainX = root.domain(dimX); @@ -3697,7 +3736,6 @@ define('elements/point',["exports", "../utils/utils-draw", "../const", "./size"] var utilsDraw = _utilsUtilsDraw.utilsDraw; var CSS_PREFIX = _const.CSS_PREFIX; var sizeScale = _size.sizeScale; - var point = function (node) { var options = node.options; @@ -3736,7 +3774,6 @@ define('utils/css-class-map',["exports", "../const"], function (exports, _const) var CSS_PREFIX = _const.CSS_PREFIX; - var arrayNumber = [1, 2, 3, 4, 5]; var countLineClasses = arrayNumber.map(function (i) { return CSS_PREFIX + "line-opacity-" + i; @@ -3771,7 +3808,6 @@ define('elements/line',["exports", "../utils/utils-draw", "./point", "../const", var CSS_PREFIX = _const.CSS_PREFIX; var getLineClassesByWidth = _utilsCssClassMap.getLineClassesByWidth; var getLineClassesByCount = _utilsCssClassMap.getLineClassesByCount; - var line = function (node) { var options = node.options; @@ -3821,20 +3857,20 @@ define('elements/line',["exports", "../utils/utils-draw", "./point", "../const", }; var line; - /*if(node.isGuide) { - var i = 0; - line = d3 - .svg - .line() - .x((d) => { - if(i) { - return xScale.rangeExtent()[1]; - } else { - i++; - return 0; - } - }) - .y((d) => yScale(45)); + /*if(node.isGuide) { + var i = 0; + line = d3 + .svg + .line() + .x((d) => { + if(i) { + return xScale.rangeExtent()[1]; + } else { + i++; + return 0; + } + }) + .y((d) => yScale(45)); } else {*/ line = d3.svg.line().x(function (d) { return xScale(d[node.x.scaleDim]); @@ -3843,6 +3879,7 @@ define('elements/line',["exports", "../utils/utils-draw", "./point", "../const", }); /*}*/ + var updatePaths = function () { this.attr("d", line); }; @@ -3859,7 +3896,6 @@ define('elements/interval',["exports", "../utils/utils-draw", "../const"], funct var utilsDraw = _utilsUtilsDraw.utilsDraw; var CSS_PREFIX = _const.CSS_PREFIX; - var BAR_GROUP = "i-role-bar-group"; var isMeasure = function (dim) { return dim.dimType === "measure"; @@ -3905,10 +3941,8 @@ define('elements/interval',["exports", "../utils/utils-draw", "../const"], funct var tickWidth; var intervalWidth; var offsetCategory; - (function () { xMin = Math.min.apply(null, xScale.domain()); - var startPoint = (xMin <= 0) ? 0 : xMin; _ref = getSizesParams({ @@ -3920,7 +3954,6 @@ define('elements/interval',["exports", "../utils/utils-draw", "../const"], funct tickWidth = _ref.tickWidth; intervalWidth = _ref.intervalWidth; offsetCategory = _ref.offsetCategory; - /* jshint ignore:end */ calculateX = isMeasure(node.x) ? function (d) { return xScale(Math.min(startPoint, d[node.x.scaleDim])); @@ -3946,10 +3979,8 @@ define('elements/interval',["exports", "../utils/utils-draw", "../const"], funct var tickWidth; var intervalWidth; var offsetCategory; - (function () { yMin = Math.min.apply(null, yScale.domain()); - var startPoint = (yMin <= 0) ? 0 : yMin; _ref2 = getSizesParams({ @@ -3961,7 +3992,6 @@ define('elements/interval',["exports", "../utils/utils-draw", "../const"], funct tickWidth = _ref2.tickWidth; intervalWidth = _ref2.intervalWidth; offsetCategory = _ref2.offsetCategory; - /* jshint ignore:end */ calculateX = function (d) { return xScale(d[node.x.scaleDim]) - (tickWidth / 2); @@ -4018,6 +4048,7 @@ define('elements/coords-parallel',["exports", "../utils/utils-draw", "../const", var utils = _utilsUtils.utils; var TMatrix = _matrix.TMatrix; + var inheritRootProps = function (unit, root, props) { var r = _.defaults(utils.clone(unit), _.pick.apply(_, [root].concat(props))); r.guide = _.extend(utils.clone(root.guide || {}), (r.guide || {})); @@ -4066,6 +4097,7 @@ define('elements/coords-parallel',["exports", "../utils/utils-draw", "../const", var container = options.container.append("g").attr("class", "graphical-report__" + "cell " + "cell").attr("transform", utilsDraw.translate(L, T)); + var translate = function (left, top) { return "translate(" + left + "," + top + ")"; }; @@ -4073,6 +4105,7 @@ define('elements/coords-parallel',["exports", "../utils/utils-draw", "../const", return "rotate(" + angle + ")"; }; + var fnDrawDimAxis = function (xScaleObj, AXIS_POSITION) { var container = this; @@ -4106,6 +4139,7 @@ define('elements/coords-parallel-line',["exports", "../utils/utils-draw", "../co var utilsDraw = _utilsUtilsDraw.utilsDraw; var CSS_PREFIX = _const.CSS_PREFIX; + var CoordsParallelLine = { draw: function (node) { node.color = node.dimension(node.color, node); @@ -4178,6 +4212,7 @@ define('node-map',["exports", "./elements/coords", "./elements/line", "./element var CoordsParallel = _elementsCoordsParallel.CoordsParallel; var CoordsParallelLine = _elementsCoordsParallelLine.CoordsParallelLine; + var setupElementNode = function (node, dimensions) { dimensions.forEach(function (dimName) { node[dimName] = node.dimension(node[dimName], node); @@ -4254,7 +4289,6 @@ define('tau.newCharts',["exports", "./utils/utils-dom", "./charts/tau.plot", "./ var FormatterRegistry = _formatterRegistry.FormatterRegistry; var nodeMap = _nodeMap.nodeMap; var UnitsRegistry = _unitsRegistry.UnitsRegistry; - var colorBrewers = {}; var plugins = {}; @@ -4349,11 +4383,11 @@ define('tau.newCharts',["exports", "./utils/utils-dom", "./charts/tau.plot", "./ exports.__api__ = __api__; exports.api = api; }); - define('underscore',function(){ - return _; - }); - define('d3',function(){ - return d3; - }); - return require('tau.newCharts'); + define('underscore',function(){ + return _; + }); + define('d3',function(){ + return d3; + }); + return require('tau.newCharts'); })); \ No newline at end of file diff --git a/build/tauCharts.min.js b/build/tauCharts.min.js index 5f8dbd576..88716a729 100644 --- a/build/tauCharts.min.js +++ b/build/tauCharts.min.js @@ -1,4 +1,4 @@ -/*! tauCharts - v0.2.1 - 2014-12-08 +/*! tauCharts - v0.2.2 - 2014-12-08 * https://github.com/TargetProcess/tauCharts * Copyright (c) 2014 Taucraft Limited; Licensed Creative Commons */ !function(a,b){if("function"==typeof define&&define.amd)define(["underscore","d3"],function(a,c){return b(a,c)});else if("object"==typeof module&&module.exports){{var c=require("underscore");require("d3")}module.exports=b(c)}else a.tauCharts=b(a._,a.d3)}(this,function(a,b){var c,d,e;return function(a){function b(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(b,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(a,d.concat([b,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(c){if(b(r,c)){var d=r[c];delete r[c],t[c]=!0,m.apply(a,d)}if(!b(q,c)&&!b(t,c))throw new Error("No "+c);return q[c]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(c,d,e,f){var h,k,l,m,n,s,u=[],v=typeof e;if(f=f||c,"undefined"===v||"function"===v){for(d=!d.length&&e.length?["require","exports","module"]:d,n=0;n','','','<%= xTick %>',"","",""].join(""),e=a.template(d),f=document.createElement("div");f.style.position="absolute",f.style.visibility="hidden",f.style.width="100px",f.style.height="100px",f.style.border="1px solid green",document.body.appendChild(f),f.innerHTML=e({xTick:c});var g=b.select(f).selectAll(".x.axis .tick text")[0][0],h={width:0,height:0},i=g.getBoundingClientRect();return h.width=i.right-i.left,h.height=i.bottom-i.top,document.body.removeChild(f),h}};c.utilsDom=d}),e("dsl-reader",["exports"],function(b){var c=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},d=function(){var b=function(a,b){this.domain=a,this.UnitsRegistry=b};return c(b,null,{buildGraph:{writable:!0,value:function(a){var b=this,c=function(a){return b.UnitsRegistry.get(a.type).walk(b.domain.mix(a),c)};return c(a.unit)}},calcLayout:{writable:!0,value:function(b,c){b.options={top:0,left:0,width:c.width,height:c.height};var d=function(b){if(!b.$matrix)return b;var c,e=b.options,f=b.guide.padding,g=e.width-(f.l+f.r),h=e.height-(f.t+f.b),i=b.$matrix.sizeR(),j=b.$matrix.sizeC(),k=g/j,l=h/i;return c=b.guide.split?{calcHeight:function(a,b,c,d){return a/d},calcTop:function(a,b,c,d){return(b+1)*(a/d)*c}}:{calcHeight:function(a){return a},calcTop:function(a,b){return b*l}},b.$matrix.iterate(function(b,e,f){var g=f.length;a.each(f,function(a,f){a.options={width:k,left:e*k,height:c.calcHeight(l,b,f,g),top:c.calcTop(l,b,f,g)},d(a)})}),b};return d(b)}},renderGraph:{writable:!0,value:function(a,b,c){var d=this;a.options.container=b;var e=function(a){d.UnitsRegistry.get(a.type).draw(d.domain.mix(a),function(b){b.parentUnit=a,e(b)}),c&&c.fire("unitready",a)};return a.parentUnit=null,e(a),a.options.container}}}),b}();b.DSLReader=d}),e("const",["exports"],function(a){a.CSS_PREFIX="graphical-report__"}),e("api/balloon",["exports","../const"],function(a,b){function c(a,b){for(var c in b)a[c]=b[c];return a}function d(a){return a&&null!=a.setInterval}function e(a){var b=l.pageYOffset||o.scrollTop,e=l.pageXOffset||o.scrollLeft,f={left:0,right:0,top:0,bottom:0,width:0,height:0};if(d(a))f.width=l.innerWidth||o.clientWidth,f.height=l.innerHeight||o.clientHeight;else{if(!o.contains(a)||null==a.getBoundingClientRect)return f;c(f,a.getBoundingClientRect()),f.width=f.right-f.left,f.height=f.bottom-f.top}return f.top=f.top+b-o.clientTop,f.left=f.left+e-o.clientLeft,f.right=f.left+f.width,f.bottom=f.top+f.height,f}function f(a){return 0|Math.round(String(a).replace(/[^\-0-9.]/g,""))}function g(a){var b=String(q(a,g.propName)),c=b.match(/([0-9.]+)([ms]{1,2})/);return c&&(b=Number(c[1]),"s"===c[2]&&(b*=1e3)),0|b}function h(a,b){return this instanceof h?(this.hidden=1,this.options=c(r(h.defaults),b),this._createElement(),void this.content(a)):new h(a,b)}var i=b.CSS_PREFIX,j=function(a){return{add:function(b){a.classList.add(b)},remove:function(b){a.classList.remove(b)}}},k=function(a,b){return a.indexOf(b)},l=window,m=l.document,n=m.body,o=m.documentElement,p=["top","bottom"],q=l.getComputedStyle;g.propName=function(){for(var a=m.createElement("div"),b=["transitionDuration","webkitTransitionDuration"],c="1s",d=0;d=b.bottom&&(c[0]="top"),c[1]){case"left":a.right-this.width<=b.left&&(c[1]="right");break;case"right":a.left+this.width>=b.right&&(c[1]="left");break;default:a.left+a.width/2+this.width/2>=b.right?c[1]="left":a.right-a.width/2-this.width/2<=b.left&&(c[1]="right")}else switch(a.left-this.width-d<=b.left?c[0]="right":a.right+this.width+d>=b.right&&(c[0]="left"),c[1]){case"top":a.bottom-this.height<=b.top&&(c[1]="bottom");break;case"bottom":a.top+this.height>=b.bottom&&(c[1]="top");break;default:a.top+a.height/2+this.height/2>=b.bottom?c[1]="top":a.bottom-a.height/2-this.height/2<=b.top&&(c[1]="bottom")}return c.join("-")},h.prototype.position=function(a,b){this.attachedTo&&(a=this.attachedTo),null==a&&this._p?(a=this._p[0],b=this._p[1]):this._p=arguments;var c="number"==typeof a?{left:0|a,right:0|a,top:0|b,bottom:0|b,width:0,height:0}:e(a),d=this.spacing,f=this._pickPlace(c);f!==this.curPlace&&(this.curPlace&&this.classes.remove(this.curPlace),this.classes.add(f),this.curPlace=f);var g,h;switch(this.curPlace){case"top":g=c.top-this.height-d,h=c.left+c.width/2-this.width/2;break;case"top-left":g=c.top-this.height-d,h=c.right-this.width;break;case"top-right":g=c.top-this.height-d,h=c.left;break;case"bottom":g=c.bottom+d,h=c.left+c.width/2-this.width/2;break;case"bottom-left":g=c.bottom+d,h=c.right-this.width;break;case"bottom-right":g=c.bottom+d,h=c.left;break;case"left":g=c.top+c.height/2-this.height/2,h=c.left-this.width-d;break;case"left-top":g=c.bottom-this.height,h=c.left-this.width-d;break;case"left-bottom":g=c.top,h=c.left-this.width-d;break;case"right":g=c.top+c.height/2-this.height/2,h=c.right+d;break;case"right-top":g=c.bottom-this.height,h=c.right+d;break;case"right-bottom":g=c.top,h=c.right+d}return this.element.style.top=Math.round(g)+"px",this.element.style.left=Math.round(h)+"px",this},h.prototype.show=function(a,b){return a=this.attachedTo?this.attachedTo:a,clearTimeout(this.aIndex),null!=a&&this.position(a,b),this.hidden&&(this.hidden=0,n.appendChild(this.element)),this.attachedTo&&this._aware(),this.options.inClass&&(this.options.effectClass&&void this.element.clientHeight,this.classes.add(this.options.inClass)),this},h.prototype.getElement=function(){return this.element},h.prototype.hide=function(){if(!this.hidden){var a=this,b=0;return this.options.inClass&&(this.classes.remove(this.options.inClass),this.options.effectClass&&(b=g(this.element))),this.attachedTo&&this._unaware(),clearTimeout(this.aIndex),this.aIndex=setTimeout(function(){a.aIndex=0,n.removeChild(a.element),a.hidden=1},b),this}},h.prototype.toggle=function(a,b){return this[this.hidden?"show":"hide"](a,b)},h.prototype.destroy=function(){clearTimeout(this.aIndex),this._unaware(),this.hidden||n.removeChild(this.element),this.element=this.options=null},h.prototype._aware=function(){var a=k(h.winAware,this);~a||h.winAware.push(this)},h.prototype._unaware=function(){var a=k(h.winAware,this);~a&&h.winAware.splice(a,1)},h.reposition=function(){function a(){!c&&h.winAware.length&&(c=d(b))}function b(){c=0;for(var a,b=0,d=h.winAware.length;d>b;b++)a=h.winAware[b],a.position()}var c,d=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return setTimeout(a,17)};return a}(),h.winAware=[],window.addEventListener("resize",h.reposition),window.addEventListener("scroll",h.reposition),h.classTypes=["type","effect"],h.defaults={baseClass:i+"tooltip",typeClass:null,effectClass:null,inClass:"in",place:"top",spacing:null,auto:0},a.Tooltip=h}),e("event",["exports"],function(a){function b(a){var b=e[a];return b||(b=function(){for(var b,c,d=this,e=0;d=d.handler;){if(c=d.callbacks[a],"function"==typeof c){if(!b)for(b=[this],e=0;e=0?-1:1,f=d||1;d-=e*f/b}for(var g=[c,d],h=g[1]-g[0],i=Math.pow(10,Math.floor(Math.log(h/b)/Math.LN10)),j=b/h*i,k=[[.15,10],[.35,5],[.75,2],[1,1],[2,1]],l=-1;j>k[++l][0];);i*=k[l][1],g[0]=Math.floor(g[0]/i)*i,g[1]=Math.ceil(g[1]/i)*i;var m=c-g[0],n=g[1]-d,o=i/2;if(c>=0)g[0]=0;else{var p=o>=m?i:0;g[0]=g[0]-p}if(0>=d)g[1]=0;else{var q=o>=n?i:0;g[1]=g[1]+q}return[parseFloat(g[0].toFixed(15)),parseFloat(g[1].toFixed(15))]},traverseJSON:b};a.utils=c}),e("formatter-registry",["exports","d3"],function(b,c){var d=c,e={"x-num-auto":function(a){var b=parseFloat(a.toFixed(2));return Math.abs(b)<1?b.toString():d.format("s")(b)},percent:function(a){var b=parseFloat((100*a).toFixed(2));return b.toString()+"%"},day:d.time.format("%d-%b-%Y"),week:d.time.format("%d-%b-%Y"),"week-range":function(a){var b=new Date(a),c=new Date(a),e=new Date(c.setDate(c.getDate()+7)),f=d.time.format("%d-%b-%Y");return f(b)+" - "+f(e)},month:function(a){var b=new Date(a),c=b.getMonth(),e=0===c?"%B, %Y":"%B";return d.time.format(e)(a)},"month-year":d.time.format("%B, %Y"),quarter:function(a){var b=new Date(a),c=b.getMonth(),d=(c-c%3)/3;return"Q"+(d+1)+" "+b.getFullYear()},year:d.time.format("%Y"),"x-time-auto":null};e["x-time-ms"]=e["x-time-auto"],e["x-time-sec"]=e["x-time-auto"],e["x-time-min"]=e["x-time-auto"],e["x-time-hour"]=e["x-time-auto"],e["x-time-day"]=e["x-time-auto"],e["x-time-week"]=e["x-time-auto"],e["x-time-month"]=e.month,e["x-time-quarter"]=e.quarter,e["x-time-year"]=e.year;var f={get:function(b,c){var f=c||"",g=function(a){return(null===a||"undefined"==typeof a?f:a).toString()},h=e.hasOwnProperty(b),i=h?e[b]:g;return h&&(i=e[b]),!h&&b&&(i=function(c){var e=a.isDate(c)?d.time.format(b):d.format(b);return e(c)}),h||b||(i=g),i},add:function(a,b){e[a]=b}};b.FormatterRegistry=f}),e("utils/utils-draw",["exports","../utils/utils","../formatter-registry","underscore","d3"],function(a,b,c,d,e){var f=b.utils,g=c.FormatterRegistry,h=d,i=e,j=function(a,b){return"translate("+a+","+b+")"},k=function(a){return"rotate("+a+")"},l=function(a){return h.contains(["bottom","top"],a.toLowerCase())?"h":"v"},m=function(a,b){a.each(function(){var a=i.select(this),c=a.text().split(/\s+/).reverse();a.text(null);for(var d,e=[],f=!1;!f&&(d=c.pop());)if(e.push(d),a.text(e.join(" ")),a.node().getComputedTextLength()>b){e.pop();var g=e.join(" ");g+="...",a.text(g),f=!0}})},n=function(a,b,c,d,e){var f=function(a,b,c,d,e,f,g){var h=g*c+f,i=a.append("tspan").attr("x",d).attr("y",e).attr("dy",h+"em").text(b);return i};a.each(function(){var a=i.select(this),g=a.text().split(/\s+/),h=1.1,j=a.attr("x"),k=a.attr("y"),l=parseFloat(a.attr("dy"));a.text(null);var m=f(a,null,h,j,k,l,0),n=!1,o=g.reduce(function(a,d){if(n)return a;var e=a.length===c,f=a[a.length-1],g=m.text(f+d).node().getComputedTextLength()>b;return g&&e&&(a[a.length-1]=f+"...",n=!0),g&&!e&&a.push(d),g||(a[a.length-1]=f+" "+d),a},[""]);k=e?-1*(o.length-1)*Math.floor(.5*d):k,o.forEach(function(b,c){return f(a,b,h,j,k,l,c)}),m.remove()})},o=function(a,b,c){var d=a.selectAll(".tick line"),e=c/d[0].length,f=e/2;if("ordinal"===b.scaleType||"period"===b.scaleType){var g="h"===l(b.guide.scaleOrient),h=g?"x":"y",i=g?f:-f;d.attr(h+"1",i).attr(h+"2",i)}},p=function(a,b){var c="h"===l(b.guide.scaleOrient)?1:-1,d=a.append("text").attr("transform",k(b.guide.label.rotate)).attr("class","label").attr("x",c*b.guide.size*.5).attr("y",c*b.guide.label.padding).style("text-anchor",b.guide.label.textAnchor),e=" > ",f=b.guide.label.text.split(e),g=f.length;f.forEach(function(a,b){d.append("tspan").attr("class","label-token label-token-"+b).text(a),g-1>b&&d.append("tspan").attr("class","label-token-delimiter label-token-delimiter-"+b).text(e)})},q=function(a,b){var c="h"===l(b.guide.scaleOrient),d=b.guide.rotate,e=a.selectAll(".tick text");e.attr("transform",k(d)).style("text-anchor",b.guide.textAnchor),90===d&&e.attr("x",9).attr("y",0),b.guide.tickFormatWordWrap?e.call(n,b.guide.tickFormatWordWrapLimit,b.guide.tickFormatWordWrapLines,b.guide.$maxTickTextH,!c):e.call(m,b.guide.tickFormatWordWrapLimit)},r=function(a,b,c){var d=this;if(a.scaleDim){var e=i.svg.axis().scale(a.scaleObj).orient(a.guide.scaleOrient),f=g.get(a.guide.tickFormat,a.guide.tickFormatNullAlias);null!==f&&(e.ticks(Math.round(c/a.guide.density)),e.tickFormat(f));var h=d.append("g").attr("class",a.guide.cssClass).attr("transform",j.apply(null,b)).call(e);o(h,a,c),q(h,a),p(h,a)}},s=function(a,b,c){var d=this,e=d.append("g").attr("class","grid").attr("transform",j(0,0)),f=(a.guide.showGridLines||"").toLowerCase();if(f.length>0){var h=e.append("g").attr("class","grid-lines");if(f.indexOf("x")>-1&&a.x.scaleDim){var k=a.x,l=i.svg.axis().scale(k.scaleObj).orient(k.guide.scaleOrient).tickSize(b),m=g.get(k.guide.tickFormat);null!==m&&(l.ticks(Math.round(c/k.guide.density)),l.tickFormat(m));var n=h.append("g").attr("class","grid-lines-x").call(l);o(n,k,c);var p=n.select("g.tick");if(p.node()&&"translate(0,0)"!==p.attr("transform")){var q=p.node().cloneNode(!0);h.node().appendChild(q),i.select(q).attr("class","border").attr("transform",j(0,0)).select("line").attr("x1",0).attr("x2",0)}}if(f.indexOf("y")>-1&&a.y.scaleDim){var r=a.y,s=i.svg.axis().scale(r.scaleObj).orient(r.guide.scaleOrient).tickSize(-c),m=g.get(r.guide.tickFormat);null!==m&&(s.ticks(Math.round(b/r.guide.density)),s.tickFormat(m));var t=h.append("g").attr("class","grid-lines-y").call(s);o(t,r,b)}h.selectAll("text").remove()}return e},t=h.times(10,function(a){return"color10-"+(1+a)}),u=function(a){var b,c,d=a.guide.color||{},e=a.color,g=e.scaleDim,h=d.brewer||t;f.isArray(h)?(c=a.domain(g),b=h):(c=Object.keys(h),b=c.map(function(a){return h[a]}));var j=i.scale.ordinal().range(b).domain(c),k=function(a){return c.indexOf(a)>-1?j(a):"color-default"};return{get:function(a){return k(a)},dimension:g}},v=function(a){return a.options=a.options||{},a.guide=a.guide||{},a.guide.padding=h.defaults(a.guide.padding||{},{l:0,b:0,r:0,t:0}),a.guide.x=h.defaults(a.guide.x||{},{label:"",padding:0,density:30,cssClass:"x axis",scaleOrient:"bottom",rotate:0,textAnchor:"middle",tickPeriod:null,tickFormat:null,autoScale:!0}),a.guide.x.label=h.isObject(a.guide.x.label)?a.guide.x.label:{text:a.guide.x.label},a.guide.x.label=h.defaults(a.guide.x.label,{padding:32,rotate:0,textAnchor:"middle"}),a.guide.x.tickFormat=a.guide.x.tickFormat||a.guide.x.tickPeriod,a.guide.y=h.defaults(a.guide.y||{},{label:"",padding:0,density:30,cssClass:"y axis",scaleOrient:"left",rotate:0,textAnchor:"end",tickPeriod:null,tickFormat:null,autoScale:!0}),a.guide.y.label=h.isObject(a.guide.y.label)?a.guide.y.label:{text:a.guide.y.label},a.guide.y.label=h.defaults(a.guide.y.label,{padding:32,rotate:-90,textAnchor:"middle"}),a.guide.y.tickFormat=a.guide.y.tickFormat||a.guide.y.tickPeriod,a},w={translate:j,rotate:k,getOrientation:l,fnDrawDimAxis:r,fnDrawGrid:s,generateColor:u,applyNodeDefaults:v};a.utilsDraw=w}),e("spec-engine-factory",["exports","./utils/utils","./utils/utils-draw","./formatter-registry"],function(b,c,d,e){var f=c.utils,g=d.utilsDraw,h=e.FormatterRegistry,i=function(b,c){var d=c.guide||{},e=d.hasOwnProperty("x")?d.x:{},f=d.hasOwnProperty("y")?d.y:{},g=d.hasOwnProperty("padding")?d.padding:{};return a.extend(b.guide.padding,g),a.extend(b.guide.x.label,e.label),a.extend(b.guide.x,a.omit(e,"label")),a.extend(b.guide.y.label,f.label),a.extend(b.guide.y,a.omit(f,"label")),a.extend(b.guide,a.omit(d,"x","y","padding")),b},j=function(b,c){return b.guide=b.guide||{},b.guide.padding=b.guide.padding||{l:0,t:0,r:0,b:0},b.hasOwnProperty("unit")||(b=a.defaults(b,c),b.guide=a.defaults(b.guide,f.clone(c.guide)),b.guide.x=a.defaults(b.guide.x,f.clone(c.guide.x)),b.guide.y=a.defaults(b.guide.y,f.clone(c.guide.y))),b},k=function(a){var b=a.unit||[],c=!a.hasOwnProperty("unit"),d=!b.some(function(a){return a.hasOwnProperty("unit")});return{type:a.type,isLeaf:c,isLeafParent:!c&&d}},l=function(b,c,d,e){if(0===b.length)return{width:0,height:0};if(null===c){var f=d("TauChart Library");return f.width=.625*e,f}var g=a.max(b,function(a){return c(a).toString().length}),h=a.isNumber(g)?".00":"";return d(c(g)+h)},m=function(a,b,c){var d=a.dimType,e=a.scaleType,f="*";if("measure"===d&&"time"===e){var g=b.source.filter(function(a){return null!==a}).sort(),h=0;if(g.length>1){for(var i=1,j=g.length,k=[];j>i;)k.push(g[i]-g[i-1]),++i;var l=k.reduce(function(a,b){return a+=b},0);h=l/k.length}var m=[[31536e6,"year"],[7776e6,"quarter"],[2592e6,"month"],[6048e5,"week"],[864e5,"day"],[36e5,"hour"],[6e4,"min"],[1e3,"sec"],[0,"ms"]],n=-1;do++n;while(m[n][0]>h);f=m[n][1]}var o=[d,e,f].join(":"),p=[d,e].join(":");return c[o]||c[p]||c[d]||null},n={NONE:function(a,b,c){var d=f.clone(a);return o(f.clone(d.unit),d.unit,function(a,b){return b.guide.x.tickFontHeight=c.getAxisTickLabelSize("X").height,b.guide.y.tickFontHeight=c.getAxisTickLabelSize("Y").height,b}),d},"BUILD-LABELS":function(b){var c=f.clone(b),d=[],e=[],g=null,h=null;return f.traverseJSON(c.unit,"unit",k,function(b,c){if(b.isLeaf)return c;!g&&c.x&&(g=c),!h&&c.y&&(h=c),c.guide=c.guide||{},c.guide.x=c.guide.x||{label:""},c.guide.y=c.guide.y||{label:""},c.guide.x.label=a.isObject(c.guide.x.label)?c.guide.x.label:{text:c.guide.x.label},c.guide.y.label=a.isObject(c.guide.y.label)?c.guide.y.label:{text:c.guide.y.label},c.x&&(c.guide.x.label.text=c.guide.x.label.text||c.x),c.y&&(c.guide.y.label.text=c.guide.y.label.text||c.y);var f=c.guide.x.label.text;f&&(d.push(f),c.guide.x.tickFormatNullAlias=c.guide.x.hasOwnProperty("tickFormatNullAlias")?c.guide.x.tickFormatNullAlias:"No "+f,c.guide.x.label.text="");var i=c.guide.y.label.text;return i&&(e.push(i),c.guide.y.tickFormatNullAlias=c.guide.y.hasOwnProperty("tickFormatNullAlias")?c.guide.y.tickFormatNullAlias:"No "+i,c.guide.y.label.text=""),c}),g&&(g.guide.x.label.text=d.map(function(a){return a.toUpperCase()}).join(" > ")),h&&(h.guide.y.label.text=e.map(function(a){return a.toUpperCase()}).join(" > ")),c},"BUILD-GUIDE":function(a,b,c){var d=f.clone(a);return o(f.clone(d.unit),d.unit,function(a,d){if(a.isLeaf)return d;a.isLeafParent&&!d.guide.hasOwnProperty("showGridLines")&&(d.guide.showGridLines="xy");var e=!a.isLeaf&&!a.isLeafParent;e&&(d.guide.x.cssClass+=" facet-axis",d.guide.y.cssClass+=" facet-axis");var f=b.dimension(d.x),g=b.dimension(d.y),i="measure"===f.dimType,j="measure"===g.dimType,k={map:d.guide.x.tickLabel,min:d.guide.x.tickMin,max:d.guide.x.tickMax,period:d.guide.x.tickPeriod,autoScale:d.guide.x.autoScale},n={map:d.guide.y.tickLabel,min:d.guide.y.tickMin,max:d.guide.y.tickMax,period:d.guide.y.tickPeriod,autoScale:d.guide.y.autoScale},o=b.scaleMeta(d.x,k),p=o.values,q=b.scaleMeta(d.y,n),r=q.values;d.guide.x.tickFormat=d.guide.x.tickFormat||m(f,o,c.defaultFormats),d.guide.y.tickFormat=d.guide.y.tickFormat||m(g,q,c.defaultFormats);var s=0===p.length,t=0===r.length,u=l(p,h.get(d.guide.x.tickFormat,d.guide.x.tickFormatNullAlias),c.getAxisTickLabelSize,c.xAxisTickLabelLimit),v=l(r,h.get(d.guide.y.tickFormat,d.guide.x.tickFormatNullAlias),c.getAxisTickLabelSize,c.yAxisTickLabelLimit),w=a.isLeafParent?c.xAxisPadding:0,x=a.isLeafParent?c.yAxisPadding:0,y=!e&&!!f.dimType&&"measure"!==f.dimType;d.guide.x.padding=s?0:w,d.guide.y.padding=t?0:x,d.guide.x.rotate=y?90:0,d.guide.x.textAnchor=y?"start":d.guide.x.textAnchor;var z=s?0:c.xTickWidth,A=t?0:c.yTickWidth;d.guide.x.tickFormatWordWrapLimit=c.xAxisTickLabelLimit,d.guide.y.tickFormatWordWrapLimit=c.yAxisTickLabelLimit;var B=y?u.width:u.height;!i&&B>c.xAxisTickLabelLimit&&(B=c.xAxisTickLabelLimit),!y&&u.width>c.xAxisTickLabelLimit&&(d.guide.x.tickFormatWordWrap=!0,d.guide.x.tickFormatWordWrapLines=c.xTickWordWrapLinesLimit,B=c.xTickWordWrapLinesLimit*u.height);var C=v.width;!j&&C>c.yAxisTickLabelLimit&&(C=c.yAxisTickLabelLimit,d.guide.y.tickFormatWordWrap=!0,d.guide.y.tickFormatWordWrapLines=c.yTickWordWrapLinesLimit);var D=z+B,E=A+C,F=c.xFontLabelHeight,G=c.yFontLabelHeight,H=c.distToXAxisLabel,I=c.distToYAxisLabel,J=Math.min(c.xAxisTickLabelLimit,y?u.height:u.width);d.guide.x.density=c.xDensityKoeff*J;var K=Math.ceil(v.width/c.yAxisTickLabelLimit),L=Math.min(K,c.yTickWordWrapLinesLimit),M=Math.min(c.yAxisTickLabelLimit,L*v.height);d.guide.y.density=c.yDensityKoeff*M,d.guide.x.label.padding=d.guide.x.label.text?D+H:0,d.guide.y.label.padding=d.guide.y.label.text?E+I:0;var N=d.guide.x.label.text?d.guide.x.label.padding+F:D,O=d.guide.y.label.text?d.guide.y.label.padding+G:E;return d.guide.padding.b=w+N,d.guide.padding.l=x+O,d.guide.padding.b=d.guide.x.hide?0:d.guide.padding.b,d.guide.padding.l=d.guide.y.hide?0:d.guide.padding.l,d.guide.x.tickFontHeight=u.height,d.guide.y.tickFontHeight=v.height,d.guide.x.$minimalDomain=p.length,d.guide.y.$minimalDomain=r.length,d.guide.x.$maxTickTextW=u.width,d.guide.x.$maxTickTextH=u.height,d.guide.y.$maxTickTextW=v.width,d.guide.y.$maxTickTextH=v.height,d}),d}};n.AUTO=function(a,b,c){return["BUILD-LABELS","BUILD-GUIDE"].reduce(function(a,d){return n[d](a,b,c)},a)};var o=function(b,c,d){var e=g.applyNodeDefaults(c);e=d(k(e),e),e=i(e,b);var h=a.omit(e,"unit");return(e.unit||[]).forEach(function(a){return o(f.clone(a),j(a,h),d)}),e},p={get:function(a,b){var c=n[a]||n.NONE;return function(a,d){return c(a,d,b)}}};b.SpecEngineFactory=p}),e("matrix",["exports"],function(b){var c=function(){var b=function(b,c){var d,e=a.toArray(arguments);d=a.isArray(e[0])?e[0]:a.times(b,function(){return a.times(c,function(){return null})}),this.cube=d};return b.prototype={iterate:function(b){var c=this.cube;return a.each(c,function(c,d){a.each(c,function(a,c){b(d,c,a)})}),this},getRC:function(a,b){return this.cube[a][b]},setRC:function(a,b,c){return this.cube[a][b]=c,this},sizeR:function(){return this.cube.length},sizeC:function(){var a=this.cube[0]||[];return a.length}},b}();b.TMatrix=c}),e("layout-engine-factory",["exports","./utils/utils","./utils/utils-draw","./matrix"],function(a,b,c,d){var e=b.utils,f=c.utilsDraw,g=d.TMatrix,h=function(a,b){var c=b?b:{depth:-1,paddings:[]},d=a.guide.padding;return c.depth+=1,c.paddings.unshift({l:d.l,b:d.b,r:d.r,t:d.t}),a.unit&&a.unit.length&&h(a.unit[0],c),c},i={NONE:function(a){return a},EXTRACT:function(a){var b=function(a,c,d){var e=a,f=e.sizeR(),h=e.sizeC();e.iterate(function(a,e,i){i.forEach(function(b){return d(b,{firstRow:0===a,firstCol:0===e,lastRow:a===f-1,lastCol:e===h-1,depth:c})}),i.filter(function(a){return a.$matrix}).forEach(function(a){a.$matrix=new g(a.$matrix.cube),b(a.$matrix,c-1,d)})})},c=e.clone(a),d=new g([[[c]]]),i=h(c),j=i.paddings.reduce(function(a,b){return a.l+=b.l,a.b+=b.b,a},{l:0,b:0}),k=e.clone(j),l=i.paddings.reverse().map(function(a){return a.l=k.l-a.l,a.b=k.b-a.b,k={l:a.l,b:a.b},a});i.paddings=l.reverse();var m=10,n=f.applyNodeDefaults({type:"COORDS.RECT",options:e.clone(a.options),$matrix:new g([[[c]]]),guide:{padding:{l:j.l-m,b:j.b-m,r:0,t:0}}});return b(d,i.depth,function(a,b){var c=b.depth;a.guide.x.hide=a.guide.x.hide?a.guide.x.hide:!b.lastRow,a.guide.y.hide=a.guide.y.hide?a.guide.y.hide:!b.firstCol;var d=c>1?0:m,e=c>1?m:0;return a.guide.x.padding+=i.paddings[c].b,a.guide.y.padding+=i.paddings[c].l,a.guide.x.padding-=e,a.guide.y.padding-=e,a.guide.padding.l=d,a.guide.padding.b=d,a.guide.padding.r=d,a.guide.padding.t=d,a}),n}},j={get:function(a){return i[a]||i.NONE}};a.LayoutEngineFactory=j}),e("plugins",["exports"],function(a){var c=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},d=function(){var a=function(a,b){this.chart=b,this._plugins=a.map(this.initPlugin,this)};return c(a,null,{initPlugin:{writable:!0,value:function(a){var b=this;a.init&&a.init(this.chart),this.chart.on("destroy",a.destroy||function(){}),Object.keys(a).forEach(function(c){if(0===c.indexOf("on")){var d=c.substr(2);b.chart.on(d.toLowerCase(),a[c].bind(a))}})}}}),a}(),e=["click","mouseover","mouseout","mousemove"],f=function(a){return function(){e.forEach(function(c){this.on(c,function(d){a.fire("element"+c,{elementData:d,element:this,cellData:b.select(this.parentNode.parentNode).datum()})})},this)}};a.propagateDatumEvents=f,a.Plugins=d}),e("unit-domain-period-generator",["exports"],function(a){var b={day:{cast:function(a){return new Date(a.setHours(0,0,0,0))},next:function(a){return new Date(a.setDate(a.getDate()+1))}},week:{cast:function(a){return a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(a.getDate()-a.getDay()))},next:function(a){return new Date(a.setDate(a.getDate()+7))}},month:{cast:function(a){return a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(1))},next:function(a){return new Date(a.setMonth(a.getMonth()+1))}},quarter:{cast:function(a){a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(1));var b=a.getMonth(),c=b-b%3;return new Date(a.setMonth(c))},next:function(a){return new Date(a.setMonth(a.getMonth()+3))}},year:{cast:function(a){return a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(1)),a=new Date(a.setMonth(0))},next:function(a){return new Date(a.setFullYear(a.getFullYear()+1))}}},c={add:function(a,c){return b[a.toLowerCase()]=c,this},get:function(a){return b[a.toLowerCase()]},generate:function(a,c,d){var e=[],f=b[d.toLowerCase()];if(f){var g=f.cast(new Date(c)),h=f.cast(new Date(a));for(e.push(h);(h=f.next(new Date(h)))<=g;)e.push(h)}return e}};a.UnitDomainPeriodGenerator=c}),e("unit-domain-mixin",["exports","./unit-domain-period-generator","./utils/utils","underscore","d3"],function(a,b,c,d,e){var f=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},g=b.UnitDomainPeriodGenerator,h=c.utils,i=d,j=e,k={ordinal:function(a){return a},linear:function(a,b){var c=b.autoScale?h.autoScale(a):j.extent(a),d=i.isNumber(b.min)?b.min:c[0],e=i.isNumber(b.max)?b.max:c[1];return[Math.min(d,c[0]),Math.max(e,c[1])]},period:function(a,b){var c=j.extent(a),d=i.isNull(b.min)||i.isUndefined(b.min)?c[0]:new Date(b.min).getTime(),e=i.isNull(b.max)||i.isUndefined(b.max)?c[1]:new Date(b.max).getTime(),f=[new Date(Math.min(d,c[0])),new Date(Math.max(e,c[1]))];return g.generate(f[0],f[1],b.period) diff --git a/component.json b/component.json index a7dd2b58a..036ea3567 100644 --- a/component.json +++ b/component.json @@ -1,6 +1,6 @@ { "name": "tauCharts", - "version": "0.2.0", + "version": "0.2.2", "ignore": [ "**/.*", "node_modules", diff --git a/package.json b/package.json index 0a63e80c6..b1bbdfe90 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tauCharts", - "version": "0.2.1", + "version": "0.2.2", "homepage": "https://github.com/TargetProcess/tauCharts", "description": "Simple charts library based on d3", "author": {