Giter Club home page Giter Club logo

gwt-d3's Introduction

#gwt-d3: the GWT wrapper around d3.js

Travis CI - Build status Javadocs

This library provides access to the d3.js API to the Java and GWT community. It allows GWT developers to use d3.js library in their project.

Goals of the library:

  • provide access to relevant API of d3.js API
  • enrich the API to ease Java programming style of d3 (turns JS array into List, string constants to Enum, ...)
  • make a bridge between GWT Widget API and d3

Have a look at the demo.

 


 

##Getting started

1. Configure a project

Using Maven

add the gwt-d3-api module to your pom.xml:

<dependencies>
  ...
  <dependency>
    <groupId>com.github.gwtd3</groupId>
    <artifactId>gwt-d3-api</artifactId>
    <version>1.3.0</version>
    <scope>provided</scope>
  </dependency>
  ...

Note: these JARs don't contain any server-side code, so you don't need to package them into your webapp.

Without Maven

Download gwt-d3-js-3.5.11.jar, gwt-d3-api-1.3.0.jar. Add the JARs to the project classpath.

Note: these JARs don't contain any server-side code, so you don't need to package them into your webapp.

2. Add the gwt D3 module inheritance in your gwt module file (.gwt.xml):

  <inherits name='com.github.gwtd3.D3' />

3. Check everything works fine :

  final Label versionLabel = new Label("d3.js current version: " + D3.version());
  RootPanel.get().add(versionLabel);

Launch your application; the current version of d3.js should be displayed.

##Learn D3

  • The best way to learn D3 is to read the d3.js tutorials
  • Then you may want to check the examples gallery from Mike Bostock website
  • You may also be interested in forking the gwt-d3 repository to see the demo source code
  • Read the Javadocs
  • Look at the demo.

##API docs

##Release notes

  • 1.3.0 (9th of jan 2017) : made GWT 2.8-compliant
  • 1.2.0 (28th of jan 2016) : added Arrays.median/Arrays.mean API, fix some regression to ensure future GWT 2.8.0 compatibility, added Cluster and Tree layouts
  • 1.1.1 (6th of feb 2015) : integrated a bug fix (color brighter() and darker() methods take a decimal rather than an integer argument
  • 1.1.0 (3rd of feb 2015) : made GWT 2.7-compliant, completed SVG Shapes,SVG Controls, and Geometry API + some bug fixes
  • 1.0.1 (7th of dec 2013) : a bug fix release to make gwt-d3 compatible with GWT super dev mode.
  • 1.0.0 (30th of sept 2013) : initial release (see below for the API coverage)

##Scope and coverage

Currently (9th of jan 2017), version 1.3.0 of gwt-d3 depends on the version 3.5.11 of d3.js codebase. However, not all the API is covered. Please also have a look to the issues.

#####CORE

API status version notes
Selections Complete 1.0.0
Transitions Complete 1.0.0
Localization - - unplanned
Working with Arrays Partial 1.0.0
Math Complete 1.0.0
String Formatting Complete 1.0.0
Colors Complete 1.0.0
Loading External Resources Partial - unplanned
CSV Formatting - - unplanned
Namespaces - - unplanned
Internals - - unplanned

#####SCALES

API status version notes
Linear Complete 1.0.0
sqrt Complete 1.0.0
pow Complete 1.0.0
log Complete 1.0.0
quantize Complete 1.0.0
threshold Complete 1.0.0
quantile Complete 1.0.0
identity Complete 1.0.0
Ordinal Complete 1.0.0

#####SVG

API status version notes
Shapes
Line Complete 1.0.0
line.radial Complete 1.1.0
area Complete 1.1.0
area.radial - - not planned
arc Complete 1.1.0
chord Complete 1.1.0
diagonal Complete 1.1.0
diagonal.radial Complete 1.1.0
Symbol Complete 1.0.0
Axes Complete 1.0.0
Controls Complete 1.1.0

#####LAYOUTS

API status version notes
Bundle - - planned for 1.4.0
Chord - - planned for 1.4.0
Cluster Complete 1.2.0
Force - - planned for 1.4.0
Hierarchy Complete 1.2.0
Histogram - - planned for 1.4.0
Pack - - planned for 1.4.0
Partition - - planned for 1.4.0
Pie - - planned for 1.4.0
Stack - - planned for 1.4.0
Tree Complete 1.2.0
Treemap - - planned for 1.4.0

#####TIME

API status version notes
Time Formatting Complete 1.0.0
Time Scales Complete 1.0.0
Time Intervals Complete 1.0.0

#####GEOGRAPHY

API status version notes
Paths - - planned for 1.5.0
Projections - - planned for 1.5.0
Streams - - planned for 1.5.0

#####GEOMETRY

API status version notes
Quadtree Complete 1.0.0
Polygon Complete 1.0.0
Hull Complete 1.0.0
Voronoi Partial 1.1.0

#####BEHAVIORS

API status version notes
Drag Complete 1.0.0
Zoom Complete 1.0.0

##Version mapping

GWT-D3 version d3.js version GWT-D3 release date
1.3.0 3.5.11 2017 01 09
1.2.0 3.5.11 2016 01 30
1.1.1 3.5.3 2015 02 06
1.1.0 3.5.3 2015 02 03
1.0.1 3.3.10 2013 12 07
1.0.0 3.3.6 2013 09 30
0.0.16 3.3.6 2013 09 29
0.0.15 3.1.10 2013 07 29
0.0.14 3.1.10 2013 07 24
0.0.13 3.1.10 2013 06 13
0.0.12 3.1.10 2013 06 01

##Debugging d3.js

You may be interested in debugging d3.js scripts when using super dev mode. If so, just add to your gwt application module file the following configuration:

  <set-property name="d3.pretty" value="true"/>

##License

See LICENSE file

gwt-d3's People

Contributors

anthonime avatar augbog avatar ericcitaire avatar evshi avatar vasvir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gwt-d3's Issues

Colors API

UNIT TESTS: TestColors

  • 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.
  • rgb.toString - convert an RGB color to a string.
  • 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.
  • hsl.toString - convert an HSL color to a string.

OMITTED for 1.0.0:

  • d3.lab - specify a color in L_a_b* space.
  • lab.brighter - increase lightness by some exponential factor (gamma).
  • lab.darker - decrease lightness by some exponential factor (gamma).
  • lab.rgb - convert from L_a_b* to RGB.
  • lab.toString - convert a L_a_b* color to a string.
  • d3.hcl - specify a color in HCL space.
  • hcl.brighter - increase lightness by some exponential factor (gamma).
  • hcl.darker - decrease lightness by some exponential factor (gamma).
  • hcl.rgb - convert from HCL to RGB.
  • hcl.toString - convert an HCL color to a string.

SVG Controls API

  • d3.svg.brush - click and drag to select one- or two-dimensional regions.
  • brush.apply - creates or updates a brush for the given selection or transition.
  • brush.x - get or set the brush’s x-scale.
  • brush.y - get or set the brush’s y-scale.
  • brush.extent - get or set the brush’s extent. NB: setters should be specialized ?
  • brush.clear - reset the brush extent.
  • brush.clamp([clamp])
  • brush.empty - returns true if the brush extent is empty.
  • brush.on - respond to events when the brush is moved.
  • brush.event -

Remove gwt-d3-ui module

gwt-d3-ui contains widgets that are experimental, and whose goals,scope and lifecycle are different from the gwt-d3 wrapper library.
We should remove it from the gwtd3 project, and let it lives its own life.
Let's move it into a new github "organization" (why not in Tiviz organization since it contributed a lot).

Working with Arrays API

MANIPULATION

  • 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.extent - find the minimum and maximum value in an array.
  • d3.sum - compute the sum of an array of numbers.
  • d3.mean - compute the arithmetic mean of an array of numbers.
  • d3.median - compute the median of an array of numbers (the 0.5-quantile).
  • d3.quantile - compute a quantile for a sorted array of numbers.
  • d3.bisect - search for a value in a sorted array.
  • d3.bisectRight - search for a value in a sorted array.
  • d3.bisectLeft - search for a value in a sorted array.
  • d3.bisector - bisect using an accessor.
  • d3.shuffle - randomize the order of an array.
  • d3.permute - reorder an array of elements according to an array of indexes.
  • d3.zip - transpose a variable number of arrays.
  • d3.transpose - transpose an array of arrays.
  • 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.merge - merge multiple arrays into one array.
  • d3.range - generate a range of numeric values.

NESTING

  • d3.nest - group array elements hierarchically.
  • nest.key - add a level to the nest hierarchy.
  • nest.sortKeys - sort the current nest level by key.
  • nest.sortValues - sort the leaf nest level by value.
  • nest.rollup - specify a rollup function for leaf values.
  • nest.map - evaluate the nest operator, returning an associative array.
  • nest.entries - evaluate the nest operator, returning an array of key-values tuples.

MAP: (candidate for exclusion?)

  • d3.map - a shim for ES6 maps, since objects are not hashes!
  • map.has - returns true if the map contains the specified key.
  • map.get - returns the value for the specified key.
  • map.set - sets the value for the specified key.
  • map.remove - removes the entry for specified key.
  • map.keys - returns the map’s array of keys.
  • map.values - returns the map’s array of values.
  • map.entries - returns the map’s array of entries (key-values objects).
  • map.forEach - calls the specified function for each entry in the map.

SET (candidate for exclusion?)

  • d3.set - a shim for ES6 sets, since objects are not hashes!
  • set.has - returns true if the set contains the specified value.
  • set.add - adds the specified value.
  • set.remove - removes the specified value.
  • set.values - returns the set’s array of values.
  • set.forEach - calls the specified function for each value in the set.

Ordinal Scales API

(TEST CASE: TestOrdinalScale)

  • d3.scale.ordinal - construct an ordinal scale.
  • ordinal - get the range value corresponding to a given domain value.
  • ordinal.domain - get or set the scale's input domain.
  • ordinal.range - get or set the scale's output range.
  • ordinal.rangePoints - divide a continuous output range for discrete points.
  • ordinal.rangeBands - divide a continuous output range for discrete bands.
  • ordinal.rangeRoundBands - divide a continuous output range for discrete bands.
  • ordinal.rangeBand - get the discrete range band width.
  • ordinal.rangeExtent - get the minimum and maximum values of the output range.
  • ordinal.copy - create a new scale from an existing scale.
  • d3.scale.category10 - construct an ordinal scale with ten categorical colors.
  • d3.scale.category20 - construct an ordinal scale with twenty categorical colors.
  • d3.scale.category20b - construct an ordinal scale with twenty categorical colors.
  • d3.scale.category20c - construct an ordinal scale with twenty categorical colors.

Write documentation

  • Getting started (setup a project...)
  • explicit the coverage of the d3.js API (release note)
  • links to good doc and tuto about d3.js
  • Examples
  • Add a more explicit roadmap

SVG Shapes API

LINE: DEMO: LineDemo

  • d3.svg.line - create a new line generator.
  • line - generate a piecewise linear curve, as in a line chart.
  • line.x - get or set the x-coordinate accessor.
  • line.y - get or set the y-coordinate accessor.
  • line.interpolate - get or set the interpolation mode.
  • line.tension - get or set the cardinal spline tension.
  • line.defined - control whether the line is defined at a given point.

LINE RADIAL (implemented but waiting for clarification from mbostock)

  • d3.svg.line.radial - create a new radial line generator.
  • line - generate a piecewise linear curve, as in a polar line chart.
  • line.radius - get or set the radius accessor.
  • line.angle - get or set the angle accessor.
  • line.defined - control whether the line is defined at a given point.

AREA

  • d3.svg.area - create a new area generator.
  • area - generate a piecewise linear area, as in an area chart.
  • area.x - get or set the x-coordinate accessors.
  • area.x0 - get or set the x0-coordinate (baseline) accessor.
  • area.x1 - get or set the x1-coordinate (topline) accessor.
  • area.y - get or set the y-coordinate accessors.
  • area.y0 - get or set the y0-coordinate (baseline) accessor.
  • area.y1 - get or set the y1-coordinate (topline) accessor.
  • area.interpolate - get or set the interpolation mode.
  • area.tension - get or set the cardinal spline tension.
  • area.defined - control whether the area is defined at a given point.

POSTPONED to #114
AREA RADIAL

  • [ ] d3.svg.area.radial - create a new area generator.
  • [ ] area - generate a piecewise linear area, as in a polar area chart.
  • [ ] area.radius - get or set the radius accessors.
  • [ ] area.innerRadius - get or set the inner radius (baseline) accessor.
  • [ ] area.outerRadius - get or set the outer radius (topline) accessor.
  • [ ] area.angle - get or set the angle accessors.
  • [ ] area.startAngle - get or set the angle (baseline) accessor.
  • [ ] area.endAngle - get or set the angle (topline) accessor.
  • [ ] area.defined - control whether the area is defined at a given point.

ARC

  • d3.svg.arc - create a new arc generator.
  • arc - generate a solid arc, as in a pie or donut chart.
  • arc.innerRadius - get or set the inner radius accessor.
  • arc.outerRadius - get or set the outer radius accessor.
  • arc.startAngle - get or set the start angle accessor.
  • arc.endAngle - get or set the end angle accessor.
  • arc.centroid - compute the arc centroid.

SYMBOL (Tested by TestSymbol and demonstrated with SymbolDemo)

  • d3.svg.symbol - create a new symbol generator.
  • symbol - generate categorical symbols, as in a scatterplot.
  • symbol.type - get or set the symbol type accessor.
  • symbol.size - get or set the symbol size (in square pixels) accessor.
  • [ ] d3.svg.symbolTypes - the array of supported symbol types. OMITTED : replaced by Symbol.Type.values() enum method

CHORD

  • d3.svg.chord - create a new chord generator.
  • chord - generate a quadratic Bézier connecting two arcs, as in a chord diagram.
  • chord.radius - get or set the arc radius accessor.
  • chord.startAngle - get or set the arc start angle accessor.
  • chord.endAngle - get or set the arc end angle accessor.
  • chord.source - get or set the source arc accessor.
  • chord.target - get or set the target arc accessor.

DIAGONAL

  • d3.svg.diagonal - create a new diagonal generator.
  • diagonal - generate a two-dimensional Bézier connector, as in a node-link diagram.
  • diagonal.source - get or set the source point accessor.
  • diagonal.target - get or set the target point accessor.
  • diagonal.projection - get or set an optional point transform.

DIAGONAL RADIAL

  • d3.svg.diagonal.radial - create a new diagonal generator.
  • diagonal - generate a two-dimensional Bézier connector, as in a node-link diagram.

Test on mobile devices

== Selections ==

  • d3.touches - gets the touch positions relative to a specified container.

Run a single test

In the demo, find a way to manually execute a single test instead of executing all of them.
Maybe by clicking on the individual test button ?

DatumFunction refactoring investigations

@ericcitaire

It appears that we forgot an additional argument in the DatumFunction.apply() method.
It is explained here: http://bost.ocks.org/mike/nest/#index

The tutorial clearly states that we can access the "row index" in case of nested selection.
I have tested it on different contexts (notably the Drag.origin method which is not clearly documented in d3.js).

I have the strong feeling that in every part of the API, every time a "data-aware" function can be provided, and even if it is not clearly documented, the method that we can pass always ensure the following contract:

  • 'this' is the current element context (or an other object, e.g an Array, but in that exceptional case it is clearly stated in the documentation).
  • arg 1 is the datum
  • arg 2 is the index of the element in the selection / the index of the datum in the array of datum
  • arg 3 is the row index in case of nested selections (and default to 0 in case of a flat selection)

So I suggest that we refactor the DatumFunction to take the additional argument into account.

What is not clear to me is, in case of a multi-dimension nested selection (like array of array of array), will we have additional arguments (fifth, sixth, etc...) ? or is it limited to one level of nesting ?

I am going to investigate further in the next days.

What do you think ?

Involved API:

  • selection.attr - get or set attribute values.
  • selection.classed - add or remove CSS classes.

Complete Scales API for missing methods

  • interpolate methods to be implemented as soon as we cover the interpolators and D3.interpolate methods. POSTPONED TO LATER VERSION
  • log.tickFormat for String and function seems to be bugged... see d3/d3#1384
    We need to implements the scales.interpolate() methods
  • recheck the methods ticks in linear, log and pow since it seems to have 2 version : without and with a count arg, and documentation is inconsistent between all those scales
  • recheck the methods tickFormat in linear, log and pow since it seems to have 2 version : without and with a count arg, and documentation is inconsistent between all those scales
  • see also #63 (invertExtent)

No license specified

I couldn't see what license the project is operating under. d3.js is BSD is gwt-d3 the same given it's just a wrapper around d3?

(This is a duplicate of anthonime/gwt-d3#45 but for the correct project now.)

String Formatting API

  • d3.format - format a number as a string.
  • d3.formatPrefix - returns the [SI prefix] for the specified value and precision.
  • d3.requote - quote a string for use in a regular expression.
  • d3.round - rounds a value to some digits after the decimal point.

Quantitative Scales API

LINEAR: (TEST CASE: TestLinearScale)

  • d3.scale.linear - construct a linear quantitative scale.
  • linear - get the range value corresponding to a given domain value.
  • linear.invert - get the domain value corresponding to a given range value.
  • linear.domain - get or set the scale's input domain.
  • linear.range - get or set the scale's output range.
  • linear.rangeRound - set the scale's output range, and enable rounding.
  • linear.interpolate - get or set the scale's output interpolator. (POSTPONED to #50 )
  • linear.clamp - enable or disable clamping of the output range.
  • linear.nice - extend the scale domain to nice round numbers.
  • linear.ticks - get representative values from the input domain.
  • linear.tickFormat - get a formatter for displaying tick values.
  • linear.copy - create a new scale from an existing scale.

SQRT / POW (TEST CASE: TestPowScale)

  • d3.scale.sqrt - construct a quantitative scale with a square root transform.
  • d3.scale.pow - construct a quantitative scale with an exponential transform.
  • pow - get the range value corresponding to a given domain value.
  • pow.invert - get the domain value corresponding to a given range value.
  • pow.domain - get or set the scale's input domain.
  • pow.range - get or set the scale's output range.
  • pow.rangeRound - set the scale's output range, and enable rounding.
  • pow.interpolate - get or set the scale's output interpolator. (POSTPONED to #50 )
  • pow.clamp - enable or disable clamping of the output range.
  • pow.nice - extend the scale domain to nice round numbers.
  • pow.ticks - get representative values from the input domain.
  • pow.tickFormat - get a formatter for displaying tick values. (BUGGED see #50)
  • pow.exponent - get or set the exponent power.
  • pow.copy - create a new scale from an existing scale.

LOG (TEST CASE: TestLogScale)

  • d3.scale.log - construct a quantitative scale with an logarithmic transform.
  • log - get the range value corresponding to a given domain value.
  • log.invert - get the domain value corresponding to a given range value.
  • log.domain - get or set the scale's input domain.
  • log.range - get or set the scale's output range.
  • log.rangeRound - set the scale's output range, and enable rounding.
  • log.interpolate - get or set the scale's output interpolator. (POSTPONED to #50 )
  • log.clamp - enable or disable clamping of the output range.
  • log.nice - extend the scale domain to nice powers of ten.
  • log.ticks - get representative values from the input domain.
  • log.tickFormat - get a formatter for displaying tick values. (BUGGED see #50)
  • log.copy - create a new scale from an existing scale.

QUANTIZE

  • d3.scale.quantize - construct a linear quantitative scale with a discrete output range.
  • quantize - get the range value corresponding to a given domain value.
  • quantize.invertExtent - get the domain values for the specified range value. POSTPONED to (#63)
  • quantize.domain - get or set the scale's input domain.
  • quantize.range - get or set the scale's output range (as discrete values).
  • quantize.copy - create a new scale from an existing scale.

THRESHOLD (TEST CASE: TestThresholdScale)

  • d3.scale.threshold - construct a threshold scale with a discrete output range.
  • threshold - get the range value corresponding to a given domain value.
  • threshold.invertExtent - get the domain values for the specified range value. POSTPONED to (#63)
  • threshold.domain - get or set the scale's input domain.
  • threshold.range - get or set the scale's output range (as discrete values).
  • threshold.copy - create a new scale from an existing scale.

QUANTILE (TEST CASE: TestQuantileScale)

  • d3.scale.quantile - construct a quantitative scale mapping to quantiles.
  • quantile - get the range value corresponding to a given domain value.
  • quantile.invertExtent - get the domain values for the specified range value. POSTPONED to (#63)
  • quantile.domain - get or set the scale's input domain (as discrete values).
  • quantile.range - get or set the scale's output range (as discrete values).
  • quantile.quantiles - get the scale's quantile bin thresholds.
  • quantile.copy - create a new scale from an existing scale.

IDENTITY (TEST CASE: TestIdentityScale)

  • d3.scale.identity - construct a linear identity scale.
  • identity - the identity function.
  • identity.invert - equivalent to identity; the identity function.
  • identity.domain - get or set the scale's domain and range.
  • identity.range - equivalent to identity.domain.
  • identity.ticks - get representative values from the domain.
  • identity.tickFormat - get a formatter for displaying tick values.
  • identity.copy - create a new scale from an existing scale.

Layouts Force API

  • ensure event properties are reachable (on)
  • what is carried by link ?
  • what is carried by nodes ?

Selections API

== Selecting Elements ==

  • d3.select - select an element from the current document (UNIT TEST).
  • d3.selectAll - select multiple elements from the current document (UNIT TEST).

== Content ==

  • selection.attr - get or set attribute values. (UNIT TEST)
  • selection.classed - add or remove CSS classes. (UNIT TEST)
  • selection.style - get or set style properties. (UNIT TEST)
  • selection.property - get or set raw properties. (UNIT TEST)
  • selection.text - get or set text content. (UNIT TEST)
  • selection.html - get or set inner HTML content. (UNIT TEST)
  • selection.append - create and append new elements. (UNIT TEST)
  • selection.insert - create and insert new elements before existing elements. (UNIT TEST)
  • selection.remove - remove elements from the document. (UNIT TEST)

== Data ==

  • selection.data - get or set data for a group of elements, while computing a relational join. (UNIT TEST)
  • selection.enter - returns placeholders for missing elements (DEMOS).
  • selection.exit - returns elements that are no longer needed (DEMOS).
  • selection.datum - get or set data for individual elements, without computing a join.
  • selection.filter - filter a selection based on data. (UNIT TEST)
  • selection.sort - sort elements in the document based on data. (UNIT TEST)
  • selection.order - reorders elements in the document to match the selection. (UNIT TEST)

== Controls ==

  • selection.each - call a function for each selected element. (UNIT TEST)
  • selection.call - call a function passing in the current selection. (OMITTED)
  • selection.empty - returns true if the selection is empty. (UNIT TEST)
  • selection.node - access the first node in a selection. (UNIT TEST)
  • selection.count - convenient additional method by gwt-d3. (UNIT TEST)

== Subselections ==

  • selection.select - subselect a descendant element for each selected element. (DEMOS)
  • selection.selectAll - subselect multiple descendants for each selected element. (DEMOS)

== Extension ==

  • d3.selection - augment the selection prototype, or test instance types . (OUT OF SCOPE)

== Animation & Interaction ==

  • selection.on - add or remove event listeners for interaction. (DEMOS)
  • selection.transition - start a transition on the selected elements. (DEMOS)
  • d3.event - access the current user event for interaction. (DEMOS)
  • d3.mouse - gets the mouse position relative to a specified container. (DEMOS)
  • d3.touches - gets the touch positions relative to a specified container. (UNTESTED)

Math API

  • d3.random.normal - generate a random number with a normal distribution.
  • d3.random.logNormal - generate a random number with a log-normal distribution.
  • d3.random.irwinHall - generate a random number with an Irwin–Hall distribution.
  • d3.transform - compute the standard form of a 2D matrix transform.

Geometry Quadtree API

Trying to get what is the current state of the original API https://github.com/mbostock/d3/wiki/Quadtree-Geom
because it's not clear what is deprecated and what is not.
See d3/d3#1467

  • d3.geom.quadtree - constructs a quadtree for an array of points.
  • quadtree.add - add a point to the quadtree.
  • quadtree.visit - recursively visit nodes in the quadtree.

DEMO: Mitchell Best Candidates

Geometry Hull API

  • d3.geom.hull - create a convex hull layout with default accessors.
  • hull - compute the convex hull for the given array of points.
  • hull.x - get or set the x-coordinate accessor.
  • hull.y - get or set the y-coordinate accessor.

DEMO: HullDemo

Transitions API

TRANSITION (smoke tests)

  • d3.transition - start an animated transition.(OMITTED)
  • 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.tween - specify a custom tween operator to run as part of the transition.
  • 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.filter - filter a transition based on data.
  • transition.transition - when this transition ends, start another one on the same elements.
  • transition.remove - remove selected elements at the end of a transition.
  • transition.empty - returns true if the transition is empty.
  • transition.node - returns the first node in the transition.
  • transition.size - returns the number of elements in the selection. (in v3.2)
  • transition.each - add a listener for transition end events.
  • transition.call - call a function passing in the current transition.

EASE (Tested in TestEasing)

  • d3.ease - customize transition timing.
  • ease - a parametric easing function.

TIMER (Tested in Lorenz System)

  • d3.timer - start a custom animation timer.
  • d3.timer.flush - immediately execute any zero-delay timers.

INTERPOLATION

  • d3.interpolate - interpolate two values. (OMITTED: not necessary with java strong typing)
  • interpolate - a parametric interpolation function.
  • 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.interpolateLab - interpolate two L_a_b* colors.-
  • d3.interpolateHcl - interpolate two HCL colors.
  • d3.interpolateArray - interpolate two arrays of values.
  • d3.interpolateObject - interpolate two arbitrary objects.
  • d3.interpolateTransform - interpolate two 2D matrix transforms.
  • d3.interpolators - register a custom interpolator.

SVG Axes API

API

  • d3.svg.axis - create a new axis generator.
  • axis - creates or updates an axis for the given selection or transition.
  • axis.scale - get or set the axis scale.
  • axis.orient - get or set the axis orientation.
  • axis.ticks - control how ticks are generated for the axis.
  • axis.tickValues - specify tick values explicitly.
  • axis.tickSubdivide - optionally subdivide ticks uniformly.
  • axis.tickSize - specify the size of major, minor and end ticks.
  • axis.tickPadding - specify padding between ticks and tick labels.
  • axis.tickFormat - override the tick formatting for labels.

TESTCASE: TestAxis
Bostock DEMO: AxisComponent

Geometry Polygon API

  • d3.geom.polygon - create a polygon from the specified array of points.
  • polygon.area - compute the counterclockwise area of this polygon.
  • polygon.centroid - compute the area centroid of this polygon.
  • polygon.clip - clip the specified polygon to this polygon. => not tested

DEMO: Shape Tweening

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.