You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2015/07/07 23:15:33 UTC
[1/2] ambari git commit: Revert "Vivek's changes"
Repository: ambari
Updated Branches:
refs/heads/trunk 7d059e7dc -> b800592c4
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/vendor/vega-lite.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/vendor/vega-lite.js b/contrib/views/hive/src/main/resources/ui/hive-web/vendor/vega-lite.js
deleted file mode 100644
index f5ea13b..0000000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/vendor/vega-lite.js
+++ /dev/null
@@ -1,6177 +0,0 @@
-!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.vl=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-'use strict';
-
-require('./globals');
-
-var util = require('./util'),
- consts = require('./consts');
-
-var vl = {};
-
-util.extend(vl, consts, util);
-
-vl.Encoding = require('./Encoding');
-vl.compiler = require('./compiler/compiler');
-vl.compile = vl.compiler.compile;
-vl.data = require('./data');
-vl.enc = require('./enc');
-vl.field = require('./field');
-vl.schema = require('./schema/schema');
-vl.toShorthand = vl.Encoding.shorthand;
-
-module.exports = vl;
-},{"./Encoding":13,"./compiler/compiler":17,"./consts":31,"./data":32,"./enc":33,"./field":34,"./globals":35,"./schema/schema":36,"./util":38}],2:[function(require,module,exports){
-
-},{}],3:[function(require,module,exports){
-// This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/).
-// JavaScript specs as packaged in the D3 library (d3js.org). Please see license at http://colorbrewer.org/export/LICENSE.txt
-!function() {
-
-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"]
-}};
-
-if (typeof define === "function" && define.amd) {
- define(colorbrewer);
-} else if (typeof module === "object" && module.exports) {
- module.exports = colorbrewer;
-} else {
- this.colorbrewer = colorbrewer;
-}
-
-}();
-
-},{}],4:[function(require,module,exports){
-module.exports = require('./colorbrewer.js');
-
-},{"./colorbrewer.js":3}],5:[function(require,module,exports){
-if (typeof Map === "undefined") {
- Map = function() {};
- Map.prototype = {
- set: function(k, v) { this["$" + k] = v; return this; },
- get: function(k) { return this["$" + k]; },
- has: function(k) { return "$" + k in this; }
- };
-}
-
-(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
- factory((global.color = {}));
-}(this, function (exports) { 'use strict';
-
- function Color() {}
-
- Color.prototype = {
- toString: function() {
- return this.rgb() + "";
- }
- };
-
- var named = (new Map)
- .set("aliceblue", 0xf0f8ff)
- .set("antiquewhite", 0xfaebd7)
- .set("aqua", 0x00ffff)
- .set("aquamarine", 0x7fffd4)
- .set("azure", 0xf0ffff)
- .set("beige", 0xf5f5dc)
- .set("bisque", 0xffe4c4)
- .set("black", 0x000000)
- .set("blanchedalmond", 0xffebcd)
- .set("blue", 0x0000ff)
- .set("blueviolet", 0x8a2be2)
- .set("brown", 0xa52a2a)
- .set("burlywood", 0xdeb887)
- .set("cadetblue", 0x5f9ea0)
- .set("chartreuse", 0x7fff00)
- .set("chocolate", 0xd2691e)
- .set("coral", 0xff7f50)
- .set("cornflowerblue", 0x6495ed)
- .set("cornsilk", 0xfff8dc)
- .set("crimson", 0xdc143c)
- .set("cyan", 0x00ffff)
- .set("darkblue", 0x00008b)
- .set("darkcyan", 0x008b8b)
- .set("darkgoldenrod", 0xb8860b)
- .set("darkgray", 0xa9a9a9)
- .set("darkgreen", 0x006400)
- .set("darkgrey", 0xa9a9a9)
- .set("darkkhaki", 0xbdb76b)
- .set("darkmagenta", 0x8b008b)
- .set("darkolivegreen", 0x556b2f)
- .set("darkorange", 0xff8c00)
- .set("darkorchid", 0x9932cc)
- .set("darkred", 0x8b0000)
- .set("darksalmon", 0xe9967a)
- .set("darkseagreen", 0x8fbc8f)
- .set("darkslateblue", 0x483d8b)
- .set("darkslategray", 0x2f4f4f)
- .set("darkslategrey", 0x2f4f4f)
- .set("darkturquoise", 0x00ced1)
- .set("darkviolet", 0x9400d3)
- .set("deeppink", 0xff1493)
- .set("deepskyblue", 0x00bfff)
- .set("dimgray", 0x696969)
- .set("dimgrey", 0x696969)
- .set("dodgerblue", 0x1e90ff)
- .set("firebrick", 0xb22222)
- .set("floralwhite", 0xfffaf0)
- .set("forestgreen", 0x228b22)
- .set("fuchsia", 0xff00ff)
- .set("gainsboro", 0xdcdcdc)
- .set("ghostwhite", 0xf8f8ff)
- .set("gold", 0xffd700)
- .set("goldenrod", 0xdaa520)
- .set("gray", 0x808080)
- .set("green", 0x008000)
- .set("greenyellow", 0xadff2f)
- .set("grey", 0x808080)
- .set("honeydew", 0xf0fff0)
- .set("hotpink", 0xff69b4)
- .set("indianred", 0xcd5c5c)
- .set("indigo", 0x4b0082)
- .set("ivory", 0xfffff0)
- .set("khaki", 0xf0e68c)
- .set("lavender", 0xe6e6fa)
- .set("lavenderblush", 0xfff0f5)
- .set("lawngreen", 0x7cfc00)
- .set("lemonchiffon", 0xfffacd)
- .set("lightblue", 0xadd8e6)
- .set("lightcoral", 0xf08080)
- .set("lightcyan", 0xe0ffff)
- .set("lightgoldenrodyellow", 0xfafad2)
- .set("lightgray", 0xd3d3d3)
- .set("lightgreen", 0x90ee90)
- .set("lightgrey", 0xd3d3d3)
- .set("lightpink", 0xffb6c1)
- .set("lightsalmon", 0xffa07a)
- .set("lightseagreen", 0x20b2aa)
- .set("lightskyblue", 0x87cefa)
- .set("lightslategray", 0x778899)
- .set("lightslategrey", 0x778899)
- .set("lightsteelblue", 0xb0c4de)
- .set("lightyellow", 0xffffe0)
- .set("lime", 0x00ff00)
- .set("limegreen", 0x32cd32)
- .set("linen", 0xfaf0e6)
- .set("magenta", 0xff00ff)
- .set("maroon", 0x800000)
- .set("mediumaquamarine", 0x66cdaa)
- .set("mediumblue", 0x0000cd)
- .set("mediumorchid", 0xba55d3)
- .set("mediumpurple", 0x9370db)
- .set("mediumseagreen", 0x3cb371)
- .set("mediumslateblue", 0x7b68ee)
- .set("mediumspringgreen", 0x00fa9a)
- .set("mediumturquoise", 0x48d1cc)
- .set("mediumvioletred", 0xc71585)
- .set("midnightblue", 0x191970)
- .set("mintcream", 0xf5fffa)
- .set("mistyrose", 0xffe4e1)
- .set("moccasin", 0xffe4b5)
- .set("navajowhite", 0xffdead)
- .set("navy", 0x000080)
- .set("oldlace", 0xfdf5e6)
- .set("olive", 0x808000)
- .set("olivedrab", 0x6b8e23)
- .set("orange", 0xffa500)
- .set("orangered", 0xff4500)
- .set("orchid", 0xda70d6)
- .set("palegoldenrod", 0xeee8aa)
- .set("palegreen", 0x98fb98)
- .set("paleturquoise", 0xafeeee)
- .set("palevioletred", 0xdb7093)
- .set("papayawhip", 0xffefd5)
- .set("peachpuff", 0xffdab9)
- .set("peru", 0xcd853f)
- .set("pink", 0xffc0cb)
- .set("plum", 0xdda0dd)
- .set("powderblue", 0xb0e0e6)
- .set("purple", 0x800080)
- .set("rebeccapurple", 0x663399)
- .set("red", 0xff0000)
- .set("rosybrown", 0xbc8f8f)
- .set("royalblue", 0x4169e1)
- .set("saddlebrown", 0x8b4513)
- .set("salmon", 0xfa8072)
- .set("sandybrown", 0xf4a460)
- .set("seagreen", 0x2e8b57)
- .set("seashell", 0xfff5ee)
- .set("sienna", 0xa0522d)
- .set("silver", 0xc0c0c0)
- .set("skyblue", 0x87ceeb)
- .set("slateblue", 0x6a5acd)
- .set("slategray", 0x708090)
- .set("slategrey", 0x708090)
- .set("snow", 0xfffafa)
- .set("springgreen", 0x00ff7f)
- .set("steelblue", 0x4682b4)
- .set("tan", 0xd2b48c)
- .set("teal", 0x008080)
- .set("thistle", 0xd8bfd8)
- .set("tomato", 0xff6347)
- .set("turquoise", 0x40e0d0)
- .set("violet", 0xee82ee)
- .set("wheat", 0xf5deb3)
- .set("white", 0xffffff)
- .set("whitesmoke", 0xf5f5f5)
- .set("yellow", 0xffff00)
- .set("yellowgreen", 0x9acd32);
-
- function Rgb(r, g, b) {
- this.r = Math.max(0, Math.min(255, Math.round(r)));
- this.g = Math.max(0, Math.min(255, Math.round(g)));
- this.b = Math.max(0, Math.min(255, Math.round(b)));
- }
-
- var _prototype = Rgb.prototype = new Color;
-
- var darker = .7;
-
- _prototype.darker = function(k) {
- k = k == null ? darker : Math.pow(darker, k);
- return new Rgb(this.r * k, this.g * k, this.b * k);
- };
-
- var brighter = 1 / darker;
-
- _prototype.brighter = function(k) {
- k = k == null ? brighter : Math.pow(brighter, k);
- return new Rgb(this.r * k, this.g * k, this.b * k);
- };
-
- _prototype.rgb = function() {
- return this;
- };
-
- function format(r, g, b) {
- if (isNaN(r)) r = 0;
- if (isNaN(g)) g = 0;
- if (isNaN(b)) b = 0;
- return "#"
- + (r < 16 ? "0" + r.toString(16) : r.toString(16))
- + (g < 16 ? "0" + g.toString(16) : g.toString(16))
- + (b < 16 ? "0" + b.toString(16) : b.toString(16));
- }
-
- _prototype.toString = function() {
- return format(this.r, this.g, this.b);
- };
-
- var rgb = function(r, g, b) {
- if (arguments.length === 1) {
- if (!(r instanceof Color)) r = color(r);
- if (r) {
- r = r.rgb();
- b = r.b;
- g = r.g;
- r = r.r;
- } else {
- r = g = b = NaN;
- }
- }
- return new Rgb(r, g, b);
- }
-
- function rgbn(n) {
- return rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff);
- }
-
- function Hsl(h, s, l) {
- this.h = +h;
- this.s = Math.max(0, Math.min(1, +s));
- this.l = Math.max(0, Math.min(1, +l));
- }
-
- var __prototype = Hsl.prototype = new Color;
-
- __prototype.brighter = function(k) {
- k = k == null ? brighter : Math.pow(brighter, k);
- return new Hsl(this.h, this.s, this.l * k);
- };
-
- __prototype.darker = function(k) {
- k = k == null ? darker : Math.pow(darker, k);
- return new Hsl(this.h, this.s, this.l * k);
- };/* From FvD 13.37, CSS Color Module Level 3 */
-
- function hsl2rgb(h, m1, m2) {
- return (h < 60 ? m1 + (m2 - m1) * h / 60
- : h < 180 ? m2
- : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60
- : m1) * 255;
- }
-
- __prototype.rgb = function() {
- var h = this.h % 360 + (this.h < 0) * 360,
- s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
- l = this.l,
- m2 = l <= .5 ? l * (1 + s) : l + s - l * s,
- m1 = 2 * l - m2;
- return new Rgb(
- hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
- hsl2rgb(h, m1, m2),
- hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2)
- );
- };
-
- var hsl = function(h, s, l) {
- if (arguments.length === 1) {
- if (h instanceof Hsl) {
- l = h.l;
- s = h.s;
- h = h.h;
- } else {
- if (!(h instanceof Color)) h = color(h);
- if (h) {
- if (h instanceof Hsl) return h;
- h = h.rgb();
- var r = h.r / 255,
- g = h.g / 255,
- b = h.b / 255,
- min = Math.min(r, g, b),
- max = Math.max(r, g, b),
- range = max - min;
- l = (max + min) / 2;
- if (range) {
- s = l < .5 ? range / (max + min) : range / (2 - max - min);
- if (r === max) h = (g - b) / range + (g < b) * 6;
- else if (g === max) h = (b - r) / range + 2;
- else h = (r - g) / range + 4;
- h *= 60;
- } else {
- h = NaN;
- s = l > 0 && l < 1 ? 0 : h;
- }
- } else {
- h = s = l = NaN;
- }
- }
- }
- return new Hsl(h, s, l);
- }
-
- var reHex3 = /^#([0-9a-f]{3})$/,
- reHex6 = /^#([0-9a-f]{6})$/,
- reRgbInteger = /^rgb\(\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*\)$/,
- reRgbPercent = /^rgb\(\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*\)$/,
- reHslPercent = /^hsl\(\s*([-+]?\d+(?:\.\d+)?)\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*\)$/;
-
- var color = function(format) {
- var m;
- format = (format + "").trim().toLowerCase();
- return (m = reHex3.exec(format)) ? (m = parseInt(m[1], 16), rgb((m >> 8 & 0xf) | (m >> 4 & 0x0f0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf))) // #f00
- : (m = reHex6.exec(format)) ? rgbn(parseInt(m[1], 16)) // #ff0000
- : (m = reRgbInteger.exec(format)) ? rgb(m[1], m[2], m[3]) // rgb(255,0,0)
- : (m = reRgbPercent.exec(format)) ? rgb(m[1] * 2.55, m[2] * 2.55, m[3] * 2.55) // rgb(100%,0%,0%)
- : (m = reHslPercent.exec(format)) ? hsl(m[1], m[2] * .01, m[3] * .01) // hsl(120,50%,50%)
- : named.has(format) ? rgbn(named.get(format))
- : null;
- }// Done lazily to avoid circular dependency between Color, Rgb and Hsl.
-
- color.prototype = Color.prototype;
- rgb.prototype = Rgb.prototype;
- hsl.prototype = Hsl.prototype;
-
- function Lab(l, a, b) {
- this.l = +l;
- this.a = +a;
- this.b = +b;
- }
-
- var ___prototype = Lab.prototype = new Color;
-
- var Kn = 18;
-
- ___prototype.brighter = function(k) {
- return new Lab(this.l + Kn * (k == null ? 1 : k), this.a, this.b);
- };
-
- ___prototype.darker = function(k) {
- return new Lab(this.l - Kn * (k == null ? 1 : k), this.a, this.b);
- };
-
- function xyz2rgb(x) {
- return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
- }
-
- var Xn = 0.950470, // D65 standard referent
- Yn = 1,
- Zn = 1.088830,
- t0 = 4 / 29,
- t1 = 6 / 29,
- t2 = 3 * t1 * t1,
- t3 = t1 * t1 * t1;
-
- function lab2xyz(t) {
- return t > t1 ? t * t * t : t2 * (t - t0);
- }
-
- ___prototype.rgb = function() {
- var y = (this.l + 16) / 116,
- x = isNaN(this.a) ? y : y + this.a / 500,
- z = isNaN(this.b) ? y : y - this.b / 200;
- y = Yn * lab2xyz(y);
- x = Xn * lab2xyz(x);
- z = Zn * lab2xyz(z);
- return new Rgb(
- xyz2rgb( 3.2404542 * x - 1.5371385 * y - 0.4985314 * z), // D65 -> sRGB
- xyz2rgb(-0.9692660 * x + 1.8760108 * y + 0.0415560 * z),
- xyz2rgb( 0.0556434 * x - 0.2040259 * y + 1.0572252 * z)
- );
- };
-
- function xyz2lab(t) {
- return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;
- }
-
- function rgb2xyz(x) {
- return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
- }
-
- var deg2rad = Math.PI / 180;
-
- function Hcl(h, c, l) {
- this.h = +h;
- this.c = +c;
- this.l = +l;
- }
-
- var ____prototype = Hcl.prototype = new Color;
-
- ____prototype.brighter = function(k) {
- return new Hcl(this.h, this.c, this.l + Kn * (k == null ? 1 : k));
- };
-
- ____prototype.darker = function(k) {
- return new Hcl(this.h, this.c, this.l - Kn * (k == null ? 1 : k));
- };
-
- ____prototype.rgb = function() {
- return lab(this).rgb();
- };
-
- var lab = function(l, a, b) {
- if (arguments.length === 1) {
- if (l instanceof Lab) {
- b = l.b;
- a = l.a;
- l = l.l;
- } else if (l instanceof Hcl) {
- var h = l.h * deg2rad;
- b = Math.sin(h) * l.c;
- a = Math.cos(h) * l.c;
- l = l.l;
- } else {
- if (!(l instanceof Rgb)) l = rgb(l);
- var r = rgb2xyz(l.r),
- g = rgb2xyz(l.g),
- b = rgb2xyz(l.b),
- x = xyz2lab((0.4124564 * r + 0.3575761 * g + 0.1804375 * b) / Xn),
- y = xyz2lab((0.2126729 * r + 0.7151522 * g + 0.0721750 * b) / Yn),
- z = xyz2lab((0.0193339 * r + 0.1191920 * g + 0.9503041 * b) / Zn);
- b = 200 * (y - z);
- a = 500 * (x - y);
- l = 116 * y - 16;
- }
- }
- return new Lab(l, a, b);
- }
- lab.prototype = Lab.prototype;
- var rad2deg = 180 / Math.PI;
-
- var hcl = function(h, c, l) {
- if (arguments.length === 1) {
- if (h instanceof Hcl) {
- l = h.l;
- c = h.c;
- h = h.h;
- } else {
- if (!(h instanceof Lab)) h = lab(h);
- l = h.l;
- c = Math.sqrt(h.a * h.a + h.b * h.b);
- h = Math.atan2(h.b, h.a) * rad2deg;
- if (h < 0) h += 360;
- }
- }
- return new Hcl(h, c, l);
- }
- hcl.prototype = Hcl.prototype;
-
- function Cubehelix(h, s, l) {
- this.h = +h;
- this.s = +s;
- this.l = +l;
- }
-
- var prototype = Cubehelix.prototype = new Color;
-
- prototype.brighter = function(k) {
- k = k == null ? brighter : Math.pow(brighter, k);
- return new Cubehelix(this.h, this.s, this.l * k);
- };
-
- prototype.darker = function(k) {
- k = k == null ? darker : Math.pow(darker, k);
- return new Cubehelix(this.h, this.s, this.l * k);
- };
-
- var gamma = 1, // Default gamma. TODO Customize.
- A = -0.14861,
- B = +1.78277,
- C = -0.29227,
- D = -0.90649,
- E = +1.97294,
- ED = E * D,
- EB = E * B,
- BC_DA = B * C - D * A;
-
- var cubehelix = function(h, s, l) {
- if (arguments.length === 1) {
- if (h instanceof Cubehelix) {
- l = h.l;
- s = h.s;
- h = h.h;
- } else {
- if (!(h instanceof Rgb)) h = rgb(h);
- var r = h.r / 255, g = h.g / 255, b = h.b / 255;
- l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB);
- var bl = b - l, k = (E * (g - l) - C * bl) / D, lgamma = Math.pow(l, gamma);
- s = Math.sqrt(k * k + bl * bl) / (E * lgamma * (1 - lgamma)); // NaN if lgamma=0 or lgamma=1
- h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN;
- if (h < 0) h += 360;
- }
- }
- return new Cubehelix(h, s, l);
- }
-
- prototype.rgb = function() {
- var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad,
- l = Math.pow(this.l, gamma),
- a = isNaN(this.s) ? 0 : this.s * l * (1 - l),
- cosh = Math.cos(h),
- sinh = Math.sin(h);
- return new Rgb(
- 255 * (l + a * (A * cosh + B * sinh)),
- 255 * (l + a * (C * cosh + D * sinh)),
- 255 * (l + a * (E * cosh))
- );
- };
- cubehelix.prototype = Cubehelix.prototype;
-
- var interpolateCubehelixLong = function(a, b) {
- a = cubehelix(a);
- b = cubehelix(b);
- var ah = isNaN(a.h) ? b.h : a.h,
- as = isNaN(a.s) ? b.s : a.s,
- al = a.l,
- bh = isNaN(b.h) ? 0 : b.h - ah,
- bs = isNaN(b.s) ? 0 : b.s - as,
- bl = b.l - al;
- return function(t) {
- a.h = ah + bh * t;
- a.s = as + bs * t;
- a.l = al + bl * t;
- return a + "";
- };
- }
- var deltaHue = function(h, h0) {
- var delta = (h - h0) % 360;
- return delta + (delta > 180 ? -360 : delta < -180 ? 360 : 0);
- }
-
- var interpolateCubehelix = function(a, b) {
- a = cubehelix(a);
- b = cubehelix(b);
- var ah = isNaN(a.h) ? b.h : a.h,
- as = isNaN(a.s) ? b.s : a.s,
- al = a.l,
- bh = isNaN(b.h) ? 0 : deltaHue(b.h, ah),
- bs = isNaN(b.s) ? 0 : b.s - as,
- bl = b.l - al;
- return function(t) {
- a.h = ah + bh * t;
- a.s = as + bs * t;
- a.l = al + bl * t;
- return a + "";
- };
- }
-
- var interpolateHclLong = function(a, b) {
- a = hcl(a);
- b = hcl(b);
- var ah = isNaN(a.h) ? b.h : a.h,
- ac = isNaN(a.c) ? b.c : a.c,
- al = a.l,
- bh = isNaN(b.h) ? 0 : b.h - ah,
- bc = isNaN(b.c) ? 0 : b.c - ac,
- bl = b.l - al;
- return function(t) {
- a.h = ah + bh * t;
- a.c = ac + bc * t;
- a.l = al + bl * t;
- return a + "";
- };
- }
-
- var interpolateHcl = function(a, b) {
- a = hcl(a);
- b = hcl(b);
- var ah = isNaN(a.h) ? b.h : a.h,
- ac = isNaN(a.c) ? b.c : a.c,
- al = a.l,
- bh = isNaN(b.h) ? 0 : deltaHue(b.h, ah),
- bc = isNaN(b.c) ? 0 : b.c - ac,
- bl = b.l - al;
- return function(t) {
- a.h = ah + bh * t;
- a.c = ac + bc * t;
- a.l = al + bl * t;
- return a + "";
- };
- }
-
- var interpolateLab = function(a, b) {
- a = lab(a);
- b = lab(b);
- var al = a.l,
- aa = a.a,
- ab = a.b,
- bl = b.l - al,
- ba = b.a - aa,
- bb = b.b - ab;
- return function(t) {
- a.l = al + bl * t;
- a.a = aa + ba * t;
- a.b = ab + bb * t;
- return a + "";
- };
- }
-
- var interpolateHslLong = function(a, b) {
- a = hsl(a);
- b = hsl(b);
- var ah = isNaN(a.h) ? b.h : a.h,
- as = isNaN(a.s) ? b.s : a.s,
- al = a.l,
- bh = isNaN(b.h) ? 0 : b.h - ah,
- bs = isNaN(b.s) ? 0 : b.s - as,
- bl = b.l - al;
- return function(t) {
- a.h = ah + bh * t;
- a.s = as + bs * t;
- a.l = al + bl * t;
- return a + "";
- };
- }
-
- var interpolateHsl = function(a, b) {
- a = hsl(a);
- b = hsl(b);
- var ah = isNaN(a.h) ? b.h : a.h,
- as = isNaN(a.s) ? b.s : a.s,
- al = a.l,
- bh = isNaN(b.h) ? 0 : deltaHue(b.h, ah),
- bs = isNaN(b.s) ? 0 : b.s - as,
- bl = b.l - al;
- return function(t) {
- a.h = ah + bh * t;
- a.s = as + bs * t;
- a.l = al + bl * t;
- return a + "";
- };
- }
-
- var interpolateRgb = function(a, b) {
- a = rgb(a);
- b = rgb(b);
- var ar = a.r,
- ag = a.g,
- ab = a.b,
- br = b.r - ar,
- bg = b.g - ag,
- bb = b.b - ab;
- return function(t) {
- return format(Math.round(ar + br * t), Math.round(ag + bg * t), Math.round(ab + bb * t));
- };
- }
-
- exports.color = color;
- exports.rgb = rgb;
- exports.hsl = hsl;
- exports.lab = lab;
- exports.hcl = hcl;
- exports.cubehelix = cubehelix;
- exports.interpolateRgb = interpolateRgb;
- exports.interpolateHsl = interpolateHsl;
- exports.interpolateHslLong = interpolateHslLong;
- exports.interpolateLab = interpolateLab;
- exports.interpolateHcl = interpolateHcl;
- exports.interpolateHclLong = interpolateHclLong;
- exports.interpolateCubehelix = interpolateCubehelix;
- exports.interpolateCubehelixLong = interpolateCubehelixLong;
-
-}));
-},{}],6:[function(require,module,exports){
-(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
- factory((global.time = {}));
-}(this, function (exports) { 'use strict';
-
- var t1 = new Date;
-
- var t0 = new Date;
-
- function newInterval(floori, offseti, count) {
-
- function interval(date) {
- return floori(date = new Date(+date)), date;
- }
-
- interval.floor = interval;
-
- interval.round = function(date) {
- var d0 = new Date(+date),
- d1 = new Date(date - 1);
- floori(d0), floori(d1), offseti(d1, 1);
- return date - d0 < d1 - date ? d0 : d1;
- };
-
- interval.ceil = function(date) {
- return floori(date = new Date(date - 1)), offseti(date, 1), date;
- };
-
- interval.offset = function(date, step) {
- return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
- };
-
- interval.range = function(start, stop, step) {
- var range = [];
- start = new Date(start - 1);
- stop = new Date(+stop);
- step = step == null ? 1 : Math.floor(step);
- if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
- offseti(start, 1), floori(start);
- if (start < stop) range.push(new Date(+start));
- while (offseti(start, step), floori(start), start < stop) range.push(new Date(+start));
- return range;
- };
-
- interval.filter = function(test) {
- return newInterval(function(date) {
- while (floori(date), !test(date)) date.setTime(date - 1);
- }, function(date, step) {
- while (--step >= 0) while (offseti(date, 1), !test(date));
- });
- };
-
- if (count) interval.count = function(start, end) {
- t0.setTime(+start), t1.setTime(+end);
- floori(t0), floori(t1);
- return Math.floor(count(t0, t1));
- };
-
- return interval;
- }
-
- var second = newInterval(function(date) {
- date.setMilliseconds(0);
- }, function(date, offset) {
- date.setTime(+date + offset * 1e3);
- }, function(start, end) {
- return (end - start) / 1e3;
- });
-
- exports.seconds = second.range;
-
- var minute = newInterval(function(date) {
- date.setSeconds(0, 0);
- }, function(date, offset) {
- date.setTime(+date + offset * 6e4);
- }, function(start, end) {
- return (end - start) / 6e4;
- });
-
- exports.minutes = minute.range;
-
- var hour = newInterval(function(date) {
- date.setMinutes(0, 0, 0);
- }, function(date, offset) {
- date.setTime(+date + offset * 36e5);
- }, function(start, end) {
- return (end - start) / 36e5;
- });
-
- exports.hours = hour.range;
-
- var day = newInterval(function(date) {
- date.setHours(0, 0, 0, 0);
- }, function(date, offset) {
- date.setDate(date.getDate() + offset);
- }, function(start, end) {
- return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * 6e4) / 864e5;
- });
-
- exports.days = day.range;
-
- function weekday(i) {
- return newInterval(function(date) {
- date.setHours(0, 0, 0, 0);
- date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
- }, function(date, offset) {
- date.setDate(date.getDate() + offset * 7);
- }, function(start, end) {
- return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * 6e4) / 6048e5;
- });
- }
-
- exports.sunday = weekday(0);
-
- exports.sundays = exports.sunday.range;
-
- exports.monday = weekday(1);
-
- exports.mondays = exports.monday.range;
-
- exports.tuesday = weekday(2);
-
- exports.tuesdays = exports.tuesday.range;
-
- exports.wednesday = weekday(3);
-
- exports.wednesdays = exports.wednesday.range;
-
- exports.thursday = weekday(4);
-
- exports.thursdays = exports.thursday.range;
-
- exports.friday = weekday(5);
-
- exports.fridays = exports.friday.range;
-
- exports.saturday = weekday(6);
-
- exports.saturdays = exports.saturday.range;
-
- var week = exports.sunday;
-
- exports.weeks = week.range;
-
- var month = newInterval(function(date) {
- date.setHours(0, 0, 0, 0);
- date.setDate(1);
- }, function(date, offset) {
- date.setMonth(date.getMonth() + offset);
- }, function(start, end) {
- return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
- });
-
- exports.months = month.range;
-
- var year = newInterval(function(date) {
- date.setHours(0, 0, 0, 0);
- date.setMonth(0, 1);
- }, function(date, offset) {
- date.setFullYear(date.getFullYear() + offset);
- }, function(start, end) {
- return end.getFullYear() - start.getFullYear();
- });
-
- exports.years = year.range;
-
- var utcSecond = newInterval(function(date) {
- date.setUTCMilliseconds(0);
- }, function(date, offset) {
- date.setTime(+date + offset * 1e3);
- }, function(start, end) {
- return (end - start) / 1e3;
- });
-
- exports.utcSeconds = utcSecond.range;
-
- var utcMinute = newInterval(function(date) {
- date.setUTCSeconds(0, 0);
- }, function(date, offset) {
- date.setTime(+date + offset * 6e4);
- }, function(start, end) {
- return (end - start) / 6e4;
- });
-
- exports.utcMinutes = utcMinute.range;
-
- var utcHour = newInterval(function(date) {
- date.setUTCMinutes(0, 0, 0);
- }, function(date, offset) {
- date.setTime(+date + offset * 36e5);
- }, function(start, end) {
- return (end - start) / 36e5;
- });
-
- exports.utcHours = utcHour.range;
-
- var utcDay = newInterval(function(date) {
- date.setUTCHours(0, 0, 0, 0);
- }, function(date, offset) {
- date.setUTCDate(date.getUTCDate() + offset);
- }, function(start, end) {
- return (end - start) / 864e5;
- });
-
- exports.utcDays = utcDay.range;
-
- function utcWeekday(i) {
- return newInterval(function(date) {
- date.setUTCHours(0, 0, 0, 0);
- date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
- }, function(date, offset) {
- date.setUTCDate(date.getUTCDate() + offset * 7);
- }, function(start, end) {
- return (end - start) / 6048e5;
- });
- }
-
- exports.utcSunday = utcWeekday(0);
-
- exports.utcSundays = exports.utcSunday.range;
-
- exports.utcMonday = utcWeekday(1);
-
- exports.utcMondays = exports.utcMonday.range;
-
- exports.utcTuesday = utcWeekday(2);
-
- exports.utcTuesdays = exports.utcTuesday.range;
-
- exports.utcWednesday = utcWeekday(3);
-
- exports.utcWednesdays = exports.utcWednesday.range;
-
- exports.utcThursday = utcWeekday(4);
-
- exports.utcThursdays = exports.utcThursday.range;
-
- exports.utcFriday = utcWeekday(5);
-
- exports.utcFridays = exports.utcFriday.range;
-
- exports.utcSaturday = utcWeekday(6);
-
- exports.utcSaturdays = exports.utcSaturday.range;
-
- var utcWeek = exports.utcSunday;
-
- exports.utcWeeks = utcWeek.range;
-
- var utcMonth = newInterval(function(date) {
- date.setUTCHours(0, 0, 0, 0);
- date.setUTCDate(1);
- }, function(date, offset) {
- date.setUTCMonth(date.getUTCMonth() + offset);
- }, function(start, end) {
- return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
- });
-
- exports.utcMonths = utcMonth.range;
-
- var utcYear = newInterval(function(date) {
- date.setUTCHours(0, 0, 0, 0);
- date.setUTCMonth(0, 1);
- }, function(date, offset) {
- date.setUTCFullYear(date.getUTCFullYear() + offset);
- }, function(start, end) {
- return end.getUTCFullYear() - start.getUTCFullYear();
- });
-
- exports.utcYears = utcYear.range;
-
- exports.second = second;
- exports.minute = minute;
- exports.hour = hour;
- exports.day = day;
- exports.week = week;
- exports.month = month;
- exports.year = year;
- exports.utcSecond = utcSecond;
- exports.utcMinute = utcMinute;
- exports.utcHour = utcHour;
- exports.utcDay = utcDay;
- exports.utcWeek = utcWeek;
- exports.utcMonth = utcMonth;
- exports.utcYear = utcYear;
-
-}));
-},{}],7:[function(require,module,exports){
-var util = require('../util'),
- time = require('../time'),
- EPSILON = 1e-15;
-
-function bins(opt) {
- if (!opt) { throw Error("Missing binning options."); }
-
- // determine range
- var maxb = opt.maxbins || 15,
- base = opt.base || 10,
- logb = Math.log(base),
- div = opt.div || [5, 2],
- min = opt.min,
- max = opt.max,
- span = max - min,
- step, level, minstep, precision, v, i, eps;
-
- if (opt.step) {
- // if step size is explicitly given, use that
- step = opt.step;
- } else if (opt.steps) {
- // if provided, limit choice to acceptable step sizes
- step = opt.steps[Math.min(
- opt.steps.length - 1,
- bisect(opt.steps, span/maxb, 0, opt.steps.length)
- )];
- } else {
- // else use span to determine step size
- level = Math.ceil(Math.log(maxb) / logb);
- minstep = opt.minstep || 0;
- step = Math.max(
- minstep,
- Math.pow(base, Math.round(Math.log(span) / logb) - level)
- );
-
- // increase step size if too many bins
- do { step *= base; } while (Math.ceil(span/step) > maxb);
-
- // decrease step size if allowed
- for (i=0; i<div.length; ++i) {
- v = step / div[i];
- if (v >= minstep && span / v <= maxb) step = v;
- }
- }
-
- // update precision, min and max
- v = Math.log(step);
- precision = v >= 0 ? 0 : ~~(-v / logb) + 1;
- eps = Math.pow(base, -precision - 1);
- min = Math.min(min, Math.floor(min / step + eps) * step);
- max = Math.ceil(max / step) * step;
-
- return {
- start: min,
- stop: max,
- step: step,
- unit: {precision: precision},
- value: value,
- index: index
- };
-}
-
-function bisect(a, x, lo, hi) {
- while (lo < hi) {
- var mid = lo + hi >>> 1;
- if (util.cmp(a[mid], x) < 0) { lo = mid + 1; }
- else { hi = mid; }
- }
- return lo;
-}
-
-function value(v) {
- return this.step * Math.floor(v / this.step + EPSILON);
-}
-
-function index(v) {
- return Math.floor((v - this.start) / this.step + EPSILON);
-}
-
-function date_value(v) {
- return this.unit.date(value.call(this, v));
-}
-
-function date_index(v) {
- return index.call(this, this.unit.unit(v));
-}
-
-bins.date = function(opt) {
- if (!opt) { throw Error("Missing date binning options."); }
-
- // find time step, then bin
- var units = opt.utc ? time.utc : time,
- dmin = opt.min,
- dmax = opt.max,
- maxb = opt.maxbins || 20,
- minb = opt.minbins || 4,
- span = (+dmax) - (+dmin),
- unit = opt.unit ? units[opt.unit] : units.find(span, minb, maxb),
- spec = bins({
- min: unit.min != null ? unit.min : unit.unit(dmin),
- max: unit.max != null ? unit.max : unit.unit(dmax),
- maxbins: maxb,
- minstep: unit.minstep,
- steps: unit.step
- });
-
- spec.unit = unit;
- spec.index = date_index;
- if (!opt.raw) spec.value = date_value;
- return spec;
-};
-
-module.exports = bins;
-
-},{"../time":11,"../util":12}],8:[function(require,module,exports){
-var gen = module.exports = {};
-
-gen.repeat = function(val, n) {
- var a = Array(n), i;
- for (i=0; i<n; ++i) a[i] = val;
- return a;
-};
-
-gen.zeros = function(n) {
- return gen.repeat(0, n);
-};
-
-gen.range = function(start, stop, step) {
- if (arguments.length < 3) {
- step = 1;
- if (arguments.length < 2) {
- stop = start;
- start = 0;
- }
- }
- if ((stop - start) / step == Infinity) throw new Error('Infinite range');
- var range = [], i = -1, j;
- if (step < 0) while ((j = start + step * ++i) > stop) range.push(j);
- else while ((j = start + step * ++i) < stop) range.push(j);
- return range;
-};
-
-gen.random = {};
-
-gen.random.uniform = function(min, max) {
- if (max === undefined) {
- max = min === undefined ? 1 : min;
- min = 0;
- }
- var d = max - min;
- var f = function() {
- return min + d * Math.random();
- };
- f.samples = function(n) { return gen.zeros(n).map(f); };
- return f;
-};
-
-gen.random.integer = function(a, b) {
- if (b === undefined) {
- b = a;
- a = 0;
- }
- var d = b - a;
- var f = function() {
- return a + Math.floor(d * Math.random());
- };
- f.samples = function(n) { return gen.zeros(n).map(f); };
- return f;
-};
-
-gen.random.normal = function(mean, stdev) {
- mean = mean || 0;
- stdev = stdev || 1;
- var next;
- var f = function() {
- var x = 0, y = 0, rds, c;
- if (next !== undefined) {
- x = next;
- next = undefined;
- return x;
- }
- do {
- x = Math.random()*2-1;
- y = Math.random()*2-1;
- rds = x*x + y*y;
- } while (rds === 0 || rds > 1);
- c = Math.sqrt(-2*Math.log(rds)/rds); // Box-Muller transform
- next = mean + y*c*stdev;
- return mean + x*c*stdev;
- };
- f.samples = function(n) { return gen.zeros(n).map(f); };
- return f;
-};
-},{}],9:[function(require,module,exports){
-var util = require('../util');
-
-var TYPES = '__types__';
-
-var PARSERS = {
- boolean: util.boolean,
- integer: util.number,
- number: util.number,
- date: util.date,
- string: function(x) { return x==='' ? null : x; }
-};
-
-var TESTS = {
- boolean: function(x) { return x==='true' || x==='false' || util.isBoolean(x); },
- integer: function(x) { return TESTS.number(x) && (x=+x) === ~~x; },
- number: function(x) { return !isNaN(+x) && !util.isDate(x); },
- date: function(x) { return !isNaN(Date.parse(x)); }
-};
-
-function annotation(data, types) {
- if (!types) return data && data[TYPES] || null;
- data[TYPES] = types;
-}
-
-function type(values, f) {
- f = util.$(f);
- var v, i, n;
-
- // if data array has type annotations, use them
- if (values[TYPES]) {
- v = f(values[TYPES]);
- if (util.isString(v)) return v;
- }
-
- for (i=0, n=values.length; !util.isValid(v) && i<n; ++i) {
- v = f ? f(values[i]) : values[i];
- }
-
- return util.isDate(v) ? 'date' :
- util.isNumber(v) ? 'number' :
- util.isBoolean(v) ? 'boolean' :
- util.isString(v) ? 'string' : null;
-}
-
-function typeAll(data, fields) {
- if (!data.length) return;
- fields = fields || util.keys(data[0]);
- return fields.reduce(function(types, f) {
- return (types[f] = type(data, f), types);
- }, {});
-}
-
-function infer(values, f) {
- f = util.$(f);
- var i, j, v;
-
- // types to test for, in precedence order
- var types = ['boolean', 'integer', 'number', 'date'];
-
- for (i=0; i<values.length; ++i) {
- // get next value to test
- v = f ? f(values[i]) : values[i];
- // test value against remaining types
- for (j=0; j<types.length; ++j) {
- if (util.isValid(v) && !TESTS[types[j]](v)) {
- types.splice(j, 1);
- j -= 1;
- }
- }
- // if no types left, return 'string'
- if (types.length === 0) return 'string';
- }
-
- return types[0];
-}
-
-function inferAll(data, fields) {
- fields = fields || util.keys(data[0]);
- return fields.reduce(function(types, f) {
- types[f] = infer(data, f);
- return types;
- }, {});
-}
-
-type.annotation = annotation;
-type.all = typeAll;
-type.infer = infer;
-type.inferAll = inferAll;
-type.parsers = PARSERS;
-module.exports = type;
-},{"../util":12}],10:[function(require,module,exports){
-var util = require('./util');
-var type = require('./import/type');
-var gen = require('./generate');
-var stats = {};
-
-// Collect unique values.
-// Output: an array of unique values, in first-observed order
-stats.unique = function(values, f, results) {
- f = util.$(f);
- results = results || [];
- var u = {}, v, i, n;
- for (i=0, n=values.length; i<n; ++i) {
- v = f ? f(values[i]) : values[i];
- if (v in u) continue;
- u[v] = 1;
- results.push(v);
- }
- return results;
-};
-
-// Return the length of the input array.
-stats.count = function(values) {
- return values && values.length || 0;
-};
-
-// Count the number of non-null, non-undefined, non-NaN values.
-stats.count.valid = function(values, f) {
- f = util.$(f);
- var v, i, n, valid = 0;
- for (i=0, n=values.length; i<n; ++i) {
- v = f ? f(values[i]) : values[i];
- if (util.isValid(v)) valid += 1;
- }
- return valid;
-};
-
-// Count the number of null or undefined values.
-stats.count.missing = function(values, f) {
- f = util.$(f);
- var v, i, n, count = 0;
- for (i=0, n=values.length; i<n; ++i) {
- v = f ? f(values[i]) : values[i];
- if (v == null) count += 1;
- }
- return count;
-};
-
-// Count the number of distinct values.
-// Null, undefined and NaN are each considered distinct values.
-stats.count.distinct = function(values, f) {
- f = util.$(f);
- var u = {}, v, i, n, count = 0;
- for (i=0, n=values.length; i<n; ++i) {
- v = f ? f(values[i]) : values[i];
- if (v in u) continue;
- u[v] = 1;
- count += 1;
- }
- return count;
-};
-
-// Construct a map from distinct values to occurrence counts.
-stats.count.map = function(values, f) {
- f = util.$(f);
- var map = {}, v, i, n;
- for (i=0, n=values.length; i<n; ++i) {
- v = f ? f(values[i]) : values[i];
- map[v] = (v in map) ? map[v] + 1 : 1;
- }
- return map;
-};
-
-// Compute the median of an array of numbers.
-stats.median = function(values, f) {
- if (f) values = values.map(util.$(f));
- values = values.filter(util.isValid).sort(util.cmp);
- return stats.quantile(values, 0.5);
-};
-
-// Computes the quartile boundaries of an array of numbers.
-stats.quartile = function(values, f) {
- if (f) values = values.map(util.$(f));
- values = values.filter(util.isValid).sort(util.cmp);
- var q = stats.quantile;
- return [q(values, 0.25), q(values, 0.50), q(values, 0.75)];
-};
-
-// Compute the quantile of a sorted array of numbers.
-// Adapted from the D3.js implementation.
-stats.quantile = function(values, f, p) {
- if (p === undefined) { p = f; f = util.identity; }
- f = util.$(f);
- var H = (values.length - 1) * p + 1,
- h = Math.floor(H),
- v = +f(values[h - 1]),
- e = H - h;
- return e ? v + e * (f(values[h]) - v) : v;
-};
-
-// Compute the sum of an array of numbers.
-stats.sum = function(values, f) {
- f = util.$(f);
- for (var sum=0, i=0, n=values.length, v; i<n; ++i) {
- v = f ? f(values[i]) : values[i];
- if (util.isValid(v)) sum += v;
- }
- return sum;
-};
-
-// Compute the mean (average) of an array of numbers.
-stats.mean = function(values, f) {
- f = util.$(f);
- var mean = 0, delta, i, n, c, v;
- for (i=0, c=0, n=values.length; i<n; ++i) {
- v = f ? f(values[i]) : values[i];
- if (util.isValid(v)) {
- delta = v - mean;
- mean = mean + delta / (++c);
- }
- }
- return mean;
-};
-
-// Compute the sample variance of an array of numbers.
-stats.variance = function(values, f) {
- f = util.$(f);
- if (!util.isArray(values) || values.length < 2) return 0;
- var mean = 0, M2 = 0, delta, i, c, v;
- for (i=0, c=0; i<values.length; ++i) {
- v = f ? f(values[i]) : values[i];
- if (util.isValid(v)) {
- delta = v - mean;
- mean = mean + delta / (++c);
- M2 = M2 + delta * (v - mean);
- }
- }
- M2 = M2 / (c - 1);
- return M2;
-};
-
-// Compute the sample standard deviation of an array of numbers.
-stats.stdev = function(values, f) {
- return Math.sqrt(stats.variance(values, f));
-};
-
-// Compute the Pearson mode skewness ((median-mean)/stdev) of an array of numbers.
-stats.modeskew = function(values, f) {
- var avg = stats.mean(values, f),
- med = stats.median(values, f),
- std = stats.stdev(values, f);
- return std === 0 ? 0 : (avg - med) / std;
-};
-
-// Find the minimum value in an array.
-stats.min = function(values, f) {
- return stats.extent(values, f)[0];
-};
-
-// Find the maximum value in an array.
-stats.max = function(values, f) {
- return stats.extent(values, f)[1];
-};
-
-// Find the minimum and maximum of an array of values.
-stats.extent = function(values, f) {
- f = util.$(f);
- var a, b, v, i, n = values.length;
- for (i=0; i<n; ++i) {
- v = f ? f(values[i]) : values[i];
- if (util.isValid(v)) { a = b = v; break; }
- }
- for (; i<n; ++i) {
- v = f ? f(values[i]) : values[i];
- if (util.isValid(v)) {
- if (v < a) a = v;
- if (v > b) b = v;
- }
- }
- return [a, b];
-};
-
-// Find the integer indices of the minimum and maximum values.
-stats.extent.index = function(values, f) {
- f = util.$(f);
- var x = -1, y = -1, a, b, v, i, n = values.length;
- for (i=0; i<n; ++i) {
- v = f ? f(values[i]) : values[i];
- if (util.isValid(v)) { a = b = v; x = y = i; break; }
- }
- for (; i<n; ++i) {
- v = f ? f(values[i]) : values[i];
- if (util.isValid(v)) {
- if (v < a) { a = v; x = i; }
- if (v > b) { b = v; y = i; }
- }
- }
- return [x, y];
-};
-
-// Compute the dot product of two arrays of numbers.
-stats.dot = function(values, a, b) {
- var sum = 0, i, v;
- if (!b) {
- if (values.length !== a.length) {
- throw Error('Array lengths must match.');
- }
- for (i=0; i<values.length; ++i) {
- v = values[i] * a[i];
- if (v === v) sum += v;
- }
- } else {
- a = util.$(a);
- b = util.$(b);
- for (i=0; i<values.length; ++i) {
- v = a(values[i]) * b(values[i]);
- if (v === v) sum += v;
- }
- }
- return sum;
-};
-
-// Compute ascending rank scores for an array of values.
-// Ties are assigned their collective mean rank.
-stats.rank = function(values, f) {
- f = util.$(f) || util.identity;
- var a = values.map(function(v, i) {
- return {idx: i, val: f(v)};
- })
- .sort(util.comparator('val'));
-
- var n = values.length,
- r = Array(n),
- tie = -1, p = {}, i, v, mu;
-
- for (i=0; i<n; ++i) {
- v = a[i].val;
- if (tie < 0 && p === v) {
- tie = i - 1;
- } else if (tie > -1 && p !== v) {
- mu = 1 + (i-1 + tie) / 2;
- for (; tie<i; ++tie) r[a[tie].idx] = mu;
- tie = -1;
- }
- r[a[i].idx] = i + 1;
- p = v;
- }
-
- if (tie > -1) {
- mu = 1 + (n-1 + tie) / 2;
- for (; tie<n; ++tie) r[a[tie].idx] = mu;
- }
-
- return r;
-};
-
-// Compute the sample Pearson product-moment correlation of two arrays of numbers.
-stats.cor = function(values, a, b) {
- var fn = b;
- b = fn ? values.map(util.$(b)) : a;
- a = fn ? values.map(util.$(a)) : values;
-
- var dot = stats.dot(a, b),
- mua = stats.mean(a),
- mub = stats.mean(b),
- sda = stats.stdev(a),
- sdb = stats.stdev(b),
- n = values.length;
-
- return (dot - n*mua*mub) / ((n-1) * sda * sdb);
-};
-
-// Compute the Spearman rank correlation of two arrays of values.
-stats.cor.rank = function(values, a, b) {
- var ra = b ? stats.rank(values, util.$(a)) : stats.rank(values),
- rb = b ? stats.rank(values, util.$(b)) : stats.rank(a),
- n = values.length, i, s, d;
-
- for (i=0, s=0; i<n; ++i) {
- d = ra[i] - rb[i];
- s += d * d;
- }
-
- return 1 - 6*s / (n * (n*n-1));
-};
-
-// Compute the distance correlation of two arrays of numbers.
-// http://en.wikipedia.org/wiki/Distance_correlation
-stats.cor.dist = function(values, a, b) {
- var X = b ? values.map(util.$(a)) : values,
- Y = b ? values.map(util.$(b)) : a;
-
- var A = stats.dist.mat(X),
- B = stats.dist.mat(Y),
- n = A.length,
- i, aa, bb, ab;
-
- for (i=0, aa=0, bb=0, ab=0; i<n; ++i) {
- aa += A[i]*A[i];
- bb += B[i]*B[i];
- ab += A[i]*B[i];
- }
-
- return Math.sqrt(ab / Math.sqrt(aa*bb));
-};
-
-// Compute the vector distance between two arrays of numbers.
-// Default is Euclidean (exp=2) distance, configurable via exp argument.
-stats.dist = function(values, a, b, exp) {
- var f = util.isFunction(b) || util.isString(b),
- X = values,
- Y = f ? values : a,
- e = f ? exp : b,
- L2 = e === 2 || e == null,
- n = values.length, s = 0, d, i;
- if (f) {
- a = util.$(a);
- b = util.$(b);
- }
- for (i=0; i<n; ++i) {
- d = f ? (a(X[i])-b(Y[i])) : (X[i]-Y[i]);
- s += L2 ? d*d : Math.pow(Math.abs(d), e);
- }
- return L2 ? Math.sqrt(s) : Math.pow(s, 1/e);
-};
-
-// Construct a mean-centered distance matrix for an array of numbers.
-stats.dist.mat = function(X) {
- var n = X.length,
- m = n*n,
- A = Array(m),
- R = gen.zeros(n),
- M = 0, v, i, j;
-
- for (i=0; i<n; ++i) {
- A[i*n+i] = 0;
- for (j=i+1; j<n; ++j) {
- A[i*n+j] = (v = Math.abs(X[i] - X[j]));
- A[j*n+i] = v;
- R[i] += v;
- R[j] += v;
- }
- }
-
- for (i=0; i<n; ++i) {
- M += R[i];
- R[i] /= n;
- }
- M /= m;
-
- for (i=0; i<n; ++i) {
- for (j=i; j<n; ++j) {
- A[i*n+j] += M - R[i] - R[j];
- A[j*n+i] = A[i*n+j];
- }
- }
-
- return A;
-};
-
-// Compute the Shannon entropy (log base 2) of an array of counts.
-stats.entropy = function(counts, f) {
- f = util.$(f);
- var i, p, s = 0, H = 0, n = counts.length;
- for (i=0; i<n; ++i) {
- s += (f ? f(counts[i]) : counts[i]);
- }
- if (s === 0) return 0;
- for (i=0; i<n; ++i) {
- p = (f ? f(counts[i]) : counts[i]) / s;
- if (p) H += p * Math.log(p);
- }
- return -H / Math.LN2;
-};
-
-// Compute the mutual information between two discrete variables.
-// Returns an array of the form [MI, MI_distance]
-// MI_distance is defined as 1 - I(a,b) / H(a,b).
-// http://en.wikipedia.org/wiki/Mutual_information
-stats.mutual = function(values, a, b, counts) {
- var x = counts ? values.map(util.$(a)) : values,
- y = counts ? values.map(util.$(b)) : a,
- z = counts ? values.map(util.$(counts)) : b;
-
- var px = {},
- py = {},
- n = z.length,
- s = 0, I = 0, H = 0, p, t, i;
-
- for (i=0; i<n; ++i) {
- px[x[i]] = 0;
- py[y[i]] = 0;
- }
-
- for (i=0; i<n; ++i) {
- px[x[i]] += z[i];
- py[y[i]] += z[i];
- s += z[i];
- }
-
- t = 1 / (s * Math.LN2);
- for (i=0; i<n; ++i) {
- if (z[i] === 0) continue;
- p = (s * z[i]) / (px[x[i]] * py[y[i]]);
- I += z[i] * t * Math.log(p);
- H += z[i] * t * Math.log(z[i]/s);
- }
-
- return [I, 1 + I/H];
-};
-
-// Compute the mutual information between two discrete variables.
-stats.mutual.info = function(values, a, b, counts) {
- return stats.mutual(values, a, b, counts)[0];
-};
-
-// Compute the mutual information distance between two discrete variables.
-// MI_distance is defined as 1 - I(a,b) / H(a,b).
-stats.mutual.dist = function(values, a, b, counts) {
- return stats.mutual(values, a, b, counts)[1];
-};
-
-// Compute a profile of summary statistics for a variable.
-stats.profile = function(values, f) {
- var mean = 0,
- valid = 0,
- missing = 0,
- distinct = 0,
- min = null,
- max = null,
- M2 = 0,
- vals = [],
- u = {}, delta, sd, i, v, x;
-
- // compute summary stats
- for (i=0; i<values.length; ++i) {
- v = f ? f(values[i]) : values[i];
-
- // update unique values
- u[v] = (v in u) ? u[v] + 1 : (distinct += 1, 1);
-
- if (v == null) {
- ++missing;
- } else if (util.isValid(v)) {
- // update stats
- x = (typeof v === 'string') ? v.length : v;
- if (min===null || x < min) min = x;
- if (max===null || x > max) max = x;
- delta = x - mean;
- mean = mean + delta / (++valid);
- M2 = M2 + delta * (x - mean);
- vals.push(x);
- }
- }
- M2 = M2 / (valid - 1);
- sd = Math.sqrt(M2);
-
- // sort values for median and iqr
- vals.sort(util.cmp);
-
- return {
- type: type(values, f),
- unique: u,
- count: values.length,
- valid: valid,
- missing: missing,
- distinct: distinct,
- min: min,
- max: max,
- mean: mean,
- stdev: sd,
- median: (v = stats.quantile(vals, 0.5)),
- q1: stats.quantile(vals, 0.25),
- q3: stats.quantile(vals, 0.75),
- modeskew: sd === 0 ? 0 : (mean - v) / sd
- };
-};
-
-// Compute profiles for all variables in a data set.
-stats.summary = function(data, fields) {
- fields = fields || util.keys(data[0]);
- var s = fields.map(function(f) {
- var p = stats.profile(data, util.$(f));
- return (p.field = f, p);
- });
- return (s.__summary__ = true, s);
-};
-
-module.exports = stats;
-},{"./generate":8,"./import/type":9,"./util":12}],11:[function(require,module,exports){
-var d3_time = require('d3-time');
-
-var tempDate = new Date(),
- baseDate = new Date(0, 0, 1).setFullYear(0), // Jan 1, 0 AD
- utcBaseDate = new Date(Date.UTC(0, 0, 1)).setUTCFullYear(0);
-
-function date(d) {
- return (tempDate.setTime(+d), tempDate);
-}
-
-// create a time unit entry
-function entry(type, date, unit, step, min, max) {
- var e = {
- type: type,
- date: date,
- unit: unit
- };
- if (step) {
- e.step = step;
- } else {
- e.minstep = 1;
- }
- if (min != null) e.min = min;
- if (max != null) e.max = max;
- return e;
-}
-
-function create(type, unit, base, step, min, max) {
- return entry(type,
- function(d) { return unit.offset(base, d); },
- function(d) { return unit.count(base, d); },
- step, min, max);
-}
-
-var locale = [
- create('second', d3_time.second, baseDate),
- create('minute', d3_time.minute, baseDate),
- create('hour', d3_time.hour, baseDate),
- create('day', d3_time.day, baseDate, [1, 7]),
- create('month', d3_time.month, baseDate, [1, 3, 6]),
- create('year', d3_time.year, baseDate),
-
- // periodic units
- entry('seconds',
- function(d) { return new Date(1970, 0, 1, 0, 0, d); },
- function(d) { return date(d).getSeconds(); },
- null, 0, 59
- ),
- entry('minutes',
- function(d) { return new Date(1970, 0, 1, 0, d); },
- function(d) { return date(d).getMinutes(); },
- null, 0, 59
- ),
- entry('hours',
- function(d) { return new Date(1970, 0, 1, d); },
- function(d) { return date(d).getHours(); },
- null, 0, 23
- ),
- entry('weekdays',
- function(d) { return new Date(1970, 0, 4+d); },
- function(d) { return date(d).getDay(); },
- [1], 0, 6
- ),
- entry('dates',
- function(d) { return new Date(1970, 0, d); },
- function(d) { return date(d).getDate(); },
- [1], 1, 31
- ),
- entry('months',
- function(d) { return new Date(1970, d % 12, 1); },
- function(d) { return date(d).getMonth(); },
- [1], 0, 11
- )
-];
-
-var utc = [
- create('second', d3_time.utcSecond, utcBaseDate),
- create('minute', d3_time.utcMinute, utcBaseDate),
- create('hour', d3_time.utcHour, utcBaseDate),
- create('day', d3_time.utcDay, utcBaseDate, [1, 7]),
- create('month', d3_time.utcMonth, utcBaseDate, [1, 3, 6]),
- create('year', d3_time.utcYear, utcBaseDate),
-
- // periodic units
- entry('seconds',
- function(d) { return new Date(Date.UTC(1970, 0, 1, 0, 0, d)); },
- function(d) { return date(d).getUTCSeconds(); },
- null, 0, 59
- ),
- entry('minutes',
- function(d) { return new Date(Date.UTC(1970, 0, 1, 0, d)); },
- function(d) { return date(d).getUTCMinutes(); },
- null, 0, 59
- ),
- entry('hours',
- function(d) { return new Date(Date.UTC(1970, 0, 1, d)); },
- function(d) { return date(d).getUTCHours(); },
- null, 0, 23
- ),
- entry('weekdays',
- function(d) { return new Date(Date.UTC(1970, 0, 4+d)); },
- function(d) { return date(d).getUTCDay(); },
- [1], 0, 6
- ),
- entry('dates',
- function(d) { return new Date(Date.UTC(1970, 0, d)); },
- function(d) { return date(d).getUTCDate(); },
- [1], 1, 31
- ),
- entry('months',
- function(d) { return new Date(Date.UTC(1970, d % 12, 1)); },
- function(d) { return date(d).getUTCMonth(); },
- [1], 0, 11
- )
-];
-
-var STEPS = [
- [31536e6, 5], // 1-year
- [7776e6, 4], // 3-month
- [2592e6, 4], // 1-month
- [12096e5, 3], // 2-week
- [6048e5, 3], // 1-week
- [1728e5, 3], // 2-day
- [864e5, 3], // 1-day
- [432e5, 2], // 12-hour
- [216e5, 2], // 6-hour
- [108e5, 2], // 3-hour
- [36e5, 2], // 1-hour
- [18e5, 1], // 30-minute
- [9e5, 1], // 15-minute
- [3e5, 1], // 5-minute
- [6e4, 1], // 1-minute
- [3e4, 0], // 30-second
- [15e3, 0], // 15-second
- [5e3, 0], // 5-second
- [1e3, 0] // 1-second
-];
-
-function find(units, span, minb, maxb) {
- var step = STEPS[0], i, n, bins;
-
- for (i=1, n=STEPS.length; i<n; ++i) {
- step = STEPS[i];
- if (span > step[0]) {
- bins = span / step[0];
- if (bins > maxb) {
- return units[STEPS[i-1][1]];
- }
- if (bins >= minb) {
- return units[step[1]];
- }
- }
- }
- return units[STEPS[n-1][1]];
-}
-
-function toUnitMap(units) {
- var map = {}, i, n;
- for (i=0, n=units.length; i<n; ++i) {
- map[units[i].type] = units[i];
- }
- map.find = function(span, minb, maxb) {
- return find(units, span, minb, maxb);
- };
- return map;
-}
-
-module.exports = toUnitMap(locale);
-module.exports.utc = toUnitMap(utc);
-
-},{"d3-time":6}],12:[function(require,module,exports){
-var buffer = require('buffer'),
- time = require('./time'),
- utc = time.utc;
-
-var u = module.exports = {};
-
-// utility functions
-
-var FNAME = '__name__';
-
-u.namedfunc = function(name, f) { return (f[FNAME] = name, f); };
-
-u.name = function(f) { return f==null ? null : f[FNAME]; };
-
-u.identity = function(x) { return x; };
-
-u.true = u.namedfunc('true', function() { return true; });
-
-u.false = u.namedfunc('false', function() { return false; });
-
-u.duplicate = function(obj) {
- return JSON.parse(JSON.stringify(obj));
-};
-
-u.equal = function(a, b) {
- return JSON.stringify(a) === JSON.stringify(b);
-};
-
-u.extend = function(obj) {
- for (var x, name, i=1, len=arguments.length; i<len; ++i) {
- x = arguments[i];
- for (name in x) { obj[name] = x[name]; }
- }
- return obj;
-};
-
-u.length = function(x) {
- return x != null && x.length != null ? x.length : null;
-};
-
-u.keys = function(x) {
- var keys = [], k;
- for (k in x) keys.push(k);
- return keys;
-};
-
-u.vals = function(x) {
- var vals = [], k;
- for (k in x) vals.push(x[k]);
- return vals;
-};
-
-u.toMap = function(list, f) {
- return (f = u.$(f)) ?
- list.reduce(function(obj, x) { return (obj[f(x)] = 1, obj); }, {}) :
- list.reduce(function(obj, x) { return (obj[x] = 1, obj); }, {});
-};
-
-u.keystr = function(values) {
- // use to ensure consistent key generation across modules
- var n = values.length;
- if (!n) return '';
- for (var s=String(values[0]), i=1; i<n; ++i) {
- s += '|' + String(values[i]);
- }
- return s;
-};
-
-// type checking functions
-
-var toString = Object.prototype.toString;
-
-u.isObject = function(obj) {
- return obj === Object(obj);
-};
-
-u.isFunction = function(obj) {
- return toString.call(obj) === '[object Function]';
-};
-
-u.isString = function(obj) {
- return typeof value === 'string' || toString.call(obj) === '[object String]';
-};
-
-u.isArray = Array.isArray || function(obj) {
- return toString.call(obj) === '[object Array]';
-};
-
-u.isNumber = function(obj) {
- return typeof obj === 'number' || toString.call(obj) === '[object Number]';
-};
-
-u.isBoolean = function(obj) {
- return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
-};
-
-u.isDate = function(obj) {
- return toString.call(obj) === '[object Date]';
-};
-
-u.isValid = function(obj) {
- return obj != null && obj === obj;
-};
-
-u.isBuffer = (buffer.Buffer && buffer.Buffer.isBuffer) || u.false;
-
-// type coercion functions
-
-u.number = function(s) {
- return s == null || s === '' ? null : +s;
-};
-
-u.boolean = function(s) {
- return s == null || s === '' ? null : s==='false' ? false : !!s;
-};
-
-u.date = function(s) {
- return s == null || s === '' ? null : Date.parse(s);
-};
-
-u.array = function(x) {
- return x != null ? (u.isArray(x) ? x : [x]) : [];
-};
-
-u.str = function(x) {
- return u.isArray(x) ? '[' + x.map(u.str) + ']'
- : u.isObject(x) ? JSON.stringify(x)
- : u.isString(x) ? ('\''+util_escape_str(x)+'\'') : x;
-};
-
-var escape_str_re = /(^|[^\\])'/g;
-
-function util_escape_str(x) {
- return x.replace(escape_str_re, '$1\\\'');
-}
-
-// data access functions
-
-u.field = function(f) {
- return String(f).split('\\.')
- .map(function(d) { return d.split('.'); })
- .reduce(function(a, b) {
- if (a.length) { a[a.length-1] += '.' + b.shift(); }
- a.push.apply(a, b);
- return a;
- }, []);
-};
-
-u.accessor = function(f) {
- var s;
- return f==null || u.isFunction(f) ? f :
- u.namedfunc(f, (s = u.field(f)).length > 1 ?
- function(x) { return s.reduce(function(x,f) { return x[f]; }, x); } :
- function(x) { return x[f]; }
- );
-};
-
-// short-cut for accessor
-u.$ = u.accessor;
-
-u.mutator = function(f) {
- var s;
- return u.isString(f) && (s=u.field(f)).length > 1 ?
- function(x, v) {
- for (var i=0; i<s.length-1; ++i) x = x[s[i]];
- x[s[i]] = v;
- } :
- function(x, v) { x[f] = v; };
-};
-
-
-u.$func = function(name, op) {
- return function(f) {
- f = u.$(f) || u.identity;
- var n = name + (u.name(f) ? '_'+u.name(f) : '');
- return u.namedfunc(n, function(d) { return op(f(d)); });
- };
-};
-
-u.$valid = u.$func('valid', u.isValid);
-u.$length = u.$func('length', u.length);
-
-u.$in = function(f, values) {
- f = u.$(f);
- var map = u.isArray(values) ? u.toMap(values) : values;
- return function(d) { return !!map[f(d)]; };
-};
-
-u.$year = u.$func('year', time.year.unit);
-u.$month = u.$func('month', time.months.unit);
-u.$date = u.$func('date', time.dates.unit);
-u.$day = u.$func('day', time.weekdays.unit);
-u.$hour = u.$func('hour', time.hours.unit);
-u.$minute = u.$func('minute', time.minutes.unit);
-u.$second = u.$func('second', time.seconds.unit);
-
-u.$utcYear = u.$func('utcYear', utc.year.unit);
-u.$utcMonth = u.$func('utcMonth', utc.months.unit);
-u.$utcDate = u.$func('utcDate', utc.dates.unit);
-u.$utcDay = u.$func('utcDay', utc.weekdays.unit);
-u.$utcHour = u.$func('utcHour', utc.hours.unit);
-u.$utcMinute = u.$func('utcMinute', utc.minutes.unit);
-u.$utcSecond = u.$func('utcSecond', utc.seconds.unit);
-
-// comparison / sorting functions
-
-u.comparator = function(sort) {
- var sign = [];
- if (sort === undefined) sort = [];
- sort = u.array(sort).map(function(f) {
- var s = 1;
- if (f[0] === '-') { s = -1; f = f.slice(1); }
- else if (f[0] === '+') { s = +1; f = f.slice(1); }
- sign.push(s);
- return u.accessor(f);
- });
- return function(a,b) {
- var i, n, f, x, y;
- for (i=0, n=sort.length; i<n; ++i) {
- f = sort[i]; x = f(a); y = f(b);
- if (x < y) return -1 * sign[i];
- if (x > y) return sign[i];
- }
- return 0;
- };
-};
-
-u.cmp = function(a, b) {
- if (a < b) {
- return -1;
- } else if (a > b) {
- return 1;
- } else if (a >= b) {
- return 0;
- } else if (a === null) {
- return -1;
- } else if (b === null) {
- return 1;
- }
- return NaN;
-};
-
-u.numcmp = function(a, b) { return a - b; };
-
-u.stablesort = function(array, sortBy, keyFn) {
- var indices = array.reduce(function(idx, v, i) {
- return (idx[keyFn(v)] = i, idx);
- }, {});
-
- array.sort(function(a, b) {
- var sa = sortBy(a),
- sb = sortBy(b);
- return sa < sb ? -1 : sa > sb ? 1
- : (indices[keyFn(a)] - indices[keyFn(b)]);
- });
-
- return array;
-};
-
-
-// string functions
-
-u.pad = function(s, length, pos, padchar) {
- padchar = padchar || " ";
- var d = length - s.length;
- if (d <= 0) return s;
- switch (pos) {
- case 'left':
- return strrep(d, padchar) + s;
- case 'middle':
- case 'center':
- return strrep(Math.floor(d/2), padchar) +
- s + strrep(Math.ceil(d/2), padchar);
- default:
- return s + strrep(d, padchar);
- }
-};
-
-function strrep(n, str) {
- var s = "", i;
- for (i=0; i<n; ++i) s += str;
- return s;
-}
-
-u.truncate = function(s, length, pos, word, ellipsis) {
- var len = s.length;
- if (len <= length) return s;
- ellipsis = ellipsis !== undefined ? String(ellipsis) : '\u2026';
- var l = Math.max(0, length - ellipsis.length);
-
- switch (pos) {
- case 'left':
- return ellipsis + (word ? truncateOnWord(s,l,1) : s.slice(len-l));
- case 'middle':
- case 'center':
- var l1 = Math.ceil(l/2), l2 = Math.floor(l/2);
- return (word ? truncateOnWord(s,l1) : s.slice(0,l1)) +
- ellipsis + (word ? truncateOnWord(s,l2,1) : s.slice(len-l2));
- default:
- return (word ? truncateOnWord(s,l) : s.slice(0,l)) + ellipsis;
- }
-};
-
-function truncateOnWord(s, len, rev) {
- var cnt = 0, tok = s.split(truncate_word_re);
- if (rev) {
- s = (tok = tok.reverse())
- .filter(function(w) { cnt += w.length; return cnt <= len; })
- .reverse();
- } else {
- s = tok.filter(function(w) { cnt += w.length; return cnt <= len; });
- }
- return s.length ? s.join('').trim() : tok[0].slice(0, len);
-}
-
-var truncate_word_re = /([\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u2028\u2029\u3000\uFEFF])/;
-
-},{"./time":11,"buffer":2}],13:[function(require,module,exports){
-'use strict';
-
-require('./globals');
-
-var consts = require('./consts'),
- util = require('./util'),
- vlfield = require('./field'),
- vlenc = require('./enc'),
- schema = require('./schema/schema');
-
-module.exports = (function() {
- function Encoding(spec, theme) {
- var defaults = schema.instantiate(),
- specExtended = schema.util.merge(defaults, theme || {}, spec) ;
-
- this._data = specExtended.data;
- this._marktype = specExtended.marktype;
- this._enc = specExtended.encoding;
- this._config = specExtended.config;
- this._filter = specExtended.filter;
- // this._vega2 = true;
- }
-
- var proto = Encoding.prototype;
-
- Encoding.fromShorthand = function(shorthand, data, config, theme) {
- var c = consts.shorthand,
- split = shorthand.split(c.delim),
- marktype = split.shift().split(c.assign)[1].trim(),
- enc = vlenc.fromShorthand(split);
-
- return new Encoding({
- data: data,
- marktype: marktype,
- encoding: enc,
- config: config,
- filter: []
- }, theme);
- };
-
- Encoding.fromSpec = function(spec, theme) {
- return new Encoding(spec, theme);
- };
-
- proto.toShorthand = function() {
- var c = consts.shorthand;
- return 'mark' + c.assign + this._marktype +
- c.delim + vlenc.shorthand(this._enc);
- };
-
- Encoding.shorthand = function (spec) {
- var c = consts.shorthand;
- return 'mark' + c.assign + spec.marktype +
- c.delim + vlenc.shorthand(spec.encoding);
- };
-
- Encoding.specFromShorthand = function(shorthand, data, config, excludeConfig) {
- return Encoding.fromShorthand(shorthand, data, config).toSpec(excludeConfig);
- };
-
- proto.toSpec = function(excludeConfig, excludeData) {
- var enc = util.duplicate(this._enc),
- spec;
-
- spec = {
- marktype: this._marktype,
- encoding: enc,
- filter: this._filter
- };
-
- if (!excludeConfig) {
- spec.config = util.duplicate(this._config);
- }
-
- if (!excludeData) {
- spec.data = util.duplicate(this._data);
- }
-
- // remove defaults
- var defaults = schema.instantiate();
- return schema.util.subtract(spec, defaults);
- };
-
-
- proto.marktype = function() {
- return this._marktype;
- };
-
- proto.is = function(m) {
- return this._marktype === m;
- };
-
- proto.has = function(encType) {
- // equivalent to calling vlenc.has(this._enc, encType)
- return this._enc[encType].name !== undefined;
- };
-
- proto.enc = function(et) {
- return this._enc[et];
- };
-
- proto.filter = function() {
- var filterNull = [],
- fields = this.fields(),
- self = this;
-
- util.forEach(fields, function(fieldList, fieldName) {
- if (fieldName === '*') return; //count
-
- if ((self.config('filterNull').Q && fieldList.containsType[Q]) ||
- (self.config('filterNull').T && fieldList.containsType[T]) ||
- (self.config('filterNull').O && fieldList.containsType[O]) ||
- (self.config('filterNull').N && fieldList.containsType[N])) {
- filterNull.push({
- operands: [fieldName],
- operator: 'notNull'
- });
- }
- });
-
- return filterNull.concat(this._filter);
- };
-
- // get "field" property for vega
- proto.field = function(et, nodata, nofn) {
- if (!this.has(et)) return null;
- return vlfield.fieldRef(this._enc[et], {
- nofn: nofn,
- data: !this._vega2 && !nodata
- });
- };
-
- proto.fieldRef = function(et, opt) {
- opt = opt || {};
- opt.data = !this._vega2 && (opt.data !== false);
- return vlfield.fieldRef(this._enc[et], opt);
- };
-
- proto.fieldName = function(et) {
- return this._enc[et].name;
- };
-
- /*
- * return key-value pairs of field name and list of fields of that field name
- */
- proto.fields = function() {
- return vlenc.fields(this._enc);
- };
-
- proto.fieldTitle = function(et) {
- if (vlfield.isCount(this._enc[et])) {
- return vlfield.count.displayName;
- }
- var timeUnit = this._enc[et].aggregate || this._enc[et].timeUnit || (this._enc[et].bin && 'bin');
- if (timeUnit) {
- return timeUnit.toUpperCase() + '(' + this._enc[et].name + ')';
- } else {
- return this._enc[et].name;
- }
- };
-
- proto.scale = function(et) {
- return this._enc[et].scale || {};
- };
-
- proto.axis = function(et) {
- return this._enc[et].axis || {};
- };
-
- proto.band = function(et) {
- return this._enc[et].band || {};
- };
-
- proto.bandSize = function(encType, useSmallBand) {
- useSmallBand = useSmallBand ||
- //isBandInSmallMultiples
- (encType === Y && this.has(ROW) && this.has(Y)) ||
- (encType === X && this.has(COL) && this.has(X));
-
- // if band.size is explicitly specified, follow the specification, otherwise draw value from config.
- return this.band(encType).size ||
- this.config(useSmallBand ? 'smallBandSize' : 'largeBandSize');
- };
-
- proto.aggregate = function(et) {
- return this._enc[et].aggregate;
- };
-
- // returns false if binning is disabled, otherwise an object with binning properties
- proto.bin = function(et) {
- var bin = this._enc[et].bin;
- if (bin === {})
- return false;
- if (bin === true)
- return {
- maxbins: schema.MAXBINS_DEFAULT
- };
- return bin;
- };
-
- proto.legend = function(et) {
- return this._enc[et].legend;
- };
-
- proto.value = function(et) {
- return this._enc[et].value;
- };
-
- proto.timeUnit = function(et) {
- return this._enc[et].timeUnit;
- };
-
- proto.sort = function(et, stats) {
- var sort = this._enc[et].sort,
- enc = this._enc,
- isTypes = vlfield.isTypes;
-
- if ((!sort || sort.length===0) &&
- // FIXME
- Encoding.toggleSort.support({encoding:this._enc}, stats, true) && //HACK
- this.config('toggleSort') === Q
- ) {
- var qField = isTypes(enc.x, [N, O]) ? enc.y : enc.x;
-
- if (isTypes(enc[et], [N, O])) {
- sort = [{
- name: qField.name,
- aggregate: qField.aggregate,
- type: qField.type,
- reverse: true
- }];
- }
- }
-
- return sort;
- };
-
- proto.length = function() {
- return util.keys(this._enc).length;
- };
-
- proto.map = function(f) {
- return vlenc.map(this._enc, f);
- };
-
- proto.reduce = function(f, init) {
- return vlenc.reduce(this._enc, f, init);
- };
-
- proto.forEach = function(f) {
- return vlenc.forEach(this._enc, f);
- };
-
- proto.type = function(et) {
- return this.has(et) ? this.
<TRUNCATED>
[2/2] ambari git commit: Revert "Vivek's changes"
Posted by yu...@apache.org.
Revert "Vivek's changes"
This reverts commit 7d059e7dc184b3828e1f5f5dc291a9b064dfa5cd.
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b800592c
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b800592c
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b800592c
Branch: refs/heads/trunk
Commit: b800592c4e58f34acdd84ab4da4e8fedbf50a31f
Parents: 7d059e7
Author: Vivek Ratnavel <vi...@gmail.com>
Authored: Tue Jul 7 14:15:29 2015 -0700
Committer: Vivek Ratnavel <vi...@gmail.com>
Committed: Tue Jul 7 14:15:29 2015 -0700
----------------------------------------------------------------------
.../src/main/resources/ui/hive-web/.jshintrc | 3 +-
.../src/main/resources/ui/hive-web/Brocfile.js | 12 -
.../hive-web/app/components/draggable-view.js | 34 -
.../hive-web/app/components/droppable-view.js | 53 -
.../app/components/visualization-view.js | 149 -
.../ui/hive-web/app/controllers/query-tabs.js | 10 -
.../app/controllers/visualization-ui.js | 109 -
.../ui/hive-web/app/initializers/i18n.js | 4 +-
.../ui/hive-web/app/mixins/draggable.js | 26 -
.../ui/hive-web/app/mixins/droppable.js | 25 -
.../hive-web/app/mixins/jquery-drag-widget.js | 109 -
.../hive-web/app/mixins/jquery-drop-widget.js | 111 -
.../ui/hive-web/app/mixins/jquery-ui.js | 110 -
.../resources/ui/hive-web/app/styles/app.scss | 1 -
.../resources/ui/hive-web/app/styles/vars.scss | 4 -
.../hive-web/app/styles/visualization-view.scss | 103 -
.../app/templates/components/draggable-view.hbs | 19 -
.../app/templates/components/droppable-view.hbs | 19 -
.../templates/components/visualization-view.hbs | 39 -
.../hive-web/app/templates/visualization-ui.hbs | 56 -
.../ui/hive-web/app/views/visualization-ui.js | 37 -
.../src/main/resources/ui/hive-web/bower.json | 5 +-
.../resources/ui/hive-web/vendor/vega-lite.js | 6177 ------------------
23 files changed, 3 insertions(+), 7212 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/.jshintrc
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/.jshintrc b/contrib/views/hive/src/main/resources/ui/hive-web/.jshintrc
index 0195538..c1fe863 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/.jshintrc
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/.jshintrc
@@ -2,8 +2,7 @@
"predef": [
"document",
"window",
- "-Promise",
- "d3"
+ "-Promise"
],
"browser" : true,
"boss" : true,
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/Brocfile.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/Brocfile.js b/contrib/views/hive/src/main/resources/ui/hive-web/Brocfile.js
index 223a581..318d1f8 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/Brocfile.js
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/Brocfile.js
@@ -51,16 +51,4 @@ app.import('vendor/codemirror/codemirror.css');
app.import('vendor/codemirror/show-hint.css');
app.import('vendor/dagre.min.js');
-app.import('bower_components/d3/d3.js');
-app.import('bower_components/vega/vega.js');
-//app.import('bower_components/vega-lite/vega-lite.js');
-app.import('vendor/vega-lite.js');
-app.import('bower_components/eventEmitter/eventEmitter.js');
-app.import('bower_components/get-size/get-size.js');
-app.import('bower_components/eventie/eventie.js');
-app.import('bower_components/unipointer/unipointer.js');
-app.import('bower_components/unidragger/unidragger.js');
-app.import('bower_components/classie/classie.js');
-app.import('bower_components/get-style-property/get-style-property.js');
-app.import('bower_components/draggabilly/draggabilly.js');
module.exports = app.toTree();
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/components/draggable-view.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/draggable-view.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/components/draggable-view.js
deleted file mode 100644
index d98d722..0000000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/draggable-view.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-import draggable from 'hive/mixins/draggable';
-
-export default Ember.Component.extend(draggable, {
-
- classNames: ['btn', 'btn-custom', 'btn-sm', 'column-drag'],
- helper_drag: 'clone',
- revert_drag: 'invalid',
-
- drag_drag : function(event, ui) {
- console.log(this.get('name') + "dragged");
- },
- create_drag: function(event, ui) {
- this.$().attr("data-name", this.get('name'));
- }
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/components/droppable-view.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/droppable-view.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/components/droppable-view.js
deleted file mode 100644
index 2bbcc8a..0000000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/droppable-view.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-import droppable from 'hive/mixins/droppable';
-
-export default Ember.Component.extend(droppable, {
- classNames: ['drop-target'],
- activeClass_drop: 'active',
- hoverClass_drop: 'ui-state-hover',
- self: this,
-
- drop_drop: function(event, ui) {
- var draggable_name = this.$(ui.draggable).attr('data-name');
- console.log(draggable_name + " dropped");
- console.log(ui);
- console.log(this.$(ui.draggable).first());
- this.$().html("");
- this.$().addClass("disabled");
- //this.$().append( this.$(ui.draggable).first().clone() );
- var field_name =
- this.$("<div/>")
- .addClass( "pull-left btn-text truncate" )
- .html(draggable_name);
- var remove_field =
- this.$("<div/>")
- .addClass("pull-right no-padding close-container")
- .html("<i class='fa fa-close field-remove pull-right'></i>");
- this.$("<div/>")
- .append(field_name)
- .append(remove_field)
- .css("padding", "3px 10px")
- .appendTo( this.$() );
-
- this.set('disabled_drop', true);
- },
-
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/components/visualization-view.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/visualization-view.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/components/visualization-view.js
deleted file mode 100644
index d9652ae..0000000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/visualization-view.js
+++ /dev/null
@@ -1,149 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-
-export default Ember.Component.extend({
- tagName: 'visualization-view',
-
- initDragAndDrop: function() {
- /*Ember.run.later(function(){
- self.$('.column-drag').draggable({
- helper: "clone",
- revert: "invalid"
- });
- self.$(".droppable.active").droppable({
- activeClass: "ui-state-default",
- hoverClass: "ui-state-hover",
- drop: function( event, ui ) {
- self.$( this )
- .addClass( "ui-state-highlight").html("Dropped");
- console.log(event);
- console.log(ui);
-
- }
- });
- });*/
- }.observes('json'),
-
- testing: function () {
- var self = this;
-
- var draggable = this.$('.column-drag').draggabilly({});
- draggable.on( 'dragEnd', function( event, pointer ) {
- console.log("Drag ended");
- });
- },
-
- initVisualization: function () {
- var vled = {
- version: 0.1,
- spec: {}
- };
- var self = this;
- vled.data = {
- values: [
- {"x":"A", "y":28}, {"x":"B", "y":55}, {"x":"C", "y":43},
- {"x":"D", "y":91}, {"x":"E", "y":81}, {"x":"F", "y":53},
- {"x":"G", "y":19}, {"x":"H", "y":87}, {"x":"I", "y":52}
- ]
- };
- vled.format = function() {
- var el = d3.select('#vlspec'),
- spec = JSON.parse(el.property('value')),
- text = JSON.stringify(spec, null, ' ', 60);
- el.property('value', text);
- };
-
- vled.parse = function() {
- var spec;
- try {
- spec = JSON.parse(d3.select('#vlspec').property('value'));
- } catch (e) {
- console.warn(e);
- return;
- }
- var done = function() {
- // only add url if data is not provided explicitly
- var theme = (spec.data && spec.data.values) ? {} : {
- data: {
- "values": vled.data.values
- }
- };
- vled.data.stats = vl.summary(vled.data.values).reduce(function(s, p) {
- s[p.field] = p;
- return s;
- },{});
- vled.loadSpec(spec, theme);
- };
-
- done();
- };
-
-
- vled.loadSpec = function(vlspec, theme) {
-
- var spec = vl.compile(vlspec, vled.data.stats, theme);
-
- self.$('textarea').trigger('autosize.resize');
-
- vled.vis = null; // DEBUG
- console.log("Inside loadSpec");
- console.log(spec);
- console.log(theme);
- vg.parse.spec(spec, function(chart) {
- vled.vis = chart({el:'#vis', renderer: 'svg'});
- console.log("Inside Vega Parse");
- vled.vis.update();
- vled.vis.on('mouseover', function(ev, item) {
- console.log(item);
- });
- });
- };
-
-
- vled.init = function() {
-
- // Initialize application
- d3.select('#btn_spec_parse').on('click', vled.parse);
-
- console.log("Inside init()");
- document.getElementById('vlspec').value = JSON.stringify({
- "data": {
- "values": [
- {"x":"A", "y":28}, {"x":"B", "y":55}, {"x":"C", "y":43},
- {"x":"D", "y":91}, {"x":"E", "y":81}, {"x":"F", "y":53},
- {"x":"G", "y":19}, {"x":"H", "y":87}, {"x":"I", "y":52}
- ]
- },
- "marktype": "bar",
- "encoding": {
- "y": {"type": "Q","name": "y"},
- "x": {"type": "O","name": "x"}
- }
- });
-
- vled.parse();
- vled.format();
- };
-
- vled.init();
- this.set('vled', vled);
- //this.testing();
- }.on('didInsertElement'),
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/query-tabs.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/query-tabs.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/query-tabs.js
index 24fe5f8..4f5176c 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/query-tabs.js
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/query-tabs.js
@@ -70,16 +70,6 @@ export default Ember.Controller.extend({
badgeProperty: 'count',
onTabOpen: 'markMessagesAsSeen',
tooltip: Ember.I18n.t('tooltips.notifications')
- }),
- Ember.Object.create({
- iconClass: 'fa-area-chart',
- id: 'visualization-icon',
- action: 'toggleOverlay',
- tooltip: Ember.I18n.t('tooltips.visualization'),
- into: 'index',
- outlet: 'overlay',
- template: 'visualization-ui',
- onTabOpen: 'onTabOpen'
})
],
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visualization-ui.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visualization-ui.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visualization-ui.js
deleted file mode 100644
index 2810df7..0000000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visualization-ui.js
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-import Ember from 'ember';
-import constants from 'hive/utils/constants';
-
-export default Ember.Controller.extend({
-
- needs: [ constants.namingConventions.index,
- constants.namingConventions.openQueries,
- constants.namingConventions.jobResults
- ],
- index : Ember.computed.alias('controllers.' + constants.namingConventions.index),
- openQueries : Ember.computed.alias('controllers.' + constants.namingConventions.openQueries),
- results : Ember.computed.alias('controllers.' + constants.namingConventions.jobResults),
- jsonResults: 'Empty',
- cachedObjects: [],
- queryId: function () {
- return this.get('index.model.queryId');
- }.property('index.model.queryId'),
- forcedContent: function () {
- return this.get('index.model.forcedContent');
- }.property('index.model.forcedContent'),
- test: '',
-
- actions: {
- onTabOpen: function () {
- var self = this;
- this.set('test', 'Hello Query id: ' + this.get('queryId') + ' Query: ' + this.get('forcedContent'));
- var tab;
- var model = this.get('index.model');
-
- if (model) {
- console.log("Model present");
- var oq = this.get('openQueries');
-
- tab = oq.getTabForModel(model);
-
- if (tab) {
- console.log("Tab present");
- this.set('test', 'Tab id: ' + tab.id + ' Tab type: ' + tab.type);
- }
- var query = oq.getQueryForModel(model);
- query = this.get('index').buildQuery(query, false, false);
- console.log("Query: " + query);
- console.log("Title: " + model.get('title'));
- console.log("Query: " + model.get('forcedContent'));
- console.log("Model id: " + model.get('id'));
- console.log("Status: " + model.status);
- console.log("Model");
- console.log(model);
- console.log('Result Object: ');
- console.log(this.get('results'));
- console.log("Cached Results: ");
- console.log(this.get('results').get('cachedResults'));
- console.log("Formatted Results: ");
- console.log(this.get('results').get('formattedResults'));
-
- var existingJob = this.get('results').get('cachedResults').findBy('id', model.get('id'));
- var url = this.container.lookup('adapter:application').buildURL();
- url += '/' + constants.namingConventions.jobs + '/' + model.get('id') + '/results?first=true&count=1000';
-
- if (existingJob) {
- console.log("Job exists");
- Ember.$.getJSON(url).then(function (results) {
-
- var columns = results.schema;
- var rows = results.rows;
-
- if (!columns || !rows) {
- return;
- }
-
- columns = columns.map(function (column) {
- return {
- name: column[0],
- type: column[1],
- index: column[2] - 1 //normalize index to 0 based
- };
- });
-
- self.set('jsonResults', {columns: columns, rows: rows.slice(0,10)});
-
- }, function (err) {
- self.set('error', err.responseText);
- });
- } else {
- this.set("error", "No visualization available. Please execute a query to visualize data.");
- }
- }
- }
- }
-
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/i18n.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/i18n.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/i18n.js
index 67158ec..af5e3a7 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/i18n.js
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/i18n.js
@@ -38,7 +38,6 @@ TRANSLATIONS = {
settings: 'Settings',
visualExplain: 'Visual Explain',
tez: 'Tez',
- visualization: 'Visualization',
notifications: 'Notifications',
expand: 'Expand query panel',
makeSettingGlobal: 'Make setting global',
@@ -114,8 +113,7 @@ TRANSLATIONS = {
visualExplain: 'Visual Explain',
tez: 'TEZ',
status: 'Status: ',
- messages: 'Messages',
- visualization: 'Visualization'
+ messages: 'Messages'
},
download: 'Save results...',
tableSample: '{{tableName}} sample'
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/draggable.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/draggable.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/draggable.js
deleted file mode 100644
index 8509c5b..0000000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/draggable.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-import dragWidget from 'hive/mixins/jquery-drag-widget'
-
-export default Ember.Mixin.create(dragWidget, {
- uiDragOptions: ['disabled_drag', 'addClasses_drag', 'appendTo_drag', 'axis_drag', 'cancel_drag', 'connectToSortable_drag', 'containment_drag', 'cursor_drag',
- 'delay_drag', 'distance_drag', 'grid_drag', 'handle_drag', 'helper_drag', 'iframeFix_drag', 'opacity_drag', 'revert_drag', 'scope_drag', 'snap_drag', 'snapMode_drag', 'stack_drag'],
- uiDragEvents: ['create_drag', 'start_drag', 'drag_drag', 'stop_drag'],
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/droppable.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/droppable.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/droppable.js
deleted file mode 100644
index 8e0b480..0000000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/droppable.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-import dropWidget from 'hive/mixins/jquery-drop-widget'
-
-export default Ember.Mixin.create(dropWidget, {
- uiDropOptions: ['accept_drop', 'activeClass_drop', 'addClasses_drop', 'disabled_drop', 'greedy_drop', 'hoverClass_drop', 'scope_drop', 'tolerance_drop'],
- uiDropEvents: ['create_drop', 'activate_drop', 'deactivate_drop', 'over_drop', 'out_drop', 'drop_drop'],
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/jquery-drag-widget.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/jquery-drag-widget.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/jquery-drag-widget.js
deleted file mode 100644
index 3f58fe9..0000000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/jquery-drag-widget.js
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-
-export default Ember.Mixin.create({
-
- didInsertElement: function () {
- this._super();
- // Make jQuery UI options available as Ember properties
- var options = this._gatherDragOptions();
-
- // Make sure that jQuery UI events trigger methods on this view.
- this._gatherDragEvents(options);
-
- // Create a new instance of the jQuery UI widget based on its `uiType`
- // and the current element.
- var ui = jQuery.ui['draggable'](options, this.get('element'));
-
- // Save off the instance of the jQuery UI widget as the `ui` property
- // on this Ember view.
- this.set('ui', ui);
- },
-
- willDestroyElement: function () {
- var ui = this.get('ui');
-
- if (ui) {
- // Tear down any observers that were created to make jQuery UI
- // options available as Ember properties.
- var observers = this._observers;
- for (var prop in observers) {
- if (observers.hasOwnProperty(prop)) {
- this.removeObserver(prop, observers[prop]);
- }
- }
- ui._destroy();
- }
- },
-
- // Each jQuery UI widget has a series of options that can be configured.
- // For instance, to disable a button, you call
- // `button.options('disabled', true)` in jQuery UI. To make this compatible
- // with Ember bindings, any time the Ember property for a
- // given jQuery UI option changes, we update the jQuery UI widget.
- _gatherDragOptions: function () {
- var uiDragOptions = this.get('uiDragOptions'), options = {};
-
- // The view can specify a list of jQuery UI options that should be treated
- // as Ember properties.
- uiDragOptions.forEach(function (key) {
- options[key.split('_')[0]] = this.get(key);
-
- // Set up an observer on the Ember property. When it changes,
- // call jQuery UI's `setOption` method to reflect the property onto
- // the jQuery UI widget.
- var observer = function () {
- var value = this.get(key);
- this.get('ui')._setOption(key.split('_')[0], value);
- };
-
- this.addObserver(key, observer);
-
- // Insert the observer in a Hash so we can remove it later.
- this._observers = this._observers || {};
- this._observers[key] = observer;
- }, this);
-
- return options;
- },
-
- // Each jQuery UI widget has a number of custom events that they can
- // trigger. For instance, the progressbar widget triggers a `complete`
- // event when the progress bar finishes. Make these events behave like
- // normal Ember events. For instance, a subclass of JQ.ProgressBar
- // could implement the `complete` method to be notified when the jQuery
- // UI widget triggered the event.
- _gatherDragEvents: function (options) {
- var uiDragEvents = this.get('uiDragEvents') || [], self = this;
- console.log(uiDragEvents);
- uiDragEvents.forEach(function (event) {
- var callback = self[event];
-
- if (callback) {
- // You can register a handler for a jQuery UI event by passing
- // it in along with the creation options. Update the options hash
- // to include any event callbacks.
- options[event.split('_')[0]] = function (event, ui) {
- callback.call(self, event, ui);
- };
- }
- });
- }
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/jquery-drop-widget.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/jquery-drop-widget.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/jquery-drop-widget.js
deleted file mode 100644
index e00df94..0000000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/jquery-drop-widget.js
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-
-export default Ember.Mixin.create({
-
- didInsertElement: function () {
- this._super();
- // Make jQuery UI options available as Ember properties
- var options = this._gatherDropOptions();
-
- // Make sure that jQuery UI events trigger methods on this view.
- this._gatherDropEvents(options);
-
- // Create a new instance of the jQuery UI widget based on its `uiType`
- // and the current element.
- var ui = jQuery.ui['droppable'](options, this.get('element'));
- //var ui = jQuery(this.get('element'))['droppable']();
-
- // Save off the instance of the jQuery UI widget as the `ui` property
- // on this Ember view.
- this.set('ui', ui);
- },
-
- willDestroyElement: function () {
- var ui = this.get('ui');
-
- if (ui) {
- // Tear down any observers that were created to make jQuery UI
- // options available as Ember properties.
- var observers = this._observers;
- for (var prop in observers) {
- if (observers.hasOwnProperty(prop)) {
- this.removeObserver(prop, observers[prop]);
- }
- }
- ui._destroy();
- }
- },
-
- // Each jQuery UI widget has a series of options that can be configured.
- // For instance, to disable a button, you call
- // `button.options('disabled', true)` in jQuery UI. To make this compatible
- // with Ember bindings, any time the Ember property for a
- // given jQuery UI option changes, we update the jQuery UI widget.
- _gatherDropOptions: function () {
- var uiDropOptions = this.get('uiDropOptions'), options = {};
-
- // The view can specify a list of jQuery UI options that should be treated
- // as Ember properties.
- uiDropOptions.forEach(function (key) {
- options[key.split('_')[0]] = this.get(key);
-
- // Set up an observer on the Ember property. When it changes,
- // call jQuery UI's `setOption` method to reflect the property onto
- // the jQuery UI widget.
- var observer = function () {
- var value = this.get(key);
- this.get('ui')._setOption(key.split('_')[0], value);
- };
-
- this.addObserver(key, observer);
-
- // Insert the observer in a Hash so we can remove it later.
- this._observers = this._observers || {};
- this._observers[key] = observer;
- }, this);
-
- return options;
- },
-
- // Each jQuery UI widget has a number of custom events that they can
- // trigger. For instance, the progressbar widget triggers a `complete`
- // event when the progress bar finishes. Make these events behave like
- // normal Ember events. For instance, a subclass of JQ.ProgressBar
- // could implement the `complete` method to be notified when the jQuery
- // UI widget triggered the event.
- _gatherDropEvents: function (options) {
- var uiDropEvents = this.get('uiDropEvents') || [], self = this;
- console.log(uiDropEvents);
- uiDropEvents.forEach(function (event) {
- var callback = self[event];
-
- if (callback) {
- // You can register a handler for a jQuery UI event by passing
- // it in along with the creation options. Update the options hash
- // to include any event callbacks.
- options[event.split('_')[0]] = function (event, ui) {
- callback.call(self, event, ui);
- };
- }
- });
- }
-});
-
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/jquery-ui.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/jquery-ui.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/jquery-ui.js
deleted file mode 100644
index 2712f8c..0000000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/jquery-ui.js
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-
-export default Ember.Mixin.create({
-
- didInsertElement: function () {
- // Make jQuery UI options available as Ember properties
- var options = this._gatherOptions();
-
- // Make sure that jQuery UI events trigger methods on this view.
- this._gatherEvents(options);
-
- // Create a new instance of the jQuery UI widget based on its `uiType`
- // and the current element.
- var ui = jQuery.ui[this.get('uiType')](options, this.get('element'));
-
- // Save off the instance of the jQuery UI widget as the `ui` property
- // on this Ember view.
- this.set('ui', ui);
- },
-
- willDestroyElement: function () {
- var ui = this.get('ui');
-
- if (ui) {
- // Tear down any observers that were created to make jQuery UI
- // options available as Ember properties.
- var observers = this._observers;
- for (var prop in observers) {
- if (observers.hasOwnProperty(prop)) {
- this.removeObserver(prop, observers[prop]);
- }
- }
- ui._destroy();
- }
- },
-
- // Each jQuery UI widget has a series of options that can be configured.
- // For instance, to disable a button, you call
- // `button.options('disabled', true)` in jQuery UI. To make this compatible
- // with Ember bindings, any time the Ember property for a
- // given jQuery UI option changes, we update the jQuery UI widget.
- _gatherOptions: function () {
- var uiOptions = this.get('uiOptions'), options = {};
-
- // The view can specify a list of jQuery UI options that should be treated
- // as Ember properties.
- uiOptions.forEach(function (key) {
- options[key] = this.get(key);
-
- // Set up an observer on the Ember property. When it changes,
- // call jQuery UI's `setOption` method to reflect the property onto
- // the jQuery UI widget.
- var observer = function () {
- var value = this.get(key);
- this.get('ui')._setOption(key, value);
- };
-
- this.addObserver(key, observer);
-
- // Insert the observer in a Hash so we can remove it later.
- this._observers = this._observers || {};
- this._observers[key] = observer;
- }, this);
-
- return options;
- },
-
- // Each jQuery UI widget has a number of custom events that they can
- // trigger. For instance, the progressbar widget triggers a `complete`
- // event when the progress bar finishes. Make these events behave like
- // normal Ember events. For instance, a subclass of JQ.ProgressBar
- // could implement the `complete` method to be notified when the jQuery
- // UI widget triggered the event.
- _gatherEvents: function (options) {
- var uiEvents = this.get('uiEvents') || [], self = this;
- console.log(uiEvents);
- uiEvents.forEach(function (event) {
- var callback = self[event];
-
- if (callback) {
- // You can register a handler for a jQuery UI event by passing
- // it in along with the creation options. Update the options hash
- // to include any event callbacks.
- options[event] = function (event, ui) {
- callback.call(self, event, ui);
- };
- }
- });
- }
-});
-
-
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss
index 2f31e6f..6507d6b 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss
@@ -21,7 +21,6 @@
@import 'mixins';
@import 'notifications';
@import 'query-tabs';
-@import 'visualization-view';
a {
word-wrap: break-word;
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/vars.scss
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/vars.scss b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/vars.scss
index ae97c50..184ac9d 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/vars.scss
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/vars.scss
@@ -19,7 +19,3 @@
$panel-background: #f5f5f5;
$placeholder-color: #aaa;
$border-color: #ddd;
-$btn-custom-background: #F2F2F2;
-$btn-custom-color: #333;
-$green-border: #4EB350;
-$unica-one: #5E9FA3;
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/visualization-view.scss
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/visualization-view.scss b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/visualization-view.scss
deleted file mode 100644
index 63e1918..0000000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/visualization-view.scss
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-.column-drag {
- width: 180px;
- margin: 3px 8px;
- cursor: move !important;
-}
-
-#columns-container {
- width: 200px;
-}
-
-.btn-custom {
- color: $btn-custom-color;
- border-color: $border-color;
- background-color: $btn-custom-background;
- text-overflow: ellipsis;
- overflow: hidden;
- text-align: left;
-}
-
-.drop-target {
- display: inline-block;
- float: left;
- margin: -5px 10px;
- width: 200px;
- height: 30px;
- color: #DDDDDD;
- border-radius: 5px;
- border: 1px dashed $border-color;
-}
-
-.drop-target.active {
- border: 2px dashed $green-border;
- background-color: #B2D3B2;
- color: #343434;
-}
-
-.drop-target.disabled {
- background-color: $btn-custom-background;
-}
-
-.inline-block {
- display: inline-block;
- float: left;
-}
-
-.droppable-text {
- margin: 4px 10px;
-}
-
-.full-width {
- width: 100%;
-}
-
-.field-remove {
- color: #808080;
- margin-top: 2px;
- &:hover {
- color: #564C4C;
- //font-size: 1.1em;
- }
-}
-
-.no-padding {
- padding: 0px !important;
-}
-
-.no-margin {
- margin: 0px !important;
-}
-
-.truncate {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- -o-text-overflow: ellipsis;
-}
-
-.btn-text {
- color: $btn-custom-color;
- width: 91.66%;
-}
-
-.close-container {
- width: 8.34%;
-}
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/draggable-view.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/draggable-view.hbs b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/draggable-view.hbs
deleted file mode 100644
index 06b7be0..0000000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/draggable-view.hbs
+++ /dev/null
@@ -1,19 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-
-{{name}}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/droppable-view.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/droppable-view.hbs b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/droppable-view.hbs
deleted file mode 100644
index b212cbd..0000000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/droppable-view.hbs
+++ /dev/null
@@ -1,19 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-
-<div class="droppable-text">Drag & drop a column...</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/visualization-view.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/visualization-view.hbs b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/visualization-view.hbs
deleted file mode 100644
index be620d8..0000000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/visualization-view.hbs
+++ /dev/null
@@ -1,39 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-
-<div id="visualization_container">
- <div class="panel panel-info">
- <div class="panel-body">
- <div style="clear:both;">
- <div class="inline-block" style="margin-right:10px;"><strong>Positional</strong></div>
- <div class="inline-block"> X: </div> {{droppable-view}}
- <div class="inline-block"> Y: </div> {{droppable-view}}
- <div class="inline-block"> Col: </div> {{droppable-view}}
- <div class="inline-block"> Row: </div> {{droppable-view}}
- <div style="clear:both;"></div>
- </div>
- </div>
- </div>
- <div id="columns-container">
- {{yield}}
- </div>
- {{textarea id="vlspec" rows="15" cols="20"}}
- <br/><button type="button" class="btn btn-success" id="btn_spec_parse">Parse</button>
- <br/><br/>
- <div id="vis"></div>
-</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/visualization-ui.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/visualization-ui.hbs b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/visualization-ui.hbs
deleted file mode 100644
index ddd716a..0000000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/visualization-ui.hbs
+++ /dev/null
@@ -1,56 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-
-<div id="visualization" class="index-overlay">
- {{#panel-widget headingTranslation="titles.query.visualization"}}
- {{#if error}}
- <div class="alert alert-danger" role="alert"><strong>{{error}}</strong></div>
- {{else}}
- <div>
- <h3>Visualization</h3>
- {{#visualization-view json=jsonResults}}
- {{#each column in jsonResults.columns}}
- {{draggable-view name=column.name}}
- {{/each}}
- {{/visualization-view}}
- </div>
- <div><h3>JSON Result: </h3><br/>
- <div id="query-results">
- <table class="table table-expandable">
- <thead>
- <tr>
- {{#each column in jsonResults.columns}}
- <th> {{column.name}} </th>
- {{/each}}
- </tr>
- </thead>
- <tbody>
- {{#each row in jsonResults.rows}}
- <tr>
- {{#each item in row}}
- <td>{{item}}</td>
- {{/each}}
- </tr>
- {{/each}}
- </tbody>
- </table>
- </div>
- </div>
- {{/if}}
- {{/panel-widget}}
-</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/app/views/visualization-ui.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/views/visualization-ui.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/views/visualization-ui.js
deleted file mode 100644
index b1c10df..0000000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/views/visualization-ui.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import Ember from 'ember';
-
-export default Ember.View.extend({
- didInsertElement: function () {
- var target = this.$('#visualization');
- var panel = this.$('#visualization .panel-body').first();
-
- panel.css('min-height', $('.main-content').height());
- target.animate({ width: $('.main-content').width() }, 'fast');
- },
-
- willDestroyElement: function () {
- var target = this.$('#visualization');
- var panel = this.$('#visualization .panel-body');
-
- panel.css('min-height', 0);
- target.css('width', 0);
- }
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b800592c/contrib/views/hive/src/main/resources/ui/hive-web/bower.json
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/bower.json b/contrib/views/hive/src/main/resources/ui/hive-web/bower.json
index c0454d6..37ea901 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/bower.json
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/bower.json
@@ -17,10 +17,7 @@
"blanket": "~1.1.5",
"jquery-ui": "~1.11.2",
"selectize": "~0.12.0",
- "pretender": "0.1.0",
- "vega": "~1.5.0",
- "vega-lite": "https://github.com/vivekratnavel/vega-lite.git",
- "draggabilly": "~1.2.4"
+ "pretender": "0.1.0"
},
"resolutions": {
"ember": "1.10.0"