From 9e6926df33ffee18eb8eecdf787c6c1558379043 Mon Sep 17 00:00:00 2001 From: Yun Xing Date: Sun, 9 Dec 2018 15:08:40 -0500 Subject: [PATCH 1/2] new color api --- src/choropleth/api-color.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/choropleth/api-color.js b/src/choropleth/api-color.js index 08df182..03dfa95 100644 --- a/src/choropleth/api-color.js +++ b/src/choropleth/api-color.js @@ -1,7 +1,21 @@ const apiColor = state => ({ color(colorOptions) { - state._options.color = colorOptions; - state._color = state._composers.color(colorOptions); + if (!colorOptions) { + console.warn('color opt is null, either scheme or type is required'); + return; + } else if (!colorOptions.type && !colorOptions.scheme) { + console.warn('invalid color opt, either scheme or type is required'); + return; + } + + if (colorOptions.type) { + state._options.color.type = colorOptions.type; + } + + if (colorOptions.scheme) { + state._options.color.scheme = colorOptions.scheme; + } + state._color = state._composers.color(state._options.color); const { _svg, _options, _c } = state; _svg From bc7b3fb41761b914d0156e8ce2b6c019157b40ae Mon Sep 17 00:00:00 2001 From: Yun Xing Date: Sun, 9 Dec 2018 15:09:58 -0500 Subject: [PATCH 2/2] bump to 2.0.2 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6df40e8..ef14bac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vizart-geo", - "version": "2.0.1", + "version": "2.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a705857..2563aeb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vizart-geo", - "version": "2.0.1", + "version": "2.0.2", "description": "VizArt: Geo", "main": "dist/vizart-geo.js", "module": "dist/vizart-geo.esm.js",