lightweight-charts-react-components 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -5
- package/dist/index.d.ts +6 -3
- package/dist/lightweight-charts-react-components.cjs +2 -2
- package/dist/lightweight-charts-react-components.cjs.map +1 -1
- package/dist/lightweight-charts-react-components.js +2 -2
- package/dist/lightweight-charts-react-components.js.map +1 -1
- package/dist/lightweight-charts-react-components.standalone.js +233 -28
- package/package.json +21 -11
package/README.md
CHANGED
|
@@ -18,17 +18,24 @@
|
|
|
18
18
|
</picture>
|
|
19
19
|
</a>
|
|
20
20
|
|
|
21
|
-
<a href="https://github.com/ukorvl/lightweight-charts-react-components/actions">
|
|
21
|
+
<a href="https://github.com/ukorvl/lightweight-charts-react-components/actions/workflows/build.yaml">
|
|
22
22
|
<picture>
|
|
23
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/actions/workflow/status/ukorvl/lightweight-charts-react-components/
|
|
24
|
-
<img src="https://img.shields.io/github/actions/workflow/status/ukorvl/lightweight-charts-react-components/
|
|
23
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/actions/workflow/status/ukorvl/lightweight-charts-react-components/build.yaml?colorA=1e2029&colorB=1e2029&style=flat">
|
|
24
|
+
<img src="https://img.shields.io/github/actions/workflow/status/ukorvl/lightweight-charts-react-components/build.yaml?colorA=ffcc00&colorB=ffcc00&style=flat" alt="Build Status">
|
|
25
25
|
</picture>
|
|
26
26
|
</a>
|
|
27
27
|
|
|
28
28
|
<a href="https://github.com/ukorvl/lightweight-charts-react-components/blob/main/LICENCE">
|
|
29
29
|
<picture>
|
|
30
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/
|
|
31
|
-
<img src="https://img.shields.io/
|
|
30
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/l/lightweight-charts-react-components?colorA=1e2029&colorB=1e2029&style=flat">
|
|
31
|
+
<img src="https://img.shields.io/npm/l/lightweight-charts-react-components?colorA=ffcc00&colorB=ffcc00&style=flat" alt="Licence">
|
|
32
|
+
</picture>
|
|
33
|
+
</a>
|
|
34
|
+
|
|
35
|
+
<a href="https://bundlephobia.com/package/lightweight-charts-react-components">
|
|
36
|
+
<picture>
|
|
37
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/bundlephobia/minzip/lightweight-charts-react-components?colorA=1e2029&colorB=1e2029&style=flat">
|
|
38
|
+
<img src="https://img.shields.io/bundlephobia/minzip/lightweight-charts-react-components?colorA=ffcc00&colorB=ffcc00&style=flat" alt="Minified size">
|
|
32
39
|
</picture>
|
|
33
40
|
</a>
|
|
34
41
|
|
|
@@ -46,3 +53,46 @@
|
|
|
46
53
|
</picture>
|
|
47
54
|
</a>
|
|
48
55
|
</p>
|
|
56
|
+
|
|
57
|
+
<span style="line-height:4;"></span>
|
|
58
|
+
|
|
59
|
+
## Description
|
|
60
|
+
This library is a set of React components that wrap the Lightweight-charts library. It provides a simple declarative way to use the Lightweight-charts library in your React application.
|
|
61
|
+
|
|
62
|
+
## Table of Contents
|
|
63
|
+
- [Installation](#installation)
|
|
64
|
+
- [Usage](#usage)
|
|
65
|
+
- [Examples](#examples)
|
|
66
|
+
- [Contributing](#contributing)
|
|
67
|
+
- [Licence](#licence)
|
|
68
|
+
|
|
69
|
+
## Installation
|
|
70
|
+
You can install the library via npm, pnpm or yarn:
|
|
71
|
+
```bash
|
|
72
|
+
npm install lightweight-charts-react-components lightweight-charts
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Standalone version of the library is also available:
|
|
76
|
+
```html
|
|
77
|
+
<head>
|
|
78
|
+
<script src="https://unpkg.com/lightweight-charts/dist/lightweight-charts.standalone.production.js" crossorigin></script>
|
|
79
|
+
<script src="https://unpkg.com/lightweight-charts-react-components/dist/lightweight-charts-react-components.standalone.js" crossorigin></script>
|
|
80
|
+
</head>
|
|
81
|
+
<body>
|
|
82
|
+
<script>
|
|
83
|
+
const { Chart, LineSeries } = LightweightChartsReactComponents;
|
|
84
|
+
</script>
|
|
85
|
+
</body>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Usage
|
|
89
|
+
tbd
|
|
90
|
+
|
|
91
|
+
## Examples
|
|
92
|
+
tbd
|
|
93
|
+
|
|
94
|
+
## Contributing
|
|
95
|
+
tbd
|
|
96
|
+
|
|
97
|
+
## Licence
|
|
98
|
+
This project is licensed under the MIT License - see the [LICENCE](./LICENCE) file for details.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/**!
|
|
3
|
-
* lightweight-charts-react-components v0.0.
|
|
3
|
+
* lightweight-charts-react-components v0.0.3
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE.md file in the root directory of this source tree.
|
|
@@ -26,7 +26,6 @@ import { RefAttributes } from 'react';
|
|
|
26
26
|
import type { SeriesDataItemTypeMap } from 'lightweight-charts';
|
|
27
27
|
import type { SeriesMarker } from 'lightweight-charts';
|
|
28
28
|
import type { SeriesPartialOptionsMap } from 'lightweight-charts';
|
|
29
|
-
import type { SeriesType as SeriesType_2 } from 'lightweight-charts';
|
|
30
29
|
import type { SizeChangeEventHandler } from 'lightweight-charts';
|
|
31
30
|
import { Time } from 'lightweight-charts';
|
|
32
31
|
import { TimeChartOptions } from 'lightweight-charts';
|
|
@@ -35,6 +34,10 @@ import type { TimeScaleOptions as TimeScaleOptions_2 } from 'lightweight-charts'
|
|
|
35
34
|
|
|
36
35
|
export declare const AreaSeries: ForwardRefExoticComponent<SeriesProps<"Area"> & RefAttributes<SeriesApiRef<"Area">>>;
|
|
37
36
|
|
|
37
|
+
export declare const BarSeries: ForwardRefExoticComponent<SeriesProps<"Bar"> & RefAttributes<SeriesApiRef<"Bar">>>;
|
|
38
|
+
|
|
39
|
+
export declare const BaselineSeries: ForwardRefExoticComponent<SeriesProps<"Baseline"> & RefAttributes<SeriesApiRef<"Baseline">>>;
|
|
40
|
+
|
|
38
41
|
export declare const CandlestickSeries: ForwardRefExoticComponent<SeriesProps<"Candlestick"> & RefAttributes<SeriesApiRef<"Candlestick">>>;
|
|
39
42
|
|
|
40
43
|
export declare const Chart: ForwardRefExoticComponent< {
|
|
@@ -120,7 +123,7 @@ export declare type SeriesTemplateProps<T extends SeriesType> = {
|
|
|
120
123
|
children?: ReactNode;
|
|
121
124
|
} & SeriesParameters<T>;
|
|
122
125
|
|
|
123
|
-
export declare type SeriesType =
|
|
126
|
+
export declare type SeriesType = "Line" | "Candlestick" | "Histogram" | "Area" | "Baseline" | "Bar";
|
|
124
127
|
|
|
125
128
|
export declare const TimeScale: ForwardRefExoticComponent<TimeScaleProps & RefAttributes<TimeScaleApiRef>>;
|
|
126
129
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/**!
|
|
3
|
-
* lightweight-charts-react-components v0.0.
|
|
3
|
+
* lightweight-charts-react-components v0.0.3
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE.md file in the root directory of this source tree.
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
* @license MIT
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=function(e,r){for(var t in r)__webpack_require__.o(r,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},__webpack_require__.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CandlestickSeries:function(){return CandlestickSeries},HistogramSeries:function(){return series_HistogramSeries},PriceLine:function(){return PriceLine},AreaSeries:function(){return series_AreaSeries},Chart:function(){return chart_ChartWrapper},PriceScale:function(){return PriceScale},TimeScale:function(){return TimeScale},LineSeries:function(){return LineSeries}});var jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_react_namespaceObject=require("react"),ChartContext=(0,external_react_namespaceObject.createContext)({});ChartContext.displayName="ChartContext";var external_lightweight_charts_namespaceObject=require("lightweight-charts");function _object_without_properties(e,r){if(null==e)return{};var t,n,i=_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++){if(t=a[n],!(r.indexOf(t)>=0))Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}}return i}function _object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&(i[t]=e[t]);return i}var useInitChart=function(e){var r=e.container,t=_object_without_properties(e,["container"]),n=t.onClick,i=t.onCrosshairMove,a=t.onInit,c=_object_without_properties(t,["onClick","onCrosshairMove","onInit"]),o=(0,external_react_namespaceObject.useRef)({_chart:null,api:function(){return null===this._chart&&!this.destroyed&&(this._chart=(0,external_lightweight_charts_namespaceObject.createChart)(r,c),a&&a(this._chart)),this._chart},clear:function(){null!==this._chart&&(this._chart.remove(),this._chart=null,this.destroyed=!0)},destroyed:!1});return(0,external_react_namespaceObject.useLayoutEffect)(function(){return o.current.api(),function(){o.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(r){if(n){var e;null===(e=o.current.api())||void 0===e||e.subscribeClick(n)}return function(){if(n){var e;null===(e=o.current.api())||void 0===e||e.unsubscribeClick(n)}}}},[n]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(r){if(i){var e;null===(e=o.current.api())||void 0===e||e.subscribeCrosshairMove(i)}return function(){if(i){var e;null===(e=o.current.api())||void 0===e||e.unsubscribeCrosshairMove(i)}}}},[i]),(0,external_react_namespaceObject.useLayoutEffect)(function(){var e;r&&(null===(e=o.current.api())||void 0===e||e.applyOptions(c))},[c]),o};function _define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){_define_property(e,r,t[r])})}return e}function ChartComponent_object_without_properties(e,r){if(null==e)return{};var t,n,i=ChartComponent_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++){if(t=a[n],!(r.indexOf(t)>=0))Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}}return i}function ChartComponent_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&(i[t]=e[t]);return i}var ChartComponent=function(e){var r=e.children,t=useInitChart(_object_spread({container:e.container},ChartComponent_object_without_properties(e,["children","container"])));return(0,jsx_runtime_namespaceObject.jsx)(ChartContext.Provider,{value:t.current,children:r})},chart_ChartComponent=ChartComponent;function _array_like_to_array(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function _array_with_holes(e){if(Array.isArray(e))return e}function ChartWrapper_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _iterable_to_array_limit(e,r){var t,n,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],c=!0,o=!1;try{for(i=i.call(e);!(c=(t=i.next()).done)&&(a.push(t.value),!r||a.length!==r);c=!0);}catch(e){o=!0,n=e}finally{try{!c&&null!=i.return&&i.return()}finally{if(o)throw n}}return a}}function _non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ChartWrapper_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){ChartWrapper_define_property(e,r,t[r])})}return e}function ChartWrapper_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function _object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ChartWrapper_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function ChartWrapper_object_without_properties(e,r){if(null==e)return{};var t,n,i=ChartWrapper_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++){if(t=a[n],!(r.indexOf(t)>=0))Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}}return i}function ChartWrapper_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&(i[t]=e[t]);return i}function _sliced_to_array(e,r){return _array_with_holes(e)||_iterable_to_array_limit(e,r)||_unsupported_iterable_to_array(e,r)||_non_iterable_rest()}function _unsupported_iterable_to_array(e,r){if(e){if("string"==typeof e)return _array_like_to_array(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _array_like_to_array(e,r)}}var ChartRenderFunction=function(e,r){var t=e.children,n=e.className,i=ChartWrapper_object_without_properties(e,["children","className"]),a=_sliced_to_array((0,external_react_namespaceObject.useState)(),2),c=a[0],o=a[1],s=(0,external_react_namespaceObject.useCallback)(function(e){o(e),r&&("function"==typeof r?s(e):r.current=e)},[r]);return(0,jsx_runtime_namespaceObject.jsx)("div",{ref:s,className:n,children:!!c&&(0,jsx_runtime_namespaceObject.jsx)(chart_ChartComponent,_object_spread_props(ChartWrapper_object_spread({container:c},i),{children:t}))})},ChartWrapper=(0,external_react_namespaceObject.forwardRef)(ChartRenderFunction);ChartWrapper.displayName="ChartWrapper";var chart_ChartWrapper=ChartWrapper,useSafeContext=function(e){var r=(0,external_react_namespaceObject.useContext)(e);if(!r){var t=e.name;throw Error("".concat(t," not found. You can access context value only inside its Provider."))}return r},useInitTimeScale=function(e){var r=e.onVisibleTimeRangeChange,t=e.onVisibleLogicalRangeChange,n=e.onSizeChange,i=e.visibleRange,a=e.visibleLogicalRange,c=e.options,o=void 0===c?{}:c,s=useSafeContext(ChartContext);if(!s)throw Error("Chart context not found");var u=(0,external_react_namespaceObject.useRef)({_timeScale:null,api:function(){if(!this._timeScale){var e=s.api();if(!e)return null;this._timeScale=e.timeScale(),this._timeScale.applyOptions(o),i&&this._timeScale.setVisibleRange(i),a&&this._timeScale.setVisibleLogicalRange(a)}return this._timeScale},clear:function(){null!==this._timeScale&&(this._timeScale=null)}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){return u.current.api(),function(){u.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(s&&o){var e,r;null===(r=u.current)||void 0===r||null===(e=r.api())||void 0===e||e.applyOptions(o)}},[o]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(s){if(n){var e,r;null===(r=u.current)||void 0===r||null===(e=r.api())||void 0===e||e.subscribeSizeChange(n)}return function(){if(n){var e,r;null===(r=u.current)||void 0===r||null===(e=r.api())||void 0===e||e.unsubscribeSizeChange(n)}}}},[n]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(s){if(t){var e,r;null===(r=u.current)||void 0===r||null===(e=r.api())||void 0===e||e.subscribeVisibleLogicalRangeChange(t)}return function(){if(t){var e,r;null===(r=u.current)||void 0===r||null===(e=r.api())||void 0===e||e.unsubscribeVisibleLogicalRangeChange(t)}}}},[t]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(s){if(r){var e,t;null===(t=u.current)||void 0===t||null===(e=t.api())||void 0===e||e.subscribeVisibleTimeRangeChange(r)}return function(){if(r){var e,t;null===(t=u.current)||void 0===t||null===(e=t.api())||void 0===e||e.unsubscribeVisibleTimeRangeChange(r)}}}},[r]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(s&&i){var e,r;null===(r=u.current)||void 0===r||null===(e=r.api())||void 0===e||e.setVisibleRange(i)}},[i]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(s&&a){var e,r;null===(r=u.current)||void 0===r||null===(e=r.api())||void 0===e||e.setVisibleLogicalRange(a)}},[a]),u},TimeScaleRenderFunction=function(e,r){var t=useInitTimeScale(e);return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return t.current},[t]),null},TimeScale_TimeScale=(0,external_react_namespaceObject.forwardRef)(TimeScaleRenderFunction);TimeScale_TimeScale.displayName="TimeScale";var TimeScale=TimeScale_TimeScale;function useInitPriceScale_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function useInitPriceScale_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){useInitPriceScale_define_property(e,r,t[r])})}return e}var useInitPriceScale=function(e){var r=e.options,t=void 0===r?{}:r,n=e.id,i=useSafeContext(ChartContext),a=(0,external_react_namespaceObject.useRef)({_priceScale:null,api:function(){if(!this._priceScale){var e=i.api();if(!e)return null;this._priceScale=e.priceScale(n),this._priceScale.applyOptions(useInitPriceScale_object_spread({},t))}return this._priceScale},setId:function(e){if(null!==this._priceScale)this._priceScale=i.api().priceScale(e)},clear:function(){null!==this._priceScale&&(this._priceScale=null)}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){return a.current.api(),function(){a.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){var e;i&&(null===(e=a.current)||void 0===e||e.setId(n))},[n]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(i&&t){var e,r;null===(r=a.current)||void 0===r||null===(e=r.api())||void 0===e||e.applyOptions(t)}},[t]),a},PriceScaleRenderFunction=function(e,r){var t=useInitPriceScale(e);return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return t.current},[t]),null},PriceScale_PriceScale=(0,external_react_namespaceObject.forwardRef)(PriceScaleRenderFunction);PriceScale_PriceScale.displayName="PriceScale";var PriceScale=PriceScale_PriceScale,useInitSeries=function(e){var r=e.type,t=e.data,n=e.options,i=void 0===n?{}:n,a=e.reactive,c=e.markers,o=useSafeContext(ChartContext),s=(0,external_react_namespaceObject.useRef)({_series:null,api:function(){if(!this._series&&!this.destroyed){var e=o.api();if(!e)return null;this._series=addSeries(e,r),this._series.applyOptions(i),this._series.setData(t),c&&this._series.setMarkers(c)}return this._series},clear:function(){if(null!==this._series){var e;null===(e=o.api())||void 0===e||e.removeSeries(this._series),this._series=null,this.destroyed=!0}},destroyed:!1});return(0,external_react_namespaceObject.useLayoutEffect)(function(){return s.current.api(),function(){s.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(o&&c&&a){var e;null===(e=s.current.api())||void 0===e||e.setMarkers(c)}},[c,a]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(o&&t&&a){var e;null===(e=s.current.api())||void 0===e||e.setData(t)}},[t,a]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(o&&i){var e;null===(e=s.current.api())||void 0===e||e.applyOptions(i)}},[i]),s},addSeries=function(e,r){var t=null;switch(r){case"Line":t=e.addLineSeries();break;case"Candlestick":t=e.addCandlestickSeries();break;case"Histogram":t=e.addHistogramSeries();break;case"Area":t=e.addAreaSeries();break;default:throw Error("Unknown series type: ".concat(r))}return t},SeriesContext=(0,external_react_namespaceObject.createContext)({});function SeriesTemplate_object_without_properties(e,r){if(null==e)return{};var t,n,i=SeriesTemplate_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++){if(t=a[n],!(r.indexOf(t)>=0))Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}}return i}function SeriesTemplate_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&(i[t]=e[t]);return i}SeriesContext.displayName="SeriesContext";var SeriesTemplateRenderFunction=function(e,r){var t=e.children,n=useInitSeries(SeriesTemplate_object_without_properties(e,["children"]));return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return n.current},[n]),(0,jsx_runtime_namespaceObject.jsx)(SeriesContext.Provider,{value:n.current,children:t})},SeriesTemplate=(0,external_react_namespaceObject.forwardRef)(SeriesTemplateRenderFunction);SeriesTemplate.displayName="SeriesTemplate";var series_SeriesTemplate=SeriesTemplate;function LineSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function LineSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){LineSeries_define_property(e,r,t[r])})}return e}function LineSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function LineSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LineSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function LineSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=LineSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++){if(t=a[n],!(r.indexOf(t)>=0))Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}}return i}function LineSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&(i[t]=e[t]);return i}var LineSeriesRenderFunction=function(e,r){var t=e.children,n=LineSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,LineSeries_object_spread_props(LineSeries_object_spread({type:"Line",ref:r},n),{children:t}))},LineSeries_LineSeries=(0,external_react_namespaceObject.forwardRef)(LineSeriesRenderFunction);LineSeries_LineSeries.displayName="LineSeries";var LineSeries=LineSeries_LineSeries;function HistogramSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function HistogramSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){HistogramSeries_define_property(e,r,t[r])})}return e}function HistogramSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function HistogramSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HistogramSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function HistogramSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=HistogramSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++){if(t=a[n],!(r.indexOf(t)>=0))Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}}return i}function HistogramSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&(i[t]=e[t]);return i}var HistogramSeriesRenderFunction=function(e,r){var t=e.children,n=HistogramSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,HistogramSeries_object_spread_props(HistogramSeries_object_spread({type:"Histogram",ref:r},n),{children:t}))},HistogramSeries=(0,external_react_namespaceObject.forwardRef)(HistogramSeriesRenderFunction);HistogramSeries.displayName="HistogramSeries";var series_HistogramSeries=HistogramSeries;function CandlestickSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function CandlestickSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){CandlestickSeries_define_property(e,r,t[r])})}return e}function CandlestickSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function CandlestickSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CandlestickSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function CandlestickSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=CandlestickSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++){if(t=a[n],!(r.indexOf(t)>=0))Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}}return i}function CandlestickSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&(i[t]=e[t]);return i}var CandlestickSeriesRenderFunction=function(e,r){var t=e.children,n=CandlestickSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,CandlestickSeries_object_spread_props(CandlestickSeries_object_spread({type:"Candlestick",ref:r},n),{children:t}))},CandlestickSeries_CandlestickSeries=(0,external_react_namespaceObject.forwardRef)(CandlestickSeriesRenderFunction);CandlestickSeries_CandlestickSeries.displayName="CandlestickSeries";var CandlestickSeries=CandlestickSeries_CandlestickSeries;function AreaSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function AreaSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){AreaSeries_define_property(e,r,t[r])})}return e}function AreaSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function AreaSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):AreaSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function AreaSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=AreaSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++){if(t=a[n],!(r.indexOf(t)>=0))Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}}return i}function AreaSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&(i[t]=e[t]);return i}var AreaSeriesRenderFunction=function(e,r){var t=e.children,n=AreaSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,AreaSeries_object_spread_props(AreaSeries_object_spread({type:"Area",ref:r},n),{children:t}))},AreaSeries=(0,external_react_namespaceObject.forwardRef)(AreaSeriesRenderFunction);AreaSeries.displayName="AreaSeries";var series_AreaSeries=AreaSeries;function useInitPriceLine_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function useInitPriceLine_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){useInitPriceLine_define_property(e,r,t[r])})}return e}var useInitPriceLine=function(e){var r=e.options,t=e.price,n=useSafeContext(SeriesContext),i=(0,external_react_namespaceObject.useRef)({_priceLine:null,api:function(){if(!this._priceLine){var e=n.api();if(!e)return null;this._priceLine=e.createPriceLine(useInitPriceLine_object_spread({price:t},r))}return this._priceLine},clear:function(){if(null!==this._priceLine){var e;null===(e=n.api())||void 0===e||e.removePriceLine(this._priceLine),this._priceLine=null}}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){return i.current.api(),function(){i.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(n&&r){var e;null===(e=i.current.api())||void 0===e||e.applyOptions(r)}},[r]),i},PriceLineRenderFunction=function(e,r){var t=useInitPriceLine(e);return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return t.current},[t]),null},PriceLine_PriceLine=(0,external_react_namespaceObject.forwardRef)(PriceLineRenderFunction);PriceLine_PriceLine.displayName="PriceLine";var PriceLine=PriceLine_PriceLine,__webpack_export_target__=exports;for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__]=__webpack_exports__[__webpack_i__];__webpack_exports__.__esModule&&Object.defineProperty(__webpack_export_target__,"__esModule",{value:!0});
|
|
11
|
+
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=function(e,r){for(var t in r)__webpack_require__.o(r,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},__webpack_require__.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{BarSeries:function(){return BarSeries},LineSeries:function(){return series_LineSeries},Chart:function(){return ChartWrapper},BaselineSeries:function(){return BaselineSeries},PriceLine:function(){return priceLine_PriceLine},CandlestickSeries:function(){return series_CandlestickSeries},HistogramSeries:function(){return series_HistogramSeries},TimeScale:function(){return TimeScale},AreaSeries:function(){return series_AreaSeries},PriceScale:function(){return PriceScale}});var jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_react_namespaceObject=require("react"),ChartContext=(0,external_react_namespaceObject.createContext)({});ChartContext.displayName="ChartContext";var external_lightweight_charts_namespaceObject=require("lightweight-charts");function _object_without_properties(e,r){if(null==e)return{};var t,n,i=_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function _object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var useInitChart=function(e){var r=e.container,t=_object_without_properties(e,["container"]),n=t.onClick,i=t.onCrosshairMove,a=t.onInit,o=_object_without_properties(t,["onClick","onCrosshairMove","onInit"]),c=(0,external_react_namespaceObject.useRef)({_chart:null,api:function(){return null===this._chart&&!this.destroyed&&(this._chart=(0,external_lightweight_charts_namespaceObject.createChart)(r,o),a&&a(this._chart)),this._chart},clear:function(){null!==this._chart&&(this._chart.remove(),this._chart=null,this.destroyed=!0)},destroyed:!1});return(0,external_react_namespaceObject.useLayoutEffect)(function(){return c.current.api(),function(){c.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(r){if(n){var e;null===(e=c.current.api())||void 0===e||e.subscribeClick(n)}return function(){if(n){var e;null===(e=c.current.api())||void 0===e||e.unsubscribeClick(n)}}}},[n]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(r){if(i){var e;null===(e=c.current.api())||void 0===e||e.subscribeCrosshairMove(i)}return function(){if(i){var e;null===(e=c.current.api())||void 0===e||e.unsubscribeCrosshairMove(i)}}}},[i]),(0,external_react_namespaceObject.useLayoutEffect)(function(){var e;r&&(null===(e=c.current.api())||void 0===e||e.applyOptions(o))},[o]),c};function _define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){_define_property(e,r,t[r])})}return e}function ChartComponent_object_without_properties(e,r){if(null==e)return{};var t,n,i=ChartComponent_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function ChartComponent_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var ChartComponent=function(e){var r=e.children,t=useInitChart(_object_spread({container:e.container},ChartComponent_object_without_properties(e,["children","container"])));return(0,jsx_runtime_namespaceObject.jsx)(ChartContext.Provider,{value:t.current,children:r})},chart_ChartComponent=ChartComponent;function _array_like_to_array(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function _array_with_holes(e){if(Array.isArray(e))return e}function ChartWrapper_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _iterable_to_array_limit(e,r){var t,n,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],o=!0,c=!1;try{for(i=i.call(e);!(o=(t=i.next()).done)&&(a.push(t.value),!r||a.length!==r);o=!0);}catch(e){c=!0,n=e}finally{try{o||null==i.return||i.return()}finally{if(c)throw n}}return a}}function _non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ChartWrapper_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){ChartWrapper_define_property(e,r,t[r])})}return e}function ChartWrapper_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function _object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ChartWrapper_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function ChartWrapper_object_without_properties(e,r){if(null==e)return{};var t,n,i=ChartWrapper_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function ChartWrapper_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}function _sliced_to_array(e,r){return _array_with_holes(e)||_iterable_to_array_limit(e,r)||_unsupported_iterable_to_array(e,r)||_non_iterable_rest()}function _unsupported_iterable_to_array(e,r){if(e){if("string"==typeof e)return _array_like_to_array(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _array_like_to_array(e,r)}}var ChartRenderFunction=function(e,r){var t=e.children,n=e.className,i=ChartWrapper_object_without_properties(e,["children","className"]),a=_sliced_to_array((0,external_react_namespaceObject.useState)(),2),o=a[0],c=a[1],s=(0,external_react_namespaceObject.useCallback)(function(e){c(e),r&&("function"==typeof r?s(e):r.current=e)},[r]);return(0,jsx_runtime_namespaceObject.jsx)("div",{ref:s,className:n,children:!!o&&(0,jsx_runtime_namespaceObject.jsx)(chart_ChartComponent,_object_spread_props(ChartWrapper_object_spread({container:o},i),{children:t}))})},ChartWrapper_ChartWrapper=(0,external_react_namespaceObject.forwardRef)(ChartRenderFunction);ChartWrapper_ChartWrapper.displayName="ChartWrapper";var ChartWrapper=ChartWrapper_ChartWrapper,useSafeContext=function(e){var r=(0,external_react_namespaceObject.useContext)(e);if(!r){var t=e.name;throw Error("".concat(t," not found. You can access context value only inside its Provider."))}return r},useInitTimeScale=function(e){var r=e.onVisibleTimeRangeChange,t=e.onVisibleLogicalRangeChange,n=e.onSizeChange,i=e.visibleRange,a=e.visibleLogicalRange,o=e.options,c=void 0===o?{}:o,s=useSafeContext(ChartContext);if(!s)throw Error("Chart context not found");var u=(0,external_react_namespaceObject.useRef)({_timeScale:null,api:function(){if(!this._timeScale){var e=s.api();if(!e)return null;this._timeScale=e.timeScale(),this._timeScale.applyOptions(c),i&&this._timeScale.setVisibleRange(i),a&&this._timeScale.setVisibleLogicalRange(a)}return this._timeScale},clear:function(){null!==this._timeScale&&(this._timeScale=null)}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){return u.current.api(),function(){u.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(s&&c){var e,r;null===(r=u.current)||void 0===r||null===(e=r.api())||void 0===e||e.applyOptions(c)}},[c]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(s){if(n){var e,r;null===(r=u.current)||void 0===r||null===(e=r.api())||void 0===e||e.subscribeSizeChange(n)}return function(){if(n){var e,r;null===(r=u.current)||void 0===r||null===(e=r.api())||void 0===e||e.unsubscribeSizeChange(n)}}}},[n]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(s){if(t){var e,r;null===(r=u.current)||void 0===r||null===(e=r.api())||void 0===e||e.subscribeVisibleLogicalRangeChange(t)}return function(){if(t){var e,r;null===(r=u.current)||void 0===r||null===(e=r.api())||void 0===e||e.unsubscribeVisibleLogicalRangeChange(t)}}}},[t]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(s){if(r){var e,t;null===(t=u.current)||void 0===t||null===(e=t.api())||void 0===e||e.subscribeVisibleTimeRangeChange(r)}return function(){if(r){var e,t;null===(t=u.current)||void 0===t||null===(e=t.api())||void 0===e||e.unsubscribeVisibleTimeRangeChange(r)}}}},[r]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(s&&i){var e,r;null===(r=u.current)||void 0===r||null===(e=r.api())||void 0===e||e.setVisibleRange(i)}},[i]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(s&&a){var e,r;null===(r=u.current)||void 0===r||null===(e=r.api())||void 0===e||e.setVisibleLogicalRange(a)}},[a]),u},TimeScaleRenderFunction=function(e,r){var t=useInitTimeScale(e);return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return t.current},[t]),null},TimeScale_TimeScale=(0,external_react_namespaceObject.forwardRef)(TimeScaleRenderFunction);TimeScale_TimeScale.displayName="TimeScale";var TimeScale=TimeScale_TimeScale;function useInitPriceScale_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function useInitPriceScale_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){useInitPriceScale_define_property(e,r,t[r])})}return e}var useInitPriceScale=function(e){var r=e.options,t=void 0===r?{}:r,n=e.id,i=useSafeContext(ChartContext),a=(0,external_react_namespaceObject.useRef)({_priceScale:null,api:function(){if(!this._priceScale){var e=i.api();if(!e)return null;this._priceScale=e.priceScale(n),this._priceScale.applyOptions(useInitPriceScale_object_spread({},t))}return this._priceScale},setId:function(e){null!==this._priceScale&&(this._priceScale=i.api().priceScale(e))},clear:function(){null!==this._priceScale&&(this._priceScale=null)}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){return a.current.api(),function(){a.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){var e;i&&(null===(e=a.current)||void 0===e||e.setId(n))},[n]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(i&&t){var e,r;null===(r=a.current)||void 0===r||null===(e=r.api())||void 0===e||e.applyOptions(t)}},[t]),a},PriceScaleRenderFunction=function(e,r){var t=useInitPriceScale(e);return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return t.current},[t]),null},PriceScale_PriceScale=(0,external_react_namespaceObject.forwardRef)(PriceScaleRenderFunction);PriceScale_PriceScale.displayName="PriceScale";var PriceScale=PriceScale_PriceScale,useInitSeries=function(e){var r=e.type,t=e.data,n=e.options,i=void 0===n?{}:n,a=e.reactive,o=e.markers,c=useSafeContext(ChartContext),s=(0,external_react_namespaceObject.useRef)({_series:null,api:function(){if(!this._series&&!this.destroyed){var e=c.api();if(!e)return null;this._series=addSeries(e,r),this._series.applyOptions(i),this._series.setData(t),o&&this._series.setMarkers(o)}return this._series},clear:function(){if(null!==this._series){var e;null===(e=c.api())||void 0===e||e.removeSeries(this._series),this._series=null,this.destroyed=!0}},destroyed:!1});return(0,external_react_namespaceObject.useLayoutEffect)(function(){return s.current.api(),function(){s.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(c&&o&&a){var e;null===(e=s.current.api())||void 0===e||e.setMarkers(o)}},[o,a]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(c&&t&&a){var e;null===(e=s.current.api())||void 0===e||e.setData(t)}},[t,a]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(c&&i){var e;null===(e=s.current.api())||void 0===e||e.applyOptions(i)}},[i]),s},addSeries=function(e,r){var t=null;switch(r){case"Line":t=e.addLineSeries();break;case"Candlestick":t=e.addCandlestickSeries();break;case"Histogram":t=e.addHistogramSeries();break;case"Area":t=e.addAreaSeries();break;case"Baseline":t=e.addBaselineSeries();break;case"Bar":t=e.addBarSeries();break;default:throw Error("Unknown series type: ".concat(r))}return t},SeriesContext=(0,external_react_namespaceObject.createContext)({});function SeriesTemplate_object_without_properties(e,r){if(null==e)return{};var t,n,i=SeriesTemplate_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function SeriesTemplate_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}SeriesContext.displayName="SeriesContext";var SeriesTemplateRenderFunction=function(e,r){var t=e.children,n=useInitSeries(SeriesTemplate_object_without_properties(e,["children"]));return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return n.current},[n]),(0,jsx_runtime_namespaceObject.jsx)(SeriesContext.Provider,{value:n.current,children:t})},SeriesTemplate=(0,external_react_namespaceObject.forwardRef)(SeriesTemplateRenderFunction);SeriesTemplate.displayName="SeriesTemplate";var series_SeriesTemplate=SeriesTemplate;function LineSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function LineSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){LineSeries_define_property(e,r,t[r])})}return e}function LineSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function LineSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LineSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function LineSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=LineSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function LineSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var LineSeriesRenderFunction=function(e,r){var t=e.children,n=LineSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,LineSeries_object_spread_props(LineSeries_object_spread({type:"Line",ref:r},n),{children:t}))},LineSeries=(0,external_react_namespaceObject.forwardRef)(LineSeriesRenderFunction);LineSeries.displayName="LineSeries";var series_LineSeries=LineSeries;function HistogramSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function HistogramSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){HistogramSeries_define_property(e,r,t[r])})}return e}function HistogramSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function HistogramSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HistogramSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function HistogramSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=HistogramSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function HistogramSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var HistogramSeriesRenderFunction=function(e,r){var t=e.children,n=HistogramSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,HistogramSeries_object_spread_props(HistogramSeries_object_spread({type:"Histogram",ref:r},n),{children:t}))},HistogramSeries=(0,external_react_namespaceObject.forwardRef)(HistogramSeriesRenderFunction);HistogramSeries.displayName="HistogramSeries";var series_HistogramSeries=HistogramSeries;function CandlestickSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function CandlestickSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){CandlestickSeries_define_property(e,r,t[r])})}return e}function CandlestickSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function CandlestickSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CandlestickSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function CandlestickSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=CandlestickSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function CandlestickSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var CandlestickSeriesRenderFunction=function(e,r){var t=e.children,n=CandlestickSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,CandlestickSeries_object_spread_props(CandlestickSeries_object_spread({type:"Candlestick",ref:r},n),{children:t}))},CandlestickSeries=(0,external_react_namespaceObject.forwardRef)(CandlestickSeriesRenderFunction);CandlestickSeries.displayName="CandlestickSeries";var series_CandlestickSeries=CandlestickSeries;function AreaSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function AreaSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){AreaSeries_define_property(e,r,t[r])})}return e}function AreaSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function AreaSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):AreaSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function AreaSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=AreaSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function AreaSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var AreaSeriesRenderFunction=function(e,r){var t=e.children,n=AreaSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,AreaSeries_object_spread_props(AreaSeries_object_spread({type:"Area",ref:r},n),{children:t}))},AreaSeries=(0,external_react_namespaceObject.forwardRef)(AreaSeriesRenderFunction);AreaSeries.displayName="AreaSeries";var series_AreaSeries=AreaSeries;function BaselineSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function BaselineSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){BaselineSeries_define_property(e,r,t[r])})}return e}function BaselineSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function BaselineSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BaselineSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function BaselineSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=BaselineSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function BaselineSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var BaselineSeriesRenderFunction=function(e,r){var t=e.children,n=BaselineSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,BaselineSeries_object_spread_props(BaselineSeries_object_spread({type:"Baseline",ref:r},n),{children:t}))},BaselineSeries_BaselineSeries=(0,external_react_namespaceObject.forwardRef)(BaselineSeriesRenderFunction);BaselineSeries_BaselineSeries.displayName="BaselineSeries";var BaselineSeries=BaselineSeries_BaselineSeries;function BarSeries_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function BarSeries_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){BarSeries_define_property(e,r,t[r])})}return e}function BarSeries_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function BarSeries_object_spread_props(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BarSeries_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function BarSeries_object_without_properties(e,r){if(null==e)return{};var t,n,i=BarSeries_object_without_properties_loose(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function BarSeries_object_without_properties_loose(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var BarSeriesRenderFunction=function(e,r){var t=e.children,n=BarSeries_object_without_properties(e,["children"]);return(0,jsx_runtime_namespaceObject.jsx)(series_SeriesTemplate,BarSeries_object_spread_props(BarSeries_object_spread({type:"Bar",ref:r},n),{children:t}))},BarSeries_BarSeries=(0,external_react_namespaceObject.forwardRef)(BarSeriesRenderFunction);BarSeries_BarSeries.displayName="BarSeries";var BarSeries=BarSeries_BarSeries;function useInitPriceLine_define_property(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function useInitPriceLine_object_spread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){useInitPriceLine_define_property(e,r,t[r])})}return e}var useInitPriceLine=function(e){var r=e.options,t=e.price,n=useSafeContext(SeriesContext),i=(0,external_react_namespaceObject.useRef)({_priceLine:null,api:function(){if(!this._priceLine){var e=n.api();if(!e)return null;this._priceLine=e.createPriceLine(useInitPriceLine_object_spread({price:t},r))}return this._priceLine},clear:function(){if(null!==this._priceLine){var e;null===(e=n.api())||void 0===e||e.removePriceLine(this._priceLine),this._priceLine=null}}});return(0,external_react_namespaceObject.useLayoutEffect)(function(){return i.current.api(),function(){i.current.clear()}},[]),(0,external_react_namespaceObject.useLayoutEffect)(function(){if(n&&r){var e;null===(e=i.current.api())||void 0===e||e.applyOptions(r)}},[r]),i},PriceLineRenderFunction=function(e,r){var t=useInitPriceLine(e);return(0,external_react_namespaceObject.useImperativeHandle)(r,function(){return t.current},[t]),null},PriceLine=(0,external_react_namespaceObject.forwardRef)(PriceLineRenderFunction);PriceLine.displayName="PriceLine";var priceLine_PriceLine=PriceLine,__webpack_export_target__=exports;for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__]=__webpack_exports__[__webpack_i__];__webpack_exports__.__esModule&&Object.defineProperty(__webpack_export_target__,"__esModule",{value:!0});
|
|
12
12
|
//# sourceMappingURL=lightweight-charts-react-components.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lightweight-charts-react-components.cjs","sources":["webpack://lightweight-charts-react-components/./src/chart/ChartContext.ts","webpack://lightweight-charts-react-components/./src/chart/useInitChart.ts","webpack://lightweight-charts-react-components/./src/chart/ChartComponent.tsx","webpack://lightweight-charts-react-components/./src/chart/ChartWrapper.tsx","webpack://lightweight-charts-react-components/./src/shared/useSafeContext.ts","webpack://lightweight-charts-react-components/./src/scales/useInitTimeScale.ts","webpack://lightweight-charts-react-components/./src/scales/TimeScale.tsx","webpack://lightweight-charts-react-components/./src/scales/useInitPriceScale.ts","webpack://lightweight-charts-react-components/./src/scales/PriceScale.tsx","webpack://lightweight-charts-react-components/./src/series/useInitSeries.ts","webpack://lightweight-charts-react-components/./src/series/SeriesContext.ts","webpack://lightweight-charts-react-components/./src/series/SeriesTemplate.tsx","webpack://lightweight-charts-react-components/./src/series/LineSeries.tsx","webpack://lightweight-charts-react-components/./src/series/HistogramSeries.tsx","webpack://lightweight-charts-react-components/./src/series/CandlestickSeries.tsx","webpack://lightweight-charts-react-components/./src/series/AreaSeries.tsx","webpack://lightweight-charts-react-components/./src/priceLine/useInitPriceLine.ts","webpack://lightweight-charts-react-components/./src/priceLine/PriceLine.tsx"],"sourcesContent":["import { createContext } from \"react\";\nimport { ChartApiRef } from \"./types\";\n\nexport const ChartContext = createContext({} as ChartApiRef);\nChartContext.displayName = \"ChartContext\";\n","import { useLayoutEffect, useRef } from \"react\";\nimport { createChart } from \"lightweight-charts\";\nimport { ChartApiRef, ChartOptions } from \"./types\";\n\nexport const useInitChart = ({\n container,\n ...rest\n}: {\n container: HTMLElement;\n} & ChartOptions) => {\n const { onClick, onCrosshairMove, onInit, ...restOptions } = rest;\n\n const chartApiRef = useRef<ChartApiRef>({\n _chart: null,\n api() {\n if (this._chart === null && !this.destroyed) {\n this._chart = createChart(container, restOptions);\n\n if (onInit) {\n onInit(this._chart);\n }\n }\n\n return this._chart;\n },\n clear() {\n if (this._chart !== null) {\n this._chart.remove();\n this._chart = null;\n this.destroyed = true;\n }\n },\n destroyed: false,\n });\n\n useLayoutEffect(() => {\n chartApiRef.current.api();\n\n return () => {\n chartApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!container) return;\n\n if (onClick) {\n chartApiRef.current.api()?.subscribeClick(onClick);\n }\n\n return () => {\n if (onClick) {\n chartApiRef.current.api()?.unsubscribeClick(onClick);\n }\n };\n }, [onClick]);\n\n useLayoutEffect(() => {\n if (!container) return;\n\n if (onCrosshairMove) {\n chartApiRef.current.api()?.subscribeCrosshairMove(onCrosshairMove);\n }\n\n return () => {\n if (onCrosshairMove) {\n chartApiRef.current.api()?.unsubscribeCrosshairMove(onCrosshairMove);\n }\n };\n }, [onCrosshairMove]);\n\n useLayoutEffect(() => {\n if (!container) return;\n\n chartApiRef.current.api()?.applyOptions(restOptions);\n }, [restOptions]);\n\n return chartApiRef;\n};\n","import { ChartContext } from \"./ChartContext\";\nimport { useInitChart } from \"./useInitChart\";\nimport { ChartProps } from \"./types\";\n\ntype ChartComponentProps = {\n container: HTMLElement;\n} & Omit<ChartProps, \"className\">;\n\nconst ChartComponent: React.FC<ChartComponentProps> = ({ children, container, ...rest }) => {\n const chartApiRef = useInitChart({ container, ...rest });\n\n return <ChartContext.Provider value={chartApiRef.current}>{children}</ChartContext.Provider>;\n};\n\nexport default ChartComponent;\n","import { ForwardRefRenderFunction, forwardRef, useCallback, useState } from \"react\";\nimport { ChartProps } from \"./types\";\nimport ChartComponent from \"./ChartComponent\";\n\nconst ChartRenderFunction: ForwardRefRenderFunction<HTMLDivElement, ChartProps> = (\n { children, className, ...rest },\n ref\n) => {\n const [container, setContainer] = useState<HTMLDivElement>();\n const containerRef = useCallback(\n (r: HTMLDivElement) => {\n setContainer(r);\n\n if (ref) {\n if (typeof ref === \"function\") {\n containerRef(r);\n } else {\n ref.current = r;\n }\n }\n },\n [ref]\n );\n\n return (\n <div ref={containerRef} className={className}>\n {!!container && (\n <ChartComponent container={container} {...rest}>\n {children}\n </ChartComponent>\n )}\n </div>\n );\n};\n\nconst ChartWrapper = forwardRef(ChartRenderFunction);\nChartWrapper.displayName = \"ChartWrapper\";\nexport default ChartWrapper;\n","import { Context, useContext } from \"react\";\n\nexport const useSafeContext = <T>(context: Context<T>) => {\n const currentContextValue = useContext(context);\n\n if (!currentContextValue) {\n const ctxName = context.name;\n throw new Error(`${ctxName} not found. You can access context value only inside its Provider.`);\n }\n\n return currentContextValue;\n};\n","import { useLayoutEffect, useRef } from \"react\";\nimport { TimeScaleApiRef, TimeScaleProps } from \"./types\";\nimport { useSafeContext } from \"@/shared/useSafeContext\";\nimport { ChartContext } from \"@/chart/ChartContext\";\n\nexport const useInitTimeScale = ({\n onVisibleTimeRangeChange,\n onVisibleLogicalRangeChange,\n onSizeChange,\n visibleRange,\n visibleLogicalRange,\n options = {},\n}: TimeScaleProps) => {\n const chart = useSafeContext(ChartContext);\n\n if (!chart) {\n throw new Error(\"Chart context not found\");\n }\n\n const timeScaleApiRef = useRef<TimeScaleApiRef>({\n _timeScale: null,\n api() {\n if (!this._timeScale) {\n const chartApi = chart.api();\n\n if (!chartApi) {\n return null;\n }\n\n this._timeScale = chartApi.timeScale();\n\n this._timeScale.applyOptions(options);\n\n if (visibleRange) {\n this._timeScale.setVisibleRange(visibleRange);\n }\n\n if (visibleLogicalRange) {\n this._timeScale.setVisibleLogicalRange(visibleLogicalRange);\n }\n }\n\n return this._timeScale;\n },\n clear() {\n if (this._timeScale !== null) {\n this._timeScale = null;\n }\n },\n });\n\n useLayoutEffect(() => {\n timeScaleApiRef.current.api();\n\n return () => {\n timeScaleApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (options) {\n timeScaleApiRef.current?.api()?.applyOptions(options);\n }\n }, [options]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (onSizeChange) {\n timeScaleApiRef.current?.api()?.subscribeSizeChange(onSizeChange);\n }\n\n return () => {\n if (onSizeChange) {\n timeScaleApiRef.current?.api()?.unsubscribeSizeChange(onSizeChange);\n }\n };\n }, [onSizeChange]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (onVisibleLogicalRangeChange) {\n timeScaleApiRef.current\n ?.api()\n ?.subscribeVisibleLogicalRangeChange(onVisibleLogicalRangeChange);\n }\n\n return () => {\n if (onVisibleLogicalRangeChange) {\n timeScaleApiRef.current\n ?.api()\n ?.unsubscribeVisibleLogicalRangeChange(onVisibleLogicalRangeChange);\n }\n };\n }, [onVisibleLogicalRangeChange]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (onVisibleTimeRangeChange) {\n timeScaleApiRef.current\n ?.api()\n ?.subscribeVisibleTimeRangeChange(onVisibleTimeRangeChange);\n }\n\n return () => {\n if (onVisibleTimeRangeChange) {\n timeScaleApiRef.current\n ?.api()\n ?.unsubscribeVisibleTimeRangeChange(onVisibleTimeRangeChange);\n }\n };\n }, [onVisibleTimeRangeChange]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (visibleRange) {\n timeScaleApiRef.current?.api()?.setVisibleRange(visibleRange);\n }\n }, [visibleRange]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (visibleLogicalRange) {\n timeScaleApiRef.current\n ?.api()\n ?.setVisibleLogicalRange(visibleLogicalRange);\n }\n }, [visibleLogicalRange]);\n\n return timeScaleApiRef;\n};\n","import { ForwardedRef, forwardRef, useImperativeHandle } from \"react\";\nimport { TimeScaleApiRef, TimeScaleProps } from \"./types\";\nimport { useInitTimeScale } from \"./useInitTimeScale\";\n\nconst TimeScaleRenderFunction = (props: TimeScaleProps, ref: ForwardedRef<TimeScaleApiRef>) => {\n const timeScaleApiRef = useInitTimeScale(props);\n useImperativeHandle(ref, () => timeScaleApiRef.current, [timeScaleApiRef]);\n\n return null;\n};\n\nconst TimeScale = forwardRef(TimeScaleRenderFunction);\nTimeScale.displayName = \"TimeScale\";\nexport default TimeScale;\n","import { useLayoutEffect, useRef } from \"react\";\nimport { PriceScaleProps, PriceScaleApiRef } from \"./types\";\nimport { useSafeContext } from \"@/shared/useSafeContext\";\nimport { ChartContext } from \"@/chart/ChartContext\";\n\nexport const useInitPriceScale = ({ options = {}, id }: PriceScaleProps) => {\n const chart = useSafeContext(ChartContext);\n\n const priceScaleApiRef = useRef<PriceScaleApiRef>({\n _priceScale: null,\n api() {\n if (!this._priceScale) {\n const chartApi = chart.api();\n\n if (!chartApi) {\n return null;\n }\n\n this._priceScale = chartApi.priceScale(id);\n\n this._priceScale.applyOptions({\n ...options,\n });\n }\n\n return this._priceScale;\n },\n setId(id) {\n if (this._priceScale === null) {\n return;\n }\n\n this._priceScale = chart.api()!.priceScale(id);\n },\n clear() {\n if (this._priceScale !== null) {\n this._priceScale = null;\n }\n },\n });\n\n useLayoutEffect(() => {\n priceScaleApiRef.current.api();\n\n return () => {\n priceScaleApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n priceScaleApiRef.current?.setId(id);\n }, [id]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (options) {\n priceScaleApiRef.current?.api()?.applyOptions(options);\n }\n }, [options]);\n\n return priceScaleApiRef;\n};\n","import { ForwardedRef, forwardRef, useImperativeHandle } from \"react\";\nimport { PriceScaleApiRef, PriceScaleProps } from \"./types\";\nimport { useInitPriceScale } from \"./useInitPriceScale\";\n\nconst PriceScaleRenderFunction = (props: PriceScaleProps, ref: ForwardedRef<PriceScaleApiRef>) => {\n const priceScaleApiRef = useInitPriceScale(props);\n useImperativeHandle(ref, () => priceScaleApiRef.current, [priceScaleApiRef]);\n\n return null;\n};\n\nconst PriceScale = forwardRef(PriceScaleRenderFunction);\nPriceScale.displayName = \"PriceScale\";\nexport default PriceScale;\n","import { useLayoutEffect, useRef } from \"react\";\nimport { SeriesApiRef, SeriesTemplateProps, SeriesType } from \"./types\";\nimport { IChartApi, ISeriesApi } from \"lightweight-charts\";\nimport { useSafeContext } from \"@/shared/useSafeContext\";\nimport { ChartContext } from \"@/chart/ChartContext\";\n\nexport const useInitSeries = <T extends SeriesType>({\n type,\n data,\n options = {},\n reactive,\n markers,\n}: Omit<SeriesTemplateProps<T>, \"children\">) => {\n const chart = useSafeContext(ChartContext);\n\n const seriesApiRef = useRef<SeriesApiRef<T>>({\n _series: null,\n api() {\n if (!this._series && !this.destroyed) {\n const chartApi = chart.api();\n\n if (!chartApi) {\n return null;\n }\n\n this._series = addSeries(chartApi, type);\n\n this._series.applyOptions(options);\n\n this._series.setData(data);\n\n if (markers) {\n this._series.setMarkers(markers);\n }\n }\n\n return this._series;\n },\n clear() {\n if (this._series !== null) {\n chart.api()?.removeSeries(this._series);\n this._series = null;\n this.destroyed = true;\n }\n },\n destroyed: false,\n });\n\n useLayoutEffect(() => {\n seriesApiRef.current.api();\n\n return () => {\n seriesApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (markers && reactive) {\n seriesApiRef.current.api()?.setMarkers(markers);\n }\n }, [markers, reactive]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (data && reactive) {\n seriesApiRef.current.api()?.setData(data);\n }\n }, [data, reactive]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (options) {\n seriesApiRef.current.api()?.applyOptions(options);\n }\n }, [options]);\n\n return seriesApiRef;\n};\n\nconst addSeries = <T extends SeriesType>(chart: IChartApi, type: T) => {\n let series = null;\n\n switch (type) {\n case \"Line\":\n series = chart.addLineSeries();\n break;\n case \"Candlestick\":\n series = chart.addCandlestickSeries();\n break;\n case \"Histogram\":\n series = chart.addHistogramSeries();\n break;\n case \"Area\":\n series = chart.addAreaSeries();\n break;\n default:\n throw new Error(`Unknown series type: ${type}`);\n }\n\n return series as ISeriesApi<T>;\n};\n","import { createContext } from \"react\";\nimport { SeriesApiRef, SeriesType } from \"./types\";\n\nexport const SeriesContext = createContext({} as SeriesApiRef<SeriesType>);\nSeriesContext.displayName = \"SeriesContext\";\n","import { useInitSeries } from \"./useInitSeries\";\nimport { SeriesType, SeriesTemplateProps, SeriesApiRef } from \"./types\";\nimport { SeriesContext } from \"./SeriesContext\";\nimport { ForwardedRef, forwardRef, useImperativeHandle } from \"react\";\n\nconst SeriesTemplateRenderFunction = <T extends SeriesType = \"Line\">(\n { children, ...rest }: SeriesTemplateProps<T>,\n ref: ForwardedRef<SeriesApiRef<T>>\n) => {\n const seriesApi = useInitSeries(rest);\n useImperativeHandle(ref, () => seriesApi.current, [seriesApi]);\n\n return <SeriesContext.Provider value={seriesApi.current}>{children}</SeriesContext.Provider>;\n};\n\nconst SeriesTemplate = forwardRef(SeriesTemplateRenderFunction);\nSeriesTemplate.displayName = \"SeriesTemplate\";\nexport default SeriesTemplate;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst LineSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Line\">,\n ref: ForwardedRef<SeriesApiRef<\"Line\">>\n) => {\n return (\n <SeriesTemplate type=\"Line\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst LineSeries = forwardRef(LineSeriesRenderFunction);\nLineSeries.displayName = \"LineSeries\";\nexport default LineSeries;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst HistogramSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Histogram\">,\n ref: ForwardedRef<SeriesApiRef<\"Histogram\">>\n) => {\n return (\n <SeriesTemplate type=\"Histogram\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst HistogramSeries = forwardRef(HistogramSeriesRenderFunction);\nHistogramSeries.displayName = \"HistogramSeries\";\nexport default HistogramSeries;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst CandlestickSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Candlestick\">,\n ref: ForwardedRef<SeriesApiRef<\"Candlestick\">>\n) => {\n return (\n <SeriesTemplate type=\"Candlestick\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst CandlestickSeries = forwardRef(CandlestickSeriesRenderFunction);\nCandlestickSeries.displayName = \"CandlestickSeries\";\nexport default CandlestickSeries;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst AreaSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Area\">,\n ref: ForwardedRef<SeriesApiRef<\"Area\">>\n) => {\n return (\n <SeriesTemplate type=\"Area\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst AreaSeries = forwardRef(AreaSeriesRenderFunction);\nAreaSeries.displayName = \"AreaSeries\";\nexport default AreaSeries;\n","import { useLayoutEffect, useRef } from \"react\";\nimport { PriceLineApiRef, PriceLineProps } from \"./types\";\nimport { useSafeContext } from \"@/shared/useSafeContext\";\nimport { SeriesContext } from \"@/series/SeriesContext\";\n\nexport const useInitPriceLine = ({ options, price }: PriceLineProps) => {\n const series = useSafeContext(SeriesContext);\n\n const priceLineApiRef = useRef<PriceLineApiRef>({\n _priceLine: null,\n api() {\n if (!this._priceLine) {\n const seriesApi = series.api();\n\n if (!seriesApi) {\n return null;\n }\n\n this._priceLine = seriesApi.createPriceLine({\n price,\n ...options,\n });\n }\n\n return this._priceLine;\n },\n clear() {\n if (this._priceLine !== null) {\n series.api()?.removePriceLine(this._priceLine);\n this._priceLine = null;\n }\n },\n });\n\n useLayoutEffect(() => {\n priceLineApiRef.current.api();\n\n return () => {\n priceLineApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!series) return;\n\n if (options) {\n priceLineApiRef.current.api()?.applyOptions(options);\n }\n }, [options]);\n\n return priceLineApiRef;\n};\n","import { ForwardedRef, forwardRef, useImperativeHandle } from \"react\";\nimport { PriceLineApiRef, PriceLineProps } from \"./types\";\nimport { useInitPriceLine } from \"./useInitPriceLine\";\n\nconst PriceLineRenderFunction = (props: PriceLineProps, ref: ForwardedRef<PriceLineApiRef>) => {\n const priceLineApiRef = useInitPriceLine(props);\n useImperativeHandle(ref, () => priceLineApiRef.current, [priceLineApiRef]);\n\n return null;\n};\n\nconst PriceLine = forwardRef(PriceLineRenderFunction);\nPriceLine.displayName = \"PriceLine\";\nexport default PriceLine;\n"],"names":["ChartContext","createContext","useInitChart","container","rest","onClick","onCrosshairMove","onInit","restOptions","chartApiRef","useRef","createChart","useLayoutEffect","_chartApiRef_current_api","ChartComponent","children","ChartRenderFunction","ref","className","_useState","setContainer","containerRef","useCallback","r","ChartWrapper","forwardRef","useSafeContext","context","currentContextValue","useContext","ctxName","Error","useInitTimeScale","onVisibleTimeRangeChange","onVisibleLogicalRangeChange","onSizeChange","visibleRange","visibleLogicalRange","options","chart","timeScaleApiRef","chartApi","_timeScaleApiRef_current_api","TimeScaleRenderFunction","props","useImperativeHandle","TimeScale","useInitPriceScale","id","priceScaleApiRef","_priceScaleApiRef_current","_priceScaleApiRef_current_api","PriceScaleRenderFunction","PriceScale","useInitSeries","type","data","reactive","markers","seriesApiRef","addSeries","_chart_api","_seriesApiRef_current_api","series","SeriesContext","SeriesTemplateRenderFunction","seriesApi","SeriesTemplate","LineSeriesRenderFunction","LineSeries","HistogramSeriesRenderFunction","HistogramSeries","CandlestickSeriesRenderFunction","CandlestickSeries","AreaSeriesRenderFunction","AreaSeries","useInitPriceLine","price","priceLineApiRef","_series_api","_priceLineApiRef_current_api","PriceLineRenderFunction","PriceLine"],"mappings":";;;;;;;;;;qwCAGaA,aAAeC,AAAAA,GAAAA,+BAAAA,aAAAA,AAAAA,EAAc,CAAC,EAC3CD,CAAAA,aAAa,WAAW,CAAG,qjBCApB,IAAME,aAAe,gBAC1BC,EAAAA,EAAAA,SAAS,CACNC,EAAAA,2BAAAA,EAAAA,CADHD,cAKQE,EAAqDD,EAArDC,OAAO,CAAEC,EAA4CF,EAA5CE,eAAe,CAAEC,EAA2BH,EAA3BG,MAAM,CAAKC,EAAAA,2BAAgBJ,EAAAA,CAArDC,UAASC,kBAAiBC,WAE5BE,EAAcC,AAAAA,GAAAA,+BAAAA,MAAAA,AAAAA,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ElE,IACT,EAEMI,oBAAYzD,AAAAA,GAAAA,+BAAAA,UAAAA,AAAAA,EAAWwD,wBAC7BC,CAAAA,oBAAU,WAAW,CAAG,YACxB,cAAeA"}
|
|
1
|
+
{"version":3,"file":"lightweight-charts-react-components.cjs","sources":["webpack://lightweight-charts-react-components/./src/chart/ChartContext.ts","webpack://lightweight-charts-react-components/./src/chart/useInitChart.ts","webpack://lightweight-charts-react-components/./src/chart/ChartComponent.tsx","webpack://lightweight-charts-react-components/./src/chart/ChartWrapper.tsx","webpack://lightweight-charts-react-components/./src/shared/useSafeContext.ts","webpack://lightweight-charts-react-components/./src/scales/useInitTimeScale.ts","webpack://lightweight-charts-react-components/./src/scales/TimeScale.tsx","webpack://lightweight-charts-react-components/./src/scales/useInitPriceScale.ts","webpack://lightweight-charts-react-components/./src/scales/PriceScale.tsx","webpack://lightweight-charts-react-components/./src/series/useInitSeries.ts","webpack://lightweight-charts-react-components/./src/series/SeriesContext.ts","webpack://lightweight-charts-react-components/./src/series/SeriesTemplate.tsx","webpack://lightweight-charts-react-components/./src/series/LineSeries.tsx","webpack://lightweight-charts-react-components/./src/series/HistogramSeries.tsx","webpack://lightweight-charts-react-components/./src/series/CandlestickSeries.tsx","webpack://lightweight-charts-react-components/./src/series/AreaSeries.tsx","webpack://lightweight-charts-react-components/./src/series/BaselineSeries.tsx","webpack://lightweight-charts-react-components/./src/series/BarSeries.tsx","webpack://lightweight-charts-react-components/./src/priceLine/useInitPriceLine.ts","webpack://lightweight-charts-react-components/./src/priceLine/PriceLine.tsx"],"sourcesContent":["import { createContext } from \"react\";\nimport { ChartApiRef } from \"./types\";\n\nexport const ChartContext = createContext({} as ChartApiRef);\nChartContext.displayName = \"ChartContext\";\n","import { useLayoutEffect, useRef } from \"react\";\nimport { createChart } from \"lightweight-charts\";\nimport { ChartApiRef, ChartOptions } from \"./types\";\n\nexport const useInitChart = ({\n container,\n ...rest\n}: {\n container: HTMLElement;\n} & ChartOptions) => {\n const { onClick, onCrosshairMove, onInit, ...restOptions } = rest;\n\n const chartApiRef = useRef<ChartApiRef>({\n _chart: null,\n api() {\n if (this._chart === null && !this.destroyed) {\n this._chart = createChart(container, restOptions);\n\n if (onInit) {\n onInit(this._chart);\n }\n }\n\n return this._chart;\n },\n clear() {\n if (this._chart !== null) {\n this._chart.remove();\n this._chart = null;\n this.destroyed = true;\n }\n },\n destroyed: false,\n });\n\n useLayoutEffect(() => {\n chartApiRef.current.api();\n\n return () => {\n chartApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!container) return;\n\n if (onClick) {\n chartApiRef.current.api()?.subscribeClick(onClick);\n }\n\n return () => {\n if (onClick) {\n chartApiRef.current.api()?.unsubscribeClick(onClick);\n }\n };\n }, [onClick]);\n\n useLayoutEffect(() => {\n if (!container) return;\n\n if (onCrosshairMove) {\n chartApiRef.current.api()?.subscribeCrosshairMove(onCrosshairMove);\n }\n\n return () => {\n if (onCrosshairMove) {\n chartApiRef.current.api()?.unsubscribeCrosshairMove(onCrosshairMove);\n }\n };\n }, [onCrosshairMove]);\n\n useLayoutEffect(() => {\n if (!container) return;\n\n chartApiRef.current.api()?.applyOptions(restOptions);\n }, [restOptions]);\n\n return chartApiRef;\n};\n","import { ChartContext } from \"./ChartContext\";\nimport { useInitChart } from \"./useInitChart\";\nimport { ChartProps } from \"./types\";\n\ntype ChartComponentProps = {\n container: HTMLElement;\n} & Omit<ChartProps, \"className\">;\n\nconst ChartComponent: React.FC<ChartComponentProps> = ({ children, container, ...rest }) => {\n const chartApiRef = useInitChart({ container, ...rest });\n\n return <ChartContext.Provider value={chartApiRef.current}>{children}</ChartContext.Provider>;\n};\n\nexport default ChartComponent;\n","import { ForwardRefRenderFunction, forwardRef, useCallback, useState } from \"react\";\nimport { ChartProps } from \"./types\";\nimport ChartComponent from \"./ChartComponent\";\n\nconst ChartRenderFunction: ForwardRefRenderFunction<HTMLDivElement, ChartProps> = (\n { children, className, ...rest },\n ref\n) => {\n const [container, setContainer] = useState<HTMLDivElement>();\n const containerRef = useCallback(\n (r: HTMLDivElement) => {\n setContainer(r);\n\n if (ref) {\n if (typeof ref === \"function\") {\n containerRef(r);\n } else {\n ref.current = r;\n }\n }\n },\n [ref]\n );\n\n return (\n <div ref={containerRef} className={className}>\n {!!container && (\n <ChartComponent container={container} {...rest}>\n {children}\n </ChartComponent>\n )}\n </div>\n );\n};\n\nconst ChartWrapper = forwardRef(ChartRenderFunction);\nChartWrapper.displayName = \"ChartWrapper\";\nexport default ChartWrapper;\n","import { Context, useContext } from \"react\";\n\nexport const useSafeContext = <T>(context: Context<T>) => {\n const currentContextValue = useContext(context);\n\n if (!currentContextValue) {\n const ctxName = context.name;\n throw new Error(`${ctxName} not found. You can access context value only inside its Provider.`);\n }\n\n return currentContextValue;\n};\n","import { useLayoutEffect, useRef } from \"react\";\nimport { TimeScaleApiRef, TimeScaleProps } from \"./types\";\nimport { useSafeContext } from \"@/shared/useSafeContext\";\nimport { ChartContext } from \"@/chart/ChartContext\";\n\nexport const useInitTimeScale = ({\n onVisibleTimeRangeChange,\n onVisibleLogicalRangeChange,\n onSizeChange,\n visibleRange,\n visibleLogicalRange,\n options = {},\n}: TimeScaleProps) => {\n const chart = useSafeContext(ChartContext);\n\n if (!chart) {\n throw new Error(\"Chart context not found\");\n }\n\n const timeScaleApiRef = useRef<TimeScaleApiRef>({\n _timeScale: null,\n api() {\n if (!this._timeScale) {\n const chartApi = chart.api();\n\n if (!chartApi) {\n return null;\n }\n\n this._timeScale = chartApi.timeScale();\n\n this._timeScale.applyOptions(options);\n\n if (visibleRange) {\n this._timeScale.setVisibleRange(visibleRange);\n }\n\n if (visibleLogicalRange) {\n this._timeScale.setVisibleLogicalRange(visibleLogicalRange);\n }\n }\n\n return this._timeScale;\n },\n clear() {\n if (this._timeScale !== null) {\n this._timeScale = null;\n }\n },\n });\n\n useLayoutEffect(() => {\n timeScaleApiRef.current.api();\n\n return () => {\n timeScaleApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (options) {\n timeScaleApiRef.current?.api()?.applyOptions(options);\n }\n }, [options]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (onSizeChange) {\n timeScaleApiRef.current?.api()?.subscribeSizeChange(onSizeChange);\n }\n\n return () => {\n if (onSizeChange) {\n timeScaleApiRef.current?.api()?.unsubscribeSizeChange(onSizeChange);\n }\n };\n }, [onSizeChange]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (onVisibleLogicalRangeChange) {\n timeScaleApiRef.current\n ?.api()\n ?.subscribeVisibleLogicalRangeChange(onVisibleLogicalRangeChange);\n }\n\n return () => {\n if (onVisibleLogicalRangeChange) {\n timeScaleApiRef.current\n ?.api()\n ?.unsubscribeVisibleLogicalRangeChange(onVisibleLogicalRangeChange);\n }\n };\n }, [onVisibleLogicalRangeChange]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (onVisibleTimeRangeChange) {\n timeScaleApiRef.current\n ?.api()\n ?.subscribeVisibleTimeRangeChange(onVisibleTimeRangeChange);\n }\n\n return () => {\n if (onVisibleTimeRangeChange) {\n timeScaleApiRef.current\n ?.api()\n ?.unsubscribeVisibleTimeRangeChange(onVisibleTimeRangeChange);\n }\n };\n }, [onVisibleTimeRangeChange]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (visibleRange) {\n timeScaleApiRef.current?.api()?.setVisibleRange(visibleRange);\n }\n }, [visibleRange]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (visibleLogicalRange) {\n timeScaleApiRef.current\n ?.api()\n ?.setVisibleLogicalRange(visibleLogicalRange);\n }\n }, [visibleLogicalRange]);\n\n return timeScaleApiRef;\n};\n","import { ForwardedRef, forwardRef, useImperativeHandle } from \"react\";\nimport { TimeScaleApiRef, TimeScaleProps } from \"./types\";\nimport { useInitTimeScale } from \"./useInitTimeScale\";\n\nconst TimeScaleRenderFunction = (props: TimeScaleProps, ref: ForwardedRef<TimeScaleApiRef>) => {\n const timeScaleApiRef = useInitTimeScale(props);\n useImperativeHandle(ref, () => timeScaleApiRef.current, [timeScaleApiRef]);\n\n return null;\n};\n\nconst TimeScale = forwardRef(TimeScaleRenderFunction);\nTimeScale.displayName = \"TimeScale\";\nexport default TimeScale;\n","import { useLayoutEffect, useRef } from \"react\";\nimport { PriceScaleProps, PriceScaleApiRef } from \"./types\";\nimport { useSafeContext } from \"@/shared/useSafeContext\";\nimport { ChartContext } from \"@/chart/ChartContext\";\n\nexport const useInitPriceScale = ({ options = {}, id }: PriceScaleProps) => {\n const chart = useSafeContext(ChartContext);\n\n const priceScaleApiRef = useRef<PriceScaleApiRef>({\n _priceScale: null,\n api() {\n if (!this._priceScale) {\n const chartApi = chart.api();\n\n if (!chartApi) {\n return null;\n }\n\n this._priceScale = chartApi.priceScale(id);\n\n this._priceScale.applyOptions({\n ...options,\n });\n }\n\n return this._priceScale;\n },\n setId(id) {\n if (this._priceScale === null) {\n return;\n }\n\n this._priceScale = chart.api()!.priceScale(id);\n },\n clear() {\n if (this._priceScale !== null) {\n this._priceScale = null;\n }\n },\n });\n\n useLayoutEffect(() => {\n priceScaleApiRef.current.api();\n\n return () => {\n priceScaleApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n priceScaleApiRef.current?.setId(id);\n }, [id]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (options) {\n priceScaleApiRef.current?.api()?.applyOptions(options);\n }\n }, [options]);\n\n return priceScaleApiRef;\n};\n","import { ForwardedRef, forwardRef, useImperativeHandle } from \"react\";\nimport { PriceScaleApiRef, PriceScaleProps } from \"./types\";\nimport { useInitPriceScale } from \"./useInitPriceScale\";\n\nconst PriceScaleRenderFunction = (props: PriceScaleProps, ref: ForwardedRef<PriceScaleApiRef>) => {\n const priceScaleApiRef = useInitPriceScale(props);\n useImperativeHandle(ref, () => priceScaleApiRef.current, [priceScaleApiRef]);\n\n return null;\n};\n\nconst PriceScale = forwardRef(PriceScaleRenderFunction);\nPriceScale.displayName = \"PriceScale\";\nexport default PriceScale;\n","import { useLayoutEffect, useRef } from \"react\";\nimport { SeriesApiRef, SeriesTemplateProps, SeriesType } from \"./types\";\nimport { IChartApi, ISeriesApi } from \"lightweight-charts\";\nimport { useSafeContext } from \"@/shared/useSafeContext\";\nimport { ChartContext } from \"@/chart/ChartContext\";\n\nexport const useInitSeries = <T extends SeriesType>({\n type,\n data,\n options = {},\n reactive,\n markers,\n}: Omit<SeriesTemplateProps<T>, \"children\">) => {\n const chart = useSafeContext(ChartContext);\n\n const seriesApiRef = useRef<SeriesApiRef<T>>({\n _series: null,\n api() {\n if (!this._series && !this.destroyed) {\n const chartApi = chart.api();\n\n if (!chartApi) {\n return null;\n }\n\n this._series = addSeries(chartApi, type);\n\n this._series.applyOptions(options);\n\n this._series.setData(data);\n\n if (markers) {\n this._series.setMarkers(markers);\n }\n }\n\n return this._series;\n },\n clear() {\n if (this._series !== null) {\n chart.api()?.removeSeries(this._series);\n this._series = null;\n this.destroyed = true;\n }\n },\n destroyed: false,\n });\n\n useLayoutEffect(() => {\n seriesApiRef.current.api();\n\n return () => {\n seriesApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (markers && reactive) {\n seriesApiRef.current.api()?.setMarkers(markers);\n }\n }, [markers, reactive]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (data && reactive) {\n seriesApiRef.current.api()?.setData(data);\n }\n }, [data, reactive]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (options) {\n seriesApiRef.current.api()?.applyOptions(options);\n }\n }, [options]);\n\n return seriesApiRef;\n};\n\nconst addSeries = <T extends SeriesType>(chart: IChartApi, type: T) => {\n let series = null;\n\n switch (type) {\n case \"Line\":\n series = chart.addLineSeries();\n break;\n case \"Candlestick\":\n series = chart.addCandlestickSeries();\n break;\n case \"Histogram\":\n series = chart.addHistogramSeries();\n break;\n case \"Area\":\n series = chart.addAreaSeries();\n break;\n case \"Baseline\":\n series = chart.addBaselineSeries();\n break;\n case \"Bar\":\n series = chart.addBarSeries();\n break;\n default:\n throw new Error(`Unknown series type: ${type}`);\n }\n\n return series as ISeriesApi<T>;\n};\n","import { createContext } from \"react\";\nimport { SeriesApiRef, SeriesType } from \"./types\";\n\nexport const SeriesContext = createContext({} as SeriesApiRef<SeriesType>);\nSeriesContext.displayName = \"SeriesContext\";\n","import { useInitSeries } from \"./useInitSeries\";\nimport { SeriesType, SeriesTemplateProps, SeriesApiRef } from \"./types\";\nimport { SeriesContext } from \"./SeriesContext\";\nimport { ForwardedRef, forwardRef, useImperativeHandle } from \"react\";\n\nconst SeriesTemplateRenderFunction = <T extends SeriesType = \"Line\">(\n { children, ...rest }: SeriesTemplateProps<T>,\n ref: ForwardedRef<SeriesApiRef<T>>\n) => {\n const seriesApi = useInitSeries(rest);\n useImperativeHandle(ref, () => seriesApi.current, [seriesApi]);\n\n return <SeriesContext.Provider value={seriesApi.current}>{children}</SeriesContext.Provider>;\n};\n\nconst SeriesTemplate = forwardRef(SeriesTemplateRenderFunction);\nSeriesTemplate.displayName = \"SeriesTemplate\";\nexport default SeriesTemplate;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst LineSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Line\">,\n ref: ForwardedRef<SeriesApiRef<\"Line\">>\n) => {\n return (\n <SeriesTemplate type=\"Line\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst LineSeries = forwardRef(LineSeriesRenderFunction);\nLineSeries.displayName = \"LineSeries\";\nexport default LineSeries;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst HistogramSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Histogram\">,\n ref: ForwardedRef<SeriesApiRef<\"Histogram\">>\n) => {\n return (\n <SeriesTemplate type=\"Histogram\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst HistogramSeries = forwardRef(HistogramSeriesRenderFunction);\nHistogramSeries.displayName = \"HistogramSeries\";\nexport default HistogramSeries;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst CandlestickSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Candlestick\">,\n ref: ForwardedRef<SeriesApiRef<\"Candlestick\">>\n) => {\n return (\n <SeriesTemplate type=\"Candlestick\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst CandlestickSeries = forwardRef(CandlestickSeriesRenderFunction);\nCandlestickSeries.displayName = \"CandlestickSeries\";\nexport default CandlestickSeries;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst AreaSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Area\">,\n ref: ForwardedRef<SeriesApiRef<\"Area\">>\n) => {\n return (\n <SeriesTemplate type=\"Area\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst AreaSeries = forwardRef(AreaSeriesRenderFunction);\nAreaSeries.displayName = \"AreaSeries\";\nexport default AreaSeries;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst BaselineSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Baseline\">,\n ref: ForwardedRef<SeriesApiRef<\"Baseline\">>,\n) => {\n return (\n <SeriesTemplate type=\"Baseline\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst BaselineSeries = forwardRef(BaselineSeriesRenderFunction);\nBaselineSeries.displayName = \"BaselineSeries\";\nexport default BaselineSeries;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst BarSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Bar\">,\n ref: ForwardedRef<SeriesApiRef<\"Bar\">>,\n) => {\n return (\n <SeriesTemplate type=\"Bar\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst BarSeries = forwardRef(BarSeriesRenderFunction);\nBarSeries.displayName = \"BarSeries\";\nexport default BarSeries;\n","import { useLayoutEffect, useRef } from \"react\";\nimport { PriceLineApiRef, PriceLineProps } from \"./types\";\nimport { useSafeContext } from \"@/shared/useSafeContext\";\nimport { SeriesContext } from \"@/series/SeriesContext\";\n\nexport const useInitPriceLine = ({ options, price }: PriceLineProps) => {\n const series = useSafeContext(SeriesContext);\n\n const priceLineApiRef = useRef<PriceLineApiRef>({\n _priceLine: null,\n api() {\n if (!this._priceLine) {\n const seriesApi = series.api();\n\n if (!seriesApi) {\n return null;\n }\n\n this._priceLine = seriesApi.createPriceLine({\n price,\n ...options,\n });\n }\n\n return this._priceLine;\n },\n clear() {\n if (this._priceLine !== null) {\n series.api()?.removePriceLine(this._priceLine);\n this._priceLine = null;\n }\n },\n });\n\n useLayoutEffect(() => {\n priceLineApiRef.current.api();\n\n return () => {\n priceLineApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!series) return;\n\n if (options) {\n priceLineApiRef.current.api()?.applyOptions(options);\n }\n }, [options]);\n\n return priceLineApiRef;\n};\n","import { ForwardedRef, forwardRef, useImperativeHandle } from \"react\";\nimport { PriceLineApiRef, PriceLineProps } from \"./types\";\nimport { useInitPriceLine } from \"./useInitPriceLine\";\n\nconst PriceLineRenderFunction = (props: PriceLineProps, ref: ForwardedRef<PriceLineApiRef>) => {\n const priceLineApiRef = useInitPriceLine(props);\n useImperativeHandle(ref, () => priceLineApiRef.current, [priceLineApiRef]);\n\n return null;\n};\n\nconst PriceLine = forwardRef(PriceLineRenderFunction);\nPriceLine.displayName = \"PriceLine\";\nexport default PriceLine;\n"],"names":["ChartContext","createContext","useInitChart","container","rest","onClick","onCrosshairMove","onInit","restOptions","chartApiRef","useRef","createChart","useLayoutEffect","_chartApiRef_current_api","ChartComponent","children","ChartRenderFunction","ref","className","_useState","setContainer","containerRef","useCallback","r","ChartWrapper","forwardRef","useSafeContext","context","currentContextValue","useContext","ctxName","Error","useInitTimeScale","onVisibleTimeRangeChange","onVisibleLogicalRangeChange","onSizeChange","visibleRange","visibleLogicalRange","options","chart","timeScaleApiRef","chartApi","_timeScaleApiRef_current_api","TimeScaleRenderFunction","props","useImperativeHandle","TimeScale","useInitPriceScale","id","priceScaleApiRef","_priceScaleApiRef_current","_priceScaleApiRef_current_api","PriceScaleRenderFunction","PriceScale","useInitSeries","type","data","reactive","markers","seriesApiRef","addSeries","_chart_api","_seriesApiRef_current_api","series","SeriesContext","SeriesTemplateRenderFunction","seriesApi","SeriesTemplate","LineSeriesRenderFunction","LineSeries","HistogramSeriesRenderFunction","HistogramSeries","CandlestickSeriesRenderFunction","CandlestickSeries","AreaSeriesRenderFunction","AreaSeries","BaselineSeriesRenderFunction","BaselineSeries","BarSeriesRenderFunction","BarSeries","useInitPriceLine","price","priceLineApiRef","_series_api","_priceLineApiRef_current_api","PriceLineRenderFunction","PriceLine"],"mappings":";;;;;;;;;;+2CAGaA,aAAeC,AAAAA,GAAAA,+BAAAA,aAAAA,AAAAA,EAAc,CAAC,EAC3CD,CAAAA,aAAa,WAAW,CAAG,8iBCApB,IAAME,aAAe,gBAC1BC,EAAAA,EAAAA,SAAS,CACNC,EAAAA,2BAAAA,EAAAA,CADHD,cAKQE,EAAqDD,EAArDC,OAAO,CAAEC,EAA4CF,EAA5CE,eAAe,CAAEC,EAA2BH,EAA3BG,MAAM,CAAKC,EAAAA,2BAAgBJ,EAAAA,CAArDC,UAASC,kBAAiBC,WAE5BE,EAAcC,AAAAA,GAA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,EAAAA,EAAO,GAAG,EAAC,GAAXA,AAAAA,KAAAA,IAAAA,GAAAA,EAAc,eAAe,CAAC,IAAI,CAAC,UAAU,EAC7C,IAAI,CAAC,UAAU,CAAG,IACpB,CACF,CACF,GAkBA,MAhBAvE,AAAAA,GAAAA,+BAAAA,eAAAA,AAAAA,EAAgB,WAGd,OAFAsE,EAAgB,OAAO,CAAC,GAAG,GAEpB,WACLA,EAAgB,OAAO,CAAC,KAAK,EAC/B,CACF,EAAG,EAAE,EAELtE,AAAAA,GAAAA,+BAAAA,eAAAA,AAAAA,EAAgB,WACd,GAAKmD,GAEDzB,EAAS,KACX8C,CAA2B,QAA3BA,CAAAA,EAAAA,EAAgB,OAAO,CAAC,GAAG,EAAC,GAA5BA,AAAAA,KAAAA,IAAAA,GAAAA,EAA+B,YAAY,CAAC9C,EAC9C,CACF,EAAG,CAACA,EAAQ,EAEL4C,CACT,EC/CMG,wBAA0B,SAACzC,CAAK,CAAkB3B,CAAG,EACzD,IAAMiE,EAAkBF,iBAAiBpC,GAGzC,MAFAC,AAAAA,GAAAA,+BAAAA,mBAAAA,AAAAA,EAAoB5B,EAAK,kBAAMiE,EAAgB,OAAO,EAAE,CAACA,EAAgB,EAElE,IACT,EAEMI,UAAY7D,AAAAA,GAAAA,+BAAAA,UAAAA,AAAAA,EAAW4D,wBAC7BC,CAAAA,UAAU,WAAW,CAAG,YACxB,wBAAeA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/**!
|
|
3
|
-
* lightweight-charts-react-components v0.0.
|
|
3
|
+
* lightweight-charts-react-components v0.0.3
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE.md file in the root directory of this source tree.
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
* @license MIT
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import*as e from"react/jsx-runtime";import*as r from"react";import*as i from"lightweight-charts";let t=(0,r.createContext)({});t.displayName="ChartContext";let a=({container:e,...t})=>{let{onClick:a,onCrosshairMove:l,onInit:s,...n}=t,u=(0,r.useRef)({_chart:null,api(){return null===this._chart&&!this.destroyed&&(this._chart=(0,i.createChart)(e,n),s&&s(this._chart)),this._chart},clear(){null!==this._chart&&(this._chart.remove(),this._chart=null,this.destroyed=!0)},destroyed:!1});return(0,r.useLayoutEffect)(()=>(u.current.api(),()=>{u.current.clear()}),[]),(0,r.useLayoutEffect)(()=>{if(e){if(a){var r;null===(r=u.current.api())||void 0===r||r.subscribeClick(a)}return()=>{if(a){var e;null===(e=u.current.api())||void 0===e||e.unsubscribeClick(a)}}}},[a]),(0,r.useLayoutEffect)(()=>{if(e){if(l){var r;null===(r=u.current.api())||void 0===r||r.subscribeCrosshairMove(l)}return()=>{if(l){var e;null===(e=u.current.api())||void 0===e||e.unsubscribeCrosshairMove(l)}}}},[l]),(0,r.useLayoutEffect)(()=>{var r;e&&(null===(r=u.current.api())||void 0===r||r.applyOptions(n))},[n]),u},l=({children:r,container:i,...l})=>{let s=a({container:i,...l});return(0,e.jsx)(t.Provider,{value:s.current,children:r})},s=(0,r.forwardRef)(({children:i,className:t,...a},s)=>{let[n,u]=(0,r.useState)(),c=(0,r.useCallback)(e=>{u(e),s&&("function"==typeof s?c(e):s.current=e)},[s]);return(0,e.jsx)("div",{ref:c,className:t,children:!!n&&(0,e.jsx)(l,{container:n,...a,children:i})})});s.displayName="ChartWrapper";let n=s,u=e=>{let i=(0,r.useContext)(e);if(!i){let r=e.name;throw Error(`${r} not found. You can access context value only inside its Provider.`)}return i},c=({onVisibleTimeRangeChange:e,onVisibleLogicalRangeChange:i,onSizeChange:a,visibleRange:l,visibleLogicalRange:s,options:n={}})=>{let c=u(t);if(!c)throw Error("Chart context not found");let o=(0,r.useRef)({_timeScale:null,api(){if(!this._timeScale){let e=c.api();if(!e)return null;this._timeScale=e.timeScale(),this._timeScale.applyOptions(n),l&&this._timeScale.setVisibleRange(l),s&&this._timeScale.setVisibleLogicalRange(s)}return this._timeScale},clear(){null!==this._timeScale&&(this._timeScale=null)}});return(0,r.useLayoutEffect)(()=>(o.current.api(),()=>{o.current.clear()}),[]),(0,r.useLayoutEffect)(()=>{if(c&&n){var e,r;null===(r=o.current)||void 0===r||null===(e=r.api())||void 0===e||e.applyOptions(n)}},[n]),(0,r.useLayoutEffect)(()=>{if(c){if(a){var e,r;null===(r=o.current)||void 0===r||null===(e=r.api())||void 0===e||e.subscribeSizeChange(a)}return()=>{if(a){var e,r;null===(r=o.current)||void 0===r||null===(e=r.api())||void 0===e||e.unsubscribeSizeChange(a)}}}},[a]),(0,r.useLayoutEffect)(()=>{if(c){if(i){var e,r;null===(r=o.current)||void 0===r||null===(e=r.api())||void 0===e||e.subscribeVisibleLogicalRangeChange(i)}return()=>{if(i){var e,r;null===(r=o.current)||void 0===r||null===(e=r.api())||void 0===e||e.unsubscribeVisibleLogicalRangeChange(i)}}}},[i]),(0,r.useLayoutEffect)(()=>{if(c){if(e){var r,i;null===(i=o.current)||void 0===i||null===(r=i.api())||void 0===r||r.subscribeVisibleTimeRangeChange(e)}return()=>{if(e){var r,i;null===(i=o.current)||void 0===i||null===(r=i.api())||void 0===r||r.unsubscribeVisibleTimeRangeChange(e)}}}},[e]),(0,r.useLayoutEffect)(()=>{if(c&&l){var e,r;null===(r=o.current)||void 0===r||null===(e=r.api())||void 0===e||e.setVisibleRange(l)}},[l]),(0,r.useLayoutEffect)(()=>{if(c&&s){var e,r;null===(r=o.current)||void 0===r||null===(e=r.api())||void 0===e||e.setVisibleLogicalRange(s)}},[s]),o},o=(0,r.forwardRef)((e,i)=>{let t=c(e);return(0,r.useImperativeHandle)(i,()=>t.current,[t]),null});o.displayName="TimeScale";let f=o,p=({options:e={},id:i})=>{let a=u(t),l=(0,r.useRef)({_priceScale:null,api(){if(!this._priceScale){let r=a.api();if(!r)return null;this._priceScale=r.priceScale(i),this._priceScale.applyOptions({...e})}return this._priceScale},setId(e){
|
|
11
|
+
import*as e from"react/jsx-runtime";import*as r from"react";import*as i from"lightweight-charts";let t=(0,r.createContext)({});t.displayName="ChartContext";let a=({container:e,...t})=>{let{onClick:a,onCrosshairMove:l,onInit:s,...n}=t,u=(0,r.useRef)({_chart:null,api(){return null===this._chart&&!this.destroyed&&(this._chart=(0,i.createChart)(e,n),s&&s(this._chart)),this._chart},clear(){null!==this._chart&&(this._chart.remove(),this._chart=null,this.destroyed=!0)},destroyed:!1});return(0,r.useLayoutEffect)(()=>(u.current.api(),()=>{u.current.clear()}),[]),(0,r.useLayoutEffect)(()=>{if(e){if(a){var r;null===(r=u.current.api())||void 0===r||r.subscribeClick(a)}return()=>{if(a){var e;null===(e=u.current.api())||void 0===e||e.unsubscribeClick(a)}}}},[a]),(0,r.useLayoutEffect)(()=>{if(e){if(l){var r;null===(r=u.current.api())||void 0===r||r.subscribeCrosshairMove(l)}return()=>{if(l){var e;null===(e=u.current.api())||void 0===e||e.unsubscribeCrosshairMove(l)}}}},[l]),(0,r.useLayoutEffect)(()=>{var r;e&&(null===(r=u.current.api())||void 0===r||r.applyOptions(n))},[n]),u},l=({children:r,container:i,...l})=>{let s=a({container:i,...l});return(0,e.jsx)(t.Provider,{value:s.current,children:r})},s=(0,r.forwardRef)(({children:i,className:t,...a},s)=>{let[n,u]=(0,r.useState)(),c=(0,r.useCallback)(e=>{u(e),s&&("function"==typeof s?c(e):s.current=e)},[s]);return(0,e.jsx)("div",{ref:c,className:t,children:!!n&&(0,e.jsx)(l,{container:n,...a,children:i})})});s.displayName="ChartWrapper";let n=s,u=e=>{let i=(0,r.useContext)(e);if(!i){let r=e.name;throw Error(`${r} not found. You can access context value only inside its Provider.`)}return i},c=({onVisibleTimeRangeChange:e,onVisibleLogicalRangeChange:i,onSizeChange:a,visibleRange:l,visibleLogicalRange:s,options:n={}})=>{let c=u(t);if(!c)throw Error("Chart context not found");let o=(0,r.useRef)({_timeScale:null,api(){if(!this._timeScale){let e=c.api();if(!e)return null;this._timeScale=e.timeScale(),this._timeScale.applyOptions(n),l&&this._timeScale.setVisibleRange(l),s&&this._timeScale.setVisibleLogicalRange(s)}return this._timeScale},clear(){null!==this._timeScale&&(this._timeScale=null)}});return(0,r.useLayoutEffect)(()=>(o.current.api(),()=>{o.current.clear()}),[]),(0,r.useLayoutEffect)(()=>{if(c&&n){var e,r;null===(r=o.current)||void 0===r||null===(e=r.api())||void 0===e||e.applyOptions(n)}},[n]),(0,r.useLayoutEffect)(()=>{if(c){if(a){var e,r;null===(r=o.current)||void 0===r||null===(e=r.api())||void 0===e||e.subscribeSizeChange(a)}return()=>{if(a){var e,r;null===(r=o.current)||void 0===r||null===(e=r.api())||void 0===e||e.unsubscribeSizeChange(a)}}}},[a]),(0,r.useLayoutEffect)(()=>{if(c){if(i){var e,r;null===(r=o.current)||void 0===r||null===(e=r.api())||void 0===e||e.subscribeVisibleLogicalRangeChange(i)}return()=>{if(i){var e,r;null===(r=o.current)||void 0===r||null===(e=r.api())||void 0===e||e.unsubscribeVisibleLogicalRangeChange(i)}}}},[i]),(0,r.useLayoutEffect)(()=>{if(c){if(e){var r,i;null===(i=o.current)||void 0===i||null===(r=i.api())||void 0===r||r.subscribeVisibleTimeRangeChange(e)}return()=>{if(e){var r,i;null===(i=o.current)||void 0===i||null===(r=i.api())||void 0===r||r.unsubscribeVisibleTimeRangeChange(e)}}}},[e]),(0,r.useLayoutEffect)(()=>{if(c&&l){var e,r;null===(r=o.current)||void 0===r||null===(e=r.api())||void 0===e||e.setVisibleRange(l)}},[l]),(0,r.useLayoutEffect)(()=>{if(c&&s){var e,r;null===(r=o.current)||void 0===r||null===(e=r.api())||void 0===e||e.setVisibleLogicalRange(s)}},[s]),o},o=(0,r.forwardRef)((e,i)=>{let t=c(e);return(0,r.useImperativeHandle)(i,()=>t.current,[t]),null});o.displayName="TimeScale";let f=o,p=({options:e={},id:i})=>{let a=u(t),l=(0,r.useRef)({_priceScale:null,api(){if(!this._priceScale){let r=a.api();if(!r)return null;this._priceScale=r.priceScale(i),this._priceScale.applyOptions({...e})}return this._priceScale},setId(e){null!==this._priceScale&&(this._priceScale=a.api().priceScale(e))},clear(){null!==this._priceScale&&(this._priceScale=null)}});return(0,r.useLayoutEffect)(()=>(l.current.api(),()=>{l.current.clear()}),[]),(0,r.useLayoutEffect)(()=>{var e;a&&(null===(e=l.current)||void 0===e||e.setId(i))},[i]),(0,r.useLayoutEffect)(()=>{if(a&&e){var r,i;null===(i=l.current)||void 0===i||null===(r=i.api())||void 0===r||r.applyOptions(e)}},[e]),l},d=(0,r.forwardRef)((e,i)=>{let t=p(e);return(0,r.useImperativeHandle)(i,()=>t.current,[t]),null});d.displayName="PriceScale";let h=d,v=({type:e,data:i,options:a={},reactive:l,markers:s})=>{let n=u(t),c=(0,r.useRef)({_series:null,api(){if(!this._series&&!this.destroyed){let r=n.api();if(!r)return null;this._series=y(r,e),this._series.applyOptions(a),this._series.setData(i),s&&this._series.setMarkers(s)}return this._series},clear(){if(null!==this._series){var e;null===(e=n.api())||void 0===e||e.removeSeries(this._series),this._series=null,this.destroyed=!0}},destroyed:!1});return(0,r.useLayoutEffect)(()=>(c.current.api(),()=>{c.current.clear()}),[]),(0,r.useLayoutEffect)(()=>{if(n&&s&&l){var e;null===(e=c.current.api())||void 0===e||e.setMarkers(s)}},[s,l]),(0,r.useLayoutEffect)(()=>{if(n&&i&&l){var e;null===(e=c.current.api())||void 0===e||e.setData(i)}},[i,l]),(0,r.useLayoutEffect)(()=>{if(n&&a){var e;null===(e=c.current.api())||void 0===e||e.applyOptions(a)}},[a]),c},y=(e,r)=>{let i=null;switch(r){case"Line":i=e.addLineSeries();break;case"Candlestick":i=e.addCandlestickSeries();break;case"Histogram":i=e.addHistogramSeries();break;case"Area":i=e.addAreaSeries();break;case"Baseline":i=e.addBaselineSeries();break;case"Bar":i=e.addBarSeries();break;default:throw Error(`Unknown series type: ${r}`)}return i},S=(0,r.createContext)({});S.displayName="SeriesContext";let m=(0,r.forwardRef)(({children:i,...t},a)=>{let l=v(t);return(0,r.useImperativeHandle)(a,()=>l.current,[l]),(0,e.jsx)(S.Provider,{value:l.current,children:i})});m.displayName="SeriesTemplate";let _=(0,r.forwardRef)(({children:r,...i},t)=>(0,e.jsx)(m,{type:"Line",ref:t,...i,children:r}));_.displayName="LineSeries";let L=_,b=(0,r.forwardRef)(({children:r,...i},t)=>(0,e.jsx)(m,{type:"Histogram",ref:t,...i,children:r}));b.displayName="HistogramSeries";let C=b,g=(0,r.forwardRef)(({children:r,...i},t)=>(0,e.jsx)(m,{type:"Candlestick",ref:t,...i,children:r}));g.displayName="CandlestickSeries";let R=g,E=(0,r.forwardRef)(({children:r,...i},t)=>(0,e.jsx)(m,{type:"Area",ref:t,...i,children:r}));E.displayName="AreaSeries";let x=E,k=(0,r.forwardRef)(({children:r,...i},t)=>(0,e.jsx)(m,{type:"Baseline",ref:t,...i,children:r}));k.displayName="BaselineSeries";let w=k,N=(0,r.forwardRef)(({children:r,...i},t)=>(0,e.jsx)(m,{type:"Bar",ref:t,...i,children:r}));N.displayName="BarSeries";let B=N,j=({options:e,price:i})=>{let t=u(S),a=(0,r.useRef)({_priceLine:null,api(){if(!this._priceLine){let r=t.api();if(!r)return null;this._priceLine=r.createPriceLine({price:i,...e})}return this._priceLine},clear(){if(null!==this._priceLine){var e;null===(e=t.api())||void 0===e||e.removePriceLine(this._priceLine),this._priceLine=null}}});return(0,r.useLayoutEffect)(()=>(a.current.api(),()=>{a.current.clear()}),[]),(0,r.useLayoutEffect)(()=>{if(t&&e){var r;null===(r=a.current.api())||void 0===r||r.applyOptions(e)}},[e]),a},H=(0,r.forwardRef)((e,i)=>{let t=j(e);return(0,r.useImperativeHandle)(i,()=>t.current,[t]),null});H.displayName="PriceLine";let P=H;export{x as AreaSeries,B as BarSeries,w as BaselineSeries,R as CandlestickSeries,n as Chart,C as HistogramSeries,L as LineSeries,P as PriceLine,h as PriceScale,f as TimeScale};
|
|
12
12
|
//# sourceMappingURL=lightweight-charts-react-components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lightweight-charts-react-components.js","sources":["webpack://lightweight-charts-react-components/./src/chart/ChartContext.ts","webpack://lightweight-charts-react-components/./src/chart/useInitChart.ts","webpack://lightweight-charts-react-components/./src/chart/ChartComponent.tsx","webpack://lightweight-charts-react-components/./src/chart/ChartWrapper.tsx","webpack://lightweight-charts-react-components/./src/shared/useSafeContext.ts","webpack://lightweight-charts-react-components/./src/scales/useInitTimeScale.ts","webpack://lightweight-charts-react-components/./src/scales/TimeScale.tsx","webpack://lightweight-charts-react-components/./src/scales/useInitPriceScale.ts","webpack://lightweight-charts-react-components/./src/scales/PriceScale.tsx","webpack://lightweight-charts-react-components/./src/series/useInitSeries.ts","webpack://lightweight-charts-react-components/./src/series/SeriesContext.ts","webpack://lightweight-charts-react-components/./src/series/SeriesTemplate.tsx","webpack://lightweight-charts-react-components/./src/series/LineSeries.tsx","webpack://lightweight-charts-react-components/./src/series/HistogramSeries.tsx","webpack://lightweight-charts-react-components/./src/series/CandlestickSeries.tsx","webpack://lightweight-charts-react-components/./src/series/AreaSeries.tsx","webpack://lightweight-charts-react-components/./src/priceLine/useInitPriceLine.ts","webpack://lightweight-charts-react-components/./src/priceLine/PriceLine.tsx"],"sourcesContent":["import { createContext } from \"react\";\nimport { ChartApiRef } from \"./types\";\n\nexport const ChartContext = createContext({} as ChartApiRef);\nChartContext.displayName = \"ChartContext\";\n","import { useLayoutEffect, useRef } from \"react\";\nimport { createChart } from \"lightweight-charts\";\nimport { ChartApiRef, ChartOptions } from \"./types\";\n\nexport const useInitChart = ({\n container,\n ...rest\n}: {\n container: HTMLElement;\n} & ChartOptions) => {\n const { onClick, onCrosshairMove, onInit, ...restOptions } = rest;\n\n const chartApiRef = useRef<ChartApiRef>({\n _chart: null,\n api() {\n if (this._chart === null && !this.destroyed) {\n this._chart = createChart(container, restOptions);\n\n if (onInit) {\n onInit(this._chart);\n }\n }\n\n return this._chart;\n },\n clear() {\n if (this._chart !== null) {\n this._chart.remove();\n this._chart = null;\n this.destroyed = true;\n }\n },\n destroyed: false,\n });\n\n useLayoutEffect(() => {\n chartApiRef.current.api();\n\n return () => {\n chartApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!container) return;\n\n if (onClick) {\n chartApiRef.current.api()?.subscribeClick(onClick);\n }\n\n return () => {\n if (onClick) {\n chartApiRef.current.api()?.unsubscribeClick(onClick);\n }\n };\n }, [onClick]);\n\n useLayoutEffect(() => {\n if (!container) return;\n\n if (onCrosshairMove) {\n chartApiRef.current.api()?.subscribeCrosshairMove(onCrosshairMove);\n }\n\n return () => {\n if (onCrosshairMove) {\n chartApiRef.current.api()?.unsubscribeCrosshairMove(onCrosshairMove);\n }\n };\n }, [onCrosshairMove]);\n\n useLayoutEffect(() => {\n if (!container) return;\n\n chartApiRef.current.api()?.applyOptions(restOptions);\n }, [restOptions]);\n\n return chartApiRef;\n};\n","import { ChartContext } from \"./ChartContext\";\nimport { useInitChart } from \"./useInitChart\";\nimport { ChartProps } from \"./types\";\n\ntype ChartComponentProps = {\n container: HTMLElement;\n} & Omit<ChartProps, \"className\">;\n\nconst ChartComponent: React.FC<ChartComponentProps> = ({ children, container, ...rest }) => {\n const chartApiRef = useInitChart({ container, ...rest });\n\n return <ChartContext.Provider value={chartApiRef.current}>{children}</ChartContext.Provider>;\n};\n\nexport default ChartComponent;\n","import { ForwardRefRenderFunction, forwardRef, useCallback, useState } from \"react\";\nimport { ChartProps } from \"./types\";\nimport ChartComponent from \"./ChartComponent\";\n\nconst ChartRenderFunction: ForwardRefRenderFunction<HTMLDivElement, ChartProps> = (\n { children, className, ...rest },\n ref\n) => {\n const [container, setContainer] = useState<HTMLDivElement>();\n const containerRef = useCallback(\n (r: HTMLDivElement) => {\n setContainer(r);\n\n if (ref) {\n if (typeof ref === \"function\") {\n containerRef(r);\n } else {\n ref.current = r;\n }\n }\n },\n [ref]\n );\n\n return (\n <div ref={containerRef} className={className}>\n {!!container && (\n <ChartComponent container={container} {...rest}>\n {children}\n </ChartComponent>\n )}\n </div>\n );\n};\n\nconst ChartWrapper = forwardRef(ChartRenderFunction);\nChartWrapper.displayName = \"ChartWrapper\";\nexport default ChartWrapper;\n","import { Context, useContext } from \"react\";\n\nexport const useSafeContext = <T>(context: Context<T>) => {\n const currentContextValue = useContext(context);\n\n if (!currentContextValue) {\n const ctxName = context.name;\n throw new Error(`${ctxName} not found. You can access context value only inside its Provider.`);\n }\n\n return currentContextValue;\n};\n","import { useLayoutEffect, useRef } from \"react\";\nimport { TimeScaleApiRef, TimeScaleProps } from \"./types\";\nimport { useSafeContext } from \"@/shared/useSafeContext\";\nimport { ChartContext } from \"@/chart/ChartContext\";\n\nexport const useInitTimeScale = ({\n onVisibleTimeRangeChange,\n onVisibleLogicalRangeChange,\n onSizeChange,\n visibleRange,\n visibleLogicalRange,\n options = {},\n}: TimeScaleProps) => {\n const chart = useSafeContext(ChartContext);\n\n if (!chart) {\n throw new Error(\"Chart context not found\");\n }\n\n const timeScaleApiRef = useRef<TimeScaleApiRef>({\n _timeScale: null,\n api() {\n if (!this._timeScale) {\n const chartApi = chart.api();\n\n if (!chartApi) {\n return null;\n }\n\n this._timeScale = chartApi.timeScale();\n\n this._timeScale.applyOptions(options);\n\n if (visibleRange) {\n this._timeScale.setVisibleRange(visibleRange);\n }\n\n if (visibleLogicalRange) {\n this._timeScale.setVisibleLogicalRange(visibleLogicalRange);\n }\n }\n\n return this._timeScale;\n },\n clear() {\n if (this._timeScale !== null) {\n this._timeScale = null;\n }\n },\n });\n\n useLayoutEffect(() => {\n timeScaleApiRef.current.api();\n\n return () => {\n timeScaleApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (options) {\n timeScaleApiRef.current?.api()?.applyOptions(options);\n }\n }, [options]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (onSizeChange) {\n timeScaleApiRef.current?.api()?.subscribeSizeChange(onSizeChange);\n }\n\n return () => {\n if (onSizeChange) {\n timeScaleApiRef.current?.api()?.unsubscribeSizeChange(onSizeChange);\n }\n };\n }, [onSizeChange]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (onVisibleLogicalRangeChange) {\n timeScaleApiRef.current\n ?.api()\n ?.subscribeVisibleLogicalRangeChange(onVisibleLogicalRangeChange);\n }\n\n return () => {\n if (onVisibleLogicalRangeChange) {\n timeScaleApiRef.current\n ?.api()\n ?.unsubscribeVisibleLogicalRangeChange(onVisibleLogicalRangeChange);\n }\n };\n }, [onVisibleLogicalRangeChange]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (onVisibleTimeRangeChange) {\n timeScaleApiRef.current\n ?.api()\n ?.subscribeVisibleTimeRangeChange(onVisibleTimeRangeChange);\n }\n\n return () => {\n if (onVisibleTimeRangeChange) {\n timeScaleApiRef.current\n ?.api()\n ?.unsubscribeVisibleTimeRangeChange(onVisibleTimeRangeChange);\n }\n };\n }, [onVisibleTimeRangeChange]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (visibleRange) {\n timeScaleApiRef.current?.api()?.setVisibleRange(visibleRange);\n }\n }, [visibleRange]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (visibleLogicalRange) {\n timeScaleApiRef.current\n ?.api()\n ?.setVisibleLogicalRange(visibleLogicalRange);\n }\n }, [visibleLogicalRange]);\n\n return timeScaleApiRef;\n};\n","import { ForwardedRef, forwardRef, useImperativeHandle } from \"react\";\nimport { TimeScaleApiRef, TimeScaleProps } from \"./types\";\nimport { useInitTimeScale } from \"./useInitTimeScale\";\n\nconst TimeScaleRenderFunction = (props: TimeScaleProps, ref: ForwardedRef<TimeScaleApiRef>) => {\n const timeScaleApiRef = useInitTimeScale(props);\n useImperativeHandle(ref, () => timeScaleApiRef.current, [timeScaleApiRef]);\n\n return null;\n};\n\nconst TimeScale = forwardRef(TimeScaleRenderFunction);\nTimeScale.displayName = \"TimeScale\";\nexport default TimeScale;\n","import { useLayoutEffect, useRef } from \"react\";\nimport { PriceScaleProps, PriceScaleApiRef } from \"./types\";\nimport { useSafeContext } from \"@/shared/useSafeContext\";\nimport { ChartContext } from \"@/chart/ChartContext\";\n\nexport const useInitPriceScale = ({ options = {}, id }: PriceScaleProps) => {\n const chart = useSafeContext(ChartContext);\n\n const priceScaleApiRef = useRef<PriceScaleApiRef>({\n _priceScale: null,\n api() {\n if (!this._priceScale) {\n const chartApi = chart.api();\n\n if (!chartApi) {\n return null;\n }\n\n this._priceScale = chartApi.priceScale(id);\n\n this._priceScale.applyOptions({\n ...options,\n });\n }\n\n return this._priceScale;\n },\n setId(id) {\n if (this._priceScale === null) {\n return;\n }\n\n this._priceScale = chart.api()!.priceScale(id);\n },\n clear() {\n if (this._priceScale !== null) {\n this._priceScale = null;\n }\n },\n });\n\n useLayoutEffect(() => {\n priceScaleApiRef.current.api();\n\n return () => {\n priceScaleApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n priceScaleApiRef.current?.setId(id);\n }, [id]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (options) {\n priceScaleApiRef.current?.api()?.applyOptions(options);\n }\n }, [options]);\n\n return priceScaleApiRef;\n};\n","import { ForwardedRef, forwardRef, useImperativeHandle } from \"react\";\nimport { PriceScaleApiRef, PriceScaleProps } from \"./types\";\nimport { useInitPriceScale } from \"./useInitPriceScale\";\n\nconst PriceScaleRenderFunction = (props: PriceScaleProps, ref: ForwardedRef<PriceScaleApiRef>) => {\n const priceScaleApiRef = useInitPriceScale(props);\n useImperativeHandle(ref, () => priceScaleApiRef.current, [priceScaleApiRef]);\n\n return null;\n};\n\nconst PriceScale = forwardRef(PriceScaleRenderFunction);\nPriceScale.displayName = \"PriceScale\";\nexport default PriceScale;\n","import { useLayoutEffect, useRef } from \"react\";\nimport { SeriesApiRef, SeriesTemplateProps, SeriesType } from \"./types\";\nimport { IChartApi, ISeriesApi } from \"lightweight-charts\";\nimport { useSafeContext } from \"@/shared/useSafeContext\";\nimport { ChartContext } from \"@/chart/ChartContext\";\n\nexport const useInitSeries = <T extends SeriesType>({\n type,\n data,\n options = {},\n reactive,\n markers,\n}: Omit<SeriesTemplateProps<T>, \"children\">) => {\n const chart = useSafeContext(ChartContext);\n\n const seriesApiRef = useRef<SeriesApiRef<T>>({\n _series: null,\n api() {\n if (!this._series && !this.destroyed) {\n const chartApi = chart.api();\n\n if (!chartApi) {\n return null;\n }\n\n this._series = addSeries(chartApi, type);\n\n this._series.applyOptions(options);\n\n this._series.setData(data);\n\n if (markers) {\n this._series.setMarkers(markers);\n }\n }\n\n return this._series;\n },\n clear() {\n if (this._series !== null) {\n chart.api()?.removeSeries(this._series);\n this._series = null;\n this.destroyed = true;\n }\n },\n destroyed: false,\n });\n\n useLayoutEffect(() => {\n seriesApiRef.current.api();\n\n return () => {\n seriesApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (markers && reactive) {\n seriesApiRef.current.api()?.setMarkers(markers);\n }\n }, [markers, reactive]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (data && reactive) {\n seriesApiRef.current.api()?.setData(data);\n }\n }, [data, reactive]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (options) {\n seriesApiRef.current.api()?.applyOptions(options);\n }\n }, [options]);\n\n return seriesApiRef;\n};\n\nconst addSeries = <T extends SeriesType>(chart: IChartApi, type: T) => {\n let series = null;\n\n switch (type) {\n case \"Line\":\n series = chart.addLineSeries();\n break;\n case \"Candlestick\":\n series = chart.addCandlestickSeries();\n break;\n case \"Histogram\":\n series = chart.addHistogramSeries();\n break;\n case \"Area\":\n series = chart.addAreaSeries();\n break;\n default:\n throw new Error(`Unknown series type: ${type}`);\n }\n\n return series as ISeriesApi<T>;\n};\n","import { createContext } from \"react\";\nimport { SeriesApiRef, SeriesType } from \"./types\";\n\nexport const SeriesContext = createContext({} as SeriesApiRef<SeriesType>);\nSeriesContext.displayName = \"SeriesContext\";\n","import { useInitSeries } from \"./useInitSeries\";\nimport { SeriesType, SeriesTemplateProps, SeriesApiRef } from \"./types\";\nimport { SeriesContext } from \"./SeriesContext\";\nimport { ForwardedRef, forwardRef, useImperativeHandle } from \"react\";\n\nconst SeriesTemplateRenderFunction = <T extends SeriesType = \"Line\">(\n { children, ...rest }: SeriesTemplateProps<T>,\n ref: ForwardedRef<SeriesApiRef<T>>\n) => {\n const seriesApi = useInitSeries(rest);\n useImperativeHandle(ref, () => seriesApi.current, [seriesApi]);\n\n return <SeriesContext.Provider value={seriesApi.current}>{children}</SeriesContext.Provider>;\n};\n\nconst SeriesTemplate = forwardRef(SeriesTemplateRenderFunction);\nSeriesTemplate.displayName = \"SeriesTemplate\";\nexport default SeriesTemplate;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst LineSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Line\">,\n ref: ForwardedRef<SeriesApiRef<\"Line\">>\n) => {\n return (\n <SeriesTemplate type=\"Line\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst LineSeries = forwardRef(LineSeriesRenderFunction);\nLineSeries.displayName = \"LineSeries\";\nexport default LineSeries;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst HistogramSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Histogram\">,\n ref: ForwardedRef<SeriesApiRef<\"Histogram\">>\n) => {\n return (\n <SeriesTemplate type=\"Histogram\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst HistogramSeries = forwardRef(HistogramSeriesRenderFunction);\nHistogramSeries.displayName = \"HistogramSeries\";\nexport default HistogramSeries;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst CandlestickSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Candlestick\">,\n ref: ForwardedRef<SeriesApiRef<\"Candlestick\">>\n) => {\n return (\n <SeriesTemplate type=\"Candlestick\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst CandlestickSeries = forwardRef(CandlestickSeriesRenderFunction);\nCandlestickSeries.displayName = \"CandlestickSeries\";\nexport default CandlestickSeries;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst AreaSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Area\">,\n ref: ForwardedRef<SeriesApiRef<\"Area\">>\n) => {\n return (\n <SeriesTemplate type=\"Area\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst AreaSeries = forwardRef(AreaSeriesRenderFunction);\nAreaSeries.displayName = \"AreaSeries\";\nexport default AreaSeries;\n","import { useLayoutEffect, useRef } from \"react\";\nimport { PriceLineApiRef, PriceLineProps } from \"./types\";\nimport { useSafeContext } from \"@/shared/useSafeContext\";\nimport { SeriesContext } from \"@/series/SeriesContext\";\n\nexport const useInitPriceLine = ({ options, price }: PriceLineProps) => {\n const series = useSafeContext(SeriesContext);\n\n const priceLineApiRef = useRef<PriceLineApiRef>({\n _priceLine: null,\n api() {\n if (!this._priceLine) {\n const seriesApi = series.api();\n\n if (!seriesApi) {\n return null;\n }\n\n this._priceLine = seriesApi.createPriceLine({\n price,\n ...options,\n });\n }\n\n return this._priceLine;\n },\n clear() {\n if (this._priceLine !== null) {\n series.api()?.removePriceLine(this._priceLine);\n this._priceLine = null;\n }\n },\n });\n\n useLayoutEffect(() => {\n priceLineApiRef.current.api();\n\n return () => {\n priceLineApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!series) return;\n\n if (options) {\n priceLineApiRef.current.api()?.applyOptions(options);\n }\n }, [options]);\n\n return priceLineApiRef;\n};\n","import { ForwardedRef, forwardRef, useImperativeHandle } from \"react\";\nimport { PriceLineApiRef, PriceLineProps } from \"./types\";\nimport { useInitPriceLine } from \"./useInitPriceLine\";\n\nconst PriceLineRenderFunction = (props: PriceLineProps, ref: ForwardedRef<PriceLineApiRef>) => {\n const priceLineApiRef = useInitPriceLine(props);\n useImperativeHandle(ref, () => priceLineApiRef.current, [priceLineApiRef]);\n\n return null;\n};\n\nconst PriceLine = forwardRef(PriceLineRenderFunction);\nPriceLine.displayName = \"PriceLine\";\nexport default PriceLine;\n"],"names":["ChartContext","createContext","useInitChart","container","rest","onClick","onCrosshairMove","onInit","restOptions","chartApiRef","useRef","createChart","useLayoutEffect","_chartApiRef_current_api","children","ChartWrapper","forwardRef","className","ref","setContainer","useState","containerRef","useCallback","r","ChartComponent","useSafeContext","context","currentContextValue","useContext","ctxName","Error","useInitTimeScale","onVisibleTimeRangeChange","onVisibleLogicalRangeChange","onSizeChange","visibleRange","visibleLogicalRange","options","chart","timeScaleApiRef","chartApi","_timeScaleApiRef_current_api","TimeScale","props","useImperativeHandle","useInitPriceScale","id","priceScaleApiRef","_priceScaleApiRef_current","_priceScaleApiRef_current_api","PriceScale","useInitSeries","type","data","reactive","markers","seriesApiRef","addSeries","_chart_api","_seriesApiRef_current_api","series","SeriesContext","SeriesTemplate","seriesApi","LineSeries","HistogramSeries","CandlestickSeries","AreaSeries","useInitPriceLine","price","priceLineApiRef","_series_api","_priceLineApiRef_current_api","PriceLine"],"mappings":";;;;;;;;;;iGAGO,IAAMA,EAAeC,AAAAA,GAAAA,EAAAA,aAAAA,AAAAA,EAAc,CAAC,EAC3CD,CAAAA,EAAa,WAAW,CAAG,eCApB,IAAME,EAAe,CAAC,CAC3BC,UAAAA,CAAS,CACT,GAAGC,EAGW,IACd,GAAM,CAAEC,QAAAA,CAAO,CAAEC,gBAAAA,CAAe,CAAEC,OAAAA,CAAM,CAAE,GAAGC,EAAa,CAAGJ,EAEvDK,EAAcC,AAAAA,GAAAA,EA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AAC,KAAK,EAC/B,GACC,EAAE,EAEL1D,AAAAA,GAAAA,EAAAA,eAAAA,AAAAA,EAAgB,KACd,GAAKgD,GAEDvB,EAAS,KACXmC,CAA2B,QAA3BA,CAAAA,EAAAA,EAAgB,OAAO,CAAC,GAAG,EAAC,GAA5BA,AAAAA,KAAAA,IAAAA,GAAAA,EAA+B,YAAY,CAACnC,EAC9C,CACF,EAAG,CAACA,EAAQ,EAELiC,CACT,ECxCMG,EAAYzD,AAAAA,GAAAA,EAAAA,UAAAA,AAAAA,EAPc,CAAC2B,EAAuBzB,KACtD,IAAMoD,EAAkBF,EAAiBzB,GAGzC,MAFAC,AAAAA,GAAAA,EAAAA,mBAAAA,AAAAA,EAAoB1B,EAAK,IAAMoD,EAAgB,OAAO,CAAE,CAACA,EAAgB,EAElE,IACT,EAGAG,CAAAA,EAAU,WAAW,CAAG,YACxB,MAAeA"}
|
|
1
|
+
{"version":3,"file":"lightweight-charts-react-components.js","sources":["webpack://lightweight-charts-react-components/./src/chart/ChartContext.ts","webpack://lightweight-charts-react-components/./src/chart/useInitChart.ts","webpack://lightweight-charts-react-components/./src/chart/ChartComponent.tsx","webpack://lightweight-charts-react-components/./src/chart/ChartWrapper.tsx","webpack://lightweight-charts-react-components/./src/shared/useSafeContext.ts","webpack://lightweight-charts-react-components/./src/scales/useInitTimeScale.ts","webpack://lightweight-charts-react-components/./src/scales/TimeScale.tsx","webpack://lightweight-charts-react-components/./src/scales/useInitPriceScale.ts","webpack://lightweight-charts-react-components/./src/scales/PriceScale.tsx","webpack://lightweight-charts-react-components/./src/series/useInitSeries.ts","webpack://lightweight-charts-react-components/./src/series/SeriesContext.ts","webpack://lightweight-charts-react-components/./src/series/SeriesTemplate.tsx","webpack://lightweight-charts-react-components/./src/series/LineSeries.tsx","webpack://lightweight-charts-react-components/./src/series/HistogramSeries.tsx","webpack://lightweight-charts-react-components/./src/series/CandlestickSeries.tsx","webpack://lightweight-charts-react-components/./src/series/AreaSeries.tsx","webpack://lightweight-charts-react-components/./src/series/BaselineSeries.tsx","webpack://lightweight-charts-react-components/./src/series/BarSeries.tsx","webpack://lightweight-charts-react-components/./src/priceLine/useInitPriceLine.ts","webpack://lightweight-charts-react-components/./src/priceLine/PriceLine.tsx"],"sourcesContent":["import { createContext } from \"react\";\nimport { ChartApiRef } from \"./types\";\n\nexport const ChartContext = createContext({} as ChartApiRef);\nChartContext.displayName = \"ChartContext\";\n","import { useLayoutEffect, useRef } from \"react\";\nimport { createChart } from \"lightweight-charts\";\nimport { ChartApiRef, ChartOptions } from \"./types\";\n\nexport const useInitChart = ({\n container,\n ...rest\n}: {\n container: HTMLElement;\n} & ChartOptions) => {\n const { onClick, onCrosshairMove, onInit, ...restOptions } = rest;\n\n const chartApiRef = useRef<ChartApiRef>({\n _chart: null,\n api() {\n if (this._chart === null && !this.destroyed) {\n this._chart = createChart(container, restOptions);\n\n if (onInit) {\n onInit(this._chart);\n }\n }\n\n return this._chart;\n },\n clear() {\n if (this._chart !== null) {\n this._chart.remove();\n this._chart = null;\n this.destroyed = true;\n }\n },\n destroyed: false,\n });\n\n useLayoutEffect(() => {\n chartApiRef.current.api();\n\n return () => {\n chartApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!container) return;\n\n if (onClick) {\n chartApiRef.current.api()?.subscribeClick(onClick);\n }\n\n return () => {\n if (onClick) {\n chartApiRef.current.api()?.unsubscribeClick(onClick);\n }\n };\n }, [onClick]);\n\n useLayoutEffect(() => {\n if (!container) return;\n\n if (onCrosshairMove) {\n chartApiRef.current.api()?.subscribeCrosshairMove(onCrosshairMove);\n }\n\n return () => {\n if (onCrosshairMove) {\n chartApiRef.current.api()?.unsubscribeCrosshairMove(onCrosshairMove);\n }\n };\n }, [onCrosshairMove]);\n\n useLayoutEffect(() => {\n if (!container) return;\n\n chartApiRef.current.api()?.applyOptions(restOptions);\n }, [restOptions]);\n\n return chartApiRef;\n};\n","import { ChartContext } from \"./ChartContext\";\nimport { useInitChart } from \"./useInitChart\";\nimport { ChartProps } from \"./types\";\n\ntype ChartComponentProps = {\n container: HTMLElement;\n} & Omit<ChartProps, \"className\">;\n\nconst ChartComponent: React.FC<ChartComponentProps> = ({ children, container, ...rest }) => {\n const chartApiRef = useInitChart({ container, ...rest });\n\n return <ChartContext.Provider value={chartApiRef.current}>{children}</ChartContext.Provider>;\n};\n\nexport default ChartComponent;\n","import { ForwardRefRenderFunction, forwardRef, useCallback, useState } from \"react\";\nimport { ChartProps } from \"./types\";\nimport ChartComponent from \"./ChartComponent\";\n\nconst ChartRenderFunction: ForwardRefRenderFunction<HTMLDivElement, ChartProps> = (\n { children, className, ...rest },\n ref\n) => {\n const [container, setContainer] = useState<HTMLDivElement>();\n const containerRef = useCallback(\n (r: HTMLDivElement) => {\n setContainer(r);\n\n if (ref) {\n if (typeof ref === \"function\") {\n containerRef(r);\n } else {\n ref.current = r;\n }\n }\n },\n [ref]\n );\n\n return (\n <div ref={containerRef} className={className}>\n {!!container && (\n <ChartComponent container={container} {...rest}>\n {children}\n </ChartComponent>\n )}\n </div>\n );\n};\n\nconst ChartWrapper = forwardRef(ChartRenderFunction);\nChartWrapper.displayName = \"ChartWrapper\";\nexport default ChartWrapper;\n","import { Context, useContext } from \"react\";\n\nexport const useSafeContext = <T>(context: Context<T>) => {\n const currentContextValue = useContext(context);\n\n if (!currentContextValue) {\n const ctxName = context.name;\n throw new Error(`${ctxName} not found. You can access context value only inside its Provider.`);\n }\n\n return currentContextValue;\n};\n","import { useLayoutEffect, useRef } from \"react\";\nimport { TimeScaleApiRef, TimeScaleProps } from \"./types\";\nimport { useSafeContext } from \"@/shared/useSafeContext\";\nimport { ChartContext } from \"@/chart/ChartContext\";\n\nexport const useInitTimeScale = ({\n onVisibleTimeRangeChange,\n onVisibleLogicalRangeChange,\n onSizeChange,\n visibleRange,\n visibleLogicalRange,\n options = {},\n}: TimeScaleProps) => {\n const chart = useSafeContext(ChartContext);\n\n if (!chart) {\n throw new Error(\"Chart context not found\");\n }\n\n const timeScaleApiRef = useRef<TimeScaleApiRef>({\n _timeScale: null,\n api() {\n if (!this._timeScale) {\n const chartApi = chart.api();\n\n if (!chartApi) {\n return null;\n }\n\n this._timeScale = chartApi.timeScale();\n\n this._timeScale.applyOptions(options);\n\n if (visibleRange) {\n this._timeScale.setVisibleRange(visibleRange);\n }\n\n if (visibleLogicalRange) {\n this._timeScale.setVisibleLogicalRange(visibleLogicalRange);\n }\n }\n\n return this._timeScale;\n },\n clear() {\n if (this._timeScale !== null) {\n this._timeScale = null;\n }\n },\n });\n\n useLayoutEffect(() => {\n timeScaleApiRef.current.api();\n\n return () => {\n timeScaleApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (options) {\n timeScaleApiRef.current?.api()?.applyOptions(options);\n }\n }, [options]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (onSizeChange) {\n timeScaleApiRef.current?.api()?.subscribeSizeChange(onSizeChange);\n }\n\n return () => {\n if (onSizeChange) {\n timeScaleApiRef.current?.api()?.unsubscribeSizeChange(onSizeChange);\n }\n };\n }, [onSizeChange]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (onVisibleLogicalRangeChange) {\n timeScaleApiRef.current\n ?.api()\n ?.subscribeVisibleLogicalRangeChange(onVisibleLogicalRangeChange);\n }\n\n return () => {\n if (onVisibleLogicalRangeChange) {\n timeScaleApiRef.current\n ?.api()\n ?.unsubscribeVisibleLogicalRangeChange(onVisibleLogicalRangeChange);\n }\n };\n }, [onVisibleLogicalRangeChange]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (onVisibleTimeRangeChange) {\n timeScaleApiRef.current\n ?.api()\n ?.subscribeVisibleTimeRangeChange(onVisibleTimeRangeChange);\n }\n\n return () => {\n if (onVisibleTimeRangeChange) {\n timeScaleApiRef.current\n ?.api()\n ?.unsubscribeVisibleTimeRangeChange(onVisibleTimeRangeChange);\n }\n };\n }, [onVisibleTimeRangeChange]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (visibleRange) {\n timeScaleApiRef.current?.api()?.setVisibleRange(visibleRange);\n }\n }, [visibleRange]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (visibleLogicalRange) {\n timeScaleApiRef.current\n ?.api()\n ?.setVisibleLogicalRange(visibleLogicalRange);\n }\n }, [visibleLogicalRange]);\n\n return timeScaleApiRef;\n};\n","import { ForwardedRef, forwardRef, useImperativeHandle } from \"react\";\nimport { TimeScaleApiRef, TimeScaleProps } from \"./types\";\nimport { useInitTimeScale } from \"./useInitTimeScale\";\n\nconst TimeScaleRenderFunction = (props: TimeScaleProps, ref: ForwardedRef<TimeScaleApiRef>) => {\n const timeScaleApiRef = useInitTimeScale(props);\n useImperativeHandle(ref, () => timeScaleApiRef.current, [timeScaleApiRef]);\n\n return null;\n};\n\nconst TimeScale = forwardRef(TimeScaleRenderFunction);\nTimeScale.displayName = \"TimeScale\";\nexport default TimeScale;\n","import { useLayoutEffect, useRef } from \"react\";\nimport { PriceScaleProps, PriceScaleApiRef } from \"./types\";\nimport { useSafeContext } from \"@/shared/useSafeContext\";\nimport { ChartContext } from \"@/chart/ChartContext\";\n\nexport const useInitPriceScale = ({ options = {}, id }: PriceScaleProps) => {\n const chart = useSafeContext(ChartContext);\n\n const priceScaleApiRef = useRef<PriceScaleApiRef>({\n _priceScale: null,\n api() {\n if (!this._priceScale) {\n const chartApi = chart.api();\n\n if (!chartApi) {\n return null;\n }\n\n this._priceScale = chartApi.priceScale(id);\n\n this._priceScale.applyOptions({\n ...options,\n });\n }\n\n return this._priceScale;\n },\n setId(id) {\n if (this._priceScale === null) {\n return;\n }\n\n this._priceScale = chart.api()!.priceScale(id);\n },\n clear() {\n if (this._priceScale !== null) {\n this._priceScale = null;\n }\n },\n });\n\n useLayoutEffect(() => {\n priceScaleApiRef.current.api();\n\n return () => {\n priceScaleApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n priceScaleApiRef.current?.setId(id);\n }, [id]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (options) {\n priceScaleApiRef.current?.api()?.applyOptions(options);\n }\n }, [options]);\n\n return priceScaleApiRef;\n};\n","import { ForwardedRef, forwardRef, useImperativeHandle } from \"react\";\nimport { PriceScaleApiRef, PriceScaleProps } from \"./types\";\nimport { useInitPriceScale } from \"./useInitPriceScale\";\n\nconst PriceScaleRenderFunction = (props: PriceScaleProps, ref: ForwardedRef<PriceScaleApiRef>) => {\n const priceScaleApiRef = useInitPriceScale(props);\n useImperativeHandle(ref, () => priceScaleApiRef.current, [priceScaleApiRef]);\n\n return null;\n};\n\nconst PriceScale = forwardRef(PriceScaleRenderFunction);\nPriceScale.displayName = \"PriceScale\";\nexport default PriceScale;\n","import { useLayoutEffect, useRef } from \"react\";\nimport { SeriesApiRef, SeriesTemplateProps, SeriesType } from \"./types\";\nimport { IChartApi, ISeriesApi } from \"lightweight-charts\";\nimport { useSafeContext } from \"@/shared/useSafeContext\";\nimport { ChartContext } from \"@/chart/ChartContext\";\n\nexport const useInitSeries = <T extends SeriesType>({\n type,\n data,\n options = {},\n reactive,\n markers,\n}: Omit<SeriesTemplateProps<T>, \"children\">) => {\n const chart = useSafeContext(ChartContext);\n\n const seriesApiRef = useRef<SeriesApiRef<T>>({\n _series: null,\n api() {\n if (!this._series && !this.destroyed) {\n const chartApi = chart.api();\n\n if (!chartApi) {\n return null;\n }\n\n this._series = addSeries(chartApi, type);\n\n this._series.applyOptions(options);\n\n this._series.setData(data);\n\n if (markers) {\n this._series.setMarkers(markers);\n }\n }\n\n return this._series;\n },\n clear() {\n if (this._series !== null) {\n chart.api()?.removeSeries(this._series);\n this._series = null;\n this.destroyed = true;\n }\n },\n destroyed: false,\n });\n\n useLayoutEffect(() => {\n seriesApiRef.current.api();\n\n return () => {\n seriesApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (markers && reactive) {\n seriesApiRef.current.api()?.setMarkers(markers);\n }\n }, [markers, reactive]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (data && reactive) {\n seriesApiRef.current.api()?.setData(data);\n }\n }, [data, reactive]);\n\n useLayoutEffect(() => {\n if (!chart) return;\n\n if (options) {\n seriesApiRef.current.api()?.applyOptions(options);\n }\n }, [options]);\n\n return seriesApiRef;\n};\n\nconst addSeries = <T extends SeriesType>(chart: IChartApi, type: T) => {\n let series = null;\n\n switch (type) {\n case \"Line\":\n series = chart.addLineSeries();\n break;\n case \"Candlestick\":\n series = chart.addCandlestickSeries();\n break;\n case \"Histogram\":\n series = chart.addHistogramSeries();\n break;\n case \"Area\":\n series = chart.addAreaSeries();\n break;\n case \"Baseline\":\n series = chart.addBaselineSeries();\n break;\n case \"Bar\":\n series = chart.addBarSeries();\n break;\n default:\n throw new Error(`Unknown series type: ${type}`);\n }\n\n return series as ISeriesApi<T>;\n};\n","import { createContext } from \"react\";\nimport { SeriesApiRef, SeriesType } from \"./types\";\n\nexport const SeriesContext = createContext({} as SeriesApiRef<SeriesType>);\nSeriesContext.displayName = \"SeriesContext\";\n","import { useInitSeries } from \"./useInitSeries\";\nimport { SeriesType, SeriesTemplateProps, SeriesApiRef } from \"./types\";\nimport { SeriesContext } from \"./SeriesContext\";\nimport { ForwardedRef, forwardRef, useImperativeHandle } from \"react\";\n\nconst SeriesTemplateRenderFunction = <T extends SeriesType = \"Line\">(\n { children, ...rest }: SeriesTemplateProps<T>,\n ref: ForwardedRef<SeriesApiRef<T>>\n) => {\n const seriesApi = useInitSeries(rest);\n useImperativeHandle(ref, () => seriesApi.current, [seriesApi]);\n\n return <SeriesContext.Provider value={seriesApi.current}>{children}</SeriesContext.Provider>;\n};\n\nconst SeriesTemplate = forwardRef(SeriesTemplateRenderFunction);\nSeriesTemplate.displayName = \"SeriesTemplate\";\nexport default SeriesTemplate;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst LineSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Line\">,\n ref: ForwardedRef<SeriesApiRef<\"Line\">>\n) => {\n return (\n <SeriesTemplate type=\"Line\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst LineSeries = forwardRef(LineSeriesRenderFunction);\nLineSeries.displayName = \"LineSeries\";\nexport default LineSeries;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst HistogramSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Histogram\">,\n ref: ForwardedRef<SeriesApiRef<\"Histogram\">>\n) => {\n return (\n <SeriesTemplate type=\"Histogram\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst HistogramSeries = forwardRef(HistogramSeriesRenderFunction);\nHistogramSeries.displayName = \"HistogramSeries\";\nexport default HistogramSeries;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst CandlestickSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Candlestick\">,\n ref: ForwardedRef<SeriesApiRef<\"Candlestick\">>\n) => {\n return (\n <SeriesTemplate type=\"Candlestick\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst CandlestickSeries = forwardRef(CandlestickSeriesRenderFunction);\nCandlestickSeries.displayName = \"CandlestickSeries\";\nexport default CandlestickSeries;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst AreaSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Area\">,\n ref: ForwardedRef<SeriesApiRef<\"Area\">>\n) => {\n return (\n <SeriesTemplate type=\"Area\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst AreaSeries = forwardRef(AreaSeriesRenderFunction);\nAreaSeries.displayName = \"AreaSeries\";\nexport default AreaSeries;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst BaselineSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Baseline\">,\n ref: ForwardedRef<SeriesApiRef<\"Baseline\">>,\n) => {\n return (\n <SeriesTemplate type=\"Baseline\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst BaselineSeries = forwardRef(BaselineSeriesRenderFunction);\nBaselineSeries.displayName = \"BaselineSeries\";\nexport default BaselineSeries;\n","import { ForwardedRef, forwardRef } from \"react\";\nimport SeriesTemplate from \"./SeriesTemplate\";\nimport { SeriesApiRef, SeriesProps } from \"./types\";\n\nconst BarSeriesRenderFunction = (\n { children, ...rest }: SeriesProps<\"Bar\">,\n ref: ForwardedRef<SeriesApiRef<\"Bar\">>,\n) => {\n return (\n <SeriesTemplate type=\"Bar\" ref={ref} {...rest}>\n {children}\n </SeriesTemplate>\n );\n};\n\nconst BarSeries = forwardRef(BarSeriesRenderFunction);\nBarSeries.displayName = \"BarSeries\";\nexport default BarSeries;\n","import { useLayoutEffect, useRef } from \"react\";\nimport { PriceLineApiRef, PriceLineProps } from \"./types\";\nimport { useSafeContext } from \"@/shared/useSafeContext\";\nimport { SeriesContext } from \"@/series/SeriesContext\";\n\nexport const useInitPriceLine = ({ options, price }: PriceLineProps) => {\n const series = useSafeContext(SeriesContext);\n\n const priceLineApiRef = useRef<PriceLineApiRef>({\n _priceLine: null,\n api() {\n if (!this._priceLine) {\n const seriesApi = series.api();\n\n if (!seriesApi) {\n return null;\n }\n\n this._priceLine = seriesApi.createPriceLine({\n price,\n ...options,\n });\n }\n\n return this._priceLine;\n },\n clear() {\n if (this._priceLine !== null) {\n series.api()?.removePriceLine(this._priceLine);\n this._priceLine = null;\n }\n },\n });\n\n useLayoutEffect(() => {\n priceLineApiRef.current.api();\n\n return () => {\n priceLineApiRef.current.clear();\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!series) return;\n\n if (options) {\n priceLineApiRef.current.api()?.applyOptions(options);\n }\n }, [options]);\n\n return priceLineApiRef;\n};\n","import { ForwardedRef, forwardRef, useImperativeHandle } from \"react\";\nimport { PriceLineApiRef, PriceLineProps } from \"./types\";\nimport { useInitPriceLine } from \"./useInitPriceLine\";\n\nconst PriceLineRenderFunction = (props: PriceLineProps, ref: ForwardedRef<PriceLineApiRef>) => {\n const priceLineApiRef = useInitPriceLine(props);\n useImperativeHandle(ref, () => priceLineApiRef.current, [priceLineApiRef]);\n\n return null;\n};\n\nconst PriceLine = forwardRef(PriceLineRenderFunction);\nPriceLine.displayName = \"PriceLine\";\nexport default PriceLine;\n"],"names":["ChartContext","createContext","useInitChart","container","rest","onClick","onCrosshairMove","onInit","restOptions","chartApiRef","useRef","createChart","useLayoutEffect","_chartApiRef_current_api","children","ChartWrapper","forwardRef","className","ref","setContainer","useState","containerRef","useCallback","r","ChartComponent","useSafeContext","context","currentContextValue","useContext","ctxName","Error","useInitTimeScale","onVisibleTimeRangeChange","onVisibleLogicalRangeChange","onSizeChange","visibleRange","visibleLogicalRange","options","chart","timeScaleApiRef","chartApi","_timeScaleApiRef_current_api","TimeScale","props","useImperativeHandle","useInitPriceScale","id","priceScaleApiRef","_priceScaleApiRef_current","_priceScaleApiRef_current_api","PriceScale","useInitSeries","type","data","reactive","markers","seriesApiRef","addSeries","_chart_api","_seriesApiRef_current_api","series","SeriesContext","SeriesTemplate","seriesApi","LineSeries","HistogramSeries","CandlestickSeries","AreaSeries","BaselineSeries","BarSeries","useInitPriceLine","price","priceLineApiRef","_series_api","_priceLineApiRef_current_api","PriceLine"],"mappings":";;;;;;;;;;iGAGO,IAAMA,EAAeC,AAAAA,GAAAA,EAAAA,aAAAA,AAAAA,EAAc,CAAC,EAC3CD,CAAAA,EAAa,WAAW,CAAG,eCAp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O,CAAE,CAACA,EAAgB,EAElE,IACT,EAGAG,CAAAA,EAAU,WAAW,CAAG,YACxB,MAAeA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/**!
|
|
3
|
-
* lightweight-charts-react-components v0.0.
|
|
3
|
+
* lightweight-charts-react-components v0.0.3
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE.md file in the root directory of this source tree.
|
|
@@ -670,10 +670,7 @@ __webpack_require__.d = function(exports, definition) {
|
|
|
670
670
|
}();
|
|
671
671
|
// webpack/runtime/has_own_property
|
|
672
672
|
!function() {
|
|
673
|
-
__webpack_require__.o = function (obj, prop)
|
|
674
|
-
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
675
|
-
};
|
|
676
|
-
|
|
673
|
+
__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
|
677
674
|
}();
|
|
678
675
|
// webpack/runtime/make_namespace_object
|
|
679
676
|
!function() {
|
|
@@ -684,23 +681,26 @@ __webpack_require__.r = function(exports) {
|
|
|
684
681
|
}
|
|
685
682
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
686
683
|
};
|
|
687
|
-
|
|
688
684
|
}();
|
|
689
685
|
/************************************************************************/
|
|
690
686
|
var __webpack_exports__ = {};
|
|
687
|
+
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
|
|
688
|
+
!function() {
|
|
691
689
|
// ESM COMPAT FLAG
|
|
692
690
|
__webpack_require__.r(__webpack_exports__);
|
|
693
691
|
|
|
694
692
|
// EXPORTS
|
|
695
693
|
__webpack_require__.d(__webpack_exports__, {
|
|
696
|
-
|
|
694
|
+
BarSeries: function() { return /* reexport */ BarSeries; },
|
|
695
|
+
LineSeries: function() { return /* reexport */ series_LineSeries; },
|
|
696
|
+
Chart: function() { return /* reexport */ ChartWrapper; },
|
|
697
|
+
BaselineSeries: function() { return /* reexport */ BaselineSeries; },
|
|
698
|
+
PriceLine: function() { return /* reexport */ priceLine_PriceLine; },
|
|
699
|
+
CandlestickSeries: function() { return /* reexport */ series_CandlestickSeries; },
|
|
697
700
|
HistogramSeries: function() { return /* reexport */ series_HistogramSeries; },
|
|
698
|
-
PriceLine: function() { return /* reexport */ PriceLine; },
|
|
699
|
-
AreaSeries: function() { return /* reexport */ series_AreaSeries; },
|
|
700
|
-
Chart: function() { return /* reexport */ chart_ChartWrapper; },
|
|
701
|
-
PriceScale: function() { return /* reexport */ PriceScale; },
|
|
702
701
|
TimeScale: function() { return /* reexport */ TimeScale; },
|
|
703
|
-
|
|
702
|
+
AreaSeries: function() { return /* reexport */ series_AreaSeries; },
|
|
703
|
+
PriceScale: function() { return /* reexport */ PriceScale; }
|
|
704
704
|
});
|
|
705
705
|
|
|
706
706
|
// EXTERNAL MODULE: ../node_modules/react/jsx-runtime.js
|
|
@@ -1478,9 +1478,9 @@ var ChartRenderFunction = function(_param, ref) {
|
|
|
1478
1478
|
}))
|
|
1479
1479
|
});
|
|
1480
1480
|
};
|
|
1481
|
-
var
|
|
1482
|
-
|
|
1483
|
-
/* ESM default export */ var
|
|
1481
|
+
var ChartWrapper_ChartWrapper = /*#__PURE__*/ (0,react.forwardRef)(ChartRenderFunction);
|
|
1482
|
+
ChartWrapper_ChartWrapper.displayName = "ChartWrapper";
|
|
1483
|
+
/* ESM default export */ var ChartWrapper = (ChartWrapper_ChartWrapper);
|
|
1484
1484
|
|
|
1485
1485
|
;// CONCATENATED MODULE: ./src/chart/index.ts
|
|
1486
1486
|
|
|
@@ -1821,6 +1821,12 @@ var addSeries = function(chart, type) {
|
|
|
1821
1821
|
case "Area":
|
|
1822
1822
|
series = chart.addAreaSeries();
|
|
1823
1823
|
break;
|
|
1824
|
+
case "Baseline":
|
|
1825
|
+
series = chart.addBaselineSeries();
|
|
1826
|
+
break;
|
|
1827
|
+
case "Bar":
|
|
1828
|
+
series = chart.addBarSeries();
|
|
1829
|
+
break;
|
|
1824
1830
|
default:
|
|
1825
1831
|
throw new Error("Unknown series type: ".concat(type));
|
|
1826
1832
|
}
|
|
@@ -1879,9 +1885,9 @@ var SeriesTemplateRenderFunction = function(_param, ref) {
|
|
|
1879
1885
|
children: children
|
|
1880
1886
|
});
|
|
1881
1887
|
};
|
|
1882
|
-
var
|
|
1883
|
-
|
|
1884
|
-
/* ESM default export */ var
|
|
1888
|
+
var SeriesTemplate_SeriesTemplate = /*#__PURE__*/ (0,react.forwardRef)(SeriesTemplateRenderFunction);
|
|
1889
|
+
SeriesTemplate_SeriesTemplate.displayName = "SeriesTemplate";
|
|
1890
|
+
/* ESM default export */ var SeriesTemplate = (SeriesTemplate_SeriesTemplate);
|
|
1885
1891
|
|
|
1886
1892
|
;// CONCATENATED MODULE: ./src/series/LineSeries.tsx
|
|
1887
1893
|
function LineSeries_define_property(obj, key, value) {
|
|
@@ -1970,7 +1976,7 @@ var LineSeriesRenderFunction = function(_param, ref) {
|
|
|
1970
1976
|
var children = _param.children, rest = LineSeries_object_without_properties(_param, [
|
|
1971
1977
|
"children"
|
|
1972
1978
|
]);
|
|
1973
|
-
return /*#__PURE__*/ (0,jsx_runtime.jsx)(
|
|
1979
|
+
return /*#__PURE__*/ (0,jsx_runtime.jsx)(SeriesTemplate, LineSeries_object_spread_props(LineSeries_object_spread({
|
|
1974
1980
|
type: "Line",
|
|
1975
1981
|
ref: ref
|
|
1976
1982
|
}, rest), {
|
|
@@ -2068,7 +2074,7 @@ var HistogramSeriesRenderFunction = function(_param, ref) {
|
|
|
2068
2074
|
var children = _param.children, rest = HistogramSeries_object_without_properties(_param, [
|
|
2069
2075
|
"children"
|
|
2070
2076
|
]);
|
|
2071
|
-
return /*#__PURE__*/ (0,jsx_runtime.jsx)(
|
|
2077
|
+
return /*#__PURE__*/ (0,jsx_runtime.jsx)(SeriesTemplate, HistogramSeries_object_spread_props(HistogramSeries_object_spread({
|
|
2072
2078
|
type: "Histogram",
|
|
2073
2079
|
ref: ref
|
|
2074
2080
|
}, rest), {
|
|
@@ -2166,16 +2172,16 @@ var CandlestickSeriesRenderFunction = function(_param, ref) {
|
|
|
2166
2172
|
var children = _param.children, rest = CandlestickSeries_object_without_properties(_param, [
|
|
2167
2173
|
"children"
|
|
2168
2174
|
]);
|
|
2169
|
-
return /*#__PURE__*/ (0,jsx_runtime.jsx)(
|
|
2175
|
+
return /*#__PURE__*/ (0,jsx_runtime.jsx)(SeriesTemplate, CandlestickSeries_object_spread_props(CandlestickSeries_object_spread({
|
|
2170
2176
|
type: "Candlestick",
|
|
2171
2177
|
ref: ref
|
|
2172
2178
|
}, rest), {
|
|
2173
2179
|
children: children
|
|
2174
2180
|
}));
|
|
2175
2181
|
};
|
|
2176
|
-
var
|
|
2177
|
-
|
|
2178
|
-
/* ESM default export */ var
|
|
2182
|
+
var CandlestickSeries = /*#__PURE__*/ (0,react.forwardRef)(CandlestickSeriesRenderFunction);
|
|
2183
|
+
CandlestickSeries.displayName = "CandlestickSeries";
|
|
2184
|
+
/* ESM default export */ var series_CandlestickSeries = (CandlestickSeries);
|
|
2179
2185
|
|
|
2180
2186
|
;// CONCATENATED MODULE: ./src/series/AreaSeries.tsx
|
|
2181
2187
|
function AreaSeries_define_property(obj, key, value) {
|
|
@@ -2264,7 +2270,7 @@ var AreaSeriesRenderFunction = function(_param, ref) {
|
|
|
2264
2270
|
var children = _param.children, rest = AreaSeries_object_without_properties(_param, [
|
|
2265
2271
|
"children"
|
|
2266
2272
|
]);
|
|
2267
|
-
return /*#__PURE__*/ (0,jsx_runtime.jsx)(
|
|
2273
|
+
return /*#__PURE__*/ (0,jsx_runtime.jsx)(SeriesTemplate, AreaSeries_object_spread_props(AreaSeries_object_spread({
|
|
2268
2274
|
type: "Area",
|
|
2269
2275
|
ref: ref
|
|
2270
2276
|
}, rest), {
|
|
@@ -2275,6 +2281,202 @@ var AreaSeries = /*#__PURE__*/ (0,react.forwardRef)(AreaSeriesRenderFunction);
|
|
|
2275
2281
|
AreaSeries.displayName = "AreaSeries";
|
|
2276
2282
|
/* ESM default export */ var series_AreaSeries = (AreaSeries);
|
|
2277
2283
|
|
|
2284
|
+
;// CONCATENATED MODULE: ./src/series/BaselineSeries.tsx
|
|
2285
|
+
function BaselineSeries_define_property(obj, key, value) {
|
|
2286
|
+
if (key in obj) {
|
|
2287
|
+
Object.defineProperty(obj, key, {
|
|
2288
|
+
value: value,
|
|
2289
|
+
enumerable: true,
|
|
2290
|
+
configurable: true,
|
|
2291
|
+
writable: true
|
|
2292
|
+
});
|
|
2293
|
+
} else {
|
|
2294
|
+
obj[key] = value;
|
|
2295
|
+
}
|
|
2296
|
+
return obj;
|
|
2297
|
+
}
|
|
2298
|
+
function BaselineSeries_object_spread(target) {
|
|
2299
|
+
for(var i = 1; i < arguments.length; i++){
|
|
2300
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
2301
|
+
var ownKeys = Object.keys(source);
|
|
2302
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
2303
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
2304
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
2305
|
+
}));
|
|
2306
|
+
}
|
|
2307
|
+
ownKeys.forEach(function(key) {
|
|
2308
|
+
BaselineSeries_define_property(target, key, source[key]);
|
|
2309
|
+
});
|
|
2310
|
+
}
|
|
2311
|
+
return target;
|
|
2312
|
+
}
|
|
2313
|
+
function BaselineSeries_ownKeys(object, enumerableOnly) {
|
|
2314
|
+
var keys = Object.keys(object);
|
|
2315
|
+
if (Object.getOwnPropertySymbols) {
|
|
2316
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
2317
|
+
if (enumerableOnly) {
|
|
2318
|
+
symbols = symbols.filter(function(sym) {
|
|
2319
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
2320
|
+
});
|
|
2321
|
+
}
|
|
2322
|
+
keys.push.apply(keys, symbols);
|
|
2323
|
+
}
|
|
2324
|
+
return keys;
|
|
2325
|
+
}
|
|
2326
|
+
function BaselineSeries_object_spread_props(target, source) {
|
|
2327
|
+
source = source != null ? source : {};
|
|
2328
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
2329
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
2330
|
+
} else {
|
|
2331
|
+
BaselineSeries_ownKeys(Object(source)).forEach(function(key) {
|
|
2332
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2333
|
+
});
|
|
2334
|
+
}
|
|
2335
|
+
return target;
|
|
2336
|
+
}
|
|
2337
|
+
function BaselineSeries_object_without_properties(source, excluded) {
|
|
2338
|
+
if (source == null) return {};
|
|
2339
|
+
var target = BaselineSeries_object_without_properties_loose(source, excluded);
|
|
2340
|
+
var key, i;
|
|
2341
|
+
if (Object.getOwnPropertySymbols) {
|
|
2342
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
2343
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
2344
|
+
key = sourceSymbolKeys[i];
|
|
2345
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
2346
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
2347
|
+
target[key] = source[key];
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
return target;
|
|
2351
|
+
}
|
|
2352
|
+
function BaselineSeries_object_without_properties_loose(source, excluded) {
|
|
2353
|
+
if (source == null) return {};
|
|
2354
|
+
var target = {};
|
|
2355
|
+
var sourceKeys = Object.keys(source);
|
|
2356
|
+
var key, i;
|
|
2357
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
2358
|
+
key = sourceKeys[i];
|
|
2359
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
2360
|
+
target[key] = source[key];
|
|
2361
|
+
}
|
|
2362
|
+
return target;
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
|
|
2366
|
+
|
|
2367
|
+
var BaselineSeriesRenderFunction = function(_param, ref) {
|
|
2368
|
+
var children = _param.children, rest = BaselineSeries_object_without_properties(_param, [
|
|
2369
|
+
"children"
|
|
2370
|
+
]);
|
|
2371
|
+
return /*#__PURE__*/ (0,jsx_runtime.jsx)(SeriesTemplate, BaselineSeries_object_spread_props(BaselineSeries_object_spread({
|
|
2372
|
+
type: "Baseline",
|
|
2373
|
+
ref: ref
|
|
2374
|
+
}, rest), {
|
|
2375
|
+
children: children
|
|
2376
|
+
}));
|
|
2377
|
+
};
|
|
2378
|
+
var BaselineSeries_BaselineSeries = /*#__PURE__*/ (0,react.forwardRef)(BaselineSeriesRenderFunction);
|
|
2379
|
+
BaselineSeries_BaselineSeries.displayName = "BaselineSeries";
|
|
2380
|
+
/* ESM default export */ var BaselineSeries = (BaselineSeries_BaselineSeries);
|
|
2381
|
+
|
|
2382
|
+
;// CONCATENATED MODULE: ./src/series/BarSeries.tsx
|
|
2383
|
+
function BarSeries_define_property(obj, key, value) {
|
|
2384
|
+
if (key in obj) {
|
|
2385
|
+
Object.defineProperty(obj, key, {
|
|
2386
|
+
value: value,
|
|
2387
|
+
enumerable: true,
|
|
2388
|
+
configurable: true,
|
|
2389
|
+
writable: true
|
|
2390
|
+
});
|
|
2391
|
+
} else {
|
|
2392
|
+
obj[key] = value;
|
|
2393
|
+
}
|
|
2394
|
+
return obj;
|
|
2395
|
+
}
|
|
2396
|
+
function BarSeries_object_spread(target) {
|
|
2397
|
+
for(var i = 1; i < arguments.length; i++){
|
|
2398
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
2399
|
+
var ownKeys = Object.keys(source);
|
|
2400
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
2401
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
2402
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
2403
|
+
}));
|
|
2404
|
+
}
|
|
2405
|
+
ownKeys.forEach(function(key) {
|
|
2406
|
+
BarSeries_define_property(target, key, source[key]);
|
|
2407
|
+
});
|
|
2408
|
+
}
|
|
2409
|
+
return target;
|
|
2410
|
+
}
|
|
2411
|
+
function BarSeries_ownKeys(object, enumerableOnly) {
|
|
2412
|
+
var keys = Object.keys(object);
|
|
2413
|
+
if (Object.getOwnPropertySymbols) {
|
|
2414
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
2415
|
+
if (enumerableOnly) {
|
|
2416
|
+
symbols = symbols.filter(function(sym) {
|
|
2417
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
2418
|
+
});
|
|
2419
|
+
}
|
|
2420
|
+
keys.push.apply(keys, symbols);
|
|
2421
|
+
}
|
|
2422
|
+
return keys;
|
|
2423
|
+
}
|
|
2424
|
+
function BarSeries_object_spread_props(target, source) {
|
|
2425
|
+
source = source != null ? source : {};
|
|
2426
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
2427
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
2428
|
+
} else {
|
|
2429
|
+
BarSeries_ownKeys(Object(source)).forEach(function(key) {
|
|
2430
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2431
|
+
});
|
|
2432
|
+
}
|
|
2433
|
+
return target;
|
|
2434
|
+
}
|
|
2435
|
+
function BarSeries_object_without_properties(source, excluded) {
|
|
2436
|
+
if (source == null) return {};
|
|
2437
|
+
var target = BarSeries_object_without_properties_loose(source, excluded);
|
|
2438
|
+
var key, i;
|
|
2439
|
+
if (Object.getOwnPropertySymbols) {
|
|
2440
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
2441
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
2442
|
+
key = sourceSymbolKeys[i];
|
|
2443
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
2444
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
2445
|
+
target[key] = source[key];
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
return target;
|
|
2449
|
+
}
|
|
2450
|
+
function BarSeries_object_without_properties_loose(source, excluded) {
|
|
2451
|
+
if (source == null) return {};
|
|
2452
|
+
var target = {};
|
|
2453
|
+
var sourceKeys = Object.keys(source);
|
|
2454
|
+
var key, i;
|
|
2455
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
2456
|
+
key = sourceKeys[i];
|
|
2457
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
2458
|
+
target[key] = source[key];
|
|
2459
|
+
}
|
|
2460
|
+
return target;
|
|
2461
|
+
}
|
|
2462
|
+
|
|
2463
|
+
|
|
2464
|
+
|
|
2465
|
+
var BarSeriesRenderFunction = function(_param, ref) {
|
|
2466
|
+
var children = _param.children, rest = BarSeries_object_without_properties(_param, [
|
|
2467
|
+
"children"
|
|
2468
|
+
]);
|
|
2469
|
+
return /*#__PURE__*/ (0,jsx_runtime.jsx)(SeriesTemplate, BarSeries_object_spread_props(BarSeries_object_spread({
|
|
2470
|
+
type: "Bar",
|
|
2471
|
+
ref: ref
|
|
2472
|
+
}, rest), {
|
|
2473
|
+
children: children
|
|
2474
|
+
}));
|
|
2475
|
+
};
|
|
2476
|
+
var BarSeries_BarSeries = /*#__PURE__*/ (0,react.forwardRef)(BarSeriesRenderFunction);
|
|
2477
|
+
BarSeries_BarSeries.displayName = "BarSeries";
|
|
2478
|
+
/* ESM default export */ var BarSeries = (BarSeries_BarSeries);
|
|
2479
|
+
|
|
2278
2480
|
;// CONCATENATED MODULE: ./src/series/index.ts
|
|
2279
2481
|
|
|
2280
2482
|
|
|
@@ -2282,6 +2484,8 @@ AreaSeries.displayName = "AreaSeries";
|
|
|
2282
2484
|
|
|
2283
2485
|
|
|
2284
2486
|
|
|
2487
|
+
|
|
2488
|
+
|
|
2285
2489
|
;// CONCATENATED MODULE: ./src/priceLine/useInitPriceLine.ts
|
|
2286
2490
|
function useInitPriceLine_define_property(obj, key, value) {
|
|
2287
2491
|
if (key in obj) {
|
|
@@ -2369,9 +2573,9 @@ var PriceLineRenderFunction = function(props, ref) {
|
|
|
2369
2573
|
]);
|
|
2370
2574
|
return null;
|
|
2371
2575
|
};
|
|
2372
|
-
var
|
|
2373
|
-
|
|
2374
|
-
/* ESM default export */ var
|
|
2576
|
+
var PriceLine = /*#__PURE__*/ (0,react.forwardRef)(PriceLineRenderFunction);
|
|
2577
|
+
PriceLine.displayName = "PriceLine";
|
|
2578
|
+
/* ESM default export */ var priceLine_PriceLine = (PriceLine);
|
|
2375
2579
|
|
|
2376
2580
|
;// CONCATENATED MODULE: ./src/priceLine/index.ts
|
|
2377
2581
|
|
|
@@ -2383,6 +2587,7 @@ PriceLine_PriceLine.displayName = "PriceLine";
|
|
|
2383
2587
|
|
|
2384
2588
|
|
|
2385
2589
|
|
|
2590
|
+
}();
|
|
2386
2591
|
return __webpack_exports__;
|
|
2387
2592
|
})()
|
|
2388
2593
|
|
package/package.json
CHANGED
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lightweight-charts-react-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"build": "rslib build"
|
|
6
|
+
},
|
|
4
7
|
"description": "React components for Lightweight Charts",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"react",
|
|
10
|
+
"lightweight-charts",
|
|
11
|
+
"data-visualization",
|
|
12
|
+
"trading",
|
|
13
|
+
"charting",
|
|
14
|
+
"stock",
|
|
15
|
+
"market",
|
|
16
|
+
"finance"
|
|
17
|
+
],
|
|
5
18
|
"repository": "https://github.com/ukorvl/lightweight-charts-react-components",
|
|
6
19
|
"homepage": "https://github.com/ukorvl/lightweight-charts-react-components#readme",
|
|
7
20
|
"bugs": {
|
|
8
21
|
"url": "https://github.com/ukorvl/lightweight-charts-react-components/issues"
|
|
9
22
|
},
|
|
10
23
|
"type": "module",
|
|
11
|
-
"main": "lightweight-charts-react-components.cjs",
|
|
12
|
-
"module": "lightweight-charts-react-components.js",
|
|
13
|
-
"types": "index.d.ts",
|
|
14
|
-
"unpkg": "lightweight-charts-react-components.standalone.js",
|
|
24
|
+
"main": "./dist/lightweight-charts-react-components.cjs",
|
|
25
|
+
"module": "./dist/lightweight-charts-react-components.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"unpkg": "./dist/lightweight-charts-react-components.standalone.js",
|
|
15
28
|
"exports": {
|
|
16
29
|
"./package.json": "./package.json",
|
|
17
30
|
".": {
|
|
@@ -23,9 +36,6 @@
|
|
|
23
36
|
"files": [
|
|
24
37
|
"dist"
|
|
25
38
|
],
|
|
26
|
-
"scripts": {
|
|
27
|
-
"build": "rslib build"
|
|
28
|
-
},
|
|
29
39
|
"author": "ukorvl",
|
|
30
40
|
"license": "MIT",
|
|
31
41
|
"peerDependencies": {
|
|
@@ -41,10 +51,10 @@
|
|
|
41
51
|
"devDependencies": {
|
|
42
52
|
"@microsoft/api-extractor": "^7.52.1",
|
|
43
53
|
"@rsbuild/plugin-react": "^1.1.0",
|
|
44
|
-
"@rslib/core": "^0.
|
|
54
|
+
"@rslib/core": "^0.5.5",
|
|
45
55
|
"@types/react": "^19.0.2",
|
|
46
56
|
"@types/react-dom": "^19.0.2",
|
|
47
|
-
"
|
|
48
|
-
"vitest": "^
|
|
57
|
+
"rsbuild-plugin-dts": "^0.5.5",
|
|
58
|
+
"vitest": "^3.0.9"
|
|
49
59
|
}
|
|
50
60
|
}
|