Compare commits
2 Commits
0e40f403e4
...
0c9e7ed183
Author | SHA1 | Date | |
---|---|---|---|
0c9e7ed183 | |||
4a7c03307d |
20
src/index.js
20
src/index.js
@ -86,6 +86,9 @@ function populateChart() {
|
|||||||
size: 18,
|
size: 18,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
time: {
|
||||||
|
unit: lookupTimeUnit(currentTimeSelection)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
y: {
|
y: {
|
||||||
ticks: {
|
ticks: {
|
||||||
@ -100,6 +103,17 @@ function populateChart() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function lookupTimeUnit(query){
|
||||||
|
const lookup = {
|
||||||
|
'h': 'day',
|
||||||
|
'd': 'week',
|
||||||
|
'm': 'month',
|
||||||
|
'y': 'month',
|
||||||
|
'l': 'year'
|
||||||
|
}
|
||||||
|
return lookup[query.charAt(query.length - 1)]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
async function callUpdateURL() {
|
async function callUpdateURL() {
|
||||||
let resp = await fetch("https://data.wowtoken.app/token/current.json");
|
let resp = await fetch("https://data.wowtoken.app/token/current.json");
|
||||||
@ -258,7 +272,7 @@ function detectRegionQuery(urlSearchParams) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log("An incorrect or malformed region selection was made in the query string");
|
console.warn("An incorrect or malformed region selection was made in the query string");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,7 +290,7 @@ function detectTimeQuery(urlSearchParams) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log("An incorrect or malformed time selection was made in the query string");
|
console.warn("An incorrect or malformed time selection was made in the query string");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -292,7 +306,7 @@ function detectAggregateQuery(urlSearchParams) {
|
|||||||
}
|
}
|
||||||
aggregateFunctionToggle();
|
aggregateFunctionToggle();
|
||||||
} else {
|
} else {
|
||||||
console.log("An incorrect or malformed aggregate selection was made in the query string");
|
console.warn("An incorrect or malformed aggregate selection was made in the query string");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user