Tag Info

Hot answers tagged

11

I believe you want "FrontFaceColor" which can be found as a specification in this list: Graphics[{FaceForm[RGBColor[2/3, 1/3, 2/3]], EdgeForm[Black], Dynamic[{If[CurrentValue["MouseOver"], Darker @ CurrentValue["FrontFaceColor"]], Disk[]}]}] You may also find "FrontFaceOpacity" of use. Simply guessing I found that "BackFaceColor" is also ...


11

Just like Albert I recommend using the second argument of Dynamic. Furthermore I recommend that you embrace the first A in AJAX, which stands for "asynchronous", so the kernel isn't busy while it collects the data (this might be why some change events are lost with your code). You can see how well the second argument of Dynamic works with this example: ...


9

I think the standard way to do this is to use the second argument of Dynamic, e.g. like so: With[{ getCompletion = Function[ Import[ "https://maps.googleapis.com/maps/api/geocode/json", "JSON", "RequestParameters" -> {"address" -> #} ] //. {{r__Rule} :> (Association[r])} ]}, DynamicModule[{ addr = "555 Mission St, San ...


8

I think you are actually not doing anything wrong but have found one of those cases where the automatic dependency tracking doesn't work (I think this is a bug). You can make the code work (version 10.1 on Windows) by explicitly telling the last Dynamic to track choices: Dynamic[choices,TrackedSymbols:>{choices}] There are some things in your code ...


6

There are some doubts about using SaveDefinitions (1), (2), so let's implement brute force approach which may be used later automaticaly. Scheme Needs @ yourPackage (*a*) CDFDeploy[...]& @ With[{ source = (text content of the package, encoded or whatever) (*b*) }, DynamicModule[{ ... }, ... , Initialization:>( Get[#]& @ ...


5

The first answer to the possible duplicate doesn't seem to work under version 10.1. Therefore here is some similar code, that does work: prjs = {prj1, prj2, prj3} = RandomReal[#, 100] & /@ {1, 2, 3}; Manipulate[ListPlot[prjs[[projectNo]], Joined -> True], {{projectNo, {1}}, Range[Length@prjs], ControlType -> CheckboxBar}]


4

Something, that more or less does what you asked for, can be achieved by creating a hidden InitializationCell using a DynamicWrapper DynamicWrapper["xxx", If[foo == 23, MessageDialog["You guessed it!"], MessageDialog["You've guessed the right variable name, but not the right value yet."]]]


4

There are a couple of things wrong in your code: first you need to define the recursions consistently... here I've put all the t-terms on the left and t-1 on the right hand side. Next, you need to specify initial conditions (there weren't any for the fx and fy and the y was only defined implicitly (as 1-x). So here is syntactically correct code: d = 2; k = ...


4

The second argument to Dynamic is the key. The code does not keep track of ViewVertical, which will change as the graphics are rotated by the mouse. See the references at the end for some of the answers where I used this technique. Manipulate[ Framed[Graphics3D[{PolyhedronData["Dodecahedron", "Faces"]}, ViewPoint -> Dynamic[3.0 {Cos[θ] ...


4

Let's give you some freedom of choice here and since you explicitly avoided Manipulate, let's start with this. The piece that creates the plot, the rectangle and the triangles will almost be the same in all three examples. In all three examples, I will use locators, that have no appearance but will be forced to stay on the y=0 line, so that they are always ...


3

You can use IntervalSlider in version 10.0 and above. However, you need to explicitly tell Manipulate to use it. Manipulate[ fShowInterval[Sequence @@ probRange], {probRange, 2000, 4000, IntervalSlider, Method -> "Push", MinIntervalSize -> 1}, Initialization :> (probRange = {2500, 3500};)] Method -> "Push"will keep the interval ...


2

This should do it. leftTriangle = Magnify[Graphics[{Directive[ColorData[1][1], Opacity[0.5]], Triangle[{{-1, 1}, {0, 0}, {-1, -1}}]}, AlignmentPoint -> Left], 0.1]; rightTriangle = Magnify[Graphics[{Directive[ColorData[1][1], Opacity[0.5]], Triangle[{{1, 1}, {0, 0}, {1, -1}}]}, AlignmentPoint -> Right], 0.1]; plot = Plot[Sin[x], {x, -Pi, ...


2

One can use $Pre to check if an input expression defines the correct variable and is doing so using the correct value. SetAttributes[check, HoldAll] check[new_Set] := (Print["You guessed it!"]; new) /; HoldForm@new == HoldForm@Set[foo, 23] check[new_Set] := (Print[ "You've guessed the right variable name, but not the right value yet."]; new) /; ...


2

Implementation 1 This should produce the desired GUI. askUser[matrix_] := DialogInput[ Column[{ Grid[{ToString@#1, InputField[Dynamic[#1], FieldSize -> Tiny], ToString@#2, InputField[Dynamic[#2], FieldSize -> Tiny]} & @@@ matrix, Alignment -> Left], Row[{CancelButton[], DefaultButton[DialogReturn[matrix]]}] }]] ...


2

This should work as you expect: DynamicModule[{y}, CellPrint[ TextCell[Column@{Slider[Dynamic[y], {1, 10, 1}], Dynamic@y, Dynamic[imgs[[y]]]}, CellEventActions -> {"LeftArrowKeyDown" :> (y = Max[1, y - 1]; SelectionMove[InputNotebook[], After, ButtonCell]), "RightArrowKeyDown" :> (y = Min[10, y = y + 1]; ...


2

It is always a pain to adjust everything in complex Manipulate but if you insist :) Manipulate[ {filter, list} , {{filter, 1, "Filter:"}, {1, 2, 3, 4, 5, 6}, ControlType -> PopupMenu} , {list, None} , Grid[{{"List:", PopupMenu[ Dynamic[list, If[# < filter, , list = #] &], # -> Dynamic[Style[#, If[# < filter, Gray, ...


1

It's a DynamicModule not a Manipulate, but it works (Mma V10.1 on Mac and Windows) DynamicModule[{filter, list = 1}, Column[{ PopupMenu[Dynamic[filter], Range[6]], PopupMenu[Dynamic[list], Table[With[{i = i}, (If[i < filter, list = list, list = i]) -> i], {i, 6}]], {"filter", Dynamic[filter]}, {"list", Dynamic[list]} }]] ...



Only top voted, non community-wiki answers of a minimum length are eligible