Modified cluster styling to have gradients

This commit is contained in:
efarooqui
2020-10-14 21:05:58 -07:00
parent b5bb7472ac
commit 32da7f0105
3 changed files with 28 additions and 4 deletions

View File

@@ -27,10 +27,10 @@ function ClusterEvents ({
const totalPoints = calculateTotalPoints()
const styles = ({
fill: colors.fallbackEventColor,
stroke: colors.darkBackground,
strokeWidth: 0,
fillOpacity: calcClusterOpacity(pointCount, totalPoints)
// fill: colors.fallbackEventColor,
// stroke: colors.darkBackground,
// strokeWidth: 0,
fillOpacity: calcClusterOpacity(pointCount, totalPoints),
})
return (
@@ -44,6 +44,7 @@ function ClusterEvents ({
cy='0'
r={calcClusterSize(pointCount, totalPoints)}
style={styles}
fill="url('#myGradient')"
/>}
</React.Fragment>
)

View File

@@ -0,0 +1,13 @@
import React from 'react'
const DefsClusters = () => (
<defs>
<radialGradient id="myGradient">
<stop offset="10%" stop-color="red" />
<stop offset="95%" stop-color="black" />
{/* <stop offset="95%" stop-color="red" /> */}
</radialGradient>
</defs>
)
export default DefsClusters