Remove the jsdom dependency and code we do not use

Bug: b/548453648

d3 3.4.2 declares jsdom as a production dependency, but it is needed only
by index.js, a Node-only shim that fakes a DOM so d3 can be required
outside a browser. AppSheet imports d3/d3.min.js directly and never loads
index.js, so the dependency is pure cost: pulling d3 from the public npm
registry dragged 42 packages into jeenee's production dependency closure,
and therefore into its generated OSS attribution, for code we never ship.

Delete index.js and drop the jsdom dependency. Also delete the test suite,
whose test/load.js was the only other jsdom consumer and which cannot run
without jsdom and vows anyway; the manifests and generator scripts for
package managers we do not use (Bower, Component, Composer); and the
upstream Travis config and contributing guide. The Makefile rules for the
generated bower.json and component.json and the test target go with them,
as do the test-only vows and seedrandom devDependencies. Repoint main at
d3.js, since index.js no longer exists.

Normalize the license declaration from the legacy licenses array
([{type: "BSD"}]) to the SPDX form "license": "BSD-3-Clause". This is a
restatement rather than a change of terms: the LICENSE file is the
three-clause BSD text, including the clause forbidding use of Michael
Bostock's name to endorse derived products. license-checker cannot
interpret the legacy array and flagged the package for manual review; with
the SPDX field it resolves automatically.

d3.js, d3.min.js, src, the remaining build chain and lib are kept. lib
holds the license files for code d3 derives from, including rhill-voronoi,
penner, protovis and polymaps, so removing it would strip provenance for
code we do ship. src and the Makefile are what would be needed to rebuild
d3.js and d3.min.js if the library ever has to be patched.

d3.min.js is unchanged: md5 33a4640a0fc7e2a0ab47ec00b506f4c7, identical to
the copy checked into jeenee today and to the npm registry tarball.
Verified by packing this repo and installing the tarball into a clean
project: npm reports "added 1 package", no jsdom is installed, and
license-checker reports d3@3.4.2 as BSD-3-Clause.

Change-Id: Ibca2c3a675ca81fa42ce8586c87e3fbd8b351d71
Reviewed-on: https://gnocchi-internal-review.git.corp.google.com/c/third_party/d3/+/318724
Autosubmit: Hughes Hilton <hugheshilton@google.com>
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
Reviewed-by: Trevor Ryland <tryland@google.com>
219 files changed
tree: 156b59375099c81c9e3aef1156b50ba788029577
  1. bin/
  2. lib/
  3. src/
  4. .gitignore
  5. .npmignore
  6. d3.js
  7. d3.min.js
  8. LICENSE
  9. Makefile
  10. METADATA
  11. OWNERS
  12. package.json
  13. README.md
README.md

Data-Driven Documents

D3.js is a JavaScript library for manipulating documents based on data. D3 helps you bring data to life using HTML, SVG and CSS. D3’s emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework, combining powerful visualization components and a data-driven approach to DOM manipulation.

Want to learn more? See the wiki.

For examples, see the gallery and mbostock’s bl.ocks.