Git Product home page Git Product logo

Comments (3)

kMutagene avatar kMutagene commented on May 24, 2024 1

Hey @pkese, what you referenced is the python version of plotly, which similarly to this lib offer a plethora of high-level abstractions on top of plotly.js. While there seems to be no direct API we could bin this to (at least hline or vline lead to no results when searching the js reference)

However, the python functions seems to me like it is simply setting the respective reference (Xref/ Yref), so you can easiliy implement this using the base Shape bindings:

open Plotly.NET
open Plotly.NET.LayoutObjects

Chart.Point([for i in 0..10 -> i, i])
|> Chart.withShapes [
    Shape.init(
        X0 = 1,
        X1 = 2,
        Y0 = 0,
        Y1 = 1,
        Yref = "y domain"
    )
    Shape.init(
        X0 = 0,
        X1 = 1,
        Y0 = 0,
        Y1 = 0,
        Xref = "x domain"
    )
]

image

image

What we should do though is add a type safe abstration for <axis id> domain, most likely in StyleParam.SubPlotId

from plotly.net.

kMutagene avatar kMutagene commented on May 24, 2024

I think we could offer such an abstraction though. Keeping consistent e.g. with special axes type creation, this would mean there would be a Shape.initVerticalLine, Shape.initVerticalRect etc., what do you think about this @pkese ?

from plotly.net.

pkese avatar pkese commented on May 24, 2024

Sounds great.

Note: I'm just learning plotly, so my comments may not be most relevant.

I do have a lot of experience with Highcharts and they have a nice way to put extra lines directly on axis object. Maybe that's also something worth considering. https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/xaxis/plotlines-color/

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.