Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

JSON Format #3

Closed
bgott opened this issue Apr 28, 2015 · 3 comments
Closed

JSON Format #3

bgott opened this issue Apr 28, 2015 · 3 comments
Assignees
Labels

Comments

@bgott
Copy link
Collaborator

bgott commented Apr 28, 2015

Need to figure out what is the optimal format of model data to pass into the visualizer such that we aren't wasting time re-parsing anything from a string format, or using an inefficient sort/search in order to display each node with its [association] edges.

@alex-grover
Copy link
Owner

JSON would be good for this as you can just use JSON.parse from the javascript which will automatically turn it into a js object.

To do this from the Ruby end, it looks like we can do

require 'json'
JSON.generate(model)

if we want to convert an object or array. Not sure if this will work with our Model class - we should test. may require defining a to_json method ourselves to serialize all the properties.

@alex-grover
Copy link
Owner

In terms of the format, right now we're storing a hash of name->model object which should be sufficient? We changed it from an array and this is definitely better but I'm not sure how you guys are handling the lookups on the JS end.

@alex-grover
Copy link
Owner

Implemented by 6213e5b.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants