alenaksu / json-viewer Goto Github PK
View Code? Open in Web Editor NEWWeb Component to visualize JSON data in a tree view
Home Page: https://alenaksu.github.io/json-viewer/
License: MIT License
Web Component to visualize JSON data in a tree view
Home Page: https://alenaksu.github.io/json-viewer/
License: MIT License
Great component. I updated to the latest. It seems that npm only publishes 3 files now -- no js files.
I would like to request a CSS variable be added for padding to the wrapping shadow DOM element (ul tag), so one can add a little space to the content, especially when it's long and needs to scroll. Thanks!
The Readme has a badge, which indicates, that this project has an MIT license, but the license does not exist and the link in the README therefore returns a 404 Not found
.
Is this intentionally, or should I make a pull request which readds the MIT License file?
Even though my element is deeply embedded in my html page structure, when I search for a value using viewer.search() it scrolls the whole document.body not the viewer element causing vertical page movement.
Similarly when initially loading the viewer with data it scrolls document.body around 20 pixels to the left.
Hi,
I wanted to let you know that I've integrated your powerfull package as Blazor Component.
https://github.com/Texnomic/JsonViewer
Thanks for your work!
I am trying to display very large numbers but unfortunately they are getting rounded and cut by JavaScripts Number type..
any chance zu support BigNumber or a similar Type?
https://dev.to/fvictorio/a-comparison-of-bignumber-libraries-in-javascript-2gc5
Hi, first I'd like yo thank you for a great piece of code.
Some json objects may have properties that contain html markup, i.e. a link to a page, like in the address property below.
{
"widget": {
"debug": "on",
"window": {
"title": "a window title",
"address": "Goto",
"name": "main_window",
"width": 500,
"height": 500
}
}
It would be nice, if the viewer can have a special csspart to render the markup as is .
Thanks
Michel
[email protected]
Describe the bug
After 1.0.0 json view is not rendered in browser with following error.
Uncaught SyntaxError: Unexpected token 'export' (at JsonViewer.js:45:94)
Error message indicates that it is an ESM module and i tried to add type="module"
attribute to script tag but it did not work too. I couldn't find anyhing about ESM change in releases page and readme.
Then i tried to use index.js file from demo and it worked with type="module
attribute.
I think demo is using a custom file. It would be better to use latest distributed file in demo to detect issues early.
To Reproduce
Steps to reproduce the behavior:
Link to Minimal Reproducible Example
<json-viewer>
{"widget":{"debug":"on","window":{"title":"Sample Konfabulator Widget","name":"main_window","width":500,"height":500},"image":{"src":"Images/Sun.png","name":"sun1","hOffset":250,"vOffset":250,"alignment":"center"},"text":{"data":"Click Here","size":36,"style":"bold","name":"text1","hOffset":250,"vOffset":100,"alignment":"center","onMouseUp":"sun1.opacity = (sun1.opacity / 100) * 90;"}}}
</json-viewer>
<!-- <script src="https://unpkg.com/@alenaksu/[email protected]/dist/index.js"></script> -->
<!-- <script type="module" src="https://alenaksu.github.io/json-viewer/index.js"></script> -->
<!-- <script type="module" src="https://unpkg.com/@alenaksu/[email protected]/dist/JsonViewer.js"></script> -->
Expected behavior
It should render tree view
When we're not using the <json-viewer>
with any content, and rather just using the data
attribute to dynamically update data. It throws the following error:
<json-viewer class="p-4" data={props.response?.data}></json-viewer>
In this case, the error is thrown.
I'm using this in a SolidJS app where the data
attribute gets updated throughout the app's usage.
Should not throw an error in this case and should allow to just use of the data
attribute for rendering.
Hi, can I use this component in polymer 3?
I've problem when import this component in my polymer 3 project.
Module not found: Error: Can't resolve '@alenaksu/json-viewer'
Best Regards,
Reja
I tried the example, however the component just displays “null”.
I referenced the index.js and css files from the build folder, are those the wrong files?
Excellent component!
I find that if I do a dynamic import of your library, and while the import is downloading, set data (before the custom element has had the chance to get registered), the data is lost after the component is initiated.
You might find this document helpful, search for "_upgradeProperty()"
Hi there, thanks for this great component!
I'm running into an issue where sometimes my nested dates are showing as empty objects. I can't seem to pin down exactly why this is happening but will try and take another look at the source code.
For now I'm working around this by checking my structures for dates and formatting them ahead of time.
Thanks again (comparison with JSON.stringify
below)
Is your feature request related to a problem? Please describe.
my array of json has address_1
, address_2
, address_3
it's a pain to pass a filter string to get all 3
Describe the solution you'd like
ideally I could filter('addr') and any key/value pair with those 4 consecutive letters would remain while everything else gets hidden.
Describe alternatives you've considered
right now i just do **.entire_field_name
Additional context
Might need to put this functionality behind an option like filterMode(...) which allows users to keep the exact
(default), or fuzzy
(generous filter matching both keys and values with partial strings)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.