Skip to content

Commit

Permalink
chore: tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle committed Nov 29, 2024
1 parent 026dcda commit 4fe16a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"typecheck": "tsc -p tsconfig.json --noEmit",
"test": "npm run test-types && npm run test-unit && npm run test-karma",
"pretest-unit": "swc --config-file .swcrc-spec src -d build",
"test-unit": "cross-env JASMINE_CONFIG_PATH=jasmine.json c8 --all --src=src --reporter=text --reporter=lcov -o=coverage/unit jasmine",
"test-unit": "cross-env JASMINE_CONFIG_PATH=jasmine.json c8 --src=src --reporter=text --reporter=lcov -o=coverage/unit jasmine",
"test-karma": "cross-env NODE_ENV=test karma start ./karma.conf.cjs --auto-watch --single-run --coverage",
"test-types": "tsc -p test/types/ --noEmit"
},
Expand Down
5 changes: 2 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Chart, Point, Scale } from 'chart.js'
import { each } from 'chart.js/helpers'
import type { DragOptions, ModeOption, ModifierKey, PanOptions } from './options'

const eventKey = (key: ModifierKey): 'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey' => `${key}Key`
Expand Down Expand Up @@ -84,11 +83,11 @@ export function getEnabledScalesByPoint(options: PanOptions | undefined, point:

const enabledScales: Scale[] = []

each(chart.scales, function (scaleItem) {
for (const scaleItem of Object.values(chart.scales)) {
if (enabled[scaleItem.axis as 'x' | 'y']) {
enabledScales.push(scaleItem)
}
})
}

return enabledScales || Object.values(chart.scales)
}

0 comments on commit 4fe16a4

Please sign in to comment.