Skip to content

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

Merged
merged 9 commits into from
Mar 31, 2023
Merged

document raster and contour #1386

merged 9 commits into from
Mar 31, 2023

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Mar 25, 2023

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.

@Fil Fil requested a review from mbostock March 25, 2023 16:18
@Fil Fil changed the title document raster document raster and contour Mar 25, 2023
Comment on lines 93 to 106
* 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
Copy link
Member

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.)

Comment on lines 162 to 173
* 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
Copy link
Member

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.

Comment on lines 218 to 254
random?: RandomSource;
minDistance?: number;
maxSteps?: number;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs comments.

Comment on lines 126 to 127
* The [image-rendering
* attribute](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/image-rendering);
Copy link
Member

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.

* from the frame’s dimensions and the *x* and *y* extents.
*/
interval?: Interval;
/**
Copy link
Member

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).

Comment on lines 67 to 68
* The lower value of *x*, on the left edge of the raster (right edge if
* reversed).
Copy link
Member

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).

Copy link
Contributor Author

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.

Comment on lines 122 to 126
/**
* 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;
Copy link
Member

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.

@mbostock mbostock merged commit 9b165f8 into main Mar 31, 2023
@mbostock mbostock deleted the fil/ts-raster branch March 31, 2023 06:08
chaichontat pushed a commit to chaichontat/plot that referenced this pull request Jan 14, 2024
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants