Changes
- Morpho now requires Python 3.8+ to run.
- Morpho now needs pyperclip as a dependency (should be automatically installed when upgraded)
- Removed virtually all method aliases from all classes. This was done to make overriding these methods in subclasses less confusing. The following method aliases were condensed into the following method names:
+ `minkeyID()`, `firstkeyID()` → `firstID()`
+ `maxkeyID()`, `lastkeyID()` → `lastID()`
+ `tweenStep()`, `tweenJump()` → `tweenInstant()`
+ `minkey()`, `firstkey()`, `start()` → `first()`
+ `maxkey()`, `lastkey()`, `end()` → `last()`
+ `reindex()` → `movekey()`
+ `subactor()` → `segment()`
+ `paste()` → `insert()`
+ `frame()` → `time()`
+ `inhandleRelative()`, `inhandlerelative()`, `inhandlerel()` → `inhandleRel()`
+ `outhandleRelative()`, `outhandlerelative()`, `outhandlerel()` → `outhandleRel()`
+ `SpaceSpline.toSpacePath()`, `SpaceSpline.toSpacepath()` → `SpaceSpline.toPath()`
- `Actor.segment()` now rezeros the subactor it returns by default.
- `morpho.color.heatmap` is now a function instead of a constant and must be called to generate a heatmap gradient: `morpho.color.heatmap()`
New Features
- New `set()` method for Figures allows multiple attributes to be set in one line: `mypoint.set(pos=1+1j, size=25, ...)`
- Skits can now be instantiated in a non-default state
- `SkitParameters` can now be invoked using keyword arguments:
python
morpho.SkitParameters(x=1, y=2, z=3, ...)
class MySkit(morpho.Skit):
...
- Locator layers can now optionally round the clicked coordinates and copy them to the clipboard.
- A variety of improvements to actor actions
+ The built-in actions `fadeIn()` and `fadeOut()` now have an optional `jump` parameter enabling most figures to move while fading in or out.
+ Actions can now be called like methods of actors; e.g. `mypoint.fadeIn(...)`
+ Added `growIn()` action for Paths, Splines, and Arrows that animates them appearing by lengthening from a point.
+ Custom actions can be created for any figure class with the syntax
python
MyFigureClass.action
def myaction(...):
...
- `Image` class now has a `center` property that indicates its visual center on screen.
- Added `constrain()` function to `morpho.tools.basics` that constrains an input value between a specified floor and ceiling.
- `Actor.key` now supports subscripting, allowing for a streamlined way to replace a keyfigure: `myactor.key[n] = myNewKeyfigure`
- Camera viewboxes can now be more easily rescaled to a given aspect ratio via the new methods `Camera.rescaleWidth()` and `Camera.rescaleHeight()`.
- `setupSpace/Alt()` can now be given alternate axis colors.
- Implemented `[rel]corners()` and `center()` methods for the `Text` class.
- Added `rgb2hsv()` and `hsv2rgb()` functions to `morpho.color` to convert between RGB and HSV color representations.
- Streamlined creation of tweenables within a Figure class constructor. It can now be specified like this:
python
self.Tweenable("name", value, tags=...)
and there is no longer a need to explicitly call `update()` or `extendState()` afterward.
- Added property `tipSize` to Arrows that allows you to set the head *and* tail sizes simultaneously:
python
The following lines are equivalent
myarrow.tipSize = 30
myarrow.headSize = myarrow.tailSize = 30
- `morpho.shapes.Ellipse` now has a `radius` property that allows you to set the `xradius` and `yradius` properties simultaneously.
- `morpho.grid.ellipse()` `b` argument now defaults to `a`, allowing you to easily specify a circle like this: `morpho.grid.ellipse(center, radius)`.
- Added `formatNumber()` function to `morpho.text` that provides a more streamlined way to format a decimal number into a string.
Bug Fixes
- Fixed bug regarding depth placement of SpacePaths.
- Quadmeshes with gradients now look better when the grid width is zero.
- Arrow tips on Paths and Arrows with gradients should be colored more correctly now.