Prev: Automatic update of variables
Next: Excel Data Managing
From: Arturas Acus on 13 Jun 2010 18:53 Dear group, I have phase space points ListPointPlot3D[data]. Clicking on point I want the solution, which represents that point to appear. I can achieve this simply by replacing each point by PopupWindow[point, myMakeGraphics[point]] construction, where myMakeGraphics generates this graphics. Thought this approach works, it tries to generate all required graphics immediatelly, and then hides them into ListPointPlot3D output. This take much time and memory. How can I force the graphics to be generated only after pushing Shift+Enter in the appeared popup window? I want the popup window with myMakeGraphics[point] appear, then pressing shift+enter the graphics to be generated in the same popup notebook. So far I was able to generate graphics this way only in Messages notebook :). Sincerely, Arturas Acus
From: John Fultz on 15 Jun 2010 02:29 Here's the beginnings of some code which does what you're looking for. The critical insights are to use Button[] instead of PopupWindow[] (Button holds its second argument), and to use DynamicModule[] to make guarantee that the function you use in Button[] is properly initialized. ListPointPlot3D[ Tooltip[Table[{RandomReal[], RandomReal[], RandomReal[]}, {50}]], PlotStyle -> {PointSize[.02]}] DynamicModule[{myMakeGraphics}, % /. Tooltip[arg_, ___] :> Button[arg, myMakeGraphics[arg]], Initialization :> {myMakeGraphics[Point[{a_, b_, c_}]] :== CreateDocument[Plot[a Sin[b x^c], {x, 0, 2 \[Pi]}], WindowSize -> Fit, WindowElements -> {}]}] Sincerely, John Fultz jfultz(a)wolfram.com User Interface Group Wolfram Research, Inc. On Sun, 13 Jun 2010 18:53:10 -0400 (EDT), Arturas Acus wrote: > > Dear group, > > I have phase space points ListPointPlot3D[data]. > Clicking on point I want the solution, which represents that point to > appear. > > I can achieve this simply by replacing each point by > PopupWindow[point, myMakeGraphics[point]] > construction, where myMakeGraphics generates this graphics. > Thought this approach works, it tries to generate all required graphics > immediatelly, and then hides them into ListPointPlot3D output. > > This take much time and memory. How can I force the graphics to be > generated only after pushing Shift+Enter in the appeared popup window? > > I want the popup window with myMakeGraphics[point] appear, then pressing > shift+enter the graphics to be generated in the same popup notebook. > > So far I was able to generate graphics this way only in Messages notebook > :). > > Sincerely, Arturas Acus
From: Arturas Acus on 15 Jun 2010 02:29 Thank You for this nice solution. By the way, I managed to achieve similar rezult putting myMakeGraphics[] inside Block[]. Calling ListPointPlot3D inside Block[] and using the same PopupWindow construction, myMakeGraphics is supressed, so graphic are not actually generated. Then click on the point generates it in PopupWindow. On Mon, 14 Jun 2010, John Fultz wrote: > Here's the beginnings of some code which does what you're looking for. The > critical insights are to use Button[] instead of PopupWindow[] (Button holds its > second argument), and to use DynamicModule[] to make guarantee that the function > you use in Button[] is properly initialized. > > ListPointPlot3D[ > Tooltip[Table[{RandomReal[], RandomReal[], RandomReal[]}, {50}]], > PlotStyle -> {PointSize[.02]}] > > DynamicModule[{myMakeGraphics}, > % /. Tooltip[arg_, ___] :> Button[arg, myMakeGraphics[arg]], > Initialization :> {myMakeGraphics[Point[{a_, b_, c_}]] := > CreateDocument[Plot[a Sin[b x^c], {x, 0, 2 \[Pi]}], > WindowSize -> Fit, WindowElements -> {}]}] > > Sincerely, > > John Fultz > jfultz(a)wolfram.com > User Interface Group > Wolfram Research, Inc. > > > On Sun, 13 Jun 2010 18:53:10 -0400 (EDT), Arturas Acus wrote: >> >> Dear group, >> >> I have phase space points ListPointPlot3D[data]. >> Clicking on point I want the solution, which represents that point to >> appear. >> >> I can achieve this simply by replacing each point by >> PopupWindow[point, myMakeGraphics[point]] >> construction, where myMakeGraphics generates this graphics. >> Thought this approach works, it tries to generate all required graphics >> immediatelly, and then hides them into ListPointPlot3D output. >> >> This take much time and memory. How can I force the graphics to be >> generated only after pushing Shift+Enter in the appeared popup window? >> >> I want the popup window with myMakeGraphics[point] appear, then pressing >> shift+enter the graphics to be generated in the same popup notebook. >> >> So far I was able to generate graphics this way only in Messages notebook >> :). >> >> Sincerely, Arturas Acus > > > >
|
Pages: 1 Prev: Automatic update of variables Next: Excel Data Managing |