-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Typing for Aesthetics and Transforms #46
Conversation
…into don/refactor/aesthetic-types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for these fixes.
@@ -126,7 +126,7 @@ export class ReglRenderer extends Renderer { | |||
const { prefs } = this; | |||
const { transform } = this.zoom; | |||
const { aes_to_buffer_num, buffer_num_to_variable, variable_to_buffer_num } = this.allocate_aesthetic_buffers(); | |||
console.log(prefs.arrow_table); | |||
// console.log(prefs.arrow_table); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to just kill anything that isn't a console.warn or console.error. I would lint them out of existence except there are few cases that they're actually intentional, alas.
const scales : { [key : string] : Function } = { | ||
const scales: Record< | ||
Transform, | ||
(range?: Iterable<number>) => ScaleContinuousNumeric<number, number, never> | ScaleIdentity<never> | ||
> = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice, glad to see this signature clarified.
type ConcreteAesthetic = | ||
| X | ||
| Y | ||
| Size | ||
| Jitter_speed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's up with this formatting, especially the line before the first X? I'm conditioned to think of leading lines as guard rather than an OR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same formatting that OCaml uses - I prefer it for multi-line union types as it keeps everything consistent.
Transform
typeAesthetic.ts
totypes.ts
and export itTransform
type in channel type definitionsdim
method strongly typedstore
andscales
strongly typed