HTML

public struct HTML

Functions for converting Figures to HTML documents rendered via Plotly.js.

  • Option how a JavaScript library is incorporated in a HTML document.

    See more

    Declaration

    Swift

    public enum JavaScriptBundleOption
  • Creates HTML document that contains the Figure.

    Declaration

    Swift

    static public func create(from figure: Figure,
                              plotly: JavaScriptBundleOption = .included,
                              mathJax: JavaScriptBundleOption = .included,
                              document: Bool = false) throws -> String

    Parameters

    figure

    Figure object representing a Plotly.js chart.

    plotly

    Specifies how is Plotly.js library source code incorporated in the HTML output. Size of the minified library is about 3 MB.

    mathJax

    Specifies how is MathJax.js library source code incorporated in the HTML output. Size of the minified library is about 40 kB.

    document

    Flag indicating whether to create a complete HTML document starting with the <html>element or only a single <div> holding the chart.