From 1b97d164b87c2a99b2d2a2ae0dd916f67322bbba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rahel=20Lu=CC=88thy?= Date: Thu, 7 Apr 2022 08:38:11 +0200 Subject: [PATCH] #14: Remove MUI dependencies from EventClusters --- src/layers/EventClusters.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/layers/EventClusters.tsx b/src/layers/EventClusters.tsx index 7dbe544..bb4ca61 100644 --- a/src/layers/EventClusters.tsx +++ b/src/layers/EventClusters.tsx @@ -1,18 +1,18 @@ import React from 'react' import { ScaleBand, ScaleLinear, scaleSqrt } from 'd3-scale' -import { Theme } from '@material-ui/core' import { TimelineEventCluster } from '../model' import { defaultClusterColor, defaultSingleEventMarkHeight } from '../utils' -import makeStyles from '@material-ui/core/styles/makeStyles' import { extent } from 'd3-array' +import { useTimelineTheme } from '../theme' -const useStyles = makeStyles((theme: Theme) => ({ - clusterCircle: { - stroke: theme.palette.background.paper, +const useCircleStyle = () => { + const theme = useTimelineTheme() + return { + stroke: theme.base.backgroundColor, strokeWidth: 2, fillOpacity: 0.5, - }, -})) + } +} interface Props { readonly height: number @@ -29,7 +29,7 @@ export const EventClusters = ({ expanded, height, }: Props) => { - const classes = useStyles() + const circleStyle = useCircleStyle() const [clusterSizeDomainMin, clusterSizeDomainMax] = extent(eventClusters.map((c) => c.size)) const clusterRadiusMin = defaultSingleEventMarkHeight / 2 @@ -47,10 +47,10 @@ export const EventClusters = ({ {eventClusters.map((eventCluster) => (