Questions tagged [onrender]

Execute custom JavaScript code after rendering

Execute custom JavaScript code after rendering.

function in R: https://www.rdocumentation.org/packages/htmlwidgets/versions/0.9/topics/onRender

function in w2ui: http://w2ui.com/web/docs/1.5/common.onRender

onRender in Javascript answer: Looking for javascript event equivalent to 'onRender'

44 questions
26
votes
4 answers

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

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…
Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
9
votes
3 answers

OnRender not called after InvalidateVisual()

A custom WPF Control overrides OnRender. The method generates and displays a Path from custom data. The data provider is bound using a Dependency Property. The Dependency Property registers for an event when data changed. This event in turn calls…
falstaff
  • 3,413
  • 2
  • 25
  • 26
7
votes
1 answer

How to dynamically draw a timeline in WPF

I am trying to draw timelines in WPF. It should basically consist of 3 rectangles. It should look something like this (hardcoded using XAML): Timeline The large white rectangle should fill all of the available space, the green rectangles represent…
6
votes
4 answers

How to redraw or refresh in OnRender?

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…
David
  • 4,027
  • 10
  • 50
  • 102
5
votes
1 answer

Retrieving R object attributes in JavaScript

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…
user2808302
4
votes
1 answer

How to draw an exact 1 monitor pixel line using drawingContext in OnRender for a 120 DPI resolution?

I just cannot manage to draw a single pixel wide black (!) line in OnRender using drawingContext.DrawLine() on my laptop monitor which has a DPI of 120. I face this problems since years and I read many answers here on stackoverflow, but I can simply…
Peter Huber
  • 3,052
  • 2
  • 30
  • 42
4
votes
1 answer

Interactively adding points to subplots in plotly R without redrawing background plot

This is a continuation of a previous post (Interactively adding points to plotly R without redrawing background plot). I am making a scatterplot matrix (using the R package ggpairs) of 32 mtcars dataset values. My goal is to allow users to click on…
user4148072
3
votes
1 answer

WPF OnRender Z-Order control?

I have a custom panel that implements a nice custom layout of its children. I want to add some extra graphics to the panel and so override OnRender to add extra rectangles etc. It works great except the OnRender only seems to add to the background.…
Phil Wright
  • 22,580
  • 14
  • 83
  • 137
3
votes
1 answer

Shiny reactive value directly in onRender() function of htmlWidgets

I have a Shiny application that has two plots. If a user clicks on a point in the top plot, the x and y coordinate of that point are saved to a reactive Shiny variable (in the code below, it is called pointSel). In the bottom plot, I would like the…
user2808302
3
votes
1 answer

Retrieving R object attributes in JavaScript - Part 2

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…
user2808302
3
votes
1 answer

Meteor: onRendered event on image possible?

I want to check if an image has been fully loaded. So I'm using onRendered on the template with the image: template helper Template.backgroundImage.helpers({ …
user3142695
  • 15,844
  • 47
  • 176
  • 332
2
votes
1 answer

Displaying message box in Extjs when the page is loaded

I'm learning extjs as our application uses it. Right now I've been able to build something like: blur: function(field, lastValues) { var vField = field.getValue(), vFormPanel = field.formPanel; if (Ext.isEmpty(vField)) { MsgBox.show({ …
user10096621
  • 225
  • 2
  • 4
  • 16
2
votes
2 answers

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

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…
user2808302
2
votes
2 answers

Trying to draw an ellipse in a WPF window, but it is not visible

I am trying to create my own graph user control, I have one already working on win forms and I am trying to move it into WPF world. I am starting with learning how to do drawing, so first thing I was trying to draw a black ellipse that fills an…
Bishoy
  • 705
  • 9
  • 24
2
votes
1 answer

WPF - Visual tree not used for drawing?

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…
JBSnorro
  • 6,048
  • 3
  • 41
  • 62
1
2 3