AykutSarac / jsoncrack.com

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML, CSV and more, into interactive graphs.
https://jsoncrack.com/
Other
30.5k stars 1.89k forks source link

Tree mode option while embedding into website #383

Closed Sabin-Adhikari closed 7 months ago

Sabin-Adhikari commented 8 months ago

Feature

Hi guys, I was not able to find a documentation on the view mode while using embed API I have the following js script:

let iframe = document.createElement('iframe')
        iframe.id = 'json-crack-iframe'
        iframe.style.border = 'none'
        iframe.height = '1000px'
        iframe.width = '100%'
        iframe.src = "https://jsoncrack.com/widget"
        getShadowRootElementByID('json-crack-container')?.appendChild(iframe)
        const json = JSON.stringify(this.ratingResPayload)
        const options = {
          theme: "light", // "light" or "dark"
          direction: "RIGHT", // "UP", "DOWN", "LEFT", "RIGHT"
        }
window?.addEventListener("message", (event) => {
            iframe.contentWindow?.postMessage({json,options}, "*");
        })

I would like to toggle between graph mode and tree mode like in the website. Is there an option that I can pass? Thanks in advance!

Alternative solutions or implementations

No response

Other context

No response

AykutSarac commented 7 months ago

Duplicate #384