Comparing version 0.40.1 to 0.40.2
{ | ||
"name": "vizabi", | ||
"version": "0.40.1", | ||
"version": "0.40.2", | ||
"description": "Vizabi Framework, Interactive charts and visualization tools animated through time", | ||
@@ -5,0 +5,0 @@ "main": "build/vizabi.js", |
@@ -5,7 +5,37 @@ import interpolator from "vizabi-interpolators/interpolators"; | ||
export const d3json = function(path, callback) { | ||
d3.json(path, callback); | ||
if (window.fetch && navigator.userAgent.toLowerCase().indexOf(" electron/") === -1) { | ||
// Chrome Canary issue fix: avoid XMLHttpRequest | ||
// we should use fetch as often as possible | ||
fetch(path) | ||
.then(response => { | ||
if (response.ok) return response.json(); | ||
callback(new Error); | ||
}) | ||
.then(jsonData => { | ||
callback(null, jsonData); | ||
}) | ||
.catch(error => callback(error)); | ||
} else { | ||
// we should use d3/XMLHttpRequest functionality for old browsers | ||
d3.json(path, callback); | ||
} | ||
}; | ||
export const d3text = function(path, callback) { | ||
d3.text(path, callback); | ||
if (window.fetch && navigator.userAgent.toLowerCase().indexOf(" electron/") === -1) { | ||
// Chrome Canary issue fix: avoid XMLHttpRequest | ||
// we should use fetch as often as possible | ||
fetch(path) | ||
.then(response => { | ||
if (response.ok) return response.text(); | ||
callback(new Error); | ||
}) | ||
.then(data => { | ||
callback(null, data); | ||
}) | ||
.catch(error => callback(error)); | ||
} else { | ||
// we should use d3/XMLHttpRequest functionality for old browsers | ||
d3.text(path, callback); | ||
} | ||
}; | ||
@@ -12,0 +42,0 @@ |
@@ -265,3 +265,3 @@ import * as utils from "base/utils"; | ||
} else { | ||
colorOptionsArray = Object.keys(this.colorModel.getPalette()).map(value => { | ||
colorOptionsArray = cScale.domain().map(value => { | ||
const result = {}; | ||
@@ -268,0 +268,0 @@ result[this.which] = value; |
@@ -351,4 +351,2 @@ import * as utils from "base/utils"; | ||
range = domain.map((d, i) => paletteObject[d] || defaultPalette[defaultPaletteKeys[i % defaultPaletteKeys.length]]); | ||
//domain.push("_default"); | ||
//range.push(paletteObject["_default"]); | ||
} | ||
@@ -358,3 +356,4 @@ | ||
.domain(domain) | ||
.range(range); | ||
.range(range) | ||
.unknown(paletteObject["_default"]); | ||
} | ||
@@ -361,0 +360,0 @@ |
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
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 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
Network access
Supply chain riskThis module accesses the network.
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
7831905
58201
10