Public
Edited
Mar 18, 2024
Fork of Data Lineage
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
mermaid_t = {
function generateMermaidPhase0Text(data) {
let text = "graph LR;\n";

for (const row of data) {
const sanitizedFileName = sanitizeString(row.target);
const sanitizedAppName = sanitizeString(row.app_name);

if (
row.target === data ||
row.app_name === data ||
!data
) {
if (row.action == "FROM") {
text += `${sanitizedFileName}["${row.target}"] -- ${row.action} --> ${sanitizedAppName}["${row.app_name}"];\n`;
} else {
text += `${sanitizedAppName}["${row.app_name}"] -- ${row.action} --> ${sanitizedFileName}["${row.target}"];\n`;
}
}
}

return sanitizeText(text);
}

function sanitizeString(str) {
return str.replace(/[\s\(\")]/g, "_");
}

function sanitizeText(text) {
return text
.replaceAll(/[\s]*{{[\s]*/g, "")
.replaceAll(/[\s]*}}[\s]*\./g, "_");
}

const tdMermaidPhase0Text = generateMermaidPhase0Text(data, table_selected);
return tdMermaidPhase0Text;
}
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more