Git Product home page Git Product logo

Comments (2)

kMutagene avatar kMutagene commented on May 14, 2024 1

Hi @ai-fwd,

Happy that you like it!

Not nearly all options of the original plotly library are wrapped in a typesafe manner. However, we are able to recreate any javascript example by using the dynamic object stlye (the type safe functions are infact just abstractions of this style), which you can create analogously to the javascript examples. While i could not get the templates to work quickly, using background images in the layout is pretty straight forward:


type LayoutImage () =
    inherit DynamicObj ()

let image1 = 
    let tmp = LayoutImage()
    tmp?name    <- "watermark_1"
    tmp?source  <- "https://raw.githubusercontent.com/michaelbabyn/plot_data/master/benzene.png"
    tmp?xref    <- "paper"
    tmp?yref    <- "paper"
    tmp?x       <- 0.40
    tmp?y       <- 0.9
    tmp?sizex   <- 0.7
    tmp?sizey   <- 0.7
    tmp?opacity <- 0.1
    tmp?layer   <- "below"
    tmp

let layoutUsingImage =
    let layout = Layout.init()
    layout?images <- [image1]
    layout

Chart.Line(x=[0; 1; 2; 3; 4; 5],y=[2; 4; 3; 0; 5; 6])
|> Chart.withLayout layoutUsingImage
|> Chart.Show

Rendered Chart:

image

Regarding templates, i think it would be quite useful having those, i will look into it when i find time

from plotly.net.

kMutagene avatar kMutagene commented on May 14, 2024

See
layout images: https://plotly.net/01_5_layout_images.html
templates: https://plotly.net/00_4_templates.html

from plotly.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.