Using LABKEY.vis Will Holtz  2016-01-07 12:56
Status: Closed
 
An old post (https://www.labkey.org/home/Developer/Forum/announcements-thread.view?rowId=8340) describes how to load all the necessary javascript dependancies for using LABKEY.vis. It is a slightly cumbersome process. Is this still best practice? I noticed that there are some libraries of javascript dependencies defined for LABKEY.vis, (server/internal/webapp/vis/visDependencies.lib.xml and server/internal/webapp/vis/vis.lib.xml). But I can't figure out how to load either of these libraries via my respective .view.xml file.

thanks,
-Will
 
 
cnathe responded:  2016-01-08 12:58
Will,
If you want to load the LABKEY Visualization related resources, you should be able to use something like the following in your .view.xml file:

<view xmlns="http://labkey.org/data/xml/view">
    <dependencies>
        <dependency path="vis"/>
    </dependencies>
</view>

-Cory
 
Will Holtz responded:  2016-01-08 14:27
Hi Cory,

I get an 'undefined' error when I call LABKEY.vis.Plot while using your .view.xml file. But it works with this:
<view xmlns="http://labkey.org/data/xml/view">
    <dependencies>
        <dependency path="/vis/SVGConverter.js"/>
        <dependency path="/vis/src/utils.js"/>
        <dependency path="/vis/src/geom.js"/>
        <dependency path="/vis/src/stat.js"/>
        <dependency path="/vis/src/scale.js"/>
        <dependency path="/vis/src/layer.js"/>
        <dependency path="/vis/src/internal/RaphaelRenderer.js"/>
        <dependency path="/vis/src/internal/D3Renderer.js"/>
        <dependency path="/vis/lib/d3-3.3.9.js"/>
        <dependency path="/vis/lib/raphael-min-2.1.0.js"/>
        <dependency path="/vis/src/plot.js"/>
    </dependencies>
</view>

Which is messier than I'd like...

thanks for your help,

-Will
 
cnathe responded:  2016-01-08 14:31
Yeah, that is a lot messier. Can you give this a try?

<view xmlns="http://labkey.org/data/xml/view">
    <dependencies>
        <dependency path="vis/vis"/>
    </dependencies>
</view>
 
Will Holtz responded:  2016-01-08 14:34
Yes! That did the trick. Thanks!

-Will