fix: minor fix for uplot scale (#10164)

This commit is contained in:
Abhi kumar
2026-02-02 18:54:45 +05:30
committed by GitHub
parent 424127c27c
commit 518dfcbe59
4 changed files with 11 additions and 21 deletions

View File

@@ -18,22 +18,5 @@
padding-left: 12px;
padding-bottom: 12px;
overflow: auto;
&::-webkit-scrollbar {
width: 0.25rem !important;
}
&::-webkit-scrollbar-track {
background: transparent;
}
&::-webkit-scrollbar-thumb {
background: var(--bg-slate-400);
border-radius: 0.5rem;
}
&::-webkit-scrollbar-thumb:hover {
background: var(--bg-slate-300);
}
}
}

View File

@@ -68,11 +68,15 @@ export class UPlotConfigBuilder extends ConfigBuilder<
constructor(args?: ConfigBuilderProps) {
super(args ?? {});
const { widgetId, onDragSelect } = args ?? {};
const { widgetId, onDragSelect, tzDate } = args ?? {};
if (widgetId) {
this.widgetId = widgetId;
}
if (tzDate) {
this.tzDate = tzDate;
}
this.onDragSelect = noop;
if (onDragSelect) {

View File

@@ -25,8 +25,10 @@ export class UPlotScaleBuilder extends ConfigBuilder<
constructor(props: ScaleProps) {
super(props);
this.softMin = props.softMin ?? null;
this.softMax = props.softMax ?? null;
// By default while creating a widget we set the softMin and softMax to 0, so we need to handle this case separately
const isDefaultSoftMinMax = props.softMin === 0 && props.softMax === 0;
this.softMin = isDefaultSoftMinMax ? null : props.softMin ?? null;
this.softMax = isDefaultSoftMinMax ? null : props.softMax ?? null;
this.min = props.min ?? null;
this.max = props.max ?? null;
}
@@ -38,7 +40,7 @@ export class UPlotScaleBuilder extends ConfigBuilder<
range,
thresholds,
logBase = 10,
padMinBy = 0,
padMinBy = 0.1,
padMaxBy = 0.1,
} = this.props;

View File

@@ -28,6 +28,7 @@ export abstract class ConfigBuilder<P, T> {
export interface ConfigBuilderProps {
widgetId?: string;
onDragSelect?: (startTime: number, endTime: number) => void;
tzDate?: uPlot.LocalDateFromUnix;
}
/**