feat: add option to show dislike

This commit is contained in:
2025-02-12 17:23:18 +01:00
parent 44bc27b567
commit 06fd18ef4c
2 changed files with 31 additions and 15 deletions

View File

@@ -33,6 +33,7 @@ interface Params {
distance: number;
weighting: boolean;
popularity: boolean;
dislike: boolean;
}
interface DeferredProps {
@@ -47,11 +48,12 @@ export default function Analysis() {
const [params, setParams] = useState<Params>({
nodeSize: 2000,
edgeWidth: 1,
arrowSize: 20,
arrowSize: 16,
fontSize: 10,
distance: 2,
weighting: true,
popularity: true,
dislike: false,
});
const [showControlPanel, setShowControlPanel] = useState(false);
const [loading, setLoading] = useState(false);
@@ -72,15 +74,14 @@ export default function Analysis() {
setLoading(false);
});
}
useEffect(() => {
if (timeoutID) {
console.log(timeoutID);
clearTimeout(timeoutID);
}
timeoutID = setTimeout(() => {
console.log("fire");
loadImage();
}, 1500);
}, 1000);
}, [params]);
return (
@@ -91,6 +92,14 @@ export default function Analysis() {
<div id="control-panel" className={showControlPanel ? "opened" : ""}>
<div className="control">
<div className="checkBox">
<input
type="checkbox"
checked={params.dislike}
onChange={(evt) => setParams({ ...params, dislike: evt.target.checked })}
/>
<label>show dislike</label>
</div>
<div className="checkBox">
<input
type="checkbox"