index.html 7.58 KB
<!DOCTYPE html>
<html>
  <head>
  <!-- style -->
  <link rel="stylesheet" href="js/bootstrap-3.3.4-dist/css/bootstrap.css">
  <!-- Js imports -->
  <script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
  <script type="text/javascript" src="../COMPONENTS/bower_components/webcomponentsjs/webcomponents.js"></script>
  <script type="text/javascript" src="js/deepClient.js"></script>
  <script src="js/bootstrap-3.3.4-dist/js/bootstrap.min.js"></script>
  <script type="text/javascript">

    //Bilancio preventivo regione Lazio
    DATAURL  = "http://dati.lazio.it/catalog/api/action/datastore_search?resource_id=722b6cbd-28d3-4151-ac50-9c4261298168&limit=1000";
    FIELDS   = Array("result,records,Capitolo","result,records,Previsione Competenza");
    FIELDS1  = Array("result,records,Capitolo","result,records,Descr. capitolo","result,records,Previsione Competenza");

    //Bilancio prato 2014
    /*DATAURL  = "http://ckan.routetopa.eu/api/action/datastore_search?resource_id=0cb600fc-19ad-4aaf-9794-1e6ea851840a&limit=1000";
    FIELDS   = Array("result,records,descrizione","result,records,movimento");
    FIELDS1  = Array("result,records,titolo","result,records,categoria","result,records,descrizione","result,records,movimento");*/

    //ROUTE-TO-PA CKAN DUBLIN
    DATAURL1 = "http://ckan.routetopa.eu/api/action/datastore_search?resource_id=73e02092-85a1-434e-85fe-0c9a43aa9a52&limit=5000";
    FIELDS2   = Array("result,records,Lat","result,records,Lng","result,records,Link");

    //ROUTE-TO-PA CKAN TREEMAP
    DATAURL2 = "http://ckan.routetopa.eu/api/action/datastore_search?resource_id=0cb600fc-19ad-4aaf-9794-1e6ea851840a&amp;limit=10000";
    FIELDS3  = Array("result,records,categoria","result,records,capitolo","result,records,movimento");

	jQuery(document).ready(function($) {
	   var table_params ={
	      component   : "datatable-datalet",
          params      :
          {
             'data-url' : DATAURL
          },
		  fields      : FIELDS1,
		  placeHolder : "table_component_place_holder"
	   };
       var linechart_params ={
            component   : "linechart-datalet",
            params      :
            {
                'data-url' : DATAURL
            },
            fields      : FIELDS,
            placeHolder : "linechart_component_place_holder"
        };
        var barchart_params ={
            component   : "barchart-datalet",
            params      :
            {
                'data-url' : DATAURL
            },
            fields      : FIELDS,
            placeHolder : "barchart_component_place_holder"
        };
        var columnchart_params ={
            component   : "columnchart-datalet",
            params      :
            {
                'data-url' : DATAURL
            },
            fields      : FIELDS,
            placeHolder : "columnchart_component_place_holder"
        };

        var column3dchart_params ={
            component   : "column3Dchart-datalet",
            params      :
            {
                'data-url' : DATAURL1
            },
            fields      : FIELDS2,
            placeHolder : "column3dchart_component_place_holder"
        };

        var leafletjs_params ={
            component   : "leafletjs-datalet",
            params      :{
                'data-url' : DATAURL1
            },
            fields      : FIELDS2,
            placeHolder : "leafletjs_component_place_holder"
        };

        var treemap_params = {
            component   : "treemap-datalet",
            params      :{
                'data-url' : DATAURL2
            },
            fields      : FIELDS3,
            placeHolder : "treemap_component_place_holder"
        };



	    ComponentService.deep_url = 'http://192.168.232.128/DEEalerProvider/DEEP/';
        ComponentService.getComponent(table_params);
        ComponentService.getComponent(linechart_params);
        ComponentService.getComponent(barchart_params);
        ComponentService.getComponent(columnchart_params);
        ComponentService.getComponent(column3dchart_params);
        ComponentService.getComponent(leafletjs_params);
        ComponentService.getComponent(treemap_params);

    });
  </script> 
 </head>
  <body>
  <div class="jumbotron">
      <div class="container">
          <h2>Open Data Datalets</h2>
          <p class="small text-info">In this page you can see several containers with opendata Datalets. To do this the page uses the DEEPCLIENT js library.
              The only things you have to know is the data source url, the fields that component need to visualize the chart, the component you want to use and the place holder in witch the component will be
              injected.
      </div>
  </div>
  <div class="container">
     <div class="row">
          <div class="col-md-12">
              <div class="panel panel-default">
                  <div class="panel-heading">
                      <h3 class="panel-title"> Datatable Datalet</h3>
                  </div>
                  <div class="panel-body">
                      <div id="table_component_place_holder"></div>
                  </div>
              </div>
          </div>
          <div class="col-md-12">
		      <div class="panel panel-default">
                  <div class="panel-heading">
                      <h3 class="panel-title">Linechart Datalet</h3>
                  </div>
                  <div class="panel-body">
                      <div id="linechart_component_place_holder"></div>
                  </div>
              </div>
          </div>
          <div class="col-md-12">
              <div class="panel panel-default">
                  <div class="panel-heading">
                      <h3 class="panel-title">Barchart Datalet</h3>
                  </div>
                  <div class="panel-body">
                      <div id="barchart_component_place_holder"></div>
                  </div>
              </div>
          </div>
         <div class="col-md-12">
              <div class="panel panel-default">
                  <div class="panel-heading">
                      <h3 class="panel-title">Columnchart Datalet</h3>
                  </div>
                  <div class="panel-body">
                      <div id="columnchart_component_place_holder"></div>
                  </div>
              </div>
          </div>
      </div>
      <div class="col-md-12">
          <div class="panel panel-default">
              <div class="panel-heading">
                  <h3 class="panel-title">Column3Dchart Datalet</h3>
              </div>
              <div class="panel-body">
                  <div id="column3dchart_component_place_holder">
                  </div>
              </div>
          </div>
      </div>
      <div class="col-md-12">
          <div class="panel panel-default">
              <div class="panel-heading">
                  <h3 class="panel-title">Leafletjs Map Datalet</h3>
              </div>
              <div class="panel-body">
                  <div id="leafletjs_component_place_holder">
                  </div>
              </div>
          </div>
      </div>

      <div class="col-md-12">
          <div class="panel panel-default">
              <div class="panel-heading">
                  <h3 class="panel-title">Treemap Datalet</h3>
              </div>
              <div class="panel-body">
                  <div id="treemap_component_place_holder">
                  </div>
              </div>
          </div>
      </div>

  </div>

  </body>
</html>