Open
Conversation
in order to programatically control the json view a number of currently private fields need to be public so that e.g. it is possible to control the layout of the tree and know where/how the user is interacting with the view also handle cases where user preferences are not set
can now install via raco pkg install --name json-view racket-json-view/ and then (require json-view)
Owner
|
Hi, This should be split in multiple PR (one for the pref fix, one for the info.rkt, etc.). |
Author
|
I'll split them into separate requests. An example of the use case for exposing the internals is that I want to have certain nodes opened by default so that a user doesn't have to click on them to open every time, and the other is to make it possible to sort the hierlist according to some criteria. Another example would be that I need to implement a button that toggles the expansion of all nodes the same way the firefox json viewer does. |
When loading large json files building the hierlist takes a extremely long time, locking the interface. This commmit modifies how the hlist is built so that nested json objects are only loaded as hierlists when they are opened. This significantly improves performance. One optimization that has not beend implemented is to remove rendered objects from the unexpanded cache once they have been rendered.
also provied json-hierlist% so that it can be subclassed to customize
this fails if someone modifies or extends a configuration file so handle that case
vector-ref does not like receiving #f as an argument, as a failover we set 14, otherwise it seems to default to 1 or some absurdly small number
due to the fact that a json-view% takes a class and not an object the json hierlist sets style using super-new but does not provide a way for subclasses to overwite that style, so we don't pass style at all
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
in order to programatically control the json view a number of
currently private fields need to be public so that e.g. it is possible
to control the layout of the tree and know where/how the user is
interacting with the view
also handle cases where user preferences are not set