The project is based on drawio_chartjs_plugin and function-plot.
Double click on a shape and edit the JSON, the shape will be redrawn after leaving the editor.
You can visit the website of Function Plot for more documents.
Because Function Plot
use eval()
function, and eval()
function is blocked by Content Security Policy of Electron, it is neccessary to find the way around it.
Firstly, find the file path of drawio desktop and there are a file name app.asar
.
For example, my app.asar
file is in /opt/drawio/resources
.
Secondly, install asar
tool to extract the app.asar
file. (You can backup your app.asar
file.)
# install
npm install -g asar
# extract
asar extract app.asar src
Thirdly, modify the index.html
in src/
, and add \'unsafe-eval\'
after 'default-src \'self\' \'unsafe-inline\'
.
Finally, repack the src\
into app.asar
.
# repack
asar pack src app.asar
And if you can open drawio successfully, it is ok.
- Download
function-plot-plugin.webpack.js
file in Releases.
- Click on
Extras
, thenPlugins...
.
- Click
Add...
.
- Click
Select File...
- Select
function-plot-plugin.webpack.js
file and thenApply
.
- Reboot and then you can enjoy it!