canvas-heatmap
Advanced tools
Comparing version 1.3.2 to 1.3.3
{ | ||
"name": "canvas-heatmap", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "Interactive heatmap, capable of displaying 1,000,000+ data points using canvas and d3. ", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -9,2 +9,10 @@ import { | ||
axisLeft, | ||
timeFormat, | ||
timeSecond, | ||
timeMinute, | ||
timeHour, | ||
timeDay, | ||
timeMonth, | ||
timeYear, | ||
timeWeek, | ||
symbol, | ||
@@ -405,3 +413,6 @@ symbolTriangle, | ||
var base = ax.copy(); | ||
var axis = axisBottom(ax).ticks(5); | ||
var axis = axisBottom(ax); | ||
if (options.xTime) { | ||
axis.ticks(3).tickFormat(multiFormat); | ||
} | ||
@@ -465,3 +476,6 @@ var g = svg | ||
var base = ax.copy(); | ||
var axis = axisLeft(ax).ticks(5); | ||
var axis = axisLeft(ax); | ||
if (options.yTime) { | ||
axis.ticks(3).tickFormat(multiFormat); | ||
} | ||
@@ -617,3 +631,2 @@ var g = svg | ||
// Add axis locators | ||
@@ -699,3 +712,6 @@ var symbolGenerator = symbol().type(symbolTriangle).size(25); | ||
`<tr><td>y:</td><td>${yval} ${yu}</td></tr>` + | ||
`<tr><td>z:</td><td>${formatNumber(zval, options.decimalPlaces)} ${zu}</td></tr>` + | ||
`<tr><td>z:</td><td>${formatNumber( | ||
zval, | ||
options.decimalPlaces | ||
)} ${zu}</td></tr>` + | ||
"</tbody></table>"; | ||
@@ -1012,2 +1028,30 @@ | ||
const multiFormat = (date) => { | ||
var formatMillisecond = timeFormat(".%L"), | ||
formatSecond = timeFormat(":%S"), | ||
formatMinute = timeFormat("%H:%M"), | ||
formatHour = timeFormat("%H:%M"), | ||
formatDay = timeFormat("%a %d"), | ||
formatWeek = timeFormat("%b %d"), | ||
formatMonth = timeFormat("%B"), | ||
formatYear = timeFormat("%Y"); | ||
return ( | ||
timeSecond(date) < date | ||
? formatMillisecond | ||
: timeMinute(date) < date | ||
? formatSecond | ||
: timeHour(date) < date | ||
? formatMinute | ||
: timeDay(date) < date | ||
? formatHour | ||
: timeMonth(date) < date | ||
? timeWeek(date) < date | ||
? formatDay | ||
: formatWeek | ||
: timeYear(date) < date | ||
? formatMonth | ||
: formatYear | ||
)(date); | ||
}; | ||
export default heatmap; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
941357
8087