Sociogram help dialog
This commit is contained in:
@@ -12,7 +12,7 @@ import {
|
|||||||
import { customTheme } from "./NetworkTheme";
|
import { customTheme } from "./NetworkTheme";
|
||||||
import { useSession } from "./Session";
|
import { useSession } from "./Session";
|
||||||
import { useNavigate } from "react-router";
|
import { useNavigate } from "react-router";
|
||||||
import { ChevronDown, ChevronUp, Settings2 } from "lucide-react";
|
import { ChevronDown, ChevronUp, Info, Settings2 } from "lucide-react";
|
||||||
|
|
||||||
interface NetworkData {
|
interface NetworkData {
|
||||||
nodes: GraphNode[];
|
nodes: GraphNode[];
|
||||||
@@ -50,6 +50,7 @@ export const GraphComponent = () => {
|
|||||||
const [showDislikes, setShowDislikes] = useState(false);
|
const [showDislikes, setShowDislikes] = useState(false);
|
||||||
const [popularity, setPopularity] = useState(false);
|
const [popularity, setPopularity] = useState(false);
|
||||||
const [mutuality, setMutuality] = useState(false);
|
const [mutuality, setMutuality] = useState(false);
|
||||||
|
const [showHelp, setShowHelp] = useState(false);
|
||||||
const { user, teams } = useSession();
|
const { user, teams } = useSession();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -212,38 +213,6 @@ export const GraphComponent = () => {
|
|||||||
onNodePointerOut={onNodePointerOut}
|
onNodePointerOut={onNodePointerOut}
|
||||||
onNodePointerOver={onNodePointerOver}
|
onNodePointerOver={onNodePointerOver}
|
||||||
/>
|
/>
|
||||||
<button
|
|
||||||
className="infobutton"
|
|
||||||
onClick={() => {
|
|
||||||
const dialog = document.querySelector("dialog[id='InfoDialog']");
|
|
||||||
(dialog as HTMLDialogElement).showModal();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
info
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<dialog
|
|
||||||
id="InfoDialog"
|
|
||||||
style={{ textAlign: "left" }}
|
|
||||||
onClick={(event) => {
|
|
||||||
event.currentTarget.close();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
scroll to zoom
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
<b>hover</b>: show inbound links
|
|
||||||
<br />
|
|
||||||
<b>click</b>: show outward links
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
multi-selection possible
|
|
||||||
<br />
|
|
||||||
with <i>Ctrl</i> or <i>Shift</i>
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
drag to pan/rotate
|
|
||||||
</dialog>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -333,25 +302,68 @@ export const GraphComponent = () => {
|
|||||||
checked={popularity}
|
checked={popularity}
|
||||||
onClick={handlePopularity}
|
onClick={handlePopularity}
|
||||||
/>
|
/>
|
||||||
<span className="ml-1">
|
<span className="ml-1">popularity</span>
|
||||||
popularity<sup>*</sup>
|
|
||||||
</span>
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
{showControls && (
|
||||||
|
<footer className="card-footer">
|
||||||
|
<button
|
||||||
|
onClick={() => {
|
||||||
|
setShowHelp(true);
|
||||||
|
}}
|
||||||
|
className="card-footer-item"
|
||||||
|
>
|
||||||
|
<p className="icon-text is-small">
|
||||||
|
<span className="icon">
|
||||||
|
<Info />
|
||||||
|
</span>
|
||||||
|
<span>help</span>
|
||||||
|
</p>
|
||||||
|
</button>
|
||||||
|
</footer>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{popularity && (
|
<div className={"modal" + (showHelp ? " is-active" : "")}>
|
||||||
<div
|
<div
|
||||||
style={{ position: "absolute", bottom: 0, right: "10px", zIndex: 10 }}
|
onClick={() => setShowHelp(false)}
|
||||||
>
|
className="modal-background"
|
||||||
<span className="grey" style={{ fontSize: "70%" }}>
|
></div>
|
||||||
<sup>*</sup>popularity meassured by rank-weighted in-degree
|
<div className="modal-content">
|
||||||
</span>
|
<article className="message is-info">
|
||||||
|
<div className="message-header">
|
||||||
|
<p>Help</p>
|
||||||
|
<button
|
||||||
|
onClick={() => setShowHelp(false)}
|
||||||
|
className="delete"
|
||||||
|
aria-label="delete"
|
||||||
|
></button>
|
||||||
|
</div>
|
||||||
|
<div className="message-body">
|
||||||
|
<p>scroll to zoom</p>
|
||||||
|
<p>
|
||||||
|
<strong>hover</strong>: show inbound links
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<strong>click</strong>: show outward links
|
||||||
|
</p>
|
||||||
|
<hr className="has-background-info" />
|
||||||
|
<p>
|
||||||
|
multi-selection is possible with
|
||||||
|
<br />
|
||||||
|
<i>Ctrl</i> or <i>Shift</i>
|
||||||
|
</p>
|
||||||
|
<p>drag to pan/rotate</p>
|
||||||
|
<hr className="has-background-info" />
|
||||||
|
<p>popularity is meassured by rank-weighted in-degree</p>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
</div>
|
</div>
|
||||||
)}
|
</div>
|
||||||
|
|
||||||
{content}
|
{content}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.network-controls {
|
.network-controls {
|
||||||
z-index: 9;
|
z-index: 2;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin: 1rem;
|
margin: 1rem;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user