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

Adding option to load json file for style with flowchart #16

Open
MrJordison opened this issue Feb 28, 2018 · 12 comments
Open

Adding option to load json file for style with flowchart #16

MrJordison opened this issue Feb 28, 2018 · 12 comments

Comments

@MrJordison
Copy link

Hi,
today with others persons we start to use your tool to generate automatically svg files with flowchart.js lib but unfortunately, it is actually not possible to add style (color, etc...) or passing it in command line parameter . For that reason, we've forked your work and adding possibility to load a JSON file containing style definition as a third argument like this:
diagrams flowchart [inputFile] [outputFile.svg] [styleSVGFilePath.json]

If you are interested by this enhancement : https://github.com/MrJordison/diagrams/commit/8ba38f9548c131fb391e306ad524a9242db9449a
I could make a merge request from our fork

@Francois-Laberge-Bose
Copy link
Collaborator

For now I'd prefer not to merge, but I agree this is needed. I'm just too busy to evaluate forks at the moment. My thought on this is I was hoping that styling information is included in the .flowchart and other source files instead. This way all information is stored in the top most file. This way I could make the real time visualization supported in the Atom plugin (francoislaberge/atom-diagrams) to see things including the related styling.

realtime-diagrams

Potentially it would be something like the first line if a comment with a certain convention for specifying stylesheets.

@Francois-Laberge-Bose
Copy link
Collaborator

Also, I was hoping to standardize potentially on a nicer syntax than css, but then again css makes the most sense. Potentially I could add explicit or optional support for css preprocessors like sass, less, stylus, etc.

@Relequestual
Copy link

@Francois-Laberge-Bose Have you had any further thoughts on this?

I know CSS might not feel like the best way, but given this is a downstream tool, wouldn't it make sense to support what's upstream already? It would be super frustrating for someone who wants to use an existing theme, having to re-encode it in JSON (or whatever) from the provided CSS.

@Francois-Laberge-Bose
Copy link
Collaborator

I'm just too busy to think about any of my open source projects at the moment. I originally set out to bootstrap this project with other projects, and then was going to redo the syntax and make my own implementation of each type of graph generator using a consistent syntax across all of them. I'm now thinking I may not get back to this, so yeah, pragmatically adding support for css would be high value, and the right thing for now.

If you create a PR and have a good description of the work, I'll take a look and maybe merge. Just so long as it's optional to use the css, and acts the same as before when you don't provide it, then I'm happy to review if it's not too complicated.

I'm a new dad and have an awesome job, so I tend to have no time for my open source projects lately.

@Relequestual
Copy link

Totally understand! Congratulations on both accounts! It's tough, but hopefully you'll find it rewarding as so many of us do! =D

I think I've decided to draw my diagrams up by hand, as I otherwise won't be able to meet my deadline. Plus I'm having doubts over the automated approach in terms of if being accessible for others to modify.
Appreciate your previous work on this though! Obviously the licence means anyone is welcome to fork and publish under another name on npm.

@Francois-Laberge-Bose
Copy link
Collaborator

Thanks! Exactly, fork away.

Have you seen my https://github.com/francoislaberge/atom-diagrams plugin? Makes it easier to have people contribute. Though, I don't support flow diagrams at the moment I believe

@Relequestual
Copy link

I have, but I don't use Atom. (ST, but expect to be moving to Code some time.)

My main barrier to usage is there's no way to tell if there's been a syntax error or not. There's no error reporting in the case of a syntax error. I assume there's some console error if the library can't digest the passed data.

@Francois-Laberge-Bose
Copy link
Collaborator

Francois-Laberge-Bose commented Feb 8, 2019 via email

@Relequestual
Copy link

Sublime Text =]
One of the few viable options before Atom and after Notepad++

@seflless
Copy link
Owner

seflless commented Feb 8, 2019 via email

@seflless
Copy link
Owner

seflless commented Feb 8, 2019 via email

@Relequestual
Copy link

Not a bad idea, but then it wouldn't give me the benefit I was using a cli for... useability by others. I don't want to require others to download atom and a plugin to update an image. npm install however, as in run a script, is probably OK.

Manual approach is going OK though, and most people have office.

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