This commit is contained in:
Vanessa 2023-04-17 15:07:21 +08:00
parent 8e8d9bba10
commit 648d00e587

View file

@ -497,47 +497,47 @@ export class Graph extends Model {
this.graphData.nodes.forEach(item => { this.graphData.nodes.forEach(item => {
switch (item.type) { switch (item.type) {
case "NodeDocument": case "NodeDocument":
item.color = {background: rootStyle.getPropertyValue("--b3-graph-doc-point").trim()} item.color = {background: rootStyle.getPropertyValue("--b3-graph-doc-point").trim()};
break; break;
case "NodeParagraph": case "NodeParagraph":
item.color = {background: rootStyle.getPropertyValue("--b3-graph-p-point").trim()} item.color = {background: rootStyle.getPropertyValue("--b3-graph-p-point").trim()};
break; break;
case "NodeHeading": case "NodeHeading":
item.color = {background: rootStyle.getPropertyValue("--b3-graph-heading-point").trim()} item.color = {background: rootStyle.getPropertyValue("--b3-graph-heading-point").trim()};
break; break;
case "NodeMathBlock": case "NodeMathBlock":
item.color = {background: rootStyle.getPropertyValue("--b3-graph-math-point").trim()} item.color = {background: rootStyle.getPropertyValue("--b3-graph-math-point").trim()};
break; break;
case "NodeCodeBlock": case "NodeCodeBlock":
item.color = {background: rootStyle.getPropertyValue("--b3-graph-code-point").trim()} item.color = {background: rootStyle.getPropertyValue("--b3-graph-code-point").trim()};
break; break;
case "NodeTable": case "NodeTable":
item.color = {background: rootStyle.getPropertyValue("--b3-graph-table-point").trim()} item.color = {background: rootStyle.getPropertyValue("--b3-graph-table-point").trim()};
break; break;
case "NodeList": case "NodeList":
item.color = {background: rootStyle.getPropertyValue("--b3-graph-list-point").trim()} item.color = {background: rootStyle.getPropertyValue("--b3-graph-list-point").trim()};
break; break;
case "NodeListItem": case "NodeListItem":
item.color = {background: rootStyle.getPropertyValue("--b3-graph-listitem-point").trim()} item.color = {background: rootStyle.getPropertyValue("--b3-graph-listitem-point").trim()};
break; break;
case "NodeBlockquote": case "NodeBlockquote":
item.color = {background: rootStyle.getPropertyValue("--b3-graph-bq-point").trim()} item.color = {background: rootStyle.getPropertyValue("--b3-graph-bq-point").trim()};
break; break;
case "NodeSuperBlock": case "NodeSuperBlock":
item.color = {background: rootStyle.getPropertyValue("--b3-graph-super-point").trim()} item.color = {background: rootStyle.getPropertyValue("--b3-graph-super-point").trim()};
break; break;
default: default:
item.color = {background: rootStyle.getPropertyValue("--b3-graph-p-point").trim()} item.color = {background: rootStyle.getPropertyValue("--b3-graph-p-point").trim()};
break; break;
} }
}) });
this.graphData.links.forEach(item => { this.graphData.links.forEach(item => {
if (item.ref) { if (item.ref) {
item.color = {color: rootStyle.getPropertyValue("--b3-graph-ref-line").trim()}; item.color = {color: rootStyle.getPropertyValue("--b3-graph-ref-line").trim()};
} else { } else {
item.color = {color: rootStyle.getPropertyValue("--b3-graph-line").trim()}; item.color = {color: rootStyle.getPropertyValue("--b3-graph-line").trim()};
} }
}) });
clearTimeout(this.timeout); clearTimeout(this.timeout);
addScript(`${Constants.PROTYLE_CDN}/js/vis/vis-network.min.js?v=9.1.2`, "protyleVisScript").then(() => { addScript(`${Constants.PROTYLE_CDN}/js/vis/vis-network.min.js?v=9.1.2`, "protyleVisScript").then(() => {
this.timeout = window.setTimeout(() => { this.timeout = window.setTimeout(() => {