forked from katspaugh/wavesurfer.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce relativeNormalization option for split channels rendering (k…
…atspaugh#2108) * Extract absolute maximum as a utility function * Implement relativeNormalization option for split channels * assign default parameters for splitChannelsOptions * Improve example documentation for relativeNormalization * fix typo * document purpose of overallAbsMax * Capitalize normalizedMax parameter documentation * rewrap long comment * version tag relativeNormalization property * unit tests for absMax utility module * add relativeNormalization to changelog * corrected version references to 4.3.0 * improve absMax documentation * mark version for SplitChannelOptions typedef with @SInCE instead of @Version
- Loading branch information
1 parent
f62ad10
commit 3c09bb8
Showing
8 changed files
with
82 additions
and
10 deletions.
There are no files selected for viewing
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
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
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
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
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
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,16 @@ | ||
import utilMax from './max'; | ||
import utilmin from './min'; | ||
|
||
/** | ||
* Get the largest absolute value in an array | ||
* | ||
* @param {Array} values Array of numbers | ||
* @returns {Number} Largest number found | ||
* @example console.log(max([-3, 2, 1]), max([-3, 2, 4])); // logs 3 4 | ||
* @since 4.3.0 | ||
*/ | ||
export default function absMax(values) { | ||
const max = utilMax(values); | ||
const min = utilmin(values); | ||
return -min > max ? -min : max; | ||
} |
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
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