Skip to content

Commit

Permalink
more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Mar 16, 2023
1 parent 9a23678 commit 9beaa45
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/context.d.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import type {GeoStreamWrapper} from "d3";

/**
* Additional rendering context provided to marks and initializers.
*/
/** Additional rendering context provided to marks and initializers. */
export interface Context {
/**
* The current document. Defaults to window.document, but may be overridden
* via plot options as when rendering plots in a headless environment.
*/
document: Document;

/**
* The current projection, if any.
*/
/** The current projection, if any. */
projection?: GeoStreamWrapper;
}
7 changes: 5 additions & 2 deletions src/curve.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import type {CurveFactory} from "d3";

type CurveFunction = CurveFactory;
/** A curve implementation. */
export type CurveFunction = CurveFactory;

type CurveName =
/** The built-in curve implementations. */
export type CurveName =
| "basis"
| "basis-closed"
| "basis-open"
Expand Down Expand Up @@ -60,6 +62,7 @@ export interface CurveOptions extends CurveAutoOptions {
curve?: Curve;
}

/** Options for marks that support possibly-projected curves. */
export interface CurveAutoOptions {
/**
* The curve (interpolation) method for connecting adjacent points. One of:
Expand Down
12 changes: 12 additions & 0 deletions src/dimensions.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
/** The realized screen dimensions, in pixels, of a plot. */
export interface Dimensions {
/** The outer width of the plot in pixels, including margins. */
width: number;
/** The outer height of the plot in pixels, including margins. */
height: number;
/** The distance between the inner and outer top edges of the plot. */
marginTop: number;
/** The distance between the inner and outer right edges of the plot. */
marginRight: number;
/** The distance between the inner and outer bottom edges of the plot. */
marginBottom: number;
/** The distance between the inner and outer left edges of the plot. */
marginLeft: number;
/** The default margins of the facet axes, if any. */
facet?: {
/** The minimum top margin to reserve for facet axes. */
marginTop: number;
/** The minimum right margin to reserve for facet axes. */
marginRight: number;
/** The minimum bottom margin to reserve for facet axes. */
marginBottom: number;
/** The minimum left margin to reserve for facet axes. */
marginLeft: number;
};
}

0 comments on commit 9beaa45

Please sign in to comment.