Skip to content

Added static option to HTML component#776

Open
arvoelke wants to merge 1 commit into
masterfrom
static-html
Open

Added static option to HTML component#776
arvoelke wants to merge 1 commit into
masterfrom
static-html

Conversation

@arvoelke
Copy link
Copy Markdown
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
Copy Markdown

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

@Seanny123
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator

LGTM.

@tcstewar
Copy link
Copy Markdown
Contributor

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
Copy Markdown
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