-
Notifications
You must be signed in to change notification settings - Fork 3
Compile with TypeScript #36
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
base: master
Are you sure you want to change the base?
Conversation
I've also expanded the API so most of the methods can be accessed directly from return c.overlay([
c.shape(
gbpusd.slice(0, 17).map((v, i) => [i, v] as [number, number])
.concat([[16, lo], [0, lo]]))
.fillColor("#1F77B460"),
c.shape(
gbpusd.slice(16).map((v, i) => [i + 16, v] as [number, number])
.concat([[gbpusd.length - 1, lo], [16, lo]]))
.fillColor("#D6272860"),
c.line(gbpusd.map((v, i) => [i, v]))
.strokeColor("#202020")
])
.axes({ left: true, right: true, bottom: true })
.svg(500, 200); |
Hello! This looks like a fantastic list of improvements for the library - I'd be happy to merge a PR that implements everything you listed above. I think having an option to emit HTML without React would be nice - I expect supporting some way of using the library on the server without the browser may be useful for someone. I'll have more time to look into this in the next week or so - but wanted just to quickly say thanks for looking into this! |
Thanks @tpetricek! I've updated the build script which will now put the JS files ready for distribution together with the declaration files in I've also added code to support dotnet compilation. If you type |
Hi @tpetricek! Not sure how to go with this PR. I am using your wonderful library to test TypeScript compilation to provide a typed API, but there are also other changes so maybe you don't want to merge everything at once.
The most important point is the last one. This makes it possible to use your excellent and documented API in a type-safe manner from TypeScript. We can also use TS erased unions (
Coord
becomesnumber | [any, number]
) and even the object to pass the events is typed.