From 6e96e5800d0f317c8c5f6d7419e9d343fa60ce3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 5 Jun 2020 16:19:46 +0200 Subject: [PATCH 1/4] deliberate ES6 syntax (rationale: don't let people install @2 in a build system that will not alert them that we have moved to ES6, only to cause trouble with a later release.) remove unused src/scheme.js --- src/ramp.js | 4 +--- src/scheme.js | 11 ----------- 2 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 src/scheme.js diff --git a/src/ramp.js b/src/ramp.js index 766c245..14f4050 100644 --- a/src/ramp.js +++ b/src/ramp.js @@ -1,5 +1,3 @@ import {interpolateRgbBasis} from "d3-interpolate"; -export default function(scheme) { - return interpolateRgbBasis(scheme[scheme.length - 1]); -} +export default scheme => interpolateRgbBasis(scheme[scheme.length - 1]); diff --git a/src/scheme.js b/src/scheme.js deleted file mode 100644 index 49a7208..0000000 --- a/src/scheme.js +++ /dev/null @@ -1,11 +0,0 @@ -export default function(ranges) { - ranges = ranges.map(function(colors) { - return colors.match(/.{6}/g).map(function(x) { - return "#" + x; - }); - }); - var n0 = ranges[0].length; - return function(n) { - return ranges[n - n0]; - }; -} From 1ae2a28c7391b1f6d1bf4953043d0ab51e57e3d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 10 Jul 2020 21:45:56 +0200 Subject: [PATCH 2/4] links to @6 versions --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1fd936e..358384a 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,9 @@ var piyg = d3.scaleSequential(d3.interpolatePiYG); If you use NPM, `npm install d3-scale-chromatic`. Otherwise, download the [latest release](https://github.com/d3/d3-scale-chromatic/releases/latest) or load directly from [d3js.org](https://d3js.org) as a [standalone library](https://d3js.org/d3-scale-chromatic.v1.min.js). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported: ```html - - - + + + +