[Feature] Integrate DOI Links, Handle Cycles in Pathway Viz (#407)

Co-authored-by: Tim Lorsbach <tim@lorsba.ch>
Reviewed-on: enviPath/enviPy#407
This commit is contained in:
2026-06-03 06:00:38 +12:00
parent 868bbf5c05
commit 14cfc1e4d7
7 changed files with 169 additions and 19 deletions

View File

@ -293,6 +293,34 @@ document.addEventListener("alpine:init", () => {
}),
);
// PubMed link widget
Alpine.data(
"doiWidget",
(fieldName, data, schema, uiSchema, mode, debugErrors, context = null) => ({
...baseWidget(
fieldName,
data,
schema,
uiSchema,
mode,
debugErrors,
context,
),
get value() {
return this.data[this.fieldName] || "";
},
set value(v) {
this.data[this.fieldName] = v;
},
get doiUrl() {
return this.value
? `https://dx.doi.org/${this.value}`
: null;
},
}),
);
// Compound link widget
Alpine.data(
"compoundWidget",

View File

@ -581,11 +581,11 @@ function draw(pathway, elem) {
for (idx in parents) {
p = nodes[parents[idx]]
// console.log(p.depth)
if (p.depth >= n.depth) {
// keep the .5 steps for pseudo nodes
n.depth = n.pseudo ? p.depth + 1 : Math.floor(p.depth + 1);
// console.log("Adjusting", orig_depth, Math.floor(p.depth + 1));
}
// if (p.depth >= n.depth) {
// // keep the .5 steps for pseudo nodes
// n.depth = n.pseudo ? p.depth + 1 : Math.floor(p.depth + 1);
// // console.log("Adjusting", orig_depth, Math.floor(p.depth + 1));
// }
}
});