feat: add option to show dislike
This commit is contained in:
@@ -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"
|
||||
|
Reference in New Issue
Block a user