Skip to content

Commit

Permalink
Merge branch 'master' into pr/1579
Browse files Browse the repository at this point in the history
  • Loading branch information
SlicedSilver committed Jul 25, 2024
2 parents 9b0513e + f934911 commit 0e1ea7d
Show file tree
Hide file tree
Showing 33 changed files with 1,892 additions and 192 deletions.
53 changes: 27 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ aliases:


executors:
node16-executor:
node-executor:
docker:
- image: cimg/node:16.16
- image: cimg/node:18.19

node16-browsers-executor:
node-browsers-executor:
docker:
- image: cimg/node:16.16-browsers
- image: cimg/node:18.19-browsers

commands:
checkout-with-deps:
Expand Down Expand Up @@ -87,21 +87,21 @@ commands:

jobs:
install-deps:
executor: node16-executor
executor: node-executor
steps:
- checkout-with-deps
- run: npm install
- save_cache: *save-node-modules-cache

install-deps-website:
executor: node16-executor
executor: node-executor
steps:
- checkout-with-deps
- run: cd website && npm install
- save_cache: *save-node-modules-cache-website

build:
executor: node16-executor
executor: node-executor
steps:
- checkout-with-deps
- run: npm run build:prod
Expand All @@ -115,27 +115,27 @@ jobs:
- dist

no-crlf:
executor: node16-executor
executor: node-executor
steps:
- checkout
- run: scripts/no-crlf.sh

trailing-lf:
executor: node16-executor
executor: node-executor
steps:
- checkout
- run: scripts/trailing-newlines.sh

lint-eslint:
executor: node16-executor
executor: node-executor
steps:
- checkout-with-deps
- attach_workspace:
at: ./
- run: npm run lint:eslint

lint-dts:
executor: node16-executor
executor: node-executor
steps:
- checkout-with-deps
- attach_workspace:
Expand All @@ -144,13 +144,13 @@ jobs:
- run: npm run check-dts-docs

lint-markdown:
executor: node16-executor
executor: node-executor
steps:
- checkout-with-deps
- run: npm run lint:md

usable-in-nodejs:
executor: node16-executor
executor: node-executor
steps:
- checkout-with-deps
- attach_workspace:
Expand All @@ -171,7 +171,7 @@ jobs:
command: node -e "import 'lightweight-charts'" --input-type=module

unittests:
executor: node16-executor
executor: node-executor
environment:
TESTS_REPORT_FILE: "test-results/unittests/results.xml"
steps:
Expand All @@ -181,14 +181,14 @@ jobs:
path: test-results/

type-tests:
executor: node16-executor
executor: node-executor
steps:
- checkout-with-deps
- run: npm run tsc-verify
- run: npm run type-tests

dts-changes:
executor: node16-executor
executor: node-executor
steps:
- checkout-with-deps
- run: scripts/check-dts-changes.sh ./dts-changes $(git merge-base origin/master HEAD) $(git rev-parse HEAD)
Expand All @@ -197,39 +197,39 @@ jobs:
when: on_fail

graphics-tests-dpr1_0:
executor: node16-browsers-executor
executor: node-browsers-executor
steps:
- run-graphics-tests:
devicePixelRatio: "1.0"

graphics-tests-dpr1_25:
executor: node16-browsers-executor
executor: node-browsers-executor
steps:
- run-graphics-tests:
devicePixelRatio: "1.25"

graphics-tests-dpr1_5:
executor: node16-browsers-executor
executor: node-browsers-executor
steps:
- run-graphics-tests:
devicePixelRatio: "1.5"

graphics-tests-dpr2_0:
executor: node16-browsers-executor
executor: node-browsers-executor
steps:
- run-graphics-tests:
devicePixelRatio: "2.0"

graphics-tests-dpr2_0-prod:
executor: node16-browsers-executor
executor: node-browsers-executor
steps:
- run-graphics-tests:
devicePixelRatio: "2.0"
productionBuild: true


memleaks-tests:
executor: node16-browsers-executor
executor: node-browsers-executor
environment:
NO_SANDBOX: "true"
TESTS_REPORT_FILE: "test-results/memleaks/results.xml"
Expand All @@ -249,7 +249,7 @@ jobs:
path: tests/e2e/memleaks/.logs/

coverage:
executor: node16-browsers-executor
executor: node-browsers-executor
environment:
NO_SANDBOX: "true"
TESTS_REPORT_FILE: "test-results/coverage/results.xml"
Expand All @@ -262,7 +262,7 @@ jobs:
path: test-results/

interactions:
executor: node16-browsers-executor
executor: node-browsers-executor
environment:
NO_SANDBOX: "true"
TESTS_REPORT_FILE: "test-results/interactions/results.xml"
Expand All @@ -275,7 +275,7 @@ jobs:
path: test-results/

size-limit:
executor: node16-executor
executor: node-executor
steps:
- checkout-with-deps
- attach_workspace:
Expand All @@ -286,7 +286,8 @@ jobs:
- run: npm run size-limit

build-docusaurus-website:
executor: node16-executor
executor: node-executor
resource_class: medium+
steps:
- checkout-with-deps
- run: npm run build:prod
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/website/docs/api/**
/website/versioned_docs/**/api/**
/website/build/**
/website/src/theme/**/*.js

/plugin-examples
/packages/create-lwc-plugin
3 changes: 1 addition & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ module.exports = {
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unnecessary-qualifier': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
Expand Down Expand Up @@ -792,8 +793,6 @@ module.exports = {
}],

'jsdoc/check-indentation': 'error',
'jsdoc/newline-after-description': 'error',

'import/no-default-export': 'error',

'prefer-arrow/prefer-arrow-functions': [
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '18'

- name: Install library dependencies
run: npm install
Expand All @@ -48,7 +48,7 @@ jobs:
run: npm run build:examples:site

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
8 changes: 4 additions & 4 deletions .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ module.exports = [
{
name: 'CJS',
path: 'dist/lightweight-charts.production.cjs',
limit: '48.15 KB',
limit: '48.35 KB',
},
{
name: 'ESM',
path: 'dist/lightweight-charts.production.mjs',
limit: '48.11 KB',
limit: '48.28 KB',
},
{
name: 'Standalone-ESM',
path: 'dist/lightweight-charts.standalone.production.mjs',
limit: '49.8 KB',
limit: '50.00 KB',
},
{
name: 'Standalone',
path: 'dist/lightweight-charts.standalone.production.js',
limit: '49.85 KB',
limit: '50.04 KB',
},
];
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"version": "4.2.0",
"version": "4.1.8",
"name": "lightweight-charts",
"author": "TradingView, Inc.",
"license": "Apache-2.0",
Expand Down Expand Up @@ -75,7 +75,7 @@
"eslint": "~7.32.0",
"eslint-plugin-deprecation": "~1.3.3",
"eslint-plugin-import": "~2.27.5",
"eslint-plugin-jsdoc": "~39.8.0",
"eslint-plugin-jsdoc": "~48.5.0",
"eslint-plugin-markdown": "~3.0.0",
"eslint-plugin-mdx": "~1.17.0",
"eslint-plugin-prefer-arrow": "~1.2.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LineStyle, createChart } from 'lightweight-charts';
import { LastPriceAnimationMode, LineStyle, createChart } from 'lightweight-charts';
import { generateLineData } from '../../../sample-data';
import { UserAlertInfo } from '../state';
import { UserPriceAlerts } from '../user-price-alerts';
Expand Down Expand Up @@ -41,6 +41,7 @@ const areaSeries = chart.addAreaSeries({
topColor: 'rgba(4,153,129, 0.4)',
bottomColor: 'rgba(4,153,129, 0)',
priceLineVisible: false,
lastPriceAnimation: LastPriceAnimationMode.Continuous,
});
const data = generateLineData();
areaSeries.setData(data);
Expand Down
6 changes: 5 additions & 1 deletion src/api/chart-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,11 @@ export class ChartApi<HorzScaleItem> implements IChartApiBase<HorzScaleItem>, Da
seriesData.set(this._mapSeriesToApi(series), data);
});

const hoveredSeries = param.hoveredSeries === undefined ? undefined : this._mapSeriesToApi(param.hoveredSeries);
const hoveredSeries =
param.hoveredSeries === undefined ||
!this._seriesMapReversed.has(param.hoveredSeries)
? undefined
: this._mapSeriesToApi(param.hoveredSeries);

return {
time: param.originalTime as HorzScaleItem,
Expand Down
12 changes: 12 additions & 0 deletions src/api/create-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,15 @@ export function createChart(container: string | HTMLElement, options?: DeepParti
HorzScaleBehaviorTime.applyDefaults(options)
);
}

/**
* Provides the default implementation of the horizontal scale (time-based) that can be used as a base for extending the horizontal scale with custom behavior.
* This allows for the introduction of custom functionality without re-implementing the entire {@link IHorzScaleBehavior}&lt;{@link Time}&gt; interface.
*
* For further details, refer to the {@link createChartEx} chart constructor method.
*
* @returns An uninitialized class implementing the {@link IHorzScaleBehavior}&lt;{@link Time}&gt; interface
*/
export function defaultHorzScaleBehavior(): new () => IHorzScaleBehavior<Time> {
return HorzScaleBehaviorTime;
}
Loading

0 comments on commit 0e1ea7d

Please sign in to comment.