Skip to content
This repository has been archived by the owner on Apr 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from chthollyphile/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
chthollyphile authored Jul 30, 2022
2 parents 198c7fd + e52c9d6 commit 4b25b29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Obsidian-3d-graph-view-plugin

Bringing 3D graph view to Obsidian using [react-force-graph](https://github.com/vasturiano/react-force-graph).
![asf32rq23r2q544213r.png](https://s2.loli.net/2022/07/30/a8o9QbqkNH7plvj.png)

# Warning

Expand Down
11 changes: 8 additions & 3 deletions view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Dgraph7c94cd } from "./ReactView";
import { createRoot } from "react-dom/client";
import ForceGraph3D from 'react-force-graph-3d';
import SpriteText from 'three-spritetext';
import { clear } from "console";
export const VIEW_TYPE_OB3GV = "Obsidian-3D-Graph-Viewer";

export class Ob3gvView extends ItemView {
Expand All @@ -25,17 +24,23 @@ async onOpen() {
const graphJson = Dgraph7c94cd()
// console.log(graphJson) //debug
const root = createRoot(this.containerEl.children[1])
const GROUPS = 12;
root.render(
<ForceGraph3D
graphData={graphJson}
nodeColor={() => '#dcddde'}
nodeColor={() => '#b6bfc1db'}
nodeResolution={8}
linkColor={() => "#f5f5f5"}
linkCurvature={0.8}
linkCurveRotation={4}
linkDirectionalArrowColor={"#ffffff"}
linkDirectionalArrowLength={4}
backgroundColor={'#202020'}
nodeThreeObjectExtend={true}
nodeThreeObject={node => {
const sprite = new SpriteText(node.id);
sprite.color = 'lightgrey';
sprite.textHeight = 2;
sprite.textHeight = 4;
return sprite;
}}
/>
Expand Down

0 comments on commit 4b25b29

Please sign in to comment.