From fae3be00777b35966de84cefdceb08f11479472e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 00:06:46 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- taxonium_component/src/components/Key.jsx | 122 +++++++++++----------- taxoniumtools/README.md | 1 - 2 files changed, 59 insertions(+), 64 deletions(-) diff --git a/taxonium_component/src/components/Key.jsx b/taxonium_component/src/components/Key.jsx index a2f0887b..f8f7bf48 100644 --- a/taxonium_component/src/components/Key.jsx +++ b/taxonium_component/src/components/Key.jsx @@ -23,7 +23,7 @@ const ColorRamp = ({ ramp }) => { const gradientStyle = { background: `linear-gradient(to top, ${colorStops})`, width: "20px", - height: `${height+2}px`, + height: `${height + 2}px`, border: "1px solid #ccc", marginTop: "-15px", }; @@ -39,55 +39,52 @@ const ColorRamp = ({ ramp }) => { return (
-
- {/* Labels and Ticks Container */} -
- {labels.map((label, index) => ( -
- {/* Label Text */} +
+ {/* Labels and Ticks Container */} +
+ {labels.map((label, index) => (
- {label.value.toFixed(2)} + {/* Label Text */} +
+ {label.value.toFixed(2)} +
+ {/* Tick */} +
- {/* Tick */} -
-
- ))} + ))} +
+ {/* Gradient */} +
- {/* Gradient */} -
-
); }; @@ -106,21 +103,21 @@ const Key = ({ }) => { const numLegendEntries = 10; const [collapsed, setCollapsed] = useState(window.innerWidth < 800); - + // sort by item.count in descending order const sortedKeyStuff = keyStuff.sort((a, b) => b.count - a.count); - + // truncate to 10 items const isTruncated = sortedKeyStuff.length > numLegendEntries; const topTenKeyStuff = sortedKeyStuff.slice(0, numLegendEntries); - + // if there is an item with value of "", remove it const filteredKeyStuff = topTenKeyStuff.filter((item) => item.value !== ""); - + if (colorByField === "None") { return null; } - + if (!filteredKeyStuff || filteredKeyStuff.length == 0) { return null; } @@ -151,20 +148,19 @@ const Key = ({ - {!collapsed && ( - - (colorByField in colorRamps) ? ( ) : ( - - ) - - )} + {!collapsed && + (colorByField in colorRamps ? ( + + ) : ( + + ))}
); }; diff --git a/taxoniumtools/README.md b/taxoniumtools/README.md index 7fce4dc1..df57b29d 100644 --- a/taxoniumtools/README.md +++ b/taxoniumtools/README.md @@ -11,7 +11,6 @@ pip install taxoniumtools ## Usage - ### Basic run First get some files: