Open Nitcloud opened 3 years ago
It already is supported! See the settings, you can set a path to custom libraries.
I've found this setting, but I haven't found a specific way to make a custom library, such as how to define graphics properties.
Can you elaborate what you mean with "custom library"? Can you describe exactly what is missing and you would like to see? Do you miss the option create custom libraries?
I've never worked with custom libraries in Draw.io.
In the figure , 1 point to how the graph is called, 2 to how the library is added, and 3 to the properties of the graph being called. Now, I want to customize what the graph looks like and what the properties are.
How do you add it in "More Shapes..."? Is Electrical / Logic Gates
a predefined library or did you import it from some file? Am I right that you want to customize this library?
Is this feature supported by Draw.io (e.g. Draw.io Desktop)? If not, it will be hard to implement this here.
I've designed a processing module, and now I want to put it in a custom library for the next call.At the same time, this module needs to configure parameters. I want to set the parameters of this module in the property on the right, so that the code can be generated automatically according to the wiring of the graphic property after the wiring is completed.
How do you add it in "More Shapes..."? Is
Electrical / Logic Gates
a predefined library or did you import it from some file? Am I right that you want to customize this library?Is this feature supported by Draw.io (e.g. Draw.io Desktop)? If not, it will be hard to implement this here.
Yes, I would like to customize a user library similar to Electrical/Logic Gates. I do not known whether this feature is now supported by the plug-in
How do you add it in "More Shapes..."? Is
Electrical / Logic Gates
a predefined library or did you import it from some file?
It's a predefined one.
Yes, I would like to customize a user library similar to Electrical/Logic Gates. I do not known whether this feature is now supported by the plug-in
You can import any exported library to the scratchpad if you click on the pencil icon in the scratchpad:
Or add it via File/Import
Otherwise it should be possible to always load an exported library afaik via settings:
"hediet.vscode-drawio.customLibraries": [
{"file": "/path/to/lib.xml","libName": "test"}
],
but in my case it wasn't added to the libraries on the left side or was reachable in the + More Shapes
dialog.
@hediet maybe a bug?
I've designed a processing module, and now I want to put it in a custom library for the next call.At the same time, this module needs to configure parameters. I want to set the parameters of this module in the property on the right, so that the code can be generated automatically according to the wiring of the graphic property after the wiring is completed.
You could use properties as placeholders (not the custom ones on the right, but the ones reachable via Strg+M
or Right click/Edit Data
).
The custom properties on the right are hardcoded into the shape types and can not be modified afaik.
Except if you code your own shapes: I built an RTL extension for building such block diagrams.
How would you create a custom library?
How would you create a custom library?
How do you add it in "More Shapes..."? Is
Electrical / Logic Gates
a predefined library or did you import it from some file?It's a predefined one.
Yes, I would like to customize a user library similar to Electrical/Logic Gates. I do not known whether this feature is now supported by the plug-in
- You can import any exported library to the scratchpad if you click on the pencil icon in the scratchpad:
- Or add it via
File/Import
- Otherwise it should be possible to always load an exported library afaik via settings:
"hediet.vscode-drawio.customLibraries": [ {"file": "/path/to/lib.xml","libName": "test"} ],
but in my case it wasn't added to the libraries on the left side or was reachable in the
+ More Shapes
dialog. @hediet maybe a bug?I've designed a processing module, and now I want to put it in a custom library for the next call.At the same time, this module needs to configure parameters. I want to set the parameters of this module in the property on the right, so that the code can be generated automatically according to the wiring of the graphic property after the wiring is completed.
You could use properties as placeholders (not the custom ones on the right, but the ones reachable via
Strg+M
orRight click/Edit Data
). The custom properties on the right are hardcoded into the shape types and can not be modified afaik.Except if you code your own shapes: I built an RTL extension for building such block diagrams.
Thank you for your reply. I will try it
How would you create a custom library?
Whether the exported XML file can be used in VSCode?
Whether the exported XML file can be used in VSCode?
You can most probably use the exported xml file by referencing it in the "custom libraries" setting!
I created a custom library using the standard draw.io webapp then exported it but when importing it using the settings it renders an empty section:
"hediet.vscode-drawio.customLibraries": [
{"file": "/Users/my_user/testlib.xml", "libName": "test", "entryId": "test"}
]
Am I missing something?
I was confused as well. The issue seems to be, that the extension only accepts compressed XML content, but draw.io only saves libraries in clear text (not sure why, at one point I read that they switched compressed xml off because of the many problems it created).
You can convert the library xml:
now the library should load.
Of course it would be way easier, if the extension would allow compressed or uncomrpressed xml content in libraries. Would this be possible?
This plug-in is really great, will you add the function of user-defined graphics library in the future? I think it is of great help to the graphical and process-based design of FPGA, looking forward to your reply.