Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The plugin should give priority to manually-set scale when mapping intensity #61

Closed
wants to merge 1 commit into from

Conversation

THeK3nger
Copy link
Contributor

So, I struggled for an hour to understand why this plugin failed to map my "mindfulness:: 10" entries with the correct shade of color. Then I discovered that it happened that, by coincidence, I meditated 10 minutes for the first 3 days of the year. In this case, the plugin check minimumIntensity === maximumIntensity (the actual minimum and maximum values of my entries), and because they are the same, it completely ignores my scale (that goes from 1 to 60) and try to set the intensity index 10 (that doesn't exist).

I find this behavior confusing, especially at the beginning of the year (when there are just a couple of entries and, therefore, it is very likely that minimumIntensity === maximumIntensity by accident).

A better behavior should be to always map the intensity between intensityScaleStart and intensityScaleEnd if the user set those values. If not, they will fall back to minimumIntensity === maximumIntensity and, therefore, the old behavior is preserved. So I think we can have our cake and eat it.

This PR address this.

If the user set `intensityScaleStart` and `intensityScaleEnd`, the
plugin should not ignore the scale if all the intensities happen to be
at the same value.

Especially at the beginning of the year (when there are just a couple of
entries) this may lead to confused users.
@THeK3nger THeK3nger closed this Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant