gcc-slycooper50 0.1.129__tar.gz → 0.1.131__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gcc-slycooper50 might be problematic. Click here for more details.
- {gcc_slycooper50-0.1.129/src/gcc_slycooper50.egg-info → gcc_slycooper50-0.1.131}/PKG-INFO +1 -1
- {gcc_slycooper50-0.1.129 → gcc_slycooper50-0.1.131}/pyproject.toml +2 -2
- gcc_slycooper50-0.1.131/src/gcc_slycooper50/extra.js +69 -0
- gcc_slycooper50-0.1.131/src/gcc_slycooper50/tree_app.py +101 -0
- {gcc_slycooper50-0.1.129 → gcc_slycooper50-0.1.131/src/gcc_slycooper50.egg-info}/PKG-INFO +1 -1
- {gcc_slycooper50-0.1.129 → gcc_slycooper50-0.1.131}/src/gcc_slycooper50.egg-info/SOURCES.txt +1 -1
- gcc_slycooper50-0.1.129/src/gcc_slycooper50/glad-2.0.8.tar.gz +0 -0
- gcc_slycooper50-0.1.129/src/gcc_slycooper50/tree_app.py +0 -228
- {gcc_slycooper50-0.1.129 → gcc_slycooper50-0.1.131}/LICENSE +0 -0
- {gcc_slycooper50-0.1.129 → gcc_slycooper50-0.1.131}/README.md +0 -0
- {gcc_slycooper50-0.1.129 → gcc_slycooper50-0.1.131}/setup.cfg +0 -0
- {gcc_slycooper50-0.1.129 → gcc_slycooper50-0.1.131}/src/gcc_slycooper50.egg-info/dependency_links.txt +0 -0
- {gcc_slycooper50-0.1.129 → gcc_slycooper50-0.1.131}/src/gcc_slycooper50.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "gcc_slycooper50"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.131"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="sly cooper", email="slycooper50@gmail.com" },
|
|
10
10
|
]
|
|
@@ -22,4 +22,4 @@ license-files = ["LICEN[CS]E*"]
|
|
|
22
22
|
where = ["src"]
|
|
23
23
|
|
|
24
24
|
[tool.setuptools.package-data]
|
|
25
|
-
"*" = ['*.tar.gz', '*.tar.xz', '*.zip', '*.tar', '*.tar.bz2']
|
|
25
|
+
"*" = ['*.tar.gz', '*.tar.xz', '*.zip', '*.tar', '*.tar.bz2', '*.js']
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
window.addEventListener('load', () => {
|
|
2
|
+
const network = window.network;
|
|
3
|
+
const nodes = window.nodes;
|
|
4
|
+
const edges = window.edges;
|
|
5
|
+
|
|
6
|
+
const nodeList = document.getElementById("nodeList");
|
|
7
|
+
const nodeTitle = document.getElementById("nodeTitle");
|
|
8
|
+
const info = document.getElementById("info");
|
|
9
|
+
const save = document.getElementById("save_btt");
|
|
10
|
+
|
|
11
|
+
// Build adjacency map
|
|
12
|
+
const adjacency = {};
|
|
13
|
+
edges.get().forEach(e => {
|
|
14
|
+
if (!adjacency[e.from]) adjacency[e.from] = [];
|
|
15
|
+
adjacency[e.from].push(e.to);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// Update sidebar list with children of a node
|
|
19
|
+
function showChildren(nodeId) {
|
|
20
|
+
nodeList.innerHTML = "";
|
|
21
|
+
nodeTitle.textContent = "Children of " + nodeId;
|
|
22
|
+
|
|
23
|
+
const children = adjacency[nodeId] || [];
|
|
24
|
+
if (children.length === 0) {
|
|
25
|
+
const li = document.createElement("li");
|
|
26
|
+
li.textContent = "(no children)";
|
|
27
|
+
li.style.color = "#888";
|
|
28
|
+
nodeList.appendChild(li);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
children.forEach(childId => {
|
|
33
|
+
const li = document.createElement("li");
|
|
34
|
+
li.textContent = childId;
|
|
35
|
+
li.style.cursor = "pointer";
|
|
36
|
+
li.style.padding = "4px 0";
|
|
37
|
+
li.onmouseenter = () => li.style.color = "#ffcc00";
|
|
38
|
+
li.onmouseleave = () => li.style.color = "";
|
|
39
|
+
li.onclick = () => {
|
|
40
|
+
// Focus and highlight the clicked child
|
|
41
|
+
network.focus(childId, { scale: 1.5, animation: true });
|
|
42
|
+
nodes.update({ id: childId, color: "#ff4444" });
|
|
43
|
+
setTimeout(() => nodes.update({ id: childId, color: "#00ccff" }), 1500);
|
|
44
|
+
};
|
|
45
|
+
nodeList.appendChild(li);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// --- Event handlers ---
|
|
50
|
+
network.on("click", params => {
|
|
51
|
+
if (params.nodes.length > 0) {
|
|
52
|
+
const nodeId = params.nodes[0];
|
|
53
|
+
showChildren(nodeId);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
network.on("hoverNode", params => {
|
|
58
|
+
info.textContent = "Hovering: " + params.node;
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
network.on("blurNode", () => {
|
|
62
|
+
info.textContent = "Click a node to see its children.";
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
save.addEventListener("click", () => {
|
|
66
|
+
console.log("SLYCOOPER");
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
from pyvis.network import Network
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
# --- Create network ---
|
|
5
|
+
net = Network(height="100vh", width="100%", directed=True, bgcolor="#222222", font_color="white")
|
|
6
|
+
|
|
7
|
+
edges = [
|
|
8
|
+
("Root", "Child1"),
|
|
9
|
+
("Root", "Child2"),
|
|
10
|
+
("Root", "Child3"),
|
|
11
|
+
("Child1", "Sub1"),
|
|
12
|
+
("Child1", "Sub2"),
|
|
13
|
+
("Child2", "Sub3"),
|
|
14
|
+
("Child3", "Sub4"),
|
|
15
|
+
("Child3", "Sub5"),
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
# Collect unique nodes
|
|
19
|
+
all_nodes = set([n for e in edges for n in e])
|
|
20
|
+
for n in all_nodes:
|
|
21
|
+
net.add_node(n, color="#00ccff" if n != "Root" else "#ffcc00")
|
|
22
|
+
|
|
23
|
+
for src, dst in edges:
|
|
24
|
+
net.add_edge(src, dst)
|
|
25
|
+
|
|
26
|
+
# Curvy edges + physics
|
|
27
|
+
net.set_options("""
|
|
28
|
+
{
|
|
29
|
+
"edges": {
|
|
30
|
+
"smooth": {
|
|
31
|
+
"type": "curvedCW",
|
|
32
|
+
"roundness": 0.3
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"physics": {
|
|
36
|
+
"stabilization": false
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
""")
|
|
40
|
+
|
|
41
|
+
# Save base template
|
|
42
|
+
net.save_graph("template.html")
|
|
43
|
+
|
|
44
|
+
# --- Inject sidebar and JS ---
|
|
45
|
+
with open("template.html", "r") as f:
|
|
46
|
+
html = f.read()
|
|
47
|
+
|
|
48
|
+
sidebar_html = """
|
|
49
|
+
<div id="sidebar" style="
|
|
50
|
+
position: fixed;
|
|
51
|
+
left: 10px;
|
|
52
|
+
top: 10px;
|
|
53
|
+
width: 240px;
|
|
54
|
+
height: 95vh;
|
|
55
|
+
background: #2c2c2c;
|
|
56
|
+
color: white;
|
|
57
|
+
padding: 12px;
|
|
58
|
+
border-radius: 8px;
|
|
59
|
+
font-family: sans-serif;
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
box-shadow: 0 0 10px rgba(0,0,0,0.4);
|
|
63
|
+
">
|
|
64
|
+
<h3 style="margin-top: 0;">Graph Controls</h3>
|
|
65
|
+
|
|
66
|
+
<hr style="border: 0; border-top: 1px solid #555; margin: 8px 0;">
|
|
67
|
+
<h4 id="nodeTitle" style="margin: 4px 0;">Children</h4>
|
|
68
|
+
<div id="nodeContainer" style="
|
|
69
|
+
flex: 1;
|
|
70
|
+
overflow-y: auto;
|
|
71
|
+
border: 1px solid #555;
|
|
72
|
+
border-radius: 6px;
|
|
73
|
+
background: #1e1e1e;
|
|
74
|
+
padding: 6px;
|
|
75
|
+
scrollbar-width: thin;
|
|
76
|
+
scrollbar-color: #666 #2c2c2c;
|
|
77
|
+
">
|
|
78
|
+
<ul id="nodeList" style="
|
|
79
|
+
list-style: none;
|
|
80
|
+
padding-left: 0;
|
|
81
|
+
margin: 0;
|
|
82
|
+
"></ul>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<hr style="border: 0; border-top: 1px solid #555; margin: 8px 0;">
|
|
86
|
+
<p id="info" style="font-size: 14px; color: #ccc;">Click a node to see its children.</p>
|
|
87
|
+
|
|
88
|
+
<div style="display: flex; gap: 10px; margin-bottom: 12px;">
|
|
89
|
+
<button id="del_node">Delete Node</button>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<button id="save_btt">Save New Connections</button>
|
|
93
|
+
</div>
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
html = html.replace("</body>", f"{sidebar_html}\n<script src={str(Path(__file__).resolve().parent)+"/"+"extra.js"}></script>\n</body>")
|
|
97
|
+
|
|
98
|
+
with open("index.html", "w") as f:
|
|
99
|
+
f.write(html)
|
|
100
|
+
|
|
101
|
+
print("✅ Created index.html with child-list sidebar.")
|
|
Binary file
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
from pyvis.network import Network
|
|
2
|
-
import json
|
|
3
|
-
|
|
4
|
-
# ---------------------------
|
|
5
|
-
# Tree data
|
|
6
|
-
# ---------------------------
|
|
7
|
-
tree_data = {
|
|
8
|
-
"Root": {"type": "root", "value": 10, "children": ["Child 1", "Child 2"]},
|
|
9
|
-
"Child 1": {"type": "branch", "value": 5, "children": ["Grandchild 1.1"]},
|
|
10
|
-
"Child 2": {"type": "branch", "value": 7, "children": ["Grandchild 2.1", "Grandchild 2.2"]},
|
|
11
|
-
"Grandchild 1.1": {"type": "leaf", "value": 3, "children": []},
|
|
12
|
-
"Grandchild 2.1": {"type": "leaf", "value": 2, "children": [], "highlight": True}, # highlight in red
|
|
13
|
-
"Grandchild 2.2": {"type": "leaf", "value": 4, "children": []}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
positions = {
|
|
17
|
-
"Root": (0, 0),
|
|
18
|
-
"Child 1": (-150, 150),
|
|
19
|
-
"Child 2": (150, 150),
|
|
20
|
-
"Grandchild 1.1": (-200, 300),
|
|
21
|
-
"Grandchild 2.1": (100, 300),
|
|
22
|
-
"Grandchild 2.2": (200, 300)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
colors = {"root": "#ffcc00", "branch": "#66ccff", "leaf": "#99ff99"}
|
|
26
|
-
|
|
27
|
-
# ---------------------------
|
|
28
|
-
# Build Pyvis Network
|
|
29
|
-
# ---------------------------
|
|
30
|
-
net = Network(height="600px", width="100%", directed=True)
|
|
31
|
-
net.toggle_physics(True) # Enable physics for draggable nodes
|
|
32
|
-
|
|
33
|
-
for name, props in tree_data.items():
|
|
34
|
-
x, y = positions[name]
|
|
35
|
-
net.add_node(name, label=name, x=x, y=y, fixed=False, color=colors[props["type"]], size=25)
|
|
36
|
-
|
|
37
|
-
for parent, props in tree_data.items():
|
|
38
|
-
for child in props["children"]:
|
|
39
|
-
net.add_edge(parent, child, arrows='to', smooth={'type': 'cubicBezier', 'roundness': 0.4})
|
|
40
|
-
|
|
41
|
-
html = net.generate_html()
|
|
42
|
-
|
|
43
|
-
# ---------------------------
|
|
44
|
-
# Sidebar, expand menu, delete, save
|
|
45
|
-
# ---------------------------
|
|
46
|
-
extra_js = f"""
|
|
47
|
-
<style>
|
|
48
|
-
#sidebar {{
|
|
49
|
-
position: absolute;
|
|
50
|
-
left: 10px;
|
|
51
|
-
top: 10px;
|
|
52
|
-
width: 250px;
|
|
53
|
-
background: #f8f8f8;
|
|
54
|
-
padding: 10px;
|
|
55
|
-
border-radius: 10px;
|
|
56
|
-
box-shadow: 0 0 8px rgba(0,0,0,0.2);
|
|
57
|
-
font-family: Arial;
|
|
58
|
-
}}
|
|
59
|
-
#menuBar button {{
|
|
60
|
-
margin: 3px;
|
|
61
|
-
padding: 5px 8px;
|
|
62
|
-
border: none;
|
|
63
|
-
background: #ddd;
|
|
64
|
-
border-radius: 4px;
|
|
65
|
-
cursor: pointer;
|
|
66
|
-
}}
|
|
67
|
-
#menuBar button:hover {{
|
|
68
|
-
background: #ccc;
|
|
69
|
-
}}
|
|
70
|
-
#expandMenu {{
|
|
71
|
-
display: none;
|
|
72
|
-
position: absolute;
|
|
73
|
-
background: white;
|
|
74
|
-
border: 1px solid #aaa;
|
|
75
|
-
box-shadow: 0 0 5px rgba(0,0,0,0.2);
|
|
76
|
-
border-radius: 5px;
|
|
77
|
-
padding: 5px;
|
|
78
|
-
margin-top: 5px;
|
|
79
|
-
z-index: 1000;
|
|
80
|
-
}}
|
|
81
|
-
#expandMenu div {{
|
|
82
|
-
padding: 5px;
|
|
83
|
-
cursor: pointer;
|
|
84
|
-
}}
|
|
85
|
-
#expandMenu div:hover {{
|
|
86
|
-
background: #eee;
|
|
87
|
-
}}
|
|
88
|
-
#saveButton {{
|
|
89
|
-
width: 100%;
|
|
90
|
-
margin-top: 10px;
|
|
91
|
-
padding: 8px;
|
|
92
|
-
border: none;
|
|
93
|
-
background: #4CAF50;
|
|
94
|
-
color: white;
|
|
95
|
-
font-weight: bold;
|
|
96
|
-
border-radius: 6px;
|
|
97
|
-
cursor: pointer;
|
|
98
|
-
}}
|
|
99
|
-
#saveButton:hover {{
|
|
100
|
-
background: #45a049;
|
|
101
|
-
}}
|
|
102
|
-
</style>
|
|
103
|
-
|
|
104
|
-
<div id="sidebar">
|
|
105
|
-
<h3 style="text-align:center;">Node Details</h3>
|
|
106
|
-
<div id="nodeInfo">
|
|
107
|
-
<p><b>Click a node</b> to view details.</p>
|
|
108
|
-
</div>
|
|
109
|
-
<hr>
|
|
110
|
-
<div id="menuBar" style="display:none; text-align:center;">
|
|
111
|
-
<button onclick="menuAction('edit')">✏️ Edit</button>
|
|
112
|
-
<button onclick="menuAction('delete')">🗑️ Delete</button>
|
|
113
|
-
<button id="expandBtn" onclick="menuAction('expand')">🔽 Expand</button>
|
|
114
|
-
</div>
|
|
115
|
-
<div id="expandMenu"></div>
|
|
116
|
-
<button id="saveButton" onclick="saveTree()">💾 Save Tree</button>
|
|
117
|
-
</div>
|
|
118
|
-
|
|
119
|
-
<script>
|
|
120
|
-
var treeData = {json.dumps(tree_data)};
|
|
121
|
-
|
|
122
|
-
// Click node → update sidebar
|
|
123
|
-
network.on("click", function(params) {{
|
|
124
|
-
hideExpandMenu();
|
|
125
|
-
if(params.nodes.length > 0){{
|
|
126
|
-
var nodeId = params.nodes[0];
|
|
127
|
-
var node = treeData[nodeId];
|
|
128
|
-
document.getElementById("nodeInfo").innerHTML =
|
|
129
|
-
"<p><b>Name:</b> " + nodeId + "</p>" +
|
|
130
|
-
"<p><b>Type:</b> " + node.type + "</p>" +
|
|
131
|
-
"<p><b>Value:</b> " + node.value + "</p>" +
|
|
132
|
-
"<p><b>Children:</b> " + (node.children.join(", ") || "None") + "</p>";
|
|
133
|
-
document.getElementById("menuBar").style.display = "block";
|
|
134
|
-
document.getElementById("menuBar").setAttribute("data-node", nodeId);
|
|
135
|
-
}}
|
|
136
|
-
}});
|
|
137
|
-
|
|
138
|
-
// Menu actions
|
|
139
|
-
function menuAction(action){{
|
|
140
|
-
var nodeId = document.getElementById("menuBar").getAttribute("data-node");
|
|
141
|
-
if(action === 'expand'){{
|
|
142
|
-
showExpandMenu(treeData[nodeId]);
|
|
143
|
-
}} else if(action === 'delete'){{
|
|
144
|
-
deleteNode(nodeId);
|
|
145
|
-
}} else {{
|
|
146
|
-
alert(action + " action on node: " + nodeId);
|
|
147
|
-
}}
|
|
148
|
-
}}
|
|
149
|
-
|
|
150
|
-
// Expand button → show children
|
|
151
|
-
function showExpandMenu(node){{
|
|
152
|
-
var menu = document.getElementById("expandMenu");
|
|
153
|
-
menu.innerHTML = "";
|
|
154
|
-
|
|
155
|
-
if(node.children.length === 0){{
|
|
156
|
-
menu.innerHTML = "<div><i>No children</i></div>";
|
|
157
|
-
}} else {{
|
|
158
|
-
node.children.forEach(c => {{
|
|
159
|
-
var item = document.createElement("div");
|
|
160
|
-
item.textContent = c;
|
|
161
|
-
|
|
162
|
-
// Highlight children in red if 'highlight' property is true
|
|
163
|
-
if(treeData[c] && treeData[c].highlight){{
|
|
164
|
-
item.style.color = "red";
|
|
165
|
-
item.style.fontWeight = "bold";
|
|
166
|
-
}}
|
|
167
|
-
|
|
168
|
-
item.onclick = function(){{
|
|
169
|
-
alert("Selected child: " + c);
|
|
170
|
-
hideExpandMenu();
|
|
171
|
-
}};
|
|
172
|
-
menu.appendChild(item);
|
|
173
|
-
}});
|
|
174
|
-
}}
|
|
175
|
-
var expandBtn = document.getElementById("expandBtn");
|
|
176
|
-
var rect = expandBtn.getBoundingClientRect();
|
|
177
|
-
menu.style.left = rect.left + "px";
|
|
178
|
-
menu.style.top = (rect.bottom + window.scrollY) + "px";
|
|
179
|
-
menu.style.display = "block";
|
|
180
|
-
}}
|
|
181
|
-
|
|
182
|
-
function hideExpandMenu(){{
|
|
183
|
-
document.getElementById("expandMenu").style.display = "none";
|
|
184
|
-
}}
|
|
185
|
-
|
|
186
|
-
window.addEventListener('click', function(e){{
|
|
187
|
-
var menu = document.getElementById("expandMenu");
|
|
188
|
-
if (!menu.contains(e.target) && e.target.id !== 'expandBtn') {{
|
|
189
|
-
hideExpandMenu();
|
|
190
|
-
}}
|
|
191
|
-
}});
|
|
192
|
-
|
|
193
|
-
// Delete node from treeData and remove from graph
|
|
194
|
-
function deleteNode(nodeId){{
|
|
195
|
-
if(confirm("Delete node '" + nodeId + "'?")){{
|
|
196
|
-
for(let key in treeData){{
|
|
197
|
-
let idx = treeData[key].children.indexOf(nodeId);
|
|
198
|
-
if(idx !== -1) treeData[key].children.splice(idx, 1);
|
|
199
|
-
}}
|
|
200
|
-
delete treeData[nodeId];
|
|
201
|
-
network.body.data.nodes.remove({{id: nodeId}});
|
|
202
|
-
document.getElementById("nodeInfo").innerHTML = "<p><b>Click a node</b> to view details.</p>";
|
|
203
|
-
document.getElementById("menuBar").style.display = "none";
|
|
204
|
-
hideExpandMenu();
|
|
205
|
-
}}
|
|
206
|
-
}}
|
|
207
|
-
|
|
208
|
-
// Save tree to fixed file name
|
|
209
|
-
function saveTree(){{
|
|
210
|
-
const jsonData = JSON.stringify(treeData, null, 2);
|
|
211
|
-
const blob = new Blob([jsonData], {{ type: "application/json" }});
|
|
212
|
-
const url = URL.createObjectURL(blob);
|
|
213
|
-
const a = document.createElement("a");
|
|
214
|
-
a.href = url;
|
|
215
|
-
a.download = "tree_data.json";
|
|
216
|
-
document.body.appendChild(a);
|
|
217
|
-
a.click();
|
|
218
|
-
document.body.removeChild(a);
|
|
219
|
-
URL.revokeObjectURL(url);
|
|
220
|
-
}}
|
|
221
|
-
</script>
|
|
222
|
-
"""
|
|
223
|
-
|
|
224
|
-
with open("tree.html", "w") as f:
|
|
225
|
-
f.write(html.replace("</body>", extra_js + "</body>"))
|
|
226
|
-
|
|
227
|
-
print("✅ Open tree.html in your browser")
|
|
228
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gcc_slycooper50-0.1.129 → gcc_slycooper50-0.1.131}/src/gcc_slycooper50.egg-info/top_level.txt
RENAMED
|
File without changes
|