Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static _getBrewerConstsDict() {
let dict = this._brewerConstsDict
if (!dict) {
dict = Object.create(null)
for (const key in Chroma.brewer) {
if (key in Chroma.brewer) {
dict[key.toLowerCase()] = Chroma.brewer[key]
}
}
this._brewerConstsDict = dict
}
return dict
}
"use strict";
/**
* Color function transfer management.
* Requires chroma.js
*/
//var colormaps = function(){
var chroma = require("chroma-js");
const svgNS = "http://www.w3.org/2000/svg";
var tables = {
Default: [[0,1],[0,1],[0,1]], //[[1,1,1],[0.93,0.001,0],[0.63,0.001,0]],
OrRd: tableFromChroma(chroma.brewer.OrRd),
PuBu: tableFromChroma(chroma.brewer.PuBu),
Oranges: tableFromChroma(chroma.brewer.Oranges),
Greens: tableFromChroma(chroma.brewer.Greens),
CubeHelix: tableFromChroma(chroma.cubehelix().scale().correctLightness().colors(9)),
InvertedGrayscale: [[1,0.01,0],[1,0.01,0],[1,0.01,0]],
Identity: [[0,1],[0,1],[0,1]]
};
function tableFromChroma(chromaTable){
var rtab = [];
var gtab = [];
var btab = [];
chromaTable.forEach(function(chromaElt){
var rgb = chroma(chromaElt).get('rgb');
rtab.push(rgb[0]/255);
CoreEvaluator.getBrewerConstsDict = function () {
var dict = this._brewerConstsDict;
if (!dict) {
dict = {};
for (var key in chroma.brewer)
if (chroma.brewer.hasOwnProperty(key))
dict[key.toLowerCase()] = chroma.brewer[key];
this._brewerConstsDict = dict;
}
return dict;
};
CoreEvaluator.prototype.numbersArithmeticOp = function (node) {
BREWER[colorscaleType].map((x, i) => (
))}
"use strict";
/**
* Color function transfer management.
* Requires chroma.js
*/
//var colormaps = function(){
var chroma = require("chroma-js");
const svgNS = "http://www.w3.org/2000/svg";
var tables = {
Default: [[0,1],[0,1],[0,1]], //[[1,1,1],[0.93,0.001,0],[0.63,0.001,0]],
OrRd: tableFromChroma(chroma.brewer.OrRd),
PuBu: tableFromChroma(chroma.brewer.PuBu),
Oranges: tableFromChroma(chroma.brewer.Oranges),
Greens: tableFromChroma(chroma.brewer.Greens),
CubeHelix: tableFromChroma(chroma.cubehelix().scale().correctLightness().colors(9)),
InvertedGrayscale: [[1,0.01,0],[1,0.01,0],[1,0.01,0]],
Identity: [[0,1],[0,1],[0,1]]
};
function tableFromChroma(chromaTable){
var rtab = [];
var gtab = [];
var btab = [];
chromaTable.forEach(function(chromaElt){
var rgb = chroma(chromaElt).get('rgb');
rtab.push(rgb[0]/255);
gtab.push(rgb[1]/255);
btab.push(rgb[2]/255);
BREWER[colorscaleType].map((x, i) => (
))}
CoreEvaluator.getBrewerConstsDict = function () {
var dict = this._brewerConstsDict;
if (!dict) {
dict = {};
for (var key in chroma.brewer)
if (chroma.brewer.hasOwnProperty(key))
dict[key.toLowerCase()] = chroma.brewer[key];
this._brewerConstsDict = dict;
}
return dict;
};
CoreEvaluator.prototype.numbersArithmeticOp = function (node) {
static _getBrewerConstsDict() {
let dict = this._brewerConstsDict
if (!dict) {
dict = Object.create(null)
for (const key in Chroma.brewer) {
if (key in Chroma.brewer) {
dict[key.toLowerCase()] = Chroma.brewer[key]
}
}
this._brewerConstsDict = dict
}
return dict
}