Updated new connection access from Smart Connections to resolve no nodes bug

This commit is contained in:
Mossy1022 2024-10-23 13:09:57 -04:00
parent 084891cee1
commit 527725ee99
4 changed files with 9 additions and 9 deletions

10
main.ts
View file

@ -1504,14 +1504,14 @@ class ScGraphItemView extends ItemView {
return true; // return all connections
} else {
// If connectionType is block, return true if connection is a SmartBlock, otherwise return false
return (this.connectionType === 'block') === (connection instanceof this.env.item_types.SmartBlock);
return (this.connectionType === 'block') === (connection.item instanceof this.env.item_types.SmartBlock);
}
}); // console.log('Filtered connections:', filteredConnections);
filteredConnections.forEach((connection: any, index: any) => {
// console.log('Filtered connection:', connection, 'Index:', index);
if (connection && connection.key) {
const connectionId = connection.key;
if (connection && connection.item && connection.item.key) {
const connectionId = connection.item.key;
// console.log('Adding connection node for ID:', connectionId);
this.addConnectionNode(connectionId, connection);
@ -1531,12 +1531,12 @@ class ScGraphItemView extends ItemView {
this.nodes.push({
id: connectionId,
name: connectionId,
group: (connection instanceof this.env.item_types.SmartBlock) ? 'block' : 'note',
group: (connection.item instanceof this.env.item_types.SmartBlock) ? 'block' : 'note',
x: Math.random() * 1000,
y: Math.random() * 1000,
fx: null,
fy: null,
fill: (connection instanceof this.env.item_types.SmartBlock) ? this.blockFillColor : this.noteFillColor,
fill: (connection.item instanceof this.env.item_types.SmartBlock) ? this.blockFillColor : this.noteFillColor,
selected: false,
highlighted: false
});

View file

@ -1,7 +1,7 @@
{
"id": "smart-connections-visualizer",
"name": "Smart Connections Visualizer",
"version": "1.0.18",
"version": "1.0.19",
"minAppVersion": "0.15.0",
"description": "View your Smart Connections in a visualized format.",
"author": "Evan Moscoso",

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "smart-connections-visualizer",
"version": "1.0.12",
"version": "1.0.18",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "smart-connections-visualizer",
"version": "1.0.12",
"version": "1.0.18",
"license": "MIT",
"dependencies": {
"bootstrap": "^5.3.3",

View file

@ -1,6 +1,6 @@
{
"name": "smart-connections-visualizer",
"version": "1.0.18",
"version": "1.0.19",
"description": "A plugin that allows you to view your Smart Connections in a visualized format.",
"main": "main.js",
"scripts": {