From dc42fb6a3c9a65533bb465f54efe500fa5377522 Mon Sep 17 00:00:00 2001 From: Kari Lavikka Date: Fri, 3 Jan 2025 11:33:30 +0200 Subject: [PATCH] docs: add some jsdocs --- src/bellplot.ts | 23 ++++++++++++++- src/layout.ts | 77 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 1 deletion(-) diff --git a/src/bellplot.ts b/src/bellplot.ts index 93d5c4b..e4d77c8 100644 --- a/src/bellplot.ts +++ b/src/bellplot.ts @@ -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; } diff --git a/src/layout.ts b/src/layout.ts index c262fcb..5484e73 100644 --- a/src/layout.ts +++ b/src/layout.ts @@ -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"; }