JohnCoene / javascript-for-r-comments

1 stars 0 forks source link

About pre render hooks #17

Open swsoyee opened 4 years ago

swsoyee commented 4 years ago

It's a very good section, It's enlightened me a lot.

But I still have some questions.

Is preRenderHook just trying to keep some of the data is not available to see in browser, but the values are still passed to the Javascript side? Or just drop those data in R side which are don't need to pass to JavaScript side.

Adding some changes to the browser's console source code before and after the use of hook might make it easier for the reader to understand what hook does.

JohnCoene commented 4 years ago

Ah, maybe I can make that clearer.

It's a function that is run in R just before the visualisation is produced.

In the book I use it to remove sensible data precisely so it never makes its way to the browser/JavaScript.