Skip to content

Commit 32bec81

Browse files
committed
chore: update chart redirection
1 parent 1a36b85 commit 32bec81

File tree

3 files changed

+8
-115
lines changed

3 files changed

+8
-115
lines changed

components/generic-charts/bar.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
} from '@/components/ui/chart'
1111
import { binding, cn } from '@/lib/utils'
1212
import { type BarChartProps } from '@/types/charts'
13-
import { useHistory } from 'react-router-dom'
1413
import {
1514
Bar,
1615
CartesianGrid,
@@ -45,8 +44,6 @@ export function BarChart({
4544
tickFormatter,
4645
className,
4746
}: BarChartProps) {
48-
const history = useHistory()
49-
5047
const chartConfig = categories.reduce(
5148
(acc, category, index) => {
5249
acc[category] = {
@@ -155,10 +152,11 @@ export function BarChart({
155152
radius={getRadius({ index, categories, stack, horizontal })}
156153
maxBarSize={120}
157154
minPointSize={3}
158-
onClick={(data) =>
159-
onClickHref !== undefined &&
160-
history.push(binding(onClickHref, data))
161-
}
155+
onClick={(data) => {
156+
if (onClickHref) {
157+
window.location.href = binding(onClickHref, data)
158+
}
159+
}}
162160
cursor={onClickHref !== undefined ? 'pointer' : 'default'}
163161
>
164162
{renderChartLabel({

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"@radix-ui/react-tooltip": "^1.0.7",
4141
"@tanstack/react-table": "^8.10.7",
4242
"@tremor/react": "^3.15.0",
43-
"@types/react-router-dom": "5",
4443
"@uiw/react-heat-map": "^2.2.1",
4544
"@vercel/analytics": "^1.3.1",
4645
"@vercel/functions": "^1.4.0",
@@ -56,7 +55,6 @@
5655
"react-error-boundary": "^4.0.11",
5756
"react-hook-form": "^7.49.2",
5857
"react-resizable-panels": "^2.1.2",
59-
"react-router-dom": "5",
6058
"recharts": "^2.12.7",
6159
"server-only-context": "^0.1.0",
6260
"tailwind-merge": "^2.0.0",

yarn.lock

Lines changed: 3 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -513,13 +513,6 @@
513513
dependencies:
514514
"@babel/helper-plugin-utils" "^7.24.7"
515515

516-
"@babel/runtime@^7.1.2", "@babel/runtime@^7.12.13":
517-
version "7.26.0"
518-
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.0.tgz#8600c2f595f277c60815256418b85356a65173c1"
519-
integrity sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==
520-
dependencies:
521-
regenerator-runtime "^0.14.0"
522-
523516
"@babel/runtime@^7.12.5", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.7":
524517
version "7.25.9"
525518
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.25.9.tgz#65884fd6dc255a775402cc1d9811082918f4bf00"
@@ -2080,11 +2073,6 @@
20802073
dependencies:
20812074
"@types/node" "*"
20822075

2083-
"@types/history@^4.7.11":
2084-
version "4.7.11"
2085-
resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.11.tgz#56588b17ae8f50c53983a524fc3cc47437969d64"
2086-
integrity sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==
2087-
20882076
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1":
20892077
version "2.0.6"
20902078
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7"
@@ -2143,23 +2131,6 @@
21432131
dependencies:
21442132
"@types/react" "*"
21452133

2146-
"@types/react-router-dom@5":
2147-
version "5.3.3"
2148-
resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-5.3.3.tgz#e9d6b4a66fcdbd651a5f106c2656a30088cc1e83"
2149-
integrity sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==
2150-
dependencies:
2151-
"@types/history" "^4.7.11"
2152-
"@types/react" "*"
2153-
"@types/react-router" "*"
2154-
2155-
"@types/react-router@*":
2156-
version "5.1.20"
2157-
resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-5.1.20.tgz#88eccaa122a82405ef3efbcaaa5dcdd9f021387c"
2158-
integrity sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==
2159-
dependencies:
2160-
"@types/history" "^4.7.11"
2161-
"@types/react" "*"
2162-
21632134
"@types/react@*", "@types/react@^18.2.66":
21642135
version "18.3.12"
21652136
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.12.tgz#99419f182ccd69151813b7ee24b792fe08774f60"
@@ -4453,25 +4424,6 @@ hasown@^2.0.0, hasown@^2.0.1, hasown@^2.0.2:
44534424
dependencies:
44544425
function-bind "^1.1.2"
44554426

4456-
history@^4.9.0:
4457-
version "4.10.1"
4458-
resolved "https://registry.yarnpkg.com/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3"
4459-
integrity sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==
4460-
dependencies:
4461-
"@babel/runtime" "^7.1.2"
4462-
loose-envify "^1.2.0"
4463-
resolve-pathname "^3.0.0"
4464-
tiny-invariant "^1.0.2"
4465-
tiny-warning "^1.0.0"
4466-
value-equal "^1.0.1"
4467-
4468-
hoist-non-react-statics@^3.1.0:
4469-
version "3.3.2"
4470-
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
4471-
integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
4472-
dependencies:
4473-
react-is "^16.7.0"
4474-
44754427
html-escaper@^2.0.0:
44764428
version "2.0.2"
44774429
resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453"
@@ -4805,11 +4757,6 @@ is-windows@^1.0.2:
48054757
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
48064758
integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==
48074759

4808-
isarray@0.0.1:
4809-
version "0.0.1"
4810-
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
4811-
integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==
4812-
48134760
isarray@^2.0.5:
48144761
version "2.0.5"
48154762
resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723"
@@ -5569,7 +5516,7 @@ log-update@^4.0.0:
55695516
slice-ansi "^4.0.0"
55705517
wrap-ansi "^6.2.0"
55715518

5572-
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0:
5519+
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0:
55735520
version "1.4.0"
55745521
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
55755522
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
@@ -6014,13 +5961,6 @@ path-scurry@^1.10.1, path-scurry@^1.11.1:
60145961
lru-cache "^10.2.0"
60155962
minipass "^5.0.0 || ^6.0.2 || ^7.0.0"
60165963

6017-
path-to-regexp@^1.7.0:
6018-
version "1.9.0"
6019-
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.9.0.tgz#5dc0753acbf8521ca2e0f137b4578b917b10cf24"
6020-
integrity sha512-xIp7/apCFJuUHdDLWe8O1HIkb0kQrOMb/0u6FXQjemHn/ii5LrIzU6bdECnsiTF/GjZkMEKg1xdiZwNqDYlZ6g==
6021-
dependencies:
6022-
isarray "0.0.1"
6023-
60245964
path-type@^4.0.0:
60255965
version "4.0.0"
60265966
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
@@ -6282,7 +6222,7 @@ react-hook-form@^7.49.2:
62826222
resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.53.1.tgz#3f2cd1ed2b3af99416a4ac674da2d526625add67"
62836223
integrity sha512-6aiQeBda4zjcuaugWvim9WsGqisoUk+etmFEsSUMm451/Ic8L/UAb7sRtMj3V+Hdzm6mMjU1VhiSzYUZeBm0Vg==
62846224

6285-
react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0:
6225+
react-is@^16.13.1:
62866226
version "16.13.1"
62876227
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
62886228
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
@@ -6327,34 +6267,6 @@ react-resizable-panels@^2.1.2:
63276267
resolved "https://registry.yarnpkg.com/react-resizable-panels/-/react-resizable-panels-2.1.6.tgz#d65e009d3e59618305dfb7bb9ce3702525b9875b"
63286268
integrity sha512-oIqo/7pp2TsR+Dp1qZMr1l4RBDV4Zz/0HEG5zxliBJoHqqFnG0MbmFbk+5Q1VMGfPQ4uhXxefunLC1o7v38PDQ==
63296269

6330-
react-router-dom@5:
6331-
version "5.3.4"
6332-
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.3.4.tgz#2ed62ffd88cae6db134445f4a0c0ae8b91d2e5e6"
6333-
integrity sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==
6334-
dependencies:
6335-
"@babel/runtime" "^7.12.13"
6336-
history "^4.9.0"
6337-
loose-envify "^1.3.1"
6338-
prop-types "^15.6.2"
6339-
react-router "5.3.4"
6340-
tiny-invariant "^1.0.2"
6341-
tiny-warning "^1.0.0"
6342-
6343-
react-router@5.3.4:
6344-
version "5.3.4"
6345-
resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.3.4.tgz#8ca252d70fcc37841e31473c7a151cf777887bb5"
6346-
integrity sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==
6347-
dependencies:
6348-
"@babel/runtime" "^7.12.13"
6349-
history "^4.9.0"
6350-
hoist-non-react-statics "^3.1.0"
6351-
loose-envify "^1.3.1"
6352-
path-to-regexp "^1.7.0"
6353-
prop-types "^15.6.2"
6354-
react-is "^16.6.0"
6355-
tiny-invariant "^1.0.2"
6356-
tiny-warning "^1.0.0"
6357-
63586270
react-smooth@^4.0.0:
63596271
version "4.0.1"
63606272
resolved "https://registry.yarnpkg.com/react-smooth/-/react-smooth-4.0.1.tgz#6200d8699bfe051ae40ba187988323b1449eab1a"
@@ -6504,11 +6416,6 @@ resolve-from@^5.0.0:
65046416
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69"
65056417
integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==
65066418

6507-
resolve-pathname@^3.0.0:
6508-
version "3.0.0"
6509-
resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-3.0.0.tgz#99d02224d3cf263689becbb393bc560313025dcd"
6510-
integrity sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==
6511-
65126419
resolve-pkg-maps@^1.0.0:
65136420
version "1.0.0"
65146421
resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f"
@@ -7085,16 +6992,11 @@ through@2, through@^2.3.8, through@~2.3, through@~2.3.1:
70856992
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
70866993
integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==
70876994

7088-
tiny-invariant@^1.0.2, tiny-invariant@^1.3.1:
6995+
tiny-invariant@^1.3.1:
70896996
version "1.3.3"
70906997
resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.3.3.tgz#46680b7a873a0d5d10005995eb90a70d74d60127"
70916998
integrity sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==
70926999

7093-
tiny-warning@^1.0.0:
7094-
version "1.0.3"
7095-
resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754"
7096-
integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==
7097-
70987000
tmp@~0.2.3:
70997001
version "0.2.3"
71007002
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae"
@@ -7433,11 +7335,6 @@ v8-to-istanbul@^9.0.1:
74337335
"@types/istanbul-lib-coverage" "^2.0.1"
74347336
convert-source-map "^2.0.0"
74357337

7436-
value-equal@^1.0.1:
7437-
version "1.0.1"
7438-
resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-1.0.1.tgz#1e0b794c734c5c0cade179c437d356d931a34d6c"
7439-
integrity sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==
7440-
74417338
verror@1.10.0:
74427339
version "1.10.0"
74437340
resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"

0 commit comments

Comments
 (0)