diff --git a/src/components/Toolbar.jsx b/src/components/Toolbar.jsx index f2606fd..75826c5 100644 --- a/src/components/Toolbar.jsx +++ b/src/components/Toolbar.jsx @@ -59,8 +59,8 @@ class Toolbar extends React.Component { renderToolbarNarrativePanel() { return ( -

Focus stories

-

Here are some highlighted stories

+

{copy[this.props.language].toolbar.narrative_panel_title}

+

{copy[this.props.language].toolbar.narrative_summary}

{this.props.narratives.map((narr) => { return (
diff --git a/src/js/data/copy.json b/src/js/data/copy.json index 2feca2b..21702e0 100644 --- a/src/js/data/copy.json +++ b/src/js/data/copy.json @@ -103,7 +103,9 @@ "title": "Directory of tags", "placeholder": "Search" } - } + }, + "narrative_panel_title": "Focus narratives", + "narrative_summary": "Here you can follow some curated stories we have found in the data." }, "timeline": { "zooms": [ diff --git a/src/js/map/map.js b/src/js/map/map.js index 2d56977..827810d 100644 --- a/src/js/map/map.js +++ b/src/js/map/map.js @@ -98,10 +98,24 @@ Stop and start the development process in terminal after you have added your tok .attr('viewBox', '0 0 6 6') .attr('refX', 3) .attr('refY', 3) - .attr('markerWidth', 14) - .attr('markerHeight', 14) + .attr('markerWidth', 6) + .attr('markerHeight', 6) .attr('orient', 'auto') .append('path') + .style('fill', 'red') + .attr('d', 'M0,3v-3l6,3l-6,3z'); + + svg.insert('defs', 'g') + .append('marker-off') + .attr('id', 'arrow-off') + .attr('viewBox', '0 0 6 6') + .attr('refX', 3) + .attr('refY', 3) + .attr('markerWidth', 6) + .attr('markerHeight', 6) + .attr('orient', 'auto') + .append('path') + .style('fill', 'black') .attr('d', 'M0,3v-3l6,3l-6,3z'); map.on('zoomstart', () => { @@ -366,6 +380,12 @@ Stop and start the development process in terminal after you have added your tok .exit() .remove(); + const getMarker = (d) => { + if (!d || app.narrative === null) return 'none'; + if (d.id !== app.narrative.id) return 'url(#arrow-off)'; + return 'url(#arrow)'; + } + narrativesDom .enter().append('path') .attr('class', 'narrative') @@ -393,12 +413,18 @@ Stop and start the development process in terminal after you have added your tok }) .style('fill', 'none') .style('cursor', 'pointer') + .attr('marker-start', d => getMarker(d)) + .attr('marker-end', d => getMarker(d)) + .attr('mid-marker', d => getMarker(d)) .on('click', d => { console.log(d) }); narrativesDom .attr('d', d => sequenceLine(d.steps)) + .attr('marker-start', d => getMarker(d)) + .attr('marker-end', d => getMarker(d)) + .attr('mid-marker', d => getMarker(d)) .style('stroke', d => { if (!d || app.narrative === null) return 'none'; if (d.id !== app.narrative.id) return '#232323';