Add Support for Custom Diagrams.net Configuration #2751

Closed
opened 2026-02-05 05:00:47 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @HeyITGuyFixIt on GitHub (Apr 11, 2022).

Describe the feature you'd like

Diagrams.net has the option to specify a custom configuration when embedding it. Could this option be available in Bookstack?

When Diagrams sends the 'configure' event, Bookstack would need to send a response like so (I'm assuming in the "resources/js/services/drawio.js" file):

drawPostMessage( { action: 'configure', config: JSON.parse(/*user-defined JSON here*/) } );

Describe the benefits this would bring to existing BookStack users

Exposing this level of configuration will allow users to have full control over how the embedded Diagrams looks. For me specifically, I want to control which Libraries are shown as well as define my own Library.

Can the goal of this request already be achieved via other means?

Not that I am aware.

Have you searched for an existing open/closed issue?

  • I have searched for existing issues and none cover my fundemental request

How long have you been using BookStack?

0 to 6 months

Additional context

No response

Originally created by @HeyITGuyFixIt on GitHub (Apr 11, 2022). ### Describe the feature you'd like Diagrams.net has the [option](https://www.diagrams.net/doc/faq/configure-diagram-editor) to specify a custom configuration when embedding it. Could this option be available in Bookstack? When Diagrams sends the 'configure' event, Bookstack would need to send a response like so (I'm assuming in the "resources/js/services/drawio.js" file): ```js drawPostMessage( { action: 'configure', config: JSON.parse(/*user-defined JSON here*/) } ); ``` ### Describe the benefits this would bring to existing BookStack users Exposing this level of configuration will allow users to have full control over how the embedded Diagrams looks. For me specifically, I want to control which Libraries are shown as well as define my own Library. ### Can the goal of this request already be achieved via other means? Not that I am aware. ### Have you searched for an existing open/closed issue? - [X] I have searched for existing issues and none cover my fundemental request ### How long have you been using BookStack? 0 to 6 months ### Additional context _No response_
OVERLORD added the 🔨 Feature Request label 2026-02-05 05:00:47 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Apr 21, 2022):

Thanks for the request @HeyITGuyFixIt.
A custom event for this usage has been added in PR #3391, to be part of the next feature release.
This aligns with the way we allow tweaking of other editor library configuration, via a custom event.

Usage will look something like this:

<script>
    window.addEventListener('editor-drawio::configure', event => {
        const config = event.detail.config;
        config.sidebarWidth = 900;
    });
</script>
@ssddanbrown commented on GitHub (Apr 21, 2022): Thanks for the request @HeyITGuyFixIt. A custom event for this usage has been added in PR #3391, to be part of the next feature release. This aligns with the way we allow tweaking of other editor library configuration, via a custom event. Usage will look something like this: ```html <script> window.addEventListener('editor-drawio::configure', event => { const config = event.detail.config; config.sidebarWidth = 900; }); </script> ```
Author
Owner

@HaniEbrahimi69 commented on GitHub (Aug 16, 2024):

I want to add custom library in draw.io project in sidebar .please help me to add this item.I use chatgpt for find a solution but I can not get good solution.please help me to resolve my problem

@HaniEbrahimi69 commented on GitHub (Aug 16, 2024): I want to add custom library in draw.io project in sidebar .please help me to add this item.I use chatgpt for find a solution but I can not get good solution.please help me to resolve my problem
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2751