From 1d5951b937586030b8749a38f58eb9d3c43cdbd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Tue, 2 Jun 2020 15:50:04 +0200 Subject: [PATCH 1/3] use d3-selection 1 - 2, 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.) --- package.json | 2 +- src/axis.js | 4 +--- yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 8c6647c..4f08408 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "sideEffects": false, "devDependencies": { "d3-scale": "2 - 3", - "d3-selection": "^1.1.0", + "d3-selection": "^1.1.0 - 2", "eslint": "6", "jsdom": "15", "rollup": "1", diff --git a/src/axis.js b/src/axis.js index 3c70e42..bc65f1b 100644 --- a/src/axis.js +++ b/src/axis.js @@ -16,9 +16,7 @@ function translateY(y) { } function number(scale) { - return function(d) { - return +scale(d); - }; + return d => +scale(d); } function center(scale) { diff --git a/yarn.lock b/yarn.lock index d65308b..efdbd77 100644 --- a/yarn.lock +++ b/yarn.lock @@ -293,10 +293,10 @@ d3-interpolate@1: d3-time "1" d3-time-format "2" -d3-selection@^1.1.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/d3-selection/-/d3-selection-1.4.0.tgz#ab9ac1e664cf967ebf1b479cc07e28ce9908c474" - integrity sha512-EYVwBxQGEjLCKF2pJ4+yrErskDnz5v403qvAid96cNdCMr8rmCYfY5RGzWz24mdIbxmDf6/4EAH+K9xperD5jg== +"d3-selection@^1.1.0 - 2": + version "2.0.0-rc.2" + resolved "https://registry.yarnpkg.com/d3-selection/-/d3-selection-2.0.0-rc.2.tgz#530fffde9fc6007d90c79d39bc4b2777e7288f6e" + integrity sha512-3sXAgCMsIi6zmZFGwgI2fFi9f99vzBRUKZoKOJq8yWDDAci00QgJQfe7xW0VqUW2hItUvGVl61M8WY4Cxg8soQ== d3-time-format@2: version "2.1.3" From ae3ffbc12af8173a338eb0d764c76dfff2f059d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Tue, 23 Jun 2020 15:58:13 +0200 Subject: [PATCH 2/3] d3js link --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3926268..2ad92c0 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,10 @@ The axis component renders human-readable reference marks for [scales](https://g ## Installing -If you use NPM, `npm install d3-axis`. Otherwise, download the [latest release](https://github.com/d3/d3-axis/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-axis.v1.min.js) or as part of [D3](https://github.com/d3/d3). (To be useful, you’ll also want to use [d3-scale](https://github.com/d3/d3-scale) and [d3-selection](https://github.com/d3/d3-selection), but these are soft dependencies.) AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported: +If you use NPM, `npm install d3-axis`. Otherwise, download the [latest release](https://github.com/d3/d3-axis/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-axis.v2.min.js) or as part of [D3](https://github.com/d3/d3). (To be useful, you’ll also want to use [d3-scale](https://github.com/d3/d3-scale) and [d3-selection](https://github.com/d3/d3-selection), but these are soft dependencies.) AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported: ```html - +