GraphNG: uPlot 1.6.22 (#51945)

This commit is contained in:
Leon Sorokin
2022-07-08 08:45:16 -05:00
committed by GitHub
parent 15d9cf2139
commit fda7f064ad
8 changed files with 19 additions and 29 deletions

View File

@@ -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": {

View File

@@ -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)

View File

@@ -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": {

View File

@@ -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(),