
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
A shameless generalization of the ridgeline plot from d3-graph-gallery.
npm i d3-ridge
import {ridge} from 'd3-ridge'
It is assumed that the data bound to ridge is an object, where each ridge is
specified a key in the object and each value corresponds to the numeric values to estimate the density from e.g.
data = {
'A': [95,95,95,95],
'B': [25,30,32,10],
}
more complex data can be provided should utility functions such as valueExtractor
be overwritten from their default behavior:
data = {
A: {
x: { value: 1 },
y: { value: 2 },
...
},
...
}
let container = d3.select('<wherever-you-want-to-dump-the-plot>')
let r = ridge(container)
.valueExtractor(function(d, i){
let subKeys = d3.keys(data[d])
return subKeys.map((k, j)=>data[d][k].value)
})
The following values are all exposed from the ridge closure:
d3.scaleLinear()): scale used on the x axisd3.scaleLinear()): scale used on the y axis()(key, index) => data[key]): how to get the values for each key in dataKeys (should be a list of numeric values)d3.curveBasis): the curve attribute used for rendering the densities(key, index) => {return d3.scaleSequential().interpolator(d3.interpolateViridis)(index / dataKeys.length)}): how to color each ridge0.7): opacity applied to all ridges((k, i)=>'black'): stroke applied to each ridge0.1)7)40)4): number of ticks that appear on the density axis5): number of ticks that appear on the x axis(k, i) => {}): function bound to mouseenter and mousemove events on each ridge(k, i) => {}): function bound to mouseexit and mouseleave events on each ridge'ridge'): included in svg elements to prevent multi-instance selection issuesspaceY - categorySpaceY, in other words it ensures that the
top ridge is visibiletrue)true),true): whether or not the density scale should be includedtrue): whether or not pan and zoom should be bound to chart500): applied to axes and ridgesd3.easeSin): applied to axes and ridgesd3.zoom(): access to the zoom instancezoom invokes. Modify at your own risk.FAQs
Beyond d3: an extension of d3
The npm package d3-ridge receives a total of 2 weekly downloads. As such, d3-ridge popularity was classified as not popular.
We found that d3-ridge demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.