Socket
Socket
Sign inDemoInstall

lwc-plugin-visible-price-range-util

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lwc-plugin-visible-price-range-util

A plugin for providing a utility API to retrieve the visible range of a price scale, and subscribe to changes.


Version published
Weekly downloads
17
increased by750%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Visible Price Range Util - Lightweight Charts™ Plugin

A plugin for providing a utility API to retrieve the visible range of a price scale, and subscribe to changes.

  • Developed for Lightweight Charts version: v4.1.0

Installation

npm install lwc-plugin-visible-price-range-util

Usage

import { VisiblePriceRangeUtil } from 'lwc-plugin-visible-price-range-util';

// Create an instantiated Visible Price Range Util primitive.
const vprUtil = new VisiblePriceRangeUtil();

// Create the chart and series...
const chart = createChart(document.getElementById('container'));
const lineSeries = chart.addLineSeries();
const data = [
    { time: 1642425322, value: 123 },
    /* ... more data */
];

// Attach the utility to the series
lineSeries.attachPrimitive(vprUtil);

const currentVisiblePriceRange = vprUtil.getVisiblePriceRange();
vprUtil.priceRangeChanged().subscribe(function(newRange) {
    if (!newRange) return;
    console.log(`Price Range is now from ${newRange.bottom} to ${newRange.top}`);
});

Developing

Running Locally

npm install
npm run dev

Visit localhost:5173 in the browser.

Compiling

npm run compile

Check the output in the dist folder.

Keywords

FAQs

Last updated on 12 Oct 2023

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