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

[BUG]: View mode toggle #384

Open
Sabin-Adhikari opened this issue Jan 29, 2024 · 1 comment · May be fixed by #395
Open

[BUG]: View mode toggle #384

Sabin-Adhikari opened this issue Jan 29, 2024 · 1 comment · May be fixed by #395
Assignees
Labels
bug Something isn't working 🙋🏻‍♂️help wanted Extra attention is needed

Comments

@Sabin-Adhikari
Copy link

Sabin-Adhikari commented Jan 29, 2024

Issue description

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!

Media & Screenshots

No response

Operating system

  • OS: [e.g. iOS]:

  • Browser [e.g. chrome, safari]:

  • Any other details...

Priority this issue should have

Medium (slightly annoying)

@Sabin-Adhikari Sabin-Adhikari added the bug Something isn't working label Jan 29, 2024
@AykutSarac
Copy link
Owner

This currently not supported but if anyone is down to open a PR I can review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🙋🏻‍♂️help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants