Skip to content

Commit

Permalink
update plot example
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Oct 7, 2024
1 parent f666e82 commit 5cbada1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
Embedding Plotly Charts in Stipple.

### News: Syntax for event forwarding has changed!

The standard API is now PlotlyBase, the StipplePlotly API is considered legacy.

### Example with forwarding of plotly events

See the docstrings of `watchplots()` and `watchplot()` for more details!

```julia
Expand Down Expand Up @@ -56,14 +58,16 @@ Stipple.js_mounted(::Example) = watchplots()

# the keyword argument 'keepselection' (default = false) controls whether the selection outline shall be removed after selection
function ui()
row(class = "st-module", [
cell(class = "st-module", [
plotly(:plot, syncevents = true, keepselection = false),
])
end

@page("/", ui, model = Example)
```

Possible forwarded events are

- '_selected' (Selection changed)
- '_hover' (hovered over data point)
- '_click' (click event on plot area)
Expand All @@ -73,4 +77,5 @@ Possible forwarded events are
For more Stipple Plotly Demos please check: [Stipple Demos Repo](https://github.com/GenieFramework/StippleDemos)

## Acknowledgement
Handling of Plotly Events was highly inspired by the [PlotlyJS](https://github.com/JuliaPlots/PlotlyJS.jl) package by [Spencer Lyon](https://github.com/sglyon)

Handling of Plotly Events was highly inspired by the [PlotlyJS](https://github.com/JuliaPlots/PlotlyJS.jl) package by [Spencer Lyon](https://github.com/sglyon)

0 comments on commit 5cbada1

Please sign in to comment.