QA notes: No QA possible in EDA yet. This is just groundwork. There are storybook stories for the donut and chart markers.
In a donut marker story, I have tried accessing markers[0].props.icon which ought to contain a Leaflet.divIcon that should have a createIcon method. But the icon prop is null when I try to access it. So I don't recommend trying that route any further.
The cleaner solution anyway would be to factor out the svgHTML generation in DonutMarker.tsx and ChartMarker.tsx into helper functions (one takes DonutMarkerProps, the other takes ChartMarkerProps as arguments - excluding the onClick prop, which seems to be unused anyway [should we remove this?]).
Then create two new Leaflet-free components: DonutMarkerIcon and ChartMarkerIcon that simply render a div with the SVG icon in it (using the new helper functions of course). The new components take the same props as the regular markers (especially if we get rid of the onClick).
QA notes: No QA possible in EDA yet. This is just groundwork. There are storybook stories for the donut and chart markers.
In a donut marker story, I have tried accessing
markers[0].props.icon
which ought to contain aLeaflet.divIcon
that should have acreateIcon
method. But theicon
prop isnull
when I try to access it. So I don't recommend trying that route any further.The cleaner solution anyway would be to factor out the
svgHTML
generation in DonutMarker.tsx and ChartMarker.tsx into helper functions (one takesDonutMarkerProps
, the other takesChartMarkerProps
as arguments - excluding theonClick
prop, which seems to be unused anyway [should we remove this?]).Then create two new Leaflet-free components: DonutMarkerIcon and ChartMarkerIcon that simply render a div with the SVG icon in it (using the new helper functions of course). The new components take the same props as the regular markers (especially if we get rid of the
onClick
).