Wolfram Widgets

This collection documents various minor “widgets” I’ve built in Wolfram. These widgets are sometimes an interactive graphic to help me understand a problem, or a tool to help me solve that problem.

Diagrams

These widgets are related to my Diagrams project.

Geometry

CircularArcThroughAnglesManipulate

I made this widget while working on diagram arrow placement and realizing the problem of calculating the “difference” between two angles is somewhat nuanced.

You can read more about that in the related project log entry.

Arrow Placement

Testing Chosen Sides

BestArrowPlacementManipulate

The intention of his widget is straightforward: visualize the Diagrams algorithm that decides, given two boxes and an arrow between them, where that arrow should be drawn.

Possible arrow placement options (“right side of Box A connected to the left side of Box B”) are ranked based on the length of the resulting arrow, and the angle at which the arrow intersects with the respective sides of the origin and destination box.

Understanding the Math

ArrowConnectionAngleManipulate

Related to the previous widget, this widget “zooms in” on the sub-problem concerning the angle at which an arrow originating from another box will arrive.

To be most visually pleasing, ideally all arrows would arrive anti-normal, pointing directly into the side of the box at a 90 degree angle. That often isn’t possible due to other diagram placement considerations, but the closer to anti-normal an arrow arrives, the more “optimal” it is considered by the ranking function.

Playing with this widget, you can see some possible arrow arrival angles are not very aesthetically pleasing:

In this example, the arrow starts at some box off to the left, and arrives at the top edge of the destination box at a very shallow angle. This isn’t very aesthetically pleasing, and it many cases, an arrow instead arriving at the left edge of the destination box would be preferable if possible.

In this example, the arrow starts at some unseen box above, and connects to the left side of the destination box. Unfortunately, following that path, the arrow passes through the destination box, which is not desirable — ideally, the arrow placement algorithm should discount cases like this from consideration.