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

Using graphviz in client side #64

Closed
silviodc opened this issue Jun 7, 2017 · 1 comment
Closed

Using graphviz in client side #64

silviodc opened this issue Jun 7, 2017 · 1 comment

Comments

@silviodc
Copy link

silviodc commented Jun 7, 2017

Hi @JanWielemaker

I'm trying to develop a html example which render the result of a pengine request by using graphviz 🌵
See more on this pull request: #63
So, i saw you already developed some javascript to do it.
However, i'm getting troubles to integrate this example with what you did since i'm not soo expert on javascript.
Could you please help me in howto use what you did here: answer.js in my html script?

Best Regards,
Silvio

@JanWielemaker
Copy link
Member

If I understand you correctly you basically want to reuse a minimal part of SWISH without making it look like SWISH, no? Not sure how easy that is. It might be worth a try and might require some work to relax dependencies inside swish. I'm happy to give pointers and/or merge pull requests that achieve this.

SWISH's answer handling is in runner.js, handleSuccess(), which eventually calls the method
renderAnswer. In the end that boils down to creating a div with class answer and calling

$(div).prologAnswer(answer);

It might be that simple, but I'm not entirely convinced.

P.s. This isn't a pull request on SWISH. I'm happy that this is discussed here, but please turn this into an issue rather than a pull request. I'll close the pull request.

P.s. You can quite easily make SWISH not look like SWISH. Just create a notebook with a single HTML cell. There you can define your entire application, using all SWISH' infrastructure. The only SWISH part visible is the top navigation bar and the hamburger menu. You simply disable these using a CSS rule in your HTML cell.

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

2 participants