Commit be2bb3ab462f549eb85c4b2335f4119bfc214a73
1 parent
5cce5b3c
test index refactory
Showing
1 changed file
with
55 additions
and
34 deletions
index.html
... | ... | @@ -20,12 +20,19 @@ |
20 | 20 | FIELDS = Array("result,records,descrizione","result,records,movimento"); |
21 | 21 | FIELDS1 = Array("result,records,titolo","result,records,categoria","result,records,descrizione","result,records,movimento");*/ |
22 | 22 | |
23 | + //ROUTE-TO-PA CKAN DUBLIN | |
24 | + DATAURL1 = "http://ckan.routetopa.eu/api/action/datastore_search?resource_id=73e02092-85a1-434e-85fe-0c9a43aa9a52&limit=5000"; | |
25 | + FIELDS2 = Array("result,records,Lat","result,records,Lng","result,records,Link"); | |
23 | 26 | |
27 | + //ROUTE-TO-PA CKAN TREEMAP | |
28 | + DATAURL2 = "http://ckan.routetopa.eu/api/action/datastore_search?resource_id=0cb600fc-19ad-4aaf-9794-1e6ea851840a&limit=10000"; | |
29 | + FIELDS3 = Array("result,records,categoria","result,records,capitolo","result,records,movimento"); | |
24 | 30 | |
25 | 31 | jQuery(document).ready(function($) { |
26 | 32 | var table_params ={ |
27 | 33 | component : "datatable-datalet", |
28 | - params :{ | |
34 | + params : | |
35 | + { | |
29 | 36 | 'data-url' : DATAURL |
30 | 37 | }, |
31 | 38 | fields : FIELDS1, |
... | ... | @@ -33,47 +40,71 @@ |
33 | 40 | }; |
34 | 41 | var linechart_params ={ |
35 | 42 | component : "linechart-datalet", |
36 | - params :{ | |
37 | - 'data-url' : DATAURL, | |
38 | - 'fields-order' : "0,1" | |
43 | + params : | |
44 | + { | |
45 | + 'data-url' : DATAURL | |
39 | 46 | }, |
40 | 47 | fields : FIELDS, |
41 | 48 | placeHolder : "linechart_component_place_holder" |
42 | 49 | }; |
43 | 50 | var barchart_params ={ |
44 | 51 | component : "barchart-datalet", |
45 | - params :{ | |
46 | - 'data-url' : DATAURL, | |
47 | - 'fields-order' : "0,1" | |
52 | + params : | |
53 | + { | |
54 | + 'data-url' : DATAURL | |
48 | 55 | }, |
49 | 56 | fields : FIELDS, |
50 | 57 | placeHolder : "barchart_component_place_holder" |
51 | 58 | }; |
52 | 59 | var columnchart_params ={ |
53 | 60 | component : "columnchart-datalet", |
54 | - params :{ | |
55 | - 'data-url' : DATAURL, | |
56 | - 'fields-order' : "0,1" | |
61 | + params : | |
62 | + { | |
63 | + 'data-url' : DATAURL | |
57 | 64 | }, |
58 | 65 | fields : FIELDS, |
59 | 66 | placeHolder : "columnchart_component_place_holder" |
60 | 67 | }; |
61 | - /*var column3dchart_params ={ | |
68 | + | |
69 | + var column3dchart_params ={ | |
62 | 70 | component : "column3Dchart-datalet", |
63 | - params :{ | |
64 | - 'data-url' : DATAURL, | |
65 | - 'fields-order' : "0,1" | |
71 | + params : | |
72 | + { | |
73 | + 'data-url' : DATAURL1 | |
66 | 74 | }, |
67 | - fields : FIELDS, | |
75 | + fields : FIELDS2, | |
68 | 76 | placeHolder : "column3dchart_component_place_holder" |
69 | - };*/ | |
77 | + }; | |
78 | + | |
79 | + var leafletjs_params ={ | |
80 | + component : "leafletjs-datalet", | |
81 | + params :{ | |
82 | + 'data-url' : DATAURL1 | |
83 | + }, | |
84 | + fields : FIELDS2, | |
85 | + placeHolder : "leafletjs_component_place_holder" | |
86 | + }; | |
87 | + | |
88 | + var treemap_params = { | |
89 | + component : "treemap-datalet", | |
90 | + params :{ | |
91 | + 'data-url' : DATAURL2 | |
92 | + }, | |
93 | + fields : FIELDS3, | |
94 | + placeHolder : "treemap_component_place_holder" | |
95 | + }; | |
96 | + | |
97 | + | |
98 | + | |
99 | + ComponentService.deep_url = 'http://192.168.232.128/DEEalerProvider/DEEP/'; | |
100 | + ComponentService.getComponent(table_params); | |
101 | + ComponentService.getComponent(linechart_params); | |
102 | + ComponentService.getComponent(barchart_params); | |
103 | + ComponentService.getComponent(columnchart_params); | |
104 | + ComponentService.getComponent(column3dchart_params); | |
105 | + ComponentService.getComponent(leafletjs_params); | |
106 | + ComponentService.getComponent(treemap_params); | |
70 | 107 | |
71 | - ComponentService.deep_url = 'http://service.routetopa.eu/WebComponentsDEV/DEEP/'; | |
72 | - ComponentService.getComponent(table_params); | |
73 | - ComponentService.getComponent(linechart_params); | |
74 | - ComponentService.getComponent(barchart_params); | |
75 | - ComponentService.getComponent(columnchart_params); | |
76 | - /*ComponentService.getComponent(column3dchart_params);*/ | |
77 | 108 | }); |
78 | 109 | </script> |
79 | 110 | </head> |
... | ... | @@ -82,9 +113,8 @@ |
82 | 113 | <div class="container"> |
83 | 114 | <h2>Open Data Datalets</h2> |
84 | 115 | <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. |
85 | - 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 | |
116 | + 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 | |
86 | 117 | injected. |
87 | - </p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more »</a></p> | |
88 | 118 | </div> |
89 | 119 | </div> |
90 | 120 | <div class="container"> |
... | ... | @@ -137,9 +167,6 @@ |
137 | 167 | </div> |
138 | 168 | <div class="panel-body"> |
139 | 169 | <div id="column3dchart_component_place_holder"> |
140 | - <link rel="import" href="http://service.routetopa.eu/WebComponentsDEV/COMPONENTS/datalets/column3Dchart-datalet/column3Dchart-datalet.html"> | |
141 | - <column3dchart-datalet data-url="http://dati.lazio.it/catalog/api/action/datastore_search?resource_id=722b6cbd-28d3-4151-ac50-9c4261298168&limit=500" query="$['result']['records'][*]['Capitolo']###$['result']['records'][*]['Previsione Competenza']"> | |
142 | - </column3dchart-datalet> | |
143 | 170 | </div> |
144 | 171 | </div> |
145 | 172 | </div> |
... | ... | @@ -151,9 +178,6 @@ |
151 | 178 | </div> |
152 | 179 | <div class="panel-body"> |
153 | 180 | <div id="leafletjs_component_place_holder"> |
154 | - <link rel="import" href="http://service.routetopa.eu/WebComponentsDEV/COMPONENTS/datalets/leafletjs-datalet/leafletjs-datalet.html"> | |
155 | - <leafletjs-datalet data-url="http://ckan.routetopa.eu/api/action/datastore_search?resource_id=73e02092-85a1-434e-85fe-0c9a43aa9a52&limit=500" query="$['result']['records'][*]['Lat']###$['result']['records'][*]['Lng']###$['result']['records'][*]['Link']"> | |
156 | - </leafletjs-datalet> | |
157 | 181 | </div> |
158 | 182 | </div> |
159 | 183 | </div> |
... | ... | @@ -162,13 +186,10 @@ |
162 | 186 | <div class="col-md-12"> |
163 | 187 | <div class="panel panel-default"> |
164 | 188 | <div class="panel-heading"> |
165 | - <h3 class="panel-title">Leafletjs Map Datalet</h3> | |
189 | + <h3 class="panel-title">Treemap Datalet</h3> | |
166 | 190 | </div> |
167 | 191 | <div class="panel-body"> |
168 | 192 | <div id="treemap_component_place_holder"> |
169 | - <link rel="import" href="http://service.routetopa.eu/WebComponentsDEV/COMPONENTS/datalets/treemap-datalet/treemap-datalet.html"> | |
170 | - <treemap-datalet data-url="http://dati.lazio.it/catalog/api/action/datastore_search?resource_id=722b6cbd-28d3-4151-ac50-9c4261298168&limit=500" query="$['result']['records'][*]['Descr. missione']###$['result']['records'][*]['Descr. capitolo']###$['result']['records'][*]['Previsione Competenza']"> | |
171 | - </treemap-datalet> | |
172 | 193 | </div> |
173 | 194 | </div> |
174 | 195 | </div> | ... | ... |