Skip to content

Commit

Permalink
feat(Vis View): ✨ Show node name on hover
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Aug 4, 2021
1 parent 56ee243 commit 4c2ad5d
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/VisModal.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as d3 from "d3";
import { drag } from "d3";
import type { Graph } from "graphlib";
import { App, Modal } from "obsidian";
import { ALLUNLINKED, REAlCLOSED, RELATIONS } from "src/constants";
Expand Down Expand Up @@ -91,8 +92,6 @@ export class VisModal extends Modal {
closeImpliedLinks(gChildren, gParents),
];

console.log({ closedSNoS: removeUnlinkedNodes(closedSiblingNoSingle) });

const graphs: VisGraphs = {
Parent: {
Real: {
Expand Down Expand Up @@ -223,9 +222,9 @@ export class VisModal extends Modal {
.join("circle")
.attr("r", 5)
.attr("fill", "#e6e6e6");
// .call(drag(simulation));
// .call(drag());

node.append("title").text((d) => d.id);
node.append("title").text((d) => d.name);

simulation.on("tick", () => {
link
Expand All @@ -237,16 +236,16 @@ export class VisModal extends Modal {
node.attr("cx", (d) => d.x).attr("cy", (d) => d.y);
});

var tooltip = d3
.select(".d3-graph")
.append("div")
.style("position", "absolute")
.style("visibility", "hidden")
.text("I'm a circle!");

tooltip
.style("top", d3.select(window).attr("cy") + "px")
.style("left", d3.select(window).attr("cx") + "px");
// var tooltip = d3
// .select(".d3-graph")
// .append("div")
// .style("position", "absolute")
// .style("visibility", "hidden")
// .text("I'm a circle!");

// tooltip
// .style("top", d3.select(window).attr("cy") + "px")
// .style("left", d3.select(window).attr("cx") + "px");
}

onClose() {
Expand Down

0 comments on commit 4c2ad5d

Please sign in to comment.