Skip to content

Commit abf4d04

Browse files
committed
Update docstring formatting
1 parent 6728a86 commit abf4d04

6 files changed

Lines changed: 34 additions & 34 deletions

File tree

‎src/lib/clean_number.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const JUNK = /^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;
1010
* Remove common leading and trailing cruft from a value and coerce it to a number.
1111
* Always returns either a number or BADNUM.
1212
*
13-
* @param v - value to clean; strings have leading/trailing junk characters stripped before numeric coercion
13+
* @param v - Value to clean; strings have leading/trailing junk characters stripped before numeric coercion
1414
*/
1515
function cleanNumber(v: any): number | undefined {
1616
if (typeof v === 'string') v = v.replace(JUNK, '');

‎src/lib/mod.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* Sanitized modulus function that always returns in the range [0, d)
55
* rather than (-d, 0] if v is negative.
66
*
7-
* @param v - dividend
8-
* @param d - divisor (the modulus); assumed positive
7+
* @param v - Dividend
8+
* @param d - Divisor (the modulus); assumed positive
99
*/
1010
export function mod(v: number, d: number) {
1111
const out = v % d;
@@ -16,8 +16,8 @@ export function mod(v: number, d: number) {
1616
* Sanitized modulus function that always returns in the range [-d/2, d/2]
1717
* rather than (-d, 0] if v is negative.
1818
*
19-
* @param v - dividend
20-
* @param d - divisor (the modulus); assumed positive
19+
* @param v - Dividend
20+
* @param d - Divisor (the modulus); assumed positive
2121
*/
2222
export function modHalf(v: number, d: number) {
2323
return Math.abs(v) > d / 2 ? v - Math.round(v / d) * d : v;

‎src/lib/regex.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
const NUMBER_REGEX = '([2-9]|[1-9][0-9]+)?';
44

55
/**
6-
* make a regex for matching counter ids/names ie xaxis, xaxis2, xaxis10...
6+
* Make a regex for matching counter ids/names, for example xaxis, xaxis2, xaxis10
77
*
8-
* @param head - the head of the pattern, eg 'x' matches 'x', 'x2', 'x10' etc.
9-
* 'xy' is a special case for cartesian subplots: it matches 'x2y3' etc
10-
* @param tail - a fixed piece after the id
11-
* eg counterRegex('scene', '.annotations') for scene2.annotations etc.
12-
* @param openEnded - if true, the string may continue past the match.
13-
* @param matchBeginning - if false, the string may start before the match.
8+
* @param head - The head of the pattern, for example 'x' matches 'x', 'x2', 'x10'.
9+
* 'xy' is a special case for cartesian subplots: it matches 'x2y3'.
10+
* @param tail - A fixed piece after the id.
11+
* For example, counterRegex('scene', '.annotations') for scene2.annotations.
12+
* @param openEnded - If true, the string may continue past the match
13+
* @param matchBeginning - If false, the string may start before the match
1414
*/
15-
export function counter(head: string, tail: string = '', openEnded: boolean, matchBeginning: boolean) {
15+
export function counter(head: string, tail: string = '', openEnded?: boolean, matchBeginning?: boolean) {
1616
const fullTail = tail + (openEnded ? '' : '$');
1717
const startWithPrefix = matchBeginning === false ? '' : '^';
1818
return head === 'xy'

‎src/lib/sort_object_keys.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* Return the keys of an object in lexicographic (default `Array.prototype.sort`) order.
55
*
6-
* @param obj - object whose own enumerable keys will be listed and sorted
6+
* @param obj - Object whose own enumerable keys will be listed and sorted
77
*/
88
function sortObjectKeys(obj: Record<string, any>) {
99
return Object.keys(obj).sort();

‎src/plots/map/get_map_fit_bounds.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface FitBoundsTrace extends Pick<ScattermapData, 'subplot' | 'visible'> {
2424
* that isn't implemented here.
2525
*
2626
* @param fullData - The full data array (post supply-defaults)
27-
* @param subplotId - e.g. `'map'`, `'map2'`
27+
* @param subplotId - Subplot id, for example `'map'` or `'map2'`
2828
*/
2929
export function getMapFitBounds(fullData: FitBoundsTrace[], subplotId: string): LonLatBox | null {
3030
const coordinates: [number, number][] = [];

‎src/types/core/api.d.ts‎

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,11 @@ export interface ValidateTemplateResult {
183183
/**
184184
* Create a new plot at `root`. Replaces any existing plot.
185185
*
186-
* @param root - graph div id or element
187-
* @param data - trace data array
188-
* @param layout - layout overrides
189-
* @param config - config overrides
190-
* @returns the graph div once the plot has rendered
186+
* @param root - Graph div id or element
187+
* @param data - Trace data array
188+
* @param layout - Layout overrides
189+
* @param config - Config overrides
190+
* @returns The graph div once the plot has rendered
191191
*/
192192
export function newPlot(
193193
root: Root,
@@ -199,9 +199,9 @@ export function newPlot(
199199
* Create a new plot at `root` from a figure-shaped object containing
200200
* `data`/`layout`/`config`/`frames`. Replaces any existing plot.
201201
*
202-
* @param root - graph div id or element
203-
* @param figure - figure-shaped object
204-
* @returns the graph div once the plot has rendered
202+
* @param root - Graph div id or element
203+
* @param figure - Figure-shaped object
204+
* @returns The graph div once the plot has rendered
205205
*/
206206
export function newPlot(
207207
root: Root,
@@ -217,17 +217,17 @@ export function purge(root: Root): void;
217217
/**
218218
* Update trace properties (style) on the existing plot.
219219
*
220-
* @param aobj - update object whose keys are attribute paths
221-
* @param traces - trace index/indices to update (defaults to all)
220+
* @param aobj - Update object whose keys are attribute paths
221+
* @param traces - Trace index/indices to update (defaults to all)
222222
*/
223223
export function restyle(root: Root, aobj: Data, traces?: number[] | number): Promise<PlotlyHTMLElement>;
224224

225225
/**
226226
* Update both trace and layout properties in a single call.
227227
*
228-
* @param traceUpdate - per-trace updates
229-
* @param layoutUpdate - layout updates
230-
* @param traces - trace index/indices `traceUpdate` applies to
228+
* @param traceUpdate - Per-trace updates
229+
* @param layoutUpdate - Layout updates
230+
* @param traces - Trace index/indices `traceUpdate` applies to
231231
*/
232232
export function update(
233233
root: Root,
@@ -239,8 +239,8 @@ export function update(
239239
/**
240240
* Add one or more traces to an existing plot.
241241
*
242-
* @param traces - trace(s) to add
243-
* @param newIndices - position(s) in `data` where the traces should land
242+
* @param traces - Trace(s) to add
243+
* @param newIndices - Position(s) in `data` where the traces should land
244244
*/
245245
export function addTraces(
246246
root: Root,
@@ -254,8 +254,8 @@ export function deleteTraces(root: Root, indices: number[] | number): Promise<Pl
254254
/**
255255
* Reorder existing traces.
256256
*
257-
* @param currentIndices - current trace indices to move
258-
* @param newIndices - destination indices; if omitted, traces move to the end
257+
* @param currentIndices - Current trace indices to move
258+
* @param newIndices - Destination indices; if omitted, traces move to the end
259259
*/
260260
export function moveTraces(
261261
root: Root,
@@ -307,8 +307,8 @@ export function register(modules: PlotlyModule | PlotlyModule[]): void;
307307
/**
308308
* Animate to a frame, frame group, or sequence of frames.
309309
*
310-
* @param frameOrGroupNameOrFrameList - frame name, group name, or list of either
311-
* @param opts - animation options (frame timing, transition, mode, …)
310+
* @param frameOrGroupNameOrFrameList - Frame name, group name, or list of either
311+
* @param opts - Animation options (frame timing, transition, mode, …)
312312
*/
313313
export function animate(
314314
root: Root,

0 commit comments

Comments
 (0)