Skip to content
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

Node-RED: Allow flows to be rendered as diagrams #1985

Merged
merged 3 commits into from
May 1, 2024
Merged

Conversation

ZJvandeWeg
Copy link
Member

Utilizes the upstream package remove the need for
images + plain JSON.

For this change I've only shown the split node as an example page. The rest of the nodes will be added
later, though there's some upstream changes that
would be better to add before we roll these changes out wholesale.

Related Issue(s)

Would be ideal to have: FlowFuse/flow-renderer#28 soonish to fix the height requiring manual checks and updates.

Checklist

  • I have read the contribution guidelines
  • I have considered the performance impact of these changes
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated

Utilizes the upstream package remove the need for
images + plain JSON.

For this change I've only shown the split node as an
example page. The rest of the nodes will be added
later, though there's some upstream changes that
would be better to add before we roll these changes
out wholesale.
@ZJvandeWeg ZJvandeWeg marked this pull request as ready for review April 30, 2024 13:14
@ZJvandeWeg
Copy link
Member Author

Copy link
Contributor

@Yndira-E Yndira-E left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to set the height of the flow viewer? It's not terrible, but some seem too big for a single line flow.

Screenshot 2024-04-30 at 15 19 52

![Node-RED split by word](./images/split-node-by-word.png "Split text by space in Node-RED")

```json
{% renderFlow 400 %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yndira-E here's an example where height is set

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Joe!!
I tried to make them all the same height, but sometimes the flows aren't centered or even visible... I'm guessing that's the reason some have an unusual height.
Screenshot 2024-04-30 at 16 47 04

Maybe some information regarding how to set the height should be added to handbook as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's caused by FlowFuse/flow-renderer#28

@Yndira-E Yndira-E self-requested a review April 30, 2024 15:01
@joepavitt
Copy link
Contributor

I'd say it's worth a quick fix of FlowFuse/flow-renderer#28 before putting this live onto the website

Now 0.3 is released the minification is provided upstream.
Furthermore, the height can be decreased as the viewport
automatically puts the top-left node right in the view.
@ZJvandeWeg
Copy link
Member Author

@Yndira-E @joepavitt the last commit, b31a9ca, bumps the upstream package and decreased the elements' height by default to 200px as it automatically puts the top-left node close to the screenspace top-left (sorry for the awkward description).

I believe this PR is now ready to be merged. The cascading changes for other pages I'll pick up later today to ensure that PR is highly focussed and can serve as an example for the writers.

@ZJvandeWeg
Copy link
Member Author

Validated the deploy preview, and going ahead with merging.

@ZJvandeWeg ZJvandeWeg merged commit 239bbfe into main May 1, 2024
6 checks passed
@ZJvandeWeg ZJvandeWeg deleted the zj-flow-renderer branch May 1, 2024 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants