-
Notifications
You must be signed in to change notification settings - Fork 185
document raster and contour #1386
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
Conversation
src/marks/contour.d.ts
Outdated
* The resolution of the underlying raster grid may be specified with the | ||
* following options: | ||
* | ||
* * **width** - the number of pixels on each horizontal line | ||
* * **height** - the number of lines; a positive integer | ||
* | ||
* The raster dimensions may also be imputed from the extent of *x* and *y* and | ||
* a pixel size: | ||
* | ||
* * **x1** - the starting horizontal position; bound to the *x* scale | ||
* * **x2** - the ending horizontal position; bound to the *x* scale | ||
* * **y1** - the starting vertical position; bound to the *y* scale | ||
* * **y2** - the ending vertical position; bound to the *y* scale | ||
* * **pixelSize** - the screen size of a raster pixel; defaults to 1 |
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.
I don’t think we should repeat the options here; that should be covered by the ContourOptions/RasterOptions interface. (This description is quite long and we should look for ways to pare it down.)
src/marks/raster.d.ts
Outdated
* The resolution of the rectangular raster image may be specified with the following options: | ||
* | ||
* * **width** - the number of pixels on each horizontal line | ||
* * **height** - the number of lines; a positive integer | ||
* | ||
* The raster dimensions may also be imputed from the extent of *x* and *y* and a pixel size: | ||
* | ||
* * **x1** - the starting horizontal position; bound to the *x* scale | ||
* * **x2** - the ending horizontal position; bound to the *x* scale | ||
* * **y1** - the starting vertical position; bound to the *y* scale | ||
* * **y2** - the ending vertical position; bound to the *y* scale | ||
* * **pixelSize** - the screen size of a raster pixel; defaults to 1 |
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.
Same comment re. enumeration of options.
src/marks/raster.d.ts
Outdated
random?: RandomSource; | ||
minDistance?: number; | ||
maxSteps?: number; |
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.
Needs comments.
src/marks/raster.d.ts
Outdated
* The [image-rendering | ||
* attribute](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/image-rendering); |
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.
I’ve started using footnote-style links in Markdown to reduce the wrapping problems with long URLs.
src/marks/raster.d.ts
Outdated
* from the frame’s dimensions and the *x* and *y* extents. | ||
*/ | ||
interval?: Interval; | ||
/** |
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.
Use a blank line between options (unless using the dense form with one-line comments).
src/marks/raster.d.ts
Outdated
* The lower value of *x*, on the left edge of the raster (right edge if | ||
* reversed). |
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 and other options need the defaults described (which is a bit tedious to describe because there are a lot of different defaults at play here, but that’s a big part of the value that documentation provides).
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.
I hope I got those right.
src/marks/raster.d.ts
Outdated
/** | ||
* The sampling interval, used to determine the height and width of the raster | ||
* from the frame’s dimensions and the *x* and *y* extents. | ||
*/ | ||
interval?: Interval; |
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.
The raster mark doesn’t support the interval option; that’s only for the contour mark.
* a weird space * document raster * document contour * cleaner * better contour, raster * defaults for x1, x2, y1, y2 (I think) * edits * edits * edits --------- Co-authored-by: Mike Bostock <[email protected]>
for #1343
Note: added interval in the raster options, and explicitly discarded the raster interval option from the type, to add the contour interval option instead—not sure it's needed, but it felt like the right thing to do.