Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to scale type definitions #11419

Merged
merged 1 commit into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/scales/scale.time.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function parse(scale, input) {
value = parser(value);
}

// Only parse if its not a timestamp already
// Only parse if it's not a timestamp already
if (!isFinite(value)) {
value = typeof parser === 'string'
? adapter.parse(value, /** @type {Unit} */ (parser))
Expand Down
18 changes: 17 additions & 1 deletion src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1176,6 +1176,22 @@ export interface CoreScaleOptions {
* @default true
*/
weight: number;
/**
* User defined minimum value for the scale, overrides minimum value from data.
*/
min: unknown;
/**
* User defined maximum value for the scale, overrides maximum value from data.
*/
max: unknown;
/**
* Adjustment used when calculating the maximum data value.
*/
suggestedMin: unknown;
/**
* Adjustment used when calculating the minimum data value.
*/
suggestedMax: unknown;
LeeLenaleee marked this conversation as resolved.
Show resolved Hide resolved
/**
* Callback called before the update process starts.
*/
Expand Down Expand Up @@ -1316,7 +1332,7 @@ export interface Scale<O extends CoreScaleOptions = CoreScaleOptions> extends El
getBasePixel(): number;

init(options: O): void;
parse(raw: unknown, index: number): unknown;
parse(raw: unknown, index?: number): unknown;
getUserBounds(): { min: number; max: number; minDefined: boolean; maxDefined: boolean };
getMinMax(canStack: boolean): { min: number; max: number };
getTicks(): Tick[];
Expand Down
Loading