-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Canvas: Dynamic connection direction #108423
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
Conversation
|
Since you've added the |
| fixed?: string | ||
| }@cuetsy(kind="interface") | ||
|
|
||
| ConnectionDirection: "forward" | "reverse" | "both" | "none" @cuetsy(kind="enum", memberNames="Forward|Reverse|Both|None") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably shouldn't be in this file, but not sure where's the best place for it, to avoid import horrors.
|
💻 Deploy preview deleted. |
| If the direction source is **Field**, select a field that contains numeric values: | ||
|
|
||
| - **Positive values** - Display forward arrows. | ||
| - **Negative values** - Display reverse arrows. | ||
| - **Zero** - Display no arrow heads. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth mentioning that NaN or null will default to forward.
@drew08t does this happen with the other panels too? I might've messed up that panel, I actually thought I removed it.. |
Not that I can see. After making this change to one connection, it works during init.
|
ooh yeah, the gdev is broken then, fixed is not an object. I'll remove the panel altogether, not sure how/when I added it back. I updated Network Weathermap panel to use fields for direction. |
# Conflicts: # public/app/features/canvas/runtime/scene.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome PR, love it 😻
Could you also add those changes from ConnectionSVG to ConnectionSVG2? Or I can do it myself, just let me know 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pushed 😁
| } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Connection Migration Fails Type Checks
The connection direction migration has two issues:
- Type Safety: It incorrectly assigns string literals (e.g.,
connection.direction,'forward') to properties that expect enum values (e.g.,ConnectionDirection,DirectionDimensionMode.Fixed), violating type contracts. - Migration Scope: The
parseFloat(pluginVersion) <= 12.2version check is insufficient. It fails forundefinedor emptypluginVersion, and prevents migration for panels withpluginVersion > 12.2or newly created connections. This results in connections lacking proper direction configurations on initial load, causing missing arrowheads.
|
Blocked by #108998 / grafana/scenes#1092 |
# Conflicts: # devenv/dev-dashboards/panel-canvas/canvas-connection-examples.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!




canvas_connections_direction.mov
To Do:
Fixes #92369
test dashboard
Please check that: