-
Notifications
You must be signed in to change notification settings - Fork 38
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
Value legend #565
Value legend #565
Conversation
The modal dialogue for changing the labels does not work as expected. |
// fill up an array with temporary labels | ||
for(i=0; i<this.n_lines; i++){ | ||
if(this.legend_labels[i] === undefined){ | ||
this.legend_labels[i] = "label_".concat(String(i)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick style question: is there a preference to do "label_".concat(String(i))
rather than "label_" + i
? I find the latter clearer, but it's just what I'm used to.
Current status:
|
this.div.appendChild(this.legend); | ||
|
||
this.legend_labels = args.legend_labels || []; | ||
console.log(this.legend_labels); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extraneous console.log
Looking good... one small issue: If you open up the plot with N dimensions, show the legend, and then change the number of dimensions to N-1, it doesn't eliminate that from the legend. |
if (this.legend_labels.length !== this.n_lines) { | ||
// fill up the array with temporary labels | ||
for (var i=this.legend_labels.length; i<this.n_lines; i++) { | ||
this.legend_labels[i] = "label_" + i; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the defaults be "0, 1, 2, ..." rather than "label_0, label_1, label_2, ..."?
The changing dimensions problem should be fixed now. |
Nice, that seems to work... but here's another bug for you. :)
import nengo
model = nengo.Network()
with model:
stim = nengo.Node([0])
a = nengo.Ensemble(n_neurons=50, dimensions=1)
nengo.Connection(stim, a[0])
When the legend re-appears, it will have 5 items on it, rather than 1. |
@tcstewar fixed the bug (: |
Looks good to me! Thanks for all the work on this! |
Added labels to the value plot and the ability to edit them. This is an intermediary step to allowing the basal-ganglia to have it's own specialised plot.