mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
GraphNG: uPlot 1.6.22 (#51945)
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
"regenerator-runtime": "0.13.9",
|
||||
"rxjs": "7.5.5",
|
||||
"tslib": "2.4.0",
|
||||
"uplot": "1.6.21",
|
||||
"uplot": "1.6.22",
|
||||
"xss": "1.0.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -241,10 +241,9 @@ export type TypedArray =
|
||||
| Float32Array
|
||||
| Float64Array;
|
||||
|
||||
export type AlignedData = [
|
||||
xValues: number[] | TypedArray,
|
||||
...yValues: Array<Array<number | null | undefined> | TypedArray>
|
||||
];
|
||||
export type AlignedData =
|
||||
| TypedArray[]
|
||||
| [xValues: number[] | TypedArray, ...yValues: Array<Array<number | null | undefined> | TypedArray>];
|
||||
|
||||
// nullModes
|
||||
const NULL_REMOVE = 0; // nulls are converted to undefined (e.g. for spanGaps: true)
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
"slate-plain-serializer": "0.7.10",
|
||||
"tinycolor2": "1.4.2",
|
||||
"tslib": "2.4.0",
|
||||
"uplot": "1.6.21",
|
||||
"uplot": "1.6.22",
|
||||
"uuid": "8.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -102,14 +102,6 @@ export class UPlotChart extends React.Component<PlotProps, UPlotChartState> {
|
||||
this.reinitPlot();
|
||||
} else if (!sameData(prevProps, this.props)) {
|
||||
plot?.setData(this.props.data as AlignedData);
|
||||
|
||||
// this is a uPlot cache-busting hack for bar charts in case x axis labels changed
|
||||
// since the x scale's "range" doesnt change, the axis size doesnt get recomputed, which is where the tick labels are regenerated & cached
|
||||
// the more expensive, more proper/thorough way to do this is to force all axes to recalc: plot?.redraw(false, true);
|
||||
if (plot && typeof this.props.data[0]?.[0] === 'string') {
|
||||
//@ts-ignore
|
||||
plot.axes[0]._values = this.props.data[0];
|
||||
}
|
||||
} else if (!sameTimeRange(prevProps, this.props)) {
|
||||
plot?.setScale('x', {
|
||||
min: this.props.timeRange.from.valueOf(),
|
||||
|
||||
Reference in New Issue
Block a user