How to use the @jiaminghi/charts/lib/util.getPolylineLength function in @jiaminghi/charts

To help you get started, we’ve selected a few @jiaminghi/charts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DataV-Team / DataV-React / src / components / decoration5 / index.js View on Github external
[0, height * 0.2],
      [width * 0.18, height * 0.2],
      [width * 0.2, height * 0.4],
      [width * 0.25, height * 0.4],
      [width * 0.27, height * 0.6],
      [width * 0.72, height * 0.6],
      [width * 0.75, height * 0.4],
      [width * 0.8, height * 0.4],
      [width * 0.82, height * 0.2],
      [width, height * 0.2]
    ]

    let line2Points = [[width * 0.3, height * 0.8], [width * 0.7, height * 0.8]]

    const line1Length = getPolylineLength(line1Points)
    const line2Length = getPolylineLength(line2Points)

    line1Points = line1Points.map(point => point.join(',')).join(' ')
    line2Points = line2Points.map(point => point.join(',')).join(' ')

    return { line1Points, line2Points, line1Length, line2Length }
  }
github DataV-Team / DataV-React / src / components / decoration5 / index.js View on Github external
let line1Points = [
      [0, height * 0.2],
      [width * 0.18, height * 0.2],
      [width * 0.2, height * 0.4],
      [width * 0.25, height * 0.4],
      [width * 0.27, height * 0.6],
      [width * 0.72, height * 0.6],
      [width * 0.75, height * 0.4],
      [width * 0.8, height * 0.4],
      [width * 0.82, height * 0.2],
      [width, height * 0.2]
    ]

    let line2Points = [[width * 0.3, height * 0.8], [width * 0.7, height * 0.8]]

    const line1Length = getPolylineLength(line1Points)
    const line2Length = getPolylineLength(line2Points)

    line1Points = line1Points.map(point => point.join(',')).join(' ')
    line2Points = line2Points.map(point => point.join(',')).join(' ')

    return { line1Points, line2Points, line1Length, line2Length }
  }

@jiaminghi/charts

Lightweight charting

MIT
Latest version published 4 years ago

Package Health Score

54 / 100
Full package analysis