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

Respect thresholds in scaled months #365

Merged
merged 4 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions examples/TestCalendar.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,23 @@ month:
```

### Colored by Values
Use parameter `circleColorByValue`, color the circles based on the values
Use parameters `circleColorByValue`, `yMin`, and `yMax`, to color the circles based on the values
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth emphasizing that you need to set all 3 of these in order for it to take effect.

``` tracker
searchType: tag
searchTarget: exercise-pushup
datasetName: PushUp
folder: diary
month:
startWeekOn:
threshold: 40
threshold: 10
color: green
headerMonthColor: orange
dimNotInMonth: false
todayRingColor: orange
selectedRingColor: steelblue
circleColorByValue: true
yMin: 0
yMax: 50
showSelectedValue: true
```

Expand Down
2 changes: 1 addition & 1 deletion examples/diary/Lucas-20210105-Journal.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ bloodpressure: 177/119

#weight:70.0kg

#exercise-pushup:35
#exercise-pushup:5
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This date should now have no circle, because it is beneath the threshold.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see it circled when I test your branch locally

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that you have to update all of the 2021-01-05 files to handle for all the various date formats. When I update 2021-01-05.md, the test works

#exercise-plank:34sec

#meditation
Expand Down
21 changes: 1 addition & 20 deletions src/month.ts
Original file line number Diff line number Diff line change
Expand Up @@ -643,26 +643,7 @@ function renderMonthDays(
console.log(curValue);
}

// 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;
}
}
const showCircle = curValue != null && curValue > threshold;

// scaledValue
let scaledValue = null;
Expand Down