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

Threshold is Ignored in Month Graphs When Using Scaled Colors #364

Open
mkarrmann opened this issue Jun 3, 2024 · 0 comments · May be fixed by #365
Open

Threshold is Ignored in Month Graphs When Using Scaled Colors #364

mkarrmann opened this issue Jun 3, 2024 · 0 comments · May be fixed by #365

Comments

@mkarrmann
Copy link

Expected Behavior

The threshold parameter for month graphs has consistent behavior, regardless of whether circleColorByValue is set.

Current Behavior

The threshold field for month graphs does nothing when circleColorByValue (along with yMin and yMax) are set.

Possible Solution

The block of code I link below to const showCircle = curValue != null && curValue > threshold;. This should be the sole consideration for whether a value is set/

Steps to Reproduce (for bugs)

Create a tracker of type month with parameters similar to this:

searchType: frontmatter
searchTarget: snoozed mins
folder: /General/Periodic/Daily
datasetName: Meditation Minutes
month:
	mode: circle
	circleColorByValue: true
	yMin: 00
	yMax: 100
	threshold: 0

In a note, set the value equal to 0 for a day. Note that the circle still appears.

Context

This isn't exactly a bug, since from the code it's clear this is completely intentional:

// showCircle
let showCircle = false;
if (!monthInfo.circleColorByValue) {
// shown or not shown
if (curValue !== null) {
if (curValue > threshold) {
showCircle = true;
}
}
} else {
if (!allowScaledValue) {
if (curValue !== null) {
if (curValue > threshold) {
showCircle = true;
}
}
} else {
showCircle = true;
}
}

It was added in this commit which made a handful of changes.

However, I can't think of any convincing reason why this behavior should be in place. I found it very surprising to set a threshold and find that it had no effect. While obviously the color will give me a sense of whether the value is near the threshold, in some situations I may care a lot of about the value being exactly 0 vs. it being very small.

The best argument I can think of for this current behavior is: "Many people don't set any threshold, in which they are not expecting there to be any threshold. So, it is surprising to the user when they try using circleColorByValue with a yMin beneath the default value of threshold (0) and find that the circle don't appear". However, this isn't problem isn't specific to using circleColorByValue, and actually the core problem is that the default value of threshold is 0 instead of "no threshold" (but I know that making that change would be something of a breaking change, and potentially annoying for some users).

@mkarrmann mkarrmann linked a pull request Jun 3, 2024 that will close this issue
2 tasks
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 a pull request may close this issue.

1 participant