diff --git a/components/NetworkGraph.tsx b/components/NetworkGraph.tsx index e10bebb..334d720 100644 --- a/components/NetworkGraph.tsx +++ b/components/NetworkGraph.tsx @@ -18,6 +18,7 @@ type Props = { undirected?: boolean; label?: (id: string) => string; color?: (id: string) => string; + textDecoration?: (id: string) => string; }; const NetworkGraph = ({ @@ -28,6 +29,7 @@ const NetworkGraph = ({ undirected = false, label = (id) => id, color = () => "#000", + textDecoration = () => "none", }: Props) => { const d3Graph = toD3(graph); @@ -90,6 +92,7 @@ const NetworkGraph = ({ textAnchor="middle" dy={6} fontFamily="sans-serif" + textDecoration={textDecoration(node.id)} > {label(node.id)} diff --git a/components/RelationshipGraph.tsx b/components/RelationshipGraph.tsx index 2edf1ca..c159112 100644 --- a/components/RelationshipGraph.tsx +++ b/components/RelationshipGraph.tsx @@ -1,5 +1,5 @@ import { ParentSize } from "@visx/responsive"; -import { addEdge, create, Graph, isCyclic } from "graph-fns"; +import { addEdge, create, isCyclic } from "graph-fns"; import { useEffect, useState } from "react"; import NetworkGraph from "../components/NetworkGraph"; import { Data } from "../utils/AppContext"; @@ -69,7 +69,7 @@ const RelationshipGraph = ({ const descendants = getDescendants(blockingRelations, issueIdentifier); if (ancestors.length === 0 && descendants.length === 0) { - return

No dependencies or dependants.

; + return

-

; } const all = [...ancestors, issueIdentifier, ...descendants]; @@ -107,10 +107,14 @@ const RelationshipGraph = ({ height={height} graph={graph} forceStrength={forceStrength} - label={(identifier) => - data.issues.find((issue) => issue.identifier === identifier) - ?.title ?? identifier - } + label={(identifier) => { + const issue = data.issues.find( + (issue) => issue.identifier === identifier + ); + return issue?.title + ? `[${identifier}] ${issue?.title}` + : identifier; + }} color={(identifier) => { const issue = data.issues.find( (issue) => issue.identifier === identifier @@ -124,6 +128,14 @@ const RelationshipGraph = ({ ? "#900" : "#090"; }} + textDecoration={(identifier) => { + const issue = data.issues.find( + (issue) => issue.identifier === identifier + ); + return issue?.state === "canceled" + ? "line-through" + : "none"; + }} /> )} diff --git a/pages/index.page.tsx b/pages/index.page.tsx index 861feb5..48cfc84 100644 --- a/pages/index.page.tsx +++ b/pages/index.page.tsx @@ -3,6 +3,7 @@ import { useContext } from "react"; import ComparisonValue from "../components/ComparisonValue"; import Layout from "../components/Layout"; import OneTimeButton from "../components/OneTimeButton"; +import RelationshipGraph from "../components/RelationshipGraph"; import AppContext from "../utils/AppContext"; import getCombinedStats from "../utils/getCombinedStats"; import { updateIssue } from "../utils/linear"; @@ -52,6 +53,7 @@ const IndexPage: NextPage = () => {
Rating + Dependencies Linear
@@ -79,7 +81,11 @@ const IndexPage: NextPage = () => { ); return issue ? ( - {issue.identifier} + + + {issue.identifier} + + {issue.projectName} {issue.cycleNumber} {issue.title} @@ -96,6 +102,12 @@ const IndexPage: NextPage = () => { {stats[id].effort.scaled.toFixed(2)} {stats[id].value.scaled.toFixed(2)} + + + {stats[id].effort.comparisons >= 4 ? recommendedEstimate