reconfigures initial settings with a 30 year setting, more sensible defaults for zooms

This commit is contained in:
Lachlan Kermode
2020-02-09 18:27:35 +13:00
parent 6ad9b12370
commit 77bedb36b9
5 changed files with 13 additions and 7 deletions

View File

@@ -8,7 +8,6 @@ const CardTimestamp = ({ timelabel, language, precision }) => {
// const estimatedLang = copy[language].cardstack.estimated
const unknownLang = copy[language].cardstack.unknown_time
console.log(precision)
if (isNotNullNorUndefined(timelabel)) {
return (
<div className='card-cell timestamp'>

View File

@@ -78,6 +78,10 @@ const TimelineEvents = ({
})
}
// console.log(datetimes
// .filter(d => d.events.some(e => e.category !== 'Legislation'))
// )
return (
<g
clipPath={'url(#clip)'}

View File

@@ -1,7 +1,7 @@
import React from 'react'
function zoomIsActive (duration, extent) {
if (duration > 1570000 && extent > 1570000) {
function zoomIsActive (duration, extent, max) {
if (duration >= max && extent >= max) {
return true
}
return duration === extent
@@ -9,7 +9,8 @@ function zoomIsActive (duration, extent) {
const TimelineZoomControls = ({ extent, zoomLevels, dims, onApplyZoom }) => {
function renderZoom (zoom, idx) {
const isActive = zoomIsActive(zoom.duration, extent)
const max = zoomLevels.reduce((acc, vl) => acc.duration < vl.duration ? vl : acc)
const isActive = zoomIsActive(zoom.duration, extent, max.duration)
return (
<text
className={`zoom-level-button ${isActive ? 'active' : ''}`}