Wednesday, May 28, 2008

labels, colors

Manipulate[
Graphics[{Point[u]}, PlotRange -> 2], {{u, {{-1, -1}, {1, 1}}},
Locator, Appearance -> Table[Style[Framed[label], color]],
LocatorAutoCreate -> True}, {label, {"1" -> 1, "2" -> 2},
ControlType -> PopupMenu}, {color, {Red -> "Red", Blue -> "Blue"},
ControlType -> PopupMenu}]

this gives an output of nodes (where you can alt+click for more) that have a label and color from a drop down menu. Next is to assign DIFFERENT labels and colors for the nodes. Perhaps an auto-numbering system would be good.

started with this:

Manipulate[
LocatorPane[Graphics[{White, Disk[]}],
Appearance -> Style[Framed[label], color]], {color, {Red -> "Red",
Blue -> "Blue"},
ControlType -> PopupMenu}, {label, {"1" -> 1, "2" -> 2},
ControlType -> PopupMenu}]

Tuesday, May 27, 2008

locators, points, appearance

LocatorPane[RandomReal[{-1, 1}, {10, 2}], Graphics[{White, Disk[]}],
Appearance -> Table[Style["####", Hue[h/10]], {h, 10}]]

For this input, where the "####" piece is, if you type ctrl+d a graphics editor comes up and you can actually draw what you want to be displayed in the output.


Manipulate[
LocatorPane[Graphics[{White, Disk[]}],
Appearance -> Style[Framed[x], color]], {color, {Red -> "Red",
Blue -> "Blue"}, ControlType -> PopupMenu}]