kandi X-RAY | crosstalk Summary
kandi X-RAY | crosstalk Summary
crosstalk
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of crosstalk
crosstalk Key Features
crosstalk Examples and Code Snippets
Community Discussions
Trending Discussions on crosstalk
QUESTION
I created the following Rmarkdown file to make a selection based on clicking an interactive ggplot.
In the javascript chunk I would like to use instead of "A" the letter (A or B) obtained from
the onclick event in the interactive ggplot. If the user clicks on polygon B then the "A" should become a "B".
ANSWER
Answered 2021-Apr-06 at 22:30Here's a slightly more useful take on the problem:
QUESTION
I use crosstalk in order to be able to click on a bar in the barplot and subset the table below based on the Abcd
. For some reason if I press on a bar I get only one row of the dataset while I should get all of them. If I select all the bars again the table still displayes only one row.
ANSWER
Answered 2021-Mar-09 at 12:26As suggested by someone, reactable
does not work well with crosstalk
. Perhaps your data could be prepared as shown below.
Try this
QUESTION
I have the shiny app below in which I use crosstalk
package to create interaction between the chart and the table. I would like to ask if it is possible to select more than one bars at the same time in order to bring back the table to its initial form and also how can you unselect a bar without having to click on another one?
ANSWER
Answered 2021-Mar-07 at 22:58When only one bar is selected and one row is displayed in the table, press and hold shift-key and click on other unselected bar to select it and the associated data row is displayed in the table. Once all bars are selected, all rows are displayed.
Also, you can select and unselect anywhere in the table to display bars that are selected/unselected according to the data row selected/unselected.
QUESTION
I am trying to change a plotly
graph via crosstalk
in my Rmarkdown
doc. This works in principle fine, however, I want to set the dropdown to the first element on startup via JavaScript
. This change, however, does not update the graph. If I run the same code once the full page is rendered, or use a delay it works.
Thus, I assume that at the point the update JavaScript
is run, the plotly
graph is not yet rendered. The setTimeout
solution works, but this feels hackis. So what is the canonical way to inform plotly/crosstalk
that the input changed?
In the gif you see that upon startup the plot shows the full range, only after changing to b
and then to a
updated the graph accordingly. I would like that the graph is correctly filtered already upon startup.
ANSWER
Answered 2021-Feb-02 at 08:09A smoother workaround is to use the window.onload
hook. This avoids the need to specify the timeout delay and as opposed to $.ready
fires not once the DOM is loaded, but the whole page is ready. Exactly what I need, unless there is a dedicated hook in plotly
for this kind of operation? plotly_afterplot
semmed to be the right candidate. Yet again this is not available on $.ready
QUESTION
I am trying to modify the appearance of a crosstalk filter slider by changing its colour and font. There is no built-in option to do this within the filter_slider()
function, so I looked up the code behind the function to see if it specifies the colour and font of the output. I found nothing that indicates that it does, so I was wondering if it is possible to add some lines to the function that enable changing the colour of the slider and its font. I have very limited knowledge of writing functions, so I do not know how to modify a complicated function like this one. I am attaching the code behind the filter_slider()
function below.
ANSWER
Answered 2021-Jan-23 at 13:52To change the font and colour of the slider, you don't need to modify the function. Instead, you can add some additional CSS to customise the appearance.
If you run the following Rmarkdown file, you can see the slider now has blue text and is in cursive font, with a red bar.
QUESTION
I make a leaflet map with a responsive heatmap using addHeatmap
. Unfortunately, this kind of tool it is not enough useful because two main problems: 1) The heatmap is redrawed with each new level of zoom and 2) you can not make the heatmap and the points in a separated group each one.
It is possible a similar solution with addWebGLHeatmap
?
There is the code for the addHeatmap
solution, following this question
ANSWER
Answered 2020-Nov-25 at 10:12This method is kind of a hack, but still should be able to work with addWebGLHeatmap
. It adds two sets of identical markers and hides one which controls the heatmap. This allows for the layer control. A working example can be found here:
https://rpubs.com/Jumble/leaflet_webgl_heatmap
Below is the code that produced this. This code solves the main two problems although it struggles if you wan't to plot over 1000 points.
Rather than using crosstalk it might be better to use a combination of something like leafgl
, shiny
and addWebGLHeatmap
if you are wanting to plot thousands of points.
QUESTION
In an Rmarkdown html document, how does one select a default value for a crosstalk::filter_select dropdown that will work with plotly plots? E.g., in the example below, to have just group 'a' selected when the RMD is knitted.
I know that for the reprex below example using plotly buttons would be easier, but when there are more than 4-5 or so choices the plotly dropdowns/buttons take up too much room/are quite ugly. Also hoping to avoid running a shiny server, the idea is to have everything running client side for speed purposes.
There is a PR in crosstalk that adds a "default choice" argument to the filter_select function, but that version doesn't work with plotly (https://github.com/rstudio/crosstalk/pull/70). I would guess the easiest way would be to add javascript to the doc to manipulate the crosstalk object, but a few experiments haven't gotten very far yet.
Reprex rmd:
...ANSWER
Answered 2020-Oct-11 at 23:41You can directly manipulate the selectize boxes that crosstalk filter_select
ouputs using javascript, the trick is triggering it on load like so:
QUESTION
I want to make a map with points and a responsive heatmap using crosstalk in R. Like this:
...ANSWER
Answered 2020-Oct-03 at 12:28This could be easily done with Shiny. However, if you really wan't to use crosstalk, then you would have to add some javascript to redraw the heat map every time the markers are changed as crosstalk for some reason can't seem to do this.
A working example can be found here: https://rpubs.com/Jumble/r_crosstalk_leaflet_heatmap_update
Below is the code which produced this:
QUESTION
I'm new to HTML and interactive tables, and I'm having trouble building a table container to add headers for my data set. Is there an easy way to insert table headers for my data set? I want columns 2-5 (excluding date in column 1) and columns 6-9 to have header 'Sector' and 'Industry' respectively.
I've included an extract of the dataset below.
Thank you!
...ANSWER
Answered 2020-Sep-05 at 00:56Does this produce what you want?
QUESTION
I'm trying to create a map visualization in plotly using mapbox (plotly::plot_mapbox()
), where the points in the map belong to different geographical districts ("comunas") and the user can choose a geographical district in a drop-down widget created by crosstalk::filter_select()
.
The expected behavior is that, when a geographical district is selected in the widget, it should trigger a filter in the map, which should only show the points that belong to the selected district.
However, I'm unable to make it work (I'm following the instructions presented here). The code that I wrote successfully creates 1) the map and 2) the filtering widget, but the components don't interact/talk to each other, i.e. when I select a district in the drop-down, there is no filtering effect in the map, it keeps showing all the points, not only those who belong to the selected district.
Am I doing something wrong? How can I make this work as intended?
Below is a reproducible example with a subset of the original data (it requires a Mapbox token to run):
...ANSWER
Answered 2020-Jul-18 at 04:15Your plot_example
needs to use the shared data. This should work:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install crosstalk
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page