client/webserver/site/src/js/charts.js
/* drawDepth draws a single side's depth chart data. */
drawDepth draws a single side's depth chart data.
drawDepth draws a single side ' s depth chart data .
drawDepth (depth) {
    const firstPt = depth[0]
    let y = firstPt[1]
    let x
    this.plotRegion.plot(this.dataExtents, (ctx, tools) => {
      tools.dataCoords(() => {
        ctx.beginPath()
        ctx.moveTo(firstPt[0], firstPt[1])
        for (let i = 0; i < depth.length; i++) {
          x = depth[i][0]
          ctx.lineTo(x, y)
          y = depth[i][1]
          ctx.lineTo(x, y)
        }
      })
      ctx.stroke()
      tools.dataCoords(() => {
        ctx.lineTo(x, 0)
        ctx.lineTo(firstPt[0], 0)
      })
      ctx.closePath()
      ctx.globalAlpha = 0.25
      ctx.fill()
    })
  }
drawDepth ( depth ) { const firstPt = depth [ 0 ] let y = firstPt [ 1 ] let x this . plotRegion . plot ( this . dataExtents , ( ctx , tools ) => { tools . dataCoords ( ( ) => { ctx . beginPath ( ) ctx . moveTo ( firstPt [ 0 ] , firstPt [ 1 ] ) for ( let i = 0 ; i < depth . length ; i ++ ) { x = depth [ i ] [ 0 ] ctx . lineTo ( x , y ) y = depth [ i ] [ 1 ] ctx . lineTo ( x , y ) } } ) ctx . stroke ( ) tools . dataCoords ( ( ) => { ctx . lineTo ( x , 0 ) ctx . lineTo ( firstPt [ 0 ] , 0 ) } ) ctx . closePath ( ) ctx . globalAlpha = 0.25 ctx . fill ( ) } ) }
drawDepth draws a single side's depth chart data.
drawDepth draws a single side ' s depth chart data .
// Set x, but don't set y until we draw the horizontal line. // If this is past the render edge, quit drawing.