Skip to content

Commit 6463443

Browse files
committed
StatsHouse UI: update dependencies version
1 parent 9d6ccaa commit 6463443

File tree

8 files changed

+1139
-1070
lines changed

8 files changed

+1139
-1070
lines changed

statshouse-ui/package-lock.json

Lines changed: 1078 additions & 1020 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

statshouse-ui/package.json

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,71 +4,71 @@
44
"private": true,
55
"type": "module",
66
"dependencies": {
7-
"@codemirror/autocomplete": "^6.18.4",
8-
"@codemirror/commands": "^6.8.0",
9-
"@codemirror/language": "^6.10.8",
10-
"@codemirror/search": "^6.5.8",
11-
"@codemirror/state": "^6.5.1",
12-
"@codemirror/view": "^6.36.2",
13-
"@eslint/js": "^9.18.0",
7+
"@codemirror/autocomplete": "^6.18.6",
8+
"@codemirror/commands": "^6.8.1",
9+
"@codemirror/language": "^6.11.0",
10+
"@codemirror/search": "^6.5.10",
11+
"@codemirror/state": "^6.5.2",
12+
"@codemirror/view": "^6.36.5",
13+
"@eslint/js": "^9.24.0",
1414
"@jest/globals": "^29.7.0",
1515
"@lezer/common": "^1.2.3",
16-
"@lezer/generator": "^1.7.2",
16+
"@lezer/generator": "^1.7.3",
1717
"@lezer/highlight": "^1.2.1",
1818
"@lezer/lr": "^1.4.2",
1919
"@sindresorhus/fnv1a": "2.0.1",
2020
"@svgr/rollup": "^8.1.0",
21-
"@swc/core": "^1.10.7",
21+
"@swc/core": "^1.11.20",
2222
"@swc/jest": "^0.2.37",
23-
"@tanstack/react-query": "^5.63.0",
24-
"@tanstack/react-query-devtools": "^5.67.3",
23+
"@tanstack/react-query": "^5.72.2",
24+
"@tanstack/react-query-devtools": "^5.72.2",
2525
"@testing-library/jest-dom": "^6.6.3",
26-
"@testing-library/react": "^16.1.0",
27-
"@testing-library/user-event": "^14.5.2",
26+
"@testing-library/react": "^16.3.0",
27+
"@testing-library/user-event": "^14.6.1",
2828
"@types/react-window": "^1.8.8",
29-
"@vitejs/plugin-react-swc": "^3.7.2",
30-
"bootstrap": "^5.3.3",
29+
"@vitejs/plugin-react-swc": "^3.8.1",
30+
"bootstrap": "^5.3.5",
3131
"bootstrap-icons": "^1.11.3",
3232
"classnames": "^2.5.1",
3333
"dequal": "^2.0.3",
34-
"eslint": "^9.18.0",
35-
"eslint-config-prettier": "^9.1.0",
36-
"eslint-plugin-prettier": "^5.2.1",
37-
"eslint-plugin-react": "^7.37.3",
38-
"eslint-plugin-react-hooks": "^5.1.0",
39-
"eslint-plugin-react-refresh": "^0.4.16",
40-
"globals": "^15.14.0",
34+
"eslint": "^9.24.0",
35+
"eslint-config-prettier": "^10.1.2",
36+
"eslint-plugin-prettier": "^5.2.6",
37+
"eslint-plugin-react": "^7.37.5",
38+
"eslint-plugin-react-hooks": "^5.2.0",
39+
"eslint-plugin-react-refresh": "^0.4.19",
40+
"globals": "^16.0.0",
4141
"history": "^5.3.0",
4242
"immer": "^10.1.1",
4343
"jest": "^29.7.0",
4444
"jest-css-modules-transform": "^4.4.2",
4545
"jest-environment-jsdom": "^29.7.0",
46-
"react": "^19.0.0",
47-
"react-data-grid": "^7.0.0-beta.47",
48-
"react-dom": "^19.0.0",
49-
"react-markdown": "^9.0.3",
50-
"react-router-dom": "^7.1.1",
46+
"react": "^19.1.0",
47+
"react-data-grid": "^7.0.0-beta.51",
48+
"react-dom": "^19.1.0",
49+
"react-markdown": "^10.1.0",
50+
"react-router-dom": "^7.5.0",
5151
"react-window": "^1.8.11",
52-
"remark-gfm": "^4.0.0",
53-
"rollup": "^4.30.1",
52+
"remark-gfm": "^4.0.1",
53+
"rollup": "^4.39.0",
5454
"sass": "^1.69.7",
55-
"typescript": "^5.7.3",
56-
"typescript-eslint": "^8.19.1",
57-
"uplot": "^1.6.31",
55+
"typescript": "^5.8.3",
56+
"typescript-eslint": "^8.29.1",
57+
"uplot": "^1.6.32",
5858
"use-deep-compare-effect": "^1.8.1",
59-
"vite": "^6.0.7",
59+
"vite": "^6.2.6",
6060
"vite-plugin-ejs": "^1.7.0",
6161
"vite-plugin-eslint": "^1.8.1",
6262
"zustand": "^5.0.3"
6363
},
6464
"devDependencies": {
6565
"@types/jest": "^29.5.14",
6666
"@types/node": "^20.17.12",
67-
"@types/react": "^19.0.4",
68-
"@types/react-dom": "^19.0.2",
69-
"@typescript-eslint/eslint-plugin": "^8.19.1",
70-
"@typescript-eslint/parser": "^8.19.1",
71-
"prettier": "^3.4.2"
67+
"@types/react": "^19.1.0",
68+
"@types/react-dom": "^19.1.2",
69+
"@typescript-eslint/eslint-plugin": "^8.29.1",
70+
"@typescript-eslint/parser": "^8.29.1",
71+
"prettier": "^3.5.3"
7272
},
7373
"scripts": {
7474
"start": "vite",

statshouse-ui/src/common/helpers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,3 +427,7 @@ export const bwd = (v: number) => {
427427
}
428428
return Math.pow(2, v) - 1;
429429
};
430+
431+
export function labelAsString(label?: string | HTMLElement): string | undefined {
432+
return label instanceof HTMLElement ? label.innerText : label;
433+
}

statshouse-ui/src/components/UPlotWrapper/UPlotWrapper.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import React, { memo, ReactNode, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
88
import uPlot from 'uplot';
99
import { debug } from '@/common/debug';
10-
import { deepClone } from '@/common/helpers';
10+
import { deepClone, labelAsString } from '@/common/helpers';
1111
import { useResizeObserver } from '@/hooks/useResizeObserver';
1212

1313
export type LegendItem<T = Record<string, unknown>> = {
@@ -91,7 +91,7 @@ function readLegend<LV = Record<string, unknown>>(u: uPlot): LegendItem<LV>[] {
9191
.replace('--', '') ?? ''; // replace '--' uplot
9292
}
9393
return {
94-
label: s.label ?? '',
94+
label: labelAsString(s.label) ?? '',
9595
width:
9696
(u.legend.markers?.width instanceof Function ? u.legend.markers?.width(u, index) : u.legend.markers?.width) ??
9797
1,
@@ -206,13 +206,14 @@ function UPlotWrapperNoMemo<LV = Record<string, unknown>>({
206206
uRef.current.batch((u: uPlot) => {
207207
const show: Record<string, boolean | undefined> = {};
208208
for (let i = u.series.length - 1; i > 0; i--) {
209-
show[u.series[i].label!] = u.series[i].show;
209+
show[labelAsString(u.series[i].label)!] = u.series[i].show;
210210
u.delSeries(i);
211211
}
212212

213213
let nextSeries = series.map((s) => ({
214214
...s,
215-
show: typeof show[s.label!] !== 'undefined' ? show[s.label!] : (s.show ?? true),
215+
show:
216+
typeof show[labelAsString(s.label)!] !== 'undefined' ? show[labelAsString(s.label)!] : (s.show ?? true),
216217
}));
217218

218219
if (nextSeries.every((s) => !s.show)) {

statshouse-ui/src/components2/Plot/PlotView/MarkdownRender.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ const customLinkComponents: Components = {
2020
),
2121
};
2222

23-
const _MarkdownRender = ({ children = '', components, ...props }: IMarkdownRenderer) => (
24-
<ReactMarkdown remarkPlugins={remarkPlugins} components={{ ...customLinkComponents, ...components }} {...props}>
25-
{children}
26-
</ReactMarkdown>
23+
const _MarkdownRender = ({ children = '', components, className, ...props }: IMarkdownRenderer) => (
24+
<div className={className}>
25+
<ReactMarkdown remarkPlugins={remarkPlugins} components={{ ...customLinkComponents, ...components }} {...props}>
26+
{children}
27+
</ReactMarkdown>
28+
</div>
2729
);
2830

2931
export const MarkdownRender = React.memo(_MarkdownRender);

statshouse-ui/src/components2/Plot/PlotView/PlotEvents.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
66

77
import React, { Key, useCallback, useEffect, useMemo, useRef, useState } from 'react';
8-
import DataGrid, { Column, DataGridHandle, RenderRowProps, Row, SortColumn } from 'react-data-grid';
8+
import { Column, DataGrid, DataGridHandle, RenderRowProps, Row, SortColumn } from 'react-data-grid';
99
import cn from 'classnames';
1010
import css from './style.module.css';
1111
import 'react-data-grid/lib/styles.css';

statshouse-ui/src/store2/plotDataStore/normalizePlotData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { type PlotParams, promQLMetric, type TimeRange } from '@/url2';
99
import type { ProduceUpdate } from '../helpers';
1010
import { isQueryWhat, METRIC_TYPE, PLOT_TYPE, QUERY_WHAT, type QueryWhat, toMetricType } from '@/api/enum';
1111
import uPlot from 'uplot';
12-
import type { PlotData, PlotValues } from './plotsDataStore';
12+
import { PlotData, PlotDataSeries, PlotValues } from './plotsDataStore';
1313
import { metaToBaseLabel, metaToLabel } from '@/view/api';
1414
import { pxPerChar } from '@/common/settings';
1515
import { stackData } from '@/common/stackData';
@@ -149,7 +149,7 @@ export function normalizePlotData(
149149
const oneGraph = series_meta.filter((s) => s.time_shift === 0).length <= 1;
150150
const seriesShow: boolean[] = new Array(series_meta.length).fill(true);
151151
const seriesTimeShift: number[] = [];
152-
const series = series_meta.map((meta, indexMeta): uPlot.Series => {
152+
const series = series_meta.map((meta, indexMeta): PlotDataSeries => {
153153
const timeShift = meta.time_shift !== 0;
154154
// TimeShift = 1 for total line
155155
seriesTimeShift[indexMeta] = totalLineId !== indexMeta ? meta.time_shift : 1;

statshouse-ui/src/store2/plotDataStore/plotsDataStore.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,15 @@ export type TopInfo = {
2828
info: string;
2929
};
3030

31+
export type PlotDataSeries = uPlot.Series & {
32+
label: string | undefined;
33+
};
34+
3135
export type PlotData = {
3236
data: uPlot.AlignedData;
3337
dataView: uPlot.AlignedData;
3438
bands?: uPlot.Band[];
35-
series: uPlot.Series[];
39+
series: PlotDataSeries[];
3640
seriesShow: boolean[];
3741
promQL: string;
3842
metricName: string;

0 commit comments

Comments
 (0)