Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Export diagram as SVG create an empty file #93

Open
pabepadu opened this issue Jun 5, 2021 · 7 comments
Open

Export diagram as SVG create an empty file #93

pabepadu opened this issue Jun 5, 2021 · 7 comments

Comments

@pabepadu
Copy link

pabepadu commented Jun 5, 2021

Hi,

Since version 0.9, "Export diagram as SVG" create an empty file.

It seems the code to get the SVG content has been commented:

public getSVG(): string {
return ''; //this.mx.mxUtils.getXml(this._editor.editor.graph.getSvg());
}

hbcarlos added a commit that referenced this issue Jun 28, 2021
@rushfly
Copy link

rushfly commented Aug 14, 2021

How to fix it? I tried to uncomment the code above, but got some install errors.

$ rimraf lib/drawio && mkdir -p lib/drawio && cp -R src/drawio lib && tsc
    src/editor.ts(113,17): error TS2339: Property 'mx' does not exist on type 'DrawIODocumentWidget'.
    src/editor.ts(113,40): error TS2339: Property '_editor' does not exist on type 'DrawIODocumentWidget'.
    error Command failed with exit code 1.

@hbcarlos
Copy link
Contributor

Hi @rushfly. The API has changed a little bit. There is a PR ready that will solve that. See: #99

You can activate this option by adding the following method:

public getSVG(): string {

This one in the panel:

public getSVG(): string {

And may this changes here:

execute: () => {

@xiongjiamu
Copy link

Hi @rushfly. The API has changed a little bit. There is a PR ready that will solve that. See: #99

You can activate this option by adding the following method:

public getSVG(): string {

This one in the panel:

public getSVG(): string {

And may this changes here:

execute: () => {

hi, dear @hbcarlos

I checkout your branch rtc-using-string and followed the Development install section in README.md , when I'm going to run the script jupyter labextension develop . --overwrite to Link my development version of the extension with JupyterLab, I got this error below:

Traceback (most recent call last):
  File "/Users/xxm/Documents/gitlab/Jupyter/jupyterlab-drawio/setup.py", line 7, in <module>
    from jupyter_packaging import (
ModuleNotFoundError: No module named 'jupyter_packaging'
An error occured.
FileNotFoundError: The Python package `.` is not a valid package, it is missing the `setup.py` file.
See the log file for details:  /var/folders/85/z3660xmj79xdjy3zr9pm__x80000gn/T/jupyterlab-debug-34dg1p3h.log

And the full error log is :

Traceback (most recent call last):

  File "/usr/local/lib/python3.9/site-packages/jupyterlab/federated_labextensions.py", line 376, in _get_labextension_metadata
    package = subprocess.check_output([sys.executable, 'setup.py', '--name'], cwd=mod_path).decode('utf8').strip()

  File "/usr/local/Cellar/python@3.9/3.9.1_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,

  File "/usr/local/Cellar/python@3.9/3.9.1_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,

subprocess.CalledProcessError: Command '['/usr/local/opt/python@3.9/bin/python3.9', 'setup.py', '--name']' returned non-zero exit status 1.


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "/usr/local/lib/python3.9/site-packages/jupyterlab/debuglog.py", line 47, in debug_logging
    yield

  File "/usr/local/lib/python3.9/site-packages/jupyterlab/labextensions.py", line 128, in start
    ans = self.run_task()

  File "/usr/local/lib/python3.9/site-packages/jupyterlab/labextensions.py", line 199, in run_task
    develop_labextension_py(arg, user=self.user, sys_prefix=self.sys_prefix, labextensions_dir=self.labextensions_dir, logger=self.log, overwrite=self.overwrite,

  File "/usr/local/lib/python3.9/site-packages/jupyterlab/federated_labextensions.py", line 135, in develop_labextension_py
    m, labexts = _get_labextension_metadata(module)

  File "/usr/local/lib/python3.9/site-packages/jupyterlab/federated_labextensions.py", line 378, in _get_labextension_metadata
    raise FileNotFoundError('The Python package `{}` is not a valid package, '

FileNotFoundError: The Python package `.` is not a valid package, it is missing the `setup.py` file.

Exiting application: lab

Can you help me fix this error ? Or may you know when your PR #99 will be merged ?

Best wishes :)

@hbcarlos
Copy link
Contributor

Hi @xiongjiamu, you need to install the package jupyter_packaging in the conda environment you are installing JupyterLab-DrawIO.
You can use mamba for this mamba install -c conda-forge jupyter-packaging.

I'll try to merge it as soon as possible.

hbcarlos added a commit that referenced this issue Aug 24, 2021
@skaag
Copy link

skaag commented Feb 21, 2022

I tried the above and it doesn't work for me. I still get empty SVG files when I export to SVG from DrawIO.

@yxiao315
Copy link

The Problem still exists, empty SVG file when export diagram as SVG

@lbocken
Copy link

lbocken commented Apr 5, 2023

Same problem for me!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants