-
Notifications
You must be signed in to change notification settings - Fork 44
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
Widgets #117
Conversation
Basically, I plan on not merging this until it has been merged into the two dependent repositories (NetLogo's |
I added issue #133 so we can address your concerns later. I also updated it to use the latest version of tortoise (that doesn't pass tests due to a random push to headless unrelated to this), so you can merge this and put it out on linode if you like. |
@qiemem, please review the changes here to TortoiseJS. |
@frankduncan, I did some significant refactoring of your code and fixed a bug in Notable themes of my refactoring:
|
LGTM |
Beep, beep, @qiemem's a Jeep. |
google.setOnLoadCallback(@drawPlot.bind(this)) | ||
|
||
plot: (y) -> | ||
if @xpoint % 20 == 0 |
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.
This looks like its only plotting every 20 points, which seems wrong.
Alright, should have everything accounted for at this point. @qiemem to review one final time. The dependency on the tortoise jar will relieve the NIL buttons and monitors |
} | ||
|
||
trait CompilesCommands extends DoesCompilation { | ||
override protected val defaultJS = "function() {}" |
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.
I don't think this is the correct default. The results of compileCommands
are wrapped in a lambda already (see https://github.com/NetLogo/Galapagos/pull/117/files#diff-ca1195ec11f0f02b655a2a4238b02194R53), so you end up with function() { function() {} }
, which isn't valid javascript. Rather, I think this should just be blank.
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.
This is small stuff.... Just change it, yourself.
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.
I wanted to make sure I was correct about the fix.
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.
Try it.
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.
I did. It works. But I wanted to make sure it matched Frank's intention. Also, I wanted to put findings of review here, even if I'm going to fix them...
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.
Looks correct to me!
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.
Killer thanks.
Allos "save as html" to actually work.
window.addEventListener('load', initPage); | ||
if(useGoogleGraph) { | ||
session.graph = GoogleGraph | ||
Grapher.graph = GoogleGraph |
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.
Setting useGoogleGraph
to true
, I get Grapher is not defined
here. @frankduncan, any ideas?
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.
Okay, you can delete that line, but graphing definitely doesn't work by just doing that flag...
Label marks the number input. Also, this consequently supports people binding together an arbitrary number of widgets for custom sliders.
@qiemem, it looks to me like it's mostly ready to merge. One thing that I noticed and found curious is that, while most sliders revert to their original values when loaded from "save as HTML", the speed slider does not. Is this intentional? |
That is not intentional. Good catch. |
Would it be better if all widget states were saved as displayed when a person saves? |
I was wondering about that, myself. It's not really clear. On the one hand, that's what NetLogo does (except for with the speed slider). On the other hand, I find that behavior really strange, and I think it runs counter to the purpose of the "Save as HTML" page. I don't feel totally strongly in one direction in another. |
In general, "save as html" is "capture what I'm looking at exactly as it is". I'm leaning towards saving state of everything, as that's more flexible, but I could easily be persuaded otherwise. |
I disagree. I see "save as HTML" as "take my existing NetLogo model and turn it into an HTML page"; the settings for how the sliders are "supposed to be" set is already in the |
I meant "Save as HTML" the browser feature rather than our feature, but I suppose it's probably not commonly used so people won't necessarily have expectations. Saving the state of the widgets makes the feature more powerful and flexible, at the risk of potentially going against expectations. The problem is, without saving the states of widgets, there is no way for a user to be able to save a state without going back to the original model (without digging into the massive source file that results of course). That means, e.g., Concord as to come to us every time they want to change the default in their model. Though I suppose they'll hopefully just be able to generate models themselves at this point... |
I was persuaded on this by the idea that we shouldn't confuse people by having a kind of, sort of editor. It should conceptually be a model viewer, just as applets are. |
|
||
/* | ||
// If the HTML was saved in the non-default state, correct it. |
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.
@frankduncan What's up with all this commented out stuff? Can it be deleted?
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.
Huh. Maybe I was keeping it as a reference? It looks like I did duplicate it above, but for some reason didn't actually delete the commented out stuff. So I'm guessing it can be deleted with prejudice
Alright, everything looks good to me. Any objections before I merge this? |
This is desktop NetLogo's behavior. See Virus for example
Alright, I'm merging. Further problems should become issues. |
Add basic widgets to create standalone
No description provided.