-
Notifications
You must be signed in to change notification settings - Fork 187
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
Basic JSDoc types - Plot.plot and all Marks #1055
Conversation
@@ -91,17 +101,13 @@ function getJsDocsForFunction(name: string, declaration: FunctionDeclaration, pr | |||
for (const overload of overloads) { | |||
const docs = overload.getJsDocs(); | |||
if (!docs.length) continue; | |||
parts.push(docs.map((doc) => makeRelativeUrls(doc.getDescription())).join("\n\n")); | |||
parts.push(transformDocs(docs)); |
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.
All of the changes to jsdoc-to-readme are about trimming the JSDoc so extra leading and trailing new lines don't end up in the README file. For some reason, when you have a JSDoc in a file that is just importing types, TypeScript returns empty lines for that JSDoc. This is benign but will result in a slightly cleaner README file.
I think I'd like to have all the types imports at the top of each file, as I was trying to do with the "import types" in #1005. Maybe for later: I've tried to add a BarYOptions to the
Of course, it would have to be extended to cover all the stacking options, which means I'd want to write something like |
…his options transform
[reminder for next steps:] I've just noticed that Plot.window(X/Y) and Plot.normalize(X/Y) have no jsdocs at all. |
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.
lgtm!
@@ -2346,7 +2346,6 @@ Plot.rect(athletes, Plot.bin({fillOpacity: "count"}, {x: "weight", y: "height"}) | |||
Bins on *x* and *y*. Also groups on the first channel of *z*, *fill*, or | |||
*stroke*, if any. | |||
|
|||
|
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.
see #1055 (comment)
Probably superseded by #1320 which goes the d.ts route. Close? |
I'm good with closing, but let's keep the branch around for a while. There are a few things that I'll want to refer to, for example the to replace the D3 type:
|
Superseded by #1343. |
This PR uses a
types.ts
file for authoring the types (this is just for convenience, since I find it easier to write typescript types than use the JSDoc syntax), and we import those types as jsdoc tags where appropriate.This PR covers Plot.plot and all of the marks.
Known issues:
TODO:
### Image
section to the Plot.image jsdocs