onrender

Retrieving R object attributes in JavaScript - Part 2

假如想象 提交于 2020-01-04 00:46:06
问题 I posted a similar question earlier (Retrieving R object attributes in JavaScript). In that earlier post, I oversimplified my MWE, and so the answer I rewarded unfortunately does not really apply to my real problem. Here, I am showing why I may need to retrieve R object attributes in JavaScript (unless there is another option that I am not aware of). I have a 5-variable dataset with 100 observations. I used hexagon binning and created a scatterplot matrix. Each of the 10 scatterplots has

Shiny actionButton() output in onRender() function of htmlWidgets

纵然是瞬间 提交于 2019-12-25 16:53:16
问题 My goal is to create a script where initially a blank plotly graph is displayed. If the user clicks on a Shiny actionButton saying "Add points", then points will be added to the plotly graph via the onRender() function of htmlWidgets. This would be efficient because the background blank plotly graph would not need to be replotted when the user selects the Shiny actionButton. However, in order for me to achieve this, I would need to figure out a way to indicate the change in the Shiny

Retrieving R object attributes in JavaScript

落花浮王杯 提交于 2019-12-23 11:50:33
问题 I have a bivariate dataset with 100 observations. I used hexagon binning and ended up with 26 hexagon bins. In order to save the rows of the 100 observations that are in each of the 26 hexagon bins, I used the base::attr function in R. In the code below, this is done at: attr(hexdf, "cID") <- h@cID I am trying to create an interactive R Plotly object of the hexagon binning so that if a user were to click on a given hexagon bin, they would obtain the rows of the 100 observations that were

How to redraw or refresh in OnRender?

强颜欢笑 提交于 2019-12-18 13:32:22
问题 I want to draw something dynamically. Following code shows my OnRender. I'm setting DrawItem somewhere in my program where I need it. But when I'm calling DrawItem =5; what do I have to call, so that OnRender gets called? protected override void OnRender(DrawingContext drawingContext) { switch (DrawItem) { case 1: //Draw Item break; case 2: //Draw Item break; case 3: //Draw Item break; case 4: //Draw Item break; case 5: //Draw Item break; } base.OnRender(drawingContext) } public int DrawItem

WPF - Visual tree not used for drawing?

老子叫甜甜 提交于 2019-12-13 16:39:55
问题 I am having troubles understanding when the OnRender method is invoked. Consider my example: I have a class SomeElement deriving from FrameworkElement which overrides the OnRender method. Suppose I have a Grid grid . What I would expect is that var someElement = new SomeElement(); grid.AddVisualChild(someElement); someElement.InvalidateVisual(); would cause the SomeElement.OnRender method to be triggered. It doesn't in my case, but the following does: var someElement = new SomeElement(); grid

Using Shiny actionButton() function in onRender() function of htmlWidgets

柔情痞子 提交于 2019-12-13 16:06:43
问题 I have a Shiny application in which a user can select black points in a Plotly scatterplot using the Plotly "box select" icon. The points the user selects will be highlighted in red. I have a MWE of this application below: library(plotly) library(htmlwidgets) library(shiny) ui <- shinyUI(fluidPage( plotlyOutput("myPlot") )) server <- shinyServer(function(input, output) { p <- ggplot(mtcars, aes(x = wt, y = mpg)) + xlim(10,40) +ylim(0,10) ggPS <- ggplotly(p) output$myPlot <- renderPlotly(ggPS

Line is not displayed on startup but becomes visible on resize (WPF)

我是研究僧i 提交于 2019-12-11 21:18:12
问题 I have a WPF application where a line shape is only displayed when the application window is resized, as shown here: The red line is drawn on-the-fly, it is not defined in XAML. It displays fine. The blue line is defined in XAML, but its dimensions are changed within the OnRender() call. If its dimensions are not changed, or if only some of its dimensions are changed, the blue line is displayed on startup. But when all the dimensions of the blue line are changed, it is not displayed on

How can you render a path in several locations?

余生颓废 提交于 2019-12-11 14:18:52
问题 We have a path defined which we would like to render in several hundred different positions during the OnRender override. We know about the PushTransform method on the DC, but that seems to require a new TranslateTransform instance for each render, which means we end up with hundreds of TranslateTransform as well. That just doesn't seem efficient. We've also tried a single TranslateTransform, then just changing it's X and Y locations with each render, but since WPF actually caches the drawing

How can I manually tell an owner-drawn WPF Control to refresh/redraw without executing measure or arrange passes?

僤鯓⒐⒋嵵緔 提交于 2019-12-03 04:42:50
问题 We are doing custom drawing in a control subclass's OnRender . This drawing code is based on an external trigger and data. As such, whenever the trigger fires, we need to re-render the control based on that data. What we're trying to do is find out how to force the control to re-render but without going through an entire layout pass. As stated above, most answers I've seen revolve around invalidating the Visual which invalidates the layout which forces new measure and arrange passes which is

How to redraw or refresh in OnRender?

天涯浪子 提交于 2019-11-30 10:10:09
I want to draw something dynamically. Following code shows my OnRender. I'm setting DrawItem somewhere in my program where I need it. But when I'm calling DrawItem =5; what do I have to call, so that OnRender gets called? protected override void OnRender(DrawingContext drawingContext) { switch (DrawItem) { case 1: //Draw Item break; case 2: //Draw Item break; case 3: //Draw Item break; case 4: //Draw Item break; case 5: //Draw Item break; } base.OnRender(drawingContext) } public int DrawItem { get; set; } Indy9000 Your question is not clear but from what I can understand you seem to be asking