├── tests ├── setup.mjs ├── unittests │ ├── setup.units.mjs │ ├── tsconfig.composite.json │ ├── series-options.spec.ts │ └── delegate.spec.ts ├── e2e │ ├── coverage │ │ ├── coverage-config.ts │ │ ├── test-cases │ │ │ ├── chart │ │ │ │ ├── create-string.js │ │ │ │ ├── remove.js │ │ │ │ ├── screenshot.js │ │ │ │ ├── options.js │ │ │ │ ├── auto-size.js │ │ │ │ ├── kinetic-scroll.js │ │ │ │ ├── handle-scroll.js │ │ │ │ └── localization.js │ │ │ ├── .eslintrc.cjs │ │ │ ├── exports.js │ │ │ ├── series │ │ │ │ ├── remove-series.js │ │ │ │ ├── title.js │ │ │ │ └── area-inverted.js │ │ │ ├── time-scale │ │ │ │ └── hidden.js │ │ │ └── panes │ │ │ │ ├── add-pane.js │ │ │ │ ├── pane-size.js │ │ │ │ ├── remove-pane.js │ │ │ │ ├── panes-sceenshot.js │ │ │ │ └── swap-panes.js │ │ └── helpers │ │ │ └── get-coverage-test-cases.ts │ ├── .eslintrc.cjs │ ├── graphics │ │ ├── helpers │ │ │ ├── testcase-window-type.ts │ │ │ └── compare-screenshots.ts │ │ └── test-cases │ │ │ ├── .eslintrc.cjs │ │ │ ├── series │ │ │ ├── line-with-custom-color.js │ │ │ ├── price-line-overlapping-series-title.js │ │ │ ├── line-with-steps-with-custom-color.js │ │ │ ├── curved-line-2-points.js │ │ │ ├── histogram-change-default-color.js │ │ │ ├── area.js │ │ │ ├── no-last-price-animation-on-first-set-data.js │ │ │ ├── histogram-update-without-set-data.js │ │ │ ├── curved-line-3-points.js │ │ │ ├── add-series-after-volume.js │ │ │ ├── area-inverted.js │ │ │ ├── line.js │ │ │ ├── area-relative-gradient.js │ │ │ ├── price-line-line-visibility.js │ │ │ ├── step-line-area.js │ │ │ ├── area-with-whitespaces.js │ │ │ ├── line-with-whitespaces.js │ │ │ ├── area-relative-gradient-inverted.js │ │ │ ├── histogram-with-whitespaces.js │ │ │ ├── no-last-price-animation-on-adding-whitespace.js │ │ │ ├── line-dotted.js │ │ │ ├── single-point-area.js │ │ │ ├── single-point-line.js │ │ │ ├── step-line.js │ │ │ ├── area-with-point-markers.js │ │ │ ├── several-non-regular-series.js │ │ │ ├── price-line-with-percentage-scale-mode.js │ │ │ ├── line-with-point-markers.js │ │ │ ├── curved-line-area.js │ │ │ ├── hidden-series-and-autoscale.js │ │ │ ├── curved-line-baseline.js │ │ │ ├── step-line-baseline.js │ │ │ ├── line-with-custom-color-change-color-later.js │ │ │ ├── no-last-price-animation-on-first-set-data-after-reseting-data.js │ │ │ ├── histogram.js │ │ │ └── line-series-with-point-markers-and-hidden-line.js │ │ │ ├── api │ │ │ ├── getting-series-price-scale.js │ │ │ └── ignore-resize-if-autosize-active.js │ │ │ ├── time-scale │ │ │ ├── set-and-clear-series.js │ │ │ ├── disable-bold-labels.js │ │ │ ├── realign-partially-hidden-time-scale-marks.js │ │ │ └── set-visible-range.js │ │ │ ├── options-chart.js │ │ │ ├── rtl-page.js │ │ │ ├── months-chart.js │ │ │ ├── transparent-color.js │ │ │ ├── initial-options │ │ │ ├── price-line-source-default.js │ │ │ ├── fix-left-edge.js │ │ │ ├── draw-time-ticks.js │ │ │ ├── no-autoscale.js │ │ │ ├── date-format.js │ │ │ ├── draw-price-ticks.js │ │ │ ├── custom-date-format.js │ │ │ ├── no-price-scale.js │ │ │ ├── zero-precision.js │ │ │ ├── price-format.js │ │ │ ├── left-price-scale.js │ │ │ ├── price-line-source-last-visible.js │ │ │ ├── no-base-line.js │ │ │ ├── no-price-line.js │ │ │ ├── crosshair-label-color-black.js │ │ │ ├── crosshair-label-color-greys.js │ │ │ ├── crosshair-label-color-named.js │ │ │ ├── crosshair-label-color-white.js │ │ │ └── gradient-background.js │ │ │ ├── fit-content-with-few-data.js │ │ │ ├── set-crosshair-position.js │ │ │ ├── applying-options │ │ │ ├── series-title.js │ │ │ └── fix-left-edge.js │ │ │ ├── price-scale │ │ │ └── logarithmic-scale-on-small-values.js │ │ │ ├── add-series-after-time.js │ │ │ └── attribution-logo-dark.js │ ├── memleaks │ │ ├── test-cases │ │ │ └── .eslintrc.cjs │ │ └── helpers │ │ │ └── test-page.html │ ├── helpers │ │ ├── page-timeout.ts │ │ ├── zoom-action.ts │ │ └── retry-tests.ts │ ├── interactions │ │ ├── test-cases │ │ │ └── .eslintrc.cjs │ │ └── helpers │ │ │ ├── get-interaction-test-cases.ts │ │ │ └── test-page-dummy.html │ └── tsconfig.composite.json ├── tsconfig.composite.json └── type-checks │ ├── tsconfig.composite.json │ └── watermarks.ts ├── website ├── static │ ├── .nojekyll │ ├── favicon.ico │ └── img │ │ ├── margin.png │ │ ├── bar-series.png │ │ ├── time-scale.png │ │ ├── area-series.png │ │ ├── extra-margin.png │ │ ├── first-chart.png │ │ ├── line-series.png │ │ ├── logical-range.png │ │ ├── price-scales.png │ │ ├── baseline-series.png │ │ ├── candlestick-series.png │ │ ├── histogram-series.png │ │ └── favicon │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ └── apple-touch-icon.png ├── .npmrc ├── tutorials │ ├── react │ │ └── _category_.yml │ ├── vuejs │ │ ├── _category_.yml │ │ └── assets │ │ │ └── .eslintrc.js │ ├── a11y │ │ └── _category_.yml │ ├── customization │ │ ├── _category_.yml │ │ ├── .eslintrc.js │ │ ├── _iterative-guide-warning-partial.mdx │ │ └── _apply-options-tabs-partial.mdx │ ├── webcomponents │ │ ├── _category_.yml │ │ └── assets │ │ │ └── .eslintrc.js │ ├── demos │ │ └── .eslintrc.js │ ├── how_to │ │ ├── .eslintrc.js │ │ └── _usage-guide-partial.mdx │ └── _usage-guide-partial.mdx ├── svgr.config.js ├── docs │ ├── migrations │ │ └── _category_.yml │ └── plugins │ │ ├── pixel-perfect-rendering │ │ ├── _category_.yml │ │ └── widths │ │ │ └── _category_.yml │ │ └── .eslintrc.js ├── versions.json ├── versioned_docs │ ├── version-3.8 │ │ └── migrations │ │ │ └── _category_.yml │ ├── version-4.0 │ │ └── migrations │ │ │ └── _category_.yml │ ├── version-4.1 │ │ ├── migrations │ │ │ └── _category_.yml │ │ └── plugins │ │ │ ├── pixel-perfect-rendering │ │ │ ├── widths │ │ │ │ └── _category_.yml │ │ │ └── _category_.yml │ │ │ └── .eslintrc.js │ ├── version-4.2 │ │ ├── migrations │ │ │ └── _category_.yml │ │ └── plugins │ │ │ ├── pixel-perfect-rendering │ │ │ ├── widths │ │ │ │ └── _category_.yml │ │ │ └── _category_.yml │ │ │ └── .eslintrc.js │ └── version-5.0 │ │ ├── migrations │ │ └── _category_.yml │ │ └── plugins │ │ ├── pixel-perfect-rendering │ │ ├── widths │ │ │ └── _category_.yml │ │ └── _category_.yml │ │ └── .eslintrc.js ├── plugins │ └── enhanced-codeblock │ │ ├── theme │ │ └── CodeBlock │ │ │ ├── styles.module.css │ │ │ └── use-id.ts │ │ └── index.js ├── .browserslistrc ├── src │ ├── img │ │ ├── vuejs.svg │ │ ├── react.svg │ │ ├── tradingview-logo-small.svg │ │ ├── shapes.svg │ │ └── cog.svg │ ├── pages │ │ └── chart.module.css │ ├── theme │ │ ├── Footer │ │ │ └── index.js │ │ └── analytics-wrapper.js │ └── components │ │ ├── landing-page │ │ └── Banner │ │ │ └── index.tsx │ │ ├── InstantDetails │ │ └── index.tsx │ │ └── CardLinkList │ │ └── index.tsx ├── .previous-typings-cache │ └── tsconfig.json ├── tsconfig.json ├── .eslintrc.js └── versioned_sidebars │ └── version-4.2-sidebars.json ├── packages └── create-lwc-plugin │ ├── .gitignore │ ├── index.js │ ├── template-common │ ├── src │ │ ├── vite-env.d.ts │ │ ├── helpers │ │ │ └── dimensions │ │ │ │ ├── common.ts │ │ │ │ └── crosshair-width.ts │ │ └── vite.config.js │ ├── index.html │ ├── _gitignore │ ├── package.json │ └── tsconfig.json │ ├── build.config.ts │ ├── template-series │ └── src │ │ ├── data.ts │ │ ├── example │ │ ├── example.ts │ │ └── index.html │ │ └── options.ts │ ├── tsconfig.json │ ├── src │ └── helpers │ │ ├── validation.ts │ │ └── package.ts │ └── template-primitive │ └── src │ ├── data-source.ts │ └── example │ ├── example.ts │ └── index.html ├── .markdownlint.json ├── plugin-examples ├── src │ ├── vite-env.d.ts │ ├── plugins │ │ ├── anchored-text │ │ │ ├── package.json │ │ │ └── example │ │ │ │ ├── index.html │ │ │ │ └── example.ts │ │ ├── background-shade-series │ │ │ ├── package.json │ │ │ ├── options.ts │ │ │ └── example │ │ │ │ ├── example.ts │ │ │ │ └── index.html │ │ ├── lollipop-series │ │ │ ├── data.ts │ │ │ ├── options.ts │ │ │ └── example │ │ │ │ ├── index.html │ │ │ │ └── example.ts │ │ ├── grouped-bars-series │ │ │ ├── data.ts │ │ │ ├── options.ts │ │ │ └── example │ │ │ │ └── index.html │ │ ├── stacked-area-series │ │ │ ├── data.ts │ │ │ └── example │ │ │ │ ├── index.html │ │ │ │ └── example.ts │ │ ├── stacked-bars-series │ │ │ ├── data.ts │ │ │ ├── options.ts │ │ │ └── example │ │ │ │ └── example.ts │ │ ├── brushable-area-series │ │ │ ├── data.ts │ │ │ └── example │ │ │ │ └── index.html │ │ ├── hlc-area-series │ │ │ ├── data.ts │ │ │ ├── example │ │ │ │ ├── example.ts │ │ │ │ └── index.html │ │ │ └── options.ts │ │ ├── rounded-candles-series │ │ │ ├── data.ts │ │ │ └── example │ │ │ │ └── index.html │ │ ├── heatmap-series │ │ │ ├── data.ts │ │ │ ├── example │ │ │ │ └── index.html │ │ │ └── options.ts │ │ ├── user-price-alerts │ │ │ └── renderer-base.ts │ │ ├── expiring-price-alerts │ │ │ ├── options.ts │ │ │ ├── iexpiring-price-alerts.ts │ │ │ └── example │ │ │ │ └── index.html │ │ ├── user-price-lines │ │ │ └── example │ │ │ │ ├── example.ts │ │ │ │ └── index.html │ │ ├── bands-indicator │ │ │ └── example │ │ │ │ ├── example.ts │ │ │ │ └── index.html │ │ ├── box-whisker-series │ │ │ ├── options.ts │ │ │ └── example │ │ │ │ └── example.ts │ │ ├── rectangle-drawing-tool │ │ │ └── example │ │ │ │ └── example.ts │ │ ├── vertical-line │ │ │ └── example │ │ │ │ ├── index.html │ │ │ │ └── example.ts │ │ ├── highlight-bar-crosshair │ │ │ └── example │ │ │ │ ├── example.ts │ │ │ │ └── index.html │ │ ├── overlay-price-scale │ │ │ └── example │ │ │ │ ├── example.ts │ │ │ │ └── index.html │ │ ├── trend-line │ │ │ └── example │ │ │ │ ├── index.html │ │ │ │ └── example.ts │ │ ├── partial-price-line │ │ │ └── example │ │ │ │ └── index.html │ │ ├── volume-profile │ │ │ └── example │ │ │ │ └── index.html │ │ └── image-watermark │ │ │ └── example │ │ │ └── index.html │ ├── helpers │ │ ├── simple-clone.ts │ │ └── dimensions │ │ │ ├── common.ts │ │ │ └── crosshair-width.ts │ └── vite.config.js ├── index.html ├── .gitignore ├── tsconfig.json └── package.json ├── src ├── model │ ├── horz-scale-behavior-price │ │ └── types.ts │ ├── coordinate.ts │ ├── point.ts │ ├── sort-sources.ts │ ├── price-formatter-fn.ts │ ├── default-price-scale.ts │ ├── plot-data.ts │ ├── series │ │ └── pane-view.ts │ ├── iprice-data-source.ts │ └── bar.ts ├── helpers │ ├── tsconfig.composite.json │ ├── mutable.ts │ ├── logger.ts │ ├── isubscription.ts │ ├── idestroyable.ts │ ├── events.ts │ ├── is-running-on-client-side.ts │ └── nominal.ts ├── views │ ├── time-axis │ │ └── itime-axis-view.ts │ ├── pane │ │ ├── iaxis-view.ts │ │ ├── ipane-view.ts │ │ └── iupdatable-pane-view.ts │ └── price-axis │ │ └── iprice-axis-view.ts ├── gui │ ├── tsconfig.composite.json │ ├── ipane-view-getter.ts │ └── iaxis-view-getters.ts ├── formatters │ ├── tsconfig.composite.json │ ├── iprice-formatter.ts │ ├── percentage-formatter.ts │ ├── date-formatter.ts │ └── time-formatter.ts ├── api │ ├── options │ │ ├── yield-curve-chart-options-defaults.ts │ │ ├── grid-options-defaults.ts │ │ ├── price-line-options-defaults.ts │ │ ├── price-scale-options-defaults.ts │ │ ├── layout-options-defaults.ts │ │ ├── crosshair-options-defaults.ts │ │ ├── time-scale-options-defaults.ts │ │ └── series-options-defaults.ts │ ├── tsconfig.composite.json │ ├── candlestick-series-api.ts │ ├── price-line-api.ts │ ├── iprice-scale-api.ts │ └── iprice-line.ts ├── renderers │ ├── iaxis-view-renderer.ts │ ├── ipane-renderer.ts │ ├── composite-renderer.ts │ ├── itime-axis-view-renderer.ts │ └── line-renderer.ts ├── tsconfig.model.json ├── standalone.ts ├── tsconfig.composite.json ├── typings │ ├── _global-types │ │ └── index.d.ts │ └── _build-time-constants │ │ └── index.d.ts └── plugins │ ├── series-markers │ └── series-markers-text.ts │ ├── image-watermark │ └── options.ts │ ├── primitive-wrapper-base.ts │ └── primitive-wrapper.ts ├── NOTICE ├── scripts ├── run-coverage-tests.sh ├── .eslintrc.cjs ├── run-interactions-tests.sh ├── no-crlf.sh ├── run-memleaks-tests.sh └── trailing-newlines.sh ├── .github ├── ISSUE_TEMPLATE │ ├── other.md │ ├── config.yml │ ├── feature_request.md │ └── bug_report.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── size-limit.yml ├── .npmrc ├── tsconfig.json ├── tsconfig.composite.base.json ├── tsconfig.composite.json ├── .mailmap ├── tsdoc.json ├── debug ├── .eslintrc.cjs ├── debug-esm.html.example └── tsconfig.json ├── .editorconfig ├── .eslintignore ├── dts-config.json ├── .vscode └── settings.json ├── tsconfig.prod.json ├── .puppeteerrc.cjs └── tsconfig.options.json /tests/setup.mjs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /website/static/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/.npmrc: -------------------------------------------------------------------------------- 1 | package-lock=false 2 | -------------------------------------------------------------------------------- /packages/create-lwc-plugin/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist -------------------------------------------------------------------------------- /tests/unittests/setup.units.mjs: -------------------------------------------------------------------------------- 1 | import '../setup.mjs'; 2 | -------------------------------------------------------------------------------- /website/tutorials/react/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "React" 2 | -------------------------------------------------------------------------------- /website/tutorials/vuejs/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "Vue.js" 2 | -------------------------------------------------------------------------------- /website/tutorials/a11y/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "Accessibility" 2 | -------------------------------------------------------------------------------- /website/svgr.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | svgo: false, 3 | }; 4 | -------------------------------------------------------------------------------- /website/tutorials/customization/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "Customization" 2 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "default": true, 3 | "line-length": false 4 | } 5 | -------------------------------------------------------------------------------- /plugin-examples/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /website/tutorials/webcomponents/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "Web Components" 2 | -------------------------------------------------------------------------------- /website/docs/migrations/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "Migration guides" 2 | position: 5 3 | -------------------------------------------------------------------------------- /src/model/horz-scale-behavior-price/types.ts: -------------------------------------------------------------------------------- 1 | export type HorzScalePriceItem = number; 2 | -------------------------------------------------------------------------------- /packages/create-lwc-plugin/index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import './dist/index.mjs'; 4 | -------------------------------------------------------------------------------- /website/versions.json: -------------------------------------------------------------------------------- 1 | [ 2 | "5.0", 3 | "4.2", 4 | "4.1", 5 | "4.0", 6 | "3.8" 7 | ] 8 | -------------------------------------------------------------------------------- /packages/create-lwc-plugin/template-common/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /website/versioned_docs/version-3.8/migrations/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "Migration guides" 2 | position: 5 3 | -------------------------------------------------------------------------------- /website/versioned_docs/version-4.0/migrations/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "Migration guides" 2 | position: 5 3 | -------------------------------------------------------------------------------- /website/versioned_docs/version-4.1/migrations/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "Migration guides" 2 | position: 5 3 | -------------------------------------------------------------------------------- /website/versioned_docs/version-4.2/migrations/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "Migration guides" 2 | position: 5 3 | -------------------------------------------------------------------------------- /website/versioned_docs/version-5.0/migrations/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "Migration guides" 2 | position: 5 3 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | TradingView Lightweight Charts™ 2 | Copyright (с) 2025 TradingView, Inc. https://www.tradingview.com/ 3 | -------------------------------------------------------------------------------- /tests/e2e/coverage/coverage-config.ts: -------------------------------------------------------------------------------- 1 | export const expectedCoverage = 90; 2 | export const threshold = 1; 3 | -------------------------------------------------------------------------------- /website/docs/plugins/pixel-perfect-rendering/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "Pixel Perfect Rendering" 2 | position: 5 3 | -------------------------------------------------------------------------------- /website/docs/plugins/pixel-perfect-rendering/widths/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "Default Widths" 2 | position: 0 3 | -------------------------------------------------------------------------------- /website/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/lightweight-charts/HEAD/website/static/favicon.ico -------------------------------------------------------------------------------- /tests/e2e/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | 'no-console': [ 4 | 'off', 5 | ], 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /website/plugins/enhanced-codeblock/theme/CodeBlock/styles.module.css: -------------------------------------------------------------------------------- 1 | .iframe { 2 | width: 100%; 3 | height: 250px; 4 | } 5 | -------------------------------------------------------------------------------- /website/static/img/margin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/lightweight-charts/HEAD/website/static/img/margin.png -------------------------------------------------------------------------------- /website/static/img/bar-series.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/lightweight-charts/HEAD/website/static/img/bar-series.png -------------------------------------------------------------------------------- /website/static/img/time-scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/lightweight-charts/HEAD/website/static/img/time-scale.png -------------------------------------------------------------------------------- /website/tutorials/customization/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ignorePatterns: ['_apply-options-tabs-partial.mdx'], 3 | }; 4 | -------------------------------------------------------------------------------- /website/versioned_docs/version-4.1/plugins/pixel-perfect-rendering/widths/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "Default Widths" 2 | position: 0 3 | -------------------------------------------------------------------------------- /website/versioned_docs/version-4.2/plugins/pixel-perfect-rendering/widths/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "Default Widths" 2 | position: 0 3 | -------------------------------------------------------------------------------- /website/versioned_docs/version-5.0/plugins/pixel-perfect-rendering/widths/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "Default Widths" 2 | position: 0 3 | -------------------------------------------------------------------------------- /website/static/img/area-series.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/lightweight-charts/HEAD/website/static/img/area-series.png -------------------------------------------------------------------------------- /website/static/img/extra-margin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/lightweight-charts/HEAD/website/static/img/extra-margin.png -------------------------------------------------------------------------------- /website/static/img/first-chart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/lightweight-charts/HEAD/website/static/img/first-chart.png -------------------------------------------------------------------------------- /website/static/img/line-series.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/lightweight-charts/HEAD/website/static/img/line-series.png -------------------------------------------------------------------------------- /website/static/img/logical-range.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/lightweight-charts/HEAD/website/static/img/logical-range.png -------------------------------------------------------------------------------- /website/static/img/price-scales.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/lightweight-charts/HEAD/website/static/img/price-scales.png -------------------------------------------------------------------------------- /website/versioned_docs/version-4.1/plugins/pixel-perfect-rendering/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "Pixel Perfect Rendering" 2 | position: 5 3 | -------------------------------------------------------------------------------- /website/versioned_docs/version-4.2/plugins/pixel-perfect-rendering/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "Pixel Perfect Rendering" 2 | position: 5 3 | -------------------------------------------------------------------------------- /website/versioned_docs/version-5.0/plugins/pixel-perfect-rendering/_category_.yml: -------------------------------------------------------------------------------- 1 | label: "Pixel Perfect Rendering" 2 | position: 5 3 | -------------------------------------------------------------------------------- /website/static/img/baseline-series.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/lightweight-charts/HEAD/website/static/img/baseline-series.png -------------------------------------------------------------------------------- /website/tutorials/vuejs/assets/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | globals: { 3 | document: false, 4 | window: false, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /src/helpers/tsconfig.composite.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.composite.base.json", 3 | "include": [ 4 | "./**/*.ts" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /website/static/img/candlestick-series.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/lightweight-charts/HEAD/website/static/img/candlestick-series.png -------------------------------------------------------------------------------- /website/static/img/histogram-series.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/lightweight-charts/HEAD/website/static/img/histogram-series.png -------------------------------------------------------------------------------- /scripts/run-coverage-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | echo "Preparing" 4 | 5 | npm run build 6 | 7 | echo "Coverage tests" 8 | npm run e2e:coverage 9 | -------------------------------------------------------------------------------- /website/static/img/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/lightweight-charts/HEAD/website/static/img/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /website/static/img/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/lightweight-charts/HEAD/website/static/img/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /website/versioned_docs/version-4.1/plugins/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | globals: { 3 | document: false, 4 | createChart: false, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /website/versioned_docs/version-4.2/plugins/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | globals: { 3 | document: false, 4 | createChart: false, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /plugin-examples/src/plugins/anchored-text/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "main": "anchored-text", 4 | "types": "anchored-text.d.ts" 5 | } 6 | -------------------------------------------------------------------------------- /src/helpers/mutable.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Removes "readonly" from all properties 3 | */ 4 | export type Mutable = { 5 | -readonly [P in keyof T]: T[P]; 6 | }; 7 | -------------------------------------------------------------------------------- /website/static/img/favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/lightweight-charts/HEAD/website/static/img/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /scripts/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | node: true, 4 | }, 5 | rules: { 6 | 'no-console': [ 7 | 'off', 8 | ], 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /scripts/run-interactions-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | echo "Preparing" 4 | 5 | npm run build 6 | 7 | echo "Interactions tests" 8 | npm run e2e:interactions 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/other.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Other 3 | about: Any other type of an issue 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /website/.browserslistrc: -------------------------------------------------------------------------------- 1 | [production] 2 | >0.5% 3 | not dead 4 | not op_mini all 5 | 6 | [development] 7 | last 1 chrome version 8 | last 1 firefox version 9 | last 1 safari version -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | package-lock=false 2 | legacy-peer-deps=true 3 | engine-strict=false # memlab doesn't explictly mention node v22 yet. 4 | prefer-dedupe=true 5 | prefer-offline=true 6 | save-prefix=~ 7 | -------------------------------------------------------------------------------- /plugin-examples/src/plugins/background-shade-series/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "main": "background-shade-series", 4 | "types": "background-shade-series.d.ts" 5 | } 6 | -------------------------------------------------------------------------------- /tests/tsconfig.composite.json: -------------------------------------------------------------------------------- 1 | { 2 | "references": [ 3 | { "path": "./e2e/tsconfig.composite.json" }, 4 | { "path": "./unittests/tsconfig.composite.json" } 5 | ], 6 | "include": [] 7 | } 8 | -------------------------------------------------------------------------------- /src/model/coordinate.ts: -------------------------------------------------------------------------------- 1 | import { Nominal } from '../helpers/nominal'; 2 | 3 | /** 4 | * Represents a coordiate as a `number`. 5 | */ 6 | export type Coordinate = Nominal; 7 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.options.json", 3 | "compilerOptions": { 4 | "noEmit": true 5 | }, 6 | "include": [ 7 | "src/**/*.ts", 8 | "tests/**/*.ts" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /src/views/time-axis/itime-axis-view.ts: -------------------------------------------------------------------------------- 1 | import { TimeAxisViewRenderer } from '../../renderers/time-axis-view-renderer'; 2 | 3 | export interface ITimeAxisView { 4 | renderer(): TimeAxisViewRenderer; 5 | } 6 | -------------------------------------------------------------------------------- /src/gui/tsconfig.composite.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.composite.base.json", 3 | "references": [ 4 | { "path": "../tsconfig.model.json" } 5 | ], 6 | "include": [ 7 | "./**/*.ts", 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tsconfig.composite.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.options.json", 3 | "compilerOptions": { 4 | "composite": true, 5 | "outDir": "lib/composite" 6 | }, 7 | "references": [], 8 | "include": [] 9 | } 10 | -------------------------------------------------------------------------------- /packages/create-lwc-plugin/template-common/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tsconfig.composite.json: -------------------------------------------------------------------------------- 1 | { 2 | "references": [ 3 | { "path": "./src/tsconfig.composite.json" }, 4 | { "path": "./tests/tsconfig.composite.json" }, 5 | { "path": "./website/tsconfig.json" }, 6 | ], 7 | "include": [] 8 | } 9 | -------------------------------------------------------------------------------- /plugin-examples/src/plugins/lollipop-series/data.ts: -------------------------------------------------------------------------------- 1 | import { CustomData } from 'lightweight-charts'; 2 | 3 | /** 4 | * Lollipop Series Data 5 | */ 6 | export interface LollipopData extends CustomData { 7 | value: number; 8 | } 9 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Eugene Korobko 2 | Eugene Korobko 3 | 4 | 5 | <39053314+kpaape@users.noreply.github.com> 6 | -------------------------------------------------------------------------------- /src/formatters/tsconfig.composite.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.composite.base.json", 3 | "references": [ 4 | { "path": "../helpers/tsconfig.composite.json" } 5 | ], 6 | "include": [ 7 | "./**/*.ts" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /src/views/pane/iaxis-view.ts: -------------------------------------------------------------------------------- 1 | import { Pane } from '../../model/pane'; 2 | import { IAxisRenderer } from '../../renderers/iaxis-view-renderer'; 3 | 4 | export interface IAxisView { 5 | renderer(pane: Pane): IAxisRenderer | null; 6 | } 7 | -------------------------------------------------------------------------------- /plugin-examples/src/plugins/grouped-bars-series/data.ts: -------------------------------------------------------------------------------- 1 | import { CustomData } from 'lightweight-charts'; 2 | 3 | /** 4 | * GroupedBars Series Data 5 | */ 6 | export interface GroupedBarsData extends CustomData { 7 | values: number[]; 8 | } 9 | -------------------------------------------------------------------------------- /plugin-examples/src/plugins/stacked-area-series/data.ts: -------------------------------------------------------------------------------- 1 | import { CustomData } from 'lightweight-charts'; 2 | 3 | /** 4 | * StackedArea Series Data 5 | */ 6 | export interface StackedAreaData extends CustomData { 7 | values: number[]; 8 | } 9 | -------------------------------------------------------------------------------- /plugin-examples/src/plugins/stacked-bars-series/data.ts: -------------------------------------------------------------------------------- 1 | import { CustomData } from 'lightweight-charts'; 2 | 3 | /** 4 | * StackedBars Series Data 5 | */ 6 | export interface StackedBarsData extends CustomData { 7 | values: number[]; 8 | } 9 | -------------------------------------------------------------------------------- /scripts/no-crlf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | git --no-pager grep -I --perl-regexp --files-with-matches '\r' ':!*.bat' . 4 | 5 | if [ $? -eq 0 ] 6 | then 7 | echo -e "\033[31mThese files has CRLF line endings!\033[m" 8 | exit 1 9 | fi 10 | -------------------------------------------------------------------------------- /plugin-examples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

List of example previews are here

8 | 9 | 10 | -------------------------------------------------------------------------------- /plugin-examples/src/plugins/brushable-area-series/data.ts: -------------------------------------------------------------------------------- 1 | import { CustomData } from 'lightweight-charts'; 2 | 3 | /** 4 | * BrushableArea Series Data 5 | */ 6 | export interface BrushableAreaData extends CustomData { 7 | value: number; 8 | } 9 | -------------------------------------------------------------------------------- /plugin-examples/src/helpers/simple-clone.ts: -------------------------------------------------------------------------------- 1 | type Mutable = { 2 | -readonly [K in keyof T]: T[K] 3 | } 4 | 5 | export function cloneReadonly(obj: T): Mutable { 6 | return JSON.parse(JSON.stringify(obj)); 7 | } 8 | -------------------------------------------------------------------------------- /src/helpers/logger.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | export function warn(msg: string): void { 4 | if (process.env.NODE_ENV === 'development') { 5 | // eslint-disable-next-line no-console 6 | console.warn(msg); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/views/pane/ipane-view.ts: -------------------------------------------------------------------------------- 1 | import { Pane } from '../../model/pane'; 2 | import { IPaneRenderer } from '../../renderers/ipane-renderer'; 3 | 4 | export interface IPaneView { 5 | renderer(pane: Pane, addAnchors?: boolean): IPaneRenderer | null; 6 | } 7 | -------------------------------------------------------------------------------- /website/src/img/vuejs.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /plugin-examples/src/helpers/dimensions/common.ts: -------------------------------------------------------------------------------- 1 | export interface BitmapPositionLength { 2 | /** coordinate for use with a bitmap rendering scope */ 3 | position: number; 4 | /** length for use with a bitmap rendering scope */ 5 | length: number; 6 | } 7 | -------------------------------------------------------------------------------- /src/views/pane/iupdatable-pane-view.ts: -------------------------------------------------------------------------------- 1 | import { IPaneView } from './ipane-view'; 2 | 3 | export type UpdateType = 'data' | 'other' | 'options'; 4 | 5 | export interface IUpdatablePaneView extends IPaneView { 6 | update(updateType?: UpdateType): void; 7 | } 8 | -------------------------------------------------------------------------------- /tsdoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", 3 | "tagDefinitions": [ 4 | { 5 | "tagName": "@template", 6 | "syntaxKind": "block" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /debug/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | 3 | module.exports = { 4 | env: { 5 | browser: true, 6 | node: false, 7 | }, 8 | rules: { 9 | 'no-console': 0, 10 | }, 11 | globals: { 12 | LightweightCharts: false, 13 | chart: false, 14 | }, 15 | }; 16 | -------------------------------------------------------------------------------- /website/tutorials/webcomponents/assets/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | globals: { 3 | document: false, 4 | window: false, 5 | HTMLElement: false, 6 | }, 7 | rules: { 8 | 'no-console': 'off', 9 | 'no-prototype-builtins': 'off', 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /plugin-examples/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | compiled 4 | typings 5 | website 6 | *.local 7 | 8 | # Editor directories and files 9 | .vscode/* 10 | !.vscode/extensions.json 11 | .idea 12 | .DS_Store 13 | *.suo 14 | *.ntvs* 15 | *.njsproj 16 | *.sln 17 | *.sw? 18 | -------------------------------------------------------------------------------- /plugin-examples/src/plugins/hlc-area-series/data.ts: -------------------------------------------------------------------------------- 1 | import { CustomData } from 'lightweight-charts'; 2 | 3 | /** 4 | * HLCArea Series Data 5 | */ 6 | export interface HLCAreaData extends CustomData { 7 | high: number; 8 | low: number; 9 | close: number; 10 | } 11 | -------------------------------------------------------------------------------- /plugin-examples/src/plugins/rounded-candles-series/data.ts: -------------------------------------------------------------------------------- 1 | import { 2 | CandlestickData, 3 | CustomData, 4 | } from 'lightweight-charts'; 5 | 6 | export interface RoundedCandleSeriesData 7 | extends CandlestickData, 8 | CustomData { 9 | rounded?: boolean; 10 | } 11 | -------------------------------------------------------------------------------- /packages/create-lwc-plugin/template-common/src/helpers/dimensions/common.ts: -------------------------------------------------------------------------------- 1 | export interface BitmapPositionLength { 2 | /** coordinate for use with a bitmap rendering scope */ 3 | position: number; 4 | /** length for use with a bitmap rendering scope */ 5 | length: number; 6 | } 7 | -------------------------------------------------------------------------------- /website/src/pages/chart.module.css: -------------------------------------------------------------------------------- 1 | /* This is used by React charts across the site, but not on index (see HeroChart folder) */ 2 | .ChartContainer * { 3 | overflow: hidden; 4 | } 5 | 6 | .ChartContainer table td, 7 | .ChartContainer table tr { 8 | border: none; 9 | } 10 | -------------------------------------------------------------------------------- /website/plugins/enhanced-codeblock/index.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = function chartCodeBlockPlugin(context, options) { 4 | return { 5 | name: 'enhanced-codeblock', 6 | 7 | getThemePath: () => path.resolve(__dirname, './theme'), 8 | }; 9 | }; 10 | -------------------------------------------------------------------------------- /website/.previous-typings-cache/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "typeRoots": [ 4 | "./node_modules/@types" 5 | ], 6 | "lib": [ 7 | "dom", 8 | "es2020" 9 | ] 10 | }, 11 | "include": [ 12 | "./*.d.ts", 13 | "../../dist/typings.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /packages/create-lwc-plugin/template-common/src/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | 3 | const input = { 4 | main: './src/example/index.html', 5 | }; 6 | 7 | export default defineConfig({ 8 | build: { 9 | rollupOptions: { 10 | input, 11 | }, 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /tests/type-checks/tsconfig.composite.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.composite.base.json", 3 | "compilerOptions": { 4 | "strict": true, 5 | }, 6 | "references": [ 7 | { "path": "../../src/tsconfig.composite.json" } 8 | ], 9 | "include": [ 10 | "./**/*.ts" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /website/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/docusaurus/tsconfig.json", 3 | "compilerOptions": { 4 | "strict": true, 5 | "resolveJsonModule": true, 6 | "jsx": "react", 7 | "moduleResolution": "node" 8 | }, 9 | "include": [ 10 | "./**/*.ts", 11 | "./**/*.tsx", 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /src/api/options/yield-curve-chart-options-defaults.ts: -------------------------------------------------------------------------------- 1 | import { YieldCurveOptions } from '../../model/yield-curve-horz-scale-behavior/yield-curve-chart-options'; 2 | 3 | export const yieldChartOptionsDefaults: YieldCurveOptions = { 4 | baseResolution: 1, 5 | minimumTimeRange: 120, 6 | startTimeRange: 0, 7 | }; 8 | -------------------------------------------------------------------------------- /tests/e2e/graphics/helpers/testcase-window-type.ts: -------------------------------------------------------------------------------- 1 | import { IChartApi } from '../../../../src/api/create-chart'; 2 | 3 | export interface TestCaseWindow extends Window { 4 | testCaseReady: void | Promise; 5 | chart?: IChartApi; 6 | ignoreMouseMove?: boolean; 7 | checkChartScreenshot?: boolean; 8 | } 9 | -------------------------------------------------------------------------------- /website/docs/plugins/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | globals: { 3 | document: false, 4 | createChart: false, 5 | LineSeries: false, 6 | AreaSeries: false, 7 | BarSeries: false, 8 | BaselineSeries: false, 9 | CandlestickSeries: false, 10 | HistogramSeries: false, 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /src/model/point.ts: -------------------------------------------------------------------------------- 1 | import { Coordinate } from './coordinate'; 2 | 3 | /** 4 | * Represents a point on the chart. 5 | */ 6 | export interface Point { 7 | /** 8 | * The x coordinate. 9 | */ 10 | readonly x: Coordinate; 11 | /** 12 | * The y coordinate. 13 | */ 14 | readonly y: Coordinate; 15 | } 16 | -------------------------------------------------------------------------------- /packages/create-lwc-plugin/build.config.ts: -------------------------------------------------------------------------------- 1 | import { defineBuildConfig } from 'unbuild'; 2 | 3 | export default defineBuildConfig({ 4 | entries: ['src/index'], 5 | clean: true, 6 | rollup: { 7 | inlineDependencies: true, 8 | esbuild: { 9 | target: 'node18', 10 | minify: true, 11 | }, 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /tests/e2e/coverage/test-cases/chart/create-string.js: -------------------------------------------------------------------------------- 1 | function interactionsToPerform() { 2 | return []; 3 | } 4 | 5 | function beforeInteractions() { 6 | LightweightCharts.createChart('container'); 7 | return Promise.resolve(); 8 | } 9 | 10 | function afterInteractions() { 11 | return Promise.resolve(); 12 | } 13 | -------------------------------------------------------------------------------- /tests/unittests/tsconfig.composite.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.composite.base.json", 3 | "compilerOptions": { 4 | "module": "ESNext", 5 | "types": ["node"] 6 | }, 7 | "references": [ 8 | { "path": "../../src/tsconfig.composite.json" } 9 | ], 10 | "include": [ 11 | "./**/*.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /src/api/tsconfig.composite.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.composite.base.json", 3 | "references": [ 4 | { "path": "../formatters/tsconfig.composite.json" }, 5 | { "path": "../gui/tsconfig.composite.json" }, 6 | { "path": "../tsconfig.model.json" } 7 | ], 8 | "include": [ 9 | "./**/*.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /website/versioned_docs/version-5.0/plugins/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | globals: { 3 | document: false, 4 | createChart: false, 5 | LineSeries: false, 6 | AreaSeries: false, 7 | BarSeries: false, 8 | BaselineSeries: false, 9 | CandlestickSeries: false, 10 | HistogramSeries: false, 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /src/gui/ipane-view-getter.ts: -------------------------------------------------------------------------------- 1 | import { 2 | IDataSourcePaneViews, 3 | } from '../model/idata-source'; 4 | import { Pane } from '../model/pane'; 5 | import { IPaneView } from '../views/pane/ipane-view'; 6 | 7 | export type IPaneViewsGetter = ( 8 | source: IDataSourcePaneViews, 9 | pane: Pane 10 | ) => readonly IPaneView[]; 11 | -------------------------------------------------------------------------------- /src/renderers/iaxis-view-renderer.ts: -------------------------------------------------------------------------------- 1 | import { CanvasRenderingTarget2D } from 'fancy-canvas'; 2 | 3 | export interface IAxisRenderer { 4 | draw(target: CanvasRenderingTarget2D, isHovered: boolean, hitTestData?: unknown): void; 5 | drawBackground?(target: CanvasRenderingTarget2D, isHovered: boolean, hitTestData?: unknown): void; 6 | } 7 | -------------------------------------------------------------------------------- /src/tsconfig.model.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.composite.base.json", 3 | "references": [ 4 | { "path": "./formatters/tsconfig.composite.json" }, 5 | { "path": "./helpers/tsconfig.composite.json" } 6 | ], 7 | "include": [ 8 | "./model/**/*.ts", 9 | "./renderers/**/*.ts", 10 | "./views/**/*.ts" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /tests/e2e/memleaks/test-cases/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | 3 | module.exports = { 4 | env: { 5 | browser: true, 6 | node: false, 7 | }, 8 | rules: { 9 | 'no-unused-vars': ['error', { varsIgnorePattern: '^runTestCase$', args: 'none' }], 10 | }, 11 | globals: { 12 | LightweightCharts: false, 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /website/src/img/react.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/formatters/iprice-formatter.ts: -------------------------------------------------------------------------------- 1 | /** Interface to be implemented by the object in order to be used as a price formatter */ 2 | export interface IPriceFormatter { 3 | /** 4 | * Formatting function 5 | * 6 | * @param price - Original price to be formatted 7 | * @returns Formatted price 8 | */ 9 | format(price: number): string; 10 | } 11 | -------------------------------------------------------------------------------- /src/formatters/percentage-formatter.ts: -------------------------------------------------------------------------------- 1 | import { PriceFormatter } from './price-formatter'; 2 | 3 | export class PercentageFormatter extends PriceFormatter { 4 | public constructor(priceScale: number = 100) { 5 | super(priceScale); 6 | } 7 | 8 | public override format(price: number): string { 9 | return `${super.format(price)}%`; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_style = tab 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | 10 | [*.yml] 11 | indent_style = space 12 | indent_size = 2 13 | 14 | [*.md] 15 | trim_trailing_whitespace = false 16 | 17 | [package.json] 18 | indent_style = space 19 | indent_size = 2 20 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | !.eslintrc.js 2 | !.size-limit.js 3 | 4 | /dist/** 5 | !/dist/typings.d.ts 6 | /lib/** 7 | 8 | /src/typings/_resize-observer/index.d.ts 9 | 10 | **/node_modules 11 | 12 | /website/docs/api/** 13 | /website/versioned_docs/**/api/** 14 | /website/build/** 15 | /website/src/theme/**/*.js 16 | 17 | /plugin-examples 18 | /packages/create-lwc-plugin 19 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **Type of PR:** 2 | 3 | **PR checklist:** 4 | 5 | - [ ] Addresses an existing issue: fixes # 6 | - [ ] Includes tests 7 | - [ ] Documentation update 8 | 9 | **Overview of change:** 10 | 11 | 12 | 13 | **Is there anything you'd like reviewers to focus on?** 14 | 15 | 16 | -------------------------------------------------------------------------------- /dts-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilationOptions": { 3 | "preferredConfigPath": "./tsconfig.prod.json" 4 | }, 5 | "entries": [ 6 | { 7 | "filePath": "./lib/prod/src/index.d.ts", 8 | "outFile": "./dist/typings.d.ts", 9 | "output": { 10 | "sortNodes": true, 11 | "respectPreserveConstEnum": true 12 | }, 13 | "failOnClass": true 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /src/model/sort-sources.ts: -------------------------------------------------------------------------------- 1 | import { ensureNotNull } from '../helpers/assertions'; 2 | 3 | import { ZOrdered } from './idata-source'; 4 | 5 | export function sortSources(sources: readonly T[]): T[] { 6 | return sources.slice().sort((s1: ZOrdered, s2: ZOrdered) => { 7 | return (ensureNotNull(s1.zorder()) - ensureNotNull(s2.zorder())); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /src/standalone.ts: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line @typescript-eslint/naming-convention 2 | import * as LightweightChartsModule from './index'; 3 | 4 | // put all exports from package to window.LightweightCharts object 5 | // eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-member-access 6 | (window as any).LightweightCharts = LightweightChartsModule; 7 | -------------------------------------------------------------------------------- /tests/e2e/helpers/page-timeout.ts: -------------------------------------------------------------------------------- 1 | import { Page } from 'puppeteer'; 2 | 3 | // await a setTimeout delay evaluated within page context 4 | export async function pageTimeout(page: Page, delay: number): Promise { 5 | return page.evaluate( 6 | (ms: number) => new Promise( 7 | (resolve: () => void) => setTimeout(resolve, ms) 8 | ), 9 | delay 10 | ); 11 | } 12 | -------------------------------------------------------------------------------- /website/src/img/tradingview-logo-small.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /website/tutorials/demos/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | globals: { 3 | document: false, 4 | createChart: false, 5 | createYieldCurveChart: false, 6 | createUpDownMarkers: false, 7 | LineSeries: false, 8 | AreaSeries: false, 9 | BarSeries: false, 10 | BaselineSeries: false, 11 | CandlestickSeries: false, 12 | HistogramSeries: false, 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /src/model/price-formatter-fn.ts: -------------------------------------------------------------------------------- 1 | import { BarPrice } from './bar'; 2 | 3 | /** 4 | * A function used to format a {@link BarPrice} as a string. 5 | */ 6 | export type PriceFormatterFn = (priceValue: BarPrice) => string; 7 | 8 | /** 9 | * A function used to format a percentage value as a string. 10 | */ 11 | export type PercentageFormatterFn = (percentageValue: number) => string; 12 | -------------------------------------------------------------------------------- /tests/e2e/coverage/test-cases/chart/remove.js: -------------------------------------------------------------------------------- 1 | function interactionsToPerform() { 2 | return []; 3 | } 4 | 5 | let chart; 6 | 7 | function beforeInteractions(container) { 8 | chart = LightweightCharts.createChart(container); 9 | return Promise.resolve(); 10 | } 11 | 12 | function afterInteractions() { 13 | chart.remove(); 14 | chart = null; 15 | return Promise.resolve(); 16 | } 17 | -------------------------------------------------------------------------------- /website/src/theme/Footer/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Footer from '@theme-original/Footer'; 3 | import AnalyticsWrapper from '../analytics-wrapper'; 4 | 5 | // eslint-disable-next-line import/no-default-export 6 | export default function FooterWrapper(props) { 7 | return ( 8 | 9 |