mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
This commit is contained in:
parent
2fb64ef69a
commit
cf3c9debc8
|
@ -241,27 +241,27 @@ export class Graph {
|
||||||
|
|
||||||
topologicalOrder(): number[] {
|
topologicalOrder(): number[] {
|
||||||
const result: number[] = [];
|
const result: number[] = [];
|
||||||
const marked = new Map<number, boolean>();
|
const marked = new Set<number>();
|
||||||
const toVisit: number[] = [];
|
const nodeStack: number[] = [];
|
||||||
this.nodes.forEach(node => {
|
this.nodes.forEach(node => {
|
||||||
if (marked.get(node.id)) {
|
if (marked.has(node.id)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
toVisit.push(node.id);
|
nodeStack.push(node.id);
|
||||||
while (toVisit.length > 0) {
|
while (nodeStack.length > 0) {
|
||||||
const item = toVisit[toVisit.length - 1];
|
const item = nodeStack[nodeStack.length - 1];
|
||||||
if (marked.get(item)) {
|
if (marked.has(item)) {
|
||||||
if (!result.find(id => id === item)) {
|
if (!result.find(id => id === item)) {
|
||||||
result.push(item);
|
result.push(item);
|
||||||
}
|
}
|
||||||
toVisit.pop();
|
nodeStack.pop();
|
||||||
} else {
|
} else {
|
||||||
marked.set(item, true);
|
marked.add(item);
|
||||||
const itemNode = this.nodes.get(item);
|
const itemNode = this.nodes.get(item);
|
||||||
if (itemNode && itemNode.outputs.length > 0) {
|
if (itemNode && itemNode.outputs.length > 0) {
|
||||||
itemNode.outputs.forEach(child => {
|
itemNode.outputs.forEach(child => {
|
||||||
if (!marked.get(child)) {
|
if (!marked.has(child)) {
|
||||||
toVisit.push(child);
|
nodeStack.push(child);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ export const PARAMETER = {
|
||||||
typificationTruncate: 42, // characters - threshold for long typification - truncate
|
typificationTruncate: 42, // characters - threshold for long typification - truncate
|
||||||
|
|
||||||
ossLongLabel: 14, // characters - threshold for long labels - small font
|
ossLongLabel: 14, // characters - threshold for long labels - small font
|
||||||
ossTruncateLabel: 28, // characters - threshold for long labels - truncate
|
ossTruncateLabel: 32, // characters - threshold for long labels - truncate
|
||||||
|
|
||||||
statSmallThreshold: 3, // characters - threshold for small labels - small font
|
statSmallThreshold: 3, // characters - threshold for small labels - small font
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user