index.html 8.07 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");*/



	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-order' : "0,1"
            },
            fields      : FIELDS,
            placeHolder : "linechart_component_place_holder"
        };
        var barchart_params ={
            component   : "barchart-datalet",
            params      :{
                'data-url' : DATAURL,
                'fields-order' : "0,1"
            },
            fields      : FIELDS,
            placeHolder : "barchart_component_place_holder"
        };
        var columnchart_params ={
            component   : "columnchart-datalet",
            params      :{
                'data-url' : DATAURL,
                'fields-order' : "0,1"
            },
            fields      : FIELDS,
            placeHolder : "columnchart_component_place_holder"
        };
        /*var column3dchart_params ={
            component   : "column3Dchart-datalet",
            params      :{
                'data-url' : DATAURL,
                'fields-order' : "0,1"
            },
            fields      : FIELDS,
            placeHolder : "column3dchart_component_place_holder"
        };*/

	   ComponentService.deep_url = 'http://service.routetopa.eu/WebComponentsDEV/DEEP/';
       ComponentService.getComponent(table_params);
       ComponentService.getComponent(linechart_params);
       ComponentService.getComponent(barchart_params);
       ComponentService.getComponent(columnchart_params);
       /*ComponentService.getComponent(column3dchart_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 componet you want to use and the place holder in witch the component will be
              injected.
          </p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more &raquo;</a></p>
      </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">
                      <link rel="import" href="http://service.routetopa.eu/WebComponentsDEV/COMPONENTS/datalets/column3Dchart-datalet/column3Dchart-datalet.html">
                      <column3dchart-datalet data-url="http://dati.lazio.it/catalog/api/action/datastore_search?resource_id=722b6cbd-28d3-4151-ac50-9c4261298168&amp;limit=500" query="$['result']['records'][*]['Capitolo']###$['result']['records'][*]['Previsione Competenza']">
                      </column3dchart-datalet>
                  </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">
                      <link rel="import" href="http://service.routetopa.eu/WebComponentsDEV/COMPONENTS/datalets/leafletjs-datalet/leafletjs-datalet.html">
                      <leafletjs-datalet data-url="http://ckan.routetopa.eu/api/action/datastore_search?resource_id=73e02092-85a1-434e-85fe-0c9a43aa9a52&amp;limit=500" query="$['result']['records'][*]['Lat']###$['result']['records'][*]['Lng']###$['result']['records'][*]['Link']">
                      </leafletjs-datalet>
                  </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="treemap_component_place_holder">
                      <link rel="import" href="http://service.routetopa.eu/WebComponentsDEV/COMPONENTS/datalets/treemap-datalet/treemap-datalet.html">
                      <treemap-datalet data-url="http://dati.lazio.it/catalog/api/action/datastore_search?resource_id=722b6cbd-28d3-4151-ac50-9c4261298168&amp;limit=500" query="$['result']['records'][*]['Descr. missione']###$['result']['records'][*]['Descr. capitolo']###$['result']['records'][*]['Previsione Competenza']">
                      </treemap-datalet>
                  </div>
              </div>
          </div>
      </div>

  </div>

  </body>
</html>