JSPM

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

Displays automatic reference lines for scales.

Package Exports

  • d3-axis

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-axis) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

d3-axis

Installing

If you use NPM, npm install d3-axis. Otherwise, download the latest release. The released bundle supports AMD, CommonJS, and vanilla environments. Create a custom build using Rollup or your preferred bundler. You can also load directly from d3js.org:

<script src="https://d3js.org/d3-array.v0.7.min.js"></script>
<script src="https://d3js.org/d3-collection.v0.1.min.js"></script>
<script src="https://d3js.org/d3-color.v0.3.min.js"></script>
<script src="https://d3js.org/d3-format.v0.5.min.js"></script>
<script src="https://d3js.org/d3-interpolate.v0.4.min.js"></script>
<script src="https://d3js.org/d3-time.v0.2.min.js"></script>
<script src="https://d3js.org/d3-time-format.v0.3.min.js"></script>
<script src="https://d3js.org/d3-scale.v0.5.min.js"></script>
<script src="https://d3js.org/d3-selection.v0.5.min.js"></script>
<script src="https://d3js.org/d3-axis.v0.0.min.js"></script>

(If you’re not using time scales, you can omit d3-time and d3-time-format.) In a vanilla environment, a d3_axis global is exported. Try d3-axis in your browser.

API Reference

# d3.axis()

Constructs a new axis generator with a default linear scale, bottom orientation, empty tick arguments, a tick size of 6 and tick padding of 3.

# axis(selection)

# axis.scale([scale])

# axis.orient([orient])

# axis.ticks(arguments…)

A convenience function for setting the tick arguments. For example, this:

axis.ticks(10);

Is equivalent to:

axis.tickArguments([10]);

# axis.tickArguments([arguments])

… Most commonly, a count and a format specifier.

# axis.tickValues([values])

# axis.tickFormat([format])

# axis.tickSize([size])

# axis.tickSizeInner([size])

# axis.tickSizeOuter([size])

# axis.tickPadding([padding])

Axis Orientations

For use with axis.orient.

# d3.axisOrientTop

# d3.axisOrientRight

# d3.axisOrientBottom

# d3.axisOrientLeft