simplestatistics.median VS d3.median
This visualization compares the performance of two median algorithms: D3's `d3.median` and the `median` function from the simple-statistics library (aliased as `ss.median`). It generates a dataset of one million random numbers using `d3.range(1000000).map(Math.random)`, times each function with `performance.now()`, and displays a text result in an SVG. The output shows whether the medians match and expresses the simple-statistics time as a percentage (formatted via `d3.format`) of D3's time, revealing the speed difference. The page loads both D3.v4 and simple-statistics 2.2.0 from CDN.
AI-generated descriptionExploring simplestatistics as a faster alternative to compute d3.median()
See d3 issue #1833
Forked from <a href='http://bl.ocks.org/Fil/1092338525a5e6a7237b31453ed6e313'>quickselect VS d3.median</a>.