react-json-view icon indicating copy to clipboard operation
react-json-view copied to clipboard

[Feature Request] Replace `ellipsis` with custom value or single line preview of data

Open lokers opened this issue 6 years ago • 2 comments

Similar to angular-json-tree library, and the output we see all the time in Chrome console, I would like to be able to replace the three expandable ellipsis with custom value, or ideally with preview of the nested data. Perhaps it's already possible? (I didn't find way around)

Here's example, you see signle line of JSON object before expanding... https://awendland.github.io/angular-json-tree/

screenshot 2019-01-03 at 16 05 58

The method getEllipsis() responsible for rendering ellipsis is in src/js/components/DataTypes/Object.js

Also, if I create PR with such functionality, how quickly you normally accept it and merge?

lokers avatar Jan 03 '19 15:01 lokers

Any updates on this?

assadtony avatar Jun 08 '20 20:06 assadtony

I added some code fragments to support this feature. Just set displayAbstract prop ( default is false). Then it looks like chrome devtool Console and Network data preview.

I won't create a pull request to this repo. Because I didn't test this enough. I'll publish it to my private registry. https://github.com/wangpeng1994/react-json-view/commit/d52dfc2659d0b17db3630febe061fe3e5b84c086

image

image

wangpeng1994 avatar Jun 15 '21 08:06 wangpeng1994