Integrating R view with Javascript

LabKey Support Forum (Inactive)
Integrating R view with Javascript jeckels  2013-11-12 14:08
Status: Closed
 
Hi Bront,

Yes, you can. For clarity, I had actually snipped that out of the source I stole from. Here's the full thing:

    function refreshChart() {
        var config = {reportId: '101', showSection: 'labkeyl_png'};

        if (comboBox.getValue() != null && comboBox.getValue() != "") {
            var filter = LABKEY.Filter.create('Run/ExperimentRunLSID/RunGroupToggle/' + comboBox.getValue(), 1, LABKEY.Filter.Types.EQUAL);
            config[filter.getURLParameterName()] = filter.getURLParameterValue();
        }

        var wikiWebPartRenderer = new LABKEY.WebPart( {
            partName: 'Report',
            renderTo: 'histogramDiv',
            frame: 'none',
            partConfig: config
        });
        wikiWebPartRenderer.render();
    }

It happens to pull the value from an ExtJS combo box, but you should be able to easily adapt to whatever filter values you want to apply.

Thanks,
Josh