Socket
Socket
Sign inDemoInstall

lightweight-charts

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightweight-charts - npm Package Compare versions

Comparing version 1.0.0-rc.3 to 1.0.0-rc.4

97

dist/typings.d.ts

@@ -38,3 +38,3 @@ /**

* @param options - any subset of ChartOptions to be applied at start.
* @return an interface to the created chart
* @returns an interface to the created chart
*/

@@ -59,4 +59,4 @@ export declare function createChart(container: string | HTMLElement, options?: DeepPartial<ChartOptions>): IChartApi;

*/
export declare type CandleSeriesOptions = SeriesOptions<CandleStyleOptions>;
export declare type CandleSeriesPartialOptions = SeriesPartialOptions<CandleStyleOptions>;
export declare type CandlestickSeriesOptions = SeriesOptions<CandlestickStyleOptions>;
export declare type CandlestickSeriesPartialOptions = SeriesPartialOptions<CandlestickStyleOptions>;
export declare type Coordinate = Nominal<number, 'Coordinate'>;

@@ -134,3 +134,3 @@ export declare type DateFormat = 'dd MMM \'yy' | 'yyyy-MM-dd' | 'yy-MM-dd' | 'yy/MM/dd' | 'yyyy/MM/dd' | 'dd-MM-yyyy' | 'dd-MM-yy' | 'dd/MM/yy' | 'dd/MM/yyyy' | 'MM/dd/yy' | 'MM/dd/yyyy';

/** Structure describing a drawing style of the candlestick chart */
export interface CandleStyleOptions {
export interface CandlestickStyleOptions {
/** Color of rising candlesticks */

@@ -260,3 +260,3 @@ upColor: string;

* @param width - target width of the chart
* @param [forceRepaint=false] - true to initiate resize immediately. One could need this to get screenshot immediately after resize
* @param forceRepaint - true to initiate resize immediately. One could need this to get screenshot immediately after resize
*/

@@ -266,30 +266,30 @@ resize(height: number, width: number, forceRepaint?: boolean): void;

* Creates an area series with specified parameters
* @param [areaParams = undefined] - customization parameters of the series being created
* @return an interface of the created series
* @param areaOptions - customization parameters of the series being created
* @returns an interface of the created series
*/
addAreaSeries(areaParams?: AreaSeriesPartialOptions): ISeriesApi<'Area'>;
addAreaSeries(areaOptions?: AreaSeriesPartialOptions): ISeriesApi<'Area'>;
/**
* Creates a bar series with specified parameters
* @param [barParams = undefined] - customization parameters of the series being created
* @return an interface of the created series
* @param barOptions - customization parameters of the series being created
* @returns an interface of the created series
*/
addBarSeries(barParams?: BarSeriesPartialOptions): ISeriesApi<'Bar'>;
addBarSeries(barOptions?: BarSeriesPartialOptions): ISeriesApi<'Bar'>;
/**
* Creates a candle series with specified parameters
* @param [candleParams = undefined] - customization parameters of the series being created
* @return an interface of the created series
* Creates a candlestick series with specified parameters
* @param candlestickOptions - customization parameters of the series being created
* @returns an interface of the created series
*/
addCandleSeries(candleParams?: CandleSeriesPartialOptions): ISeriesApi<'Candle'>;
addCandlestickSeries(candlestickOptions?: CandlestickSeriesPartialOptions): ISeriesApi<'Candlestick'>;
/**
* Creates a histogram series with specified parameters
* @param [histogramParams=undefined] - customization parameters of the series being created
* @return an interface of the created series
* @param histogramOptions - customization parameters of the series being created
* @returns an interface of the created series
*/
addHistogramSeries(histogramParams?: HistogramSeriesPartialOptions): ISeriesApi<'Histogram'>;
addHistogramSeries(histogramOptions?: HistogramSeriesPartialOptions): ISeriesApi<'Histogram'>;
/**
* Creates a line series with specified parameters
* @param [lineParams=undefined] - customization parameters of the series being created
* @return an interface of the created series
* @param lineOptions - customization parameters of the series being created
* @returns an interface of the created series
*/
addLineSeries(lineParams?: LineSeriesPartialOptions): ISeriesApi<'Line'>;
addLineSeries(lineOptions?: LineSeriesPartialOptions): ISeriesApi<'Line'>;
/**

@@ -332,3 +332,3 @@ * Removes a series of any type. This is an irreversible operation, you cannot do anything with the series after removing it

* Returns API to manipulate the time scale
* @return - target API
* @returns - target API
*/

@@ -338,3 +338,3 @@ timeScale(): ITimeScaleApi;

* Applies new options to the chart
* @param - options, any subset of chart options
* @param options - any subset of chart options
*/

@@ -344,5 +344,5 @@ applyOptions(options: DeepPartial<ChartOptions>): void;

* Returns currently applied options
* @return - full set of currently applied options, including defaults
* @returns - full set of currently applied options, including defaults
*/
options(): ChartOptions;
options(): Readonly<ChartOptions>;
/**

@@ -359,3 +359,3 @@ * Removes branding text from the chart.

* @param price - original price to be formatted
* @return - formatted price
* @returns - formatted price
*/

@@ -373,5 +373,5 @@ format(price: BarPrice): string;

* Returns currently applied options of the price scale
* @return full set of currently applied options, including defaults
* @returns full set of currently applied options, including defaults
*/
options(): PriceScaleOptions;
options(): Readonly<PriceScaleOptions>;
}

@@ -381,3 +381,3 @@ export interface ISeriesApi<TSeriesType extends SeriesType> {

* Returns current price formatter
* @return - interface to the price formatter object that can be used to format prices in the same way as the chart does
* @returns - interface to the price formatter object that can be used to format prices in the same way as the chart does
*/

@@ -387,3 +387,3 @@ priceFormatter(): IPriceFormatter;

* @param price - input price to be converted
* @result - pixel coordinate of the price level on the chart
* @returns - pixel coordinate of the price level on the chart
*/

@@ -398,3 +398,3 @@ priceToCoordinate(price: BarPrice): Coordinate | null;

* Returns currently applied options
* @return full set of currently applied options, including defaults
* @returns full set of currently applied options, including defaults
*/

@@ -404,3 +404,3 @@ options(): Readonly<SeriesOptionsMap[TSeriesType]>;

* Sets or replaces series data
* @param - ordered (earlier time point goes first) array of data items. Old data is fully replaced with the new one.
* @param data - ordered (earlier time point goes first) array of data items. Old data is fully replaced with the new one.
*/

@@ -410,3 +410,3 @@ setData(data: SeriesDataItemTypeMap[TSeriesType][]): void;

* Adds or replaces a new bar
* @param a single data item to be added. Time of the new item must be greater or equal to the latest existing time point.
* @param bar - a single data item to be added. Time of the new item must be greater or equal to the latest existing time point.
* If the new item's time is equal to the last existing item's time, then the existing item is replaced with the new one.

@@ -420,3 +420,3 @@ */

* Returns current scroll position of the chart
* @return a distance from the right edge to the latest bar, measured in bars
* @returns a distance from the right edge to the latest bar, measured in bars
*/

@@ -436,3 +436,3 @@ scrollPosition(): number;

* Returns current visible time range of the chart
* @return - visible range or null if the chart has no data at all
* @returns - visible range or null if the chart has no data at all
*/

@@ -461,5 +461,5 @@ getVisibleRange(): TimeRange | null;

* Returns current options
* @return - currently applied options
* @returns - currently applied options
*/
options(): TimeScaleOptions;
options(): Readonly<TimeScaleOptions>;
}

@@ -497,3 +497,3 @@ /** Structure describing layout options */

* Current locale, which will be used for formatting dates.
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation}
*/

@@ -585,3 +585,3 @@ locale: string;

Bar: BarData;
Candle: BarData;
Candlestick: BarData;
Area: LineData;

@@ -595,6 +595,8 @@ Line: LineData;

export interface SeriesOptionsCommon {
/** Visibility of the label with the latest visible price on the price scale */
lastValueVisible: boolean;
/** Title of the series. This label is placed with price axis label */
title: string;
/** Visibility of the price line. Price line is a horizontal line indicating the last price of the series */
priceLineVisible: boolean;
/** Visibility of the label with the latest visible price on the price scale */
lastValueVisible: boolean;
/** Width of the price line. Ignored if priceLineVisible is false */

@@ -604,11 +606,18 @@ priceLineWidth: LineWidth;

priceLineColor: string;
/** Price line style. Suitible for percentage and indexedTo100 scales */
priceLineStyle: LineStyle;
/** Formatting settings associated with the series */
priceFormat: PriceFormat;
/** Visibity of base line. Suitible for percentage and indexedTo100 scales */
baseLineVisible: boolean;
/** Color of the base line in IndexedTo100 mode */
baseLineColor: string;
title: string;
/** Base line width. Suitible for percentage and indexedTo100 scales. Ignored if baseLineVisible is not set */
baseLineWidth: LineWidth;
/** Base line style. Suitible for percentage and indexedTo100 scales. Ignored if baseLineVisible is not set */
baseLineStyle: LineStyle;
}
export interface SeriesOptionsMap {
Bar: BarSeriesOptions;
Candle: CandleSeriesOptions;
Candlestick: CandlestickSeriesOptions;
Area: AreaSeriesOptions;

@@ -620,3 +629,3 @@ Line: LineSeriesOptions;

Bar: BarSeriesPartialOptions;
Candle: CandleSeriesPartialOptions;
Candlestick: CandlestickSeriesPartialOptions;
Area: AreaSeriesPartialOptions;

@@ -623,0 +632,0 @@ Line: LineSeriesPartialOptions;

{
"version": "1.0.0-rc.3",
"version": "1.0.0-rc.4",
"name": "lightweight-charts",

@@ -4,0 +4,0 @@ "author": "TradingView, Inc.",

@@ -9,3 +9,3 @@ # Lightweight Charts

[Demos](https://www.tradingview.com/lightweight-charts/) | [Documentation](./docs/getting-started.md)
[Demos](https://www.tradingview.com/lightweight-charts/) | [Documentation](./docs/README.md)

@@ -73,28 +73,4 @@ TradingView Lightweight Charts is one of the smallest and fastest financial HTML5 charts.

Note that the minimal supported version of [NodeJS](https://nodejs.org/) for development is 10.
See [BUILDING.md](./BUILDING.md) for instructions on how to build `lightweight-charts` from source.
### Compiling
- `npm run tsc` - compiles the source code only (excluding tests)
- `npm run tsc-watch` - runs the TypeScript compiler in the watch mode for source code (same as `tsc`, but in the watch mode)
- `npm run tsc-all` - compiles everything (source code and tests)
- `npm run tsc-all-watch` - runs the TypeScript compiler in watch mode for source code and tests (same as `tsc-all`, but in watch mode)
### Bundling
- `npm run rollup` - runs Rollup to bundle code
- `npm run build` - compiles source code and bundles it (as one word for `npm run tsc && npm run rollup`)
Note that only the dev version is bundled by default.
To bundle production builds (minified) too just set the `NODE_ENV` variable to `production` and run bundling, e.g. `NODE_ENV=production npm run rollup`.
### Testing
- `npm run lint` - runs lint for the code
- `npm run test` - runs unit-tests
### Tips
To make sure that your local copy passed all (almost) checks, you can use the `verify` npm script: `npm run verify`.
## License

@@ -101,0 +77,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc