Skip to content

Commit

Permalink
Add default arg correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
joelostblom committed Nov 11, 2023
1 parent c820639 commit 28932dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compile/data/density.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class DensityTransformNode extends DataFlowNode {
this.transform = duplicate(transform); // duplicate to prevent side effects
const specifiedAs = this.transform.as ?? [undefined, undefined];
this.transform.as = [specifiedAs[0] ?? 'value', specifiedAs[1] ?? 'density'];
const resolve = 'independent';
const resolve = this.transform.resolve ?? 'independent';
this.transform.resolve = resolve;
}

Expand Down
1 change: 1 addition & 0 deletions test/compile/data/density.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ describe('compile/data/fold', () => {
expect(density.assemble()).toEqual({
type: 'kde',
field: 'v',
resolve: 'independent',
as: ['value', 'density']
});
});
Expand Down

0 comments on commit 28932dd

Please sign in to comment.