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

Why render a blank #1

Open
ghost opened this issue Aug 14, 2020 · 5 comments
Open

Why render a blank #1

ghost opened this issue Aug 14, 2020 · 5 comments

Comments

@ghost
Copy link

ghost commented Aug 14, 2020

Hi, I operate according to the document, but the rendering result is really blank. I took a look at the document of markmap lib. The first step is to get the data and the second step is to render. However, the rendering relies on DOM elements. I don't know how to solve this problem. Do you encounter such a problem?

<svg class="markmap-svg">{"t":"heading","d":1,"v":"root","c":[{"t":"heading","d":2,"v":"child1","c":[{"t":"list_item","d":3,"v":"child3"}]},{"t":"heading","d":2,"v":"child2","c":[{"t":"list_item","d":3,"v":"child3"}]}]}</svg>
@deiv
Copy link
Owner

deiv commented Aug 14, 2020

Maybe you lack the transform:

<script src="https://cdn.jsdelivr.net/npm/d3@5"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/browser/view.min.js"></script>
<script>
    const mindmaps = document.querySelectorAll('.markmap-svg');

    for(const mindmap of mindmaps) {
        markmap.markmap(mindmap, JSON.parse(mindmap.innerHTML));
    }
</script>

@ghost
Copy link
Author

ghost commented Aug 14, 2020

Thank you very much for your reply. I use Vue framework. I try to solve it according to your instructions. Unfortunately, I don't know how to solve it. Should I write a markdown it rendering rule?

@ghost
Copy link
Author

ghost commented Aug 14, 2020

Do you know stackeditor? Stackeeditor is a markdown editor. I want to expand stackedit to realize mind map. However, since stackeeditor is written based on Vue, the document instance writing method is invalid

@deiv
Copy link
Owner

deiv commented Aug 15, 2020

It runs as javascript in the browser...

Vue, I think is a javascript framework, so it runs in a browser. If it runs in a browser, you have to have the document instance.

@ghost
Copy link
Author

ghost commented Aug 17, 2020

think you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant