Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we display a vertical line in the line graph? #27

Open
64J0 opened this issue Sep 15, 2021 · 5 comments
Open

Can we display a vertical line in the line graph? #27

64J0 opened this issue Sep 15, 2021 · 5 comments

Comments

@64J0
Copy link

64J0 commented Sep 15, 2021

Is your feature request related to a problem?

Not actually. I just didn't saw any example related to this in the docs.

Describe the solution you'd like

I would like to plot a graph like this one: https://stackoverflow.com/questions/42423167/custom-vertical-line-using-plotly-js.

Describe alternatives you've considered

None yet.

Additional context

image

Create this type of graph with vertical line.

@64J0
Copy link
Author

64J0 commented Sep 29, 2021

Bump

@64J0
Copy link
Author

64J0 commented Oct 1, 2021

It is not working by what I saw creating this sample project: https://github.com/64J0/Feliz.Plotly-testing-vertical-line/blob/master/src/Components.fs

@64J0
Copy link
Author

64J0 commented Oct 1, 2021

I think that I have spotted the problem. In this line https://github.com/Shmew/Feliz.Plotly/blob/master/src/Feliz.Plotly/Bindings.fs#L26 by what I understood, all the values within the data object but this is wrong for the shapes. They must live inside of their own objects like shown in the example from the starting of this issue.

@MichaelMay81
Copy link

MichaelMay81 commented Jan 20, 2022

Shapes seem to be broken:
shapes in Props/Layout.fs
shape in Props/Shapes.fs

Example:
F#:

layout.shapes [
    shapes.shape [
        shape.type'.line; shape.x0 1; shape.x1 4; shape.y0 7; shape.y1 12]

current JS:
shapes: { shape: { type: "line", x0: 1, x1: 4, y0: 7, y1: 12 }}
desired JS:
shapes: [{ type: "line", x0: 1, x1: 4, y0: 7, y1: 12 }]

Fix:
Props/Layout.fs:

static member inline shapes (shapes: obj list) =
    Interop.mkLayoutAttr "shapes" (shapes |> ResizeArray)

Props/Shapes.fs:

static member inline shape (properties: #IShapeProperty list) =
    (createObj !!properties)

@64J0
Copy link
Author

64J0 commented Jan 20, 2022

@MichaelMay81 this project seems abandoned unfortunately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants