@vizabi/core
Advanced tools
Comparing version 1.28.4 to 1.28.5
@@ -1,2 +0,2 @@ | ||
// http://vizabi.org v1.28.4 Copyright 2023 Jasper Heeffer and others at Gapminder Foundation | ||
// http://vizabi.org v1.28.5 Copyright 2023 Jasper Heeffer and others at Gapminder Foundation | ||
(function (global, factory) { | ||
@@ -3,0 +3,0 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('mobx'), require('d3')) : |
{ | ||
"name": "@vizabi/core", | ||
"version": "1.28.4", | ||
"version": "1.28.5", | ||
"description": "Vizabi core (data layer)", | ||
@@ -5,0 +5,0 @@ "main": "dist/Vizabi.js", |
@@ -109,14 +109,16 @@ import { action } from 'mobx'; | ||
}, | ||
// args: {colorID, shadeID} | ||
getColorShade(args) { | ||
if (!args) return utils.warn("getColorShade() is missing arguments"); | ||
getColorShade({colorID, shadeID = "shade"}) { | ||
if (!colorID) | ||
return false; | ||
// if colorID is not given or not found in the palette, replace it with default color | ||
//if (!args.colorID || !this.defaultPalette[args.colorID]) args.colorID = "_default"; | ||
const color = this.palette[args.colorID]; | ||
const color = this.palette[colorID]; | ||
//a specific shade is available | ||
if (Array.isArray(color)) | ||
return color[this.shades[shadeID]]; | ||
// if the resolved colr value is not an array (has only one shade) -- return it | ||
if (!Array.isArray(color)) return args.shadeID == "shade" ? d3_rgb(palette[args.colorID] || this.parent.d3Scale(args.colorID)).darker(0.5).toString() : color; | ||
return color[this.shades[args.shadeID]]; | ||
return shadeID === "shade" | ||
? d3_rgb(palette[colorID] || this.parent.d3Scale(colorID)).darker(0.5).toString() | ||
: color; | ||
}, | ||
@@ -123,0 +125,0 @@ getColor(key, palette = this.palette) { |
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
13596
1310462