SSShooter / SSShooter/mind-elixir-core
Attach a sub item to the root of a mindmap.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.2k
- Forks
- 415
- PR merge metrics
- No merged PRs in 30d
Description
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch mind-elixir@5.3.7 for the project I'm working on.
It was not possible to attach a sub item to the root of the mindmap.
Here is the diff that solved my problem:
diff --git a/node_modules/mind-elixir/dist/MindElixir.js b/node_modules/mind-elixir/dist/MindElixir.js
index fda8cf9..cfd11b0 100644
--- a/node_modules/mind-elixir/dist/MindElixir.js
+++ b/node_modules/mind-elixir/dist/MindElixir.js
@@ -922,7 +922,7 @@ const me = document, Dt = function(e, t) {
}, He = function(e, t) {
for (const n of t) {
const o = n.parentElement.parentElement.contains(e);
- if (!(e && e.tagName === "ME-TPC" && e !== n && !o && e.nodeObj.parent)) return !1;
+ if (!(e && e.tagName === "ME-TPC" && e !== n && !o)) return !1;
}
return !0;
}, Pt = function(e) {
@@ -1680,7 +1680,7 @@ function ln(e, t) {
n !== void 0 && (n[o] = t, t.children = [e]);
}
function ot(e, t, n) {
- if (nt(t), n.parent?.parent || (t.direction = n.direction), e === "in")
+ if (nt(t), !n.parent ? (t.direction = t.direction !== void 0 ? t.direction : 0) : n.parent?.parent || (t.direction = n.direction), e === "in")
n.children ? n.children.push(t) : n.children = [t];
else {
t.direction !== void 0 && (t.direction = n.direction);
This issue body was partially generated by patch-package.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported changes in dist/MindElixir.js, especially the He and ot functions, and locate their source counterparts in the TypeScript project. Verify the root-attachment path and direction handling, then confirm that a sub item can be attached to the mindmap root without breaking other attachments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- data-visualization, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100