update rollup bundles

This commit is contained in:
t47io 2018-04-22 12:06:17 -07:00
parent 04418af0b5
commit ea58ad4acb
9 changed files with 17 additions and 143 deletions

View File

@ -2,8 +2,6 @@ function $(expr, con) {
return typeof expr === "string"? (con || document).querySelector(expr) : expr || null; return typeof expr === "string"? (con || document).querySelector(expr) : expr || null;
} }
$.create = (tag, o) => { $.create = (tag, o) => {
var element = document.createElement(tag); var element = document.createElement(tag);
@ -66,10 +64,6 @@ function getElementContentWidth(element) {
return element.clientWidth - padding; return element.clientWidth - padding;
} }
function fire(target, type, properties) { function fire(target, type, properties) {
var evt = document.createEvent("HTMLEvents"); var evt = document.createEvent("HTMLEvents");
@ -82,8 +76,6 @@ function fire(target, type, properties) {
return target.dispatchEvent(evt); return target.dispatchEvent(evt);
} }
// https://css-tricks.com/snippets/javascript/loop-queryselectorall-matches/
const BASE_MEASURES = { const BASE_MEASURES = {
margins: { margins: {
top: 10, top: 10,
@ -130,9 +122,6 @@ function getExtraWidth(m) {
const INIT_CHART_UPDATE_TIMEOUT = 700; const INIT_CHART_UPDATE_TIMEOUT = 700;
const CHART_POST_ANIMATE_TIMEOUT = 400; const CHART_POST_ANIMATE_TIMEOUT = 400;
const DEFAULT_AXIS_CHART_TYPE = 'line';
const AXIS_DATASET_CHART_TYPES = ['line', 'bar'];
const AXIS_LEGEND_BAR_SIZE = 100; const AXIS_LEGEND_BAR_SIZE = 100;
const BAR_CHART_SPACE_RATIO = 0.5; const BAR_CHART_SPACE_RATIO = 0.5;
@ -159,8 +148,6 @@ const DEFAULT_CHART_COLORS = ['light-blue', 'blue', 'violet', 'red', 'orange',
'yellow', 'green', 'light-green', 'purple', 'magenta', 'light-grey', 'dark-grey']; 'yellow', 'green', 'light-green', 'purple', 'magenta', 'light-grey', 'dark-grey'];
const HEATMAP_COLORS_GREEN = ['#ebedf0', '#c6e48b', '#7bc96f', '#239a3b', '#196127']; const HEATMAP_COLORS_GREEN = ['#ebedf0', '#c6e48b', '#7bc96f', '#239a3b', '#196127'];
const DEFAULT_COLORS = { const DEFAULT_COLORS = {
bar: DEFAULT_CHART_COLORS, bar: DEFAULT_CHART_COLORS,
line: DEFAULT_CHART_COLORS, line: DEFAULT_CHART_COLORS,
@ -306,19 +293,6 @@ function floatTwo(d) {
return parseFloat(d.toFixed(2)); return parseFloat(d.toFixed(2));
} }
/**
* Returns whether or not two given arrays are equal.
* @param {Array} arr1 First array
* @param {Array} arr2 Second array
*/
/**
* Shuffles array in place. ES6 version
* @param {Array} array An array containing the items.
*/
/** /**
* Fill an array with extra points * Fill an array with extra points
* @param {Array} array Array * @param {Array} array Array
@ -344,11 +318,6 @@ function getStringWidth(string, charWidth) {
return (string+"").length * charWidth; return (string+"").length * charWidth;
} }
// https://stackoverflow.com/a/29325222
function getPositionByAngle(angle, radius) { function getPositionByAngle(angle, radius) {
return { return {
x: Math.sin(angle * ANGLE_RATIO) * radius, x: Math.sin(angle * ANGLE_RATIO) * radius,
@ -514,8 +483,6 @@ function makeSVGGroup(className, transform='', parent=undefined) {
return createSVG('g', args); return createSVG('g', args);
} }
function makePath(pathStr, className='', stroke='none', fill='none') { function makePath(pathStr, className='', stroke='none', fill='none') {
return createSVG('path', { return createSVG('path', {
className: className, className: className,
@ -1737,17 +1704,14 @@ class AggregationChart extends BaseChart {
const NO_OF_YEAR_MONTHS = 12; const NO_OF_YEAR_MONTHS = 12;
const NO_OF_DAYS_IN_WEEK = 7; const NO_OF_DAYS_IN_WEEK = 7;
const NO_OF_MILLIS = 1000; const NO_OF_MILLIS = 1000;
const SEC_IN_DAY = 86400; const SEC_IN_DAY = 86400;
const MONTH_NAMES = ["January", "February", "March", "April", "May", const MONTH_NAMES = ["January", "February", "March", "April", "May",
"June", "July", "August", "September", "October", "November", "December"]; "June", "July", "August", "September", "October", "November", "December"];
const DAY_NAMES_SHORT = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; const DAY_NAMES_SHORT = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
// https://stackoverflow.com/a/11252167/6495043 // https://stackoverflow.com/a/11252167/6495043
function treatAsUtc(date) { function treatAsUtc(date) {
let result = new Date(date); let result = new Date(date);
@ -1769,10 +1733,6 @@ function clone(date) {
return new Date(date.getTime()); return new Date(date.getTime());
} }
// export function getMonthsBetween(startDate, endDate) {} // export function getMonthsBetween(startDate, endDate) {}
function getWeeksBetween(startDate, endDate) { function getWeeksBetween(startDate, endDate) {
@ -2647,8 +2607,6 @@ function getZeroIndex(yPts) {
return zeroIndex; return zeroIndex;
} }
function getIntervalSize(orderedArray) { function getIntervalSize(orderedArray) {
return orderedArray[1] - orderedArray[0]; return orderedArray[1] - orderedArray[0];
} }
@ -2661,10 +2619,6 @@ function scale(val, yAxis) {
return floatTwo(yAxis.zeroLine - val * yAxis.scaleMultiplier); return floatTwo(yAxis.zeroLine - val * yAxis.scaleMultiplier);
} }
function getClosestInArray(goal, arr, index = false) { function getClosestInArray(goal, arr, index = false) {
let closest = arr.reduce(function(prev, curr) { let closest = arr.reduce(function(prev, curr) {
return (Math.abs(curr - goal) < Math.abs(prev - goal) ? curr : prev); return (Math.abs(curr - goal) < Math.abs(prev - goal) ? curr : prev);
@ -3017,7 +2971,6 @@ function dataPrep(data, type) {
// Set type // Set type
if(!d.chartType ) { if(!d.chartType ) {
if(!AXIS_DATASET_CHART_TYPES.includes(type)) type === DEFAULT_AXIS_CHART_TYPE;
d.chartType = type; d.chartType = type;
} }
@ -3677,7 +3630,6 @@ class AxisChart extends BaseChart {
// removeDataPoint(index = 0) {} // removeDataPoint(index = 0) {}
} }
// import MultiAxisChart from './charts/MultiAxisChart';
const chartTypes = { const chartTypes = {
bar: AxisChart, bar: AxisChart,
line: AxisChart, line: AxisChart,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,63 +1,29 @@
(function () { (function () {
'use strict'; 'use strict';
function __$styleInject(css, ref) { function __$styleInject(css, returnValue) {
if ( ref === void 0 ) ref = {}; if (typeof document === 'undefined') {
var insertAt = ref.insertAt; return returnValue;
}
if (!css || typeof document === 'undefined') { return; } css = css || '';
var head = document.head || document.getElementsByTagName('head')[0]; var head = document.head || document.getElementsByTagName('head')[0];
var style = document.createElement('style'); var style = document.createElement('style');
style.type = 'text/css'; style.type = 'text/css';
head.appendChild(style);
if (insertAt === 'top') { if (style.styleSheet){
if (head.firstChild) {
head.insertBefore(style, head.firstChild);
} else {
head.appendChild(style);
}
} else {
head.appendChild(style);
}
if (style.styleSheet) {
style.styleSheet.cssText = css; style.styleSheet.cssText = css;
} else { } else {
style.appendChild(document.createTextNode(css)); style.appendChild(document.createTextNode(css));
} }
return returnValue;
} }
// Fixed 5-color theme,
// More colors are difficult to parse visually
var HEATMAP_COLORS_BLUE = ['#ebedf0', '#c0ddf9', '#73b3f3', '#3886e1', '#17459e']; var HEATMAP_COLORS_BLUE = ['#ebedf0', '#c0ddf9', '#73b3f3', '#3886e1', '#17459e'];
var HEATMAP_COLORS_YELLOW = ['#ebedf0', '#fdf436', '#ffc700', '#ff9100', '#06001c']; var HEATMAP_COLORS_YELLOW = ['#ebedf0', '#fdf436', '#ffc700', '#ff9100', '#06001c'];
// Universal constants // Universal constants
var ANGLE_RATIO = Math.PI / 180;
/**
* Returns the value of a number upto 2 decimal places.
* @param {Number} d Any number
*/
/**
* Returns whether or not two given arrays are equal.
* @param {Array} arr1 First array
* @param {Array} arr2 Second array
*/
/** /**
* Shuffles array in place. ES6 version * Shuffles array in place. ES6 version
@ -78,24 +44,6 @@ function shuffle(array) {
return array; return array;
} }
/**
* Fill an array with extra points
* @param {Array} array Array
* @param {Number} count number of filler elements
* @param {Object} element element to fill with
* @param {Boolean} start fill at start?
*/
/**
* Returns pixel width of string.
* @param {String} string
* @param {Number} charWidth Width of single char in pixels
*/
// https://stackoverflow.com/a/29325222 // https://stackoverflow.com/a/29325222
function getRandomBias(min, max, bias, influence) { function getRandomBias(min, max, bias, influence) {
var range = max - min; var range = max - min;
@ -107,21 +55,10 @@ function getRandomBias(min, max, bias, influence) {
} }
// Playing around with dates // Playing around with dates
var NO_OF_MILLIS = 1000; var NO_OF_MILLIS = 1000;
var SEC_IN_DAY = 86400; var SEC_IN_DAY = 86400;
var MONTH_NAMES_SHORT = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; var MONTH_NAMES_SHORT = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
function clone(date) { function clone(date) {
return new Date(date.getTime()); return new Date(date.getTime());
} }
@ -140,21 +77,6 @@ function timestampToMidnight(timestamp) {
return midnightTs; return midnightTs;
} }
// export function getMonthsBetween(startDate, endDate) {}
// mutates
// mutates // mutates
function addDays(date, numberOfDays) { function addDays(date, numberOfDays) {
date.setDate(date.getDate() + numberOfDays); date.setDate(date.getDate() + numberOfDays);

File diff suppressed because one or more lines are too long