Skip to content

Graphing 1.3.0

Latest
Compare
Choose a tag to compare
@That-One-Nerd That-One-Nerd released this 03 May 13:15
ea60865

Here's another graphing calculator update. I know it's been a while, sorry about that. There have been a lot of new features and improvements. Here's what's new:

Of course, there are some new graphables! There's a small one, the EquationDifference graphable. This one is made to display the difference between two given equations. Nothing huge. There's also the ParametricEquation graphable, which is self explanatory. It lets you graph parametric equations. The code right now is not particularly optimized, but that's alright for now. It takes in a range for t, and two delegate methods, one for x with time and one for y with time.

I've replaced the original system for some UI elements. Things like the integrating and deriving buttons would require the graphable to be an equation specifically. That kind of limits things and prevents it from being as homebrew-able as possible. So that's been replaced. I've instead added interfaces for each of this things. So if you want your graphable to be able to be integrated, just implement the IIntegrable interface. Same for the IDerivable interface. There are also now more UI options. Converting an equation to its slope field is possible, and there's an interface for that: IConvertSlopeField, as well as some others: IConvertEquation and IConvertColumnTable. Each of those conversion interfaces come with a boolean like UngraphWhenConvertedTo[...] which specify whether the original graphable should remain graphed once converted. So like when you convert an equation to its slope field, you probably still want the equation there. But if you wanted to convert an equation difference to an equation itself, you probably don't want the original line.

We're almost done with interfaces. One more UI element that's been added is the ability to shift a graphable along the X and Y axes in the UI. It's under the "Operations" tab, and it can be controlled again with interfaces. You don't need to implement functionality for both the X and Y axes at the same time if your graphable doesn't support that (for example, a tangent line). You can instead just implement the X and Y interfaces. For X, implement the ITranslatableX, ITranslatableY for Y, and ITranslatableXY as a shorthand for both.

Speaking of UI elements, there are some new ones. Slope fields can now have their detail modified outside of the code. It's under the "Elements > Detail" tab. This one has no interface; you must be a slope field to be added to that list. This one is a bit too specific to abstract away, though there comes another graphable that can have its detail modified in some way, it'll also probably be added to that tab, only it'll invoke a different UI form. There's also the zoom form. This one already existed for a bit but has been completely revamped. The graph now supports non-square zoom levels, so things like a box zoom have been added. There's also the "Match Aspect" button, which stretches the graph window to make the zoom square. Then there's "Normalize," which zooms in/out until one of the axes is set to the default zoom. And lastly there's the ability to reset the zoom, which also resets the window zoom level. If you want to modify the exact endpoints for the window, that's also an option, and you can lock the viewport to prevent dragging, scaling, or resetting. A lot of talk for "I made the zoom system better."

There's also an update checker now! It doesn't do much at the moment, it's pretty limited as this package is just a library. I don't have the ability to replace the graphing DLL while the application is running, and then I'd have to recompile and breaking changes could screw that up. So it is just a simple popup on the bottom right of the graph form that takes you to the GitHub release if you click it. You won't be able to see it until the next release, obviously, but it's there.

One more big thing. The graphable selection system has changed. This is a fairly breaking change but not something difficult to adapt. Rather than returning a specific selected point when asked, you return a collection of more graph parts. So for example, you can have custom selection text messages (like displaying the slope rather than the point coordinates) or have additional UI elements if need be.

Anyway, that's all for now. I don't think I missed anything here? Again, sorry for the wait, see you in 1.4!


And here's the exact changelog, as usual.

  • Added an .Abstract namespace with the following interfaces:
    • IConvertColumnTable: Allows the graphable to convert to a column table. Appears in the UI under "Convert > Column Table"
    • IConvertEquation: Allows the graphable to convert to an equation. Appears in the UI under "Convert > Equation"
    • IConvertSlopeField: Allows the graphable to convert to a slope field. Appears in the UI under "Convert > Slope Field"
    • ITranslatable: Marks the graphable as shiftable. Does nothing on its own.
    • ITranslatableX: Marks the graphable as shiftable along the X-axis. Appears in the UI under "Operations > Translate"
    • ITranslatableY: Marks the graphable as shiftable along the Y-axis. Appears in the UI under "Operations > Translate"
    • ITranslatableXY: A shorthand for implementing both ITranslatableX and ITranslatableY. Both shifting UIs are accessed in the same place.
  • Added the following static readonly color properties to the GraphForm:
    • BackgroundColor: Controls the background color of the form. Currently pure white.
    • ZoomBoxColor: Controls the color of the zoom-box rectangle. Currently pure black.
    • MajorUpdateColor: Controls the text color of the update popup when the latest release is a major release above of the current version. Currently set to a red tone (#F74434).
    • MajorUpdateColor: Controls the text color of the update popup when the latest release is only a minor release above of the current version. Currently set to a orangish-gold tone (#FCA103).
  • Made the zooming system allow for rectangular zooming. The X and Y zoom levels can be changed independently.
  • Got rid of the segment check in the zooming mechanism since the zoom box mechanism can break it a bit.
  • Changed the icon of the reset viewport button.
  • Added a property called ViewportLocked that prevents the viewport from being moved, resized, or reset. Locking the viewport makes the reset viewport button use a padlock symbol.
  • Added a callback in GraphForm for when the viewport is zoomed in or out.
  • Added an update checker. Runs in an asyncronous task so as to not lag startup on a poor connection.
  • Replaced the default text on selection with a more customizable method.
  • Replaced the selection system with a small state machine to control the various click-drag functions.
  • Added the ability to set the zoom of the graph form by drawing a box.
  • Added the ability to ungraph a graphable from the form.
  • Added a method to determine if a point on the graph is visible to the user.
  • The graph form now stores a reference to the current zoom form when opened to prevent duplicates.
  • Zooming in with the scroll wheel now focuses the zooming around the cursor's currently selected point.
  • Pressing the reset button now does a full reset instead of a previous partial one.
  • Added the ability to change a slope field's detail in the UI. Found under "Elements > Detail"
  • Reworked most of the original UI elements to hopefully be more extendable.
    • Added some more options. See above with the interfaces, those are most of them.
  • The zoom form now tries to appear to the right of the graph form (though if it goes off the screen it won't do that).
  • Added a public method to do a full reset of the viewport (ResetAllViewport()).
  • The graph form now stores a reference to the current cache form when opened to prevent duplicates.
  • Made a bunch of object senders nullable. Gotta be conventionally correct!
  • The zoom form has been completely reworked. Now it's a lot more customizable.
  • The cache form now ignores graphables with zero cache. Doesn't change much.
  • Replaced the method in the abstract Graphable class named DeepCopy() with one called ShallowCopy() since I wasn't actually doing any deep copying in my implementations of it.
  • The column table no longer does any deep copying. This was I think the one place I actually used deep-copied internal variables.
  • Added new selection code for the ColumnTable.
  • Implemented a bunch of the earlier abstract interfaces in the Equation graphable (specifically ITranslatableXY, and IConvertSlopeField).
  • Added a callback for when the equation is rendered. I don't use it much and I'll probably get rid of it, having callbacks in graphables is not recommended.
  • Added the ability for an equation to convert to its slope field.
  • Added the ability for an equation to convert to a column table.
  • Added a public method in the Equation graphable for getting an exact value from it.
  • Slightly reworked the selection text in the Equation graphable.
  • Added a graphable that displays the difference between two equations, called the EquationDifference. It can convert to an equation that displays the difference over x and can be translated.
  • Slightly reworked the selection text in the IntegralEquation graphable.
  • Added a ParametricEquation graphable. It takes in two delegates, one for x over time and one for y.
  • Made the detail in the SlopeField graphable a public property that can be modified. Also made it a double instead of an int. Reworked the renderer a bit so decimal slope fields work well.
  • Improved the SlopeField selection UI items to show the slope rather than the coordinates.
  • Made the TangentLine graphable implement the interfaces IConvertEquation and ITranslatableX.
  • Made the cache of the TangentLine clear when the parent is modified. The only use of a graphable callback. If you translate the original equation, the tangent line should update accordingly.
  • Updated the TangentLine selection UI items to show the slope rather than the coordinates.
  • The TangentLine can now convert to a full line in slope-intercept form.
  • The GraphRectangle graph part can now be partially transparent.
  • The GraphUiCircle now has a default radius of 8.
  • Added the ability to graph a UI part that is text (GraphUiText).
  • Changed the readme a teeny bit.
  • Changed the default project to be representative of this update.