Skip to content

Commit

Permalink
Merge pull request #461 from openclimatefix/issue/437-blob-size
Browse files Browse the repository at this point in the history
change circle so that area is proportional to expected PV
  • Loading branch information
rachel-labri-tipton authored Feb 6, 2024
2 parents d73b941 + 6fec0fc commit 8164485
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/nowcasting-app/components/map/sitesMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ const SitesMap: React.FC<SitesMapProps> = ({
label: site.label,
capacity: site.capacity,
expectedPV: site.expectedPV,
// Make the radius of the circle where the area is proportional to the expectedPV
// We know expectedPVRadius has to be proportional to sqrt(expectedPV),
// But this didn't look good, so took took halfway between linear and area
// and if expectedPV == capacity, then expectedPVRadius == capacity, therefore
expectedPVRadius: Math.pow(site.expectedPV, 0.67) * Math.pow(site.capacity, 0.34),
selected: site.id === clickedSiteGroupId
}
};
Expand Down Expand Up @@ -406,7 +411,7 @@ const SitesMap: React.FC<SitesMapProps> = ({
if (generationLayer) {
map.setPaintProperty(`Generation-${groupName}`, "circle-radius", [
"*",
["to-number", ["get", "expectedPV"]],
["to-number", ["get", "expectedPVRadius"]],
getRingMultiplier(groupAggregationLevel)
]);
// const visibility = currentAggregationLevel === groupAggregationLevel ? "visible" : "none";
Expand All @@ -426,7 +431,7 @@ const SitesMap: React.FC<SitesMapProps> = ({
paint: {
"circle-radius": [
"*",
["to-number", ["get", "expectedPV"]],
["to-number", ["get", "expectedPVRadius"]],
getRingMultiplier(groupAggregationLevel)
],
"circle-color": [
Expand Down

0 comments on commit 8164485

Please sign in to comment.