Skip to content
Discussion options

You must be logged in to vote

Hi Sai, thanks for reaching out!
My muscle heatmap is built around a rolling volume calculation system that maps workout sets to specific muscle regions.

The core approach is calculating rolling 7-day volumes(weekly sets) for each of the muscle.

The body maps use color gradients (red or blue based on theme applied).

I use a this function that takes the muscle's set count and maximum volume to calculate a color intensity:

const getVolumeColor = (sets: number, maxSets: number): string => {
  if (sets === 0) return 'hsla(0, 0%, 100%, 1)';
  const ratio = sets / Math.max(maxSets, 1);
  const lightness = 84 - ratio * 64; // 84% → 20%
  return `hsl(var(--heatmap-hue), 75%, ${lightness}%)`;
};

T…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@thesaiteja24
Comment options

Answer selected by aree6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants