-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Add Reformat as JSON Option (Keep Comments) For Vega Editor #68674
Comments
Pinging @elastic/kibana-app (Team:KibanaApp) |
Can you elaborate on how that would look like? The JSON spec doesn't support comments, so I'm not sure how we could keep them when formatting the spec as JSON. |
The same way Visual Studio Code and other IDE's maintain comments but allow formatting I'd assume.
Without this I have to maintain my Vega JSON object in VS Code and copy/paste back and forth which is not a tremendous burden but anything that increases productivity I am game for. |
I don't use HJSON because most my work is done in https://vega.github.io/editor/#/ due to the ease of development. Then I will copy the code over when done or ready to start using elasticsearch data. The IDE will throw errors but still allows you to maintain comments and reformat as expected. The default Vega Visualization when you add a new visualization contains comments in JSON. I am simply asking to maintain that functionality. |
It's not a functionality, the default spec is just hardcoded like this. It's not JSON (as JSON is not allowed no include comments at all), it's HJSON which is mostly compatible with JSON except for the embedded comments. I'm still not 100% sure how your workflow looks like (I tried using a spec containing comments and it seems like the vega editor you linked is just throwing errors without showing a chart or being able to format the spec), but I see the point of this functionality. I'll label this an enhancement. Thanks for being responsive and explaining your use case! |
Correct. The editor doesn't allow comments there. They don't allow it but Kibana does. My workflow goes like this.
Now when I go back and make revisions that require reformatting my workflow goes like this.
Thanks for your help on this. |
After brainstorming with the team I think we have a solution that will work for us and anyone that wants to do this. "transform": [ Just add fields for comments. It doesn't break the Vega visualization if there are fields that aren't used. Just ignores them. |
Thank you for contributing to this issue, however, we are closing this issue due to inactivity as part of a backlog grooming effort. If you believe this feature/bug should still be considered, please reopen with a comment. |
The Vega editor currently has 2 options when you click the wrench.
We are requesting another option.
3. Reformat as JSON, keep comments
In our Vega code we have a header for change tracking with versions and releases as well as inline code explaining what is going on. So we don't need to write/maintain this code in another place it would be great if we can just reformat as JSON but keep the comments.
The text was updated successfully, but these errors were encountered: