Package-level declarations

Types

Link copied to clipboard
external interface DownloadImgOpts
Link copied to clipboard

Output format for Orca export

Link copied to clipboard
class Plot(val meta: ObservableMutableMeta = ObservableMutableMeta()) : Configurable, MetaRepr, Described

The main plot class. The changes to plot could be observed by attaching listener to root meta property.

Link copied to clipboard
object Plotly

A namespace for utility functions

Link copied to clipboard
class PlotlyConfig : Scheme
Link copied to clipboard
Link copied to clipboard
class PlotlyElement(val div: HTMLElement)
Link copied to clipboard
class PlotlyFragment(val render: FlowContent.(renderer: PlotlyRenderer) -> Unit)

A custom HTML fragment including plotly container reference

Link copied to clipboard
class PlotlyHtmlFragment(val visit: TagConsumer<*>.() -> Unit)
Link copied to clipboard
external object PlotlyJs
Link copied to clipboard
data class PlotlyPage(val headers: Collection<PlotlyHtmlFragment>, val fragment: PlotlyFragment, val title: String = "Plotly.kt", val renderer: PlotlyRenderer = StaticPlotlyRenderer)

A complete page including headers and title

Link copied to clipboard
interface PlotlyRenderer
Link copied to clipboard
external interface PlotMouseEvent
Link copied to clipboard

The location of resources for plot.

Link copied to clipboard
Link copied to clipboard
external interface ToImgOpts
Link copied to clipboard
annotation class UnstablePlotlyAPI
Link copied to clipboard
annotation class UnsupportedPlotlyAPI

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
inline fun Plot.bar(block: Bar.() -> Unit): Bar
Link copied to clipboard
inline fun Plot.box(block: Box.() -> Unit): Box
Link copied to clipboard
inline fun Plot.candlestick(block: CandleStick.() -> Unit): CandleStick
Link copied to clipboard
inline fun Plot.contour(block: Contour.() -> Unit): Contour
Link copied to clipboard
fun Plotly.display(pageBuilder: FlowContent.(renderer: PlotlyRenderer) -> Unit)
Link copied to clipboard
fun Plot.export(path: Path, format: OrcaFormat = OrcaFormat.svg)

Use external plotly-orca (https://github.com/plotly/orca) tool to export static image. The tool must be installed externally (for example via conda) and usage patterns could differ for different systems.

Link copied to clipboard
fun Plotly.fragment(content: FlowContent.(renderer: PlotlyRenderer) -> Unit): PlotlyFragment
Link copied to clipboard
inline fun Plot.heatmap(block: Heatmap.() -> Unit): Heatmap
Link copied to clipboard
inline fun Plot.histogram(block: Histogram.() -> Unit): Histogram
Link copied to clipboard
inline fun Plot.histogram2d(block: Histogram2D.() -> Unit): Histogram2D
Link copied to clipboard
Link copied to clipboard
inline fun Plot.layout(block: Layout.() -> Unit)

Configure the layout

Link copied to clipboard
fun localCssHeader(basePath: Path, cssPath: Path, resource: String): PlotlyHtmlFragment
Link copied to clipboard
fun localScriptHeader(basePath: Path, scriptPath: Path, resource: String): PlotlyHtmlFragment

A header that automatically copies relevant scripts to given path

Link copied to clipboard
fun main()
Link copied to clipboard
fun PlotlyPage.makeFile(path: Path? = null, show: Boolean = true)

Export a page html to a file.

fun Plot.makeFile(path: Path? = null, show: Boolean = true, resourceLocation: ResourceLocation = ResourceLocation.LOCAL, config: PlotlyConfig = PlotlyConfig())

Create a standalone html with the plot

fun PlotlyFragment.makeFile(path: Path? = null, show: Boolean = true, title: String = "Plotly.kt", resourceLocation: ResourceLocation = ResourceLocation.LOCAL, additionalHeaders: List<PlotlyHtmlFragment> = emptyList())

The same as Plot.makeFile.

fun PlotlyPage.makeFile(path: <Error class: unknown class>)

Export a page html to a file.

fun Plot.makeFile(path: String, config: PlotlyConfig = PlotlyConfig())

fun Plot.makeFile(path: <Error class: unknown class>, config: PlotlyConfig = PlotlyConfig())

Create a standalone html with the plot

Link copied to clipboard
fun Scheme.numberGreaterThan(minValue: Number, default: Number = minValue, key: Name? = null): ReadWriteProperty<Any?, Number>

A safe Number ray

Link copied to clipboard
fun Scheme.numberInRange(range: ClosedRange<Double>, key: Name? = null): ReadWriteProperty<Any?, Number>

A safe Number range

Link copied to clipboard
Link copied to clipboard
fun Plotly.page(vararg headers: PlotlyHtmlFragment = arrayOf(cdnPlotlyHeader), title: String = "Plotly.kt", renderer: PlotlyRenderer = StaticPlotlyRenderer, content: FlowContent.(renderer: PlotlyRenderer) -> Unit): PlotlyPage

Create a complete page including plots

Link copied to clipboard
inline fun Plot.pie(block: Pie.() -> Unit): Pie
Link copied to clipboard
fun Plot(meta: Meta): Plot
Link copied to clipboard
fun FlowContent.plot(plotId: String? = null, config: PlotlyConfig = PlotlyConfig(), renderer: PlotlyRenderer = StaticPlotlyRenderer, builder: Plot.() -> Unit): Plot
fun FlowContent.plot(plot: Plot, plotId: String = plot.toString(), config: PlotlyConfig = PlotlyConfig(), renderer: PlotlyRenderer = StaticPlotlyRenderer): Plot
fun Element.plot(plot: Plot, plotlyConfig: PlotlyConfig = PlotlyConfig())

inline fun Element.plot(plotlyConfig: PlotlyConfig = PlotlyConfig(), plotBuilder: Plot.() -> Unit)

Create a plot in this element

fun Element.plot(plotlyConfig: PlotlyConfig = PlotlyConfig(), plot: Plot)

Attach a plot to this element or update the existing plot

Link copied to clipboard
inline fun TagConsumer<HTMLElement>.plotDiv(plotlyConfig: PlotlyConfig = PlotlyConfig(), plotBuilder: Plot.() -> Unit): PlotlyElement

Render plot in the HTML element using direct plotly API.

fun TagConsumer<HTMLElement>.plotDiv(plotlyConfig: PlotlyConfig = PlotlyConfig(), plot: Plot): PlotlyElement

Create a div element and render plot in it

Link copied to clipboard
Link copied to clipboard
inline fun Plot.scatter(block: Scatter.() -> Unit): Scatter
Link copied to clipboard
fun selectFile(filter: FileNameExtensionFilter? = null): Path?

Select a file to save plot to using Swing form.

Link copied to clipboard
fun Plot.shape(block: Shape.() -> Unit)
Link copied to clipboard
inline fun Plot.table(block: Table.() -> Unit): Table
Link copied to clipboard
fun Plot.text(block: Text.() -> Unit)
Link copied to clipboard
fun Plot.toHTML(vararg headers: PlotlyHtmlFragment = arrayOf(cdnPlotlyHeader), config: PlotlyConfig = PlotlyConfig()): String

Create a html (including headers) string from plot

Link copied to clipboard
fun List<Scheme>.toJsonString(): String

Convert list of type-safe configurators to json array string

fun Scheme.toJsonString(): String

Convert any type-safe configurator to json string

Convert a plot to Json representation specified by Plotly newPlot command.

Link copied to clipboard
fun PlotlyFragment.toPage(vararg headers: PlotlyHtmlFragment = arrayOf(cdnPlotlyHeader), title: String = "Plotly.kt", renderer: PlotlyRenderer = StaticPlotlyRenderer): PlotlyPage

Convert an html plot fragment to page

fun Plot.toPage(vararg headers: PlotlyHtmlFragment = arrayOf(cdnPlotlyHeader), config: PlotlyConfig = PlotlyConfig.empty(), title: String = "Plotly.kt", renderer: PlotlyRenderer = StaticPlotlyRenderer): PlotlyPage

Convert a plot to the sigle-plot page

Link copied to clipboard
inline fun Plot.trace(block: Trace.() -> Unit): Trace

Add a generic trace

Link copied to clipboard
inline fun Plot.violin(block: Violin.() -> Unit): Violin