-
-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Allow passing data
property to individual Ports
#227
Comments
I tried adding Steps to reproduce
Port.stories.tsxnodes={[
{
id: '1',
text: 'Node 1',
ports: [
{
id: '1-from',
width: 10,
height: 10,
side: 'SOUTH',
data: {
hostnames: 'test',
remote_hostnames: ['']
}
},
{
id: '1-to',
width: 10,
height: 10,
side: 'NORTH',
data: {
hostnames: 'test',
remote_hostnames: ['']
}
}
]
},
{
id: '2',
text: 'Node 2',
ports: [
{
id: '2-from',
width: 10,
height: 10,
side: 'SOUTH',
data: {
hostnames: 'test',
remote_hostnames: ['']
}
},
{
id: '2-to',
width: 10,
height: 10,
side: 'NORTH',
data: {
hostnames: 'test',
remote_hostnames: ['']
}
}
]
}
]} Stacktrace
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
It would be useful if port objects supported the
data
property that Node and Edge's support (types.ts file).This would allow the user to add additional meta information about the port
Motivation for feature
I have a device with 2 ports; 1 on the left and one on the right
This port is connected to multiple other edges / nodes on the canvas from a user point of view
I'd like to be able to check
port.data
, which contains my own data, before modifying a port object.In the example below, I added
red-port
class to a port that I didn't intentionally intent to (the left red port in the image)I was doing something like this:
then , realized after looking at my code, that the concept of
data
for port didn't exist.Having
data
on port objects, would allow users to conditionally operate on the portReferences
The text was updated successfully, but these errors were encountered: