Replies: 4 comments 3 replies
-
The only significant difference between YAML and JSON is that YAML can express cyclic graphs, while JSON supports strictly DAGs. e.g:
expresses a data-structure that is the equivalent to what the following JS code creates:
Which means that the visual tool may need to represent arrows going against the natural direction. Anyway - IMHO - cool feature as it is, the use-cases for cyclic graphs in yaml are still a small minor subset of the use-cases. |
Beta Was this translation helpful? Give feedback.
-
yq does lots of smart transformations, json with comments (jsonc), comments manipulation, even edits/inplace updates! # About
yq is a portable command-line YAML, JSON, XML, CSV and properties processor
# Updates/edits:
https://mikefarah.gitbook.io/yq/v/v4.x/commands/evaluate
https://mikefarah.gitbook.io/yq/operators/select#select-and-update-matching-values-in-map
---
https://github.com/mikefarah/yq "Controlling" this binary as a dependency could ease the heavy work. |
Beta Was this translation helpful? Give feedback.
-
Having YAML support would be dreamy. Is it my understanding that it will happen? |
Beta Was this translation helpful? Give feedback.
-
YAML file type will be supported once #27 & #51 gets fixed. They are the biggest troubles currently in the parsing algorithm. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I started testing JSON Visio to display CWL workflow files. These are normally written in YAML (e.g. https://github.com/common-workflow-language/user_guide/blob/84f22ab00a8bd73077e47801b2ccb81aff1eb79f/src/_includes/cwl/hello_world.cwl) but it is also possible to use JSON to write CWL workflows (e.g. https://github.com/common-workflow-language/cwltool/blob/e37134a90ac7a7c18254e30cff16da590b45c6d7/tests/wf/scatter-wf4.json).
To plot the YAML diagrams, I copied one of the YAML workflows and pasted into an online tool that converts YAML to JSON (YAML being a superset of JSON makes it easy, I guess).
Maybe JSON Visio could be extended to support YAML too, with some experimental feature that first converts YAML into JSON, and then renders it?
The output in these three tools is the same for a CWL YAML document converted into JSON. I suspect they might be using something similar to https://www.npmjs.com/package/yaml-to-json.
Thanks for sharing jsonvisio.com! Learned about it from HackerNews.
Bruno
Beta Was this translation helpful? Give feedback.
All reactions