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

Added static option to HTML component #776

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

arvoelke
Copy link
Contributor

@arvoelke arvoelke commented Jun 14, 2016

This is useful if you are serving something like an iframe containing javascript, where you don't want it to update every simulation timestep (i.e. served once every time the components are created). Tested manually with the following code:

def function(t): return None
function._nengo_html_ = '<iframe src="http://localhost:%d/" />' % port
function._nengo_static_ = True
nengo.Node(function, size_in=0, label="")

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @tcstewar and @Seanny123 to be potential reviewers

@Seanny123
Copy link
Collaborator

Practically, do you have an example of how you would use this usefully? Just might be useful to point people to later.

@arvoelke
Copy link
Contributor Author

I may have something nice to point to in the very near future, but for now just imagine localhost:port is some web application that is communicating with the model through another channel (via some thread inside the model).

@Seanny123
Copy link
Collaborator

LGTM.

@tcstewar
Copy link
Collaborator

Nice. I'm fine with _html_static_ for now, but I also wonder whether another option like letting people optionally return a dictionary would work:

_html_nengo_ = dict(html='<h1>title</h1>', static=True)

@Seanny123
Copy link
Collaborator

@tcstewar make an issue after the merge?

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

Successfully merging this pull request may close these issues.

4 participants