-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from VisActor/fix/isvalid-scale-include-thres…
…hold Fix/isvalid scale include threshold
- Loading branch information
Showing
3 changed files
with
40 additions
and
14 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
common/changes/@visactor/vscale/fix-isvalid-scale-include-threshold_2023-09-20-06-44.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"comment": "fix: fix isValidScale did not include threshold scale\n\n", | ||
"type": "none", | ||
"packageName": "@visactor/vscale" | ||
} | ||
], | ||
"packageName": "@visactor/vscale", | ||
"email": "lixuef1313@163.com" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { isValidScaleType, ScaleEnum } from '../src/type'; | ||
|
||
test('scaleLinear() has the expected defaults', function () { | ||
expect(isValidScaleType(ScaleEnum.Identity)).toBe(true); | ||
|
||
expect(isValidScaleType(ScaleEnum.Linear)).toBe(true); | ||
expect(isValidScaleType(ScaleEnum.Log)).toBe(true); | ||
expect(isValidScaleType(ScaleEnum.Pow)).toBe(true); | ||
expect(isValidScaleType(ScaleEnum.Sqrt)).toBe(true); | ||
expect(isValidScaleType(ScaleEnum.Symlog)).toBe(true); | ||
expect(isValidScaleType(ScaleEnum.Time)).toBe(true); | ||
|
||
expect(isValidScaleType(ScaleEnum.Quantile)).toBe(true); | ||
expect(isValidScaleType(ScaleEnum.Quantize)).toBe(true); | ||
expect(isValidScaleType(ScaleEnum.Threshold)).toBe(true); | ||
|
||
expect(isValidScaleType(ScaleEnum.Ordinal)).toBe(true); | ||
expect(isValidScaleType(ScaleEnum.Point)).toBe(true); | ||
expect(isValidScaleType(ScaleEnum.Band)).toBe(true); | ||
|
||
expect(isValidScaleType('unknown')).toBe(false); | ||
expect(isValidScaleType('aaaaa')).toBe(false); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters