Skip to content

Commit

Permalink
improve hover logic
Browse files Browse the repository at this point in the history
  • Loading branch information
domechn committed Nov 25, 2023
1 parent 5720906 commit a6e5e6f
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import IndexApp from "@/components/index";
import AutoUpdater from "@/components/auto-updater";
import { Toaster } from "@/components/ui/toaster"
import { Toaster } from "@/components/ui/toaster";
import Loading from "@/components/common/loading";
import { useState } from "react";
import React from "react";
Expand Down
6 changes: 3 additions & 3 deletions src/components/coins-amount-and-value-change.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ const App = ({
const options = {
maintainAspectRatio: false,
responsive: false,
tooltips: {
hover: {
mode: "index",
intersect: false,
},
hover: {
interaction: {
mode: "index",
intersect: false,
},
Expand Down Expand Up @@ -108,7 +108,7 @@ const App = ({
labels: current.timestamps.map((x) => timestampToDate(x)),
datasets: [
{
label: "Value In " + currency.currency,
label: `Value(${currency.currency})`,
data: _(current.values)
.map((v) => currencyWrapper(currency)(v))
.value(),
Expand Down
8 changes: 8 additions & 0 deletions src/components/pnl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ const App = ({
const options = {
maintainAspectRatio: false,
responsive: false,
hover: {
mode: "index",
intersect: false,
},
interaction: {
mode: "index",
intersect: false,
},
plugins: {
title: {
display: false,
Expand Down
8 changes: 8 additions & 0 deletions src/components/top-coins-percentage-change.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ const App = ({ data }: { data: TopCoinsPercentageChangeData }) => {
const options = {
maintainAspectRatio: false,
responsive: false,
hover: {
mode: "nearest",
intersect: false,
},
interaction: {
mode: "nearest",
intersect: false,
},
plugins: {
title: {
display: false,
Expand Down
8 changes: 8 additions & 0 deletions src/components/top-coins-rank.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ const App = ({ data }: { data: TopCoinsRankData }) => {
const options = {
maintainAspectRatio: false,
responsive: false,
hover: {
mode: "nearest",
intersect: false,
},
interaction: {
mode: "nearest",
intersect: false,
},
plugins: {
title: {
display: false,
Expand Down
8 changes: 8 additions & 0 deletions src/components/total-value-and-change.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,14 @@ const App = ({
const options = {
maintainAspectRatio: false,
responsive: false,
hover: {
mode: "index",
intersect: false,
},
interaction: {
mode: "index",
intersect: false,
},
plugins: {
title: {
display: false,
Expand Down

0 comments on commit a6e5e6f

Please sign in to comment.