Skip to content

document raster and contour#1386

Merged
mbostock merged 9 commits into
mainfrom
fil/ts-raster
Mar 31, 2023
Merged

document raster and contour#1386
mbostock merged 9 commits into
mainfrom
fil/ts-raster

Conversation

@Fil
Copy link
Copy Markdown
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 thread src/marks/contour.d.ts Outdated
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
Copy Markdown
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 thread src/marks/contour.d.ts
Comment thread src/marks/raster.d.ts Outdated
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
Copy Markdown
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 thread src/marks/raster.d.ts
Comment on lines 218 to 254
random?: RandomSource;
minDistance?: number;
maxSteps?: number;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Needs comments.

Comment thread src/marks/raster.d.ts Outdated
Comment on lines +126 to +127
* The [image-rendering
* attribute](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/image-rendering);
Copy link
Copy Markdown
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.

Comment thread src/marks/raster.d.ts
Comment thread src/marks/raster.d.ts
* from the frame’s dimensions and the *x* and *y* extents.
*/
interval?: Interval;
/**
Copy link
Copy Markdown
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 thread src/marks/raster.d.ts Outdated
Comment on lines +67 to +68
* The lower value of *x*, on the left edge of the raster (right edge if
* reversed).
Copy link
Copy Markdown
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
Copy Markdown
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 thread src/marks/raster.d.ts Outdated
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
Copy Markdown
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 <mbostock@gmail.com>
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