Skip to content

Add more input events #1392

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

Merged
merged 61 commits into from
Feb 8, 2019
Merged
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
379e482
add restyle event, addresses #1321
cpsievert Nov 2, 2018
133e5ff
Merge branch 'master' into input-events
cpsievert Nov 6, 2018
06de984
add an example of mapping parcoord ranges back to the observations of…
cpsievert Nov 8, 2018
8d71818
Merge branch 'master' into input-events
cpsievert Nov 20, 2018
39553e6
New shiny input event 'plotly_brush' returns the x/y range of rectang…
cpsievert Nov 20, 2018
eb5a093
add plotly_selecting and plotly_brushing
cpsievert Nov 27, 2018
40f039c
Merge branch 'master' into input-events
cpsievert Nov 27, 2018
f949d7c
use Shiny.setInputValue() over Shiny.onInputChange()
cpsievert Nov 30, 2018
849f5f1
Relay full annotation info on 'plotly_clickannotation' event
cpsievert Nov 30, 2018
5514bfe
Relay 'plotly_afterplot' event
cpsievert Nov 30, 2018
5a54e41
Relay traces tied to legend events
cpsievert Nov 30, 2018
f23838f
Allow shiny input priority to be configurable at the plot-level, clos…
cpsievert Dec 1, 2018
5576397
fix legend event data and add example app
cpsievert Dec 1, 2018
fe1f075
add a 'proxy method' for modifying the plot config; add annotation ex…
cpsievert Dec 1, 2018
80a750d
add double-click, unhover, and deselect events
cpsievert Dec 2, 2018
1522f59
update list of supported events and use match.arg() to make sure a su…
cpsievert Dec 2, 2018
e7f718e
avoid fromJSON simplification for legend events
cpsievert Dec 3, 2018
1e10fc7
document
cpsievert Dec 3, 2018
b8789dd
tidy up documentation and function signature
cpsievert Dec 3, 2018
6e9e636
'plotly_unhover' emits data
cpsievert Dec 3, 2018
2abe932
attempt to dynamically register events
cpsievert Dec 4, 2018
65f473a
make sure events are registered once; clean up some other bugs
cpsievert Dec 5, 2018
f2b5426
always send message on flush and tidy up registration logic
cpsievert Dec 5, 2018
eb6cadb
consistent use of [].map
cpsievert Dec 5, 2018
d32b86f
silly off-by-one mistake
cpsievert Dec 5, 2018
8f00e01
tidy up R docs
cpsievert Dec 5, 2018
14d674d
resolve priority of 'null' events server-side (with a message)
cpsievert Dec 5, 2018
0eac8b5
plotly_brushed is more consistent naming than plotly_brush
cpsievert Dec 5, 2018
d2cf6a2
Merge branch 'master' into input-events
cpsievert Dec 6, 2018
dc91b70
Merge branch 'master' into input-events
cpsievert Dec 6, 2018
95b3121
improve parcoords example app
cpsievert Dec 6, 2018
c20fbf4
Treat Shiny.addCustomMessageHandler like the 'global' operation that …
cpsievert Dec 11, 2018
e4d240a
clean-up comments
cpsievert Dec 11, 2018
5b37957
update event priority example app
cpsievert Dec 11, 2018
d2e4042
only add message handler when in shinyMode
cpsievert Dec 11, 2018
8377bec
revert to 6e9e636
cpsievert Dec 12, 2018
f293486
force user to specify inputs/events to register as part of plot object
cpsievert Dec 13, 2018
c52909a
use modern jsonlite::parse_json for safer JSON parsing
cpsievert Dec 13, 2018
f62c50e
Track plot events in user's session data to throw informative errors
cpsievert Dec 14, 2018
1437d64
Merge branch 'master' into input-events
cpsievert Dec 17, 2018
ecbe79d
more clean-up
cpsievert Dec 17, 2018
f2937d7
events currently need their own dedicated input value
cpsievert Dec 17, 2018
d6ea8bc
merge with master
cpsievert Jan 22, 2019
a159ded
fix event_data shiny example
cpsievert Jan 22, 2019
d4c1d58
remove .clientValue prefix
cpsievert Jan 25, 2019
834498a
always set input values with event priority and leverage reactive cac…
cpsievert Jan 25, 2019
89296a5
fix test expectations
cpsievert Jan 25, 2019
d2ffbb0
maintain backwards-compatibility; document priority argument; update …
cpsievert Jan 25, 2019
a3b826d
more news
cpsievert Jan 25, 2019
e5dde36
clean-up
cpsievert Jan 25, 2019
9128db3
new bullet about event_register() and event_unregister()
cpsievert Jan 28, 2019
7671756
more news improvements
cpsievert Jan 28, 2019
781643d
add a shinytest test for event_data app
cpsievert Jan 28, 2019
bd56d2e
update event_data tests
cpsievert Jan 29, 2019
3519787
disable shinytest tests during visual test runs
cpsievert Jan 29, 2019
71d5d48
actually disable this time
cpsievert Jan 29, 2019
fe2684a
actually, no really, disable shinytest in vdiffr run
cpsievert Jan 29, 2019
39d9e92
load plotly in example shiny apps
cpsievert Jan 30, 2019
6155442
throw a warning (not an error) if the input value that event_data() i…
cpsievert Jan 31, 2019
8db07c3
Wait to check input values have been registered until after shiny's r…
cpsievert Feb 1, 2019
35a6887
warn instead of stop
cpsievert Feb 5, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions R/shiny.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,20 @@ event_data <- function(
}

event <- match.arg(event)
# check to see if this event-source-priority combo is registered
eventID <- paste(event, source, sep = "-")
eventIDRegistered <- eventID %in% session$userData$plotlyShinyEventIDs
if (!eventIDRegistered) {
stop(
"The '", event, "' event has not been registered for a source ID ",
"of '", source, "'. Please add `event_register(p, '", event, "')` to your plot `p`."
# If event_data() is requested before any (relevant) plotly
# graphs have rendered, we won't know if the relevant
# event-source combo is legitimate. As a result, we throw a
# warning here to try to be useful in cases where you really
# are requesting an input value that is never registered, but
# without preventing valid code from running.
warning(
"The '", event, "' event tied a source ID of '", source, "' ",
"has not yet been registered. ",
"If you encounter issues acquiring data from this event-source combo",
"Try adding `event_register(p, '", event, "')` to plot `p`"
)
}

Expand Down