canvas-heatmap
Advanced tools
Comparing version 1.2.17 to 1.2.18
{ | ||
"name": "canvas-heatmap", | ||
"version": "1.2.17", | ||
"version": "1.2.18", | ||
"description": "Interactive heatmap, capable of displaying 1,000,000+ data points using canvas and d3. ", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -14,2 +14,3 @@ import { | ||
zoom as d3zoom, | ||
timeFormatDefaultLocale, | ||
} from "d3"; | ||
@@ -59,2 +60,4 @@ import { contours } from "d3-contour"; | ||
if ("language" in options) setLanguage(options.language); | ||
var xAxis = addXAxis(svg, xDomain, options); | ||
@@ -166,2 +169,60 @@ var yAxis = addYAxis(svg, yDomain, options); | ||
const setLanguage = (name) => { | ||
var lang = { | ||
DE: { | ||
decimal: ",", | ||
thousands: ".", | ||
grouping: [3], | ||
currency: ["€", ""], | ||
dateTime: "%a %b %e %X %Y", | ||
date: "%d.%m.%Y", | ||
time: "%H:%M:%S", | ||
periods: ["AM", "PM"], | ||
days: [ | ||
"Sonntag", | ||
"Montag", | ||
"Dienstag", | ||
"Mittwoch", | ||
"Donnerstag", | ||
"Freitag", | ||
"Samstag", | ||
], | ||
shortDays: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], | ||
months: [ | ||
"Januar", | ||
"Februar", | ||
"März", | ||
"April", | ||
"Mai", | ||
"Juni", | ||
"Juli", | ||
"August", | ||
"September", | ||
"Oktober", | ||
"November", | ||
"Dezember", | ||
], | ||
shortMonths: [ | ||
"Jan", | ||
"Feb", | ||
"Mär", | ||
"Apr", | ||
"Mai", | ||
"Jun", | ||
"Jul", | ||
"Aug", | ||
"Sep", | ||
"Okt", | ||
"Nov", | ||
"Dez", | ||
], | ||
}, | ||
}; | ||
if (name in lang) { | ||
timeFormatDefaultLocale(lang[name]); | ||
} else { | ||
console.error("Language: "+language+" not recognised.") | ||
} | ||
}; | ||
const replaceNull = (data, zMax) => { | ||
@@ -168,0 +229,0 @@ var nullData = JSON.parse(JSON.stringify(data)); |
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
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
913204
7690