UNPKG

gramoloss

Version:

Graph theory package for edition and computation

19 lines (18 loc) 925 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const board_1 = require("../board"); const coord_1 = require("../coord"); const text_zone_1 = require("../text_zone"); const traits_1 = require("../traits"); const b = new board_1.Board(); b.graph.addVertex(new traits_1.BasicVertexData(new coord_1.Coord(0, 0), "hello", "Neutral")); console.log(b.get_value("Vertex", 0, "weight") == "hello"); console.log(b.get_value("Vertex", 0, "color") == "Neutral"); b.text_zones.set(0, new text_zone_1.TextZone(new coord_1.Coord(0, 0), 100, "salut", 0)); const data1 = b.get_value("TextZone", 0, "text"); console.log(data1 == "salut"); // should return "salut" console.log(b.get_value("TextZone", 0, "width") == 100); const data2 = b.get_value("TextZone", 0, "c1"); console.log(data2); // should return undefined const data3 = b.get_value("TextZone", 1, "text"); console.log(data3); // should return undefined