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

1.3.0 #15

Merged
merged 9 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all 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: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
Heat.js

[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Heat.js%2C%20a%20free%20JavaScript%heat%20map&url=https://github.com/williamtroup/Heat.js&hashtags=javascript,heat,map)
[![npm](https://img.shields.io/badge/npmjs-v1.2.1-blue)](https://www.npmjs.com/package/jheat.js)
[![nuget](https://img.shields.io/badge/nuget-v1.2.1-purple)](https://www.nuget.org/packages/jHeat.js/)
[![npm](https://img.shields.io/badge/npmjs-v1.3.0-blue)](https://www.npmjs.com/package/jheat.js)
[![nuget](https://img.shields.io/badge/nuget-v1.3.0-purple)](https://www.nuget.org/packages/jHeat.js/)
[![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/Heat.js/blob/main/LICENSE.txt)
[![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/Heat.js/discussions)
[![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-yellow)](https://william-troup.com/)
</h1>

> <p align="center">🌞 A lightweight JavaScript library that generates customizable heat maps to visualize date-based activity and trends.</p>
> <p align="center">v1.2.1</p>
> <p align="center">v1.3.0</p>
<br />

![Heat.js](docs/images/main.png)
Expand Down
6 changes: 3 additions & 3 deletions README_NUGET.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Heat.js v1.2.1
# Heat.js v1.3.0

[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Heat.js%2C%20a%20free%20JavaScript%heat%20map&url=https://github.com/williamtroup/Heat.js&hashtags=javascript,heat,map)
[![npm](https://img.shields.io/badge/npmjs-v1.2.1-blue)](https://www.npmjs.com/package/jheat.js)
[![nuget](https://img.shields.io/badge/nuget-v1.2.1-purple)](https://www.nuget.org/packages/jHeat.js/)
[![npm](https://img.shields.io/badge/npmjs-v1.3.0-blue)](https://www.npmjs.com/package/jheat.js)
[![nuget](https://img.shields.io/badge/nuget-v1.3.0-purple)](https://www.nuget.org/packages/jHeat.js/)
[![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/Heat.js/blob/main/LICENSE.txt)
[![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/Heat.js/discussions)
[![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-yellow)](https://william-troup.com/)
Expand Down
33 changes: 27 additions & 6 deletions dist/heat.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Heat.js v1.2.1 | (c) Bunoon 2024 | MIT License */
/*! Heat.js v1.3.0 | (c) Bunoon 2024 | MIT License */
(function() {
function render() {
var tagTypes = _configuration.domElementTypes;
Expand Down Expand Up @@ -177,11 +177,20 @@
var date = new Date(year, month, actualDay);
var dateCount = _elements_DateCounts[bindingOptions.element.id].type[bindingOptions.currentView.type][toStorageDate(date)];
dateCount = isDefinedNumber(dateCount) ? dateCount : 0;
day.title = getCustomFormattedDateText(bindingOptions.dayToolTipText, date);
if (isDefinedFunction(bindingOptions.onDayToolTipRender)) {
day.title = fireCustomTrigger(bindingOptions.onDayToolTipRender, date, dateCount);
} else {
day.title = getCustomFormattedDateText(bindingOptions.dayToolTipText, date);
}
if (bindingOptions.showDayNumbers && dateCount > 0) {
day.innerHTML = dateCount.toString();
}
if (isDefinedFunction(bindingOptions.onDayClick)) {
day.onclick = function() {
fireCustomTrigger(bindingOptions.onDayClick, date, dateCount);
};
} else {
day.className += _string.space + "no-click";
}
var mapRangeColorsLength = bindingOptions.mapRangeColors.length;
var useMapRangeColor = null;
Expand Down Expand Up @@ -384,12 +393,18 @@
options.placeMonthNamesOnTheBottom = getDefaultBoolean(options.placeMonthNamesOnTheBottom, false);
options.exportOnlyYearBeingViewed = getDefaultBoolean(options.exportOnlyYearBeingViewed, true);
options.year = getDefaultNumber(options.year, (new Date()).getFullYear());
options.showDayNumbers = getDefaultBoolean(options.showDayNumbers, false);
if (isInvalidOptionArray(options.monthsToShow)) {
options.monthsToShow = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
}
if (isInvalidOptionArray(options.daysToShow)) {
options.daysToShow = [1, 2, 3, 4, 5, 6, 7];
}
options = buildAttributeOptionMapRanges(options);
options = buildAttributeOptionStrings(options);
return buildAttributeOptionCustomTriggers(options);
}
function buildAttributeOptionMapRanges(options) {
options.mapRangeColors = getDefaultArray(options.mapRangeColors, [{minimum:10, cssClassName:"day-color-1", tooltipText:"Day Color 1"}, {minimum:15, cssClassName:"day-color-2", tooltipText:"Day Color 2"}, {minimum:20, cssClassName:"day-color-3", tooltipText:"Day Color 3"}, {minimum:25, cssClassName:"day-color-4", tooltipText:"Day Color 4"}]);
var mapRangeColorsLength = options.mapRangeColors.length;
var mapRangeColorsIndex = 0;
Expand All @@ -398,8 +413,7 @@
options.mapRangeColors[mapRangeColorsIndex].id = newGuid();
}
}
options = buildAttributeOptionStrings(options);
return buildAttributeOptionCustomTriggers(options);
return options;
}
function buildAttributeOptionStrings(options) {
options.titleText = getDefaultString(options.titleText, "Heat.js");
Expand All @@ -417,6 +431,7 @@
options.onExport = getDefaultFunction(options.onExport, null);
options.onSetYear = getDefaultFunction(options.onSetYear, null);
options.onTypeSwitch = getDefaultFunction(options.onTypeSwitch, null);
options.onDayToolTipRender = getDefaultFunction(options.onDayToolTipRender, null);
return options;
}
function getTotalDaysInMonth(year, month) {
Expand Down Expand Up @@ -506,9 +521,11 @@
return value;
}
function fireCustomTrigger(triggerFunction) {
var result = null;
if (isDefinedFunction(triggerFunction)) {
triggerFunction.apply(null, [].slice.call(arguments, 1));
result = triggerFunction.apply(null, [].slice.call(arguments, 1));
}
return result;
}
function getDefaultString(value, defaultValue) {
return isDefinedString(value) ? value : defaultValue;
Expand Down Expand Up @@ -702,6 +719,10 @@
}
return result;
};
this.renderAll = function() {
render();
return this;
};
this.destroyAll = function() {
var elementId;
for (elementId in _elements_DateCounts) {
Expand Down Expand Up @@ -731,7 +752,7 @@
return this;
};
this.getVersion = function() {
return "1.2.1";
return "1.3.0";
};
(function(documentObject, windowObject) {
_parameter_Document = documentObject;
Expand Down
48 changes: 31 additions & 17 deletions dist/heat.js.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Heat.js Library v1.2.1
* Heat.js Library v1.3.0
*
* Copyright 2024 Bunoon
* Released under the MIT License
Expand All @@ -15,15 +15,20 @@
--heat-js-day-background-color-hover: var(--heat-js-container-border-color);
--heat-js-day-spacing: 6.3px;
--heat-js-day-opacity-hover: 0.7;
--heat-js-day-opacity-active: 0.5;
--heat-js-day-size: 1.1rem;
--heat-js-day-color-1-background-color: rgba( 57, 211, 83, 0.25 );
--heat-js-day-color-1-border-color: rgba( 57, 211, 83, 0.15 );
--heat-js-day-color-1-text-color: var(--heat-js-color-white);
--heat-js-day-color-2-background-color: rgba( 57, 211, 83, 0.50 );
--heat-js-day-color-2-border-color: rgba( 57, 211, 83, 0.25 );
--heat-js-day-color-2-text-color: var(--heat-js-color-white);
--heat-js-day-color-3-background-color: rgba( 57, 211, 83, 0.75 );
--heat-js-day-color-3-border-color: rgba( 57, 211, 83, 0.50 );
--heat-js-day-color-3-text-color: var(--heat-js-color-white);
--heat-js-day-color-4-background-color: rgba( 57, 211, 83, 1 );
--heat-js-day-color-4-border-color: rgba( 57, 211, 83, 0.75 );
--heat-js-day-color-4-text-color: var(--heat-js-color-black);
--heat-js-button-background-color: var(--heat-js-day-background-color);
--heat-js-button-border-color: var(--heat-js-container-border-color);
--heat-js-button-text-color: var(--heat-js-color-white);
Expand Down Expand Up @@ -66,6 +71,9 @@ div.heat-js {
max-width: 700px;
margin: 0 !important;
}
div.heat-js div.no-click {
pointer-events: none !important;
}
div.heat-js * {
box-sizing: border-box;
line-height: normal;
Expand Down Expand Up @@ -198,18 +206,23 @@ div.heat-js div.map-contents div.map div.months div.month div.day-columns {
}
div.heat-js div.map-contents div.map div.months div.month div.day-columns div.day-column div.day,
div.heat-js div.map-contents div.map div.months div.month div.day-columns div.day-column div.day-disabled {
display: flex;
border-radius: var(--heat-js-border-radius-day);
width: var(--heat-js-day-size);
height: var(--heat-js-day-size);
margin-right: var(--heat-js-day-spacing);
margin-bottom: var(--heat-js-day-spacing);
font-size: 0.6rem;
justify-content: center;
align-items: center;
overflow: hidden;
}
div.heat-js div.map-contents div.map div.months div.month div.day-columns div.day-column div.day:last-child,
div.heat-js div.map-contents div.map div.months div.month div.day-columns div.day-column div.day-disabled:last-child {
margin-bottom: 0;
}
div.heat-js div.map-contents div.map div.months div.month div.day-columns div.day-column div.day {
pointer-events: all !important;
pointer-events: all;
background-color: var(--heat-js-day-background-color);
border: var(--heat-js-border-size) solid var(--heat-js-day-border-color);
transition: var(--heat-js-transition);
Expand Down Expand Up @@ -291,9 +304,6 @@ div.heat-js div.guide div.map-toggles {
justify-content: right;
}
}
div.heat-js div.guide div.map-toggles div.no-click {
pointer-events: none;
}
div.heat-js div.guide div.map-toggles div.less-text,
div.heat-js div.guide div.map-toggles div.more-text {
display: inline-block;
Expand Down Expand Up @@ -340,31 +350,35 @@ div.heat-js div.guide div.map-toggles div.days div.day:last-child {
Heat.js - Colors
-------------------------------------------------------------------------
*/
div.heat-js div.day-color-1:active,
div.heat-js div.day-color-2:active,
div.heat-js div.day-color-3:active,
div.heat-js div.day-color-4:active {
opacity: var(--heat-js-day-opacity-active) !important;
}
div.heat-js div.day-color-1:hover,
div.heat-js div.day-color-2:hover,
div.heat-js div.day-color-3:hover,
div.heat-js div.day-color-4:hover {
opacity: var(--heat-js-day-opacity-hover);
}
div.heat-js div.day-color-1 {
background-color: var(--heat-js-day-color-1-background-color) !important;
border: var(--heat-js-border-size-day) solid var(--heat-js-day-color-1-border-color) !important;
}
div.heat-js div.day-color-1:hover {
opacity: var(--heat-js-day-opacity-hover);
color: var(--heat-js-day-color-1-text-color);
}
div.heat-js div.day-color-2 {
background-color: var(--heat-js-day-color-2-background-color) !important;
border: var(--heat-js-border-size-day) solid var(--heat-js-day-color-2-border-color) !important;
}
div.heat-js div.day-color-2:hover {
opacity: var(--heat-js-day-opacity-hover);
color: var(--heat-js-day-color-2-text-color);
}
div.heat-js div.day-color-3 {
background-color: var(--heat-js-day-color-3-background-color) !important;
border: var(--heat-js-border-size-day) solid var(--heat-js-day-color-3-border-color) !important;
}
div.heat-js div.day-color-3:hover {
opacity: var(--heat-js-day-opacity-hover);
color: var(--heat-js-day-color-3-text-color);
}
div.heat-js div.day-color-4 {
background-color: var(--heat-js-day-color-4-background-color) !important;
border: var(--heat-js-border-size-day) solid var(--heat-js-day-color-4-border-color) !important;
}
div.heat-js div.day-color-4:hover {
opacity: var(--heat-js-day-opacity-hover);
color: var(--heat-js-day-color-4-text-color);
}/*# sourceMappingURL=heat.js.css.map */
2 changes: 1 addition & 1 deletion dist/heat.js.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading