.dcss-bin
Groups the numbers of a list into bins, and gives each bin’s count and bounds.
Example
Result
Markup
<link rel="stylesheet" href="dcss.css">
<link rel="stylesheet" href="families/array.css">
<link rel="stylesheet" href="families/format.css">
<figure class="dcss-bin" style="--domain-0: 0; --domain-1: 30; --threshold-0: 10; --threshold-1: 20">
<ol>
<li style="--value: 3"></li>
<li style="--value: 12"></li>
<li style="--value: 15"></li>
<li style="--value: 28"></li>
</ol>
<ol>
<li>
<output class="dcss-format-fixed" style="--value: var(--dcss-bin-length); --precision: 0"></output></li>
<li>
<output class="dcss-format-fixed" style="--value: var(--dcss-bin-length); --precision: 0"></output></li>
<li>
<output class="dcss-format-fixed" style="--value: var(--dcss-bin-length); --precision: 0"></output></li>
</ol>
</figure>
Browser support
| Browser | Support |
|---|---|
| Chrome | Yes |
| Safari | Yes |
| Firefox | Whole numbers only |
See also
d3.binin d3’s documentation