Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,20 @@ import { ShapeContourDrawer } from './ShapeContourDrawer';
import { calculateContour } from './calculateContour';

interface ConrecOptions {
/**
* x-values for the matrix columns
* @default [0, ..., matrix.length]
*/
xs?: Readonly<NumberArray>;
/**
* y-values for the matrix rows
* @default [0, ..., matrix[0].length]
*/
ys?: Readonly<NumberArray>;
/**
* means xs are in the rows direction. This is the normal way for the conrec library.
* @default false
*/
swapAxes?: boolean;
}

Expand Down Expand Up @@ -58,9 +70,25 @@ export class Conrec {
}

drawContour<DrawerName extends ContourDrawerName>(options: {
/**
* z-values of the desired contour lines. If not provided, they will be computed automatically.
* @default nbLevels between min and max of the matrix
*/
levels?: readonly number[];
/**
* number of contour lines to compute if levels is not provided
* @default 10
*/
nbLevels?: number;
/**
* contour drawer name to use
* @default 'basic'
*/
contourDrawer?: DrawerName;
/**
* time in milliseconds before stopping the calculation
* @default 0 (no timeout)
*/
timeout?: number;
}): DrawContourResult<DrawerName> {
const { nbLevels = 10, timeout = 0, contourDrawer = 'basic' } = options;
Expand Down