Skip to content
This repository has been archived by the owner on Nov 11, 2022. It is now read-only.

Working with Arrays API #41

Open
44 tasks
anthonime opened this issue Jun 5, 2013 · 3 comments
Open
44 tasks

Working with Arrays API #41

anthonime opened this issue Jun 5, 2013 · 3 comments
Assignees

Comments

@anthonime
Copy link
Member

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.
@anthonime
Copy link
Member Author

I think we should put a lot of these methods into JsArrays instead of D3.

@ghost ghost assigned anthonime Jul 20, 2013
@anthonime
Copy link
Member Author

should we really include this API in the 1.0.0 milestone ?
I think most of these methods are covered by gwt or otherwise are server-side concerns.

@anthonime
Copy link
Member Author

@ericcitaire related to #55

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant