Richardsl / heatmap-calendar-obsidian

An Obsidian plugin for displaying data in a calendar similar to the github activity calendar
Apache License 2.0
614 stars 102 forks source link

Support for binary/boolean boxes? #91

Open onejgordon opened 1 year ago

onejgordon commented 1 year ago

I'm trying to visualize binary data based on the completed status of tasks, in which each box is either gray (no matching task present on that day, or matching task but not completed), or colored (matching completed task on day). None of the intensity and intensity range configurations I've tried so far give me the effect sought.

I've tried:

defaultEntryIntensity: 1,  
intensityScaleStart: 1,   
intensityScaleEnd: 100,

With entry intensity in {1, 100}.

defaultEntryIntensity: 0,  
intensityScaleStart: 0,   
intensityScaleEnd: 100,

With entry intensity in {0, 100}.

defaultEntryIntensity: 0,  
intensityScaleStart: 0,   
intensityScaleEnd: 1,

With entry intensity in {0, 1}.

These result in 3 intensity levels visible in the grid, where missing, not completed, and completed appear differently. I expected defaultEntryIntensity to govern the color for missing entries, but this doesn't seem to be the case.

I assume I'm missing a simpler configuration that achieves this.

GoogilyBoogily commented 6 months ago

Hey @onejgordon

I was able to get it working when I manually defined a color array in the calendarData parameter. Here's my code:

const calendarData = {
    colors: {
        completedOrNot: ["#ff0000", "#00ff00"]
    },
    defaultEntryIntensity: 0,
    intensityScaleStart: 0,
    intensityScaleEnd: 1,
    entries: []
};