Skip to content

Commit

Permalink
Release 3.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Jul 22, 2015
1 parent bab4584 commit 4c973f2
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 13 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v3.5.3 [2015-07-23]

* [fix] Fix #156 Remove trailing comma in object literal
* [fix] Fix #161 `domainDynamicDimension` not working with x_week subdomain

## v3.5.2 [2015-02-05]

* [fix] Fix #74: Let `empty` target cells with no data
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"d3js",
"heat map"
],
"version": "3.5.2",
"version": "3.5.3",
"main": ["./cal-heatmap.js", "./cal-heatmap.css"],
"dependencies": {
"d3": ">= v3.0.6"
Expand Down
36 changes: 29 additions & 7 deletions cal-heatmap.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! cal-heatmap v3.5.2 (Thu Feb 05 2015 17:06:47)
/*! cal-heatmap v3.5.3 (Thu Jul 23 2015 01:27:26)
* ---------------------------------------------
* Cal-Heatmap is a javascript module to create calendar heatmap to visualize time series data
* https://github.com/kamisama/cal-heatmap
Expand Down Expand Up @@ -70,11 +70,23 @@ var CalHeatMap = function() {

maxDate: null,

// ================================================
// DATA
// ================================================

// Data source
// URL, where to fetch the original datas
data: "",

// Data type
// Default: json
dataType: this.allowedDataType[0],

// Payload sent when using POST http method
// Leave to null (default) for GET request
// Expect a string, formatted like "a=b;c=d"
dataPostPayload: null,

// Whether to consider missing date:value from the datasource
// as equal to 0, or just leave them as missing
considerMissingDataAsZero: false,
Expand Down Expand Up @@ -438,7 +450,7 @@ var CalHeatMap = function() {
case "year":
return self._domainType.week.maxItemNumber;
case "month":
return self.getWeekNumber(new Date(d.getFullYear(), d.getMonth()+1, 0)) - self.getWeekNumber(d);
return self.options.domainDynamicDimension ? self.getWeekNumber(new Date(d.getFullYear(), d.getMonth()+1, 0)) - self.getWeekNumber(d) : 5;
}
},
defaultRowNumber: 1,
Expand Down Expand Up @@ -527,7 +539,7 @@ var CalHeatMap = function() {
column: d.row,
position: {
x: d.position.y,
y: d.position.x,
y: d.position.x
},
format: d.format,
extractUnit: d.extractUnit
Expand Down Expand Up @@ -2503,18 +2515,28 @@ CalHeatMap.prototype = {
_callback({});
return true;
} else {
var url = this.parseURI(source, startDate, endDate);
var requestType = "GET";
if (self.options.dataPostPayload !== null ) {
requestType = "POST";
}
var payload = null;
if (self.options.dataPostPayload !== null) {
payload = this.parseURI(self.options.dataPostPayload, startDate, endDate);
}

switch(this.options.dataType) {
case "json":
d3.json(this.parseURI(source, startDate, endDate), _callback);
d3.json(url, _callback).send(requestType, payload);
break;
case "csv":
d3.csv(this.parseURI(source, startDate, endDate), _callback);
d3.csv(url, _callback).send(requestType, payload);
break;
case "tsv":
d3.tsv(this.parseURI(source, startDate, endDate), _callback);
d3.tsv(url, _callback).send(requestType, payload);
break;
case "txt":
d3.text(this.parseURI(source, startDate, endDate), "text/plain", _callback);
d3.text(url, "text/plain", _callback).send(requestType, payload);
break;
}
}
Expand Down
6 changes: 3 additions & 3 deletions cal-heatmap.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cal-heatmap",
"version": "3.5.2",
"version": "3.5.3",
"description": "Cal-Heatmap is a javascript module to create calendar heatmap to visualize time series data",
"keywords": [
"calendar",
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! cal-heatmap v3.5.2 (Thu Feb 05 2015 17:06:47)
/*! cal-heatmap v3.5.3 (Thu Jul 23 2015 01:27:26)
* ---------------------------------------------
* Cal-Heatmap is a javascript module to create calendar heatmap to visualize time series data
* https://github.com/kamisama/cal-heatmap
Expand Down

0 comments on commit 4c973f2

Please sign in to comment.