<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Panel does not render anything when I javascript code to source code in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Panel-does-not-render-anything-when-I-javascript-code-to-source/m-p/509417#M33944</link>
    <description>&lt;P&gt;I am trying to make my own COVID-19 dashboard. I was wondering if I could use the code provided on the CDC website.&amp;nbsp;&lt;BR /&gt;You can find this code by visiting&amp;nbsp;&lt;A href="https://www.cdc.gov/coronavirus/2019-ncov/cases-updates/cases-in-us.html" target="_blank"&gt;https://www.cdc.gov/coronavirus/2019-ncov/cases-updates/cases-in-us.html&lt;/A&gt;&amp;nbsp;and scroll down to "Deaths by Jurisdiction" and click on "Add US Map to your website"&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div data-post-id="50079" data-site-id="499" data-site-root-folder="coronavirus" class="mb-3" data-host="www.cdc.gov" data-theme="theme-cyan" data-cdc-widget="cdcMaps" data-config-url="/coronavirus/2019-ncov/cases-updates/us-case-count-maps-charts/map-cases-us-DeathOnly_Desktop.json"&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;script src="//tools.cdc.gov/TemplatePackage/contrib/widgets/tp-widget-external-loader.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;What is wrong with this piece of code I added to my dashboard? There are no errors but I don't see any panel on the dashboard.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;title&amp;gt;Deaths by Jurisdiction &amp;lt;/title&amp;gt;
      &amp;lt;div data-post-id="50079" data-site-id="499" data-site-root-folder="coronavirus" class="mb-3" data-host="www.cdc.gov" data-theme="theme-cyan" data-cdc-widget="cdcMaps" data-config-url="/coronavirus/2019-ncov/cases-updates/us-case-count-maps-charts/map-cases-us-DeathOnly_Desktop.json"&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;script src="//tools.cdc.gov/TemplatePackage/contrib/widgets/tp-widget-external-loader.js"&amp;gt;&amp;lt;/script&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jul 2020 22:52:02 GMT</pubDate>
    <dc:creator>g-money</dc:creator>
    <dc:date>2020-07-15T22:52:02Z</dc:date>
    <item>
      <title>Panel does not render anything when I javascript code to source code</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Panel-does-not-render-anything-when-I-javascript-code-to-source/m-p/509417#M33944</link>
      <description>&lt;P&gt;I am trying to make my own COVID-19 dashboard. I was wondering if I could use the code provided on the CDC website.&amp;nbsp;&lt;BR /&gt;You can find this code by visiting&amp;nbsp;&lt;A href="https://www.cdc.gov/coronavirus/2019-ncov/cases-updates/cases-in-us.html" target="_blank"&gt;https://www.cdc.gov/coronavirus/2019-ncov/cases-updates/cases-in-us.html&lt;/A&gt;&amp;nbsp;and scroll down to "Deaths by Jurisdiction" and click on "Add US Map to your website"&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div data-post-id="50079" data-site-id="499" data-site-root-folder="coronavirus" class="mb-3" data-host="www.cdc.gov" data-theme="theme-cyan" data-cdc-widget="cdcMaps" data-config-url="/coronavirus/2019-ncov/cases-updates/us-case-count-maps-charts/map-cases-us-DeathOnly_Desktop.json"&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;script src="//tools.cdc.gov/TemplatePackage/contrib/widgets/tp-widget-external-loader.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;What is wrong with this piece of code I added to my dashboard? There are no errors but I don't see any panel on the dashboard.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;title&amp;gt;Deaths by Jurisdiction &amp;lt;/title&amp;gt;
      &amp;lt;div data-post-id="50079" data-site-id="499" data-site-root-folder="coronavirus" class="mb-3" data-host="www.cdc.gov" data-theme="theme-cyan" data-cdc-widget="cdcMaps" data-config-url="/coronavirus/2019-ncov/cases-updates/us-case-count-maps-charts/map-cases-us-DeathOnly_Desktop.json"&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;script src="//tools.cdc.gov/TemplatePackage/contrib/widgets/tp-widget-external-loader.js"&amp;gt;&amp;lt;/script&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 22:52:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Panel-does-not-render-anything-when-I-javascript-code-to-source/m-p/509417#M33944</guid>
      <dc:creator>g-money</dc:creator>
      <dc:date>2020-07-15T22:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Panel does not render anything when I javascript code to source code</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Panel-does-not-render-anything-when-I-javascript-code-to-source/m-p/509803#M33976</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/223757"&gt;@g-money&lt;/a&gt;&amp;nbsp;ideally you should not add Javascript (rather any static resources) from external website without knowing the complete code. This will open up your app/web page to cross site insecure contents and XSS attack.&lt;/P&gt;&lt;P&gt;Splunk4Good provides you with several insightful Covid dashboards along with github repo for you to build your based on your data source, please see if that would suit your needs.&amp;nbsp;&lt;A href="https://covid-19.splunkforgood.com/hub" target="_blank" rel="noopener"&gt;https://covid-19.splunkforgood.com/hub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Having said that, there are two ways you can use internet based static JS file reference.&lt;/P&gt;&lt;P&gt;1. Convert an Empty Simple XML Dashboard to HTML Dashboard and past the HTML content as is in the html section of the HTML dashboard.&lt;/P&gt;&lt;P&gt;2. For Simple XML JS extension, add a dummy JS file to your Splunk Apps's &lt;STRONG&gt;appserver/static&lt;/STRONG&gt; folder and reference web based JS file in that dummy JS file.&lt;/P&gt;&lt;P&gt;Please find below Example of Simple XML JS Extension approach as HTML Dashboard would be straight forward. &lt;STRONG&gt;PS: Use at your own caution as stated earlier.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screen Shot 2020-07-18 at 3.05.56 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9760i69B63BB636ED29C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-07-18 at 3.05.56 AM.png" alt="Screen Shot 2020-07-18 at 3.05.56 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Following is the Simple XML Dashboard code (notice &amp;lt;script&amp;gt; section is not added to the &amp;lt;html&amp;gt; panel):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;dashboard script="cdc_covid_dummy.js"&amp;gt;
  &amp;lt;label&amp;gt;CDC Covid Dashboard&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;div data-post-id="50079" data-site-id="499" data-site-root-folder="coronavirus" class="mb-3" data-host="www.cdc.gov" data-theme="theme-cyan" data-cdc-widget="cdcMaps" data-config-url="/coronavirus/2019-ncov/cases-updates/us-case-count-maps-charts/map-cases-us-CaseOnly_Desktop.json"&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following is the required JS file&amp;nbsp;&lt;STRONG&gt;cdc_covid_dummy.js&lt;/STRONG&gt; to be placed under your Splunk app's &lt;STRONG&gt;appserver/static&lt;/STRONG&gt; folder (may require refresh, bump or restart of Splunk instance and also clearing of web browser history):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require(['//tools.cdc.gov/TemplatePackage/contrib/widgets/tp-widget-external-loader.js',
    'splunkjs/mvc/simplexml/ready!'
], function () {
    // Dummy JS to link CDC JS over Web
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try out and confirm! Recommended approach would be to use Splunk4Good code and plug in your data source.&lt;/P&gt;&lt;P&gt;Do UPVOTE if this reply helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 21:42:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Panel-does-not-render-anything-when-I-javascript-code-to-source/m-p/509803#M33976</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-07-17T21:42:57Z</dc:date>
    </item>
  </channel>
</rss>

