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

make internals accessible #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

make internals accessible #1

wants to merge 7 commits into from

Conversation

tgbugs
Copy link

@tgbugs tgbugs commented Apr 15, 2021

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

tgbugs added 2 commits April 15, 2021 10:57
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)
@telephil
Copy link
Owner

Hi,

This should be split in multiple PR (one for the pref fix, one for the info.rkt, etc.).
The fix and the info.rkt are good but I really don't like the idea of making internals accessible.
Do you have a concrete example of something you would like to do and cannot because the internals are not exposed ?

@tgbugs
Copy link
Author

tgbugs commented Apr 18, 2021

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.

tgbugs added 5 commits May 4, 2021 19:15
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
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