Viewer
The live viewer: one browser tab that shows every plot view()ed from this JVM, newest first, as it arrives.
The first view() starts a small web server on 127.0.0.1 (port 8337, or a free one when that is taken; set another with the system property tda4j.plot.port or the environment variable TDA4J_PLOT_PORT) and opens the page in the default browser. Where there is no desktop to open it on (a remote machine, a container), it prints the address instead: open it yourself, forwarding the port if needed (ssh -L 8337:localhost:8337 host). Set TDA4J_PLOT_BROWSER=none (or the system property tda4j.plot.browser=none) to never open a browser. The page keeps a list of every plot shown, and reconnects by itself when the JVM restarts on the same port.
Only programs on the same machine can reach 127.0.0.1. Where the page is read from somewhere else and the port cannot be forwarded (a container that publishes the port to its host), name the address to listen on with the system property tda4j.plot.host or the environment variable TDA4J_PLOT_HOST; 0.0.0.0 is every address of the machine. The page has no password: whoever reaches the port sees the plots.
The server's threads are daemon threads: a REPL or script exits as usual, and the page then waits for a new one. Nothing here uses Swing or AWT windows, so it works the same from sbt console, scala and scala-cli on any OS.
Attributes
- Experimental
- true
- Source
- Viewer.scala
- Graph
-
- Supertypes
-
class MainRoutestrait Routesclass Mainclass Objecttrait Matchableclass AnyShow all
- Self type
-
Viewer.type
Members list
Value members
Concrete methods
Opens address in the default browser, unless browsers are turned off (TDA4J_PLOT_BROWSER=none, or the system property tda4j.plot.browser=none) or there is no desktop to open it on. Returns whether it did.
Opens address in the default browser, unless browsers are turned off (TDA4J_PLOT_BROWSER=none, or the system property tda4j.plot.browser=none) or there is no desktop to open it on. Returns whether it did.
Attributes
- Source
- Viewer.scala
Attributes
- Source
- Viewer.scala
Attributes
- Source
- Viewer.scala
Attributes
- Source
- Viewer.scala
Attributes
- Source
- Viewer.scala
Shows plot in the viewer's tab (starting the server and opening the tab the first time).
Shows plot in the viewer's tab (starting the server and opening the tab the first time).
Attributes
- Source
- Viewer.scala
Stops the server; the next view() starts a new one.
The page's address, starting the server if it is not running yet.
Inherited methods
Attributes
- Inherited from:
- MainRoutes
- Source
- Main.scala
Attributes
- Inherited from:
- Routes
- Source
- Routes.scala
Attributes
- Inherited from:
- Main
- Source
- Main.scala
Attributes
- Inherited from:
- Main
- Source
- Main.scala
Attributes
- Inherited from:
- Main
- Source
- Main.scala
Attributes
- Inherited from:
- Routes
- Source
- Routes.scala
Attributes
- Inherited from:
- Main
- Source
- Main.scala
Attributes
- Inherited from:
- Main
- Source
- Main.scala
Attributes
- Inherited from:
- Main
- Source
- Main.scala
Attributes
- Inherited from:
- Main
- Source
- Main.scala
Attributes
- Inherited from:
- Main
- Source
- Main.scala
Attributes
- Inherited from:
- Main
- Source
- Main.scala
Attributes
- Inherited from:
- Main
- Source
- Main.scala
Attributes
- Inherited from:
- Main
- Source
- Main.scala
Attributes
- Inherited from:
- Main
- Source
- Main.scala
Attributes
- Inherited from:
- Main
- Source
- Main.scala
Inherited fields
Attributes
- Inherited from:
- Main
- Source
- Main.scala
Implicits
Inherited implicits
Attributes
- Inherited from:
- Main
- Source
- Main.scala
Attributes
- Inherited from:
- Main
- Source
- Main.scala