Skip to content

Commit 0aa17db

Browse files
committed
[UI] Update models with cut off axes sizes on plot widgets with appropriate widget size
1 parent c14372a commit 0aa17db

3 files changed

Lines changed: 80 additions & 80 deletions

File tree

Sample Models/Social Science/Language Change.nlogox

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ end
239239
; Copyright 2007 Uri Wilensky.
240240
; See Info tab for full copyright and license.]]></code>
241241
<widgets>
242-
<view x="390" wrappingAllowedX="false" y="10" frameRate="30.0" minPycor="-45" height="368" showTickCounter="true" patchSize="4.0" fontSize="10" wrappingAllowedY="false" width="375" tickCounterLabel="ticks" maxPycor="45" updateMode="1" maxPxcor="45" minPxcor="-45"></view>
242+
<view x="390" wrappingAllowedX="false" y="10" frameRate="30.0" minPycor="-45" height="368" showTickCounter="true" patchSize="4.0" fontSize="10" wrappingAllowedY="false" width="368" tickCounterLabel="ticks" maxPycor="45" updateMode="1" maxPxcor="45" minPxcor="-45"></view>
243243
<button x="10" y="10" height="35" disableUntilTicks="false" forever="false" kind="Observer" width="95" display="setup">setup</button>
244244
<button x="10" y="220" height="35" disableUntilTicks="true" forever="false" kind="Observer" width="193" display="reset states">reset-nodes</button>
245245
<slider x="10" step="1" y="55" max="100" width="195" display="num-nodes" height="50" min="2" direction="Horizontal" default="100.0" variable="num-nodes"></slider>
@@ -255,7 +255,11 @@ end
255255
<choice type="string" value="threshold"></choice>
256256
<choice type="string" value="reward"></choice>
257257
</chooser>
258-
<note x="10" y="265" backgroundDark="0" fontSize="10" width="200" markdown="false" height="151" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">* threshold-val and sink state only
258+
<button x="225" y="90" height="35" disableUntilTicks="false" forever="true" kind="Observer" width="150">highlight</button>
259+
<button x="110" y="10" height="35" disableUntilTicks="false" forever="true" kind="Observer" width="95" display="layout">layout
260+
display</button>
261+
<button x="225" y="10" height="35" disableUntilTicks="true" forever="true" kind="Observer" width="150">go</button>
262+
<note x="10" y="265" backgroundDark="0" fontSize="10" width="200" markdown="false" height="155" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">* threshold-val and sink state only
259263
apply for "individual" and "threshold"
260264
updating algorithms
261265

@@ -265,19 +269,15 @@ built-in bias towards grammar 1
265269
* alpha only applies to the
266270
"reward" updating algorithm
267271
and when logistic? is on</note>
268-
<button x="225" y="90" height="35" disableUntilTicks="false" forever="true" kind="Observer" width="150">highlight</button>
269-
<button x="110" y="10" height="35" disableUntilTicks="false" forever="true" kind="Observer" width="95" display="layout">layout
270-
display</button>
271-
<output x="390" y="390" height="70" fontSize="14" width="375"></output>
272-
<button x="225" y="10" height="35" disableUntilTicks="true" forever="true" kind="Observer" width="150">go</button>
273-
<plot x="15" autoPlotX="true" yMax="1.0" autoPlotY="true" yAxis="State" y="435" xMin="0.0" height="127" legend="false" xMax="100.0" yMin="0.0" width="360" xAxis="Time" display="Mean state of language users in the network">
272+
<plot x="15" autoPlotX="true" yMax="1.0" autoPlotY="true" yAxis="State" y="430" xMin="0.0" height="150" legend="false" xMax="100.0" yMin="0.0" width="360" xAxis="Time" display="Mean state of language users in the network">
274273
<setup></setup>
275274
<update></update>
276275
<pen interval="1.0" mode="0" display="default" color="-16777216" legend="true">
277276
<setup></setup>
278277
<update>plot mean [state] of nodes</update>
279278
</pen>
280279
</plot>
280+
<output x="390" y="390" height="70" fontSize="14" width="375"></output>
281281
</widgets>
282282
<info><![CDATA[## WHAT IS IT?
283283

Sample Models/Social Science/Minority Game.nlogox

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,17 @@ end
168168
; See Info tab for full copyright and license.]]></code>
169169
<widgets>
170170
<view x="192" wrappingAllowedX="true" y="12" frameRate="30.0" minPycor="-17" height="325" showTickCounter="true" patchSize="9.17143" fontSize="10" wrappingAllowedY="true" width="325" tickCounterLabel="ticks" maxPycor="17" updateMode="1" maxPxcor="17" minPxcor="-17"></view>
171-
<plot x="9" autoPlotX="true" yMax="100.0" autoPlotY="true" yAxis="count" y="513" xMin="0.0" height="157" legend="false" xMax="1.0" yMin="0.0" width="248" xAxis="time" display="Number Picking Zero">
172-
<setup>set-plot-y-range 0 number</setup>
173-
<update></update>
174-
<pen interval="1.0" mode="0" display="number" color="-10899396" legend="true">
175-
<setup></setup>
176-
<update></update>
177-
</pen>
178-
</plot>
179-
<plot x="9" autoPlotX="true" yMax="1.0" autoPlotY="true" yAxis="score" y="349" xMin="0.0" height="157" legend="true" xMax="1.0" yMin="0.0" width="248" xAxis="time" display="Scores">
171+
<chooser x="11" y="278" height="60" variable="color-by" current="1" width="173" display="color-by">
172+
<choice type="string" value="choice"></choice>
173+
<choice type="string" value="success"></choice>
174+
</chooser>
175+
<monitor x="11" precision="3" y="214" height="60" fontSize="11" width="173" display="History">full-history</monitor>
176+
<button x="101" y="10" height="35" disableUntilTicks="true" forever="true" kind="Observer" width="82" display="go">go</button>
177+
<button x="11" y="10" height="35" disableUntilTicks="false" forever="false" kind="Observer" width="83" display="setup">setup</button>
178+
<slider x="11" step="1" y="160" max="10" width="173" display="strategies-per-agent" height="50" min="1" direction="Horizontal" default="5.0" variable="strategies-per-agent"></slider>
179+
<slider x="11" step="1" y="106" max="12" width="172" display="memory" height="50" min="1" direction="Horizontal" default="6.0" variable="memory"></slider>
180+
<slider x="11" step="2" y="52" max="1501" width="172" display="number" height="50" min="1" direction="Horizontal" default="501.0" variable="number"></slider>
181+
<plot x="9" autoPlotX="true" yMax="1.0" autoPlotY="true" yAxis="score" y="349" xMin="0.0" height="197" legend="true" xMax="1.0" yMin="0.0" width="249" xAxis="time" display="Scores">
180182
<setup></setup>
181183
<update></update>
182184
<pen interval="1.0" mode="0" display="max" color="-2674135" legend="true">
@@ -194,17 +196,15 @@ plot min-score</update>
194196
<update>plot avg-score</update>
195197
</pen>
196198
</plot>
197-
<chooser x="11" y="278" height="60" variable="color-by" current="1" width="173" display="color-by">
198-
<choice type="string" value="choice"></choice>
199-
<choice type="string" value="success"></choice>
200-
</chooser>
201-
<monitor x="11" precision="3" y="214" height="60" fontSize="11" width="173" display="History">full-history</monitor>
202-
<button x="101" y="10" height="35" disableUntilTicks="true" forever="true" kind="Observer" width="82" display="go">go</button>
203-
<button x="11" y="10" height="35" disableUntilTicks="false" forever="false" kind="Observer" width="83" display="setup">setup</button>
204-
<slider x="11" step="1" y="160" max="10" width="173" display="strategies-per-agent" height="50" min="1" direction="Horizontal" default="5.0" variable="strategies-per-agent"></slider>
205-
<slider x="11" step="1" y="106" max="12" width="172" display="memory" height="50" min="1" direction="Horizontal" default="6.0" variable="memory"></slider>
206-
<slider x="11" step="2" y="52" max="1501" width="172" display="number" height="50" min="1" direction="Horizontal" default="501.0" variable="number"></slider>
207-
<plot x="266" autoPlotX="true" yMax="0.05" autoPlotY="true" yAxis="success rate" y="512" xMin="0.0" height="157" legend="false" xMax="1.0" yMin="0.0" width="251" xAxis="time" display="Success rate">
199+
<plot x="267" autoPlotX="true" yMax="1.0" autoPlotY="true" yAxis="frequency" y="349" xMin="0.0" height="198" legend="false" xMax="1.0" yMin="0.0" width="250" xAxis="success" display="Success histogram">
200+
<setup>set-histogram-num-bars 25</setup>
201+
<update></update>
202+
<pen interval="0.02" mode="1" display="default" color="-16777216" legend="false">
203+
<setup></setup>
204+
<update>if (ticks != 0) [ histogram [score / ticks] of turtles ]</update>
205+
</pen>
206+
</plot>
207+
<plot x="268" autoPlotX="true" yMax="0.05" autoPlotY="true" yAxis="success rate" y="557" xMin="0.0" height="202" legend="false" xMax="1.0" yMin="0.0" width="252" xAxis="time" display="Success rate">
208208
<setup></setup>
209209
<update></update>
210210
<pen interval="1.0" mode="0" display="max" color="-2674135" legend="true">
@@ -222,12 +222,12 @@ if (ticks != 0)[ plot min-score / ticks ]</update>
222222
<update>if (ticks != 0)[ plot avg-score / ticks ]</update>
223223
</pen>
224224
</plot>
225-
<plot x="267" autoPlotX="true" yMax="1.0" autoPlotY="true" yAxis="frequency" y="349" xMin="0.0" height="157" legend="false" xMax="1.0" yMin="0.0" width="250" xAxis="success" display="Success histogram">
226-
<setup>set-histogram-num-bars 25</setup>
225+
<plot x="10" autoPlotX="true" yMax="100.0" autoPlotY="true" yAxis="count" y="557" xMin="0.0" height="203" legend="false" xMax="1.0" yMin="0.0" width="249" xAxis="time" display="Number Picking Zero">
226+
<setup>set-plot-y-range 0 number</setup>
227227
<update></update>
228-
<pen interval="0.02" mode="1" display="default" color="-16777216" legend="false">
228+
<pen interval="1.0" mode="0" display="number" color="-10899396" legend="true">
229229
<setup></setup>
230-
<update>if (ticks != 0) [ histogram [score / ticks] of turtles ]</update>
230+
<update></update>
231231
</pen>
232232
</plot>
233233
</widgets>

Sample Models/Social Science/Scatter.nlogox

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,54 @@ end
165165
<widgets>
166166
<view x="267" wrappingAllowedX="false" y="10" frameRate="30.0" minPycor="-23" height="427" showTickCounter="true" patchSize="9.0" fontSize="10" wrappingAllowedY="false" width="427" tickCounterLabel="ticks" maxPycor="23" updateMode="1" maxPxcor="23" minPxcor="-23"></view>
167167
<button x="11" y="9" height="41" disableUntilTicks="false" forever="false" kind="Observer" width="123">setup</button>
168-
<plot x="11" autoPlotX="true" yMax="1080.0" autoPlotY="true" yAxis="total distance moved" y="366" xMin="0.0" height="193" legend="false" xMax="5.0" yMin="0.0" width="249" xAxis="circle number" display="Mobility of Scatterers">
168+
<button x="143" y="9" height="41" disableUntilTicks="true" forever="true" kind="Observer" width="117">go</button>
169+
<slider x="11" step="0.1" y="115" max="2" width="249" display="step-size" height="50" min="0.1" direction="Horizontal" default="1.0" variable="step-size"></slider>
170+
<slider x="11" step="0.5" y="59" max="20" width="249" display="initial-radius" height="50" min="0" direction="Horizontal" default="10.5" variable="initial-radius"></slider>
171+
<slider x="703" step="0.1" y="10" max="5" width="197" display="too-close" height="50" min="0.1" direction="Horizontal" default="1.5" variable="too-close"></slider>
172+
<slider x="703" step="0.1" y="68" max="5" width="197" display="too-far" height="50" min="0.1" direction="Horizontal" default="2.0" variable="too-far"></slider>
173+
<note x="704" y="130" backgroundDark="0" fontSize="11" width="197" markdown="false" height="18" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">Violet</note>
174+
<slider x="704" step="1" y="148" max="200" width="197" display="num-random-min" height="50" min="0" direction="Horizontal" default="100.0" variable="num-random-min"></slider>
175+
<slider x="704" step="1" y="480" max="200" width="197" display="num-random" height="50" min="0" direction="Horizontal" default="0.0" variable="num-random"></slider>
176+
<slider x="704" step="1" y="395" max="200" width="197" display="num-random-away" height="50" min="0" direction="Horizontal" default="0.0" variable="num-random-away"></slider>
177+
<note x="704" y="462" backgroundDark="0" fontSize="11" width="197" markdown="false" height="18" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">Brown</note>
178+
<note x="704" y="377" backgroundDark="0" fontSize="11" width="197" markdown="false" height="18" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">Pink</note>
179+
<note x="704" y="294" backgroundDark="0" fontSize="11" width="197" markdown="false" height="18" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">Orange</note>
180+
<slider x="704" step="1" y="310" max="200" width="197" display="num-open-min-max" height="50" min="0" direction="Horizontal" default="50.0" variable="num-open-min-max"></slider>
181+
<note x="704" y="213" backgroundDark="0" fontSize="11" width="197" markdown="false" height="18" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">Blue</note>
182+
<slider x="704" step="1" y="230" max="200" width="197" display="num-open-min" height="50" min="0" direction="Horizontal" default="0.0" variable="num-open-min"></slider>
183+
<plot x="13" autoPlotX="true" yMax="100.0" autoPlotY="true" yAxis="average distance" y="172" xMin="0.0" height="238" legend="false" xMax="100.0" yMin="0.0" width="250" xAxis="time ticks" display="Average Distance from Origin">
184+
<setup>set-plot-x-range 0 30
185+
set-plot-y-range 0 5 ; set initial y range to half of height</setup>
186+
<update><![CDATA[foreach [ "random-min" "random-away" "random" "open-min" "open-min-max" ] [ r ->
187+
;; if there are any turtles with turtle-rule as their rule,
188+
;; plot the mean distance from the origin
189+
if any? turtles with [ rule = r ] [
190+
set-current-plot-pen r
191+
plot mean [ distance origin ] of turtles with [ rule = r ]
192+
]
193+
]]]></update>
194+
<pen interval="1.0" mode="0" display="random-min" color="-8630108" legend="true">
195+
<setup></setup>
196+
<update></update>
197+
</pen>
198+
<pen interval="1.0" mode="0" display="random-away" color="-2064490" legend="true">
199+
<setup></setup>
200+
<update></update>
201+
</pen>
202+
<pen interval="1.0" mode="0" display="random" color="-6459832" legend="true">
203+
<setup></setup>
204+
<update></update>
205+
</pen>
206+
<pen interval="1.0" mode="0" display="open-min" color="-13345367" legend="true">
207+
<setup></setup>
208+
<update></update>
209+
</pen>
210+
<pen interval="1.0" mode="0" display="open-min-max" color="-955883" legend="true">
211+
<setup></setup>
212+
<update></update>
213+
</pen>
214+
</plot>
215+
<plot x="13" autoPlotX="true" yMax="1080.0" autoPlotY="true" yAxis="total distance moved" y="415" xMin="0.0" height="239" legend="false" xMax="5.0" yMin="0.0" width="250" xAxis="circle number" display="Mobility of Scatterers">
169216
<setup>set-plot-x-range 0 5
170217
set-plot-y-range 0 (max-pxcor)</setup>
171218
<update><![CDATA[;; a histogram of the total distance traveled by turtles,
@@ -212,53 +259,6 @@ if (any? turtles with [(distancexy 0 0) > (world-width - 1) / 2])
212259
<update></update>
213260
</pen>
214261
</plot>
215-
<button x="143" y="9" height="41" disableUntilTicks="true" forever="true" kind="Observer" width="117">go</button>
216-
<slider x="11" step="0.1" y="115" max="2" width="249" display="step-size" height="50" min="0.1" direction="Horizontal" default="1.0" variable="step-size"></slider>
217-
<plot x="11" autoPlotX="true" yMax="100.0" autoPlotY="true" yAxis="average distance" y="173" xMin="0.0" height="186" legend="false" xMax="100.0" yMin="0.0" width="249" xAxis="time ticks" display="Average Distance from Origin">
218-
<setup>set-plot-x-range 0 30
219-
set-plot-y-range 0 5 ; set initial y range to half of height</setup>
220-
<update><![CDATA[foreach [ "random-min" "random-away" "random" "open-min" "open-min-max" ] [ r ->
221-
;; if there are any turtles with turtle-rule as their rule,
222-
;; plot the mean distance from the origin
223-
if any? turtles with [ rule = r ] [
224-
set-current-plot-pen r
225-
plot mean [ distance origin ] of turtles with [ rule = r ]
226-
]
227-
]]]></update>
228-
<pen interval="1.0" mode="0" display="random-min" color="-8630108" legend="true">
229-
<setup></setup>
230-
<update></update>
231-
</pen>
232-
<pen interval="1.0" mode="0" display="random-away" color="-2064490" legend="true">
233-
<setup></setup>
234-
<update></update>
235-
</pen>
236-
<pen interval="1.0" mode="0" display="random" color="-6459832" legend="true">
237-
<setup></setup>
238-
<update></update>
239-
</pen>
240-
<pen interval="1.0" mode="0" display="open-min" color="-13345367" legend="true">
241-
<setup></setup>
242-
<update></update>
243-
</pen>
244-
<pen interval="1.0" mode="0" display="open-min-max" color="-955883" legend="true">
245-
<setup></setup>
246-
<update></update>
247-
</pen>
248-
</plot>
249-
<slider x="11" step="0.5" y="59" max="20" width="249" display="initial-radius" height="50" min="0" direction="Horizontal" default="10.5" variable="initial-radius"></slider>
250-
<slider x="703" step="0.1" y="10" max="5" width="197" display="too-close" height="50" min="0.1" direction="Horizontal" default="1.5" variable="too-close"></slider>
251-
<slider x="703" step="0.1" y="68" max="5" width="197" display="too-far" height="50" min="0.1" direction="Horizontal" default="2.0" variable="too-far"></slider>
252-
<note x="704" y="130" backgroundDark="0" fontSize="11" width="197" markdown="false" height="18" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">Violet</note>
253-
<slider x="704" step="1" y="148" max="200" width="197" display="num-random-min" height="50" min="0" direction="Horizontal" default="100.0" variable="num-random-min"></slider>
254-
<slider x="704" step="1" y="480" max="200" width="197" display="num-random" height="50" min="0" direction="Horizontal" default="0.0" variable="num-random"></slider>
255-
<slider x="704" step="1" y="395" max="200" width="197" display="num-random-away" height="50" min="0" direction="Horizontal" default="0.0" variable="num-random-away"></slider>
256-
<note x="704" y="462" backgroundDark="0" fontSize="11" width="197" markdown="false" height="18" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">Brown</note>
257-
<note x="704" y="377" backgroundDark="0" fontSize="11" width="197" markdown="false" height="18" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">Pink</note>
258-
<note x="704" y="294" backgroundDark="0" fontSize="11" width="197" markdown="false" height="18" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">Orange</note>
259-
<slider x="704" step="1" y="310" max="200" width="197" display="num-open-min-max" height="50" min="0" direction="Horizontal" default="50.0" variable="num-open-min-max"></slider>
260-
<note x="704" y="213" backgroundDark="0" fontSize="11" width="197" markdown="false" height="18" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">Blue</note>
261-
<slider x="704" step="1" y="230" max="200" width="197" display="num-open-min" height="50" min="0" direction="Horizontal" default="0.0" variable="num-open-min"></slider>
262262
</widgets>
263263
<info><![CDATA[## WHAT IS IT?
264264

0 commit comments

Comments
 (0)