@ultipa-graph/ultipa-node-sdk
Version:
NodeJS SDK for ultipa-server 4.0
34 lines • 1.35 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.printGraph = void 0;
const chalk_1 = __importDefault(require("chalk"));
const types_1 = require("../types");
const node_1 = require("./node");
const edge_1 = require("./edge");
const alias_1 = require("./alias");
function printGraph(d) {
if ((d === null || d === void 0 ? void 0 : d.type) == types_1.ULTIPA.ResultType.RESULT_TYPE_GRAPH) {
(0, alias_1.printAlias)(d);
{
console.log(chalk_1.default.magenta(` * nodes`));
let schemaMap = (0, node_1.getNodesPrintInfo)(d.asGraph().nodes);
for (const schema in schemaMap) {
console.log(chalk_1.default.blue(` @${schema}`));
console.table(schemaMap[schema]);
}
}
{
console.log(chalk_1.default.magenta(` * edges`));
let schemaMap = (0, edge_1.getEdgesPrintInfo)(d.asGraph().edges);
for (const schema in schemaMap) {
console.log(chalk_1.default.blue(` @${schema}`));
console.table(schemaMap[schema]);
}
}
}
}
exports.printGraph = printGraph;
//# sourceMappingURL=graph.js.map