mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 21:38:35 +03:00
WIP: overridden colours and shapes
This commit is contained in:
@@ -10,6 +10,7 @@ export const sizes = {
|
||||
}
|
||||
|
||||
export default {
|
||||
fallbackEventColor: colors.fa_red,
|
||||
darkBackground: colors.black,
|
||||
primaryHighlight: colors.yellow,
|
||||
secondaryHighlight: colors.white,
|
||||
|
||||
@@ -175,13 +175,13 @@ export function selectTypeFromPathWithPoster (path, poster) {
|
||||
return { type: typeForPath(path), path, poster }
|
||||
}
|
||||
|
||||
export function getEventOpacity (events) {
|
||||
export function calcOpacity (num) {
|
||||
/* Events have opacity 0.5 by default, and get added to according to how many
|
||||
* other events there are in the same render. The idea here is that the
|
||||
* overlaying of events builds up a 'heat map' of the event space, where
|
||||
* darker areas represent more events with proportion */
|
||||
const base = events.length >= 1 ? 0.3 : 0
|
||||
return base + (Math.min(0.5, 0.08 * (events.length - 1)))
|
||||
const base = num >= 1 ? 0.6 : 0
|
||||
return base + (Math.min(0.5, 0.08 * (num - 1)))
|
||||
}
|
||||
|
||||
export const dateMin = function () { return Array.prototype.slice.call(arguments).reduce(function (a, b) { return a < b ? a : b }) }
|
||||
|
||||
Reference in New Issue
Block a user