Redesign graph nodes around semantic contributors
This commit is contained in:
parent
cb4353fe8c
commit
252033e30a
14 changed files with 447 additions and 137 deletions
|
|
@ -253,6 +253,9 @@ The test verifies the default behavior.
|
|||
"function selectNode", 1
|
||||
)[0]
|
||||
relation_constants = script.split("const relationStyles", 1)[1].split("const $", 1)[0]
|
||||
node_label_logic = script.split("const escapeText", 1)[1].split("function relationHash", 1)[
|
||||
0
|
||||
]
|
||||
relation_logic = script.split("function relationHash", 1)[1].split(
|
||||
"function applyViewport", 1
|
||||
)[0]
|
||||
|
|
@ -263,6 +266,8 @@ The test verifies the default behavior.
|
|||
"const defaultViewport = Object.freeze({x: -600, y: -410, width: 1200, height: 820});\n"
|
||||
"const relationStyles"
|
||||
+ relation_constants
|
||||
+ "const escapeText"
|
||||
+ node_label_logic
|
||||
+ "function relationHash"
|
||||
+ relation_logic
|
||||
+ "function viewportForPositions"
|
||||
|
|
@ -297,7 +302,20 @@ if (Math.hypot(positions.get("child-two").x, positions.get("child-two").y)
|
|||
<= Math.hypot(positions.get("child-one").x, positions.get("child-one").y)) {
|
||||
fail("hop rings");
|
||||
}
|
||||
if (nodePalette("child", 2).fill === nodePalette("child", 1).fill) fail("hop shading");
|
||||
if (nodePalette("composition", 2).fill === nodePalette("composition", 1).fill) {
|
||||
fail("hop shading");
|
||||
}
|
||||
const qualified = {
|
||||
node_id: "py.symbol.tests.test_settings.settingstests.test_default_settings_load",
|
||||
title: "tests.test_settings.SettingsTests.test_default_settings_load",
|
||||
family: "code.test",
|
||||
tags: ["method", "python", "test"],
|
||||
};
|
||||
if (nodeDisplayName(qualified) !== "test_default_settings_load") fail("leaf display name");
|
||||
if (nodeKindLabel(qualified) !== "Test method") fail("node kind label");
|
||||
if (categoryForRelation("contains") !== "composition") fail("composition category");
|
||||
if (categoryForRelation("inherits") !== "behavior") fail("behavior category");
|
||||
if (categoryForRelation("imports") !== "dependency") fail("dependency category");
|
||||
const singleViewport = viewportForPositions(new Map([["primary", {x: 0, y: 0}]]));
|
||||
if (singleViewport.width !== 440) fail("single-node fit");
|
||||
if (singleViewport.x !== -220 || singleViewport.y !== -singleViewport.height / 2) {
|
||||
|
|
@ -456,11 +474,20 @@ if (pruned.prunedCount !== 2) fail("pruned node count");
|
|||
self.assertIn("beginDialogDrag", javascript)
|
||||
self.assertIn('setupPanelResizer("left")', javascript)
|
||||
self.assertIn('setupPanelResizer("right")', javascript)
|
||||
self.assertIn("Focus node", javascript)
|
||||
self.assertIn("Outgoing paths", javascript)
|
||||
self.assertIn("Incoming & lateral", javascript)
|
||||
self.assertIn("Structure & containment", javascript)
|
||||
self.assertIn("Inherited & implemented behavior", javascript)
|
||||
self.assertIn("Required dependencies", javascript)
|
||||
self.assertNotIn(">Children<", html)
|
||||
self.assertIn("distanceShade", javascript)
|
||||
self.assertIn("nodeDisplayName", javascript)
|
||||
self.assertIn("nodeKindLabel", javascript)
|
||||
self.assertIn("nodeContributionCategory", javascript)
|
||||
self.assertIn("graphNodeContent", javascript)
|
||||
self.assertIn('"foreignObject"', javascript)
|
||||
self.assertNotIn("short(node.title, 26)", javascript)
|
||||
self.assertIn('id="node-legend"', html)
|
||||
self.assertIn(".graph-node-content", css)
|
||||
self.assertIn("overflow-wrap: anywhere", css)
|
||||
self.assertIn("viewportForPositions", javascript)
|
||||
self.assertIn("centerSelectedNode", javascript)
|
||||
self.assertIn("relationStyles", javascript)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue