Custom rendering of data/insights

Hello I want to bring in some simple SG data analytics for my team and want to draw linear regression lines on top of history graphs to be able to sample predictions into the future more accurately. Any advice to point me to the right files that render the graphs would be fantastic!

Also can we hook up google analytics to SG?

3 Likes

Hi Duy,

Thanks for your question! Currently our graph widget options don’t include a regression line overlay for the change over time graphs.

While there’s no out-of-the box integration between Shotgun and Google Analytics, both systems have a Python API so you could conceivably pull the data you need from Shotgun and send it over to Google. A couple links for reference:

3 Likes

Thanks Brandon!

I found an acceptable solution using the BI software Tableau that can make a regression plot. However, I tried these URLs/html in the URL widget in the Insights design page and all I get are errors.

Please advise.

I used these instructions:

https://public.tableau.com/profile/duy1028#!/vizhome/test_15678855155560/Sheet2

https://public.tableau.com/views/test_15678855155560/Sheet2?:embed=y&:display_count=yes&:origin=viz_share_link

<div class='tableauPlaceholder' id='viz1568059148898' style='position: relative'><noscript><a href='#'><img alt=' ' src='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;te&#47;test_15678855155560&#47;Sheet2&#47;1_rss.png' style='border: none' /></a></noscript><object class='tableauViz' style='display:none;'><param name='host_url' value='https%3A%2F%2Fpublic.tableau.com%2F' /> <param name='embed_code_version' value='3' /> <param name='site_root' value='' /><param name='name' value='test_15678855155560&#47;Sheet2' /><param name='tabs' value='no' /><param name='toolbar' value='yes' /><param name='static_image' value='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;te&#47;test_15678855155560&#47;Sheet2&#47;1.png' /> <param name='animate_transition' value='yes' /><param name='display_static_image' value='yes' /><param name='display_spinner' value='yes' /><param name='display_overlay' value='yes' /><param name='display_count' value='yes' /></object></div> <script type='text/javascript'> var divElement = document.getElementById('viz1568059148898'); var vizElement = divElement.getElementsByTagName('object')[0]; vizElement.style.width='100%';vizElement.style.height=(divElement.offsetWidth*0.75)+'px'; var scriptElement = document.createElement('script'); scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js'; vizElement.parentNode.insertBefore(scriptElement, vizElement); </script>

1 Like

Hi Duy,

In order to host external urls in a SG URL Widget, the source media must allow itself to be embedded in an iFrame. You’d need to talk to the Tableau folks about if they’re denying iFrame embedding or not. If you’re hosting your graphs locally or on a server where you have control over embedding options (at the Apache or nginx level: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options), you’ll probably get more mileage that way. I hope this helps!

5 Likes

Thanks for the heads up! I’ll go on over to the Tableau people and see what’s good.

5 Likes

We’ve done what @tony suggested with a Flask server wrapping https://plot.ly widgets embedded in Shotgun URL views/tabs. We like that because we can do all sorts of data-crunching in python and serve a clean little endpoint, rather than having to construct a huge URL with data-analysis and formatting limitations.

3 Likes