-
-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fuzzy-viz): add/update viz options, fix zero marker
- Loading branch information
1 parent
566469d
commit bee9cd0
Showing
2 changed files
with
94 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import type { Fn, Fn3 } from "@thi.ng/api"; | ||
import type { FuzzyFn, LVarDomain } from "@thi.ng/fuzzy"; | ||
|
||
export type InstrumentFn<T> = Fn3<FuzzyFn, LVarDomain, number, T>; | ||
|
||
export interface AsciiVizOpts { | ||
/** | ||
* Width in characters | ||
* | ||
* @defaultValue 100 | ||
*/ | ||
width: number; | ||
/** | ||
* Height in characters | ||
* | ||
* @defaultValue 16 | ||
*/ | ||
height: number; | ||
/** | ||
* Char to use for empty space | ||
* | ||
* @defaultValue "." | ||
*/ | ||
empty: string; | ||
} | ||
|
||
export interface VizualizeVarOpts { | ||
/** | ||
* Number of samples to evaluate for each fuzzy set. | ||
* | ||
* @defaultValue 200 | ||
*/ | ||
samples: number; | ||
/** | ||
* Visualization width | ||
* | ||
* @defaultValue 600 | ||
*/ | ||
width: number; | ||
/** | ||
* Visualization height | ||
* | ||
* @defaultValue 100 | ||
*/ | ||
height: number; | ||
/** | ||
* If true, includes a legend of color coded labels of the fuzzy sets. | ||
* | ||
* @defaultValue true | ||
*/ | ||
labels: boolean; | ||
/** | ||
* Color factory function. Converts number in [0..1) interval into an CSS | ||
* color string. | ||
*/ | ||
stroke: Fn<number, string>; | ||
/** | ||
* Color factory function. Converts number in [0..1) interval into an CSS | ||
* color string. | ||
*/ | ||
fill: Fn<number, string>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters