Scene

org.appliedtopology.tda4j.plot.Scene
See theScene companion object
final case class Scene(layers: Vector[Layer] = ..., title: String = ..., subtitle: String = ..., width: Int = ..., height: Int = ..., azimuth: Double = ..., elevation: Double = ..., palette: Palette = ..., style: Style = ..., degrees: Map[Int, DegreeStyle] = ..., elements: Elements = ..., zoom: Double = ..., turns: Boolean = ..., fitted: Option[(XYZ, Double)] = ..., region: Option[Window] = ..., axes: Boolean = ..., xAxis: Axis = ..., yAxis: Axis = ...) extends Plot

A 3-D plot. In a page (html, the live viewer) it is drawn on a canvas you can turn (drag) and zoom (scroll), with no library to load; as an .svg file it is one view, from azimuth/elevation (degrees), drawn back to front.

With turns = false the view stays as azimuth and elevation give it and a drag pans instead; the scroll wheel zooms about the pointer. A flat picture (points in the plane, seen from above: azimuth = 0, elevation = 90) is drawn this way when it has too many items for an SVG, which a canvas draws in a fraction of the time and bytes.

The scene is fitted into the picture by its points (the centres of balls and halos count, their extent does not). fitted gives the centre and the radius to fit to instead: an interactive page does so for a scene whose items come and go or move with a control, so that the picture stays put (see Interactive).

axes draws an x axis along the foot of the picture and a y axis along its left edge, numbered with the coordinates of the plane at round values as a plot's axes are, for a flat picture (seen from above: azimuth = 0, elevation = 90), with gridlines at the numbers. The picture then keeps to the room inside the axes, and a canvas that pans and zooms numbers its axes again for what it shows. xAxis and yAxis hold what the axes are given by Labels (x, y) and Scale (transform, min, max, padding, breaks, format, grid, visible, reverse): an axis can be linear, log, square-root or symmetric log (Transform.Custom has no ticks a page can draw) and can run the other way, and the picture is then the data after the transforms, drawn at one scale on both axes: a straight segment between two places is a straight line between their positions. min, max and padding give the range the picture opens on (and returns to), widened to the shape of the plot area; without them the picture is fitted to its points.

region is a rectangle drawn over the picture, a translucent fill with a dashed outline, in the units of the view plane: the view from azimuth and elevation (at zoom 1), x to the right and y up, in the radius of the fitted frame. PageState.brush puts it in a still picture of a Panel.Spatial, where it is the rectangle a viewer has dragged out.

Attributes

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

Members list

Value members

Concrete methods

def +(layer: Layer): Scene

Attributes

Source
Scene.scala
def +(tweak: Tweak): Scene

This scene with the change tweak makes. Only the tweaks that need no axes apply: a palette, a Style, a Size, the Camera, the title and subtitle of Labels and the colors of Scale.degree.

This scene with the change tweak makes. Only the tweaks that need no axes apply: a palette, a Style, a Size, the Camera, the title and subtitle of Labels and the colors of Scale.degree.

Attributes

Source
Scene.scala
def ++(more: IterableOnce[Layer]): Scene

Attributes

Source
Scene.scala
def fragment(theme: Theme = ...): String

The plot as a fragment to embed in a page (an ``, or a `

The plot as a fragment to embed in a page (an ``, or a `

` with its own script for 3-D).

Attributes

Source
Scene.scala
def html(theme: Theme = ...): String

A complete HTML page, following the reader's light or dark setting under Theme.Auto.

A complete HTML page, following the reader's light or dark setting under Theme.Auto.

Attributes

Source
Scene.scala
def over(under: Scene): Scene

This scene's layers drawn over under's.

This scene's layers drawn over under's.

Attributes

Source
Scene.scala
def staticSvg(theme: Theme = ..., saved: Boolean = ...): String

One view as an ``, primitives sorted back to front (orthographic projection). With saved, the view of a file, which draws no background unless the style asks for one (see Style.transparent).

One view as an ``, primitives sorted back to front (orthographic projection). With saved, the view of a file, which draws no background unless the style asks for one (see Style.transparent).

Attributes

Source
Scene.scala
def svgFile(theme: Theme = ...): String

A complete SVG document in plain colors (for a 3-D scene: one fixed view), with no background unless the style asks for one (Style.print, or Style.transparent = false), so that it takes the color of the page it goes onto.

A complete SVG document in plain colors (for a 3-D scene: one fixed view), with no background unless the style asks for one (Style.print, or Style.transparent = false), so that it takes the color of the page it goes onto.

Attributes

Source
Scene.scala
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
Source
Scene.scala

This scene with an x axis and a y axis, numbered with the coordinates of the plane: for a flat picture, seen from above (azimuth = 0, elevation = 90). See Scene.

This scene with an x axis and a y axis, numbered with the coordinates of the plane: for a flat picture, seen from above (azimuth = 0, elevation = 90). See Scene.

Attributes

Source
Scene.scala
def withCamera(azimuth: Optional[Double] = ..., elevation: Optional[Double] = ..., zoom: Optional[Double] = ...): Scene

Where the camera looks from (azimuth and elevation, in degrees) and how close (zoom). See Camera.

Where the camera looks from (azimuth and elevation, in degrees) and how close (zoom). See Camera.

Attributes

Source
Scene.scala
def withCamera(azimuth: Double, elevation: Double, zoom: Double): Scene

The camera by plain numbers, for MATLAB and Java: withCamera(-35, 25, 1) is the default view.

The camera by plain numbers, for MATLAB and Java: withCamera(-35, 25, 1) is the default view.

Attributes

Source
Scene.scala
def withDegree(k: Int, color: Optional[String] = ..., darkColor: Optional[String] = ...): Scene

The color of homological degree k (and its dark-mode color). See Scale.degree.

The color of homological degree k (and its dark-mode color). See Scale.degree.

Attributes

Source
Scene.scala
def withDegreeColor(degree: Int, color: String): Scene

The color of homological degree degree, as a CSS color.

The color of homological degree degree, as a CSS color.

Attributes

Source
Scene.scala
def withLabels(title: Optional[String] = ..., subtitle: Optional[String] = ..., x: Optional[String] = ..., y: Optional[String] = ...): Scene

The title and subtitle, and the labels of the axes of a flat picture (withAxes): only what is given changes. A scene has no legend or color bar to label.

The title and subtitle, and the labels of the axes of a flat picture (withAxes): only what is given changes. A scene has no legend or color bar to label.

Attributes

Source
Scene.scala
def withMarkScale(factor: Double): Scene

A factor on the size of markers and the width of lines.

A factor on the size of markers and the width of lines.

Attributes

Source
Scene.scala

With its palette's surface as the background in a saved .svg too, where it has none unless asked.

With its palette's surface as the background in a saved .svg too, where it has none unless asked.

Attributes

Source
Scene.scala
def withPalette(palette: Palette): Scene

This palette.

This palette.

Attributes

Source
Scene.scala
def withPalette(name: String): Scene

The palette called name: brand, reference, print, grayscale, okabe-ito or clear.

The palette called name: brand, reference, print, grayscale, okabe-ito or clear.

Attributes

Source
Scene.scala
def withPoints(size: Optional[Double] = ..., opacity: Optional[Double] = ..., edgeWidth: Optional[Double] = ..., edgeColor: Optional[String] = ..., edgeVisible: Optional[Boolean] = ...): Scene

The markers of the points of a scene: size, opacity and the edge (edgeWidth, edgeColor, edgeVisible); a scene's points are round and filled. See Geom.points.

The markers of the points of a scene: size, opacity and the edge (edgeWidth, edgeColor, edgeVisible); a scene's points are round and filled. See Geom.points.

Attributes

Source
Scene.scala
def withSetting(spec: String): Scene

One change written as text, element.property=value: withSetting("title.size=18"). See Settings; a scene has only the title, subtitle and note.

One change written as text, element.property=value: withSetting("title.size=18"). See Settings; a scene has only the title, subtitle and note.

Attributes

Source
Scene.scala
def withSize(width: Optional[Int] = ..., height: Optional[Int] = ...): Scene

The size in pixels; give one to keep the other.

The size in pixels; give one to keep the other.

Attributes

Source
Scene.scala
def withSize(width: Int, height: Int): Scene

The size in pixels.

The size in pixels.

Attributes

Source
Scene.scala
def withStyle(style: Style): Scene

This style, in place of the scene's.

This style, in place of the scene's.

Attributes

Source
Scene.scala
def withStyle(name: String): Scene

The style called name: default, slides, print or clear.

The style called name: default, slides, print or clear.

Attributes

Source
Scene.scala
def withSubtitle(text: String): Scene

The line under the heading.

The line under the heading.

Attributes

Source
Scene.scala
def withText(role: TextRole, size: Optional[Double] = ..., weight: Optional[Weight] = ..., italic: Optional[Boolean] = ..., align: Optional[Anchor] = ..., font: Optional[String] = ..., color: Optional[String] = ..., paint: Optional[Paint] = ...): Scene

The look of the title, the subtitle or the hint (TextRole.Note): the text a scene has. See Text.

The look of the title, the subtitle or the hint (TextRole.Note): the text a scene has. See Text.

Attributes

Source
Scene.scala
def withTextScale(factor: Double): Scene

A factor on every text size.

A factor on every text size.

Attributes

Source
Scene.scala
def withTitle(text: String): Scene

The heading.

The heading.

Attributes

Source
Scene.scala

Without a background.

Without a background.

Attributes

Source
Scene.scala
def withXLabel(text: String): Scene

The x axis label of a flat picture with axes.

The x axis label of a flat picture with axes.

Attributes

Source
Scene.scala
def withXRange(min: Double, max: Double): Scene

The range of the x axis the picture opens on, in data units, for MATLAB and Java.

The range of the x axis the picture opens on, in data units, for MATLAB and Java.

Attributes

Source
Scene.scala
def withXScale(transform: Optional[Transform] = ..., min: Optional[Double] = ..., max: Optional[Double] = ..., breaks: Optional[Seq[Double]] = ..., format: Optional[String] = ..., grid: Optional[Boolean] = ..., visible: Optional[Boolean] = ..., reverse: Optional[Boolean] = ..., padding: Optional[Double] = ...): Scene

The x axis of a flat picture with axes, as Scale.x has it: its transform (linear, log, square-root or symmetric log), the min and max of the range the picture opens on (padding, the fraction of the data's extent left empty at each end where an end is not given, is 0.04 unless set), the breaks where the numbers stand, the printf format of the numbers (%f and %e), whether it has gridlines, whether it is visible at all, and whether it runs the other way (reverse). A canvas keeps equal units on both axes, so a range the picture is opened on is widened to the shape of the plot area, and its pan and zoom move off it. position, crossesAt and minusInfinity of Scale.x are not here: a canvas's axes stay at the foot and the left edge of its plot area, and a log axis has no -∞ line (Transform.SymLog keeps zero and negative numbers).

The x axis of a flat picture with axes, as Scale.x has it: its transform (linear, log, square-root or symmetric log), the min and max of the range the picture opens on (padding, the fraction of the data's extent left empty at each end where an end is not given, is 0.04 unless set), the breaks where the numbers stand, the printf format of the numbers (%f and %e), whether it has gridlines, whether it is visible at all, and whether it runs the other way (reverse). A canvas keeps equal units on both axes, so a range the picture is opened on is widened to the shape of the plot area, and its pan and zoom move off it. position, crossesAt and minusInfinity of Scale.x are not here: a canvas's axes stay at the foot and the left edge of its plot area, and a log axis has no -∞ line (Transform.SymLog keeps zero and negative numbers).

Attributes

Source
Scene.scala
def withXScale(name: String): Scene

The x axis on the scale called name: linear, log, sqrt or symlog.

The x axis on the scale called name: linear, log, sqrt or symlog.

Attributes

Source
Scene.scala
def withXYScale(transform: Optional[Transform] = ..., min: Optional[Double] = ..., max: Optional[Double] = ..., breaks: Optional[Seq[Double]] = ..., format: Optional[String] = ..., grid: Optional[Boolean] = ..., visible: Optional[Boolean] = ..., reverse: Optional[Boolean] = ..., padding: Optional[Double] = ...): Scene

Both axes alike: a log-log picture is withXYScale(Transform.Log10).

Both axes alike: a log-log picture is withXYScale(Transform.Log10).

Attributes

Source
Scene.scala
def withYLabel(text: String): Scene

The y axis label of a flat picture with axes.

The y axis label of a flat picture with axes.

Attributes

Source
Scene.scala
def withYRange(min: Double, max: Double): Scene

The range of the y axis the picture opens on, in data units, for MATLAB and Java.

The range of the y axis the picture opens on, in data units, for MATLAB and Java.

Attributes

Source
Scene.scala
def withYScale(transform: Optional[Transform] = ..., min: Optional[Double] = ..., max: Optional[Double] = ..., breaks: Optional[Seq[Double]] = ..., format: Optional[String] = ..., grid: Optional[Boolean] = ..., visible: Optional[Boolean] = ..., reverse: Optional[Boolean] = ..., padding: Optional[Double] = ...): Scene

The y axis of a flat picture with axes; as withXScale.

The y axis of a flat picture with axes; as withXScale.

Attributes

Source
Scene.scala
def withYScale(name: String): Scene

The y axis on the scale called name: linear, log, sqrt or symlog.

The y axis on the scale called name: linear, log, sqrt or symlog.

Attributes

Source
Scene.scala

Inherited methods

def fragment(theme: String): String

fragment in the theme called theme (auto, light or dark), for callers that have a word, not a Theme (Python: a notebook shows an interactive plot by its fragment).

fragment in the theme called theme (auto, light or dark), for callers that have a word, not a Theme (Python: a notebook shows an interactive plot by its fragment).

Attributes

Inherited from:
Plot
Source
Plot.scala
def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala
def save(path: String, theme: String): String

save in the theme called theme (auto, light or dark), for callers that have a word, not a Theme (MATLAB: fig.save('diagram.svg', 'dark')).

save in the theme called theme (auto, light or dark), for callers that have a word, not a Theme (MATLAB: fig.save('diagram.svg', 'dark')).

Attributes

Inherited from:
Plot
Source
Plot.scala
def save(path: String): String

save in the default theme for the file type, for callers that cannot use a default argument (Java, MATLAB: fig.save('diagram.svg')).

save in the default theme for the file type, for callers that cannot use a default argument (Java, MATLAB: fig.save('diagram.svg')).

Attributes

Inherited from:
Plot
Source
Plot.scala
def save(path: String, theme: Option[Theme] = ...): String

Writes the plot to path: an .svg file in plain light colors with no background (another theme on request; see svgFile), or an .html page (interactive for 3-D) that follows the reader's light or dark setting and has its background. Returns the absolute path.

Writes the plot to path: an .svg file in plain light colors with no background (another theme on request; see svgFile), or an .html page (interactive for 3-D) that follows the reader's light or dark setting and has its background. Returns the absolute path.

Attributes

Inherited from:
Plot
Source
Plot.scala
def view(): this.type

Shows the plot in the live viewer, a browser tab that adds every plot view()ed (see Viewer). Inside Plot.viewWith the plot goes to the program that hosts the session instead.

Shows the plot in the live viewer, a browser tab that adds every plot view()ed (see Viewer). Inside Plot.viewWith the plot goes to the program that hosts the session instead.

Attributes

Inherited from:
Plot
Source
Plot.scala