diff --git a/demo/demo.js b/demo/demo.js index cb91a71..3ed7157 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -458,7 +458,7 @@ var heatmap = [ ] links = [ - ['january', 1, 10, 'february', 20, 25, 0], + ['january', 1, 10, 'february', 20, 25, 1], ['february', 1, 10, 'march', 20, 25, 1], ['march', 1, 10, 'april', 3, 7, 2], ['april', 1, 10, 'may', 20, 25, 3], @@ -568,6 +568,7 @@ circos .layout( { ticks: {display: false}, + cornerRadius: 0, onClick: function(){console.log('You clicked on the layout layer!');} }, layout_data @@ -635,11 +636,9 @@ circos .chords( 'l1', { - usePalette: false, + logScale: false, opacity: 0.7, - color: function(d, i) { - return i % 2 === 0 ? 'blue' : 'red'; - }, + color: 'Greens', tooltipContent: function(d) { return d.source.id + ' ➤ ' + d.target.id + ': ' + d.value; }, diff --git a/dist/circos.js b/dist/circos.js index cc98c4e..c8cdfd5 100644 --- a/dist/circos.js +++ b/dist/circos.js @@ -57,10 +57,6 @@ var Circos = var _forEach2 = _interopRequireDefault(_forEach); - var _keys = __webpack_require__(103); - - var _keys2 = _interopRequireDefault(_keys); - var _isArray = __webpack_require__(76); var _isArray2 = _interopRequireDefault(_isArray); @@ -79,36 +75,34 @@ var Circos = var _Text2 = _interopRequireDefault(_Text); - var _Highlight = __webpack_require__(292); + var _Highlight = __webpack_require__(293); var _Highlight2 = _interopRequireDefault(_Highlight); - var _Histogram = __webpack_require__(293); + var _Histogram = __webpack_require__(294); var _Histogram2 = _interopRequireDefault(_Histogram); - var _Chords = __webpack_require__(294); + var _Chords = __webpack_require__(295); var _Chords2 = _interopRequireDefault(_Chords); - var _Heatmap = __webpack_require__(296); + var _Heatmap = __webpack_require__(297); var _Heatmap2 = _interopRequireDefault(_Heatmap); - var _Line = __webpack_require__(297); + var _Line = __webpack_require__(298); var _Line2 = _interopRequireDefault(_Line); - var _Scatter = __webpack_require__(298); + var _Scatter = __webpack_require__(299); var _Scatter2 = _interopRequireDefault(_Scatter); - var _Stack = __webpack_require__(299); + var _Stack = __webpack_require__(300); var _Stack2 = _interopRequireDefault(_Stack); - __webpack_require__(300); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -10098,7 +10092,7 @@ var Circos = var _Track3 = _interopRequireDefault(_Track2); - var _dataParser = __webpack_require__(282); + var _dataParser = __webpack_require__(283); var _forEach = __webpack_require__(99); @@ -10108,7 +10102,7 @@ var Circos = var _assign2 = _interopRequireDefault(_assign); - var _configs = __webpack_require__(291); + var _configs = __webpack_require__(292); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -10198,24 +10192,14 @@ var Circos = **/ var Track = function () { function Track(instance, conf, defaultConf, data, dataParser) { - var _this = this; - _classCallCheck(this, Track); this.dispatch = (0, _d3Dispatch.dispatch)('mouseover', 'mouseout'); this.parseData = dataParser; this.loadData(data, instance); this.conf = (0, _configUtils.getConf)(conf, defaultConf, this.meta, instance); - var reverse = this.conf.colorPaletteReverse ? this.conf.colorPaletteReverse : false; - var colorScale = (0, _utils.buildScale)(this.conf.cmin, this.conf.cmax, this.conf.colorPaletteSize, reverse, this.conf.logScale, this.conf.logScaleBase); - this.colorScale = function (value) { - var result = Math.floor(colorScale(value)); - if (result === _this.conf.colorPaletteSize) { - return _this.conf.colorPaletteSize - 1; - } - return result; - }; - this.scale = (0, _utils.buildScale)(this.conf.cmin, this.conf.cmax, this.conf.outerRadius - this.conf.innerRadius, false, this.conf.logScale, this.conf.logScaleBase); + this.conf.colorIteratee = (0, _utils.buildColorIteratee)(this.conf.color, this.conf.cmin, this.conf.cmax, this.conf.logScale, this.conf.logScaleBase); + this.scale = (0, _utils.buildScale)(this.conf.cmin, this.conf.cmax, this.conf.outerRadius - this.conf.innerRadius, this.conf.logScale, this.conf.logScaleBase); } _createClass(Track, [{ @@ -10228,7 +10212,7 @@ var Circos = }, { key: 'render', value: function render(instance, parentElement, name) { - var _this2 = this; + var _this = this; parentElement.select('.' + name).remove(); var track = parentElement.append('g').attr('class', name).attr('z-index', this.conf.zIndex); @@ -10241,10 +10225,10 @@ var Circos = (0, _tooltip.registerTooltip)(this, instance, selection, this.conf); } selection.on('mouseover', function (d, i, j) { - _this2.dispatch.call('mouseover', _this2, d); + _this.dispatch.call('mouseover', _this, d); }); selection.on('mouseout', function (d, i, j) { - _this2.dispatch.call('mouseout', _this2, d); + _this.dispatch.call('mouseout', _this, d); }); return this; @@ -13400,9 +13384,7 @@ var Circos = if ((0, _isFunction2.default)(userConf[key])) { conf[key] = userConf[key]; } else { - conf[key] = function () { - return userConf[key]; - }; + conf[key] = userConf[key]; } } else { conf[key] = function () { @@ -13517,9 +13499,14 @@ var Circos = Object.defineProperty(exports, "__esModule", { value: true }); + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + exports.smartBorders = smartBorders; exports.computeMinMax = computeMinMax; + exports.buildColorIteratee = buildColorIteratee; exports.buildScale = buildScale; + exports.buildColorScale = buildColorScale; var _sortBy = __webpack_require__(212); @@ -13545,8 +13532,14 @@ var Circos = var _reverse2 = _interopRequireDefault(_reverse); + var _isFunction = __webpack_require__(12); + + var _isFunction2 = _interopRequireDefault(_isFunction); + var _d3Scale = __webpack_require__(277); + var _d3ScaleChromatic = __webpack_require__(282); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function smartBorders(conf, layout, tracks) { @@ -13566,7 +13559,73 @@ var Circos = return conf; } + var palettes = { + BrBG: _d3ScaleChromatic.interpolateBrBG, + PRGn: _d3ScaleChromatic.interpolatePRGn, + PiYG: _d3ScaleChromatic.interpolatePiYG, + PuOr: _d3ScaleChromatic.interpolatePuOr, + RdBu: _d3ScaleChromatic.interpolateRdBu, + RdGy: _d3ScaleChromatic.interpolateRdGy, + RdYlBu: _d3ScaleChromatic.interpolateRdYlBu, + RdYlGn: _d3ScaleChromatic.interpolateRdYlGn, + Spectral: _d3ScaleChromatic.interpolateSpectral, + Blues: _d3ScaleChromatic.interpolateBlues, + Greens: _d3ScaleChromatic.interpolateGreens, + Greys: _d3ScaleChromatic.interpolateGreys, + Oranges: _d3ScaleChromatic.interpolateOranges, + Purples: _d3ScaleChromatic.interpolatePurples, + Reds: _d3ScaleChromatic.interpolateReds, + BuGn: _d3ScaleChromatic.interpolateBuGn, + BuPu: _d3ScaleChromatic.interpolateBuPu, + GnBu: _d3ScaleChromatic.interpolateGnBu, + OrRd: _d3ScaleChromatic.interpolateOrRd, + PuBuGn: _d3ScaleChromatic.interpolatePuBuGn, + PuBu: _d3ScaleChromatic.interpolatePuBu, + PuRd: _d3ScaleChromatic.interpolatePuRd, + RdPu: _d3ScaleChromatic.interpolateRdPu, + YlGnBu: _d3ScaleChromatic.interpolateYlGnBu, + YlGn: _d3ScaleChromatic.interpolateYlGn, + YlOrBr: _d3ScaleChromatic.interpolateYlOrBr, + YlOrRd: _d3ScaleChromatic.interpolateYlOrRd + }; + + function buildColorIteratee(color, min, max) { + var logScale = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + var logScaleBase = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : Math.E; + + if ((0, _isFunction2.default)(color)) { + return color; + } + var reverse = color[0] === '-'; + var paletteName = color[0] === '-' ? color.slice(1) : color; + if (palettes[paletteName]) { + var _ret = function () { + var scale = buildColorScale(palettes[paletteName], min, max, reverse, logScale, logScaleBase); + return { + v: function v(d) { + return scale(d.value); + } + }; + }(); + + if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v; + } + return color; + }; + function buildScale(min, max, height) { + var logScale = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + var logScaleBase = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : Math.E; + + if (logScale && min * max <= 0) { + console.warn('As log(0) = -\u221E, a log scale domain must be\n strictly-positive or strictly-negative. logscale ignored'); + } + var scale = logScale && min * max > 0 ? (0, _d3Scale.scaleLog)().base(logScaleBase) : (0, _d3Scale.scaleLinear)(); + + return scale.domain([min, max]).range([0, height]); + } + + function buildColorScale(interpolator, min, max) { var reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; var logScale = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; var logScaleBase = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : Math.E; @@ -13574,9 +13633,21 @@ var Circos = if (logScale && min * max <= 0) { console.warn('As log(0) = -\u221E, a log scale domain must be\n strictly-positive or strictly-negative. logscale ignored'); } - var scale = logScale && min * max > 0 ? (0, _d3Scale.scaleLog)().base(logScaleBase) : (0, _d3Scale.scaleLinear)(); - return scale.domain(reverse ? [max, min] : [min, max]).range([0, height]); + if (logScale && min * max > 0) { + var _ret2 = function () { + var scale = (0, _d3Scale.scaleLog)().base(logScaleBase).domain(reverse ? [max, min] : [min, max]).range([0, 1]); + return { + v: (0, _d3Scale.scaleSequential)(function (t) { + return interpolator(scale(t)); + }).domain([0, 1]) + }; + }(); + + if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === "object") return _ret2.v; + } + + return (0, _d3Scale.scaleSequential)(interpolator).domain(reverse ? [max, min] : [min, max]); } /***/ }, @@ -19257,6 +19328,453 @@ var Circos = /***/ }, /* 282 */ +/***/ function(module, exports, __webpack_require__) { + + // https://d3js.org/d3-scale-chromatic/ Version 1.1.0. Copyright 2016 Mike Bostock. + (function (global, factory) { + true ? factory(exports, __webpack_require__(197)) : + typeof define === 'function' && define.amd ? define(['exports', 'd3-interpolate'], factory) : + (factory((global.d3 = global.d3 || {}),global.d3)); + }(this, (function (exports,d3Interpolate) { 'use strict'; + + var colors = function(specifier) { + var n = specifier.length / 6 | 0, colors = new Array(n), i = 0; + while (i < n) colors[i] = "#" + specifier.slice(i * 6, ++i * 6); + return colors; + }; + + var Accent = colors("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"); + + var Dark2 = colors("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"); + + var Paired = colors("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"); + + var Pastel1 = colors("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"); + + var Pastel2 = colors("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"); + + var Set1 = colors("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"); + + var Set2 = colors("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"); + + var Set3 = colors("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"); + + var ramp = function(scheme) { + return d3Interpolate.interpolateRgbBasis(scheme[scheme.length - 1]); + }; + + var scheme = new Array(3).concat( + "d8b365f5f5f55ab4ac", + "a6611adfc27d80cdc1018571", + "a6611adfc27df5f5f580cdc1018571", + "8c510ad8b365f6e8c3c7eae55ab4ac01665e", + "8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e", + "8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e", + "8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e", + "5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30", + "5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30" + ).map(colors); + + var BrBG = ramp(scheme); + + var scheme$1 = new Array(3).concat( + "af8dc3f7f7f77fbf7b", + "7b3294c2a5cfa6dba0008837", + "7b3294c2a5cff7f7f7a6dba0008837", + "762a83af8dc3e7d4e8d9f0d37fbf7b1b7837", + "762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837", + "762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837", + "762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837", + "40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b", + "40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b" + ).map(colors); + + var PRGn = ramp(scheme$1); + + var scheme$2 = new Array(3).concat( + "e9a3c9f7f7f7a1d76a", + "d01c8bf1b6dab8e1864dac26", + "d01c8bf1b6daf7f7f7b8e1864dac26", + "c51b7de9a3c9fde0efe6f5d0a1d76a4d9221", + "c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221", + "c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221", + "c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221", + "8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419", + "8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419" + ).map(colors); + + var PiYG = ramp(scheme$2); + + var scheme$3 = new Array(3).concat( + "f1a340f7f7f7998ec3", + "e66101fdb863b2abd25e3c99", + "e66101fdb863f7f7f7b2abd25e3c99", + "b35806f1a340fee0b6d8daeb998ec3542788", + "b35806f1a340fee0b6f7f7f7d8daeb998ec3542788", + "b35806e08214fdb863fee0b6d8daebb2abd28073ac542788", + "b35806e08214fdb863fee0b6f7f7f7d8daebb2abd28073ac542788", + "7f3b08b35806e08214fdb863fee0b6d8daebb2abd28073ac5427882d004b", + "7f3b08b35806e08214fdb863fee0b6f7f7f7d8daebb2abd28073ac5427882d004b" + ).map(colors); + + var PuOr = ramp(scheme$3); + + var scheme$4 = new Array(3).concat( + "ef8a62f7f7f767a9cf", + "ca0020f4a58292c5de0571b0", + "ca0020f4a582f7f7f792c5de0571b0", + "b2182bef8a62fddbc7d1e5f067a9cf2166ac", + "b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac", + "b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac", + "b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac", + "67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061", + "67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061" + ).map(colors); + + var RdBu = ramp(scheme$4); + + var scheme$5 = new Array(3).concat( + "ef8a62ffffff999999", + "ca0020f4a582bababa404040", + "ca0020f4a582ffffffbababa404040", + "b2182bef8a62fddbc7e0e0e09999994d4d4d", + "b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d", + "b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d", + "b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d", + "67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a", + "67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a" + ).map(colors); + + var RdGy = ramp(scheme$5); + + var scheme$6 = new Array(3).concat( + "fc8d59ffffbf91bfdb", + "d7191cfdae61abd9e92c7bb6", + "d7191cfdae61ffffbfabd9e92c7bb6", + "d73027fc8d59fee090e0f3f891bfdb4575b4", + "d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4", + "d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4", + "d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4", + "a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695", + "a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695" + ).map(colors); + + var RdYlBu = ramp(scheme$6); + + var scheme$7 = new Array(3).concat( + "fc8d59ffffbf91cf60", + "d7191cfdae61a6d96a1a9641", + "d7191cfdae61ffffbfa6d96a1a9641", + "d73027fc8d59fee08bd9ef8b91cf601a9850", + "d73027fc8d59fee08bffffbfd9ef8b91cf601a9850", + "d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850", + "d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850", + "a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837", + "a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837" + ).map(colors); + + var RdYlGn = ramp(scheme$7); + + var scheme$8 = new Array(3).concat( + "fc8d59ffffbf99d594", + "d7191cfdae61abdda42b83ba", + "d7191cfdae61ffffbfabdda42b83ba", + "d53e4ffc8d59fee08be6f59899d5943288bd", + "d53e4ffc8d59fee08bffffbfe6f59899d5943288bd", + "d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd", + "d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd", + "9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2", + "9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2" + ).map(colors); + + var Spectral = ramp(scheme$8); + + var scheme$9 = new Array(3).concat( + "e5f5f999d8c92ca25f", + "edf8fbb2e2e266c2a4238b45", + "edf8fbb2e2e266c2a42ca25f006d2c", + "edf8fbccece699d8c966c2a42ca25f006d2c", + "edf8fbccece699d8c966c2a441ae76238b45005824", + "f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824", + "f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b" + ).map(colors); + + var BuGn = ramp(scheme$9); + + var scheme$10 = new Array(3).concat( + "e0ecf49ebcda8856a7", + "edf8fbb3cde38c96c688419d", + "edf8fbb3cde38c96c68856a7810f7c", + "edf8fbbfd3e69ebcda8c96c68856a7810f7c", + "edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b", + "f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b", + "f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b" + ).map(colors); + + var BuPu = ramp(scheme$10); + + var scheme$11 = new Array(3).concat( + "e0f3dba8ddb543a2ca", + "f0f9e8bae4bc7bccc42b8cbe", + "f0f9e8bae4bc7bccc443a2ca0868ac", + "f0f9e8ccebc5a8ddb57bccc443a2ca0868ac", + "f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e", + "f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e", + "f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081" + ).map(colors); + + var GnBu = ramp(scheme$11); + + var scheme$12 = new Array(3).concat( + "fee8c8fdbb84e34a33", + "fef0d9fdcc8afc8d59d7301f", + "fef0d9fdcc8afc8d59e34a33b30000", + "fef0d9fdd49efdbb84fc8d59e34a33b30000", + "fef0d9fdd49efdbb84fc8d59ef6548d7301f990000", + "fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000", + "fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000" + ).map(colors); + + var OrRd = ramp(scheme$12); + + var scheme$13 = new Array(3).concat( + "ece2f0a6bddb1c9099", + "f6eff7bdc9e167a9cf02818a", + "f6eff7bdc9e167a9cf1c9099016c59", + "f6eff7d0d1e6a6bddb67a9cf1c9099016c59", + "f6eff7d0d1e6a6bddb67a9cf3690c002818a016450", + "fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450", + "fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636" + ).map(colors); + + var PuBuGn = ramp(scheme$13); + + var scheme$14 = new Array(3).concat( + "ece7f2a6bddb2b8cbe", + "f1eef6bdc9e174a9cf0570b0", + "f1eef6bdc9e174a9cf2b8cbe045a8d", + "f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d", + "f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b", + "fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b", + "fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858" + ).map(colors); + + var PuBu = ramp(scheme$14); + + var scheme$15 = new Array(3).concat( + "e7e1efc994c7dd1c77", + "f1eef6d7b5d8df65b0ce1256", + "f1eef6d7b5d8df65b0dd1c77980043", + "f1eef6d4b9dac994c7df65b0dd1c77980043", + "f1eef6d4b9dac994c7df65b0e7298ace125691003f", + "f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f", + "f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f" + ).map(colors); + + var PuRd = ramp(scheme$15); + + var scheme$16 = new Array(3).concat( + "fde0ddfa9fb5c51b8a", + "feebe2fbb4b9f768a1ae017e", + "feebe2fbb4b9f768a1c51b8a7a0177", + "feebe2fcc5c0fa9fb5f768a1c51b8a7a0177", + "feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177", + "fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177", + "fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a" + ).map(colors); + + var RdPu = ramp(scheme$16); + + var scheme$17 = new Array(3).concat( + "edf8b17fcdbb2c7fb8", + "ffffcca1dab441b6c4225ea8", + "ffffcca1dab441b6c42c7fb8253494", + "ffffccc7e9b47fcdbb41b6c42c7fb8253494", + "ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84", + "ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84", + "ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58" + ).map(colors); + + var YlGnBu = ramp(scheme$17); + + var scheme$18 = new Array(3).concat( + "f7fcb9addd8e31a354", + "ffffccc2e69978c679238443", + "ffffccc2e69978c67931a354006837", + "ffffccd9f0a3addd8e78c67931a354006837", + "ffffccd9f0a3addd8e78c67941ab5d238443005a32", + "ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32", + "ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529" + ).map(colors); + + var YlGn = ramp(scheme$18); + + var scheme$19 = new Array(3).concat( + "fff7bcfec44fd95f0e", + "ffffd4fed98efe9929cc4c02", + "ffffd4fed98efe9929d95f0e993404", + "ffffd4fee391fec44ffe9929d95f0e993404", + "ffffd4fee391fec44ffe9929ec7014cc4c028c2d04", + "ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04", + "ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506" + ).map(colors); + + var YlOrBr = ramp(scheme$19); + + var scheme$20 = new Array(3).concat( + "ffeda0feb24cf03b20", + "ffffb2fecc5cfd8d3ce31a1c", + "ffffb2fecc5cfd8d3cf03b20bd0026", + "ffffb2fed976feb24cfd8d3cf03b20bd0026", + "ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026", + "ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026", + "ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026" + ).map(colors); + + var YlOrRd = ramp(scheme$20); + + var scheme$21 = new Array(3).concat( + "deebf79ecae13182bd", + "eff3ffbdd7e76baed62171b5", + "eff3ffbdd7e76baed63182bd08519c", + "eff3ffc6dbef9ecae16baed63182bd08519c", + "eff3ffc6dbef9ecae16baed64292c62171b5084594", + "f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594", + "f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b" + ).map(colors); + + var Blues = ramp(scheme$21); + + var scheme$22 = new Array(3).concat( + "e5f5e0a1d99b31a354", + "edf8e9bae4b374c476238b45", + "edf8e9bae4b374c47631a354006d2c", + "edf8e9c7e9c0a1d99b74c47631a354006d2c", + "edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32", + "f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32", + "f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b" + ).map(colors); + + var Greens = ramp(scheme$22); + + var scheme$23 = new Array(3).concat( + "f0f0f0bdbdbd636363", + "f7f7f7cccccc969696525252", + "f7f7f7cccccc969696636363252525", + "f7f7f7d9d9d9bdbdbd969696636363252525", + "f7f7f7d9d9d9bdbdbd969696737373525252252525", + "fffffff0f0f0d9d9d9bdbdbd969696737373525252252525", + "fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000" + ).map(colors); + + var Greys = ramp(scheme$23); + + var scheme$24 = new Array(3).concat( + "efedf5bcbddc756bb1", + "f2f0f7cbc9e29e9ac86a51a3", + "f2f0f7cbc9e29e9ac8756bb154278f", + "f2f0f7dadaebbcbddc9e9ac8756bb154278f", + "f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486", + "fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486", + "fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d" + ).map(colors); + + var Purples = ramp(scheme$24); + + var scheme$25 = new Array(3).concat( + "fee0d2fc9272de2d26", + "fee5d9fcae91fb6a4acb181d", + "fee5d9fcae91fb6a4ade2d26a50f15", + "fee5d9fcbba1fc9272fb6a4ade2d26a50f15", + "fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d", + "fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d", + "fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d" + ).map(colors); + + var Reds = ramp(scheme$25); + + var scheme$26 = new Array(3).concat( + "fee6cefdae6be6550d", + "feeddefdbe85fd8d3cd94701", + "feeddefdbe85fd8d3ce6550da63603", + "feeddefdd0a2fdae6bfd8d3ce6550da63603", + "feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04", + "fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04", + "fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704" + ).map(colors); + + var Oranges = ramp(scheme$26); + + exports.schemeAccent = Accent; + exports.schemeDark2 = Dark2; + exports.schemePaired = Paired; + exports.schemePastel1 = Pastel1; + exports.schemePastel2 = Pastel2; + exports.schemeSet1 = Set1; + exports.schemeSet2 = Set2; + exports.schemeSet3 = Set3; + exports.interpolateBrBG = BrBG; + exports.schemeBrBG = scheme; + exports.interpolatePRGn = PRGn; + exports.schemePRGn = scheme$1; + exports.interpolatePiYG = PiYG; + exports.schemePiYG = scheme$2; + exports.interpolatePuOr = PuOr; + exports.schemePuOr = scheme$3; + exports.interpolateRdBu = RdBu; + exports.schemeRdBu = scheme$4; + exports.interpolateRdGy = RdGy; + exports.schemeRdGy = scheme$5; + exports.interpolateRdYlBu = RdYlBu; + exports.schemeRdYlBu = scheme$6; + exports.interpolateRdYlGn = RdYlGn; + exports.schemeRdYlGn = scheme$7; + exports.interpolateSpectral = Spectral; + exports.schemeSpectral = scheme$8; + exports.interpolateBuGn = BuGn; + exports.schemeBuGn = scheme$9; + exports.interpolateBuPu = BuPu; + exports.schemeBuPu = scheme$10; + exports.interpolateGnBu = GnBu; + exports.schemeGnBu = scheme$11; + exports.interpolateOrRd = OrRd; + exports.schemeOrRd = scheme$12; + exports.interpolatePuBuGn = PuBuGn; + exports.schemePuBuGn = scheme$13; + exports.interpolatePuBu = PuBu; + exports.schemePuBu = scheme$14; + exports.interpolatePuRd = PuRd; + exports.schemePuRd = scheme$15; + exports.interpolateRdPu = RdPu; + exports.schemeRdPu = scheme$16; + exports.interpolateYlGnBu = YlGnBu; + exports.schemeYlGnBu = scheme$17; + exports.interpolateYlGn = YlGn; + exports.schemeYlGn = scheme$18; + exports.interpolateYlOrBr = YlOrBr; + exports.schemeYlOrBr = scheme$19; + exports.interpolateYlOrRd = YlOrRd; + exports.schemeYlOrRd = scheme$20; + exports.interpolateBlues = Blues; + exports.schemeBlues = scheme$21; + exports.interpolateGreens = Greens; + exports.schemeGreens = scheme$22; + exports.interpolateGreys = Greys; + exports.schemeGreys = scheme$23; + exports.interpolatePurples = Purples; + exports.schemePurples = scheme$24; + exports.interpolateReds = Reds; + exports.schemeReds = scheme$25; + exports.interpolateOranges = Oranges; + exports.schemeOranges = scheme$26; + + Object.defineProperty(exports, '__esModule', { value: true }); + + }))); + + +/***/ }, +/* 283 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -19274,15 +19792,15 @@ var Circos = var _keys2 = _interopRequireDefault(_keys); - var _includes = __webpack_require__(283); + var _includes = __webpack_require__(284); var _includes2 = _interopRequireDefault(_includes); - var _every = __webpack_require__(287); + var _every = __webpack_require__(288); var _every2 = _interopRequireDefault(_every); - var _map = __webpack_require__(290); + var _map = __webpack_require__(291); var _map2 = _interopRequireDefault(_map); @@ -19451,18 +19969,18 @@ var Circos = return { data: [], meta: { min: null, max: null } }; } - var preParsedData = normalize(data, ['source_id', 'source_start', 'source_end', 'target_id', 'target_start', 'target_end', 'value']); + var preParsedData = normalize(data, ['sourceId', 'sourceStart', 'sourceEnd', 'targetId', 'targetStart', 'targetEnd']); var formatedData = preParsedData.filter(function (datum, index) { - return checkParent(datum[0], index, layoutSummary, 'source_id'); + return checkParent(datum[0], index, layoutSummary, 'sourceId'); }).filter(function (datum, index) { - return checkParent(datum[3], index, layoutSummary, 'target_id'); + return checkParent(datum[3], index, layoutSummary, 'targetId'); }).filter(function (datum, index) { return checkNumber({ - source_start: datum[1], - source_end: datum[2], - target_start: datum[4], - target_end: datum[5], + sourceStart: datum[1], + sourceEnd: datum[2], + targetStart: datum[4], + targetEnd: datum[5], value: datum[6] || 1 }, index); }).map(function (datum) { @@ -19477,7 +19995,7 @@ var Circos = start: Math.max(0, parseFloat(datum[4])), end: Math.min(layoutSummary[datum[3]], parseFloat(datum[5])) }, - value: parseFloat(datum[6]) + value: parseFloat(datum[6]) || 1 }; }); @@ -19495,14 +20013,14 @@ var Circos = } /***/ }, -/* 283 */ +/* 284 */ /***/ function(module, exports, __webpack_require__) { var baseIndexOf = __webpack_require__(246), isArrayLike = __webpack_require__(78), - isString = __webpack_require__(284), + isString = __webpack_require__(285), toInteger = __webpack_require__(255), - values = __webpack_require__(285); + values = __webpack_require__(286); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; @@ -19554,7 +20072,7 @@ var Circos = /***/ }, -/* 284 */ +/* 285 */ /***/ function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(13), @@ -19590,10 +20108,10 @@ var Circos = /***/ }, -/* 285 */ +/* 286 */ /***/ function(module, exports, __webpack_require__) { - var baseValues = __webpack_require__(286), + var baseValues = __webpack_require__(287), keys = __webpack_require__(103); /** @@ -19630,7 +20148,7 @@ var Circos = /***/ }, -/* 286 */ +/* 287 */ /***/ function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__(169); @@ -19655,11 +20173,11 @@ var Circos = /***/ }, -/* 287 */ +/* 288 */ /***/ function(module, exports, __webpack_require__) { - var arrayEvery = __webpack_require__(288), - baseEvery = __webpack_require__(289), + var arrayEvery = __webpack_require__(289), + baseEvery = __webpack_require__(290), baseIteratee = __webpack_require__(142), isArray = __webpack_require__(76), isIterateeCall = __webpack_require__(98); @@ -19717,7 +20235,7 @@ var Circos = /***/ }, -/* 288 */ +/* 289 */ /***/ function(module, exports) { /** @@ -19746,7 +20264,7 @@ var Circos = /***/ }, -/* 289 */ +/* 290 */ /***/ function(module, exports, __webpack_require__) { var baseEach = __webpack_require__(101); @@ -19773,7 +20291,7 @@ var Circos = /***/ }, -/* 290 */ +/* 291 */ /***/ function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__(169), @@ -19832,7 +20350,7 @@ var Circos = /***/ }, -/* 291 */ +/* 292 */ /***/ function(module, exports) { 'use strict'; @@ -19948,7 +20466,7 @@ var Circos = exports.common = common; /***/ }, -/* 292 */ +/* 293 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -19963,13 +20481,13 @@ var Circos = var _Track3 = _interopRequireDefault(_Track2); - var _dataParser = __webpack_require__(282); + var _dataParser = __webpack_require__(283); var _assign = __webpack_require__(210); var _assign2 = _interopRequireDefault(_assign); - var _configs = __webpack_require__(291); + var _configs = __webpack_require__(292); var _d3Shape = __webpack_require__(188); @@ -20029,7 +20547,7 @@ var Circos = exports.default = Highlight; /***/ }, -/* 293 */ +/* 294 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -20044,7 +20562,7 @@ var Circos = var _Track3 = _interopRequireDefault(_Track2); - var _dataParser = __webpack_require__(282); + var _dataParser = __webpack_require__(283); var _d3Shape = __webpack_require__(188); @@ -20052,7 +20570,7 @@ var Circos = var _assign2 = _interopRequireDefault(_assign); - var _configs = __webpack_require__(291); + var _configs = __webpack_require__(292); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -20075,7 +20593,7 @@ var Circos = value: [], iteratee: false } - }, _configs.axes, _configs.palette, _configs.radial, _configs.common, _configs.values); + }, _configs.axes, _configs.radial, _configs.common, _configs.values); var Histogram = function (_Track) { _inherits(Histogram, _Track); @@ -20089,7 +20607,7 @@ var Circos = _createClass(Histogram, [{ key: 'renderDatumContainer', value: function renderDatumContainer(instance, parentElement, name, data, conf) { - var track = parentElement.append('g').attr('class', this.conf.colorPalette); + var track = parentElement.append('g'); return this.renderBlock(track, data, instance._layout, conf); } }, { @@ -20116,13 +20634,7 @@ var Circos = }).endAngle(function (d) { return utils.theta(d.end, layout.blocks[d.block_id]); })); - if (conf.usePalette) { - bin.attr('class', function (d) { - return 'q' + _this2.colorScale(d.value) + '-' + conf.colorPaletteSize; - }); - } else { - bin.attr('fill', conf.color); - } + bin.attr('fill', conf.color); return bin; } }]); @@ -20133,7 +20645,7 @@ var Circos = exports.default = Histogram; /***/ }, -/* 294 */ +/* 295 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -20148,17 +20660,17 @@ var Circos = var _Track3 = _interopRequireDefault(_Track2); - var _dataParser = __webpack_require__(282); + var _dataParser = __webpack_require__(283); var _tooltip = __webpack_require__(193); - var _d3Chord = __webpack_require__(295); + var _d3Chord = __webpack_require__(296); var _assign = __webpack_require__(210); var _assign2 = _interopRequireDefault(_assign); - var _configs = __webpack_require__(291); + var _configs = __webpack_require__(292); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -20173,7 +20685,7 @@ var Circos = value: '#fd6a62', iteratee: true } - }, _configs.palette, _configs.common, _configs.values); + }, _configs.common, _configs.values); var Chords = function (_Track) { _inherits(Chords, _Track); @@ -20202,7 +20714,7 @@ var Circos = value: function renderChords(parentElement, name, conf, data, layout, getCoordinates) { var _this2 = this; - var track = parentElement.append('g').attr('class', conf.colorPalette); + var track = parentElement.append('g'); var that = this; var link = track.selectAll('.chord').data(data).enter().append('path').attr('class', 'chord').attr('d', (0, _d3Chord.ribbon)().source(function (d) { @@ -20215,13 +20727,8 @@ var Circos = return that.dispatch.call('mouseout', _this2, d); }); - if (conf.usePalette) { - link.attr('class', function (d) { - return 'q' + _this2.colorScale(d.value) + '-' + conf.colorPaletteSize; - }); - } else { - link.attr('fill', conf.color); - } + link.attr('fill', conf.colorIteratee); + return link; } }, { @@ -20245,7 +20752,7 @@ var Circos = exports.default = Chords; /***/ }, -/* 295 */ +/* 296 */ /***/ function(module, exports, __webpack_require__) { // https://d3js.org/d3-chord/ Version 1.0.3. Copyright 2016 Mike Bostock. @@ -20481,7 +20988,7 @@ var Circos = /***/ }, -/* 296 */ +/* 297 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -20496,7 +21003,7 @@ var Circos = var _Track3 = _interopRequireDefault(_Track2); - var _dataParser = __webpack_require__(282); + var _dataParser = __webpack_require__(283); var _d3Shape = __webpack_require__(188); @@ -20504,7 +21011,7 @@ var Circos = var _assign2 = _interopRequireDefault(_assign); - var _configs = __webpack_require__(291); + var _configs = __webpack_require__(292); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -20519,7 +21026,7 @@ var Circos = value: [], iteratee: false } - }, _configs.radial, _configs.palette, _configs.values, _configs.common); + }, _configs.radial, _configs.values, _configs.common); var Heatmap = function (_Track) { _inherits(Heatmap, _Track); @@ -20533,7 +21040,7 @@ var Circos = _createClass(Heatmap, [{ key: 'renderDatumContainer', value: function renderDatumContainer(instance, parentElement, name, data, conf) { - var track = parentElement.append('g').attr('class', conf.colorPalette); + var track = parentElement.append('g'); return this.renderBlock(track, data, instance._layout, conf); } @@ -20548,9 +21055,7 @@ var Circos = return _this2.theta(d.start, layout.blocks[d.block_id]); }).endAngle(function (d, i) { return _this2.theta(d.end, layout.blocks[d.block_id]); - })).attr('class', function (d) { - return 'q' + _this2.colorScale(d.value) + '-' + conf.colorPaletteSize; - }); + })).attr('fill', conf.color); } }]); @@ -20560,7 +21065,7 @@ var Circos = exports.default = Heatmap; /***/ }, -/* 297 */ +/* 298 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -20575,13 +21080,13 @@ var Circos = var _Track3 = _interopRequireDefault(_Track2); - var _dataParser = __webpack_require__(282); + var _dataParser = __webpack_require__(283); var _assign = __webpack_require__(210); var _assign2 = _interopRequireDefault(_assign); - var _configs = __webpack_require__(291); + var _configs = __webpack_require__(292); var _d3Shape = __webpack_require__(188); @@ -20690,7 +21195,7 @@ var Circos = exports.default = Line; /***/ }, -/* 298 */ +/* 299 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -20705,13 +21210,13 @@ var Circos = var _Track3 = _interopRequireDefault(_Track2); - var _dataParser = __webpack_require__(282); + var _dataParser = __webpack_require__(283); var _assign = __webpack_require__(210); var _assign2 = _interopRequireDefault(_assign); - var _configs = __webpack_require__(291); + var _configs = __webpack_require__(292); var _d3Shape = __webpack_require__(188); @@ -20823,7 +21328,7 @@ var Circos = exports.default = Scatter; /***/ }, -/* 299 */ +/* 300 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -20838,7 +21343,7 @@ var Circos = var _Track3 = _interopRequireDefault(_Track2); - var _dataParser = __webpack_require__(282); + var _dataParser = __webpack_require__(283); var _d3Shape = __webpack_require__(188); @@ -20850,7 +21355,7 @@ var Circos = var _forEach2 = _interopRequireDefault(_forEach); - var _configs = __webpack_require__(291); + var _configs = __webpack_require__(292); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -20893,7 +21398,7 @@ var Circos = value: [], iteratee: false } - }, _configs.palette, _configs.axes, _configs.radial, _configs.values, _configs.common); + }, _configs.axes, _configs.radial, _configs.values, _configs.common); var Stack = function (_Track) { _inherits(Stack, _Track); @@ -20972,7 +21477,7 @@ var Circos = }, { key: 'renderDatumContainer', value: function renderDatumContainer(instance, parentElement, name, data, conf) { - var track = parentElement.append('g').attr('class', conf.colorPalette); + var track = parentElement.append('g'); return this.renderBlock(track, data, instance._layout, conf); } }, { @@ -20990,11 +21495,7 @@ var Circos = endAngle: utils.theta(datum.end, layout.blocks[datum.block_id]) }; }); - }).enter().append('path').attr('class', 'tile').attr('d', (0, _d3Shape.arc)()).attr('opacity', conf.opacity).attr('stroke-width', conf.strokeWidth).attr('stroke', conf.strokeColor).attr('fill', conf.color).attr('class', function (d) { - if (conf.usePalette) { - return 'q' + utils.ratio(d.value, conf.cmin, conf.cmax, conf.colorPaletteSize, conf.colorPaletteReverse, conf.logScale) + '-' + conf.colorPaletteSize; - } - }); + }).enter().append('path').attr('class', 'tile').attr('d', (0, _d3Shape.arc)()).attr('opacity', conf.opacity).attr('stroke-width', conf.strokeWidth).attr('stroke', conf.strokeColor).attr('fill', conf.color); } }]); @@ -21003,45 +21504,5 @@ var Circos = exports.default = Stack; -/***/ }, -/* 300 */ -/***/ function(module, exports, __webpack_require__) { - - // style-loader: Adds some css to the DOM by adding a