mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-08 03:18:36 +03:00
Merge pull request #168 from forensic-architecture/fix/dot-vs-bar
fix check to render a dot or bar in timeline
This commit is contained in:
@@ -4,7 +4,13 @@ import DatetimeSquare from './DatetimeSquare'
|
||||
import DatetimeStar from './DatetimeStar'
|
||||
import Project from './Project'
|
||||
import ColoredMarkers from '../Map/ColoredMarkers.jsx'
|
||||
import { calcOpacity, getEventCategories, zipColorsToPercentages, calculateColorPercentages } from '../../../common/utilities'
|
||||
import {
|
||||
calcOpacity,
|
||||
getEventCategories,
|
||||
zipColorsToPercentages,
|
||||
calculateColorPercentages,
|
||||
isLatitude,
|
||||
isLongitude } from '../../../common/utilities'
|
||||
|
||||
function renderDot (event, styles, props) {
|
||||
const colorPercentages = calculateColorPercentages([event], props.coloringSet)
|
||||
@@ -92,7 +98,7 @@ const TimelineEvents = ({
|
||||
return null
|
||||
}
|
||||
}
|
||||
const isDot = (!!event.location && !!event.longitude) || (features.GRAPH_NONLOCATED && event.projectOffset !== -1)
|
||||
const isDot = (isLatitude(event.latitude) && isLongitude(event.longitude)) || (features.GRAPH_NONLOCATED && event.projectOffset !== -1)
|
||||
|
||||
let renderShape = isDot ? renderDot : renderBar
|
||||
if (event.shape) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react'
|
||||
import colors from '../../../common/global'
|
||||
import { getEventCategories } from '../../../common/utilities'
|
||||
import { getEventCategories, isLatitude, isLongitude } from '../../../common/utilities'
|
||||
|
||||
const TimelineMarkers = ({
|
||||
styles,
|
||||
@@ -51,7 +51,7 @@ const TimelineMarkers = ({
|
||||
/>
|
||||
}
|
||||
|
||||
const isDot = (!!event.location && !!event.longitude) || (features.GRAPH_NONLOCATED && event.projectOffset !== -1)
|
||||
const isDot = (isLatitude(event.latitude) && isLongitude(event.longitude)) || (features.GRAPH_NONLOCATED && event.projectOffset !== -1)
|
||||
const evShadows = getEventCategories(event, categories).map(cat => getEventY({ ...event, category: cat.id }))
|
||||
|
||||
function renderMarkerForEvent (y) {
|
||||
|
||||
Reference in New Issue
Block a user