title: Add filled circles (markers) at SwiftUI path points
body: <p>I'm trying to draw a line with markers at each point by using a Shape view in SwiftUI. I want the line to have a filled circle at each <code>CGPoint</code> on the line. The closest to this that I've gotten is by adding an arc at each point. Instead of using the arc, how can I add a <code>Circle()</code> shape at each point? I'm open to other approaches to accomplish this. My only requirements are to use SwiftUI and have the ability to interact with the markers.</p>
  <p><a href="https://i.stack.imgur.com/IxPl2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IxPl2.png" alt="line plot" /></a></p>
  <pre class="lang-swift prettyprint-override"><code>import SwiftUI
  
  struct LineShape: Shape {
      
      let values: [Double]
      
      func path(in rect: CGRect) -&gt; Path {
          let xStep = rect.width / CGFloat(values.count - 1)
          
          var path = Path()
          path.move(to: CGPoint(x: 0.0, y: (1 - values[0]) * Double(rect.height)))
          
          for i in 1..&lt;values.count {
              let pt = CGPoint(x: Double(i) * Double(xStep), y: (1 - values[i]) * Double(rect.height))
              path.addLine(to: pt)
              path.addArc(center: pt, radius: 8, startAngle: Angle(degrees: 0), endAngle: Angle(degrees: 360), clockwise: false)
          }
          
          return path
      }
  }
  
  struct ContentView: View {
      var body: some View {
          LineShape(values: [0.2, 0.4, 0.3, 0.8, 0.5])
              .stroke(.red, lineWidth: 2.0)
              .padding()
              .frame(width: 400, height: 300)
      }
  }
  </code></pre>