38

Date-picker implementation in Mathematica The following is my implementation of a simple date-picker. The current date is highlighted in LightBlue and the weekends are highlighted in LightGreen. The selected date is always highlighted in LightRed (the default selection is the current date). You can tap into this calendar by using the Dynamic values for year, ...


28

To see the steps for taking indefinite integrals one can use free rule-based integrator nicknamed Rubi crafted by Albert D. Rich: Click on the sample integration problem at the end of the notebook and press Shift-Enter to evaluate it. After a minute or so depending on the speed of your computer, the first step of the integration should be displayed. ...


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

You can install the LiveWeb plugin for PowerPoint which allows to embed a live webpage into a slide. Now you should prepare an HTML page with emdedded CDF object (here and here you can find old instructions how to do this, but probably there is easier way now) and embed it into a PowerPoint slide. People say that it works surprisingly well and you maintain ...


22

ListPlot accepts data wrappers besides Tooltip (although I could not find any mention of this feature in the docs). So, @Jens' method can be achieved without post-processing: data = Table[{Sin[n], Sin[2 n]}, {n, 50}]; ListPlot[PopupWindow[Tooltip[#], #] & /@ data] On mouseover: Click on a point: Note: Thought this was a new feature added in ...


20

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[#, ...


16

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[...


16

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[ Plot[Evaluate[Table[i Sin[i x], {i, 1, 5}]], {x, 0, 2 \[Pi]}, PlotStyle -> ReplacePart[Table[Thin, {5}], n -> Thickness[.01]], PlotLegends -> SetterBar[Dynamic[n], Table[i -> Grid[{{Pane[ Style[Sin[i x], 16, Bold, "Panel", Opacity[1], colors[[i]], ...


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"]]}]


12

You can't. You can combine CDFs and content generated by other tools on web pages, though. From Frequently Asked Questions about the Computable Document Format (CDF) (Wolfram Research): Do CDFs plug in to Microsoft Office documents or PDFs? Currently, the CDF Player plugin only supports web browsers. We are exploring the same capabilities for a number of ...


12

Here is one that should work in version 6 and later. The full code is at bottom. Here is what it looks like: {dateSetter[Dynamic[d]],Dynamic[d]} I did not incorporate the year here, but you could put it in a Tooltip or add it to the button's graphic. And when you click on the button you get Incorporate this into a Manipulate using {d,dateSetter[#]&} ...


12

The answer by Mr. Wizard covers the built-in options, but one thing that you may be missing is that the tooltip alone isn't very convenient when it comes to recording the desired coordinates for later use. You'd have to read off the numbers and type them in again. If you want to automate this process too, then you might be interested in the following: data ...


11

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

Inspired by Jens' answer, here is a method that will print below the plot the coordinates of each point clicked. printTip = Button[Tooltip@##, SelectionMove[ButtonNotebook[], After, Cell]; NotebookWrite[ButtonNotebook[], ToBoxes@#2], Appearance -> "Frameless"] &; data = N @ Table[{Sin[n], Sin[2 n]}, {n, 50}]; ListPlot[Tooltip @ ...


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}]}] } ]


6

This is a basic code to get textures and "click on any face to show message" features: Graphics3D[{ {Texture[ExampleData[{"ColorTexture", "Metal4"}]], PopupWindow[ Polygon[{{-1, -1, 0}, {1, -1, 0}, {1, 1, 0}, {-1, 1, 0}}, VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}], Style["metallic floor", 18]]}, {Texture[...


6

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 ...


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