diff options
Diffstat (limited to 'client/map/index.js')
| -rw-r--r-- | client/map/index.js | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/client/map/index.js b/client/map/index.js index a1c728d9..9ca43867 100644 --- a/client/map/index.js +++ b/client/map/index.js @@ -52,12 +52,12 @@ function addMarker(map, latlng, citations) { rec.unshift("<a href='" + doi[0] + "' target='_blank'>") rec.push("</a>") } - const addressString = addresses.map(addr => addr.name).join('<br/>') - rec.push("<br>") - rec.push(addressString) if (year) { rec.push(" (" + year + ")") } + const addressString = addresses.map(addr => addr.name).join('<br/>') + rec.push("<br>") + rec.push(addressString) return rec.join("") }) @@ -107,6 +107,7 @@ export default function append(el, payload) { console.log(citation) return } + console.log(citation) citation.addresses.forEach(address => { if (!(address.name in citationsByAddress)) { citationsByAddress[address.name] = { address, citations: []} @@ -122,7 +123,16 @@ export default function append(el, payload) { const latlng = [citationAddress.lat, citationAddress.lng].map(n => parseFloat(n)) if (Number.isNaN(latlng[0]) || Number.isNaN(latlng[1])) return addMarker(map, latlng, citationList) - addArc(map, source, latlng, arcStyles[citationAddress.type]) + const style = { ...arcStyles[citationAddress.type] } + let weight = Math.min(citationList.length, 5) + let opacity = 0.5 + Math.min(citationList.length / 5, 0.5) + if (citationAddress.type !== 'edu') { + weight += 1 + opacity = 1 + } + style.weight = String(weight) + style.opacity = opacity + addArc(map, source, latlng, style) }) console.log(paper) |
