Skip to content

Add saving and loading to JSON #31

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

Merged
merged 6 commits into from
Feb 26, 2019
Merged

Conversation

crhallberg
Copy link
Collaborator

@crhallberg crhallberg commented Feb 8, 2019

Initial draft. Tried to make it compact. Would love feedback!

  • Should toJSON export an object or a string?

UPDATE:
File size is an issue. I transformed a 98MB CSV into a QuadTree and the JSON output is 144MB. I know JSON is fairly verbose, perhaps there's another way to encode this.

@crhallberg
Copy link
Collaborator Author

I did some benchmarking to see if this was worth it. Code available in this gist.

image

Parsing the JSON takes about 200ms if it seems fairer to include that in the time.

@crhallberg
Copy link
Collaborator Author

After reviewing a few libraries, most toJSON methods return objects. Plus, fromJSON was expecting an object.

@shiffman
Copy link
Member

@crhallberg Hi! Thank you for all of this work! I haven't been able to keep up with this repo, but I am planning to use it next week in my "Nature of Code" class at ITP in combination with the flocking example. Would you be interested in having write permissions to this repo and managing the various pull requests and issues?

@shiffman
Copy link
Member

I went through a bunch of the pull requests and have gotten more of a handle on the library! I'm happy to include this if you want to fix the merge conflicts!

@crhallberg
Copy link
Collaborator Author

1/ Thank you for the invite! I could definitely help facilitate this repository if you added me. I think this tool is a great and easy to use QuadTree and a great teaching tool as part of Coding Train. Thank you!

2/ I'll fix the merge errors soon! If you don't want to merge this before your class to avoid surprises, that makes sense too!

@crhallberg crhallberg mentioned this pull request Feb 25, 2019
4 tasks
@crhallberg crhallberg merged commit 9600369 into CodingTrain:master Feb 26, 2019
@crhallberg crhallberg deleted the save-load branch October 26, 2021 00:13
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

Successfully merging this pull request may close these issues.

2 participants