chore(a11y): merge labelConfig with defaults
This commit is contained in:
@@ -16,6 +16,8 @@ import type {
|
||||
import { type Viewport } from '../types';
|
||||
import { getNodePositionWithOrigin, isInternalNodeBase } from './graph';
|
||||
|
||||
import { defaultLabelConfig, type LabelConfig } from '../constants';
|
||||
|
||||
export const clamp = (val: number, min = 0, max = 1): number => Math.min(Math.max(val, min), max);
|
||||
|
||||
export const clampPosition = (
|
||||
@@ -418,3 +420,7 @@ export function withResolvers<T>(): {
|
||||
});
|
||||
return { promise, resolve, reject };
|
||||
}
|
||||
|
||||
export function mergeLabelConfig(partial?: Partial<LabelConfig>): LabelConfig {
|
||||
return { ...defaultLabelConfig, ...(partial || {}) };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user