refactor: multiple linting fixes
This commit is contained in:
parent
103139ebee
commit
53d14004bb
@ -1,29 +1,52 @@
|
|||||||
import { MONTH_NAMES_SHORT } from '../../../src/js/utils/date-utils';
|
import { MONTH_NAMES_SHORT } from "../../../src/js/utils/date-utils";
|
||||||
|
|
||||||
// Composite Chart
|
// Composite Chart
|
||||||
// ================================================================================
|
// ================================================================================
|
||||||
const reportCountList = [152, 222, 199, 287, 534, 709,
|
const reportCountList = [
|
||||||
1179, 1256, 1632, 1856, 1850];
|
152,
|
||||||
|
222,
|
||||||
|
199,
|
||||||
|
287,
|
||||||
|
534,
|
||||||
|
709,
|
||||||
|
1179,
|
||||||
|
1256,
|
||||||
|
1632,
|
||||||
|
1856,
|
||||||
|
1850,
|
||||||
|
];
|
||||||
|
|
||||||
export const lineCompositeData = {
|
export const lineCompositeData = {
|
||||||
labels: ["2007", "2008", "2009", "2010", "2011", "2012",
|
labels: [
|
||||||
"2013", "2014", "2015", "2016", "2017"],
|
"2007",
|
||||||
|
"2008",
|
||||||
|
"2009",
|
||||||
|
"2010",
|
||||||
|
"2011",
|
||||||
|
"2012",
|
||||||
|
"2013",
|
||||||
|
"2014",
|
||||||
|
"2015",
|
||||||
|
"2016",
|
||||||
|
"2017",
|
||||||
|
],
|
||||||
|
|
||||||
yMarkers: [
|
yMarkers: [
|
||||||
{
|
{
|
||||||
label: "Average 100 reports/month",
|
label: "Average 100 reports/month",
|
||||||
value: 1200,
|
value: 1200,
|
||||||
options: { labelPos: 'left' }
|
options: { labelPos: "left" },
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
datasets: [{
|
datasets: [
|
||||||
"name": "Events",
|
{
|
||||||
"values": reportCountList
|
name: "Events",
|
||||||
}]
|
values: reportCountList,
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export const fireball_5_25 = [
|
export const fireball_5_25 = [
|
||||||
[4, 0, 3, 1, 1, 2, 1, 1, 1, 0, 1, 1],
|
[4, 0, 3, 1, 1, 2, 1, 1, 1, 0, 1, 1],
|
||||||
[2, 3, 3, 2, 1, 3, 0, 1, 2, 7, 10, 4],
|
[2, 3, 3, 2, 1, 3, 0, 1, 2, 7, 10, 4],
|
||||||
@ -62,7 +85,7 @@ export const fireballOver25 = [
|
|||||||
[5, 6, 1, 2, 5, 4, 5, 5, 16, 9, 14, 9],
|
[5, 6, 1, 2, 5, 4, 5, 5, 16, 9, 14, 9],
|
||||||
[5, 4, 7, 5, 1, 5, 3, 3, 5, 7, 22, 2],
|
[5, 4, 7, 5, 1, 5, 3, 3, 5, 7, 22, 2],
|
||||||
[5, 13, 11, 6, 1, 7, 9, 8, 14, 17, 16, 3],
|
[5, 13, 11, 6, 1, 7, 9, 8, 14, 17, 16, 3],
|
||||||
[8, 9, 8, 6, 4, 8, 5, 6, 14, 11, 21, 12]
|
[8, 9, 8, 6, 4, 8, 5, 6, 14, 11, 21, 12],
|
||||||
];
|
];
|
||||||
|
|
||||||
export const barCompositeData = {
|
export const barCompositeData = {
|
||||||
@ -78,24 +101,32 @@ export const barCompositeData = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "2 to 5 reports",
|
name: "2 to 5 reports",
|
||||||
values: fireball_2_5[9]
|
values: fireball_2_5[9],
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
// Demo Chart multitype Chart
|
// Demo Chart multitype Chart
|
||||||
// ================================================================================
|
// ================================================================================
|
||||||
export const typeData = {
|
export const typeData = {
|
||||||
labels: ["12am-3am", "3am-6am", "6am-9am", "9am-12pm",
|
labels: [
|
||||||
"12pm-3pm", "3pm-6pm", "6pm-9pm", "9pm-12am"],
|
"12am-3am",
|
||||||
|
"3am-6am",
|
||||||
|
"6am-9am",
|
||||||
|
"9am-12pm",
|
||||||
|
"12pm-3pm",
|
||||||
|
"3pm-6pm",
|
||||||
|
"6pm-9pm",
|
||||||
|
"9pm-12am",
|
||||||
|
],
|
||||||
|
|
||||||
yMarkers: [
|
yMarkers: [
|
||||||
{
|
{
|
||||||
label: "Marker",
|
label: "Marker",
|
||||||
value: 43,
|
value: 43,
|
||||||
options: { labelPos: 'left' }
|
options: { labelPos: "left" },
|
||||||
// type: 'dashed'
|
// type: 'dashed'
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
yRegions: [
|
yRegions: [
|
||||||
@ -103,7 +134,7 @@ export const typeData = {
|
|||||||
label: "Region",
|
label: "Region",
|
||||||
start: -10,
|
start: -10,
|
||||||
end: 50,
|
end: 50,
|
||||||
options: { labelPos: 'right' }
|
options: { labelPos: "right" },
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
@ -111,69 +142,137 @@ export const typeData = {
|
|||||||
{
|
{
|
||||||
name: "Some Data",
|
name: "Some Data",
|
||||||
values: [18, 40, 30, 35, 8, 52, 17, -4],
|
values: [18, 40, 30, 35, 8, 52, 17, -4],
|
||||||
axisPosition: 'right',
|
axisPosition: "right",
|
||||||
chartType: 'bar'
|
chartType: "bar",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Another Set",
|
name: "Another Set",
|
||||||
values: [30, 50, -10, 15, 18, 32, 27, 14],
|
values: [30, 50, -10, 15, 18, 32, 27, 14],
|
||||||
axisPosition: 'right',
|
axisPosition: "right",
|
||||||
chartType: 'bar'
|
chartType: "bar",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Yet Another",
|
name: "Yet Another",
|
||||||
values: [15, 20, -3, -15, 58, 12, -17, 37],
|
values: [15, 20, -3, -15, 58, 12, -17, 37],
|
||||||
chartType: 'line'
|
chartType: "line",
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const trendsData = {
|
export const trendsData = {
|
||||||
labels: [1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976,
|
labels: [
|
||||||
1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986,
|
1967,
|
||||||
1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
|
1968,
|
||||||
1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
1969,
|
||||||
2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016] ,
|
1970,
|
||||||
|
1971,
|
||||||
|
1972,
|
||||||
|
1973,
|
||||||
|
1974,
|
||||||
|
1975,
|
||||||
|
1976,
|
||||||
|
1977,
|
||||||
|
1978,
|
||||||
|
1979,
|
||||||
|
1980,
|
||||||
|
1981,
|
||||||
|
1982,
|
||||||
|
1983,
|
||||||
|
1984,
|
||||||
|
1985,
|
||||||
|
1986,
|
||||||
|
1987,
|
||||||
|
1988,
|
||||||
|
1989,
|
||||||
|
1990,
|
||||||
|
1991,
|
||||||
|
1992,
|
||||||
|
1993,
|
||||||
|
1994,
|
||||||
|
1995,
|
||||||
|
1996,
|
||||||
|
1997,
|
||||||
|
1998,
|
||||||
|
1999,
|
||||||
|
2000,
|
||||||
|
2001,
|
||||||
|
2002,
|
||||||
|
2003,
|
||||||
|
2004,
|
||||||
|
2005,
|
||||||
|
2006,
|
||||||
|
2007,
|
||||||
|
2008,
|
||||||
|
2009,
|
||||||
|
2010,
|
||||||
|
2011,
|
||||||
|
2012,
|
||||||
|
2013,
|
||||||
|
2014,
|
||||||
|
2015,
|
||||||
|
2016,
|
||||||
|
],
|
||||||
datasets: [
|
datasets: [
|
||||||
{
|
{
|
||||||
values: [132.9, 150.0, 149.4, 148.0, 94.4, 97.6, 54.1, 49.2, 22.5, 18.4,
|
values: [
|
||||||
39.3, 131.0, 220.1, 218.9, 198.9, 162.4, 91.0, 60.5, 20.6, 14.8,
|
132.9,
|
||||||
33.9, 123.0, 211.1, 191.8, 203.3, 133.0, 76.1, 44.9, 25.1, 11.6,
|
150.0,
|
||||||
28.9, 88.3, 136.3, 173.9, 170.4, 163.6, 99.3, 65.3, 45.8, 24.7,
|
149.4,
|
||||||
12.6, 4.2, 4.8, 24.9, 80.8, 84.5, 94.0, 113.3, 69.8, 39.8]
|
148.0,
|
||||||
}
|
94.4,
|
||||||
]
|
97.6,
|
||||||
|
54.1,
|
||||||
|
49.2,
|
||||||
|
22.5,
|
||||||
|
18.4,
|
||||||
|
39.3,
|
||||||
|
131.0,
|
||||||
|
220.1,
|
||||||
|
218.9,
|
||||||
|
198.9,
|
||||||
|
162.4,
|
||||||
|
91.0,
|
||||||
|
60.5,
|
||||||
|
20.6,
|
||||||
|
14.8,
|
||||||
|
33.9,
|
||||||
|
123.0,
|
||||||
|
211.1,
|
||||||
|
191.8,
|
||||||
|
203.3,
|
||||||
|
133.0,
|
||||||
|
76.1,
|
||||||
|
44.9,
|
||||||
|
25.1,
|
||||||
|
11.6,
|
||||||
|
28.9,
|
||||||
|
88.3,
|
||||||
|
136.3,
|
||||||
|
173.9,
|
||||||
|
170.4,
|
||||||
|
163.6,
|
||||||
|
99.3,
|
||||||
|
65.3,
|
||||||
|
45.8,
|
||||||
|
24.7,
|
||||||
|
12.6,
|
||||||
|
4.2,
|
||||||
|
4.8,
|
||||||
|
24.9,
|
||||||
|
80.8,
|
||||||
|
84.5,
|
||||||
|
94.0,
|
||||||
|
113.3,
|
||||||
|
69.8,
|
||||||
|
39.8,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const moonData = {
|
export const moonData = {
|
||||||
names: ["Ganymede", "Callisto", "Io", "Europa"],
|
names: ["Ganymede", "Callisto", "Io", "Europa"],
|
||||||
masses: [14819000, 10759000, 8931900, 4800000],
|
masses: [14819000, 10759000, 8931900, 4800000],
|
||||||
distances: [1070.412, 1882.709, 421.700, 671.034],
|
distances: [1070.412, 1882.709, 421.7, 671.034],
|
||||||
diameters: [5262.4, 4820.6, 3637.4, 3121.6],
|
diameters: [5262.4, 4820.6, 3637.4, 3121.6],
|
||||||
};
|
};
|
||||||
|
|
||||||
// const jupiterMoons = {
|
|
||||||
// 'Ganymede': {
|
|
||||||
// mass: '14819000 x 10^16 kg',
|
|
||||||
// 'semi-major-axis': '1070412 km',
|
|
||||||
// 'diameter': '5262.4 km'
|
|
||||||
// },
|
|
||||||
// 'Callisto': {
|
|
||||||
// mass: '10759000 x 10^16 kg',
|
|
||||||
// 'semi-major-axis': '1882709 km',
|
|
||||||
// 'diameter': '4820.6 km'
|
|
||||||
// },
|
|
||||||
// 'Io': {
|
|
||||||
// mass: '8931900 x 10^16 kg',
|
|
||||||
// 'semi-major-axis': '421700 km',
|
|
||||||
// 'diameter': '3637.4 km'
|
|
||||||
// },
|
|
||||||
// 'Europa': {
|
|
||||||
// mass: '4800000 x 10^16 kg',
|
|
||||||
// 'semi-major-axis': '671034 km',
|
|
||||||
// 'diameter': '3121.6 km'
|
|
||||||
// },
|
|
||||||
// };
|
|
||||||
|
|
||||||
// ================================================================================
|
|
||||||
|
|
||||||
@ -1,8 +1,10 @@
|
|||||||
import { shuffle, getRandomBias } from '../../../src/js/utils/helpers';
|
import { shuffle, getRandomBias } from '../../../src/js/utils/helpers';
|
||||||
import { HEATMAP_COLORS_YELLOW, HEATMAP_COLORS_BLUE } from '../../../src/js/utils/constants';
|
import { HEATMAP_COLORS_YELLOW, HEATMAP_COLORS_BLUE } from '../../../src/js/utils/constants';
|
||||||
import { SEC_IN_DAY, clone, timestampToMidnight, timestampSec, addDays } from '../../../src/js/utils/date-utils';
|
import { SEC_IN_DAY, clone, timestampToMidnight, timestampSec, addDays } from '../../../src/js/utils/date-utils';
|
||||||
|
/* eslint-disable no-unused-vars */
|
||||||
import { fireballOver25, fireball_2_5, fireball_5_25, lineCompositeData,
|
import { fireballOver25, fireball_2_5, fireball_5_25, lineCompositeData,
|
||||||
barCompositeData, typeData, trendsData, moonData } from './data';
|
barCompositeData, typeData, trendsData, moonData } from './data';
|
||||||
|
/* eslint-enable no-unused-vars */
|
||||||
import demoConfig from './demoConfig';
|
import demoConfig from './demoConfig';
|
||||||
// import { lineComposite, barComposite } from './demoConfig';
|
// import { lineComposite, barComposite } from './demoConfig';
|
||||||
// ================================================================================
|
// ================================================================================
|
||||||
|
|||||||
@ -37,8 +37,8 @@ export function lightenDarkenColor(color, amt) {
|
|||||||
|
|
||||||
export function isValidColor(string) {
|
export function isValidColor(string) {
|
||||||
// https://stackoverflow.com/a/32685393
|
// https://stackoverflow.com/a/32685393
|
||||||
let HEX_RE = /(^\s*)(#)((?:[A-Fa-f0-9]{3}){1,2})$/i
|
let HEX_RE = /(^\s*)(#)((?:[A-Fa-f0-9]{3}){1,2})$/i;
|
||||||
let RGB_RE = /(^\s*)(rgb|hsl)(a?)[(]\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*(?:,\s*([\d.]+)\s*)?[)]$/i
|
let RGB_RE = /(^\s*)(rgb|hsl)(a?)[(]\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*(?:,\s*([\d.]+)\s*)?[)]$/i;
|
||||||
return HEX_RE.test(string) || RGB_RE.test(string);
|
return HEX_RE.test(string) || RGB_RE.test(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user