Socket
Socket
Sign inDemoInstall

altpro

Package Overview
Dependencies
1
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    altpro

Elevation profile widget.


Version published
Weekly downloads
9
increased by350%
Maintainers
2
Install size
16.8 kB
Created
Weekly downloads
 

Readme

Source

NPM version Build Status

altpro

Elevation profile widget. See demo here.

Install

$ npm install --save altpro

Usage


const data = [
  { elevation: 10, distance: 0 },
  { elevation: 15, distance: 10 },
  { elevation: 25, distance: 10 },
  // etc.
];

const altpro = require('altpro');

const container = document.querySelector('.altitude-profile-container');
altpro(container, data);

API

altpro(parent, data, options)

Creates new widget inside of parent. parent element has to exist, be visible and have desired size.

  • data is an Array of items with elevation and distance properties. All other properties are ignored, and data is not changed by altpro. distance means - distance from previous items.

The following options can be passed:

altpro.select(index)

Selects index element of data.

altpro.destroy()

Removes altpro widget from DOM, unbinds all listeners.

License

MIT © Damian Krzeminski

Keywords

FAQs

Last updated on 31 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc