Curve

d3 offers different curve types. More insights on githubopen in new window.






This code-example shows a linear curve:

import { line, curveLinear } from 'd3';
const lineGenerator = computed(() => {
  return line()
      .x((d) => xScale.value(d.x))
      .y((d) => yScale.value(d.y ?? 0))
      .curve(curveLinear);
});
Last Updated:
Contributors: Christian