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

SVG output is broken #35

Open
krisztianb opened this issue May 15, 2020 · 7 comments
Open

SVG output is broken #35

krisztianb opened this issue May 15, 2020 · 7 comments

Comments

@krisztianb
Copy link

Hi there!

I'm using your module in my typedoc plugin: https://github.com/krisztianb/typedoc-umlclass/blob/master/src/image_generator.ts#L34

In version 0.5.0 of your module the SVG output is working fine. In later versions (0.7.0 and later) it produces a malformed output. Unfortunately I could not test 0.6.x as their installer fails/hangs while downloading the JAR file.

You can find more on this issue here: krisztianb/typedoc-umlclass#2

Kind regards and thanks for your great work!

@Ognian
Copy link

Ognian commented Jun 18, 2020

@krisztianb any idea if this is going to be fixed?

@krisztianb
Copy link
Author

krisztianb commented Jun 18, 2020

Hello @Ognian actually I don't really care anymore, because I'm soon going to release a module on npm that does the same thing this module does and can even generate multiple diagrams with one process. You can have a look here: https://github.com/krisztianb/plantuml-pipe

@krisztianb
Copy link
Author

@Ognian I've just released plantuml-pipe on NPM: https://www.npmjs.com/package/plantuml-pipe I hope it can help you.

@sylvainar-adeo
Copy link

Hey,
This new release looks great. Are you going to adapt current node-plantuml for it to use plantuml-pipe or are we supposed to switch to the new package?

@krisztianb
Copy link
Author

@sylvainar-adeo thanks.

I'm not planing to adapt node-plantuml and I'm not the package owner. Actually I only created plantuml-pipe, because node-plantuml seems to be abandoned.

I want to keep plantuml-pipe as simple a possible, but I'm open to feature requests. Feel free to use whichever package suits you most.

@sylvainar
Copy link

sylvainar commented Jun 26, 2020

Okay nice!

Right now i'm using node-plantuml like this:

/**
 * Generate a single output file from PUML.
 *
 * @async
 * @param {string} source - Source path.
 * @param {string} dest - Dest path.
 */
const promiseGenerator = (source, dest) => new Promise((resolve, reject) => {
  const generator = plantuml.generate(source, PUML_OPTIONS);
  const fileStream = fs.createWriteStream(dest);

  fileStream.on('error', reject);
  generator.out.on('error', reject);

  generator.out.pipe(fileStream);

  fileStream.on('finish', () => {
    resolve();
  });
});

If you have an equivalent on plantuml-pipe I'd be happy to switch 😄

Edit: (oups, cross-posting with another account)

@krisztianb
Copy link
Author

I really like this promise approach. I was thinking about how plantuml-pipe could be used in this manner, but couldn't come up with a sensible solution so far. The problem is that you would need to generate a Promise that gets resolved inside of the streams data event. It can be done, but the code looks quite ugly imho.

So the short answer is: I'm afraid you can't just simply replace node-plantuml with plantuml-pipe without some refactoring of your code. 😞

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

4 participants