mirror of
https://github.com/SigNoz/signoz.git
synced 2026-02-03 08:33:26 +00:00
fix: minor fix for uplot scale (#10164)
This commit is contained in:
@@ -18,22 +18,5 @@
|
|||||||
padding-left: 12px;
|
padding-left: 12px;
|
||||||
padding-bottom: 12px;
|
padding-bottom: 12px;
|
||||||
overflow: auto;
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,11 +68,15 @@ export class UPlotConfigBuilder extends ConfigBuilder<
|
|||||||
|
|
||||||
constructor(args?: ConfigBuilderProps) {
|
constructor(args?: ConfigBuilderProps) {
|
||||||
super(args ?? {});
|
super(args ?? {});
|
||||||
const { widgetId, onDragSelect } = args ?? {};
|
const { widgetId, onDragSelect, tzDate } = args ?? {};
|
||||||
if (widgetId) {
|
if (widgetId) {
|
||||||
this.widgetId = widgetId;
|
this.widgetId = widgetId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tzDate) {
|
||||||
|
this.tzDate = tzDate;
|
||||||
|
}
|
||||||
|
|
||||||
this.onDragSelect = noop;
|
this.onDragSelect = noop;
|
||||||
|
|
||||||
if (onDragSelect) {
|
if (onDragSelect) {
|
||||||
|
|||||||
@@ -25,8 +25,10 @@ export class UPlotScaleBuilder extends ConfigBuilder<
|
|||||||
|
|
||||||
constructor(props: ScaleProps) {
|
constructor(props: ScaleProps) {
|
||||||
super(props);
|
super(props);
|
||||||
this.softMin = props.softMin ?? null;
|
// By default while creating a widget we set the softMin and softMax to 0, so we need to handle this case separately
|
||||||
this.softMax = props.softMax ?? null;
|
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.min = props.min ?? null;
|
||||||
this.max = props.max ?? null;
|
this.max = props.max ?? null;
|
||||||
}
|
}
|
||||||
@@ -38,7 +40,7 @@ export class UPlotScaleBuilder extends ConfigBuilder<
|
|||||||
range,
|
range,
|
||||||
thresholds,
|
thresholds,
|
||||||
logBase = 10,
|
logBase = 10,
|
||||||
padMinBy = 0,
|
padMinBy = 0.1,
|
||||||
padMaxBy = 0.1,
|
padMaxBy = 0.1,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ export abstract class ConfigBuilder<P, T> {
|
|||||||
export interface ConfigBuilderProps {
|
export interface ConfigBuilderProps {
|
||||||
widgetId?: string;
|
widgetId?: string;
|
||||||
onDragSelect?: (startTime: number, endTime: number) => void;
|
onDragSelect?: (startTime: number, endTime: number) => void;
|
||||||
|
tzDate?: uPlot.LocalDateFromUnix;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user