-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
mbostock edited this page May 29, 2011
·
151 revisions
Everything in D3 is scoped under the d3 namespace. D3 is broken up into several modules so that you can pick and choose which features you need and minimize the weight. The default build of d3.js includes the core, scale and svg modules, at about 12KB uglified and gzipped. However, you can edit the Makefile to produce a custom build that suites your needs. D3 does not introduce anything else in the global namespace. However, for nonstandard browsers we do register polyfills for Date.now and Object.create.
D3 uses semantic versioning. You can find the current version of D3 as d3.version.
- d3.select - select an element from the current document.
- d3.selectAll - select multiple elements from the current document.
- selection.attr - get or set attribute values.
- selection.classed - add or remove CSS classes.
- selection.style - get or set style properties.
- selection.property - get or set raw properties.
- selection.text - get or set text content.
- selection.html - get or set inner HTML content.
- selection.append - create and append new elements.
- selection.insert - create and insert new elements before existing elements.
- selection.remove - remove elements from the document.
- selection.data - bind data to elements, and compute a relational join.
- selection.enter - returns placeholders for missing elements.
- selection.exit - returns elements that are no longer needed.
- selection.filter - filter a selection based on data.
- selection.map - modify the data associated with the selected elements.
- selection.sort - sort elements in the document based on data.
- selection.on - add or remove event listeners for interaction.
- selection.transition - start a transition on the selected elements.
- selection.each - call a function for each selected element.
- selection.call - call a function passing in the current selection.
- selection.empty - returns true if the selection is empty.
- selection.node - access the first node in a selection.
- selection.select - subselect a descendant element for each selected element.
- selection.selectAll - subselect multiple descendants for each selected element.
- d3.ns - access or extend known XML namespaces.
- d3.functor - create a function that returns a constant.
- d3.transition - start an animated transition.
- transition.delay - specify per-element delay in milliseconds.
- transition.duration - specify per-element duration in milliseconds.
- transition.ease - specify transition easing function.
- transition.attr - smoothly transition to the new attribute value.
- transition.attrTween - smoothly transition between two attribute values.
- transition.style - smoothly transition to the new style property value.
- transition.styleTween - smoothly transition between two style property values.
- transition.text - set the text content when the transition starts.
- transition.select - start a transition on a descendant element for each selected element.
- transition.selectAll - start a transition on multiple descendants for each selected element.
- transition.remove - remove selected elements at the end of a transition.
- transition.each - add a listener for transition end events.
- transition.call - call a function passing in the current transition.
- d3.ease - customize transition timing.
- d3.timer - start a custom animation timer.
- d3.timer.flush - immediately execute any zero-delay timers.
- d3.interpolate - interpolate two values.
- d3.interpolateNumber - interpolate two numbers.
- d3.interpolateRound - interpolate two integers.
- d3.interpolateString - interpolate two strings.
- d3.interpolateRgb - interpolate two RGB colors.
- d3.interpolateHsl - interpolate two HSL colors.
- d3.interpolateArray - interpolate two arrays of values.
- d3.interpolateObject - interpolate two arbitrary objects.
- d3.dispatch - create a custom event dispatcher.
- d3.event - access the current user event for interaction.
- d3.ascending - compare two values for sorting.
- d3.descending - compare two values for sorting.
- d3.min - find the minimum value in an array.
- d3.max - find the maximum value in an array.
- d3.keys - list the keys of an associative array.
- d3.values - list the values of an associated array.
- d3.entries - list the key-value entries of an associative array.
- d3.split - split an array into multiple arrays.
- d3.merge - merge multiple arrays into one array.
- d3.range - generate a range of numeric values.
- d3.nest - group array elements hierarchically.
-
d3.xhr - load a resource using
XMLHttpRequest. - d3.text - load a text file.
- d3.json - load a JSON blob.
- d3.html - load an HTML document fragment.
- d3.xml - load an XML document fragment.
Also see the csv module.
- d3.format - format a number as a string.
- d3.rgb - specify a color in RGB space.
- rgb.brighter - increase RGB channels by some exponential factor (gamma).
- rgb.darker - decrease RGB channels by some exponential factor (gamma).
- rgb.hsl - convert from RGB to HSL.
- d3.hsl - specify a color in HSL space.
- hsl.brighter - increase lightness by some exponential factor (gamma).
- hsl.darker - decrease lightness by some exponential factor (gamma).
- hsl.rgb - convert from HSL to RGB.
- d3.chart.box
- box.width
- box.height
- box.tickFormat
- box.duration
- box.domain
- box.value
- box.whiskers
- box.quartiles
- d3.chart.bullet
- bullet.orient
- bullet.ranges
- bullet.markers
- bullet.measures
- bullet.width
- bullet.height
- bullet.tickFormat
- bullet.duration
- d3.geo.mercator
- mercator.scale
- mercator.translate
- d3.geo.albers
- albers.origin
- albers.parallels
- albers.scale
- albers.translate
- d3.geo.albersUsa
- albersUsa.scale
- albersUsa.translate
- d3.layout.force
- force.on
- force.nodes
- force.links
- force.size
- force.distance
- force.drag
- force.charge
- force.gravity
- force.theta
- force.start
- force.resume
- force.stop
- force.drag
- d3.layout.treemap
- treemap.sort
- treemap.children
- treemap.value
- treemap.size
- treemap.round
- treemap.sticky
- d3.layout.chord
- chord.matrix
- chord.padding
- chord.sortGroups
- chord.sortSubgroups
- chord.sortChords
- chord.chords
- chord.groups
- d3.scale.linear
- linear.invert
- linear.domain
- linear.range
- linear.rangeRound
- linear.interpolate
- linear.clamp
- linear.ticks
- linear.tickFormat
- d3.scale.sqrt
- d3.scale.pow
- pow.invert
- pow.domain
- pow.range
- pow.rangeRound
- pow.interpolate
- pow.clamp
- pow.ticks
- pow.tickFormat
- pow.exponent
- d3.scale.log
- log.invert
- log.domain
- log.range
- log.rangeRound
- log.interpolate
- log.clamp
- log.ticks
- log.tickFormat