-
Notifications
You must be signed in to change notification settings - Fork 5
Issue 59 update documentation how to use send back diagram image #60
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
Merged
CopyDemon
merged 10 commits into
IDAES:main
from
CopyDemon:issue-59-update-documentation-how-to-use-send-back-diagram-image
Mar 5, 2025
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8a3572b
change readme.txt to readme.md, add content about how to run sphinx l…
CopyDemon f967de8
add quick link to save and preview diagram
CopyDemon f4959bb
add quick link to save and preview diagram
CopyDemon b445563
add quick link to save and preview diagram
CopyDemon e1398e5
work save working on save diagram function doc
CopyDemon 4132625
Merge branch 'main' into issue-59-update-documentation-how-to-use-sen…
CopyDemon e1d6234
export_flowsheet_diagram takes display as a boolean parameter to dete…
CopyDemon 09d046e
update save and preview flowsheet diagram documentation
CopyDemon 6ec97f3
save and preview flowsheet diagram documentation demo video
CopyDemon 3b61af8
stage renamed as "view" and was more explicit about where m.fs comes …
dangunter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
README for IDAES-UI docs | ||
========================= | ||
|
||
|
||
### Merge and build | ||
* When merging changes to IDAES-UI, the CI will automatically run and build the documentation to the online server. | ||
|
||
### Run as developer | ||
```bash | ||
# Change to the docs directory | ||
|
||
# Install the required packages | ||
pip install -r requirement.txt | ||
|
||
# Install sphinx-autobuild | ||
# This is necessary for building a local development server to view live changes. | ||
pip install sphinx-autobuild | ||
|
||
# Run the live server using Sphinx-autobuild. | ||
sphinx-autobuild . _build/html | ||
``` |
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+8.24 MB
docs/static/save_diagram/videos/demo_video_export_flowsheet_diagram.mp4
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
(save-preview-diagram)= | ||
# Save and Preview Flowsheet Diagram | ||
|
||
### Overview: | ||
IDAES UI allows you to preview your flowsheet diagram at any time while working on it by calling `export_flowsheet_diagram`. | ||
|
||
### Usage: | ||
The export_flowsheet_diagram function is used to return the current stage of the flowsheet diagram at any time after you have initialized your model. | ||
* It can save the diagram to your preferred path or the default path. | ||
* It can display the current stage of the flowsheet diagram in a Jupyter Notebook. | ||
|
||
### Parameters: | ||
`export_flowsheet_diagram` takes three parameters: | ||
* `flowsheet`: The flowsheet object | ||
* `name`: The diagram filename or full path where you prefer to save the diagram. The output format is determined by the file extension (".svg" for SVG and ".png" for PNG). | ||
* `display`: Boolean, to determent if you want to review current flowsheet in jupyter notebook | ||
|
||
#### Let's go over it step by step. | ||
1. Import `export_flowsheet_diagram` function from `idaes_ui package` | ||
```python | ||
from idaes_ui.fv.fsvis import export_flowsheet_diagram | ||
``` | ||
|
||
2. After initializing your model, you should have `m.fs`. | ||
Then, you can call `export_flowsheet_diagram`. | ||
```python | ||
export_flowsheet_diagram(m.fs, '~/Download/my_flowsheet_diagram.svg', display=True) | ||
``` | ||
|
||
3. Then, you can see the flowsheet diagram's saved path in the log. | ||
|
||
### View flowsheet diagram | ||
1. To view the image, after calling `export_flowsheet_diagram`, you can visit the path shown in the log. | ||
2. To view the flowsheet diagram in a Jupyter Notebook, set `display=True`. This will automatically display the flowsheet diagram in the notebook. | ||
|
||
### Demo | ||
```{video} /static/save_diagram/videos/demo_video_export_flowsheet_diagram.mp4 | ||
:width: 800 | ||
:nocontrols: | ||
:autoplay: true | ||
:loop: | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
typo requirements with an 's'