JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3457
  • Score
    100M100P100Q113138F
  • License BSD-3-Clause

3D projection

Package Exports

  • d3-3d

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (d3-3d) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

d3-3d

d3-3d is meant for 3d visualizations. d3-3d allows the projection of 3d data onto the screen in the webbrowser. It is specially designed to work with d3.js. It adds 3d transformations to SVG.

3D Surfaceplot created with d3-3d

See more examples

Installing

If you use npm, npm install d3-3d. You can also download the latest release. Otherwise use unpkg to get the latest release. For example:

<script src="https://unpkg.com/d3-3d/build/d3-3d.js"></script>

For a specific version:

<script src="https://unpkg.com/d3-3d@version/build/d3-3d.js"></script>

For the minified version:

<script src="https://unpkg.com/d3-3d@version/build/d3-3d.min.js"></script>

API Reference

Overview

d3-3d uses the browser's coordinate system. It will calculate the centroid and the orientation of your polygons for you. Due to the fact that SVG isn't very 3d compatible d3-3d has also a special draw method.

Shapes

  • POINT
  • LINE
  • LINE_STRIP
  • PLANE
  • TRIANGLE
  • CUBE
  • PYRAMID

# _3d.shape(shape) <>

Sets the shape to shape. If shape is not specified the current shape will be returned.

var triangles3D = d3._3d().shape('TRIANGLE');