diff --git a/src/common/data/copy.json b/src/common/data/copy.json index eac9782..9985d60 100644 --- a/src/common/data/copy.json +++ b/src/common/data/copy.json @@ -235,7 +235,7 @@ "Testimony Group 03", "Other" ], - "info": "Showing %n events that occurred between", + "info": "Showing %n events that occurred between", "default_categories_label": "" }, "cardstack": { diff --git a/src/common/utilities.js b/src/common/utilities.js index 9a4e469..50aad7b 100644 --- a/src/common/utilities.js +++ b/src/common/utilities.js @@ -344,7 +344,7 @@ export function calcClusterOpacity(pointCount, totalPoints) { /* Clusters represent multiple events within a specific radius. The darker the cluster, the larger the number of underlying events. We use a multiplication factor (50) here as well to ensure that the larger clusters have an appropriately darker shading. */ - return Math.min(0.85, 0.08 + (pointCount / totalPoints) * 50); + return Math.min(0.85, 0.5 + (pointCount / totalPoints) * 50); } export function calcClusterSize(pointCount, totalPoints) { @@ -352,8 +352,8 @@ export function calcClusterSize(pointCount, totalPoints) { Just like with opacity, we use a multiplication factor to ensure that clusters with higher point counts appear larger. */ //TO-DO: Convert maxSize into a config var - const maxSize = totalPoints > 60 ? 60 : 35; - return Math.min(maxSize, 10 + (pointCount / totalPoints) * 100); + const maxSize = totalPoints > 60 ? 90 : 35; + return Math.min(maxSize, 15 + (pointCount / totalPoints) * 120); } export function calculateTotalClusterPoints(clusters) { diff --git a/src/components/space/carto/atoms/Clusters.js b/src/components/space/carto/atoms/Clusters.js index f652e64..d04884c 100644 --- a/src/components/space/carto/atoms/Clusters.js +++ b/src/components/space/carto/atoms/Clusters.js @@ -81,7 +81,7 @@ function Cluster({ }} className="cluster-event-marker" /> - {hovered ? renderHover(cluster) : null} + {renderHover(cluster)} ); @@ -111,8 +111,13 @@ function ClusterEvents({ <> 40 ? (txt > 70 ? (txt > 100 ? 14 : 12) : 8) : 3}px`} + style={{ + fontWeight: "bold", + fill: "#dedede", + zIndex: 10000 + txt, + fontSize: Math.min(45, Math.max(18, txt / 1.5)), + }} > {txt} diff --git a/src/components/time/Timeline.js b/src/components/time/Timeline.js index 295b3c8..8f4a042 100644 --- a/src/components/time/Timeline.js +++ b/src/components/time/Timeline.js @@ -17,6 +17,10 @@ import Markers from "./atoms/Markers.js"; import Events from "./atoms/Events.js"; import Categories from "./Categories"; +function timeout(delay) { + return new Promise((res) => setTimeout(res, delay)); +} + class Timeline extends React.Component { constructor(props) { super(props); @@ -29,6 +33,7 @@ class Timeline extends React.Component { this.onDragStart = this.onDragStart.bind(this); this.onDrag = this.onDrag.bind(this); this.onDragEnd = this.onDragEnd.bind(this); + this.onClick = this.onClick.bind(this); this.svgRef = React.createRef(); this.state = { isFolded: @@ -362,6 +367,30 @@ class Timeline extends React.Component { this.props.methods.onSelect(event); } + async onClick() { + console.log("click"); + const timeShift = 3600 * 24; //14 days + const { range, rangeLimits } = this.props.app.timeline; + // let newDomain0 = timeSecond.offset(range[0], timeShift); + let earlyDate = rangeLimits[0]; + let laterDate = timeSecond.offset(rangeLimits[0], 24 * timeShift); + const maxDate = rangeLimits[1]; + let i = 0; + while (laterDate < maxDate) { + // i+=1; + // console.log(i) + // laterDate = timeSecond.offset(earlyDate, timeShift * 14); + // laterDate = timeSecond.offset(laterDate, timeShift * 14); + // this.props.methods.onUpdateTimerange([earlyDate, laterDate]); + // await timeout(100); //for 1 sec delay + i += 1; + console.log(i); + laterDate = timeSecond.offset(laterDate, timeShift * Math.min(2 * i, 14)); + this.props.methods.onUpdateTimerange([earlyDate, laterDate]); + await timeout(750); //for 1 sec delay + } + } + render() { const { isNarrative, app, domain } = this.props; const { timeline } = app; @@ -391,7 +420,12 @@ class Timeline extends React.Component {
- + {

-

+

{d0} - {d1}