Transform

org.appliedtopology.tda4j.plot.Transform
See theTransform companion object
enum Transform

How data values become positions along an axis (or steps along a color ramp). The plots hold data in its own units; a transform is applied only when drawing, so the same figure can be shown on a linear or a log axis.

apply gives NaN for a value with no position of its own: zero or a negative number under Log10. The renderer does not leave such a value out: what is at 0 on a log axis sits on a -∞ line below the lowest number, and a log axis with a negative value is drawn as a symmetric log (Transform.SymLog), which it says under the plot. Only what is not a number at all is left out, and counted.

Attributes

Companion
object
Experimental
true
Source
Transform.scala
Graph
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Type members

Enum entries

final case class Custom(name: String, forward: Double => Double, backward: Double => Double)

A transform of your own: forward gives the position of a value (NaN for a value with none), backward its inverse; ticks are round numbers of the data, as on a square-root axis. Two axes are on one scale when they share the same functions (so a val keeps one): Transform.Custom("cube root", math.cbrt, v => v * v * v).

A transform of your own: forward gives the position of a value (NaN for a value with none), backward its inverse; ticks are round numbers of the data, as on a square-root axis. Two axes are on one scale when they share the same functions (so a val keeps one): Transform.Custom("cube root", math.cbrt, v => v * v * v).

Attributes

Source
Transform.scala
case Identity extends Transform

The data as it is.

The data as it is.

Attributes

Source
Transform.scala
case Log10 extends Transform

Base-10 logarithm: equal steps are equal ratios. On an axis, what is at 0 (an H0 bar's birth) sits on a -∞ line below the lowest number, and an axis with a negative value is drawn as a symmetric log.

Base-10 logarithm: equal steps are equal ratios. On an axis, what is at 0 (an H0 bar's birth) sits on a -∞ line below the lowest number, and an axis with a negative value is drawn as a symmetric log.

Attributes

Source
Transform.scala
case Sqrt extends Transform

Square root of the magnitude, with the sign kept (sign(v) * sqrt(|v|)): spreads out small values, keeps zero, and shows a negative value mirrored.

Square root of the magnitude, with the sign kept (sign(v) * sqrt(|v|)): spreads out small values, keeps zero, and shows a negative value mirrored.

Attributes

Source
Transform.scala
final case class SymLog(linear: Double)

Logarithmic away from zero, linear within linear of it: sign(v) * log10(1 + |v| / linear). Keeps zero and negative values on a log-like axis. linear is the size of the linear stretch around zero, in data units.

Logarithmic away from zero, linear within linear of it: sign(v) * log10(1 + |v| / linear). Keeps zero and negative values on a log-like axis. linear is the size of the linear stretch around zero, in data units.

Attributes

Source
Transform.scala