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

"Open With > Vega" removes line breaks and indentation #5452

Closed
masonlr opened this issue Oct 7, 2018 · 4 comments · Fixed by #5642
Closed

"Open With > Vega" removes line breaks and indentation #5452

masonlr opened this issue Oct 7, 2018 · 4 comments · Fixed by #5642
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Milestone

Comments

@masonlr
Copy link

masonlr commented Oct 7, 2018

Describe the bug

The "Open With > Vega" feature removes line breaks and indentation from the source json file (making it difficult to develop vega json files using jupyter lab).

To Reproduce
Steps to reproduce the behavior:

  1. Create a file called vega.json with example vega source:

    curl https://vega.github.io/vega/examples/bar-chart.vg.json > vega.json
    
  2. Right click on the file in the jupyterlab file browser and go to "Open With > Vega" .

  3. Line breaks and indentation will be removed.

Expected behavior
Original file formatting to be retained.

Screenshots

vega

Desktop (please complete the following information):

  • OS: macOS 10.12.6
  • Browser: chrome 69.0
  • JupyterLab: 0.34.10
@jasongrout
Copy link
Contributor

Confirmed. Thanks for the easy and explicit instructions to reproduce!

My first question: why is the vega viewer saving the json? Shouldn't it be basically opening the file read-only?

@jasongrout jasongrout added this to the Future milestone Oct 10, 2018
@jasongrout
Copy link
Contributor

I've also noticed sometimes opening csv files, it seems that the file shows as being dirty. Perhaps this is related? The CSV viewer also should be read-only.

@jasongrout
Copy link
Contributor

Setting as a 1.0 issue so we can track down why the file is being saved - that seems really odd.

@jasongrout jasongrout modified the milestones: Future, 1.0 Oct 10, 2018
@JohnJohnsonIII
Copy link
Contributor

Identified issue as being with the _changeCallback function in docregistry package's mimedocument.ts file. About to do a PR for the fix...

ian-r-rose added a commit that referenced this issue Nov 19, 2018
Fix issue #5452 by putting in checks into the _changeCallback functio…
@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Aug 8, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants