Skip to content

Commit 5691e2e

Browse files
committed
type
1 parent 5957c86 commit 5691e2e

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

src/mark.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type {ChannelDomainSort, Channels, ChannelValue, ChannelValues, ChannelVa
22
import type {Context} from "./context.js";
33
import type {Dimensions} from "./dimensions.js";
44
import type {plot} from "./plot.js";
5-
import type {ScaleFunctions} from "./scales.js";
5+
import type {InstanciatedScales} from "./scales.js";
66
import type {InitializerFunction, SortOrder, TransformFunction} from "./transforms/basic.js";
77

88
/**
@@ -40,8 +40,8 @@ export type Data = Iterable<any> | ArrayLike<any>;
4040
export type RenderFunction = (
4141
/** The mark’s (filtered and transformed) index. */
4242
index: number[],
43-
/** The plot’s scale functions. */
44-
scales: ScaleFunctions,
43+
/** The plot’s instanciated scales. */
44+
scales: InstanciatedScales,
4545
/** The mark’s (possibly scaled and transformed) channel values. */
4646
values: ChannelValues,
4747
/** The plot’s dimensions. */
@@ -459,5 +459,5 @@ export class RenderableMark extends Mark {
459459
/** A compound Mark, comprising other marks. */
460460
export type CompoundMark = Markish[] & Pick<Mark, "plot">;
461461

462-
/** Given an array of marks, returns a compound mark; supports *mark.plot shorthand. */
462+
/** Given an array of marks, returns a compound mark; supports *mark*.plot shorthand. */
463463
export function marks(...marks: Markish[]): CompoundMark;

src/scales.d.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,9 @@ export type ColorScheme = ColorSchemeCase | (Lowercase<ColorSchemeCase> & Record
160160
export type ScaleName = "x" | "y" | "fx" | "fy" | "r" | "color" | "opacity" | "symbol" | "length";
161161

162162
/**
163-
* The instantiated scales’ apply functions; passed to marks and initializers
164-
* for rendering.
163+
* The instantiated scales; passed to marks and initializers for rendering.
165164
*/
166-
export type ScaleFunctions = {[key in ScaleName]?: (value: any) => any};
165+
export type InstanciatedScales = {[key in ScaleName]?: Scale};
167166

168167
/**
169168
* The supported scale types. For quantitative data, one of:

src/transforms/basic.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type {ChannelName, Channels, ChannelValue} from "../channel.js";
22
import type {Context} from "../context.js";
33
import type {Dimensions} from "../dimensions.js";
4-
import type {ScaleFunctions} from "../scales.js";
4+
import type {InstanciatedScales} from "../scales.js";
55

66
/**
77
* A mark transform function is passed the mark’s *data* and a nested index into
@@ -40,7 +40,7 @@ export type InitializerFunction = (
4040
data: any[],
4141
facets: number[][],
4242
channels: Channels,
43-
scales: ScaleFunctions,
43+
scales: InstanciatedScales,
4444
dimensions: Dimensions,
4545
context: Context
4646
) => {

0 commit comments

Comments
 (0)