Skip to content

Commit

Permalink
Set min/max domain for number col domain
Browse files Browse the repository at this point in the history
Related to #718

The parameter default, i.e. `min = Number.NaN`, is only used if the parameter is `undefined`. However, when the parameter is `null` it does not assign `Number.NaN`.

With this commit `null` and `undefined` result in `Number.NaN`.
  • Loading branch information
thinkh committed Jul 22, 2022
1 parent a067102 commit 2158e1f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/lineup/desc.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/lineup/desc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/lineup/desc.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/lineup/desc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ export class ColumnDescUtils {
* @param {Partial<IColumnOptions>} options
* @returns {IAdditionalColumnDesc}
*/
static numberCol(column: string, min: number = Number.NaN, max: number = Number.NaN, options: Partial<IColumnOptions> = {}): IAdditionalColumnDesc {
static numberCol(column: string, min?: number, max?: number, options: Partial<IColumnOptions> = {}): IAdditionalColumnDesc {
return Object.assign(ColumnDescUtils.baseColumn(column, options), {
type: 'number',
domain: [min, max],
domain: [min || Number.NaN, max || Number.NaN],
});
}

Expand Down

0 comments on commit 2158e1f

Please sign in to comment.