Hi, thank you for this post. It's helpful since I am new to Shiny. I followed the script you shared and it works, but i also want to create a new csv file or a new dataframe where the "Updated Dataset" goes to. How to do this? Thank you!
Can we delete points on a plot generated by plotly or ggplotly? I want the user to be able to select some points on the graph by box select, lasso select or click select and be able to delete those from the graph
Not sure what could be the problem as without seeing the code very hard to advise. Below approach should help you.. Use reactive events and assign the original dataset to it so that any changes on it reflects on data through out the app Use event data function along with plotly_selected & drag mode as lasso in the plotly to select the graph data point you want to remove. You can use any other form of events such as click, bd click, hover etc.... too Capture the meta data info from the selected points and use this to extract corresponding rows of data from the original dataset so you can remove it Delete the rows identified Result will be the selected data points will be removed from the dataset Let me know how it goes.
Hi, thank you for this post. It's helpful since I am new to Shiny. I followed the script you shared and it works, but i also want to create a new csv file or a new dataframe where the "Updated Dataset" goes to. How to do this? Thank you!
Sure, let me get a working example for you.. Ty Abi
@@abhinavagrawal6317 the mtcars dataset could work
Can we delete points on a plot generated by plotly or ggplotly? I want the user to be able to select some points on the graph by box select, lasso select or click select and be able to delete those from the graph
Yes, possible.
Yes, possible
@@abhinavagrawal6317 can you suggest me some ideas on how to do it?
I tried using, plotly_brush. I am able to select the data and able to extract those selected points into a table. But not able to delete them.
Not sure what could be the problem as without seeing the code very hard to advise. Below approach should help you..
Use reactive events and assign the original dataset to it so that any changes on it reflects on data through out the app
Use event data function along with plotly_selected & drag mode as lasso in the plotly to select the graph data point you want to remove. You can use any other form of events such as click, bd click, hover etc.... too
Capture the meta data info from the selected points and use this to extract corresponding rows of data from the original dataset so you can remove it
Delete the rows identified
Result will be the selected data points will be removed from the dataset
Let me know how it goes.