24

If you are serious about using this extensively, consider making a function based on CreateDocument... Here is one way to pursue Szabolcs's line of thought. What follows is a function based on CreateDocument[] that can be used in conjunction with the (now somewhat neglected) option DisplayFunction, which handles where the output of graphics functions should ...


22

There is a built-in DateSetter: {Developer`DateSetter[Dynamic@date], Dynamic@date} By default the first selectable date is tomorrow and one can only go to future months. However, the option NotebookTools`DateSetterRange can be used to set the first selectable date to sometime in the past, {Developer`DateSetter[Dynamic@date, NotebookTools`DateSetterRange -&...


18

You can always create a new notebook and put things in it. If you are serious about using this extensively, consider making a function based on CreateDocument that sets the appropriate options for the notebook to look good. Check what CreateDocument@Plot[Sin[x],{x,0,10}] does. Or use a quick-and-dirty hack based on CreatePalette: fig = CreatePalette[#, ...


17

I have improved J. M.'s version of walkD by adding error handling. I have also added walkInt that works like walkD except for integration. Code: Format[d[f_, x_], TraditionalForm] := Module[{paren, boxes}, paren = MatchQ[f,Plus[_,__]]; boxes = RowBox[{f}]; If[paren, boxes = RowBox[{"(", boxes, ")"}] ]; boxes = RowBox[{FractionBox[...


17

Update: So after adding the missing features I decided to give your actual problem a go. This is what I have: You'll note a little "Add Layer" ActionMenu on the right. That's really the only actual extension to the basic BlockBuilder[] interface I needed. Wasn't hard to get in. The Run function turned out to be something of a tough problem. I had ...


15

SetterBar colors = ColorData[1, "ColorList"][[;; 5]]; Dynamic[Legended[ Plot[Evaluate[Table[i Sin[i x], {i, 1, 5}]], {x, 0, 2 π}, PlotStyle -> ReplacePart[Table[{colors[[i]], Thin}, {i, 5}], {Alternatives @@ n, 2} -> Thickness[.01]]], SetterBar[Dynamic[n], Table[i -> Grid[{{Pane[Style[Sin[i x], 16, Bold, "Panel&...


15

Both tasks you outlined could be fused into a single app - screenshot is above. I assume that because this is a game the corrections due to geodetic model (flat map from non-flat planet surface) do not really matter (this was not mentioned in the project description). Here is a quite simple code to get you started that you can modify and upgrade. i = Import[...


14

Following detects backspace on Mac: SetOptions[EvaluationNotebook[],NotebookEventActions-> {{"KeyDown","\.08"}:>Print["triggered"]}] This code can be helpful for finding out different codes for non-standard keys. SetOptions[EvaluationNotebook[],NotebookEventActions-> {"KeyDown":>Print[FullForm@CurrentValue["EventKey"]]}]


13

Edit: I made the size of the graphic generalised so you can have any size of canvas and any thickness of line As Szabolcs said in a comment, there is an example of that in the documentation. Hating to leave something without completely understanding it I translated the code from the cell (only the drawing section, not the classifier): (*Inputs for the ...


9

You can wrap input data with Button with action CopyToClipboard: data = {1, 2, 3}; BarChart[Button[Tooltip[#, "I want tip"], CopyToClipboard@#] & /@ data, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"] Update: You can add tool tips in several ways: tooltips = {"tooltip1", "tooltip2", "tooltip3"}; Use Tooltip as a wrapper ...


9

First of all your Offset specification is strange, I'd make it Offset[{-5, -5}, {2, 1}], right? Then, you can use GraphicsGroup to treat it as a single item for the purpose of interactive editing: p0 = Point[{0, 0}]; p1 = Point[{2, 1}]; Graphics[{ GraphicsGroup @ {p0, Text["A", Offset[{-5, -5}, {0, 0}]]}, GraphicsGroup @ {p1, Text["B", Offset[{-5, -5},...


8

Perhaps this? Manipulate[ Plot[x^n, {x, 0, 5}, PlotRange -> {{0, 5}, {0, 5}}, GridLines -> {Range@5, Range@5}, GridLinesStyle -> Directive[GrayLevel[0.8], Dashed], AspectRatio -> Automatic, PlotStyle -> Thick, Axes -> False, ImageSize -> 200, Prolog -> Inset@DynamicModule[{x = 11}, Grid[ Map[Button[...


8

Here is how you would do it with LocatorPane: pt1 = {0, 0}; pt2 = {0, 2}; LocatorPane[ Dynamic[{pt1, pt2}], Dynamic@Graphics[{ Line[{pt1, pt2}] }, PlotRange -> {{-5, 5}, {-5, 5}} ], Appearance -> { Graphics[{Red, PointSize[Large], Point[{0, 0}]}], Graphics[{Blue, PointSize[Large], Point[{0, 0}]}] } ]


8

This is a very minimal interactive wireframe to get you started. DynamicModule[{words = {}, word = ""}, Column[{ Dynamic@Column@words, Row[{ InputField[Dynamic[word], String], Button["Submit", AppendTo[words, wordle[word]]; word = ""] }]}]]


7

Here is what I would propose related to the use of Graphics: DynamicModule[{color = Red, m = 10, premade, col, posnum, posFriends, unSortedPos, posMouse = {0, 0}, positionColor = {{0, 0}}}, (*Initialization code*) premade = Transpose@Partition[Range@(m*m), m]; col[n_] := Table[{n - 0.5, i - 0.5}, {i, 1, m}]; EventHandler[ Graphics[ { ...


6

This colors based upon a divisibility criteria: DynamicModule[{x = 11}, Grid@Map[Button[ToString@#, x = #, Background -> Dynamic[If[Divisible[#, x], Green, Red]], ImageSize -> 30] &, RandomInteger[{1, 10}, {5, 5}], {2}]] Edit If you want it less "buttonlike" and more "gridlike": DynamicModule[{x = 11}, ...


6

Following suggestions in the comments, here is a way to achieve what I want: Manipulate[ Row[{ Plot[Sin[x (1 + a x)], {x, 0, 6}], Plot[Evaluate@D[Sin[x (1 + a x)], x], {x, 0, 6}]}, BaseStyle -> ImageSizeMultipliers -> 2/3], {a, 0, 2, Grid[{{ Slider[##, Appearance -> Tiny], InputField[#, FieldSize -> ...


6

Here is a simple way to convert any ListPlot into something that raises a PopupWindow, and it gives you feedback about the active point before clicking it, by showing a Tooltip: popupGraph[pt_] := Graphics[Circle[pt, .1], PlotRange -> {{0, 4}, {0, 4}}, Frame -> True] toolRule = Tooltip[x__] :> PopupWindow[Tooltip[x], popupGraph@Last@{x}]; ...


6

@BlacKow's answer works well on Mac, but Mathematica cannot handle special keys (s.a. F2 or PAUSE) on Windows. Thus, Here is a Windows workaround: The idea is to create a dynamic link library that runs in a separate thread, as explained here. In this separate thread, the keyboard status is continuously tested. Once the specified key is pressed, an event is ...


6

The following works: mymouse := Block[{}, pos = MousePosition["Graphics"]; If[pos =!= None, AppendTo[posList, pos]]] posList = {}; plot = Plot[Sin[x], {x, 0, 4 Pi}]; (* your plot *) Dynamic[Show[plot, ListLinePlot[posList, PlotStyle -> Red]]] Dynamic[mymouse] (This amazing artwork is copyrighted ©anderstood) Edit Maybe this is a bit ...


6

One possible solution is to make a separate trackball control. {vp, vv} = {ViewPoint, ViewVertical} /. Options[Graphics3D]; Graphics3D[{Cuboid[]}, Boxed -> False, SphericalRegion -> True, RotationAction -> "Clip", Prolog -> {GrayLevel[.8], Disk[Scaled[{1/2, 1/2}], Scaled[1/2]]}, AspectRatio -> 1, ImageSize -> Small, PlotLabel -> "...


6

Set an explicit value for ViewPoint and for ViewVertical. Add the option PreserveImageOptions -> True if you want to preserve other options (such as ImageSize) set interactively, PreserveImageOptions -> False if you want them to revert to the original values after interactive changes: Graphics3D[Cuboid[], ViewPoint -> {1, 1, 1}, ViewVertical ...


6

Feel free to take a look at this on the Wolfram community that I did for fun: a facsimile of Wordle Moderators: update… I did not see that a link to this was added as a comment above. I am leaving this one as well, but feel free to change it to a comment or to delete it as you see fit. Thanks!


5

This is not yet a complete answer but I think it may set you on a viable path. We can style each element using StyleBox as follows: boxes = RowBox[{"(", FractionBox[ RowBox[{RowBox[{"(", RowBox[{"a", "+", "b"}], ")"}], SuperscriptBox["c", "d"]}], SqrtBox["e"]], ")"}]; colors = ColorData[54, "ColorList"] boxesNew = Module[{i = 1}, ...


5

After additional research, I believe I can (mostly) explain all four examples. Example 1: CurrentValue is returning the default font for the front end, not the font you're typing in. It's the same as looking at Options Inspector→Formatting→Font→FontFamily, or evaluating: Options[$FrontEnd, FontFamily] (* {FontFamily -> "Times"} *) Example 2: ...


5

Example Note: This will add all them buttons as in your example but you won't be able to hide them. Manipulate[ Plot[Sin[n x], {x, 0, 2 Pi}], {n, 1, 20, Animator} ] In the above example I omit typing ControlType -> Animator, that's what you'd normally do. It seems to work without it :). I have added reference for ControlType below. Also, see ...


5

A summary to all the stuffs: Needs["JLink`"]; ReinstallJava[]; robotclass = JavaNew["java.awt.Robot"]; LoadJavaClass["java.awt.event.InputEvent"]; LoadJavaClass["java.awt.event.KeyEvent"]; LoadJavaClass["java.awt.Event"]; (*Action*) mousemove[{x_, y_}] := robotclass@mouseMove[x, y]; leftmousedown[] := robotclass@mousePress[InputEvent`BUTTON1UMASK]; ...


5

I would do this using a Manipulate with a Locator pane, because that's easier than using an EventHandler for mouse clicks. First, define a function that calculates the additional stream line that you need, then superimpose that onto the already existing plots: linePlot[V_, W_, Current_, a_, b_, c_, tMax_] := Module[{x, y}, NDSolveValue[{D[{x[t], y[t]}, t]...


5

This works on MacOS Sierra running MMA 10.3 SpecialClose[nb2Open_String] := Module[ { nb, nbID , nbIDList }, nb = EvaluationNotebook[]; nbID = nb[[2]]; (*id of the evaluation notebook, We need to use only the notebooks id since the notebook- object's first element is a kernel link that chnages *) (*This task will interactively close ...


5

Something like this img = ExampleData[{"TestImage", "Lena"}]; {w, h} = ImageDimensions@img; Manipulate[ Grid[{{Show[img, Graphics[{Opacity[0.5], Rectangle @@ pt}], ImageSize -> 300], Show[ImageTake[img, Reverse[h - pt[[All, 2]]], pt[[All, 1]]], ImageSize -> UpTo[300], PlotLabel -> {{"Coordinate", "Pixel&...


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