Skip to content

Commit 57fe4d3

Browse files
committed
adding back static/obsidian
1 parent 8966940 commit 57fe4d3

6 files changed

Lines changed: 251 additions & 6 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ node_modules
1313
Thumbs.db
1414

1515
/.obsidian
16-
/static/.obsidian
1716

1817
# Env
1918
.env

static/.obsidian/app.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

static/.obsidian/appearance.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

static/.obsidian/core-plugins.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"file-explorer": true,
3+
"global-search": true,
4+
"switcher": true,
5+
"graph": true,
6+
"backlink": true,
7+
"canvas": true,
8+
"outgoing-link": true,
9+
"tag-pane": true,
10+
"footnotes": false,
11+
"properties": false,
12+
"page-preview": true,
13+
"daily-notes": true,
14+
"templates": true,
15+
"note-composer": true,
16+
"command-palette": true,
17+
"slash-command": false,
18+
"editor-status": true,
19+
"bookmarks": true,
20+
"markdown-importer": false,
21+
"zk-prefixer": false,
22+
"random-note": false,
23+
"outline": true,
24+
"word-count": true,
25+
"slides": false,
26+
"audio-recorder": false,
27+
"workspaces": false,
28+
"file-recovery": true,
29+
"publish": false,
30+
"sync": true,
31+
"bases": true,
32+
"webviewer": false
33+
}

static/.obsidian/workspace.json

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
{
2+
"main": {
3+
"id": "81ae340c8f8fa970",
4+
"type": "split",
5+
"children": [
6+
{
7+
"id": "695d28d196b5fccc",
8+
"type": "tabs",
9+
"children": [
10+
{
11+
"id": "0f6e29742202f5b9",
12+
"type": "leaf",
13+
"state": {
14+
"type": "canvas",
15+
"state": {
16+
"file": "main.canvas",
17+
"viewState": {
18+
"x": 90,
19+
"y": -120,
20+
"zoom": 0
21+
}
22+
},
23+
"icon": "lucide-layout-dashboard",
24+
"title": "main"
25+
}
26+
}
27+
]
28+
}
29+
],
30+
"direction": "vertical"
31+
},
32+
"left": {
33+
"id": "b1ff712765918888",
34+
"type": "split",
35+
"children": [
36+
{
37+
"id": "24c4a9f11e013449",
38+
"type": "tabs",
39+
"children": [
40+
{
41+
"id": "6eade1eff7fa8066",
42+
"type": "leaf",
43+
"state": {
44+
"type": "file-explorer",
45+
"state": {
46+
"sortOrder": "alphabetical",
47+
"autoReveal": false
48+
},
49+
"icon": "lucide-folder-closed",
50+
"title": "Files"
51+
}
52+
},
53+
{
54+
"id": "bd33334be1675f3c",
55+
"type": "leaf",
56+
"state": {
57+
"type": "search",
58+
"state": {
59+
"query": "",
60+
"matchingCase": false,
61+
"explainSearch": false,
62+
"collapseAll": false,
63+
"extraContext": false,
64+
"sortOrder": "alphabetical"
65+
},
66+
"icon": "lucide-search",
67+
"title": "Search"
68+
}
69+
},
70+
{
71+
"id": "a7365ab63d824dc6",
72+
"type": "leaf",
73+
"state": {
74+
"type": "bookmarks",
75+
"state": {},
76+
"icon": "lucide-bookmark",
77+
"title": "Bookmarks"
78+
}
79+
}
80+
]
81+
}
82+
],
83+
"direction": "horizontal",
84+
"width": 300
85+
},
86+
"right": {
87+
"id": "ee486154ca9ef613",
88+
"type": "split",
89+
"children": [
90+
{
91+
"id": "3c2856c947c83e03",
92+
"type": "tabs",
93+
"children": [
94+
{
95+
"id": "163480c900376156",
96+
"type": "leaf",
97+
"state": {
98+
"type": "backlink",
99+
"state": {
100+
"file": "main.canvas",
101+
"collapseAll": false,
102+
"extraContext": false,
103+
"sortOrder": "alphabetical",
104+
"showSearch": false,
105+
"searchQuery": "",
106+
"backlinkCollapsed": false,
107+
"unlinkedCollapsed": true
108+
},
109+
"icon": "links-coming-in",
110+
"title": "Backlinks for main"
111+
}
112+
},
113+
{
114+
"id": "6cbb346ce731016a",
115+
"type": "leaf",
116+
"state": {
117+
"type": "outgoing-link",
118+
"state": {
119+
"file": "main.canvas",
120+
"linksCollapsed": false,
121+
"unlinkedCollapsed": true
122+
},
123+
"icon": "links-going-out",
124+
"title": "Outgoing links from main"
125+
}
126+
},
127+
{
128+
"id": "69da460d1245a649",
129+
"type": "leaf",
130+
"state": {
131+
"type": "tag",
132+
"state": {
133+
"sortOrder": "frequency",
134+
"useHierarchy": true,
135+
"showSearch": false,
136+
"searchQuery": ""
137+
},
138+
"icon": "lucide-tags",
139+
"title": "Tags"
140+
}
141+
},
142+
{
143+
"id": "6626ae123f308eb2",
144+
"type": "leaf",
145+
"state": {
146+
"type": "outline",
147+
"state": {
148+
"file": "main.canvas",
149+
"followCursor": false,
150+
"showSearch": false,
151+
"searchQuery": ""
152+
},
153+
"icon": "lucide-list",
154+
"title": "Outline of main"
155+
}
156+
}
157+
]
158+
}
159+
],
160+
"direction": "horizontal",
161+
"width": 300,
162+
"collapsed": true
163+
},
164+
"left-ribbon": {
165+
"hiddenItems": {
166+
"switcher:Open quick switcher": false,
167+
"graph:Open graph view": false,
168+
"canvas:Create new canvas": false,
169+
"daily-notes:Open today's daily note": false,
170+
"templates:Insert template": false,
171+
"command-palette:Open command palette": false,
172+
"bases:Create new base": false
173+
}
174+
},
175+
"active": "0f6e29742202f5b9",
176+
"lastOpenFiles": [
177+
"welcome.md",
178+
"small-but-qualitative-data.md",
179+
"main.canvas",
180+
"big-observational-data.md",
181+
"survey-data.md",
182+
"team-data-annotations.md",
183+
"solo-annotations.md",
184+
"annotated-data.md"
185+
]
186+
}

static/canvas.js

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,36 @@ function drawEdges() {
214214
const fromPoint = getAnchorPoint(fromNode, edge.fromSide);
215215
const toPoint = getAnchorPoint(toNode, edge.toSide);
216216

217-
const curveTightness = 0.75;
218-
const controlPointX1 = fromPoint.x + (toPoint.x - fromPoint.x) * curveTightness;
219-
const controlPointX2 = fromPoint.x + (toPoint.x - fromPoint.x) * (1 - curveTightness);
220-
const controlPointY1 = fromPoint.y;
221-
const controlPointY2 = toPoint.y;
217+
// Calculate control point offset based on distance
218+
const dx = Math.abs(toPoint.x - fromPoint.x);
219+
const dy = Math.abs(toPoint.y - fromPoint.y);
220+
const offset = Math.max(dx, dy) * 0.5;
221+
222+
// Set control points based on edge sides for proper arrow direction
223+
let controlPointX1 = fromPoint.x;
224+
let controlPointY1 = fromPoint.y;
225+
let controlPointX2 = toPoint.x;
226+
let controlPointY2 = toPoint.y;
227+
228+
// First control point extends from the fromSide
229+
if (edge.fromSide === 'right') controlPointX1 += offset;
230+
else if (edge.fromSide === 'left') controlPointX1 -= offset;
231+
else if (edge.fromSide === 'bottom') controlPointY1 += offset;
232+
else if (edge.fromSide === 'top') controlPointY1 -= offset;
233+
234+
// Second control point: position to make arrow point in correct direction
235+
// For vertical arrows, keep X aligned; for horizontal arrows, keep Y aligned
236+
if (edge.toSide === 'right') {
237+
controlPointX2 -= offset; // CP left of endpoint → arrow points right
238+
} else if (edge.toSide === 'left') {
239+
controlPointX2 += offset; // CP right of endpoint → arrow points left
240+
} else if (edge.toSide === 'top') {
241+
controlPointX2 = toPoint.x; // Keep X aligned for vertical approach
242+
controlPointY2 -= offset; // CP above endpoint → arrow points down
243+
} else if (edge.toSide === 'bottom') {
244+
controlPointX2 = toPoint.x; // Keep X aligned for vertical approach
245+
controlPointY2 += offset; // CP below endpoint → arrow points up
246+
}
222247

223248
const d = `M ${fromPoint.x} ${fromPoint.y} C ${controlPointX1} ${controlPointY1}, ${controlPointX2} ${controlPointY2}, ${toPoint.x} ${toPoint.y}`;
224249

0 commit comments

Comments
 (0)