This function fills the rplot.js glue-partial. The rplot javascript function is part of the OpenCPU javascript library.
Examples
appifyr:::rplot("xGkrZCuuI", "rnorm", "n : 5")
#> [1] "// Handle form submission for plotting function\n$(\"#submit-xGkrZCuuI\").click(function(){\n // Show loading indicator\n $(\"#target-xGkrZCuuI\").html('<div class=\"text-center p-3\"><div class=\"spinner-border\" role=\"status\"><span class=\"sr-only\">Loading...</span></div></div>');\n \n // Make the OpenCPU request\n var req = $(\"#target-xGkrZCuuI\").rplot(\n \"rnorm\",\n {n : 5}\n );\n \n // Handle failure case with better error display\n req.fail(function(xhr, textStatus, errorThrown){\n console.error(\"OpenCPU request failed:\", textStatus, errorThrown);\n $(\"#target-xGkrZCuuI\").html(\n '<div class=\"alert alert-danger\">' +\n '<h4 class=\"alert-heading\">Error</h4>' +\n '<p>Error: ' + xhr.responseText + '</p>' +\n '</div>'\n );\n });\n \n // Add successful response handling\n req.done(function(){\n console.log(\"OpenCPU request completed successfully\");\n });\n});"
appifyr:::rplot("xGkrZCuuI", "rnorm", "n : 1000, mean : 100, sd : 15")
#> [1] "// Handle form submission for plotting function\n$(\"#submit-xGkrZCuuI\").click(function(){\n // Show loading indicator\n $(\"#target-xGkrZCuuI\").html('<div class=\"text-center p-3\"><div class=\"spinner-border\" role=\"status\"><span class=\"sr-only\">Loading...</span></div></div>');\n \n // Make the OpenCPU request\n var req = $(\"#target-xGkrZCuuI\").rplot(\n \"rnorm\",\n {n : 1000, mean : 100, sd : 15}\n );\n \n // Handle failure case with better error display\n req.fail(function(xhr, textStatus, errorThrown){\n console.error(\"OpenCPU request failed:\", textStatus, errorThrown);\n $(\"#target-xGkrZCuuI\").html(\n '<div class=\"alert alert-danger\">' +\n '<h4 class=\"alert-heading\">Error</h4>' +\n '<p>Error: ' + xhr.responseText + '</p>' +\n '</div>'\n );\n });\n \n // Add successful response handling\n req.done(function(){\n console.log(\"OpenCPU request completed successfully\");\n });\n});"