caldwell / renderjson

Render JSON into collapsible HTML
http://caldwell.github.io/renderjson
418 stars 91 forks source link

truncation for too many items #22

Open Almenon opened 7 years ago

Almenon commented 7 years ago

It would be nice to have truncation paramater in case there are too many items. set_show_to_level is useful in this regard, but it doesn't cover cases in which there are too many items in the level that you normally want shown.

Just something like this would work:

............................. .............................. 154 items truncated +

Alternatively, you could go with the approach used in the chrome developer tools and summarize the items like so:

[ 0-100 ] + [ 100-200 ] + [ 200-300 ] + etc.... increasing the scale with the number of items.

Almenon commented 6 years ago

I tried developing this for a tiny bit. Got it sort-of working but the tabs are wonky.

see https://github.com/Almenon/renderjson/commit/cc0b12ac251d9826e289e795aa831508dbd1bdc1

DirkReiners commented 5 years ago

+1 This would be very useful! We have queries that can return between 1 and 100000 entries, so some control would be great!