Skip to content

Commit

Permalink
docs: add some jsdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
tuner committed Jan 3, 2025
1 parent 42f96e2 commit dc42fb6
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/bellplot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,32 @@ import { treeToNodeArray } from "./tree.js";
import { drawArrowAndLabel } from "./utilityElements.js";

export interface BellPlotProperties {
/**
* The shape of the bell tip. 0 is a sharp tip, 1 is a blunt tip.
* @minimum 0
* @maximum 1
*/
bellTipShape: number;

/**
* How much to spread nested bell tips. 0 is no spread, 1 is full spread.
* @minimum 0
* @maximum 1
*/
bellTipSpread: number;

/**
* The width of strokes in the bell.
* @minimum 0
* @maximum 10
*/
bellStrokeWidth: number;

/** Where the bell has fully appeared and the plateau starts */
/**
* Where the bell has fully appeared and the plateau starts.
* @minimum 0
* @maximum 1
*/
plateauPos: number;
}

Expand Down
77 changes: 77 additions & 0 deletions src/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,97 @@ export interface NodePosition {
}

export interface LayoutProperties extends BellPlotProperties {
/**
* Height of real sample nodes
* @minimum 10
*/
sampleHeight: number;

/**
* Width of sample nodes
* @minimum 10
*/
sampleWidth: number;

/**
* Height of inferred sample nodes
* @minimum 10
*/
inferredSampleHeight: number;

/**
* Height of gaps between samples. Gaps are routes for tentacle bundles.
* @minimum 0
*/
gapHeight: number;

/**
* Vertical space between samples
* @minimum 0
*/
sampleSpacing: number;

/**
* Horizontal space between columns
* @minimum 10
*/
columnSpacing: number;

/**
* Width of tentacles in pixels
* @minimum 0
*/
tentacleWidth: number;

/**
* Space between tentacles in a bundle, in pixels
* @minimum 0
*/
tentacleSpacing: number;

/**
* Relative distance of tentacle control points from the edge of the sample node
* @minimum 0
* @maximum 0.45
*/
inOutCPDistance: number;

/**
* Relative distance of tentacle bundle's control points. The higher the value,
* the longer the individual tentacles stay together before diverging.
* @minimum 0
* @maximum 1.2
*/
bundleCPDistance: number;

/**
* Font size for sample labels
* @minimum 0
*/
sampleFontSize: number;

/**
* Whether to show the legend
*/
showLegend: boolean;

/**
* Whether to use a color scheme based on phylogeny
*/
phylogenyColorScheme: boolean;

/**
* Offset for the hue of the phylogeny color scheme
*/
phylogenyHueOffset: number;

/**
* Type of the "sample taken" guide.
*
* `"none"` for no guides,
* `"line"` for a faint dashed line in all samples,
* `"text"` same as line, but with a text label in one of the samples.
*/
sampleTakenGuide: "none" | "line" | "text";
}

Expand Down

0 comments on commit dc42fb6

Please sign in to comment.