Search code examples
d3.jsobservabledata-visualizationstream-graph

Draw a vertical band at the maximum value of a single-stream streamgraph in d3js that respects the bounds of curve?


Question: how do we draw a vertical band at the maximum value of a single-stream streamgraph in d3js that respects the bounds of curve?

editable streamgraph example.

Imagine this is the original streamgraph: Streamgraph sans vertical band The question is focused on how we create something like this: Streamgraph with vertical band


Solution

  • The following solution uses @GerardoFurtado's initial idea, but adds a clipPath to respect the bounds of the curve for any bandwidth:

    https://beta.observablehq.com/@blehman/untitled/2