semagrams.util
Useful non-Semagrams-specific functionality
Attributes
Members list
Type members
Classlikes
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
CustomAttr.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
A view of a variable. Uses a lens to forward gets and sets to an underlying UndoableVar
.
A view of a variable. Uses a lens to forward gets and sets to an underlying UndoableVar
.
Note: this is specialized to UndoableVar
right now because there isn't an informative superclass of both UndoableVar
and Var
. At some point we should fix this.
Maybe we should send a PR with UndoableVar
and LensedVar
to Laminar?
Attributes
- Todo
-
implement more of the
Var
api. - Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Supertypes
-
trait Singletontrait Producttrait Mirrortrait Producttrait Equalsclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
- Self type
-
NoneError.type
Represents an affine transformation of the 2d plane
Represents an affine transformation of the 2d plane
Value parameters
- w
-
the translation factor Note: scaling is applied before translation.
- z
-
the scaling/twisting factor
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
The internal state of an UndoableVar, implemented as a cursor into a list.
The internal state of an UndoableVar, implemented as a cursor into a list.
Value parameters
- future
-
states that we have undone (for redo). This goes away once you start editing from a state in the past; we don't have undo trees yet.
- past
-
previous states (for undoing)
- present
-
current state
- recording
-
indicator for whether we should record updates or not
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
A class similar to Var
but with support for undo and redo.
A class similar to Var
but with support for undo and redo.
Attributes
- Supertypes
-
trait Sink[A]trait SignalSource[A]trait Source[A]class Objecttrait Matchableclass AnyShow all
Custom laminar attributes for using complex numbers with svg more easily
Custom laminar attributes for using complex numbers with svg more easily
These can be used both
- with signals, i.e.
xy <-- z
, - with values, i.e.
xy := z
.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
complexattrs.type
Value members
Concrete methods
Returns the dimensions of the bounding box for text
at fontSize
Returns the dimensions of the bounding box for text
at fontSize
This caches computations, so that repeated queries are fast.
Attributes
- Todo
-
we hardcode most of the style for this; we should make this more flexible.
Make an SVG element containing the html object.
Make an SVG element containing the html object.
We have to specify manually the dimensions and position of the html, because SVG does not have automatic layout (unlike html).
One way of getting "automatic layout" is to make an html element which takes up the entire semagrams window but is transparent and doesn't intercept mouse actions, and then doing layout within that.
Attributes
Extensions
Extensions
Perform fin
if the action is cancelled or errors.
Perform fin
if the action is cancelled or errors.
Note that if the action is cancelled, it never returns, so we only get the result of fin
if it errors.
Attributes
Convert a possibly erroring IO action to one that safely returns an Option
Convert a possibly erroring IO action to one that safely returns an Option
Attributes
Produce an SVG string representing a whole path. Used in the d
attribute.
Produce an SVG string representing a whole path. Used in the d
attribute.
Attributes
Multiplication by a complex implictly converts to complex
Multiplication by a complex implictly converts to complex
Attributes
Exponentiation as an infix operator
Exponentiation as an infix operator
Attributes
Get the value of an option, throwing an error in a monad if the option is None. The advantage of throwing the error in the monad is that its more easily catchable.
Get the value of an option, throwing an error in a monad if the option is None. The advantage of throwing the error in the monad is that its more easily catchable.
Attributes
Exports
Defined exports
A custom svg attribute for setting cx
and cy
from one complex number
A custom svg attribute for setting cx
and cy
from one complex number
Attributes
A custom svg attribute for setting d
(the svg element for describing a path) from a sequence of Path.Element.
A custom svg attribute for setting d
(the svg element for describing a path) from a sequence of Path.Element.
Attributes
A custom svg attribute for setting points
from a sequence of complex numbers
A custom svg attribute for setting points
from a sequence of complex numbers
Attributes
A custom svg attribute for setting w
and h
from one complex number
A custom svg attribute for setting w
and h
from one complex number
Attributes
A custom svg attribute for setting x
and y
from one complex number
A custom svg attribute for setting x
and y
from one complex number
Attributes
A custom svg attribute for setting x1
and y1
from a complex number
A custom svg attribute for setting x1
and y1
from a complex number
Attributes
A custom svg attribute for setting x2
and y2
from a complex number
A custom svg attribute for setting x2
and y2
from a complex number