Skip to content

Commit

Permalink
opt: opt overlay styles
Browse files Browse the repository at this point in the history
  • Loading branch information
liihuu committed Apr 15, 2023
1 parent 36d522f commit b4e8155
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/common/DeepPartial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ type DeepPartial<T> = {
? Array<DeepPartial<U>>
: T[P] extends ReadonlyArray<infer X>
? ReadonlyArray<DeepPartial<X>>
: DeepPartial<T[P]>
: T[P] extends object
? DeepPartial<T[P]>
: T[P]
}

export default DeepPartial
4 changes: 3 additions & 1 deletion src/common/DeepRequired.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ type DeepRequired<T> = {
? Array<DeepRequired<U>>
: T[P] extends ReadonlyArray<infer X>
? ReadonlyArray<DeepRequired<X>>
: DeepRequired<T[P]>
: T[P] extends object
? DeepRequired<T[P]>
: T[P]
}

export default DeepRequired
1 change: 1 addition & 0 deletions src/common/Options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ export interface OverlayStyle {
arc: LineStyle
text: TextStyle
rectText: RectTextStyle
[key: string]: any
}

function getDefaultOverlayStyle (): OverlayStyle {
Expand Down
5 changes: 3 additions & 2 deletions src/component/YAxis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ export default class YAxisImp extends AxisImp implements YAxis {
max = Math.max(max, data.high)
}
if (inCandle && isArea) {
min = Math.min(min, data[areaValueKey])
max = Math.max(max, data[areaValueKey])
const value = data[areaValueKey]
min = Math.min(min, value)
max = Math.max(max, value)
}
figuresResultList.forEach(({ figures, result }) => {
const indicatorData = result[dataIndex] ?? {}
Expand Down
3 changes: 2 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/
export type DeepPartial<T> = {
[P in keyof T]?: T[P] extends Array<infer U> ? Array<DeepPartial<U>> : T[P] extends ReadonlyArray<infer X> ? ReadonlyArray<DeepPartial<X>> : DeepPartial<T[P]>;
[P in keyof T]?: T[P] extends Array<infer U> ? Array<DeepPartial<U>> : T[P] extends ReadonlyArray<infer X> ? ReadonlyArray<DeepPartial<X>> : T[P] extends object ? DeepPartial<T[P]> : T[P];
};
/**
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -317,6 +317,7 @@ export interface OverlayStyle {
arc: LineStyle;
text: TextStyle;
rectText: RectTextStyle;
[key: string]: any;
}
export interface SeparatorStyle {
size: number;
Expand Down

0 comments on commit b4e8155

Please sign in to comment.