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

Support for ?presentation query param #36

Merged
merged 3 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Example: https://dreampuf.github.io/GraphvizOnline/?url=https://gist.githubuserc

Using https://gist.github.com/ allows you to share and version your graph definitions.

## Presentation mode

If you would like to display just the graph and not the graph input, you can add a `?presentation` query param. This can be helpful when generating links with the graph already prefilled.

# How to implement this

- [viz.js](https://github.com/mdaines/viz.js) This repo has compile graphviz(C) to javascript via [emscripten](https://github.com/kripken/emscripten).
Expand Down
16 changes: 16 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
margin: 0 0;
}

body.presentation #editor {
display: none;
}

body.presentation #options {
left: 0;
}

body.presentation #review {
left: 0;
}

#editor {
margin: 0;
position: absolute;
Expand Down Expand Up @@ -497,6 +509,10 @@
}
}

if (params.has("presentation")) {
document.body.classList.add("presentation");
}

if (params.has('raw')) {
editor.getSession().setValue(params.get('raw'));
renderGraph();
Expand Down
Loading