Skip to main content
100%

Chevrons and Arcs 2

✓ Published0🌍 Public
Aandrew-reid
Last edited Nov 6, 2017
Created on Nov 5, 2017

Three large blue chevron-shaped arcs radiate from the center of an SVG canvas, each spanning roughly 120 degrees with distinct start and end angles. The custom chevronArc function, built on d3-path, draws each arc as a curved band with pointed indentations at both the head and tail, creating arrow-like forms. The arcs are positioned at different radial offsets, with inner and outer radii of 150 and 200 pixels, and the view is centered in a 500 by 500 pixel space.

AI-generated description

This block uses d3.js v4 with a custom module.

A very basic modification of d3.arc to produce an arc with chevrons, d3.chevronArc. Unlike the first attempt at this, tail ends of arcs are indented.

This block serves primarily as a proof of concept - and not as a demo of a decent module/plugin. It is based entirely off of the d3-shape module's (https://github.com/d3/d3-shape) arc function with few changes and a lot of code removed. In creating it, many or all of the checks for different cases or exceptions were removed.

Six methods are available for chevronArc(), all are required,these are:

  • innerRadius()
  • outerRadius()
  • startAngle() - in radians
  • endAngle() - in radians

All these behave the same as with d3.arc(). The two new methods are:

  • startIndent() - the indent in pixels for the tail
  • endIndent() - the indent (outdent?) in pixels for the head.

Similar vizzes