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

Independent viewer component for embedding #15

Closed
Hydragyrum opened this issue Jun 29, 2021 · 5 comments
Closed

Independent viewer component for embedding #15

Hydragyrum opened this issue Jun 29, 2021 · 5 comments
Assignees

Comments

@Hydragyrum
Copy link

Would it be possible to separate the viewer component such that it can take a JSON file and display it as an embedded format à la mermaidJS? This will make it easier to embed a read-only version for documentation purposes.

@honzaap
Copy link
Owner

honzaap commented Jun 29, 2021

This could be possible, there is a similar Issue that will export the board as png except what you're saying would be perphaps SVG. I mean something like drawio File->Embed->SVG function.

@Hydragyrum
Copy link
Author

Hydragyrum commented Jun 29, 2021

I was thinking more exporting the json and rendering it on the fly, though exporting an svg might be a reasonable fallback. Rendering it on the fly would make updating the document much easier though, as the source simply needs to be imported, modified and re-exported.

@honzaap
Copy link
Owner

honzaap commented Jun 29, 2021

There are certainly a lot of pros this would bring, however I don't think that it would be possible now. It would mean a lot of changes and I'm not sure I even know where to start. I will try to look into more way to export the system outside the app after creating the "export as png/svg" and maybe even try this method. It will take some time though...

@Hydragyrum
Copy link
Author

No problem, it'll probably mean decoupling the board view from the rest of the app somehow

@honzaap
Copy link
Owner

honzaap commented Jul 17, 2021

Most of the UI was decoupled, only things that are essential for the board are present in the component. The <app-board> can now take in a JSON object, like: <app-board [loadedSave]="saveObject"></app-board>. If this object is provided, it will be loaded instead of the last modified save. You can also pass in [isReadOnly]="true", which will render the board without component and options menu, and will provide a bottom menu for controls. This is the method used for IFrame embedding that was made in the c417412 commit. Even though it's not exactly like the example of mermaidJS I believe that this Issue can be closed with this. Any future embedding options will be also done with this method. If you have any issues, feel free to ask, create a new Issue or reopen this one.

@honzaap honzaap closed this as completed Jul 17, 2021
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

No branches or pull requests

2 participants