diff --git a/taxonium_component/src/components/ColorPicker.jsx b/taxonium_component/src/components/ColorPicker.jsx index 2671833a..6bf265a9 100644 --- a/taxonium_component/src/components/ColorPicker.jsx +++ b/taxonium_component/src/components/ColorPicker.jsx @@ -1,46 +1,47 @@ -import React, { useState } from 'react'; -import { SketchPicker } from 'react-color'; +import React, { useState } from "react"; +import { SketchPicker } from "react-color"; const rgbToList = (rgb) => { return [rgb.r, rgb.g, rgb.b]; }; const listToRgb = (list) => { - const color = {r: list[0], g: list[1], b: list[2]}; + const color = { r: list[0], g: list[1], b: list[2] }; console.log("COLOR", color); return color; - }; -function ColorPicker({ color,setColor }) { - - const rgbColor = listToRgb(color); +function ColorPicker({ color, setColor }) { + const rgbColor = listToRgb(color); - - const [showPicker, setShowPicker] = useState(false); + const [showPicker, setShowPicker] = useState(false); - const togglePicker = () => { - setShowPicker(!showPicker); - }; + const togglePicker = () => { + setShowPicker(!showPicker); + }; - const handleColorChange = (newColor) => { - setColor(rgbToList(newColor.rgb)); - setShowPicker(false); - }; - if(showPicker) return ( -
- -
- ) + const handleColorChange = (newColor) => { + setColor(rgbToList(newColor.rgb)); + setShowPicker(false); + }; + if (showPicker) return ( -
-
- -
+
+ +
); + return ( +
+
+
+ ); } export default ColorPicker; diff --git a/taxonium_component/src/components/DeckSettingsModal.jsx b/taxonium_component/src/components/DeckSettingsModal.jsx index 7a9006d0..c595ae18 100644 --- a/taxonium_component/src/components/DeckSettingsModal.jsx +++ b/taxonium_component/src/components/DeckSettingsModal.jsx @@ -74,7 +74,6 @@ const DeckSettingsModal = ({ -
-

Search

- -
-
- -
- +

Search

+ + +
+ +
); diff --git a/taxonium_component/src/components/SearchDisplayToggle.jsx b/taxonium_component/src/components/SearchDisplayToggle.jsx index 54b5f42d..eba16fb5 100644 --- a/taxonium_component/src/components/SearchDisplayToggle.jsx +++ b/taxonium_component/src/components/SearchDisplayToggle.jsx @@ -1,26 +1,26 @@ -import React from 'react'; -import { toast } from 'react-hot-toast'; -import { FaCircle, FaRegCircle } from 'react-icons/fa'; +import React from "react"; +import { toast } from "react-hot-toast"; +import { FaCircle, FaRegCircle } from "react-icons/fa"; const SearchDisplayToggle = ({ settings }) => { - const { displaySearchesAsPoints, setDisplaySearchesAsPoints } = settings; - const toggleDisplay = () => { - // Toggle the displaySearchesAsPoints value - setDisplaySearchesAsPoints(!displaySearchesAsPoints); + const { displaySearchesAsPoints, setDisplaySearchesAsPoints } = settings; + const toggleDisplay = () => { + // Toggle the displaySearchesAsPoints value + setDisplaySearchesAsPoints(!displaySearchesAsPoints); - // Show a toast message based on the new value - if (!displaySearchesAsPoints) { - toast.success('Displaying searches as points'); - } else { - toast.success('Displaying searches as circles'); - } - }; + // Show a toast message based on the new value + if (!displaySearchesAsPoints) { + toast.success("Displaying searches as points"); + } else { + toast.success("Displaying searches as circles"); + } + }; - return ( - - ); + return ( + + ); }; export default SearchDisplayToggle; diff --git a/taxonium_component/src/components/SearchPanel.jsx b/taxonium_component/src/components/SearchPanel.jsx index 9e595041..8f263dad 100644 --- a/taxonium_component/src/components/SearchPanel.jsx +++ b/taxonium_component/src/components/SearchPanel.jsx @@ -375,12 +375,12 @@ function SearchPanel({

-
- - Search -
- -

+
+ + Search +
+ +
{search.searchSpec.map((item) => ( [d[xType], d.y], - getLineColor: settings.displaySearchesAsPoints ? [0,0,0] : lineColor, - getRadius: settings.displaySearchesAsPoints ? settings.searchPointSize : 5 + 2 * i , + getLineColor: settings.displaySearchesAsPoints ? [0, 0, 0] : lineColor, + getRadius: settings.displaySearchesAsPoints + ? settings.searchPointSize + : 5 + 2 * i, radiusUnits: "pixels", lineWidthUnits: "pixels", stroked: true, @@ -464,7 +466,9 @@ const useLayers = ({ wireframe: true, getLineWidth: 1, filled: true, - getFillColor: settings.displaySearchesAsPoints ? lineColor:[255, 0, 0, 0], + getFillColor: settings.displaySearchesAsPoints + ? lineColor + : [255, 0, 0, 0], modelMatrix: modelMatrix, updateTriggers: { getPosition: [xType], diff --git a/taxonium_component/src/hooks/useSettings.jsx b/taxonium_component/src/hooks/useSettings.jsx index 30d8a0d2..a084c256 100644 --- a/taxonium_component/src/hooks/useSettings.jsx +++ b/taxonium_component/src/hooks/useSettings.jsx @@ -10,14 +10,13 @@ export const useSettings = ({ query, updateQuery }) => { const [thresholdForDisplayingText, setThresholdForDisplayingText] = useState(2.9); - const [displaySearchesAsPoints, setDisplaySearchesAsPoints] = - useState(false); - - const [searchPointSize, setSearchPointSize] = - useState(3); + const [displaySearchesAsPoints, setDisplaySearchesAsPoints] = useState(false); - const [terminalNodeLabelColor, setTerminalNodeLabelColor] = useState([180,180,180]); + const [searchPointSize, setSearchPointSize] = useState(3); + const [terminalNodeLabelColor, setTerminalNodeLabelColor] = useState([ + 180, 180, 180, + ]); const [displayPointsForInternalNodes, setDisplayPointsForInternalNodes] = useState(false); @@ -137,6 +136,6 @@ export const useSettings = ({ query, updateQuery }) => { searchPointSize, setSearchPointSize, terminalNodeLabelColor, - setTerminalNodeLabelColor + setTerminalNodeLabelColor, }; };