Commit c377c98f3b3473e525df7ae770d51c689f0a04aa

Authored by mwasiluk
2 parents 93a54ea8 38120605

Merge remote-tracking branch 'upstream/master'

Showing 65 changed files with 2886 additions and 6212 deletions
.htaccess 0 → 100644
  1 +RewriteEngine On
  2 +RewriteCond %{REQUEST_FILENAME} !-f
  3 +RewriteRule ^ index.php [QSA,L]
0 4 \ No newline at end of file
... ...
alasql-utility/alasql-utility.js
... ... @@ -125,7 +125,8 @@ function _addParenthesis (fields) {
125 125 }
126 126  
127 127 function _normalizeField (field) {
128   - return "[" + field + "]";
  128 + return "`" + field + "`";
  129 + //return "[" + field + "]";
129 130 }
130 131  
131 132 function alasql_transformData (data, fields, round) {
... ...
bower_components/jsdatachecker/.bower.json
1 1 {
2 2 "name": "jsdatachecker",
3   - "version": "0.1.1",
  3 + "version": "0.1.3",
4 4 "homepage": "https://github.com/donpir/jsdatachecker",
5 5 "authors": [
6 6 "'Donato Pirozzi <'donatopirozzi@gmail.com'>"
... ... @@ -19,17 +19,16 @@
19 19 "polymer": "Polymer/polymer#1.2.0",
20 20 "qunit": "~1.22.0",
21 21 "csvjson": "0.1.1",
22   - "polywc": "https://github.com/donpir/polywc.git#master"
  22 + "polywc-data-table": "https://github.com/donpir/polywc-data-table.git#master"
23 23 },
24 24 "private": false,
25   - "_release": "0.1.1",
  25 + "_release": "0.1.3",
26 26 "_resolution": {
27 27 "type": "version",
28   - "tag": "v0.1.1",
29   - "commit": "60887fda0d7e7388c5d682228ee1288dd7bcdd09"
  28 + "tag": "v0.1.3",
  29 + "commit": "186392b9d8576e98e269150ab2a88562215a2b2a"
30 30 },
31 31 "_source": "https://github.com/donpir/JSDataChecker.git",
32   - "_target": "~0.1.1",
33   - "_originalSource": "jsdatachecker",
34   - "_direct": true
  32 + "_target": "~0.1.2",
  33 + "_originalSource": "jsdatachecker"
35 34 }
36 35 \ No newline at end of file
... ...
bower_components/jsdatachecker/bower.json
1 1 {
2 2 "name": "jsdatachecker",
3   - "version": "v0.1.1",
  3 + "version": "v0.1.3",
4 4 "homepage": "https://github.com/donpir/jsdatachecker",
5 5 "authors": [
6 6 "'Donato Pirozzi <'donatopirozzi@gmail.com'>"
... ... @@ -19,7 +19,7 @@
19 19 "polymer": "Polymer/polymer#1.2.0",
20 20 "qunit": "~1.22.0",
21 21 "csvjson": "0.1.1",
22   - "polywc": "https://github.com/donpir/polywc.git#master"
  22 + "polywc-data-table": "https://github.com/donpir/polywc-data-table.git#master"
23 23 },
24 24 "private": false
25 25 }
... ...
bower_components/jsdatachecker/build.cmd
1 1 del jsdatachecker.min.js
2   -uglifyjs src\ArrayUtils.js src\DataTypeConverter.js src\DataTypesUtils.js src\DataTypeHierarchy.js --compress -o jsdatachecker.min.js
3 2 \ No newline at end of file
  3 +uglifyjs src\ArrayUtils.js src\DataTypeConverter.js src\DataTypesUtils.js src\DataTypeHierarchy.js src\langs.js --compress -o jsdatachecker.min.js
4 4 \ No newline at end of file
... ...
bower_components/jsdatachecker/jsdatachecker.min.js
1   -function ArrayUtils(){}function DataTypeConverter(){this._fields=[],this._numOfRows=0}function DataTypesUtils(){}function DataTypeHierarchy(){}ArrayUtils.TestAndSet=function(arr,key,object){return"undefined"==typeof arr?null:0==Array.isArray(arr)?null:("undefined"==typeof arr[key]&&(arr[key]=object),arr[key])},ArrayUtils.TestAndInitializeKey=function(obj,key,value){return"undefined"==typeof obj?null:("undefined"==typeof obj[key]&&(obj[key]=value),obj[key])},ArrayUtils.TestAndIncrement=function(arr,key){var exists=arr[key];return"undefined"==typeof exists&&(arr[key]=0),arr[key]++,arr},ArrayUtils.toFieldsArray=function(obj){var fields=[];return ArrayUtils.IteratorOverKeys(obj,function(field,key){field.key=key,fields.push(field)}),fields},ArrayUtils.IteratorOverKeys=function(arr,callback){for(var property in arr)if(arr.hasOwnProperty(property)){var item=arr[property];callback(item,property)}},ArrayUtils.FindMinMax=function(arr,fncompare){var max1=null,max2=null;for(var key in arr)null==max1||fncompare(arr[key],max1.value)?(max2=max1,max1={index:-1,key:key,value:arr[key]}):(null==max2||fncompare(arr[key],max2.value))&&(max2={index:-1,key:key,value:arr[key]});return{first:max1,second:max2}},ArrayUtils.isArray=function(arr){return Array.isArray(arr)?arr.length>0:!1},DataTypeConverter.TYPES={TEXT:{value:0,name:"TEXT"},CODE:{value:1,name:"CODE"},NUMBER:{value:2,name:"NUMBER"},OBJECT:{value:3,name:"OBJECT"},BOOL:{value:5,name:"BOOL"},CONST:{value:6,name:"CONST"},CATEGORY:{value:7,name:"CATEGORY"},DATETIME:{value:8,name:"DATETIME"},EMPTY:{value:101,name:"NULL"}},DataTypeConverter.SUBTYPES={GEOCOORDINATE:{value:1e3,name:"GEOCOORDINATE"},GEOJSON:{value:1001,name:"GEOJSON"},PERCENTAGE:{value:1100,name:"PERCENTAGE"},LATITUDE:{value:1101,name:"LATITUDE"},LONGITUDE:{value:1102,name:"LONGITUDE"}},DataTypeConverter.GEOJSONTYPES=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","GeometryCollection"],DataTypeConverter.prototype=function(){var _analyseDataTypes=function(fields){ArrayUtils.IteratorOverKeys(fields,function(field){if(field._inferredTypes[DataTypeConverter.TYPES.CODE.name]){var confidence=field._inferredTypes[DataTypeConverter.TYPES.CODE.name]/field.numOfItems,_numericalInferredType=field._inferredTypes[DataTypeConverter.TYPES.NUMBER.name];return"undefined"!=typeof _numericalInferredType&&(confidence+=_numericalInferredType/field.numOfItems),field.type=DataTypeConverter.TYPES.CODE.name,void(field.typeConfidence=confidence)}var max=ArrayUtils.FindMinMax(field._inferredTypes,function(curval,lastval){return curval>lastval}),tkey=max.first.key;tkey===DataTypeConverter.TYPES.EMPTY.name&&null!=max.second&&"undefined"!=typeof max.second&&(tkey=max.second.key),field.type=tkey,field.typeConfidence=field._inferredTypes[max.first.key]/field.numOfItems;var max=ArrayUtils.FindMinMax(field._inferredSubTypes,function(curval,lastval){return curval>lastval});if(field.subtype=null,null!=max&&null!=max.first){field.subtype=max.first.key,field.subtypeConfidence=field._inferredSubTypes[field.subtype]/field.numOfItems;var fieldName=field.name.toLowerCase(),isLatType=field.subtype===DataTypeConverter.SUBTYPES.LATITUDE.name,fieldNameContainsLat=fieldName.indexOf("lat")>=0,fieldNameContainsLon=fieldName.indexOf("ng")>=0;1==isLatType&&0==fieldNameContainsLat&&1==fieldNameContainsLon&&(field.subtype=DataTypeConverter.SUBTYPES.LONGITUDE.name)}})},_processInferType=function(value){if(null===value||"undefined"==typeof value)return DataTypeConverter.TYPES.EMPTY;if("object"==typeof value)return DataTypeConverter.TYPES.OBJECT;if(/^0[0-9]+$/.test(value))return DataTypeConverter.TYPES.CODE;var isnumber=DataTypesUtils.FilterFloat(value);if(isNaN(isnumber)!==!0)return DataTypeConverter.TYPES.NUMBER;var _date=DataTypesUtils.FilterDateTime(value);return 0==isNaN(_date)&&null!=_date?DataTypeConverter.TYPES.DATETIME:DataTypeConverter.TYPES.TEXT},_processInferSubType=function(value){if(null===value||"undefined"==typeof value)return null;if(Array.isArray(value)&&2==value.length&&NaN!=DataTypesUtils.FilterFloat(value[0])&&NaN!=DataTypesUtils.FilterFloat(value[1])&&DataTypesUtils.DecimalPlaces(value[0])>4&&DataTypesUtils.DecimalPlaces(value[1])>4)return DataTypeConverter.SUBTYPES.GEOCOORDINATE;if("string"==typeof value){var split=value.split(",");if(DataTypesUtils.IsLatLng(split[0])&&DataTypesUtils.IsLatLng(split[1]))return DataTypeConverter.SUBTYPES.GEOCOORDINATE}var isnumber=DataTypesUtils.FilterFloat(value);if(isNaN(isnumber)!==!0)return isnumber>=-90&&90>=isnumber&&DataTypesUtils.DecimalPlaces(isnumber)>=5?DataTypeConverter.SUBTYPES.GEOCOORDINATE:isnumber>=-180&&180>=isnumber&&DataTypesUtils.DecimalPlaces(isnumber)>=5?DataTypeConverter.SUBTYPES.GEOCOORDINATE:null;if("object"==typeof value&&value.hasOwnProperty("type")){var geotype=value.type,isincluded=DataTypeConverter.GEOJSONTYPES.includes(geotype);if(isincluded)return DataTypeConverter.SUBTYPES.GEOJSON}return null},_filterBasedOnThreshold=function(metadata,threshold){return ArrayUtils.IteratorOverKeys(metadata.types,function(fieldType,key){if(!(fieldType.typeConfidence>=threshold)){var arrHierarchyTypes=DataTypeHierarchy.HIERARCHY[fieldType.type];if(null==arrHierarchyTypes)return metadata;var lastFieldType={lastType:arrHierarchyTypes[0],lastTypeCounter:fieldType._inferredTypes[arrHierarchyTypes[0]],typeConfidence:0};lastFieldType.typeConfidence=lastFieldType.lastTypeCounter/fieldType.numOfItems;for(var curType,i=1;i<arrHierarchyTypes.length,curType=arrHierarchyTypes[i];i++){var numItemsOfCurType=fieldType._inferredTypes.hasOwnProperty(curType)?fieldType._inferredTypes[curType]:0;if(lastFieldType.lastType=curType,lastFieldType.lastTypeCounter+=numItemsOfCurType,lastFieldType.typeConfidence=lastFieldType.lastTypeCounter/fieldType.numOfItems,lastFieldType.typeConfidence>=threshold){fieldType.type=lastFieldType.lastType,fieldType.typeConfidence=lastFieldType.typeConfidence;break}}}}),metadata},jsonTraverse=function(json,fieldKeys,callback){var stack=[],numOfRows=0;for(stack.push({item:json,fieldKeyIndex:0});stack.length>0;){var stackTask=stack.pop(),item=stackTask.item,fieldKeyIndex=stackTask.fieldKeyIndex,fieldKey=fieldKeys[fieldKeyIndex];if("*"!=fieldKey||0!=ArrayUtils.isArray(item))if("*"!=fieldKey||1!=ArrayUtils.isArray(item)){var jsonSubtree=item[fieldKey];if(Array.isArray(jsonSubtree))for(var j=0;j<jsonSubtree.length;j++){var jsonItem=jsonSubtree[j];stack.push({item:jsonItem,fieldKeyIndex:fieldKeyIndex+1})}else stack.push({item:jsonSubtree,fieldKeyIndex:fieldKeyIndex+1})}else for(var cell,j=0;j<item.length&&(cell=item[j]);j++)stack.push({item:cell,fieldKeyIndex:fieldKeyIndex}),numOfRows++;else{var sProcessedKeys=fieldKeys.slice(0,fieldKeyIndex).toString();ArrayUtils.IteratorOverKeys(item,function(value,key){var curKey=sProcessedKeys+(sProcessedKeys.length>0?",":"")+key,_value=callback(value,key,curKey,numOfRows);item[key]=_value}),numOfRows++}}};return{constructor:DataTypeConverter,cast:function(metadata,options){return"undefined"!=typeof options&&null!=options||(options={castThresholdConfidence:1,castIfNull:!1}),this.convert(metadata,options)},convert:function(metadata,options){var lastRowIndex=0,numOfRows=0,numOfValues=0,datasetErrors=0,datasetMissingValues=0;return"undefined"!=typeof options&&null!=options||(options={castThresholdConfidence:1,castIfNull:!1}),jsonTraverse(metadata.dataset,metadata.fieldKeys,function(value,key,traversedKeys,rowIndex){var inferredType=metadata.types[traversedKeys];numOfValues++,lastRowIndex!=rowIndex&&(lastRowIndex=rowIndex,numOfRows++),null==value||"undefined"==typeof value||0==(value+"").length;var isCast=inferredType.typeConfidence>=options.castThresholdConfidence;if(inferredType.type==DataTypeConverter.TYPES.NUMBER.name&&isCast){var number=parseFloat(value);return isNaN(number)?(datasetErrors++,value):number}return value}),metadata.qualityIndex.notNullValues=(numOfValues-datasetMissingValues)/numOfValues,metadata.qualityIndex.errors=(numOfValues-datasetErrors)/numOfValues,metadata},inferJsonDataType:function(json,fieldKeys,options){"undefined"!=typeof options&&null!=options||(options={thresholdConfidence:1});var stack=[],fieldsType={},numOfRows=0;if("undefined"==typeof fieldKeys)throw"IllegalArgumentException: undefined json path to analyse.";for(stack.push({item:json,fieldKeyIndex:0});stack.length>0;){var stackTask=stack.pop(),item=stackTask.item,fieldKeyIndex=stackTask.fieldKeyIndex,fieldKey=fieldKeys[fieldKeyIndex];if("*"!=fieldKey||0!=ArrayUtils.isArray(item))if("*"==fieldKey&&ArrayUtils.isArray(item))for(var cell,j=0;j<item.length&&(cell=item[j]);j++)stack.push({item:cell,fieldKeyIndex:fieldKeyIndex}),numOfRows++;else{var jsonSubtree=item[fieldKey];if(Array.isArray(jsonSubtree))for(var j=0;j<jsonSubtree.length;j++){var jsonItem=jsonSubtree[j];stack.push({item:jsonItem,fieldKeyIndex:fieldKeyIndex+1})}else stack.push({item:jsonSubtree,fieldKeyIndex:fieldKeyIndex+1})}else{var sProcessedKeys=fieldKeys.slice(0,fieldKeyIndex).toString();ArrayUtils.IteratorOverKeys(item,function(item,key){var curKey=sProcessedKeys+(0==sProcessedKeys.length?"":",")+key,fieldType=ArrayUtils.TestAndInitializeKey(fieldsType,curKey,{name:curKey,_inferredTypes:[],_inferredSubTypes:[],_inferredValues:[],numOfItems:0});fieldType.numOfItems++;var inferredType=_processInferType(item);ArrayUtils.TestAndIncrement(fieldType._inferredTypes,inferredType.name),inferredType===DataTypeConverter.TYPES.TEXT&&ArrayUtils.TestAndIncrement(fieldType._inferredValues,item);var inferredSubType=_processInferSubType(item);null!=inferredSubType&&"undefined"!=typeof inferredSubType&&ArrayUtils.TestAndIncrement(fieldType._inferredSubTypes,inferredSubType.name)}),numOfRows++}}_analyseDataTypes(fieldsType);var quality={homogeneity:1,completeness:1,totalNullValues:0,totalValues:0};ArrayUtils.IteratorOverKeys(fieldsType,function(fieldType){quality.totalValues+=fieldType.numOfItems,quality.homogeneity*=fieldType.typeConfidence,fieldType.totalNullValues=0,fieldType._inferredTypes.hasOwnProperty(DataTypeConverter.TYPES.EMPTY.name)&&(fieldType.totalNullValues=fieldType._inferredTypes[DataTypeConverter.TYPES.EMPTY.name],quality.totalNullValues+=fieldType.totalNullValues)}),quality.homogeneity=Math.round(100*quality.homogeneity)/100;var totFullValues=quality.totalValues-quality.totalNullValues;quality.completeness=Math.round(totFullValues/quality.totalValues*100)/100;var warningsTextual="";ArrayUtils.IteratorOverKeys(fieldsType,function(fieldType){fieldType.errorsDescription="";var description="";if(fieldType.typeConfidence<1){var incorrect=fieldType.numOfItems-fieldType.totalNullValues-fieldType._inferredTypes[fieldType.type];if(incorrect>0){description+="The column <"+fieldType.name+"> has the type <"+fieldType.type+">";var verb=1==incorrect?" value is":" values are";description+=", but "+incorrect+verb+" not a "+fieldType.type}}fieldType.totalNullValues>0&&(description+="The column <"+fieldType.name+"> has "+fieldType.totalNullValues+" EMPTY value",fieldType.totalNullValues>1&&(description+="s")),description.length>0&&(description+="."),fieldType.errorsDescription=description,warningsTextual+=description});var metadata={dataset:json,fieldKeys:fieldKeys,types:fieldsType,qualityIndex:quality,warningsTextual:warningsTextual};return _filterBasedOnThreshold(metadata,options.thresholdConfidence),metadata},inferDataTypeOfValue:function(value){return _processInferType(value)},inferDataSubTypeOfValue:function(value){return _processInferSubType(value)}}}(),DataTypesUtils.FilterTime=function(value){var expTime=/^[0-9]{2}:[0-9]{2}(:[0-9]{2})?(\+[0-9]{2}:[0-9]{2})?$/;if(0==expTime.test(value))return null;var splitted=value.split(/[:|\+]/),expNumber=/^[0-9]{2}$/,HH=expNumber.test(splitted[0])?parseInt(splitted[0]):0,MM=expNumber.test(splitted[1])?parseInt(splitted[1]):0,SS=splitted.length>=3&&expNumber.test(splitted[2])?parseInt(splitted[2]):0,dt=new Date;return dt.setHours(HH),dt.setMinutes(MM),dt.setSeconds(SS),dt},DataTypesUtils.FilterDateTime=function(value){var _dtSplitted=value.split(/[T|\s]/);if(2==_dtSplitted.length){var dtTime=DataTypesUtils.FilterTime(_dtSplitted[1]);if(null==dtTime)return null;var dtDateTime=DataTypesUtils.FilterDate(_dtSplitted[0],dtTime);return dtDateTime}var dtDate=DataTypesUtils.FilterDate(value);if(null!=dtDate)return dtDate;var dtTime=DataTypesUtils.FilterTime(value);return dtTime},DataTypesUtils.FilterDate=function(value,dtDate){if(null==dtDate&&(dtDate=new Date),/^[0-9][0-9][0-9][0-9]\-[0-9][0-9]$/.test(value)){var year=parseInt(value.substring(0,4)),month=parseInt(value.substring(5));return dtDate.setYear(year),dtDate.setMonth(month),dtDate}var expDate=/^[0-9]{4}(\-|\/)[0-9]{2}((\-|\/)[0-9]{2})?$/;if(expDate.test(value)){var splitted=value.split(/[\-|\/]/),year=parseInt(splitted[0]),month=parseInt(splitted[1]),day=3==splitted.length?parseInt(splitted[2]):0;return dtDate.setYear(year),dtDate.setMonth(month),dtDate.setDate(day),dtDate}if(expDate=/^[0-9]{2}(\-|\/)[0-9]{2}(\-|\/)[0-9]{4}$/,expDate.test(value)){var splitted=value.split(/[\-|\/]/),year=parseInt(splitted[2]),month=parseInt(splitted[1]),day=parseInt(splitted[0]);return dtDate.setYear(year),dtDate.setMonth(month),dtDate.setDate(day),dtDate}return null},DataTypesUtils.FilterFloat=function(value){return/^(\-|\+)?((0|([1-9][0-9]*))(\.[0-9]+)?|Infinity)$/.test(value)?Number(value):NaN},DataTypesUtils.DecimalPlaces=function(num){var match=(""+num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return match?Math.max(0,(match[1]?match[1].length:0)-(match[2]?+match[2]:0)):0},DataTypesUtils.IsLatLng=function(num){return NaN==DataTypesUtils.FilterFloat(num)?!1:DataTypesUtils.DecimalPlaces(num)>4},DataTypeHierarchy.HIERARCHY=[],DataTypeHierarchy.HIERARCHY[DataTypeConverter.TYPES.TEXT.name]=[DataTypeConverter.TYPES.TEXT.name],DataTypeHierarchy.HIERARCHY[DataTypeConverter.TYPES.NUMBER.name]=[DataTypeConverter.TYPES.NUMBER.name,DataTypeConverter.TYPES.TEXT.name],DataTypeHierarchy.HIERARCHY[DataTypeConverter.TYPES.DATETIME.name]=[DataTypeConverter.TYPES.DATETIME.name,DataTypeConverter.TYPES.TEXT.name],DataTypeHierarchy.HIERARCHY[DataTypeConverter.SUBTYPES.GEOCOORDINATE.name]=[DataTypeConverter.SUBTYPES.GEOCOORDINATE.name,DataTypeConverter.TYPES.NUMBER.name,DataTypeConverter.TYPES.TEXT.name],DataTypeHierarchy.canConvert=function(fromType,toType){var arrConvertableTypes=DataTypeHierarchy.HIERARCHY[fromType],idx=arrConvertableTypes.indexOf(toType);return idx>=0};
2 1 \ No newline at end of file
  2 +function ArrayUtils(){}function DataTypeConverter(){this._fields=[],this._numOfRows=0}function DataTypesUtils(){}function DataTypeHierarchy(){}ArrayUtils.TestAndSet=function(arr,key,object){return"undefined"==typeof arr?null:0==Array.isArray(arr)?null:("undefined"==typeof arr[key]&&(arr[key]=object),arr[key])},ArrayUtils.TestAndInitializeKey=function(obj,key,value){return"undefined"==typeof obj?null:("undefined"==typeof obj[key]&&(obj[key]=value),obj[key])},ArrayUtils.TestAndIncrement=function(arr,key){var exists=arr[key];return"undefined"==typeof exists&&(arr[key]=0),arr[key]++,arr},ArrayUtils.toFieldsArray=function(obj){var fields=[];return ArrayUtils.IteratorOverKeys(obj,function(field,key){field.key=key,fields.push(field)}),fields},ArrayUtils.IteratorOverKeys=function(arr,callback){for(var property in arr)if(arr.hasOwnProperty(property)){var item=arr[property];callback(item,property)}},ArrayUtils.FindMinMax=function(arr,fncompare){var max1=null,max2=null;for(var key in arr)null==max1||fncompare(arr[key],max1.value)?(max2=max1,max1={index:-1,key:key,value:arr[key]}):(null==max2||fncompare(arr[key],max2.value))&&(max2={index:-1,key:key,value:arr[key]});return{first:max1,second:max2}},ArrayUtils.isArray=function(arr){return Array.isArray(arr)?arr.length>0:!1},DataTypeConverter.TYPES={EMPTY:{value:0,name:"NULL"},TEXT:{value:1,name:"TEXT"},NUMBER:{value:2,name:"NUMBER"},OBJECT:{value:3,name:"OBJECT"},DATETIME:{value:4,name:"DATETIME"}},DataTypeConverter.SUBTYPES={GEOCOORDINATE:{value:1e3,name:"GEOCOORDINATE"},GEOJSON:{value:1001,name:"GEOJSON"},BOOL:{value:1002,name:"BOOL"},CONST:{value:1003,name:"CONST"},CATEGORY:{value:1004,name:"CATEGORY"},PERCENTAGE:{value:1100,name:"PERCENTAGE"},LATITUDE:{value:1101,name:"LATITUDE"},LONGITUDE:{value:1102,name:"LONGITUDE"}},DataTypeConverter.LANGS={EN:{value:1e3,name:"EN"},IT:{value:1001,name:"IT"},FR:{value:1100,name:"FR"},NL:{value:1101,name:"NL"}},DataTypeConverter.GEOJSONTYPES=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","GeometryCollection","Feature","FeatureCollection"],DataTypeConverter.prototype=function(){var _analyseDataTypes=function(fields){ArrayUtils.IteratorOverKeys(fields,function(field){var max=ArrayUtils.FindMinMax(field._inferredTypes,function(curval,lastval){return curval>lastval}),tkey=max.first.key;tkey===DataTypeConverter.TYPES.EMPTY.name&&null!=max.second&&"undefined"!=typeof max.second&&(tkey=max.second.key),field.type=tkey,field.typeConfidence=field._inferredTypes[max.first.key]/field.numOfItems;var max=ArrayUtils.FindMinMax(field._inferredSubTypes,function(curval,lastval){return curval>lastval});if(field.subtype=null,null!=max&&null!=max.first){field.subtype=max.first.key,field.subtypeConfidence=field._inferredSubTypes[field.subtype]/field.numOfItems;var fieldName=field.name.toLowerCase(),isLatType=field.subtype===DataTypeConverter.SUBTYPES.LATITUDE.name,fieldNameContainsLat=fieldName.indexOf("lat")>=0,fieldNameContainsLon=fieldName.indexOf("ng")>=0;1==isLatType&&0==fieldNameContainsLat&&1==fieldNameContainsLon&&(field.subtype=DataTypeConverter.SUBTYPES.LONGITUDE.name)}})},_processInferType=function(value){if(null===value||"undefined"==typeof value)return DataTypeConverter.TYPES.EMPTY;if("object"==typeof value)return DataTypeConverter.TYPES.OBJECT;var isnumber=DataTypesUtils.FilterNumber(value);if(isNaN(isnumber)!==!0)return DataTypeConverter.TYPES.NUMBER;var _date=DataTypesUtils.FilterDateTime(value);return 0==isNaN(_date)&&null!=_date?DataTypeConverter.TYPES.DATETIME:DataTypeConverter.TYPES.TEXT},_processInferSubType=function(value){if(null===value||"undefined"==typeof value)return null;if(Array.isArray(value)&&2==value.length&&NaN!=DataTypesUtils.FilterNumber(value[0])&&NaN!=DataTypesUtils.FilterNumber(value[1])&&DataTypesUtils.DecimalPlaces(value[0])>4&&DataTypesUtils.DecimalPlaces(value[1])>4)return DataTypeConverter.SUBTYPES.GEOCOORDINATE;if("string"==typeof value){var split=value.split(",");if(DataTypesUtils.IsLatLng(split[0])&&DataTypesUtils.IsLatLng(split[1]))return DataTypeConverter.SUBTYPES.GEOCOORDINATE}var isnumber=DataTypesUtils.FilterNumber(value);if(isNaN(isnumber)!==!0)return isnumber>=-90&&90>=isnumber&&DataTypesUtils.DecimalPlaces(isnumber)>=5?DataTypeConverter.SUBTYPES.GEOCOORDINATE:isnumber>=-180&&180>=isnumber&&DataTypesUtils.DecimalPlaces(isnumber)>=5?DataTypeConverter.SUBTYPES.GEOCOORDINATE:null;if("object"==typeof value&&value.hasOwnProperty("type")){var geotype=value.type,isincluded=DataTypeConverter.GEOJSONTYPES.includes(geotype);if(isincluded)return DataTypeConverter.SUBTYPES.GEOJSON}return null},_filterBasedOnThreshold=function(metadata,threshold){return ArrayUtils.IteratorOverKeys(metadata.types,function(fieldType,key){if(!(fieldType.typeConfidence>=threshold)){var arrHierarchyTypes=DataTypeHierarchy.HIERARCHY[fieldType.type];if(null==arrHierarchyTypes)return metadata;var lastFieldType={lastType:arrHierarchyTypes[0],lastTypeCounter:fieldType._inferredTypes[arrHierarchyTypes[0]],typeConfidence:0};lastFieldType.typeConfidence=lastFieldType.lastTypeCounter/fieldType.numOfItems;for(var curType,i=1;i<arrHierarchyTypes.length,curType=arrHierarchyTypes[i];i++){var numItemsOfCurType=fieldType._inferredTypes.hasOwnProperty(curType)?fieldType._inferredTypes[curType]:0;if(lastFieldType.lastType=curType,lastFieldType.lastTypeCounter+=numItemsOfCurType,lastFieldType.typeConfidence=lastFieldType.lastTypeCounter/fieldType.numOfItems,lastFieldType.typeConfidence>=threshold){fieldType.type=lastFieldType.lastType,fieldType.typeConfidence=lastFieldType.typeConfidence;break}}}}),metadata},_capitalizeFirstLetter=function(string){return string.charAt(0).toUpperCase()+string.slice(1)},jsonTraverse=function(json,fieldKeys,callback){var stack=[],numOfRows=0;for(stack.push({item:json,fieldKeyIndex:0});stack.length>0;){var stackTask=stack.pop(),item=stackTask.item,fieldKeyIndex=stackTask.fieldKeyIndex,fieldKey=fieldKeys[fieldKeyIndex];if("*"!=fieldKey||0!=ArrayUtils.isArray(item))if("*"!=fieldKey||1!=ArrayUtils.isArray(item)){var jsonSubtree=item[fieldKey];if(Array.isArray(jsonSubtree))for(var j=0;j<jsonSubtree.length;j++){var jsonItem=jsonSubtree[j];stack.push({item:jsonItem,fieldKeyIndex:fieldKeyIndex+1})}else stack.push({item:jsonSubtree,fieldKeyIndex:fieldKeyIndex+1})}else for(var cell,j=0;j<item.length&&(cell=item[j]);j++)stack.push({item:cell,fieldKeyIndex:fieldKeyIndex}),numOfRows++;else{var sProcessedKeys=fieldKeys.slice(0,fieldKeyIndex).toString();ArrayUtils.IteratorOverKeys(item,function(value,key){var curKey=sProcessedKeys+(sProcessedKeys.length>0?",":"")+key,_value=callback(value,key,curKey,numOfRows);item[key]=_value}),numOfRows++}}};return{constructor:DataTypeConverter,cast:function(metadata,options){return"undefined"!=typeof options&&null!=options||(options={castThresholdConfidence:1,castIfNull:!1,makeChangesToDataset:!1}),this.convert(metadata,options)},convert:function(metadata,options){var lastRowIndex=0,numOfRows=0,numOfValues=0,datasetErrors=0,datasetMissingValues=0;return"undefined"!=typeof options&&null!=options||(options={castThresholdConfidence:1,castIfNull:!1,makeChangesToDataset:!1}),jsonTraverse(metadata.dataset,metadata.fieldKeys,function(value,key,traversedKeys,rowIndex){var inferredType=metadata.types[traversedKeys];numOfValues++,lastRowIndex!=rowIndex&&(lastRowIndex=rowIndex,numOfRows++),null==value||"undefined"==typeof value||0==(value+"").length;var isCast=inferredType.typeConfidence>=options.castThresholdConfidence;if(inferredType.type==DataTypeConverter.TYPES.NUMBER.name&&isCast){0==isNaN(DataTypesUtils.FilterNumber(value))&&"string"==typeof value&&(value=value.replace(",","."));var number=parseFloat(value);return isNaN(number)?(datasetErrors++,value):number}return value}),metadata.qualityIndex.notNullValues=(numOfValues-datasetMissingValues)/numOfValues,metadata.qualityIndex.errors=(numOfValues-datasetErrors)/numOfValues,metadata},inferJsonDataType:function(json,fieldKeys,options){"undefined"!=typeof options&&null!=options||(options={}),0==options.hasOwnProperty("thresholdConfidence")&&(options.thresholdConfidence=1),0==options.hasOwnProperty("language")?options.language=DataTypeConverter.LANGS.EN.name:options.language=options.language.toUpperCase();var stack=[],fieldsType={},numOfRows=0;if("undefined"==typeof fieldKeys)throw"IllegalArgumentException: undefined json path to analyse.";for(stack.push({item:json,fieldKeyIndex:0});stack.length>0;){var stackTask=stack.pop(),item=stackTask.item,fieldKeyIndex=stackTask.fieldKeyIndex,fieldKey=fieldKeys[fieldKeyIndex];if("*"!=fieldKey||0!=ArrayUtils.isArray(item))if("*"==fieldKey&&ArrayUtils.isArray(item))for(var cell,j=0;j<item.length&&(cell=item[j]);j++)stack.push({item:cell,fieldKeyIndex:fieldKeyIndex}),numOfRows++;else{var jsonSubtree=item[fieldKey];if(Array.isArray(jsonSubtree))for(var j=0;j<jsonSubtree.length;j++){var jsonItem=jsonSubtree[j];stack.push({item:jsonItem,fieldKeyIndex:fieldKeyIndex+1})}else stack.push({item:jsonSubtree,fieldKeyIndex:fieldKeyIndex+1})}else{var sProcessedKeys=fieldKeys.slice(0,fieldKeyIndex).toString();ArrayUtils.IteratorOverKeys(item,function(item,key){var curKey=sProcessedKeys+(0==sProcessedKeys.length?"":",")+key,fieldType=ArrayUtils.TestAndInitializeKey(fieldsType,curKey,{name:curKey,_inferredTypes:[],_inferredSubTypes:[],_inferredValues:[],numOfItems:0});fieldType.numOfItems++;var inferredType=_processInferType(item);ArrayUtils.TestAndIncrement(fieldType._inferredTypes,inferredType.name),inferredType===DataTypeConverter.TYPES.TEXT&&ArrayUtils.TestAndIncrement(fieldType._inferredValues,item);var inferredSubType=_processInferSubType(item);null!=inferredSubType&&"undefined"!=typeof inferredSubType&&ArrayUtils.TestAndIncrement(fieldType._inferredSubTypes,inferredSubType.name)}),numOfRows++}}var _numOfRows=0;ArrayUtils.IteratorOverKeys(fieldsType,function(fieldType){fieldType.numOfItems>_numOfRows&&(_numOfRows=fieldType.numOfItems)}),ArrayUtils.IteratorOverKeys(fieldsType,function(fieldType){fieldType._inferredTypes.hasOwnProperty(DataTypeConverter.TYPES.EMPTY.name)||(fieldType._inferredTypes[DataTypeConverter.TYPES.EMPTY.name]=0),fieldType._inferredTypes[DataTypeConverter.TYPES.EMPTY.name]=fieldType._inferredTypes[DataTypeConverter.TYPES.EMPTY.name]+(_numOfRows-fieldType.numOfItems)}),_analyseDataTypes(fieldsType);var quality={homogeneity:1,completeness:1,totalNullValues:0,totalValues:0};ArrayUtils.IteratorOverKeys(fieldsType,function(fieldType){quality.totalValues+=fieldType.numOfItems,quality.homogeneity*=fieldType.typeConfidence,fieldType.totalNullValues=0,fieldType._inferredTypes.hasOwnProperty(DataTypeConverter.TYPES.EMPTY.name)&&(fieldType.totalNullValues=fieldType._inferredTypes[DataTypeConverter.TYPES.EMPTY.name],quality.totalNullValues+=fieldType.totalNullValues)}),quality.homogeneity=Math.round(100*quality.homogeneity)/100;var totFullValues=quality.totalValues-quality.totalNullValues;quality.completeness=Math.round(totFullValues/quality.totalValues*100)/100;var warningsTextual="";ArrayUtils.IteratorOverKeys(fieldsType,function(fieldType){fieldType.errorsDescription="";var description="";if(fieldType.typeConfidence<1){var incorrect=fieldType.numOfItems-fieldType.totalNullValues-fieldType._inferredTypes[fieldType.type];if(incorrect>0){var _descr1=_capitalizeFirstLetter(JDC_LNG.key_declaretype[options.language])+".",_descr2=_capitalizeFirstLetter(JDC_LNG.key_notoftype_singular[options.language])+".";incorrect>1&&(_descr2=_capitalizeFirstLetter(JDC_LNG.key_notoftype_plural[options.language])+".");var descr=_descr1+" "+_descr2;descr=descr.replace(/%COL_NAME/g,fieldType.name),descr=descr.replace(/%COL_TYPE/g,fieldType.type),descr=descr.replace(/%COL_ERRORS/g,incorrect),description+=descr}}var descr="";1==fieldType.totalNullValues?descr=_capitalizeFirstLetter(JDC_LNG.key_emptyvalue_singolar[options.language])+".":fieldType.totalNullValues>1&&(descr=_capitalizeFirstLetter(JDC_LNG.key_emptyvalue_plural[options.language])+"."),descr=descr.replace(/%COL_NAME/g,fieldType.name),descr=descr.replace(/%COL_TYPE/g,fieldType.type),descr=descr.replace(/%COL_NULLVALUES/g,fieldType.totalNullValues),description=description+" "+descr,fieldType.errorsDescription=description.trim(),warningsTextual+=description.trim()});var metadata={dataset:json,fieldKeys:fieldKeys,types:fieldsType,qualityIndex:quality,warningsTextual:warningsTextual};return _filterBasedOnThreshold(metadata,options.thresholdConfidence),metadata},inferDataTypeOfValue:function(value){return _processInferType(value)},inferDataSubTypeOfValue:function(value){return _processInferSubType(value)}}}(),DataTypesUtils.FilterTime=function(value){var expTime=/^[0-9]{2}:[0-9]{2}(:[0-9]{2})?(\+[0-9]{2}:[0-9]{2})?$/;if(0==expTime.test(value))return null;var splitted=value.split(/[:|\+]/),expNumber=/^[0-9]{2}$/,HH=expNumber.test(splitted[0])?parseInt(splitted[0]):0,MM=expNumber.test(splitted[1])?parseInt(splitted[1]):0,SS=splitted.length>=3&&expNumber.test(splitted[2])?parseInt(splitted[2]):0,dt=new Date;return dt.setHours(HH),dt.setMinutes(MM),dt.setSeconds(SS),dt},DataTypesUtils.FilterDateTime=function(value){var _dtSplitted=value.split(/[T|\s]/);if(2==_dtSplitted.length){var dtTime=DataTypesUtils.FilterTime(_dtSplitted[1]);if(null==dtTime)return null;var dtDateTime=DataTypesUtils.FilterDate(_dtSplitted[0],dtTime);return dtDateTime}var dtDate=DataTypesUtils.FilterDate(value);if(null!=dtDate)return dtDate;var dtTime=DataTypesUtils.FilterTime(value);return dtTime},DataTypesUtils.FilterDate=function(value,dtDate){if(null==dtDate&&(dtDate=new Date),/^[0-9][0-9][0-9][0-9]\-[0-9][0-9]$/.test(value)){var year=parseInt(value.substring(0,4)),month=parseInt(value.substring(5));return dtDate.setYear(year),dtDate.setMonth(month),dtDate}var expDate=/^[0-9]{4}(\-|\/)[0-9]{2}((\-|\/)[0-9]{2})?$/;if(expDate.test(value)){var splitted=value.split(/[\-|\/]/),year=parseInt(splitted[0]),month=parseInt(splitted[1]),day=3==splitted.length?parseInt(splitted[2]):0;return dtDate.setYear(year),dtDate.setMonth(month),dtDate.setDate(day),dtDate}if(expDate=/^[0-9]{2}(\-|\/)[0-9]{2}(\-|\/)[0-9]{4}$/,expDate.test(value)){var splitted=value.split(/[\-|\/]/),year=parseInt(splitted[2]),month=parseInt(splitted[1]),day=parseInt(splitted[0]);return dtDate.setYear(year),dtDate.setMonth(month),dtDate.setDate(day),dtDate}return null},DataTypesUtils.FilterFloat=function(value){return/^(\-|\+)?((0|([1-9][0-9]*))(\.[0-9]+)?|Infinity)$/.test(value)?Number(value):NaN},DataTypesUtils.FilterNumber=function(value){var valnum=DataTypesUtils.FilterFloat(value);if(0==isNaN(valnum))return valnum;if("string"!=typeof value)return NaN;var idxDot=(value.split(/(,|\.)/g),{idx:value.indexOf("."),sym:"."}),idxComma={idx:value.lastIndexOf(","),sym:","},idxFirst={};idxFirst=-1==idxDot.idx?idxComma:-1==idxComma.idx?idxDot:idxDot.idx<idxComma.idx?idxDot:idxComma;var idxLastDot={idx:value.lastIndexOf("."),sym:"."},idxLastComma={idx:value.lastIndexOf(","),sym:","},idxLast={};idxLast=-1==idxLastDot.idx?idxLastComma:-1==idxLastComma.idx?idxLastDot:idxLastDot.idx>idxLastComma.idx?idxLastDot:idxLastComma;var splitted=value.split(/(\.|,|\-|\+)/g);if(0==splitted.length)return NaN;var numOfDots=0,numOfComma=0,i=0;"-"!=splitted[0]&&"+"!=splitted[0]||(i=1);for(var str;i<splitted.length,str=splitted[i];i++)if("."==str)numOfDots++;else if(","==str)numOfComma++;else if(0==/^(0|([1-9][0-9]*))$/g.test(str))return NaN;var lastValue=splitted[splitted.length-1];if("."==lastValue||","==lastValue||0==lastValue.length)return NaN;if(-1==idxFirst.idx&&-1==idxLast.idx)return DataTypesUtils.FilterFloat(value);if(idxFirst.idx==idxLast.idx&&"."==idxFirst.sym)return Number(value);if(idxFirst.idx==idxLast.idx&&","==idxFirst.sym){var nval=value.replace(",",".");return Number(nval)}return NaN},DataTypesUtils.DecimalPlaces=function(num){var match=(""+num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return match?Math.max(0,(match[1]?match[1].length:0)-(match[2]?+match[2]:0)):0},DataTypesUtils.IsLatLng=function(num){return NaN==DataTypesUtils.FilterFloat(num)?!1:DataTypesUtils.DecimalPlaces(num)>4},DataTypeHierarchy.HIERARCHY=[],DataTypeHierarchy.HIERARCHY[DataTypeConverter.TYPES.TEXT.name]=[DataTypeConverter.TYPES.TEXT.name],DataTypeHierarchy.HIERARCHY[DataTypeConverter.TYPES.NUMBER.name]=[DataTypeConverter.TYPES.NUMBER.name,DataTypeConverter.TYPES.TEXT.name],DataTypeHierarchy.HIERARCHY[DataTypeConverter.TYPES.DATETIME.name]=[DataTypeConverter.TYPES.DATETIME.name,DataTypeConverter.TYPES.TEXT.name],DataTypeHierarchy.HIERARCHY[DataTypeConverter.SUBTYPES.GEOCOORDINATE.name]=[DataTypeConverter.SUBTYPES.GEOCOORDINATE.name,DataTypeConverter.TYPES.NUMBER.name,DataTypeConverter.TYPES.TEXT.name],DataTypeHierarchy.canConvert=function(fromType,toType){var arrConvertableTypes=DataTypeHierarchy.HIERARCHY[fromType],idx=arrConvertableTypes.indexOf(toType);return idx>=0};var JDC_LNG={key_declaretype:{EN:"the column <%COL_NAME> is of type <%COL_TYPE>",IT:"la colonna <%COL_NAME> è di tipo <%COL_TYPE>",FR:"le colum <%COL_NAME> est de type <%COL_TYPE>",NL:"de kolom <%COL_NAME> is van het type <%COL_TYPE>"},key_notoftype_singular:{EN:"a value is not <%COL_TYPE>",IT:"un valore non è un <%COL_TYPE>",FR:"une valeur est pas <%COL_TYPE> se trouvant",NL:"een waarde is niet <%COL_TYPE>"},key_notoftype_plural:{EN:"%COL_ERRORS values are not <%COL_TYPE>",IT:"%COL_ERRORS valori non sono di tipo <%COL_TYPE>",FR:"les valeurs %COL_ERRORS sont du type <%COL_TYPE>",NL:"%COL_ERRORS waarden niet <%COL_TYPE>"},key_emptyvalue_singolar:{EN:"the column <%COL_NAME> has an empty value",IT:"la colonna <%COL_NAME> ha un valore vuoto",FR:"la colonne <%COL_NAME> a une valeur vide",NL:"de kolom <%COL_NAME> heeft een lege waarde"},key_emptyvalue_plural:{EN:"the column <%COL_NAME> has <%COL_NULLVALUES> empty values",IT:"la colonna <%COL_NAME> ha <%COL_NULLVALUES> valori vuoti",FR:"la colonne <%COL_NAME> a <%COL_NULLVALUES> valeurs vide",NL:"de kolom <%COL_NAME> heeft <%COL_NULLVALUES> lege waarde"},key_type:{EN:"type",IT:"tipo",FR:"type",NL:"type"},key_subtype:{EN:"subtype",IT:"sottotipo",FR:"sous-type",NL:"subtype"},key_typetext:{EN:"text",IT:"testo",FR:"texte",NL:"tekst"},key_typenumber:{EN:"number",IT:"numero",FR:"nombre",NL:"aantal"},key_typeobject:{EN:"object",IT:"oggetto",FR:"objet",NL:"voorwerp"},key_typedatetime:{EN:"date or time",IT:"data o orario",FR:"date ou l'heure",NL:"datum of tijd"},key_typeempty:{EN:"empty",IT:"vuoto",FR:"vide",NL:"leeg"},key_typelatitude:{EN:"latitude",IT:"latitudine",FR:"latitude",NL:"breedtegraad"},key_typelongitude:{EN:"longitude",IT:"longitudine",FR:"longitude",NL:"lengtegraad"}};
3 3 \ No newline at end of file
... ...
bower_components/jsdatachecker/src/DataTypeConverter.js
... ... @@ -25,33 +25,39 @@ function DataTypeConverter() {
25 25 };//EndConstructor.
26 26  
27 27 DataTypeConverter.TYPES = {
28   - TEXT : { value: 0, name: "TEXT" },
29   - CODE : { value: 1, name: "CODE"},
  28 + EMPTY : { value: 0, name: "NULL"},
30 29  
  30 + TEXT : { value: 1, name: "TEXT" },
31 31 NUMBER : { value: 2, name: "NUMBER" },
32 32 OBJECT : { value: 3, name: "OBJECT" },
33   -
34   -
35   - BOOL : { value: 5, name: "BOOL"},
36   - CONST : { value: 6, name: "CONST" },
37   - CATEGORY : { value: 7, name: "CATEGORY" },
38   -
39   - DATETIME : { value: 8, name: "DATETIME" },
40   -
41   - EMPTY : { value: 101, name: "NULL" }
  33 + DATETIME : { value: 4, name: "DATETIME" }
42 34 };
43 35  
44 36 DataTypeConverter.SUBTYPES = {
45 37 GEOCOORDINATE : { value: 1000, name: "GEOCOORDINATE" },
46 38 GEOJSON : { value: 1001, name: "GEOJSON" },
  39 + BOOL : { value: 1002, name: "BOOL"},
  40 + CONST : { value: 1003, name: "CONST" },
  41 + CATEGORY : { value: 1004, name: "CATEGORY" },
47 42  
48 43 PERCENTAGE : { value: 1100, name: "PERCENTAGE" },
49 44 LATITUDE : { value: 1101, name: "LATITUDE" },
50 45 LONGITUDE : { value: 1102, name: "LONGITUDE" }
  46 +
  47 + /*CODE : { value: 2000, name: "CODE"},*/
  48 +};
  49 +
  50 +DataTypeConverter.LANGS = {
  51 + EN : { value: 1000, name: "EN" },
  52 + IT : { value: 1001, name: "IT" },
  53 + FR : { value: 1100, name: "FR" },
  54 + NL : { value: 1101, name: "NL" }
51 55 };
52 56  
  57 +
53 58 DataTypeConverter.GEOJSONTYPES = [ "Point", "MultiPoint", "LineString",
54   - "MultiLineString", "Polygon", "MultiPolygon", "GeometryCollection" ];
  59 + "MultiLineString", "Polygon", "MultiPolygon", "GeometryCollection", "Feature",
  60 + "FeatureCollection" ];
55 61  
56 62 DataTypeConverter.prototype = (function () {
57 63  
... ... @@ -116,6 +122,10 @@ DataTypeConverter.prototype = (function () {
116 122  
117 123 var _analyseDataTypes = function(fields) {
118 124 ArrayUtils.IteratorOverKeys(fields, function(field) {
  125 +
  126 +
  127 + /*
  128 + //TODO: removed CODE, I don't know whether it must be inserted
119 129 if (field._inferredTypes[DataTypeConverter.TYPES.CODE.name]) {
120 130 var confidence = field._inferredTypes[DataTypeConverter.TYPES.CODE.name] / field.numOfItems;
121 131 var _numericalInferredType = field._inferredTypes[DataTypeConverter.TYPES.NUMBER.name];
... ... @@ -124,7 +134,7 @@ DataTypeConverter.prototype = (function () {
124 134 field.type = DataTypeConverter.TYPES.CODE.name;
125 135 field.typeConfidence = confidence;
126 136 return;
127   - }
  137 + }*/
128 138  
129 139 //Infers the field TYPE.
130 140 var max = ArrayUtils.FindMinMax(field._inferredTypes, function (curval, lastval) {
... ... @@ -194,13 +204,9 @@ DataTypeConverter.prototype = (function () {
194 204 if (typeof value === 'object')
195 205 return DataTypeConverter.TYPES.OBJECT;
196 206  
197   - //If the value starts with a zero and contains all numbers, it is
198   - //inferred as textual content.
199   - if (/^0[0-9]+$/.test(value))
200   - return DataTypeConverter.TYPES.CODE;
201   -
202 207 //Try to parse the float.
203   - var isnumber = DataTypesUtils.FilterFloat(value);
  208 + //var isnumber = DataTypesUtils.FilterFloat(value);
  209 + var isnumber = DataTypesUtils.FilterNumber(value);
204 210 if (isNaN(isnumber) !== true) {//It is a number.
205 211 //If the number ranges from -90.0 to 90.0, the value is marked as Latitude.
206 212 //if (-90.0 <= isnumber && isnumber <= 90.0 && _dataTypesUtils.decimalPlaces(isnumber) >= 5)
... ... @@ -230,19 +236,22 @@ DataTypeConverter.prototype = (function () {
230 236 //GEOCOORDINATE
231 237 if (Array.isArray(value) && value.length == 2) {//It recognises the LAT LNG as array of two values.
232 238 //Checks if the two array's values are numbers.
233   - if ( DataTypesUtils.FilterFloat(value[0]) != NaN && DataTypesUtils.FilterFloat(value[1]) != NaN )
  239 + //if ( DataTypesUtils.FilterFloat(value[0]) != NaN && DataTypesUtils.FilterFloat(value[1]) != NaN )
  240 + if ( DataTypesUtils.FilterNumber(value[0]) != NaN && DataTypesUtils.FilterNumber(value[1]) != NaN )
234 241 if (DataTypesUtils.DecimalPlaces(value[0]) > 4 && DataTypesUtils.DecimalPlaces(value[1]) > 4 )
235 242 return DataTypeConverter.SUBTYPES.GEOCOORDINATE;
236 243 }//EndIf.
237 244  
238 245 if (typeof value === 'string') {
239 246 var split = value.split(",");
240   - if (DataTypesUtils.IsLatLng(split[0]) && DataTypesUtils.IsLatLng(split[1]))
241   - return DataTypeConverter.SUBTYPES.GEOCOORDINATE;
  247 + //if (split.length == 2)
  248 + if (DataTypesUtils.IsLatLng(split[0]) && DataTypesUtils.IsLatLng(split[1]))
  249 + return DataTypeConverter.SUBTYPES.GEOCOORDINATE;
242 250 }
243 251  
244 252 //Try to parse the float.
245   - var isnumber = DataTypesUtils.FilterFloat(value);
  253 + //var isnumber = DataTypesUtils.FilterFloat(value);
  254 + var isnumber = DataTypesUtils.FilterNumber(value);
246 255 if (isNaN(isnumber) !== true) {//It is a number.
247 256 //If the number ranges from -90.0 to 90.0, the value is marked as Latitude.
248 257 if (-90.0 <= isnumber && isnumber <= 90.0 && DataTypesUtils.DecimalPlaces(isnumber) >= 5)
... ... @@ -267,6 +276,11 @@ DataTypeConverter.prototype = (function () {
267 276 if (isincluded) return DataTypeConverter.SUBTYPES.GEOJSON;
268 277 }
269 278  
  279 + //If the value starts with a zero and contains all numbers, it is
  280 + //inferred as textual content.
  281 + /*if (/^0[0-9]+$/.test(value))
  282 + return DataTypeConverter.TYPES.CODE;*/
  283 +
270 284 return null;
271 285 };//EndFunction.
272 286  
... ... @@ -300,6 +314,15 @@ DataTypeConverter.prototype = (function () {
300 314 return metadata;
301 315 };//EndFunction.
302 316  
  317 + var _capitalizeFirstLetter = function(string) {
  318 + return string.charAt(0).toUpperCase() + string.slice(1);
  319 + };//EndFunction.
  320 +
  321 + var _replaceAll = function(search, replacement) {
  322 + var target = this;
  323 + return target.split(search).join(replacement);
  324 + };
  325 +
303 326 var jsonTraverse = function(json, fieldKeys, callback) {
304 327 var stack = [];
305 328 var numOfRows = 0;
... ... @@ -349,15 +372,19 @@ DataTypeConverter.prototype = (function () {
349 372 return {
350 373 constructor: DataTypeConverter,
351 374  
  375 +
352 376 /**
353   - * It parses the json in input and converts the content
354   - * in according to the inferred data types.
355   - * @param json
356   - * @param path Format: field1->field2->field3
  377 + *
  378 + * @param metadata Previous information on the inferred types.
  379 + * @param options Some options to cast the data.
  380 + * - castThresholdConfidence: for which threshold the library must perform the cast (default 1)
  381 + * - makeChangesToDataset: is a boolean value, to indicate whether the library can do improvement on the storage
  382 + * values, for instance, numbers with the comma will be replaced with the dot.
  383 + * @returns {*}
357 384 */
358 385 cast: function(metadata, options) {
359 386 if (typeof options === 'undefined' || options == null)
360   - options = { castThresholdConfidence: 1, castIfNull: false };
  387 + options = { castThresholdConfidence: 1, castIfNull: false, makeChangesToDataset: false };
361 388 return this.convert(metadata, options);
362 389 },
363 390  
... ... @@ -380,7 +407,7 @@ DataTypeConverter.prototype = (function () {
380 407 var datasetMissingValues = 0;
381 408  
382 409 if (typeof options === 'undefined' || options == null)
383   - options = { castThresholdConfidence: 1, castIfNull: false };
  410 + options = { castThresholdConfidence: 1, castIfNull: false, makeChangesToDataset: false };
384 411  
385 412 jsonTraverse(metadata.dataset, metadata.fieldKeys, function(value, key, traversedKeys, rowIndex) {
386 413 var inferredType = metadata.types[traversedKeys];
... ... @@ -399,6 +426,9 @@ DataTypeConverter.prototype = (function () {
399 426 //var isCast = !(options.castIfNull == false && inferredType.totalNullValues > 0);
400 427 var isCast = inferredType.typeConfidence >= options.castThresholdConfidence;
401 428 if (inferredType.type == DataTypeConverter.TYPES.NUMBER.name && isCast) {
  429 + if (isNaN(DataTypesUtils.FilterNumber(value)) == false && typeof value === "string")
  430 + value = value.replace(',', '.');
  431 +
402 432 var number = parseFloat(value);
403 433  
404 434 if (isNaN(number)) {
... ... @@ -426,8 +456,17 @@ DataTypeConverter.prototype = (function () {
426 456 * @param options Infer Data Type options, in particular the threshold value for the confidence.
427 457 */
428 458 inferJsonDataType: function (json, fieldKeys, options) {
429   - if (typeof options === 'undefined' || options == null)
430   - options = { thresholdConfidence: 1 };
  459 +
  460 + //Default options initialisation.
  461 + if (typeof options === 'undefined' || options == null) options = { };
  462 +
  463 + if (options.hasOwnProperty("thresholdConfidence") == false)
  464 + options.thresholdConfidence = 1;
  465 +
  466 + if (options.hasOwnProperty("language") == false)
  467 + options.language = DataTypeConverter.LANGS.EN.name;
  468 + else
  469 + options.language = options.language.toUpperCase();
431 470  
432 471 var stack = [];
433 472 var fieldsType = {};
... ... @@ -500,6 +539,25 @@ DataTypeConverter.prototype = (function () {
500 539 }
501 540 }//EndWhile.
502 541  
  542 +
  543 + //Calculates the number of rows in the dataset.
  544 + var _numOfRows = 0;
  545 + ArrayUtils.IteratorOverKeys(fieldsType, function(fieldType) {
  546 + if (fieldType.numOfItems > _numOfRows)
  547 + _numOfRows = fieldType.numOfItems;
  548 + });
  549 +
  550 + //Computes the number of null values.
  551 + ArrayUtils.IteratorOverKeys(fieldsType, function(fieldType) {
  552 + if (!fieldType._inferredTypes.hasOwnProperty(DataTypeConverter.TYPES.EMPTY.name)) {
  553 + //Initialises the field.
  554 + fieldType._inferredTypes[DataTypeConverter.TYPES.EMPTY.name] = 0;
  555 + }
  556 +
  557 + fieldType._inferredTypes[DataTypeConverter.TYPES.EMPTY.name] = fieldType._inferredTypes[DataTypeConverter.TYPES.EMPTY.name] + (_numOfRows - fieldType.numOfItems);
  558 + });
  559 +
  560 + //Infers the data type.
503 561 _analyseDataTypes(fieldsType);
504 562  
505 563 //Data quality.
... ... @@ -538,22 +596,47 @@ DataTypeConverter.prototype = (function () {
538 596  
539 597 var incorrect = fieldType.numOfItems - fieldType.totalNullValues - fieldType._inferredTypes[fieldType.type];
540 598 if (incorrect > 0) {
541   - description += "The column <" + fieldType.name + "> has the type <" + fieldType.type + ">";
  599 + var _descr1 = _capitalizeFirstLetter(JDC_LNG['key_declaretype'][options.language]) + ".";
  600 + var _descr2 = _capitalizeFirstLetter(JDC_LNG['key_notoftype_singular'][options.language]) + ".";
  601 + if (incorrect > 1)
  602 + _descr2 = _capitalizeFirstLetter(JDC_LNG['key_notoftype_plural'][options.language]) + ".";
  603 +
  604 + var descr = _descr1 + " " + _descr2;
  605 + descr = descr.replace(/%COL_NAME/g, fieldType.name);
  606 + descr = descr.replace(/%COL_TYPE/g, fieldType.type);
  607 + descr = descr.replace(/%COL_ERRORS/g, incorrect);
  608 +
  609 + description += descr;
  610 +
  611 + /*description += "The column <" + fieldType.name + "> has the type <" + fieldType.type + ">";
542 612 var verb = (incorrect == 1) ? " value is" : " values are";
543   - description += ", but " + incorrect + verb + " not a " + fieldType.type;
  613 + description += ", but " + incorrect + verb + " not a " + fieldType.type;*/
544 614 }
545 615 }
546 616  
547   - if (fieldType.totalNullValues > 0) {
  617 + var descr = "";
  618 + if (fieldType.totalNullValues == 1)
  619 + descr = _capitalizeFirstLetter(JDC_LNG['key_emptyvalue_singolar'][options.language]) + ".";
  620 + else if (fieldType.totalNullValues > 1 )
  621 + descr = _capitalizeFirstLetter(JDC_LNG['key_emptyvalue_plural'][options.language]) + ".";
  622 +
  623 + descr = descr.replace(/%COL_NAME/g, fieldType.name);
  624 + descr = descr.replace(/%COL_TYPE/g, fieldType.type);
  625 + descr = descr.replace(/%COL_NULLVALUES/g, fieldType.totalNullValues);
  626 + description = description + " " + descr;
  627 +
  628 + /*if (fieldType.totalNullValues > 0) {
  629 + var descr = _capitalizeFirstLetter(JDC_LNG['key_declaretype'][options.language]) + ".";
  630 +
548 631 description += "The column <" + fieldType.name + "> has " + fieldType.totalNullValues + " EMPTY value";
549 632 if (fieldType.totalNullValues > 1) description += "s";
550 633 }
551 634  
552 635 if (description.length > 0)
553   - description += ".";
  636 + description += ".";*/
554 637  
555   - fieldType.errorsDescription = description;
556   - warningsTextual += description;
  638 + fieldType.errorsDescription = description.trim();
  639 + warningsTextual += description.trim();
557 640 });
558 641  
559 642 var metadata = { dataset: json, fieldKeys: fieldKeys, types: fieldsType, qualityIndex: quality, warningsTextual: warningsTextual };
... ...
bower_components/jsdatachecker/src/DataTypesUtils.js
... ... @@ -107,6 +107,71 @@ DataTypesUtils.FilterFloat = function (value) {
107 107 return NaN;
108 108 };//EndFunction.
109 109  
  110 +DataTypesUtils.FilterNumber = function (value) {
  111 + //Check immediatly if it is a classical number.
  112 + var valnum = DataTypesUtils.FilterFloat(value);
  113 + if (isNaN(valnum) == false) return valnum;
  114 +
  115 + //Checks if the value is a string.
  116 + if (typeof value !== "string")
  117 + return NaN;
  118 +
  119 + var parts = value.split(/(,|\.)/g);
  120 +
  121 + //Find the smallest symbol.
  122 + var idxDot = { idx: value.indexOf('.'), sym: '.' };
  123 + var idxComma = { idx: value.lastIndexOf(','), sym: ',' };
  124 + var idxFirst = {};
  125 + if (idxDot.idx == -1) idxFirst = idxComma;
  126 + else if (idxComma.idx == -1) idxFirst = idxDot;
  127 + else if (idxDot.idx < idxComma.idx) idxFirst = idxDot;
  128 + else idxFirst = idxComma;
  129 +
  130 + //Find the greatest symbol.
  131 + var idxLastDot = { idx: value.lastIndexOf('.'), sym: '.' };
  132 + var idxLastComma = { idx: value.lastIndexOf(','), sym: ',' };
  133 + var idxLast = {};
  134 + if (idxLastDot.idx == -1) idxLast = idxLastComma;
  135 + else if (idxLastComma.idx == -1) idxLast = idxLastDot;
  136 + else if (idxLastDot.idx > idxLastComma.idx) idxLast = idxLastDot;
  137 + else idxLast = idxLastComma;
  138 +
  139 + //Splits over the dot and comma and check that are all numbers.
  140 + var splitted = value.split(/(\.|,|\-|\+)/g);
  141 + if (splitted.length == 0) return NaN;
  142 +
  143 + var numOfDots = 0;
  144 + var numOfComma = 0;
  145 + var i=0;
  146 + if (splitted[0] == '-' || splitted[0] == '+') i=1;
  147 +
  148 + for (var str; i<splitted.length, str=splitted[i]; i++) {
  149 + if (str == '.') numOfDots++;
  150 + else if (str == ',') numOfComma++;
  151 + else if (/^(0|([1-9][0-9]*))$/g.test(str) == false)
  152 + return NaN;
  153 + }//EndFor.
  154 +
  155 + var lastValue = splitted[splitted.length-1];
  156 + if (lastValue == '.' || lastValue == ',' || lastValue.length == 0) return NaN;
  157 +
  158 + //No dot/comma char found
  159 + if (idxFirst.idx == -1 && idxLast.idx == -1)
  160 + return DataTypesUtils.FilterFloat(value);
  161 +
  162 + //Only one dot symbol found
  163 + if (idxFirst.idx == idxLast.idx && idxFirst.sym == '.')
  164 + return Number(value);
  165 +
  166 + //Only one comma symbol found
  167 + if (idxFirst.idx == idxLast.idx && idxFirst.sym == ',') {
  168 + var nval = value.replace(',', '.');
  169 + return Number(nval);
  170 + }
  171 +
  172 + return NaN;
  173 +};//EndFunction.
  174 +
110 175 /**
111 176 * Solution from here:
112 177 * http://stackoverflow.com/questions/10454518/javascript-how-to-retrieve-the-number-of-decimals-of-a-string-number
... ...
bower_components/jsdatachecker/src/ODPlatforms/CKAN.js
... ... @@ -39,6 +39,7 @@ CKANApi.prototype = (function() {
39 39 errorCallback("Check DataStoreAPI.");
40 40 };
41 41 xhttp.open("GET", theUrl, true);//true for asynchronous.
  42 + //xhttp.setRequestHeader('Content-yype')
42 43 xhttp.send(null);
43 44 };//EndFunction.
44 45  
... ...
bower_components/jsdatachecker/src/ODPlatforms/ODStatistics.js
... ... @@ -53,18 +53,44 @@ ODStatistics.prototype = (function() {
53 53  
54 54 stats.numOfDatasets = datasets.length;
55 55 stats.formats = [];
  56 + stats.formatsAggregated = [];
56 57  
57 58 for (var i=0; i<datasets.length; i++) {
58 59 var dataset = datasets[i];
59 60  
60 61 //Statistics on the datasets' formats.
61 62 ArrayUtils.TestAndIncrement(stats.formats, dataset.format);
  63 +
  64 + var dsformat = dataset.format.toLowerCase();
  65 +
  66 + //Aggregated formats.
  67 + if (dsformat.includes("csv"))
  68 + ArrayUtils.TestAndIncrement(stats.formatsAggregated, "csv");
  69 + else if (dsformat.includes("pdf"))
  70 + ArrayUtils.TestAndIncrement(stats.formatsAggregated, "pdf");
  71 + else if (dsformat.includes("html"))
  72 + ArrayUtils.TestAndIncrement(stats.formatsAggregated, "html");
  73 + else if (dsformat.includes("json"))
  74 + ArrayUtils.TestAndIncrement(stats.formatsAggregated, "json");
  75 + else if (dsformat.includes("xml"))
  76 + ArrayUtils.TestAndIncrement(stats.formatsAggregated, "xml");
  77 + else if (dsformat.includes("shp"))
  78 + ArrayUtils.TestAndIncrement(stats.formatsAggregated, "shp");
  79 + else if (dsformat.includes("geojson"))
  80 + ArrayUtils.TestAndIncrement(stats.formatsAggregated, "geojson");
  81 + else if (dsformat.includes("kml"))
  82 + ArrayUtils.TestAndIncrement(stats.formatsAggregated, "kml");
  83 + else if (dsformat.includes("txt"))
  84 + ArrayUtils.TestAndIncrement(stats.formatsAggregated, "txt");
  85 + else if (dsformat.includes("xls") || dsformat.includes("xlsx") || dsformat.includes("ods"))
  86 + ArrayUtils.TestAndIncrement(stats.formatsAggregated, "xls/ods");
  87 + else
  88 + ArrayUtils.TestAndIncrement(stats.formatsAggregated, "other");
62 89 }//EndForI.
63 90  
64 91 //Calculates the formats percentages.
65 92 var tmpArrFormats = stats.formats;
66 93 stats.formats = [];
67   -
68 94 ArrayUtils.IteratorOverKeys(tmpArrFormats, function(item, property) {
69 95 var recordFormat = {};
70 96 recordFormat.name = property;
... ... @@ -74,6 +100,18 @@ ODStatistics.prototype = (function() {
74 100 stats.formats.push(recordFormat);
75 101 });
76 102  
  103 + //Calculates the formats percentage for the aggregated formats.
  104 + var tmpArrFormatsAggregated = stats.formatsAggregated;
  105 + stats.formatsAggregated = [];
  106 + ArrayUtils.IteratorOverKeys(tmpArrFormatsAggregated, function(item, property) {
  107 + var recordFormat = {};
  108 + recordFormat.name = property;
  109 + recordFormat.occurrance = item;
  110 + recordFormat.occurrancePercentage = (item / datasets.length) * 100;
  111 + recordFormat.occurrancePercentage = Math.round(recordFormat.occurrancePercentage * 100) / 100;
  112 + stats.formatsAggregated.push(recordFormat);
  113 + });
  114 +
77 115 return stats;
78 116 };//EndFunction.
79 117  
... ...
bower_components/jsdatachecker/src/langs.js 0 → 100644
  1 +
  2 +
  3 +
  4 +var JDC_LNG = {
  5 +
  6 + "key_declaretype": {
  7 + "EN": "the column <%COL_NAME> is of type <%COL_TYPE>",
  8 + "IT": "la colonna <%COL_NAME> è di tipo <%COL_TYPE>",
  9 + "FR": "le colum <%COL_NAME> est de type <%COL_TYPE>",
  10 + "NL": "de kolom <%COL_NAME> is van het type <%COL_TYPE>"
  11 + },
  12 +
  13 + "key_notoftype_singular": {
  14 + "EN": "a value is not <%COL_TYPE>",
  15 + "IT": "un valore non è un <%COL_TYPE>",
  16 + "FR": "une valeur est pas <%COL_TYPE> se trouvant",
  17 + "NL": "een waarde is niet <%COL_TYPE>"
  18 + },
  19 +
  20 + "key_notoftype_plural": {
  21 + "EN": "%COL_ERRORS values are not <%COL_TYPE>",
  22 + "IT": "%COL_ERRORS valori non sono di tipo <%COL_TYPE>",
  23 + "FR": "les valeurs %COL_ERRORS sont du type <%COL_TYPE>",
  24 + "NL": "%COL_ERRORS waarden niet <%COL_TYPE>"
  25 + },
  26 +
  27 + "key_emptyvalue_singolar": {
  28 + "EN": "the column <%COL_NAME> has an empty value",
  29 + "IT": "la colonna <%COL_NAME> ha un valore vuoto",
  30 + "FR": "la colonne <%COL_NAME> a une valeur vide",
  31 + "NL": "de kolom <%COL_NAME> heeft een lege waarde"
  32 + },
  33 +
  34 + "key_emptyvalue_plural": {
  35 + "EN": "the column <%COL_NAME> has <%COL_NULLVALUES> empty values",
  36 + "IT": "la colonna <%COL_NAME> ha <%COL_NULLVALUES> valori vuoti",
  37 + "FR": "la colonne <%COL_NAME> a <%COL_NULLVALUES> valeurs vide",
  38 + "NL": "de kolom <%COL_NAME> heeft <%COL_NULLVALUES> lege waarde"
  39 + },
  40 +
  41 + "key_type": {
  42 + "EN": "type",
  43 + "IT": "tipo",
  44 + "FR": "type",
  45 + "NL": "type"
  46 + },
  47 +
  48 + "key_subtype": {
  49 + "EN": "subtype",
  50 + "IT": "sottotipo",
  51 + "FR": "sous-type",
  52 + "NL": "subtype"
  53 + },
  54 +
  55 + "key_typetext": {
  56 + "EN": "text",
  57 + "IT": "testo",
  58 + "FR": "texte",
  59 + "NL": "tekst"
  60 + },
  61 +
  62 + "key_typenumber": {
  63 + "EN": "number",
  64 + "IT": "numero",
  65 + "FR": "nombre",
  66 + "NL": "aantal"
  67 + },
  68 +
  69 + "key_typeobject": {
  70 + "EN": "object",
  71 + "IT": "oggetto",
  72 + "FR": "objet",
  73 + "NL": "voorwerp"
  74 + },
  75 +
  76 + "key_typedatetime": {
  77 + "EN": "date or time",
  78 + "IT": "data o orario",
  79 + "FR": "date ou l'heure",
  80 + "NL": "datum of tijd"
  81 + },
  82 +
  83 + "key_typeempty": {
  84 + "EN": "empty",
  85 + "IT": "vuoto",
  86 + "FR": "vide",
  87 + "NL": "leeg"
  88 + },
  89 +
  90 + "key_typelatitude": {
  91 + "EN": "latitude",
  92 + "IT": "latitudine",
  93 + "FR": "latitude",
  94 + "NL": "breedtegraad"
  95 + },
  96 +
  97 + "key_typelongitude": {
  98 + "EN": "longitude",
  99 + "IT": "longitudine",
  100 + "FR": "longitude",
  101 + "NL": "lengtegraad"
  102 + }
  103 +
  104 +};
0 105 \ No newline at end of file
... ...
controllet.html 0 → 100644
  1 +<script type="text/javascript" src="controllets/shared_js/jquery-1.11.2.min.js"></script>
  2 +<script type="text/javascript" src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
  3 +<link rel="import" href="controllets/data-sevc-controllet/demo-data-sevc-controllet.html" />
  4 +
  5 +<style>
  6 + #controllet paper-material {
  7 + overflow: hidden;
  8 + }
  9 +</style>
  10 +
  11 +<script type="text/javascript">
  12 + $(document).ready(function () {
  13 + var datasets = {"result":{
  14 + "providers":{"1":{"title":"CKAN","api_url":"http://ckan.routetopa.eu","image_hash":"11","id":"1"}},
  15 + "datasets":[
  16 + {"w":1,"provider_name":"p:1","organization_name":"SPOD","package_name":"isislab","resource_name":"SPOD SUPER HEROES","url":"http:\/\/ckan.routetopa.eu\/\/api/action\/datastore_search?resource_id=642ceea8-711e-4124-b450-0d23010c44e6","metas":"{\"organization\":\"SPOD\",\"description\":\"This is a test datasets.\",\"format\":\"CSV\"}"},
  17 + {"w":1,"provider_name":"p:1","organization_name":"SPOD","package_name":"isislab","resource_name":"Wonders of the World","url":"http:\/\/ckan.routetopa.eu\/\/api\/action\/datastore_search?resource_id=1d9c8e62-47ab-40d5-8943-b4c3bca14b50","metas":"{\"organization\":\"SPOD\",\"description\":\"This is a test datasets.\",\"format\":\"CSV\"}"},
  18 + {"w":1,"provider_name":"p:1","organization_name":"SPOD","package_name":"isislab","resource_name":"Animal Sounds","url":"http:\/\/ckan.routetopa.eu\/\/api\/action\/datastore_search?resource_id=0937845d-c398-4416-a229-993f64e1d71d","metas":"{\"organization\":\"SPOD\",\"description\":\"This is a test datasets.\",\"format\":\"CSV\"}"}
  19 + ]}};
  20 +
  21 + var controllet = document.getElementById("controllet");
  22 + controllet.setAttribute("datasets", JSON.stringify(datasets));
  23 +
  24 + window.addEventListener("data-sevc-controllet.dataletCreated", function(e){parent.createHTML(e);});
  25 + });
  26 +
  27 + //http://ckan.routetopa.eu/api/action/datastore_search?resource_id=1d9c8e62-47ab-40d5-8943-b4c3bca14b50
  28 +
  29 +</script>
  30 +
  31 +<demo-data-sevc-controllet id="controllet"
  32 + deep-url="http://172.16.15.38/DEEalerProvider/DEEP/"
  33 + datalets-list-url="http://172.16.15.38/DEEalerProvider/DEEP/datalets-list"
  34 + >
  35 +</demo-data-sevc-controllet>
  36 +
  37 +<!--datasets='{"result":{"providers":{"1":{"title":"CKAN","api_url":"http:\/\/ckan.routetopa.eu","image_hash":"11","id":"1"}},"datasets":[{"w":1,"provider_name":"p:1","organization_name":"SPOD","package_name":"isislab","resource_name":"EXAMPLE 1","url":"http:\/\/ckan.routetopa.eu\/\/api\/action\/datastore_search?resource_id=642ceea8-711e-4124-b450-0d23010c44e6","metas":"{\"organization\":\"SPOD\",\"description\":\"This is a test datasets.\",\"format\":\"CSV\"}"}, {"w":1,"provider_name":"p:1","organization_name":"SPOD","package_name":"isislab","resource_name":"EXAMPLE 2","url":"http:\/\/ckan2.routetopa.eu\/\/api\/action\/datastore_search?resource_id=642ceea8-711e-4124-b450-0d23010c44e6","metas":"{\"organization\":\"SPOD\",\"description\":\"This is a test datasets.\",\"format\":\"CSV\"}"}, {"w":1,"provider_name":"p:1","organization_name":"SPOD","package_name":"isislab","resource_name":"EXAMPLE 3","url":"http:\/\/ckan3.routetopa.eu\/\/api\/action\/datastore_search?resource_id=642ceea8-711e-4124-b450-0d23010c44e6","metas":"{\"organization\":\"SPOD\",\"description\":\"This is a test datasets.\",\"format\":\"CSV\"}"}]}}'-->
... ...
controllets/animated-button-container-controllet/animated-button-container-controllet.html
... ... @@ -18,17 +18,12 @@
18 18 color: #FFFFFF;
19 19 height: 32px;
20 20 width: 32px;
21   - background-color: #00BCD4;
22   - }
23   -
24   - .button-container {
25   - cursor: pointer;
26   - height: 36px;
27   - width: 36px;
  21 + background-color: #2196F3;
  22 + border-radius: 18px;
28 23 box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
29 24 }
30 25  
31   - .button-container:hover {
  26 + iron-icon.myspace:hover {
32 27 box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15);
33 28 -webkit-transition: 0.2s ease-out;
34 29 -moz-transition: 0.2s ease-out;
... ... @@ -37,6 +32,13 @@
37 32 transition: 0.2s ease-out;
38 33 }
39 34  
  35 + .button-container {
  36 + cursor: pointer;
  37 + height: 36px;
  38 + width: 36px;
  39 + border-radius: 18px;
  40 + }
  41 +
40 42 .window {
41 43 height: 620px;
42 44 width: 760px;
... ...
controllets/cocreation-paper-card-controllet/cocreation-paper-card-controllet.html
... ... @@ -4,108 +4,208 @@
4 4 <link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html"/>
5 5 <link rel="import" href="../../bower_components/paper-button/paper-button.html"/>
6 6 <link rel="import" href="../../bower_components/iron-icon/iron-icon.html"/>
7   -<link rel="import" href="../../bower_components/iron-collapse/iron-collapse.html"/>
  7 +<link rel="import" href="../../bower_components/paper-tooltip/paper-tooltip.html">
8 8  
  9 +<script src="../../locales/cocreation_paper_card_ln.js"></script>
9 10  
10 11 <dom-module id="cocreation-paper-card-controllet">
11 12  
12 13 <template>
13 14 <style>
14 15  
15   - iron-icon{
16   - padding-left: 5px;
17   - padding-right: 5px;
18   - --iron-icon-height: 16px;
19   - --iron-icon-width: 16px;
  16 + #card_container {
  17 + height: 200px;
  18 + width: 300px;
  19 + margin-top: 32px;
  20 + margin-left: 32px;
  21 + margin-right: -3.7px;
20 22 }
21 23  
22   - iron-icon.icon-from{
23   - --iron-icon-fill-color : #000000;
  24 + #card_container * {
  25 + font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  26 + font-size: 16px;
  27 + line-height: 24px;
24 28 }
25 29  
26   - iron-icon.icon-to{
27   - --iron-icon-fill-color : #ff0000;
  30 + .card-content {
  31 + padding: 12px;
  32 + height: 103px;
  33 + /*overflow: hidden;*/
  34 + background: #E0E0E0;
28 35 }
29 36  
30   - paper-card.cocreation {
31   - width: 310px;
  37 + .card-actions {
  38 + padding: 12px;
  39 + height: 48px;
  40 + /*border-color: #2196F3;*/
  41 + /*border-color: #4CAF50;*/
32 42 }
33 43  
34   - .from, .to {
35   - font-size: 13px;
36   - color: #CCCCCC;
  44 + paper-button {
  45 + height: 48px;
  46 + width: 136px;/*+2*/
  47 + padding: 12px;
  48 + margin: 0;
  49 + font-weight: 700;
  50 +
  51 + background: #FFFFFF;
  52 + color: #000000;
  53 + --paper-button-ink-color: #00BCD4;
  54 + }
  55 +
  56 + paper-button.info {
  57 + cursor: help;
  58 + float: right;
37 59 }
38 60  
39   - .rate-content {
40   - @apply(--layout-flex);
41   - float: left;
42   - width: 100%;
  61 + paper-button.info:hover {
  62 + color: #000000;
43 63 }
44 64  
45   - .rate-header { @apply(--paper-font-headline); }
46   - .rate-name { color: var(--paper-grey-600); margin: 10px 0; }
  65 + paper-button:hover {
  66 + color: #00BCD4;
  67 + }
  68 +
  69 + paper-icon-button[icon="info-outline"] {
  70 + cursor: help;
  71 + float: right;
47 72  
48   - paper-icon-button.rate-icon {
49   - --iron-icon-fill-color: white;
50   - --iron-icon-stroke-color: var(--paper-grey-600);
  73 + height: 48px;
  74 + width: 48px;
  75 + padding: 8px;
  76 + color: #000000;
51 77 }
52 78  
53   - .collapse-content {
54   - width: 200px;
55   - padding: 15px;
  79 + paper-tooltip {
  80 + min-width: 400px;
  81 + --paper-tooltip-background: black;
56 82 }
57 83  
58   - iron-collapse.iron-collapse-over
59   - {
60   - position: absolute;
61   - left: -1px;
62   - margin:0;
63   - padding:0;
64   - z-index:10;
65   - background-color: #FFFFFF;
66   - border: solid 1px #E6E6E6;
67   - border-top: none !important;
68   - min-width: 310px;
69   - min-height: 188px;
70   - }
71   - .badge{
  84 + paper-fab {
72 85 position: absolute;
73   - right: 5px;
74   - bottom: 5px;
  86 + z-index: 10;
  87 + }
  88 +
  89 + paper-fab.delete {
  90 + top: -12px;
  91 + right: -12px;
  92 + --iron-icon-height: 18px;
  93 + --iron-icon-width: 18px;
  94 + width: 24px;
  95 + height: 24px;
  96 + --paper-fab-background:#B6B6B6;
  97 + }
  98 +
  99 + #card_container br {
  100 + display: block;
  101 + margin-top: 8px;
  102 + content: " ";
  103 + }
  104 +
  105 + #card_container p {
  106 + margin: 0;
  107 + padding: 0;
  108 + }
  109 +
  110 + #card_container p .title{
  111 + font-weight: 700;
  112 + /*color: #2196F3;*/
  113 + /*color: #4CAF50;*/
  114 + white-space: nowrap;
  115 + }
  116 +
  117 + #card_container p .description{
  118 + }
  119 +
  120 + #card_container .name{
  121 + font-size: 18px;
  122 + font-weight: 700;
  123 + /*color: #2196F3;*/
  124 + /*color: #4CAF50;*/
  125 + height: 32px;
  126 +
  127 + overflow: hidden;
  128 + white-space: nowrap;
  129 + text-overflow: ellipsis;
  130 + }
  131 +
  132 + #card_container .owner{
  133 + font-size: 14px;
  134 + height: 47px;
  135 +
  136 + overflow: hidden;
  137 + white-space: nowrap;
  138 + text-overflow: ellipsis;
  139 + }
  140 +
  141 + #card_container .time{
  142 + display: flex;
  143 + flex-direction: row;
  144 + height: 24px;
  145 + }
  146 +
  147 + #card_container .from {
  148 + width: 50%;
  149 + font-size: 12px;
  150 + }
  151 +
  152 + #card_container .to {
  153 + width: 50%;
  154 + font-size: 12px;
  155 + }
  156 +
  157 + paper-fab.assessment,
  158 + paper-fab.description {
  159 + bottom: -20px;
  160 + right: 12px;
  161 + cursor: auto;
  162 + }
  163 +
  164 + paper-fab.description {
75 165 background: #2196F3;
76 166 }
77 167  
78   - </style>
  168 + paper-fab.assessment {
  169 + background: #4CAF50;
  170 + }
79 171  
  172 + </style>
80 173  
81   - <paper-card class="cocreation">
82   - <div class="rate-content">
  174 + <paper-card id="card_container">
83 175 <div class="card-content">
84   - <div class="rate-header">{{name}}</div>
85   - <div class="rate-name">{{owner}}</div>
86   - <div>
87   - <iron-icon class="icon-from" icon="alarm"></iron-icon>
88   - <span class="from">{{from}}</span>
89   - <iron-icon class="icon-to" icon="alarm-off"></iron-icon>
90   - <span class="to">{{to}}</span>
91   - <template is="dom-if" if="{{!checkRoomType(roomType)}}">
92   - <paper-fab mini disabled icon="assessment" class="badge data"></paper-fab>
93   - </template>
94   - <template is="dom-if" if="{{checkRoomType(roomType)}}">
95   - <paper-fab mini disabled icon="description" class="badge knowledge"></paper-fab>
96   - </template>
  176 + <template is="dom-if" if="{{isOwner}}">
  177 + <paper-fab id="card_delete" class="delete" mini icon="delete" on-click="_handleDeleteClick"></paper-fab>
  178 + </template>
  179 + <div class="name" style$="color: {{color}};">{{name}}</div>
  180 + <div class="owner">{{owner}}</div>
  181 + <div class="time">
  182 + <div class="from">
  183 + <iron-icon class="icon-from" icon="alarm"></iron-icon>&nbsp; {{from}}
  184 + </div>
  185 + <div class="to">
  186 + <iron-icon class="icon-to" icon="alarm-off"></iron-icon>&nbsp; {{to}}
  187 + </div>
97 188 </div>
  189 + <template is="dom-if" if="{{!_checkRoomType(roomType)}}">
  190 + <paper-fab mini icon="assessment" class="assessment" noink></paper-fab>
  191 + </template>
  192 + <template is="dom-if" if="{{_checkRoomType(roomType)}}">
  193 + <paper-fab mini icon="description" class="description" noink></paper-fab>
  194 + </template>
98 195 </div>
99   - <div class="card-actions">
100   - <paper-button on-click="_onExplore">Explore</paper-button>
101   - <paper-icon-button icon="expand-less" on-click="_toggle" style="float:right;"></paper-icon-button>
102   - <iron-collapse class="iron-collapse-over" id="more_info" no-animation>
103   - <div class="collapse-content">
104   - {{goal}}
105   - </div>
106   - </iron-collapse>
  196 + <div class="card-actions" style$="border-color: {{color}};">
  197 + <paper-button on-click="_onExplore"><span id="explore"></span></paper-button>
  198 + <paper-button id="goal_button" class="info" noink><span id="goal"></span></paper-button>
  199 + <!--<paper-icon-button id="goal_button" icon="info-outline" noink></paper-icon-button>-->
  200 +
  201 + <paper-tooltip for="goal_button" position="bottom" offset="-8">
  202 + <p>
  203 + <span class="title" style$="color: {{color}};" id="tooltip_goal"></span>
  204 + <br>
  205 + <span class="description">{{goal}}</span>
  206 + </p>
  207 + </paper-tooltip>
107 208 </div>
108   - </div>
109 209 </paper-card>
110 210  
111 211 </template>
... ... @@ -119,23 +219,23 @@
119 219 properties: {
120 220 name:{
121 221 type: String,
122   - value: "text"
  222 + value: ""
123 223 },
124 224 owner:{
125 225 type: String,
126   - value: "text"
  226 + value: ""
127 227 },
128 228 from:{
129 229 type: String,
130   - value: "text"
  230 + value: ""
131 231 },
132 232 to:{
133 233 type: String,
134   - value: "text"
  234 + value: ""
135 235 },
136 236 goal:{
137 237 type: String,
138   - value: "text"
  238 + value: ""
139 239 },
140 240 roomUrl: {
141 241 type: String,
... ... @@ -144,28 +244,46 @@
144 244 roomType:{
145 245 type: String,
146 246 value: undefined
  247 + },
  248 + isOwner: {
  249 + type: Boolean,
  250 + value: false
  251 + },
  252 + roomId:{
  253 + type: Number,
  254 + value: undefined
  255 + },
  256 + color:{
  257 + type: String,
  258 + value: ""
147 259 }
148 260 },
149 261  
  262 + ready: function() {
  263 + var color = "#4CAF50";
  264 + if(this.roomType == "knowledge")
  265 + color = "#2196F3";
  266 + this.color = color;
  267 + },
  268 +
150 269 attached: function(){
  270 + cocreation_room_ln["ln"] = ODE.user_language;
  271 +
  272 + this.$.goal.innerHTML = cocreation_room_ln["goal_" + cocreation_room_ln["ln"]];
  273 + this.$.tooltip_goal.innerHTML = cocreation_room_ln["goal_" + cocreation_room_ln["ln"]];
  274 + this.$.explore.innerHTML = cocreation_room_ln["explore_" + cocreation_room_ln["ln"]];
151 275 },
152 276  
153   - _toggle: function(){
154   - var moreInfo = this.$.more_info;
155   - var iconButton = Polymer.dom(event).localTarget;
156   - iconButton.icon = moreInfo.opened ? 'expand-less' : 'expand-more';
157   - moreInfo.toggle();
  277 + _handleDeleteClick: function(){
  278 + this.fire("cocreation-paper-card-controllet_delete", {roomId: this.roomId});
158 279 },
159 280  
160   - _onExplore: function(e){
  281 + _onExplore: function(){
161 282 window.location = this.roomUrl;
162 283 },
163 284  
164   - checkRoomType: function(type){
165   - if(type == "knowledge")
166   - return true;
167   - else
168   - return false;
  285 + _checkRoomType: function(type){
  286 + return (type == "knowledge") ? true : false;
169 287 }
170 288 })
171 289 </script>
... ...
controllets/data-sevc-controllet/data-sevc-controllet.html
... ... @@ -47,7 +47,7 @@
47 47  
48 48 listeners : {
49 49 'page-slider-controllet_selected' : '_updateSlider',
50   - 'dataset-selection-controllet_data-url' : '_allowSecondStep',
  50 + 'select-dataset-controllet_data-url' : '_allowSecondStep',
51 51 'select-fields-controllet_selected-fields' : '_allowThirdStep',
52 52 'filters-controllet_filters': '_allowThirdStep',
53 53 'aggregators-controllet_aggregators': '_allowThirdStep',
... ... @@ -117,7 +117,7 @@
117 117  
118 118 _allowSecondStep : function(e){
119 119 this.$.slider.chevronRight(false);
120   -//
  120 +
121 121 var f = Object.create(providerFactory);
122 122 var provider = f.getProvider(e.detail.url);
123 123 var dataUrl = provider.addLimit(e.detail.url);
... ... @@ -135,6 +135,8 @@
135 135 }
136 136 else
137 137 this.$.select_dataset.$.selected_url.invalid = true;
  138 +
  139 + this.$.select_dataset.showDatasetInfo();
138 140 },
139 141  
140 142 _allowThirdStep : function(){
... ...
controllets/data-sevc-controllet/data-sevc-controllet_old.html deleted
1   -<script src="../shared_js/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js"></script>
2   -<link rel="stylesheet" href="../shared_js/perfect-scrollbar/css/perfect-scrollbar.min.css">
3   -
4   -<script src="../../locales/controllet_ln.js"></script>
5   -
6   -<link rel="import" href="../../bower_components/polymer/polymer.html">
7   -
8   -<link rel="import" href="../page-slider-controllet/page-slider-controllet.html">
9   -
10   -<link rel="import" href="../select-dataset-controllet/select-dataset-controllet.html">
11   -<link rel="import" href="../select-data-controllet/select-data-controllet.html" />
12   -<link rel="import" href="../select-visualization-controllet/select-visualization-controllet.html" />
13   -
14   -<dom-module id="data-sevc-controllet">
15   -
16   - <template>
17   -
18   - <page-slider-controllet id="slider">
19   -
20   - <neon-animatable>
21   -
22   - <template is="dom-if" if={{!modify}}>
23   - <select-dataset-controllet id="select_dataset" data={{data}} datasets={{datasets}} suggested-datasets={{suggestedDatasets}}></select-dataset-controllet>
24   - </template>
25   -
26   - </neon-animatable>
27   -
28   - <neon-animatable>
29   -
30   - <select-data-controllet id="select_data" data-url={{dataUrl}} preselected-fields={{selectedFields}} datalet-preset="{{dataletPreset}}"></select-data-controllet>
31   -
32   - </neon-animatable>
33   -
34   - <neon-animatable>
35   -
36   - <select-visualization-controllet id="select_visualization" deep-url={{deepUrl}} datalets-list-url={{dataletsListUrl}} data-url={{dataUrl}} preselected-datalet={{selectedDatalet}} datalet-preset={{dataletPreset}}></select-visualization-controllet>
37   -
38   - </neon-animatable>
39   -
40   - </page-slider-controllet>
41   -
42   - </template>
43   -
44   - <script>
45   -
46   - Polymer({
47   -
48   - is : 'data-sevc-controllet',
49   -
50   - listeners : {
51   - 'page-slider-controllet_selected' : '_updateSlider',
52   - 'dataset-selection-controllet_data-url' : '_allowSecondStep',
53   - 'tree-view-controllet_selected-fields' : '_allowThirdStep'
54   - },
55   -
56   - properties : {
57   -
58   - deepUrl : {
59   - type : String,
60   - value : undefined
61   - },
62   -
63   - dataletsListUrl : {
64   - type : String ,
65   - value : undefined
66   - },
67   -
68   - datasets : {
69   - type : Array,
70   - value : undefined
71   - },
72   -
73   - suggestedDatasets : {
74   - type : Array,
75   - value : undefined
76   - },
77   -
78   - dataUrl : {
79   - type : String,
80   - value : undefined
81   - },
82   -
83   - jsonData : {
84   - type : Object,
85   - value : undefined
86   - },
87   -
88   - modify : {
89   - type : Boolean,
90   - value : false
91   - },
92   -
93   - selectedDatalet : {
94   - type : String,
95   - value : undefined
96   - },
97   -
98   - selectedFields : {
99   - type : Array,
100   - value : []
101   - },
102   -
103   - dataletPreset : {
104   - type : Object,
105   - value : []
106   - },
107   -
108   - localization : {
109   - type : String,
110   - value : "en"
111   - }
112   -
113   - },
114   -
115   - ready : function(){
116   - if(this.selectedDatalet){
117   - this.modify = true;
118   - this.$.slider.selected = 1;
119   - this.dataUrl = this.dataletPreset["data-url"];
120   - }
121   - ln["localization"] = this.localization;
122   - },
123   -
124   - _updateSlider : function(e){
125   - switch (e.detail.selected) {
126   - case 0:
127   - slider.setTitle(ln["slide1Title_" + this.localization], ln["slide1Subtitle_" + this.localization]);
128   - slider.chevronLeft("invisible");
129   - slider.chevronRight(false);
130   - if(slider.getPrevSelected() == 1)
131   - slider.chevronRight(true);
132   - break;
133   - case 1:
134   - slider.setTitle(ln["slide2Title_" + this.localization], ln["slide2Subtitle_" + this.localization]);
135   - if(this.modify){
136   - slider.chevronLeft("invisible");
137   - }
138   - else{
139   - slider.chevronLeft(true);
140   - }
141   - slider.chevronRight(false);
142   - this._allowThirdStep({detail: {fields: select_data.getSelectedFields()}});
143   - if(this.modify){
144   - this.$.select_visualization.setFields(select_data.getSelectedFields());
145   - this.$.select_visualization.setFilters(select_data.getFilters());
146   - }
147   - break;
148   - case 2:
149   - slider.setTitle(ln["slide3Title_" + this.localization], ln["slide3Subtitle_" + this.localization]);
150   - slider.chevronLeft(true);
151   - slider.chevronRight("invisible");
152   -
153   - this.$.select_visualization.setFields(select_data.getSelectedFields());
154   - this.$.select_visualization.setFilters(select_data.getFilters());
155   - if(this.modify) {
156   - this.$.select_visualization.show();//resize
157   - }
158   - }
159   - },
160   -
161   - _allowSecondStep : function(e){
162   - if(e.detail.url == "") {
163   - slider.chevronRight(false);
164   - select_dataset.$.selected_url.invalid = false;
165   - return;
166   - }
167   -
168   - this.dataUrl = e.detail.url;
169   -
170   - var that = this;
171   -
172   - $.ajax({
173   - url: e.detail.url,
174   - dataType: "json",
175   - success: function(data){
176   -// this.dataUrl = e.detail.url
177   -// this.jsonData = JSON.stringify(data);
178   - slider.chevronRight(true);
179   - select_dataset.$.selected_url.invalid = false;
180   -
181   - that.$.select_data._init();
182   - },
183   - error: function(){
184   -// this.jsonData = undefined;
185   - slider.chevronRight(false);
186   - select_dataset.$.selected_url.invalid = true;
187   -
188   - that.$.select_data._reset();
189   - }
190   - });
191   -
192   - //NOT HERE ma quando VADO al secondo passo e l'url è cambiato
193   -// this.$.select_data._init();
194   - this.$.select_visualization.reset();
195   - },
196   -
197   - _allowThirdStep : function(e){
198   - if(e.detail.fields.length > 0)
199   - slider.chevronRight(true);
200   - else
201   - slider.chevronRight(false);
202   -
203   - //this.$.select_visualization.reset();
204   - }
205   -
206   - });
207   -
208   - </script>
209   -
210   -</dom-module>
211 0 \ No newline at end of file
controllets/data-sevc-controllet/datalets-modifier-controllet.html deleted
1   -<script src="../shared_js/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js"></script>
2   -<link rel="stylesheet" href="../shared_js/perfect-scrollbar/css/perfect-scrollbar.min.css">
3   -
4   -<script src="../../locales/controllet_ln.js"></script>
5   -
6   -<link rel="import" href="../../bower_components/polymer/polymer.html">
7   -
8   -<link rel="import" href="../page-slider-controllet/page-slider-controllet.html">
9   -
10   -<link rel="import" href="../select-data-controllet/select-data-controllet.html" />
11   -<link rel="import" href="../select-visualization-controllet/select-visualization-controllet.html" />
12   -
13   -<dom-module id="datalets-modifier-controllet">
14   -
15   - <template>
16   -
17   - <page-slider-controllet id="slider">
18   -
19   - <neon-animatable>
20   -
21   - <select-data-controllet id="select_data"></select-data-controllet>
22   -
23   - </neon-animatable>
24   -
25   - <neon-animatable>
26   -
27   - <select-visualization-controllet id="select_visualization" deep-url={{deepUrl}} datalets-list-url={{dataletsListUrl}}></select-visualization-controllet>
28   -
29   - </neon-animatable>
30   -
31   - </page-slider-controllet>
32   -
33   - </template>
34   -
35   - <script>
36   -
37   - Polymer({
38   -
39   - is : 'datalets-modifier-controllet',
40   -
41   - listeners : {
42   - 'page-slider-controllet_selected' : '_updateSlider',
43   - 'dataset-selection-controllet_data-url' : '_allowSecondStep',
44   - 'tree-view-controllet_selected-fields' : '_allowThirdStep'
45   - },
46   -
47   - properties : {
48   -// dataUrl : {
49   -// type : String,
50   -// value : undefined
51   -// },
52   -
53   - preselectedDatalet : { //datalet
54   - type : String,
55   - value : undefined
56   - },
57   -
58   - preselectedFields : { //fields
59   - type : Array,
60   - value : undefined
61   - },
62   -
63   - dataletPreset : { //params
64   - type : String,
65   - value : undefined
66   - },
67   -
68   - deepUrl : {
69   - type : String,
70   - value : undefined
71   - },
72   -
73   - dataletsListUrl : {
74   - type : String ,
75   - value : undefined
76   - },
77   -
78   - localization : {
79   - type : String,
80   - value : "en"
81   - }
82   -
83   - },
84   -
85   - ready : function(){
86   - if(this.selectedDatalet){
87   - this.modify = true;
88   - this.$.slider.selected = 1;
89   - this.dataUrl = this.dataletPreset["data-url"];
90   - }
91   - ln["localization"] = this.localization;
92   - },
93   -
94   - _updateSlider : function(e){
95   - switch (e.detail.selected) {
96   - case 0:
97   - slider.setTitle(ln["slide1Title_" + this.localization], ln["slide1Subtitle_" + this.localization]);
98   - slider.chevronLeft("invisible");
99   - slider.chevronRight(false);
100   - if(slider.getPrevSelected() == 1)
101   - slider.chevronRight(true);
102   - break;
103   - case 1:
104   - slider.setTitle(ln["slide2Title_" + this.localization], ln["slide2Subtitle_" + this.localization]);
105   - if(this.modify){
106   - slider.chevronLeft("invisible");
107   - }
108   - else{
109   - slider.chevronLeft(true);
110   - }
111   - slider.chevronRight(false);
112   - this._allowThirdStep({detail: {fields: select_data.getSelectedFields()}});
113   - if(this.modify){
114   - this.$.select_visualization.setFields(select_data.getSelectedFields());
115   - this.$.select_visualization.setFilters(select_data.getFilters());
116   - }
117   - break;
118   - case 2:
119   - slider.setTitle(ln["slide3Title_" + this.localization], ln["slide3Subtitle_" + this.localization]);
120   - slider.chevronLeft(true);
121   - slider.chevronRight("invisible");
122   -
123   - this.$.select_visualization.setFields(select_data.getSelectedFields());
124   - this.$.select_visualization.setFilters(select_data.getFilters());
125   - if(this.modify) {
126   - this.$.select_visualization.show();//resize
127   - }
128   - }
129   - },
130   -
131   - _allowSecondStep : function(e){
132   - if(e.detail.url == "") {
133   - slider.chevronRight(false);
134   - select_dataset.$.selected_url.invalid = false;
135   - return;
136   - }
137   -
138   - this.dataUrl = e.detail.url;
139   -
140   - var that = this;
141   -
142   - $.ajax({
143   - url: e.detail.url,
144   - dataType: "json",
145   - success: function(data){
146   -// this.dataUrl = e.detail.url
147   -// this.jsonData = JSON.stringify(data);
148   - slider.chevronRight(true);
149   - select_dataset.$.selected_url.invalid = false;
150   -
151   - that.$.select_data._init();
152   - },
153   - error: function(){
154   -// this.jsonData = undefined;
155   - slider.chevronRight(false);
156   - select_dataset.$.selected_url.invalid = true;
157   -
158   - that.$.select_data._reset();
159   - }
160   - });
161   -
162   - //NOT HERE ma quando VADO al secondo passo e l'url è cambiato
163   -// this.$.select_data._init();
164   - this.$.select_visualization.reset();
165   - },
166   -
167   - _allowThirdStep : function(e){
168   - if(e.detail.fields.length > 0)
169   - slider.chevronRight(true);
170   - else
171   - slider.chevronRight(false);
172   -
173   - //this.$.select_visualization.reset();
174   - }
175   -
176   - });
177   -
178   - </script>
179   -
180   -</dom-module>
181 0 \ No newline at end of file
controllets/data-sevc-controllet/demo-data-sevc-controllet.html 0 → 100644
  1 +<script src="../shared_js/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js"></script>
  2 +<link rel="stylesheet" href="../shared_js/perfect-scrollbar/css/perfect-scrollbar.min.css">
  3 +
  4 +<script src="../../locales/controllet_ln.js"></script>
  5 +
  6 +<link rel="import" href="../../bower_components/polymer/polymer.html">
  7 +
  8 +<link rel="import" href="../page-slider-controllet/page-slider-controllet.html">
  9 +
  10 +<link rel="import" href="../select-dataset-controllet/demo-select-dataset-controllet.html">
  11 +<link rel="import" href="../select-data-controllet/select-data-controllet.html" />
  12 +<link rel="import" href="../select-visualization-controllet/select-visualization-controllet.html" />
  13 +
  14 +<dom-module id="demo-data-sevc-controllet">
  15 +
  16 + <template>
  17 +
  18 + <page-slider-controllet id="slider">
  19 +
  20 + <neon-animatable>
  21 +
  22 + <demo-select-dataset-controllet id="select_dataset" datasets={{datasets}} suggested-datasets={{suggestedDatasets}}></demo-select-dataset-controllet>
  23 +
  24 + </neon-animatable>
  25 +
  26 + <neon-animatable>
  27 +
  28 + <select-data-controllet id="select_data"></select-data-controllet>
  29 +
  30 + </neon-animatable>
  31 +
  32 + <neon-animatable>
  33 +
  34 + <select-visualization-controllet id="select_visualization" deep-url={{deepUrl}} datalets-list-url={{dataletsListUrl}}></select-visualization-controllet>
  35 +
  36 + </neon-animatable>
  37 +
  38 + </page-slider-controllet>
  39 +
  40 + </template>
  41 +
  42 + <script>
  43 +
  44 + Polymer({
  45 +
  46 + is : 'demo-data-sevc-controllet',
  47 +
  48 + listeners : {
  49 + 'page-slider-controllet_selected' : '_updateSlider',
  50 + 'select-dataset-controllet_data-url' : '_allowSecondStep',
  51 + 'select-fields-controllet_selected-fields' : '_allowThirdStep',
  52 + 'filters-controllet_filters': '_allowThirdStep',
  53 + 'aggregators-controllet_aggregators': '_allowThirdStep',
  54 + 'data-ready': '_dataReady'
  55 + },
  56 +
  57 + properties : {
  58 +
  59 + datasets : {
  60 + type : Object,
  61 + value : undefined
  62 + },
  63 +
  64 + suggestedDatasets : {
  65 + type : Array,
  66 + value : undefined
  67 + },
  68 +
  69 + deepUrl : {
  70 + type : String,
  71 + value : undefined
  72 + },
  73 +
  74 + dataletsListUrl : {
  75 + type : String ,
  76 + value : undefined
  77 + },
  78 +
  79 + localization : {
  80 + type : String,
  81 + value : "en"
  82 + }
  83 +
  84 + },
  85 +
  86 + ready : function(){
  87 + ln["localization"] = this.localization;
  88 + },
  89 +
  90 + _updateSlider : function(e){
  91 + switch (e.detail.selected) {
  92 + case 0:
  93 + this.$.slider.setTitle(ln["slide1Title_" + this.localization], ln["slide1Subtitle_" + this.localization]);
  94 +
  95 + this.$.slider.chevronLeft("invisible");
  96 + this.$.slider.chevronRight(false);
  97 +
  98 + if(this.$.slider.getPrevSelected() == 1)
  99 + this.$.slider.chevronRight(true);
  100 + break;
  101 + case 1:
  102 + this.$.slider.setTitle(ln["slide2Title_" + this.localization], ln["slide2Subtitle_" + this.localization]);
  103 +
  104 + this.$.slider.chevronLeft(true);
  105 + this.$.slider.chevronRight(false);
  106 +
  107 + if(this.$.slider.getPrevSelected() == 2)
  108 + this.$.slider.chevronRight(true);
  109 + break;
  110 + case 2:
  111 + this.$.slider.setTitle(ln["slide3Title_" + this.localization], ln["slide3Subtitle_" + this.localization]);
  112 +
  113 + this.$.slider.chevronLeft(true);
  114 + this.$.slider.chevronRight("invisible");
  115 + }
  116 + },
  117 +
  118 + _allowSecondStep : function(e){
  119 + this.$.slider.chevronRight(false);
  120 +
  121 + var f = Object.create(providerFactory);
  122 + var provider = f.getProvider(e.detail.url);
  123 + var dataUrl = provider.addLimit(e.detail.url);
  124 +
  125 + this.$.select_data.dataUrl = dataUrl;
  126 + this.$.select_data.init();
  127 + this.$.select_visualization.dataUrl = dataUrl;
  128 + this.$.select_visualization.init();
  129 + },
  130 +
  131 + _dataReady : function(e){
  132 + if(e.detail.ready) {
  133 + this.$.slider.chevronRight(true);
  134 + this.$.select_dataset.$.selected_url.invalid = false;
  135 + }
  136 + else
  137 + this.$.select_dataset.$.selected_url.invalid = true;
  138 +
  139 + this.$.select_dataset.showDatasetInfo();
  140 + },
  141 +
  142 + _allowThirdStep : function(){
  143 + this.$.slider.chevronRight(false);
  144 + var selectedFields = this.$.select_data.getSelectedFields();
  145 + var filters = this.$.select_data.getFilters();
  146 + var aggregators = this.$.select_data.getAggregators();
  147 + var data = this.$.select_data.getData();
  148 + if(selectedFields.length > 0) {
  149 + this.$.select_visualization.init();
  150 + this.$.select_visualization.setSelectedFields(selectedFields);
  151 + this.$.select_visualization.setFilters(filters);
  152 + this.$.select_visualization.setAggregators(aggregators);
  153 + this.$.select_visualization.setData(data);
  154 + this.$.slider.chevronRight(true);
  155 + }
  156 + }
  157 +
  158 + });
  159 +
  160 + </script>
  161 +
  162 +</dom-module>
0 163 \ No newline at end of file
... ...
controllets/data-sevc-controllet/demo/index.html
... ... @@ -18,8 +18,10 @@
18 18 <data-sevc-controllet deep-url="http://172.16.15.38/DEEalerProvider/DEEP/"
19 19 datalets-list-url="http://172.16.15.38/DEEalerProvider/DEEP/datalets-list"
20 20 datasets='{"result":{"providers":{"1":{"title":"CKAN","api_url":"http:\/\/ckan.routetopa.eu","image_hash":"11","id":"1"}},"datasets":[{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 2","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b056c5e6-76af-4526-a35d-7dee664fb6ee\/download\/isislab.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"Year 1 Dissemination of the ROUTE-TO-PA project (2015)","resource_name":"First year (2015) ROUTE-TO-PA Dissemination","url":"http:\/\/ckan.routetopa.eu\/dataset\/d81d451d-8b3d-47f4-b57f-e295e8f51da0\/resource\/818c2edb-0cb7-4288-b340-e4dd1933d817\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New---Link-Upd.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"Year 1 Dissemination of the ROUTE-TO-PA project (2015)","resource_name":"First year (2015) ROUTE-TO-PA Dissemination - dl","url":"http:\/\/ckan.routetopa.eu\/dataset\/d81d451d-8b3d-47f4-b57f-e295e8f51da0\/resource\/fd8c4d6f-315d-4aa0-b7bd-4fdde7bf641b\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New---Link-Upd.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"Year 1 Dissemination of the ROUTE-TO-PA project (2015)","resource_name":"First year (2015) dissemination of ROUTE-TO-PA project","url":"http:\/\/ckan.routetopa.eu\/dataset\/d81d451d-8b3d-47f4-b57f-e295e8f51da0\/resource\/b0ef6017-8c64-4e11-8046-7e51a8561856\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New---Link-Upd.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"test dissemination with link","resource_name":"Year 1 Dissemination of the ROUTE-TO-PA project (2015)","url":"http:\/\/ckan.routetopa.eu\/dataset\/ba5054af-7561-4f99-9504-76ea004a1e85\/resource\/4cc2349d-bf7b-4bbe-a7ca-db5312bb6c94\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New---Link.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"Dissemination activity of the first year","resource_name":"Dissemination activity of the first year (2015)","url":"http:\/\/ckan.routetopa.eu\/dataset\/61f07087-210a-4c35-9606-2aafe183633b\/resource\/5f9d8d8b-1c41-45f7-9dbb-61b9a7bcd076\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"City of the Hague Municipality","package_name":"Test 3- Buurten","resource_name":"Test Buurten - 3","url":"http:\/\/ckan.routetopa.eu\/dataset\/1248d447-2901-4beb-91ae-c2f249fd8a99\/resource\/1fdbc765-8945-4271-8dce-9c7eba45a67d\/download\/Test-3-Compare.csv","metas":"{\"organization\":\"City of the Hague Municipality\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"}]}}'
  21 + suggested-datasets='[{"resource_name":"SUGGESTED 1","url":"noUrl.csv","metas":"{\"description\":\"noDescriione\"}"},{"resource_name":"SUGGESTED 2","url":"noUrl.csv","metas":"{\"description\":\"noDescriione\"}"},{"resource_name":"SUGGESTED 3","url":"noUrl.csv","metas":"{\"description\":\"noDescriione\"}"}]'
  22 + <!--suggested-datasets='{"result":{"providers":{"1":{"title":"CKAN","api_url":"http:\/\/ckan.routetopa.eu","image_hash":"11","id":"1"}},"datasets":[{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 2","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b056c5e6-76af-4526-a35d-7dee664fb6ee\/download\/isislab.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"Year 1 Dissemination of the ROUTE-TO-PA project (2015)","resource_name":"First year (2015) ROUTE-TO-PA Dissemination","url":"http:\/\/ckan.routetopa.eu\/dataset\/d81d451d-8b3d-47f4-b57f-e295e8f51da0\/resource\/818c2edb-0cb7-4288-b340-e4dd1933d817\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New-&#45;&#45;Link-Upd.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"Year 1 Dissemination of the ROUTE-TO-PA project (2015)","resource_name":"First year (2015) ROUTE-TO-PA Dissemination - dl","url":"http:\/\/ckan.routetopa.eu\/dataset\/d81d451d-8b3d-47f4-b57f-e295e8f51da0\/resource\/fd8c4d6f-315d-4aa0-b7bd-4fdde7bf641b\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New-&#45;&#45;Link-Upd.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"Year 1 Dissemination of the ROUTE-TO-PA project (2015)","resource_name":"First year (2015) dissemination of ROUTE-TO-PA project","url":"http:\/\/ckan.routetopa.eu\/dataset\/d81d451d-8b3d-47f4-b57f-e295e8f51da0\/resource\/b0ef6017-8c64-4e11-8046-7e51a8561856\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New-&#45;&#45;Link-Upd.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"test dissemination with link","resource_name":"Year 1 Dissemination of the ROUTE-TO-PA project (2015)","url":"http:\/\/ckan.routetopa.eu\/dataset\/ba5054af-7561-4f99-9504-76ea004a1e85\/resource\/4cc2349d-bf7b-4bbe-a7ca-db5312bb6c94\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New-&#45;&#45;Link.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"Dissemination activity of the first year","resource_name":"Dissemination activity of the first year (2015)","url":"http:\/\/ckan.routetopa.eu\/dataset\/61f07087-210a-4c35-9606-2aafe183633b\/resource\/5f9d8d8b-1c41-45f7-9dbb-61b9a7bcd076\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"City of the Hague Municipality","package_name":"Test 3- Buurten","resource_name":"Test Buurten - 3","url":"http:\/\/ckan.routetopa.eu\/dataset\/1248d447-2901-4beb-91ae-c2f249fd8a99\/resource\/1fdbc765-8945-4271-8dce-9c7eba45a67d\/download\/Test-3-Compare.csv","metas":"{\"organization\":\"City of the Hague Municipality\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"}]}}'-->
21 23 <!--datasets='{"result":{"providers":{"1":{"title":"CKAN","api_url":"http:\/\/ckan.routetopa.eu","image_hash":"11","id":"1"}},"datasets":[{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 2","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b056c5e6-76af-4526-a35d-7dee664fb6ee\/download\/isislab.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"Year 1 Dissemination of the ROUTE-TO-PA project (2015)","resource_name":"First year (2015) ROUTE-TO-PA Dissemination","url":"http:\/\/ckan.routetopa.eu\/dataset\/d81d451d-8b3d-47f4-b57f-e295e8f51da0\/resource\/818c2edb-0cb7-4288-b340-e4dd1933d817\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New-&#45;&#45;Link-Upd.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"Year 1 Dissemination of the ROUTE-TO-PA project (2015)","resource_name":"First year (2015) ROUTE-TO-PA Dissemination - dl","url":"http:\/\/ckan.routetopa.eu\/dataset\/d81d451d-8b3d-47f4-b57f-e295e8f51da0\/resource\/fd8c4d6f-315d-4aa0-b7bd-4fdde7bf641b\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New-&#45;&#45;Link-Upd.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"Year 1 Dissemination of the ROUTE-TO-PA project (2015)","resource_name":"First year (2015) dissemination of ROUTE-TO-PA project","url":"http:\/\/ckan.routetopa.eu\/dataset\/d81d451d-8b3d-47f4-b57f-e295e8f51da0\/resource\/b0ef6017-8c64-4e11-8046-7e51a8561856\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New-&#45;&#45;Link-Upd.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"test dissemination with link","resource_name":"Year 1 Dissemination of the ROUTE-TO-PA project (2015)","url":"http:\/\/ckan.routetopa.eu\/dataset\/ba5054af-7561-4f99-9504-76ea004a1e85\/resource\/4cc2349d-bf7b-4bbe-a7ca-db5312bb6c94\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New-&#45;&#45;Link.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"Dissemination activity of the first year","resource_name":"Dissemination activity of the first year (2015)","url":"http:\/\/ckan.routetopa.eu\/dataset\/61f07087-210a-4c35-9606-2aafe183633b\/resource\/5f9d8d8b-1c41-45f7-9dbb-61b9a7bcd076\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"City of the Hague Municipality","package_name":"Test 3- Buurten","resource_name":"Test Buurten - 3","url":"http:\/\/ckan.routetopa.eu\/dataset\/1248d447-2901-4beb-91ae-c2f249fd8a99\/resource\/1fdbc765-8945-4271-8dce-9c7eba45a67d\/download\/Test-3-Compare.csv","metas":"{\"organization\":\"City of the Hague Municipality\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"}]}}'-->
22   - <!--suggested-datasets='[{"resource_name":"SUGGESTED 1","url":"noUrl.csv","metas":"{\"description\":\"noDescriione\"}"},{"resource_name":"SUGGESTED 2","url":"noUrl.csv","metas":"{\"description\":\"noDescriione\"}"},{"resource_name":"SUGGESTED 3","url":"noUrl.csv","metas":"{\"description\":\"noDescriione\"}"}]'-->
  24 +
23 25 </data-sevc-controllet>
24 26  
25 27 <!--<co-datalets-creator-controllet data='[{"a":"0", "b":"1"},{"a":"2", "b":"3a"},{"a":"2", "b":"3"}]' deep-url="http://172.16.15.38/DEEalerProvider/DEEP/"-->
... ...
controllets/data-sevc-controllet/static/css/reset.css deleted
1   -::content html {
2   - color: #000;
3   - background: #FFF;
4   -}
5   -
6   -::content body, div, dl, dt, dd, ul, ol, li, h1, h2, h3,
7   -h4, h5, h6, pre, code, form, fieldset, legend,
8   -input, button, textarea, p, blockquote, th, td {
9   - margin: 0;
10   - padding: 0;
11   -}
12   -
13   -::content table {
14   - border-collapse: collapse;
15   - border-spacing: 0;
16   -}
17   -
18   -::content fieldset, img {
19   - border: 0;
20   -}
21   -
22   -::content address, caption, cite, code, dfn, em, strong,
23   -th, var, optgroup {
24   - font-style: inherit;
25   - font-weight: inherit;
26   -}
27   -
28   -::content del, ins {
29   - text-decoration: none;
30   -}
31   -
32   -::content li {
33   - list-style: none;
34   -}
35   -
36   -::content caption, th {
37   - text-align: left;
38   -}
39   -
40   -::content h1, h2, h3, h4, h5, h6 {
41   - font-size: 100%;
42   - font-weight: normal;
43   -}
44   -
45   -::content q:before, q:after {
46   - content: '';
47   -}
48   -
49   -::content abbr, acronym {
50   - border: 0;
51   - font-variant: normal;
52   -}
53   -
54   -::content sup {
55   - vertical-align: baseline;
56   -}
57   -
58   -::content sub {
59   - vertical-align: baseline;
60   -}
61   -
62   -/*because legend doesn't inherit in IE */
63   -::content legend {
64   - color: #000;
65   -}
66   -
67   -::content input, button, textarea, select, optgroup, option {
68   - font-family: inherit;
69   - font-size: inherit;
70   - font-style: inherit;
71   - font-weight: inherit;
72   -}
73   -
74   -/*@purpose To enable resizing for IE */
75   -/*@branch For IE6-Win, IE7-Win */
76   -::content input, button, textarea, select {
77   - *font-size: 100%;
78   -}
79 0 \ No newline at end of file
controllets/data-sevc-controllet/static/images/UnderConstruction.png deleted

97.5 KB

controllets/data-sevc-controllet/static/images/or.png deleted

733 Bytes

controllets/data-table-controllet/data-table-controllet.html
... ... @@ -40,15 +40,20 @@
40 40 }
41 41  
42 42 paper-icon-button.order {
43   - height: 24px;
44   - width: 24px;
  43 + height: 40px;
  44 + width: 40px;
  45 + padding: 4px;
  46 +
45 47 cursor: pointer;
46 48 }
47 49  
48 50 paper-icon-button.warning {
49   - height: 24px;
50   - width: 24px;
  51 + height: 40px;
  52 + width: 40px;
  53 + padding: 4px;
51 54 color: #FFEB3B;
  55 + --paper-icon-button-ink-color: #FFEB3B;
  56 +
52 57 cursor: help;
53 58 }
54 59  
... ... @@ -77,18 +82,22 @@
77 82  
78 83 #data_table_container #header {
79 84 background: #B6B6B6;
80   - height: 24px;
81   - padding: 12px;
  85 + height: 40px;
  86 + padding: 4px;
82 87 text-align: center;
83 88 font-weight: 700;
84 89 cursor: help;
85 90 }
86 91  
  92 + #data_table_container #header * {
  93 + line-height: 40px !important;
  94 + }
  95 +
87 96 #data_table_container table {
88 97 height: calc(100% - 96px);
89 98 width: 100%;
90 99  
91   - border-spacing: 0px;
  100 + border-spacing: 0;
92 101 }
93 102  
94 103 #data_table_container tbody {
... ... @@ -103,22 +112,35 @@
103 112  
104 113 #data_table_container th,
105 114 #data_table_container td{
106   - height: 24px;
107   - padding: 12px;
  115 + height: 32px;
  116 + /*padding: 12px;*/
108 117 text-align: center;
109   - max-width: 256px;
110   - min-width: 156px;
  118 + /*max-width: 256px;*/
  119 + /*min-width: 156px;*/
111 120 overflow: hidden;
112 121 white-space: nowrap;
113 122 text-overflow: ellipsis;
114 123 width: 1%;
115 124 }
116 125  
  126 + #data_table_container td {
  127 + font-size: 14px;
  128 + padding: 4px 12px;
  129 + max-width: calc(360px - 24px);
  130 + }
  131 +
117 132 #data_table_container th {
118 133 background: #2196F3;
119 134 color: #FFFFFF;
120 135 font-weight: 700;
121 136 cursor: help;
  137 + border-right: 2px solid #FFFFFF;
  138 + height: 40px;
  139 + padding: 4px 12px;
  140 + }
  141 +
  142 + #data_table_container tr :nth-last-child(2) {
  143 + border-right: 0;
122 144 }
123 145  
124 146 #data_table_container th,
... ... @@ -128,17 +150,13 @@
128 150  
129 151 #data_table_container th .th_label {
130 152 display: inline-block;
131   - max-width: calc(100% - 48px - 8px);
  153 + /*max-width: calc(100% - 48px - 8px);*/
132 154 vertical-align: middle;
133 155 overflow: hidden;
134 156 white-space: nowrap;
135 157 text-overflow: ellipsis;
136 158 line-height: 24px;/**/
137   - }
138   -
139   - #data_table_container td {
140   - font-size: 14px;
141   - padding: 4px;
  159 + max-width: calc(360px - 114px);
142 160 }
143 161  
144 162 #data_table_container #footer {
... ... @@ -202,10 +220,10 @@
202 220 <paper-material id="data_table_container" elevation="5">
203 221  
204 222 <div id="header">
205   - <span id="selected_data"></span>
206 223 <template is="dom-if" if={{hasWarnings}}>
207 224 <paper-icon-button class="warning" icon="warning"></paper-icon-button>
208 225 </template>
  226 + <span id="selected_data"></span>
209 227 </div>
210 228  
211 229 <paper-tooltip id="tooltip_wornings" for="header" offset="56">
... ... @@ -223,10 +241,11 @@
223 241 <tr>
224 242 <template is="dom-repeat" items="{{fields}}">
225 243 <th id="id_{{index}}">
226   - <div class="th_label">{{item.name}}</div>
  244 +
227 245 <template is="dom-if" if={{item.errorsDescription.length}}>
228 246 <paper-icon-button class="warning" icon="warning"></paper-icon-button>
229 247 </template>
  248 + <div class="th_label">{{item.name}}</div>
230 249 <paper-icon-button id="{{index}}" class="order" on-click="_order" icon="unfold-more"></paper-icon-button>
231 250 </th>
232 251 </template>
... ... @@ -340,7 +359,7 @@
340 359  
341 360 setData : function(data) {
342 361 var converter = new DataTypeConverter();
343   - var result = converter.inferJsonDataType(data, ["*"]);
  362 + var result = converter.inferJsonDataType(data, ["*"], { language: ln["localization"] } );
344 363 result = converter.cast(result);
345 364 this.fields = ArrayUtils.toFieldsArray(result.types);
346 365 this.data = result.dataset;
... ...
controllets/datalet-selection-controllet/datalet-selection-controllet.html deleted
1   -<link rel="import" href="../../bower_components/polymer/polymer.html" />
2   -
3   -<link rel="import" href="../../bower_components/paper-material/paper-material.html" />
4   -
5   -<link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
6   -<link rel="import" href="../../bower_components/paper-menu/paper-menu.html">
7   -<link rel="import" href="../../bower_components/paper-item/paper-item.html">
8   -
9   -<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
10   -<link rel="import" href="../../bower_components/iron-icons/iron-icons.html">
11   -<link rel="import" href="../../bower_components/iron-icon/iron-icon.html">
12   -
13   -<link rel="import" href="../../bower_components/paper-input/paper-textarea.html">
14   -<link rel="import" href="../../bower_components/paper-input/paper-input.html">
15   -
16   -<link rel="import" href="../../bower_components/paper-button/paper-button.html">
17   -
18   -<link rel="import" href="../../bower_components/paper-dialog/paper-dialog.html">
19   -
20   -<link rel="import" href="../items-vslider-controllet/items-vslider-controllet.html" />
21   -
22   -<script src="../../../DEEPCLIENT/js/deepClient.js"></script>
23   -
24   -<dom-module id="datalet-selection-controllet">
25   -
26   - <template>
27   -
28   - <style is="custom-style">
29   - :host {
30   - --paper-dropdown-menu-icon: {
31   - color: #2196F3;
32   - };
33   - }
34   -
35   - #datalet_selection_container {
36   - display: flex;
37   - font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
38   - font-size: 16px;
39   - margin-top: 8px;
40   - }
41   -
42   - #items_vslider_controllet {
43   - position: relative;
44   - min-width: 172px;
45   - }
46   -
47   - #datalet_selection_inputs {
48   - position: relative;
49   - height: 100vh;
50   - margin-left: 32px;
51   - min-width: 258px;
52   - }
53   -
54   - #datalet_selection_labels {
55   - position: relative;
56   - height: 100vh;
57   - margin-left: 32px;
58   - min-width: 258px;
59   - }
60   -
61   - #datalet_selection_column {
62   - position: relative;
63   - width: 100%;
64   - margin-left: 32px;
65   - }
66   -
67   - #datalet_selection_datalet {
68   - position: relative;
69   - height: 100vh;
70   - width: 100%;
71   - }
72   -
73   - #datalet_selection_datalet_placeholder {
74   - padding: 16px;
75   - }
76   -
77   - .inputs{
78   - position: relative;
79   - }
80   -
81   - .input_header {
82   - height: 32px;
83   - padding-top: 16px;
84   - text-align: center;
85   - font-weight: 700;
86   - background-color: #B6B6B6;
87   - }
88   -
89   - #expert_container {
90   - display: none;
91   - }
92   -
93   - #expert_header {
94   - display: none;
95   -
96   - height: 32px;
97   - padding-top: 16px;
98   - margin-top: 8px;
99   - text-align: center;
100   - font-weight: 700;
101   - color: #00BCD4;
102   - cursor: pointer;
103   - }
104   -
105   - .field_nema {
106   - height: 40px;
107   - padding-top: 8px;
108   -
109   - margin-top: 8px;
110   - padding-left: 16px;
111   - font-weight: 700;
112   - color: #2196F3;
113   - background-color: #E0E0E0;
114   - }
115   -
116   - .info_button {
117   - position: absolute;
118   - top: 18px;
119   - right: 0px;
120   - }
121   -
122   - paper-input {
123   - display: inline-block;
124   - height: 48px;
125   - /*padding: 0px 8px;*/
126   - width: 210px;
127   - padding-left: 8px;
128   - padding-bottom: 8px;
129   - --paper-input-container-focus-color: #2196F3;
130   - }
131   -
132   - paper-input.base_input {
133   - width: 242px;
134   - }
135   -
136   - paper-textarea {
137   - width: 242px;
138   - padding-left: 8px;
139   - padding-bottom: 4px;
140   - --paper-input-container-focus-color: #2196F3;
141   - }
142   -
143   - paper-dropdown-menu {
144   - height: 48px;
145   - width: 210px;;
146   - padding-left: 8px;
147   - padding-bottom: 8px;
148   - --paper-input-container-focus-color: #2196F3;
149   - }
150   -
151   - paper-item.iron-selected {
152   - background-color: #2196F3;
153   - color: #FFFFFF;
154   - }
155   -
156   - paper-icon-button {
157   - color: #2196F3;
158   - --paper-icon-button-ink-color: #2196F3;
159   - margin: 0px;
160   - }
161   -
162   - paper-button {
163   - position: absolute;
164   - bottom: 16px;
165   - right: 11px;
166   -
167   - height: 48px;
168   - width: 172px;
169   - background-color: #00BCD4;
170   - color: white;
171   - font-weight: 700;
172   - padding: 16px;
173   - }
174   -
175   - paper-button:hover {
176   - background-color: #00AABF;
177   -
178   - box-shadow: 0px 8px 12px #888;
179   - -webkit-box-shadow: 0px 8px 12px #888;
180   - -moz-box-shadow: 0px 8px 12px #888;
181   - }
182   -
183   - paper-button[disabled] {
184   - background-color: #B6B6B6;
185   - }
186   -
187   - #dialog_info_input {
188   - border: 2px solid #2196F3;
189   - background-color: #E0E0E0;
190   - min-width: 248px;
191   - }
192   - </style>
193   -
194   - <iron-ajax id="selectedDatalet_request" on-response="_handleSelectedDatalet"></iron-ajax>
195   -
196   - <div id="datalet_selection_container">
197   -
198   - <div id="items_vslider_controllet">
199   - <items-vslider-controllet id="vslider" datalets-list-url={{dataletsListUrl}} preselected-datalet={{preselectedDatalet}}></items-vslider-controllet>
200   - </div>
201   -
202   - <paper-material id="datalet_selection_inputs" elevation="5">
203   - <div class="input_header"><span id="inputs"></span></div>
204   - <template is="dom-repeat" items="{{inputs}}" index-as="ddl_index">
205   - <div class="inputs">
206   - <paper-dropdown-menu id={{ddl_index}} label={{_getLabelName(item.name)}}>
207   - <paper-menu class="dropdown-content">
208   - <template is="dom-repeat" items={{fields}}>
209   - <paper-item id={{index}} on-tap="_addInput">{{_fieldName(item)}}</paper-item>
210   - <!--{{_fieldName(item)}}-->
211   - </template>
212   - </paper-menu>
213   - </paper-dropdown-menu>
214   - <div class="info_button">
215   - <paper-icon-button id={{item.name}} on-click="_showInfo" icon="info-outline" title="{{_getLabelName(item.name)}} info"></paper-icon-button>
216   - </div>
217   - </div>
218   - </template>
219   -
220   - <!-- EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE -->
221   -
222   - <div id="expert_header" on-click="_showExpertMode"><span id="groupBy"></span></div>
223   -
224   - <div id="expert_container">
225   -
226   - <div class="inputs">
227   - <paper-dropdown-menu id="group_by">
228   - <paper-menu class="dropdown-content">
229   - <template is="dom-repeat" items={{fields}}>
230   - <paper-item id={{index}} on-tap="_showGroupedFields">{{_fieldName(item)}}</paper-item>
231   - </template>
232   - </paper-menu>
233   - </paper-dropdown-menu>
234   - <div class="info_button">
235   - <paper-icon-button id="gb" on-click="_addOrder" icon="unfold-more" title=""></paper-icon-button>
236   - </div>
237   - </div>
238   -
239   - <template is="dom-repeat" items="{{groupedFields}}">
240   - <div class="inputs">
241   - <paper-dropdown-menu id="calculate_{{index}}" label="{{_calculateLabel()}}">
242   - <paper-menu class="dropdown-content">
243   - <!--foreach functions-->
244   - <paper-item id="0" on-tap="_addGroupByInput">{{_operationName(0)}} {{_fieldName(item)}}</paper-item>
245   - <paper-item id="1" on-tap="_addGroupByInput">{{_operationName(1)}} {{_fieldName(item)}}</paper-item>
246   - <paper-item id="2" on-tap="_addGroupByInput">{{_operationName(2)}} {{_fieldName(item)}}</paper-item>
247   - <paper-item id="3" on-tap="_addGroupByInput">{{_operationName(3)}} {{_fieldName(item)}}</paper-item>
248   - <paper-item id="4" on-tap="_addGroupByInput">{{_operationName(4)}} {{_fieldName(item)}}</paper-item>
249   - <paper-item id="5" on-tap="_addGroupByInput">{{_operationName(5)}} {{_fieldName(item)}}</paper-item>
250   - <paper-item id="6" on-tap="_addGroupByInput">{{_operationName(6)}} {{_fieldName(item)}}</paper-item>
251   - </paper-menu>
252   - </paper-dropdown-menu>
253   - <div class="info_button">
254   - <paper-icon-button id={{_fieldName(item)}} on-click="_addOrder" icon="unfold-more" title=""></paper-icon-button>
255   - </div>
256   - </div>
257   - </template>
258   -
259   - </div>
260   -
261   - <!-- EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE -->
262   -
263   - </paper-material>
264   -
265   - <paper-material id="datalet_selection_labels" elevation="5">
266   - <div class="input_header"><span id="baseInfo"></span></div>
267   -
268   - <div class="inputs">
269   - <paper-input id="base_title" maxlength="32" class="base_input"></paper-input>
270   - </div>
271   -
272   - <div class="inputs">
273   - <paper-textarea id="base_description" maxlength="100" class="base_input"></paper-textarea>
274   - </div>
275   -
276   - <div class="input_header"><span id="layouts"></span></div>
277   -
278   - <template is="dom-repeat" items="{{labels}}" index-as="index">
279   - <div class="inputs">
280   - <paper-input label={{_getLabelName(item.name)}}></paper-input>
281   - <div class="info_button">
282   - <paper-icon-button id={{item.name}} on-click="_showInfo" icon="info-outline" title="{{_getLabelName(item.name)}} info"></paper-icon-button>
283   - </div>
284   - </div>
285   - </template>
286   - </paper-material>
287   -
288   -
289   - <div id="datalet_selection_column">
290   -
291   - <paper-material id="datalet_selection_datalet" elevation="5">
292   - <div class="input_header"><span id="dataletPreview"></span></div>
293   - <div id="datalet_selection_datalet_placeholder"></div>
294   -
295   - </paper-material>
296   -
297   - <paper-button id="add_button" disabled raised on-click="_addDatalet"></paper-button>
298   -
299   - </div>
300   -
301   - <paper-dialog id="dialog_info_input">
302   - <h2 id="dialog_name"></h2>
303   - <p id="dialog_description"></p>
304   - </paper-dialog>
305   -
306   - </div>
307   -
308   - </template>
309   -
310   - <script>
311   -
312   - Polymer({
313   -
314   - is : 'datalet-selection-controllet',
315   -
316   - properties : {
317   -
318   - deepUrl : {
319   - type : String,
320   - value : undefined
321   - },
322   -
323   - dataletsListUrl : {
324   - type : String,
325   - value : undefined
326   - },
327   -
328   - selectedDatalet : {
329   - type : String,
330   - value : undefined
331   - },
332   -
333   - preselectedDatalet : {
334   - type : String,
335   - value : undefined
336   - },
337   -
338   - loadPreview : {
339   - type : Boolean,
340   - value : false
341   - },
342   -
343   - type : {
344   - type : String,
345   - value : undefined
346   - },
347   -
348   - inputs : {
349   - type : Array,
350   - value : []
351   - },
352   -
353   - labels : {
354   - type : Array,
355   - value : []
356   - },
357   -
358   - filters : {
359   - type : Array,
360   - value : []
361   - },
362   -
363   - aggregators : {
364   - type : Array,
365   - value : []
366   - },
367   -
368   - orders : {
369   - type : Array,
370   - value : []
371   - },
372   -
373   - fields : {
374   - type : Array,
375   - value : []
376   - },
377   -
378   - selectedFields : {
379   - type : Array,
380   - value : []
381   - },
382   -
383   - groupedFields : {
384   - type : Array,
385   - value : []
386   - },
387   -
388   - dataletPreset : {
389   - type : Object,
390   - value : []
391   - },
392   -
393   -// selectableFields : {
394   -// type : Array,
395   -// value : []
396   -// },
397   -
398   - dataUrl : {
399   - type : String,
400   - value : undefined
401   - },
402   -
403   - params:{
404   - type: Object,
405   - value: undefined
406   - },
407   -
408   - expert : {
409   - type : Boolean,
410   - value : false
411   - },
412   -
413   - functions : {
414   - type : Array,
415   - value : ["COUNT", "SUM", "MIN", "MAX", "AVG", "FIRST", "LAST"]
416   - },
417   -
418   - modify : {
419   - type : Boolean,
420   - value : false
421   - }
422   -
423   - },
424   -
425   - listeners: {
426   - 'items-vslider-controllet_selected-datalet': '_selectDatalet',
427   -// 'tree-view-controllet_selected-fields': '_updateSelectedFields'
428   - 'change': '_paramsChanged'
429   - },
430   -
431   - _showExpertMode : function() {
432   - if(!this.expert) {
433   - this.$.expert_header.style.color = "#000000";
434   - this.$.expert_header.style.background = "#B6B6B6";
435   - this.$.expert_container.style.display = "block";
436   - }
437   - else {
438   - this.$.expert_header.style.color = "#00BCD4";
439   - this.$.expert_header.style.background = "#FFFFFF";
440   - this.$.expert_container.style.display = "none";
441   - }
442   -
443   - this.expert = !this.expert;
444   - },
445   -
446   - _showGroupedFields : function(e) {
447   - var index = e.target.id;
448   - var temp = [];
449   -
450   -// var isSelected = false;
451   -// for (var i = 0; i < this.selectedFields.length; i++) {
452   -// if (this.selectedFields[i]) {
453   -// if (this.selectedFields[i].indexOf(this.fields[index]) > -1) {
454   -// isSelected = true;
455   -// }
456   -// else {
457   -// temp.push(this.selectedFields[i]);
458   -// }
459   -// }
460   -// }
461   -//
462   -// if (isSelected)
463   -// this.groupedFields = this._copy(temp);
464   -// else
465   -// this.groupedFields =[];
466   -
467   - for (var i = 0; i < this.selectedFields.length; i++) {
468   - if (this.selectedFields[i]) {
469   - if (i != index) {
470   - temp.push(this.selectedFields[i]);
471   - }
472   - }
473   - }
474   -
475   - this.groupedFields = this._copy(temp);
476   -
477   - this.async(function() {
478   - var ddls = document.getElementsByTagName("paper-dropdown-menu");
479   - for (var i = 0; i < ddls.length; i++){
480   - var id = ddls[i].id;
481   - if(id.indexOf("calculate") > -1) {
482   - $(ddls[i]).find("paper-menu")[0].select(-1);
483   - $(ddls[i]).find("paper-menu")[0].select(0);
484   - }
485   - }
486   - }, 0);
487   -
488   - this._addGroupByInput();
489   - },
490   -
491   - ready : function() {
492   - this._resize();
493   - $(this.$.datalet_selection_inputs).perfectScrollbar();
494   - $(this.$.datalet_selection_labels).perfectScrollbar();
495   - $(this.$.datalet_selection_datalet).perfectScrollbar();
496   -
497   - this.params = {'data-url' : this.dataUrl};
498   -
499   - //this.modify = true;//da eliminare in futuro
500   - if(this.preselectedDatalet){
501   - if(this.modify)
502   - this._preselectDatalet();
503   -
504   - this.modify = true;
505   - this.preselectedDatalet = undefined;
506   - }
507   - },
508   -
509   - attached : function() {
510   - this._resize();
511   - var that = this;
512   - window.addEventListener("resize", function() { that._resize(); });
513   -
514   - this._translate();
515   - },
516   -
517   - setFilters : function(filters) {
518   - this.filters = filters;
519   - },
520   -
521   - setFields : function(fields) {
522   - this.fields = fields;
523   - },
524   -
525   - reset : function() {
526   - this.selectedDatalet = undefined;//non va!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
527   - this.preselectedDatalet = undefined;
528   - this.type = undefined;
529   - this.inputs = [];
530   - this.labels = [];
531   - this.$.expert_header.style.display = "none";
532   - this.expert = true;
533   - this._showExpertMode();
534   - this.loadPreview = false;
535   - this.$.datalet_selection_datalet_placeholder.innerHTML = "";
536   - this._resetGroupBy();
537   - },
538   -
539   - _translate : function(){
540   -
541   - this.$.add_button.innerHTML = ln["addDatalet_" + ln["localization"]];
542   - this.$.inputs.innerHTML = ln["inputs_" + ln["localization"]];
543   - this.$.baseInfo.innerHTML = ln["baseInfo_" + ln["localization"]];
544   - this.$.layouts.innerHTML = ln["layouts_" + ln["localization"]];
545   - this.$.dataletPreview.innerHTML = ln["dataletPreview_" + ln["localization"]];
546   -
547   - this.$.base_title.label = ln["title_" + ln["localization"]];
548   - this.$.base_description.label = ln["description_" + ln["localization"]];
549   -
550   - this.$.groupBy.innerHTML = ln["groupBy_" + ln["localization"]];
551   - this.$.group_by.setAttribute("label", ln["groupBy_" + ln["localization"]]);
552   -
553   - if(this.modify)
554   - this.$.add_button.innerHTML = ln["modifyDatalet_" + ln["localization"]];
555   - },
556   -
557   - _selectDatalet : function(e){
558   - this.$.add_button.setAttribute("disabled", "true");
559   -
560   - this.selectedDatalet = e.detail.datalet;
561   -
562   - this.$.datalet_selection_datalet_placeholder.innerHTML = "";
563   -
564   - if(!this.selectedDatalet){
565   - this.type = undefined;
566   - this.inputs = [];
567   - this.labels = [];
568   - this.$.expert_header.style.display = "none";
569   - this.expert = true;
570   - this._showExpertMode();
571   - this.loadPreview = false;
572   - }
573   - else{
574   - this.$.selectedDatalet_request.url = this.deepUrl + e.detail.datalet + "-datalet";
575   - this.$.selectedDatalet_request.generateRequest();
576   - this.$.expert_header.style.display = "block";
577   - }
578   - },
579   -
580   - _preselectDatalet : function() {
581   - this.type = "undefined";
582   - this.$.selectedDatalet_request.url = this.deepUrl + this.preselectedDatalet + "-datalet";
583   - this.$.selectedDatalet_request.generateRequest();
584   -
585   - this.selectedDatalet = this.preselectedDatalet;
586   - this.selectedFields = this._copy(this.fields);
587   -
588   -// this.filters = JSON.parse(this.dataletPreset["filters"]);
589   -// this.aggregators = JSON.parse(this.dataletPreset["aggregators"]);
590   -// this.orders = JSON.parse(this.dataletPreset["orders"]);
591   -
592   - this.async(function() {
593   - this.selectedFields = this._copy(this.fields);
594   -
595   - //set info labels options
596   - var textarea = this.$.datalet_selection_labels.querySelectorAll("paper-textarea");
597   - textarea[0].value = this.dataletPreset["description"];
598   -
599   - var inputs = this.$.datalet_selection_labels.querySelectorAll("paper-input");
600   - inputs[0].value = this.dataletPreset["title"];
601   -
602   - for (var i = 1; i < inputs.length; i++)
603   - inputs[i].value = this.dataletPreset[this.labels[i-1].name];
604   -
605   - //set inputs --> prima apri GB e riempi CALCULATE e poi gli ORDERBY???
606   - var ddls = document.getElementsByTagName("paper-dropdown-menu");
607   - for (var i = 0; i < ddls.length; i++) {
608   - var id = ddls[i].id;
609   - if (!isNaN(id)) {
610   -// id = parseInt(id);
611   - $(ddls[i]).find("paper-menu")[0].select(id);
612   - }
613   - else if (id.indexOf("group_by") > -1) {
614   - ;
615   - }
616   - else if (id.indexOf("calculate") > -1) {
617   - ;
618   - }
619   - }
620   -
621   - this.loadPreview = true;
622   - this._loadDatalet(this.selectedFields);
623   - }, 300);
624   - },
625   -
626   - _handleSelectedDatalet : function(e){
627   -
628   - if(this.type != e.detail.response.type) {
629   -
630   - this.inputs = [];
631   - this.labels = [];
632   -
633   - var inputs = e.detail.response.idm.inputs.input;
634   -
635   - if (inputs.constructor == Object) {//not Array && inputs.input.selection == "*"
636   - var name = inputs.name;
637   - var description = inputs.description;
638   - var selection = inputs.selection;
639   - inputs = [];
640   - for (var i in this.fields)
641   - inputs.push({name: name + " " + i, description: description, selection: selection});
642   - }
643   -
644   - this.async(function(){
645   - this.type = e.detail.response.type;
646   - this.inputs = inputs;
647   - this.labels = e.detail.response.idm.inputs.layouts.input;
648   -
649   - this.selectedFields = new Array(inputs.length);
650   - },0);
651   -
652   - this._resetGroupBy();
653   -
654   - this.loadPreview = false;
655   - }
656   -
657   - else if (this.loadPreview)
658   - this._loadDatalet(this.selectedFields);
659   - },
660   -
661   - _resetGroupBy : function(){
662   - $(this.$.group_by).find("paper-menu")[0].select(-1);
663   - this.groupedFields = [];
664   - this.aggregators = [];
665   - },
666   -
667   - _addGroupByInput : function(){
668   - this.async(function() {//codice reprlicato!
669   - var selectedFields = this.selectedFields;
670   -
671   - var load = true;
672   -
673   - if(this.inputs[0].selection == "*"){
674   - var temp = [];
675   - for (var i = 0; i < selectedFields.length; i++)
676   - if(selectedFields[i])
677   - temp.push(selectedFields[i]);
678   - selectedFields = temp;
679   - }
680   - else {
681   - for (var i = 0; i < selectedFields.length; i++)
682   - if (!selectedFields[i]) {
683   - load = false;
684   - break;
685   - }
686   - }
687   -
688   - if(load){
689   - this.loadPreview = true;
690   - this._loadDatalet(selectedFields);
691   - }
692   - }, 0);
693   - },
694   -
695   - _addOrder : function(e){
696   - var t = e.target;
697   - if(t.tagName.indexOf("IRON-ICON") > -1)
698   - t = $(e.target).parents("paper-icon-button")[0];
699   -
700   - var icon = t.getAttribute("icon");
701   - var name = t.getAttribute("id");
702   -
703   - if(name.indexOf("gb") > -1){
704   - var selectedItem = $(this.$.group_by).find("paper-menu")[0].selectedItem;
705   - if(selectedItem)
706   - name = selectedItem.textContent.trim();
707   -// name = "[" + selectedItem.textContent.trim() + "]";
708   - else
709   - return;
710   - }// else {
711   -// var i = name;
712   -// var ddl = $("#calculate_"+i);
713   -//
714   -// var label = $(ddl).find("paper-menu")[0].selectedItem.textContent.trim();
715   -// var index = label.split(" ", 2).join(" ").length;
716   -// var field = label.substring(index+1, label.length);
717   -// var operation = label.substring(0, label.indexOf(" "));
718   -// name = operation + "([" + field + "])";
719   -// }
720   -
721   - if(icon.indexOf("unfold-more") > -1){
722   - t.setAttribute("icon", "expand-less");
723   - t.setAttribute("title", ln["sortAscending_" + ln["localization"]]);
724   - var orders = this.orders.filter(function (el) { return el.field !== name; });
725   - orders.push({"field": name, "operation": "ASC"});
726   - this.orders = this._copy(orders);
727   - }
728   - else if(icon.indexOf("expand-less") > -1){
729   - t.setAttribute("icon", "expand-more");
730   - t.setAttribute("title", ln["sortDescending_" + ln["localization"]]);
731   - var orders = this.orders.filter(function (el) { return el.field !== name; });
732   - orders.push({"field": name, "operation": "DESC"});
733   - this.orders = this._copy(orders);
734   - }
735   - else if(icon.indexOf("expand-more") > -1){
736   - t.setAttribute("icon", "unfold-more");
737   - t.setAttribute("title", ln["unsort_" + ln["localization"]]);
738   - var orders = this.orders.filter(function (el) { return el.field !== name; });
739   - this.orders = this._copy(orders);
740   - }
741   -
742   - this._addGroupByInput();//no buoono
743   -// if(load){
744   -// this.loadPreview = true;
745   -// this._loadDatalet(selectedFields);
746   -// }
747   - },
748   -
749   - _addInput : function(e){
750   - var selectedFields = this._copy(this.selectedFields);
751   -
752   -// var index = $(e.target).parents("paper-dropdown-menu")[0].id;
753   -// selectedFields[index] = e.target.innerHTML.trim();
754   -
755   - var ddl_index = $(e.target).parents("paper-dropdown-menu")[0].id;
756   - var index = e.target.id;
757   - selectedFields[ddl_index] = this.fields[index];
758   -
759   - this.selectedFields = this._copy(selectedFields);
760   -
761   - var load = true;
762   -
763   - if(this.inputs[0].selection == "*"){
764   - var temp = [];
765   - for (var i = 0; i < selectedFields.length; i++)
766   - if(selectedFields[i])
767   - temp.push(selectedFields[i]);
768   - selectedFields = temp;
769   - }
770   - else {
771   - for (var i = 0; i < selectedFields.length; i++)
772   - if (!selectedFields[i]) {
773   - load = false;
774   - break;
775   - }
776   - }
777   -
778   - this._resetGroupBy();//--> conflitto, in _updateparams valorizza this.aggregators
779   -
780   - if(load){
781   - this.loadPreview = true;
782   - this._loadDatalet(selectedFields);
783   - }
784   - },
785   -
786   - _updateParams : function(){
787   - var textarea = this.$.datalet_selection_labels.querySelectorAll("paper-textarea");
788   - this.params["description"] = textarea[0].value;
789   -
790   - if(!textarea[0].value)
791   - this.params[textarea[0].label] = "";
792   -
793   - var inputs = this.$.datalet_selection_labels.querySelectorAll("paper-input");
794   - this.params["title"] = inputs[0].value;
795   -
796   - for (var i = 1; i < inputs.length; i++)
797   - this.params[this.labels[i-1].name] = inputs[i].value;
798   -
799   - this.aggregators = [];
800   -
801   - var ddls = document.getElementsByTagName("paper-dropdown-menu");
802   - for (var i = 0; i < ddls.length; i++){
803   - var id = ddls[i].id;
804   - if(id.indexOf("group_by") > -1 && $(ddls[i]).find("paper-menu")[0].selectedItem) {
805   - var label = $(ddls[i]).find("paper-menu")[0].selectedItem.textContent.trim();
806   - this.aggregators.push({"field": label, "operation": "GROUP BY"});
807   - }
808   - if(id.indexOf("calculate") > -1) {
809   - var menu = $(ddls[i]).find("paper-menu")[0];
810   - var label = menu.selectedItem.textContent.trim();
811   - var index = menu.selectedItem.id;
812   - var ii = label.split(" ", 2).join(" ").length;
813   - //attenzione BUG --> non funziona se la traduzione non ha solo 1 spazio
814   - var field = label.substring(ii+1, label.length);
815   -// var operation = label.substring(0, label.indexOf(" "));
816   - this.aggregators.push({"field": field, "operation": this.functions[index]});
817   - }
818   - }
819   - },
820   -
821   - _paramsChanged : function(){
822   -
823   - this._updateParams();
824   -
825   - if(this.$.datalet_selection_datalet_placeholder.children[1])
826   - this.$.datalet_selection_datalet_placeholder.children[1].behavior.setParameters(this.params);
827   - },
828   -
829   - _loadDatalet : function(selectedFields){
830   -
831   - this._updateParams();
832   -
833   - this.params["filters"] = JSON.stringify(this.filters);
834   - this.params["aggregators"] = JSON.stringify(this.aggregators);
835   - this.params["orders"] = JSON.stringify(this.orders);
836   -
837   -// this.params["filters"] = '[{"field": "Lat", "operation": ">=", "value": "53.298164"}, {"field": "Lat", "operation": "<", "value": "54"}]';
838   -// this.params["aggregators"] = '[{"field": "Lat", "operation": "GROUP BY"}, {"field": "Lng", "operation": "COUNT"}]';
839   -// this.params["orders"] = '[{"field": "Lat", "operation": "DESC"}, {"field": "Lat", "operation": "ASC"}]';
840   -
841   - //this.params["aggregators"] = '[{"field": "Value", "operation": "GROUP BY"}, {"field": "LOCATION", "operation": "COUNT"}]';
842   - //this.params["orders"] = '[{"field": "Value", "operation": "ASC"}, {"field": "Value", "operation": "ASC"}]';
843   -
844   - var dataletParams ={
845   - component : this.selectedDatalet+"-datalet",
846   - params : this.params,
847   - fields : selectedFields,
848   - placeHolder : this.$.datalet_selection_datalet_placeholder
849   - };
850   -
851   - ComponentService.deep_url = this.deepUrl;
852   - ComponentService.getComponent(dataletParams);
853   -
854   - this.$.add_button.removeAttribute("disabled");
855   - },
856   -
857   - _addDatalet : function(){
858   -
859   - this._updateParams();
860   -
861   - var selectedFields = [];
862   - for (var i = 0; i < this.selectedFields.length; i++)
863   - if(this.selectedFields[i])
864   - selectedFields.push(this.selectedFields[i]);
865   -
866   - var data = {
867   - dataUrl : this.dataUrl,
868   - params : this.params,
869   - fields : selectedFields,
870   - datalet : this.selectedDatalet+"-datalet",
871   -// comment : "",//DEPRECATED!!!
872   - staticData : JSON.stringify(this.$.datalet_selection_datalet_placeholder.children[1].behavior.data)
873   - }
874   -
875   - this.fire('data-sevc-controllet.dataletCreated', {data : data});
876   -
877   - },
878   -
879   - _showInfo : function(e){
880   -// var that = this;
881   - var t = e.target;
882   - if(t.tagName.indexOf("IRON-ICON") != -1)
883   - t = $(e.target).parents("paper-icon-button")[0];
884   -
885   -// var name = t.getAttribute("title").replace(" info", "");
886   - var name = t.getAttribute("id");
887   -
888   - var dataset = $.grep(this.inputs, function(e){ return e.name == name; })[0];
889   - if(!dataset)
890   - dataset = $.grep(this.labels, function(e){ return e.name == name; })[0];
891   -
892   - this.$.dialog_name.innerHTML = this._getLabelName(dataset.name);
893   - this.$.dialog_description.innerHTML = ln[dataset.description + "_" + ln["localization"]];
894   - this.$.dialog_info_input.open();
895   -
896   - var pos = t.getBoundingClientRect();
897   - $("#dialog_info_input").css("top", pos.top - 4);
898   - $("#dialog_info_input").css("left", pos.left - 4);
899   - },
900   -
901   - _fieldName : function(field) {
902   - if(!field)//when?
903   - return "";
904   - return field.substring(field.lastIndexOf(",")+1, field.length);
905   - },
906   -
907   - _copy : function(o) {
908   - var out, v, key;
909   - out = Array.isArray(o) ? new Array(o.length) : {};
910   - for (key in o) {
911   - v = o[key];
912   - out[key] = (typeof v === "object") ? this._copy(v) : v;
913   - }
914   - return out;
915   - },
916   -
917   - _getLabelName: function(key) {
918   - //* exceptions
919   - if(key.indexOf("Cell") > -1) {
920   - return ln["Cell" + "_" +ln["localization"]] + key.slice(-2);
921   - }
922   - if(key.indexOf("Level") > -1) {
923   - return ln["Level" + "_" +ln["localization"]] + key.slice(-2);
924   - }
925   -
926   - return ln[key + "_" +ln["localization"]];
927   - },
928   -
929   - _calculateLabel: function() {
930   - return ln["calculate" + "_" +ln["localization"]];
931   - },
932   -
933   - _operationName: function(index) {
934   - var key = this.functions[index];
935   - return ln[key + "_" +ln["localization"]];
936   - },
937   -
938   - _resize : function(){
939   - var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0) - 16;
940   - h = h - 64 - 8; //height with page scroller
941   -
942   - $("#items_vslider_container").height(h);//vslider controllet
943   -
944   - $("#datalet_selection_inputs").height(h);
945   - $("#datalet_selection_labels").height(h);
946   - $("#datalet_selection_datalet").height(h);
947   - }
948   -
949   - });
950   -
951   - </script>
952   -
953   -</dom-module>
954 0 \ No newline at end of file
controllets/datalet-selection-controllet/demo/index.html deleted
1   -<html>
2   -
3   -<head>
4   - <script src="../../shared_js/jquery-1.11.2.min.js"></script>
5   -
6   - <script src="../../../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
7   -
8   - <script src="../../shared_js/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js"></script>
9   - <link rel="stylesheet" href="../../shared_js/perfect-scrollbar/css/perfect-scrollbar.min.css">
10   -
11   - <script src="../../../locales/controllet_ln.js"></script>
12   - <script>
13   - ln["localization"] = "en";
14   - </script>
15   -
16   - <link rel="import" href="../datalet-selection-controllet.html" />
17   -</head>
18   -
19   -<body>
20   -
21   -<!--<datalet-selection-controllet fields='["result,records,Anno","result,records,Cinesi","result,records,Albanesi","result,records,Rumeni","result,records,Pakistani","result,records,Marocchini","result,records,Altri stranieri" ]' data-url="http://ckan.routetopa.eu/api/action/datastore_search?resource_id=e04338cf-7a92-4221-81c6-fe12f41003d5" deep-url="http://172.16.15.38/DEEalerProvider/DEEP/" datalets-list-url="http://172.16.15.38/DEEalerProvider/DEEP/datalets-list"></datalet-selection-controllet>-->
22   -
23   -<!--<datalet-selection-controllet fields='["records,fields,title", "records,fields,published"]' data-url="https://data.issy.com/api/records/1.0/search?dataset=flux-rss-des-offres-demplois-a-issy-les-moulineaux&sort=published&facet=published&refine.published=2015%2F10" deep-url="http://172.16.15.38/DEEalerProvider/DEEP/" datalets-list-url="http://172.16.15.38/DEEalerProvider/DEEP/datalets-list"></datalet-selection-controllet>-->
24   -<datalet-selection-controllet fields='["records,fields,annee", "records,fields,preteur", "records,fields,capital_restant_du"]' data-url="https://data.issy.com/api/records/1.0/search/?dataset=repartitiondeladetteparpreteursau3112n-feuille1&rows=56&sort=-annee" deep-url="http://172.16.15.38/DEEalerProvider/DEEP/" datalets-list-url="http://172.16.15.38/DEEalerProvider/DEEP/datalets-list"></datalet-selection-controllet>
25   -
26   -</body>
27   -
28   -<!--urls:-->
29   -<!--https://yperdiavgeia.gr/analytics/counts/source:Decision/query:linux/method:count_organization.json-->
30   -<!--http://dati.lazio.it/catalog/api/action/datastore_search?resource_id=114baf3d-6d4f-42ff-b4af-481beef59ae1-->
31   -<!--url: 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=73e02092-85a1-434e-85fe-0c9a43aa9a52&limit=5',-->
32   -<!--url: 'https://data.issy.com/api/records/1.0/search?dataset=liste-des-restaurants-a-issy-les-moulineaux&sort=type&facet=type&facet=terrasse',-->
33   -<!--url: 'https://data.issy.com/api/records/1.0/search?dataset=flux-rss-des-offres-demplois-a-issy-les-moulineaux&sort=published&facet=published&refine.published=2015',-->
34 0 \ No newline at end of file
controllets/dataset-selection-controllet/dataset-selection-controllet.html deleted
1   -<link rel="import" href="../../bower_components/polymer/polymer.html">
2   -
3   -<link rel="import" href="../../bower_components/paper-tabs/paper-tabs.html">
4   -<link rel="import" href="../../bower_components/paper-tabs/paper-tab.html">
5   -
6   -<link rel="import" href="../../bower_components/neon-animation/neon-animation.html">
7   -<link rel="import" href="../../bower_components/neon-animation/neon-animatable.html">
8   -<link rel="import" href="../../bower_components/neon-animation/neon-animations.html">
9   -
10   -<link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
11   -<link rel="import" href="../../bower_components/paper-menu/paper-menu.html">
12   -<link rel="import" href="../../bower_components/paper-item/paper-item.html">
13   -
14   -<link rel="import" href="../../bower_components/paper-input/paper-textarea.html">
15   -
16   -<link rel="import" href="../../bower_components/paper-material/paper-material.html" />
17   -
18   -<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
19   -<link rel="import" href="../../bower_components/iron-icons/iron-icons.html">
20   -<link rel="import" href="../../bower_components/iron-icon/iron-icon.html">
21   -
22   -<link rel="import" href="../../bower_components/paper-dialog/paper-dialog.html">
23   -
24   -<link rel="import" href="../../datalets/datasetexplorer-datalet/datasetexplorer-datalet.html">
25   -
26   -<link rel="import" href="paper-input-search.html">
27   -
28   -<dom-module id="dataset-selection-controllet">
29   -
30   - <template>
31   -
32   - <style is="custom-style">
33   - :host {
34   - --paper-dropdown-menu-icon: {
35   - color: #2196F3;
36   - };
37   - }
38   -
39   - paper-tabs {
40   - font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
41   - font-size: 16px;
42   - font-weight: bold;
43   - --paper-tabs-selection-bar-color: #2196F3;
44   - }
45   -
46   - paper-tab {
47   - transition: all 1.0s;
48   - }
49   -
50   - paper-tab.iron-selected {
51   - background-color: #B6B6B6;
52   - }
53   -
54   - paper-tab:hover {
55   - color: #2196F3;
56   - }
57   -
58   - paper-tab[disabled] {
59   - color: #B6B6B6;
60   - }
61   -
62   - paper-dropdown-menu {
63   - width: 45%;
64   - margin-bottom: 32px;
65   - --paper-input-container-focus-color: #2196F3;
66   - }
67   -
68   - paper-dropdown-menu paper-item {
69   - white-space: nowrap;
70   - }
71   -
72   - paper-input-search {
73   - width: 45%;
74   - margin-bottom: 32px;
75   - --paper-input-container-focus-color: #2196F3;
76   - }
77   -
78   - paper-input-search paper-item {
79   - white-space: nowrap;
80   - }
81   -
82   - paper-item.iron-selected {
83   - background-color: #2196F3;
84   - color: #FFFFFF;
85   - }
86   -
87   - .ddl_container {
88   - position: relative;
89   - }
90   -
91   - .info_button {
92   - position: absolute;
93   - top: 18px;
94   - left: 45%;
95   - }
96   -
97   - paper-textarea {
98   - width: 90%;
99   - margin-bottom: 32px;
100   - --paper-input-container-focus-color: #2196F3;
101   - }
102   -
103   - paper-icon-button {
104   - color: #2196F3;
105   - --paper-icon-button-ink-color: #2196F3;
106   - }
107   -
108   - paper-icon-button[disabled] {
109   - color: #B6B6B6;
110   - }
111   -
112   - #material_container {
113   - margin-top: 8px;
114   - }
115   -
116   - #div_selection {
117   - padding-left: 10%;
118   - padding-top: 64px;
119   - }
120   -
121   - #dialog_info {
122   - border: 2px solid #2196F3;
123   - background-color: #E0E0E0;
124   - }
125   - </style>
126   -
127   - <paper-material id="material_container" elevation="5">
128   -
129   - <paper-tabs selected="{{selected}}">
130   - <paper-tab noink><span id="listView"></span></paper-tab>
131   - <paper-tab noink><span id="treeMapView"></span></paper-tab>
132   - <!--<paper-tab noink disabled><span data-l10n-id="mostPopular"></span></paper-tab>-->
133   - </paper-tabs>
134   -
135   - <neon-animated-pages selected="{{selected}}" entry-animation="fade-in-animation" exit-animation="fade-out-animation">
136   -
137   - <neon-animatable>
138   -
139   - <div id="div_selection">
140   - <div class="ddl_container">
141   - <paper-input-search id="_datasets" label="Available datasets">
142   - <paper-menu class="dropdown-content">
143   - <template is="dom-repeat" items={{filteredDatasets}} as="dataset">
144   - <paper-item id={{index}} on-tap="_selectDataUrl">{{dataset.name}}</paper-item>
145   - </template>
146   - </paper-menu>
147   - </paper-input-search>
148   -
149   - <div class="info_button">
150   - <paper-icon-button id="info_dataset" disabled on-click="_showInfo" icon="info-outline" title="dataset info"></paper-icon-button>
151   - </div>
152   - </div>
153   -
154   - <template is="dom-if" if={{isSuggested}}>
155   -
156   - <div class="ddl_container">
157   - <paper-dropdown-menu id="s_datasets" label="Suggested datasets">
158   - <paper-menu class="dropdown-content">
159   - <template is="dom-repeat" items={{suggestedDatasets}} as="dataset">
160   - <paper-item id={{index}} on-tap="_selectSuggestedDataUrl">{{dataset.name}}</paper-item>
161   - </template>
162   - </paper-menu>
163   - </paper-dropdown-menu>
164   -
165   - <div class="info_button">
166   - <paper-icon-button id="info_s_dataset" disabled on-click="_showInfo" icon="info-outline" title="dataset info"></paper-icon-button>
167   - </div>
168   - </div>
169   -
170   - </template>
171   -
172   - <paper-textarea id="selected_url" label="Selected url" value={{dataUrl}} error-message={{errorMessage}}></paper-textarea>
173   -
174   - <paper-dialog id="dialog_info">
175   - <h2 id="dialog_name"></h2>
176   - <p id="dialog_description"></p>
177   - </paper-dialog>
178   - </div>
179   -
180   - </neon-animatable>
181   -
182   - <neon-animatable>
183   - <div id="div_datasetexplorer"></div>
184   - </neon-animatable>
185   -
186   - <neon-animatable>
187   - <!--popular-->
188   - </neon-animatable>
189   -
190   - </neon-animated-pages>
191   -
192   - </paper-material>
193   -
194   - </template>
195   -
196   - <script>
197   -
198   - Polymer({
199   -
200   - is : 'dataset-selection-controllet',
201   -
202   - properties : {
203   -
204   - selected : {
205   - type : Number,
206   - value : 0
207   - },
208   -
209   - datasets : {
210   - type : Array,
211   - value : undefined
212   - },
213   -
214   - filteredDatasets : {
215   - type : Array,
216   - value : []
217   - },
218   -
219   - suggestedDatasets : {
220   - type : Array,
221   - value : undefined
222   - },
223   -
224   - isSuggested : {
225   - type : Boolean,
226   - value : false
227   - },
228   -
229   - dataUrl : {
230   - type : String,
231   - value : undefined,
232   - observer : '_fireDataUrl'
233   - },
234   -
235   - errorMessage : {
236   - type : String,
237   - value : "",
238   - }
239   -
240   - },
241   -
242   - listeners: {
243   - 'datasetexplorer-datalet_data-url': '_selectDataUrl_treeMap',
244   - 'paper-input-search_input-value' : '_filterDatasets'
245   - },
246   -
247   - ready : function(){
248   - $(this.$.material_container).perfectScrollbar();
249   - $(this.$.dialog_info).perfectScrollbar();
250   -
251   - this.errorMessage = ln["wrongUrl_" + ln["localization"]];
252   - },
253   -
254   - attached : function(){
255   - this._resize();
256   - var that = this;
257   - window.addEventListener("resize", function() { that._resize(); });
258   -
259   - this.filteredDatasets = this.datasets;
260   -
261   - if(this.suggestedDatasets)
262   - this.isSuggested = true;
263   -
264   - this._loadTreeMap();
265   -
266   - this.async(function(){this._translate();},100);
267   - },
268   -
269   - _translate : function(){
270   - this.$._datasets.setAttribute("label", ln["availableDatasets_" + ln["localization"]]);
271   - this.$.listView.innerHTML = ln["listView_" + ln["localization"]];
272   - this.$.treeMapView.innerHTML = ln["treeMapView_" + ln["localization"]];
273   -
274   - if(this.isSuggested)
275   - this.$$("#s_datasets").setAttribute("label", ln["suggestedDatasets_" + ln["localization"]]);
276   - this.$.selected_url.setAttribute("label", ln["selectedUrl_" + ln["localization"]]);
277   - },
278   -
279   - _filterDatasets : function(e){
280   - var filter = e.detail.inputValue;
281   - var filteredDatasets = [];
282   - for (var i in this.datasets){
283   - if(this.datasets[i].name.toLowerCase().indexOf(filter.toLowerCase()) != -1)
284   - filteredDatasets.push(this.datasets[i]);
285   - }
286   -
287   - this.filteredDatasets = filteredDatasets;
288   - },
289   -
290   - _loadTreeMap : function(){
291   - var h = $("#material_container").height() - 48;
292   - var w = $("#material_container").width();
293   -
294   - this.$.div_datasetexplorer.innerHTML = "<datasetexplorer-datalet data='"+this.data+"' width=\""+w+"\" height=\""+h+"\" data-url=\"/openwall/api/datasetTree\" fields='[\"result,datasets,provider_name\",\"result,datasets,organization_name\",\"result,datasets,package_name\",\"result,datasets,resource_name\",\"result,datasets,url\",\"result,datasets,w\"]'></datasetexplorer-datalet>";
295   - },
296   -
297   - _selectDataUrl_treeMap : function(e) {
298   - $("#_datasets")[0]._setSelectedItem(null);
299   - $("#_datasets")[0].inputValue = "";
300   - $("#info_dataset")[0].setAttribute("disabled", "true");
301   -
302   - if (this.isSuggested) {
303   - $("#s_datasets")[0]._setSelectedItem(null);
304   - $("#s_datasets")[0].contentElement.select(-1);
305   - $("#info_s_dataset")[0].setAttribute("disabled", "true");
306   - }
307   -
308   - this.dataUrl = this._addlimitUrl(e.detail.url);
309   - this.selected=0;
310   - },
311   -
312   - _selectDataUrl : function(e){this._translate();
313   - if (this.isSuggested) {
314   - $("#s_datasets")[0]._setSelectedItem(null);
315   - $("#s_datasets")[0].contentElement.select(-1);
316   - $("#info_s_dataset")[0].setAttribute("disabled", "true");
317   - }
318   -
319   - var dataset = this.filteredDatasets[parseInt(e.target.id)]
320   -
321   - this.dataUrl = this._addlimitUrl(dataset.url);
322   -
323   - if(dataset.description != ""){
324   - $("#info_dataset")[0].removeAttribute("disabled");
325   - this.$.dialog_name.innerHTML = dataset.name;
326   - this.$.dialog_description.innerHTML = dataset.description;
327   - }
328   - else
329   - $("#info_dataset")[0].setAttribute("disabled", "true");
330   - },
331   -
332   - _selectSuggestedDataUrl : function(e){
333   - $("#_datasets")[0]._setSelectedItem(null);
334   - $("#_datasets")[0].inputValue = "";
335   - $("#info_dataset")[0].setAttribute("disabled", "true");
336   -
337   - var dataset = this.suggestedDatasets[parseInt(e.target.id)]
338   -
339   - this.dataUrl = this._addlimitUrl(dataset.url);
340   -
341   - if(dataset.description != ""){
342   - $("#info_s_dataset")[0].removeAttribute("disabled");
343   - this.$.dialog_name.innerHTML = dataset.name;
344   - this.$.dialog_description.innerHTML = dataset.description;
345   - }
346   - else
347   - $("#info_s_dataset")[0].setAttribute("disabled", "true");
348   - },
349   -
350   - _showInfo : function(e){
351   - var t = e.target;
352   - if(t.tagName.indexOf("IRON-ICON") != -1)
353   - t = $(e.target).parents("paper-icon-button")[0];
354   -
355   - this.$.dialog_info.open();
356   -
357   - var pos = t.getBoundingClientRect();
358   - $("#dialog_info").css("top", pos.top - 4);
359   - $("#dialog_info").css("left", pos.left - 4);
360   - },
361   -
362   - _fireDataUrl : function(){
363   - this.fire('dataset-selection-controllet_data-url', {url: this.dataUrl});
364   - },
365   -
366   - _addlimitUrl : function(url){
367   - //CKAN --> action no limit
368   - if((url.indexOf("api/action") > -1) && !(url.indexOf("limit") > -1))
369   - {
370   - url += "&limit=99999";
371   - }
372   - //OpenDataSoft --> action no limit
373   - if((url.indexOf("api/records") > -1) && !(url.indexOf("rows") > -1)){
374   - url += "&rows=10000";
375   - }
376   - return url;
377   - },
378   -
379   - _resize : function(){
380   - var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0) - 16;
381   - h = h - 64 - 8; //height with page scroller
382   - $("#material_container").height(h);
383   - }
384   -
385   - });
386   -
387   - </script>
388   -
389   -</dom-module>
controllets/dataset-selection-controllet/demo/index.html deleted
1   -<html>
2   -
3   -<head>
4   - <script src="../../shared_js/jquery-1.11.2.min.js"></script>
5   -
6   - <script src="../../../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
7   -
8   - <script src="../../shared_js/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js"></script>
9   - <link rel="stylesheet" href="../../shared_js/perfect-scrollbar/css/perfect-scrollbar.min.css">
10   -
11   - <link rel="import" href="../dataset-selection-controllet.html" />
12   -</head>
13   -
14   -<body>
15   -
16   -<dataset-selection-controllet id="ds"></dataset-selection-controllet>
17   -
18   -<script>
19   - var description = "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa "+
20   - " aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa "+
21   - " aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa "+
22   - "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
23   - "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
24   - "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
25   - "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
26   - "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
27   - "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
28   - "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
29   - "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
30   - "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
31   - "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
32   - "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
33   - "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
34   - "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
35   - "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa";
36   -
37   - var dataset1 = {description: description, name: "Data", url: "http://ckan.routetopa.eu/api/action/datastore_search?resource_id=c3b52992-ba61-4a73-a637-0f2e1ca26aab"};
38   - var dataset2 = {description: "", name: "Klassen", url: "http://ckan.routetopa.eu/api/action/datastore_search?resource_id=dfd27de5-0790-466c-af59-6a82509e7fbb"};
39   - var dataset3 = {description: "descrizione bellissima purissima levissima sbiricuda antani", name: "Derelict Sites", url: "http://ckan.routetopa.eu/api/action/datastore_search?resource_id=fcbee83e-3d3d-4303-a568-24dd33d02adc"};
40   - var datasets = [dataset1, dataset2, dataset3];
41   - var datasets = [dataset1, dataset2, dataset3, dataset1, dataset2, dataset3, dataset1, dataset2, dataset3, dataset1, dataset2, dataset3, dataset1, dataset2, dataset3];
42   -
43   - var ds = document.getElementById('ds');
44   - ds.setAttribute("datasets", JSON.stringify(datasets));
45   -
46   -</script>
47   -
48   -</body>
49   -
50   -</html>
51 0 \ No newline at end of file
controllets/dataset-selection-controllet/paper-input-search.html deleted
1   -<!--
2   -@license
3   -Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4   -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5   -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6   -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7   -Code distributed by Google as part of the polymer project is also
8   -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9   --->
10   -
11   -<link rel="import" href="../../bower_components/polymer/polymer.html">
12   -<link rel="import" href="../../bower_components/paper-styles/default-theme.html">
13   -<link rel="import" href="../../bower_components/paper-input/paper-input.html">
14   -<link rel="import" href="../../bower_components/paper-menu-button/paper-menu-button.html">
15   -<link rel="import" href="../../bower_components/paper-ripple/paper-ripple.html">
16   -<link rel="import" href="../../bower_components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
17   -<link rel="import" href="../../bower_components/iron-behaviors/iron-control-state.html">
18   -<link rel="import" href="../../bower_components/iron-behaviors/iron-button-state.html">
19   -<link rel="import" href="../../bower_components/iron-icons/iron-icons.html">
20   -<link rel="import" href="../../bower_components/iron-icon/iron-icon.html">
21   -<link rel="import" href="../../bower_components/iron-selector/iron-selectable.html">
22   -<link rel="import" href="../../bower_components/iron-form-element-behavior/iron-form-element-behavior.html">
23   -<link rel="import" href="../../bower_components/iron-validatable-behavior/iron-validatable-behavior.html">
24   -
25   -<!--
26   -Material design: [Dropdown menus](https://www.google.com/design/spec/components/buttons.html#buttons-dropdown-buttons)
27   -
28   -`paper-dropdown-menu` is similar to a native browser select element.
29   -`paper-dropdown-menu` works with selectable content. The currently selected
30   -item is displayed in the control. If no item is selected, the `label` is
31   -displayed instead.
32   -
33   -The child element with the class `dropdown-content` will be used as the dropdown
34   -menu. It could be a `paper-menu` or element that triggers `iron-select` when
35   -selecting its children.
36   -
37   -Example:
38   -
39   - <paper-dropdown-menu label="Your favourite pastry">
40   - <paper-menu class="dropdown-content">
41   - <paper-item>Croissant</paper-item>
42   - <paper-item>Donut</paper-item>
43   - <paper-item>Financier</paper-item>
44   - <paper-item>Madeleine</paper-item>
45   - </paper-menu>
46   - </paper-dropdown-menu>
47   -
48   -This example renders a dropdown menu with 4 options.
49   -
50   -Similarly to using `iron-select`, `iron-deselect` events will cause the
51   -current selection of the `paper-dropdown-menu` to be cleared.
52   -
53   -### Styling
54   -
55   -The following custom properties and mixins are also available for styling:
56   -
57   -Custom property | Description | Default
58   -----------------|-------------|----------
59   -`--paper-dropdown-menu` | A mixin that is applied to the element host | `{}`
60   -`--paper-dropdown-menu-disabled` | A mixin that is applied to the element host when disabled | `{}`
61   -`--paper-dropdown-menu-ripple` | A mixin that is applied to the internal ripple | `{}`
62   -`--paper-dropdown-menu-button` | A mixin that is applied to the internal menu button | `{}`
63   -`--paper-dropdown-menu-input` | A mixin that is applied to the internal paper input | `{}`
64   -`--paper-dropdown-menu-icon` | A mixin that is applied to the internal icon | `{}`
65   -
66   -You can also use any of the `paper-input-container` and `paper-menu-button`
67   -style mixins and custom properties to style the internal input and menu button
68   -respectively.
69   -
70   -@group Paper Elements
71   -@element paper-dropdown-menu
72   -@hero hero.svg
73   -@demo demo/index.html
74   --->
75   -
76   -<dom-module id="paper-input-search">
77   - <style>
78   - :host {
79   - display: inline-block;
80   - position: relative;
81   - text-align: left;
82   - cursor: pointer;
83   -
84   - /* NOTE(cdata): Both values are needed, since some phones require the
85   - * value to be `transparent`.
86   - */
87   - -webkit-tap-highlight-color: rgba(0,0,0,0);
88   - -webkit-tap-highlight-color: transparent;
89   -
90   - --paper-input-container-input: {
91   - overflow: hidden;
92   - white-space: nowrap;
93   - text-overflow: ellipsis;
94   - max-width: 100%;
95   - box-sizing: border-box;
96   - /*cursor: pointer;*/
97   - };
98   -
99   - @apply(--paper-dropdown-menu);
100   - }
101   -
102   - :host([disabled]) {
103   - @apply(--paper-dropdown-menu-disabled);
104   - }
105   -
106   - :host([noink]) paper-ripple {
107   - display: none;
108   - }
109   -
110   - :host([no-label-float]) paper-ripple {
111   - top: 8px;
112   - }
113   -
114   - paper-ripple {
115   - top: 12px;
116   - left: 0px;
117   - bottom: 8px;
118   - right: 0px;
119   -
120   - @apply(--paper-dropdown-menu-ripple);
121   - }
122   -
123   - paper-menu-button {
124   - display: block;
125   - padding: 0;
126   - @apply(--paper-dropdown-menu-button);
127   - }
128   -
129   - paper-input {
130   - @apply(--paper-dropdown-menu-input);
131   - }
132   -
133   - iron-icon {
134   - /*color: var(--disabled-text-color);*/
135   - color: #2196F3;
136   -
137   - @apply(--paper-dropdown-menu-icon);
138   - }
139   -
140   - </style>
141   - <template>
142   - <paper-menu-button
143   - id="menuButton"
144   - vertical-align="top"
145   - horizontal-align="left"
146   - vertical-offset="[[_computeMenuVerticalOffset(noLabelFloat)]]"
147   - disabled="[[disabled]]"
148   - no-animations="[[noAnimations]]"
149   - on-iron-select="_onIronSelect"
150   - on-iron-deselect="_onIronDeselect"
151   - opened="{{opened}}">
152   - <div class="dropdown-trigger">
153   - <!--<paper-ripple></paper-ripple>-->
154   - <paper-input
155   - id="inputField"
156   - invalid="[[invalid]]"
157   - value="{{inputValue}}"
158   - placeholder="[[placeholder]]"
159   - always-float-label="[[alwaysFloatLabel]]"
160   - no-label-float="[[noLabelFloat]]"
161   - label="[[label]]">
162   - <iron-icon icon="search" prefix></iron-icon>
163   - <iron-icon icon="arrow-drop-down" suffix></iron-icon>
164   - </paper-input>
165   - </div>
166   - <content id="content" select=".dropdown-content"></content>
167   - </paper-menu-button>
168   - </template>
169   -</dom-module>
170   -<script>
171   - (function() {
172   - 'use strict';
173   -
174   - Polymer({
175   - is: 'paper-input-search',
176   -
177   - /**
178   - * Fired when the dropdown opens.
179   - *
180   - * @event paper-dropdown-open
181   - */
182   -
183   - /**
184   - * Fired when the dropdown closes.
185   - *
186   - * @event paper-dropdown-close
187   - */
188   -
189   - behaviors: [
190   - Polymer.IronControlState,
191   - Polymer.IronButtonState,
192   - Polymer.IronFormElementBehavior,
193   - Polymer.IronValidatableBehavior
194   - ],
195   -
196   - properties: {
197   - /**
198   - * The derived "label" of the currently selected item. This value
199   - * is the `label` property on the selected item if set, or else the
200   - * trimmed text content of the selected item.
201   - */
202   - selectedItemLabel: {
203   - type: String,
204   - notify: true,
205   - readOnly: true
206   - },
207   -
208   - /**
209   - * The last selected item. An item is selected if the dropdown menu has
210   - * a child with class `dropdown-content`, and that child triggers an
211   - * `iron-select` event with the selected `item` in the `detail`.
212   - *
213   - * @type {?Object}
214   - */
215   - selectedItem: {
216   - type: Object,
217   - notify: true,
218   - readOnly: true
219   - },
220   -
221   - /**
222   - * The value for this element that will be used when submitting in
223   - * a form. It is read only, and will always have the same value
224   - * as `selectedItemLabel`.
225   - */
226   - value: {
227   - type: String,
228   - notify: true,
229   - readOnly: true
230   - },
231   -
232   - /**
233   - * The label for the dropdown.
234   - */
235   - label: {
236   - type: String
237   - },
238   -
239   - /**
240   - * The placeholder for the dropdown.
241   - */
242   - placeholder: {
243   - type: String
244   - },
245   -
246   - /**
247   - * True if the dropdown is open. Otherwise, false.
248   - */
249   - opened: {
250   - type: Boolean,
251   - notify: true,
252   - value: false
253   - },
254   -
255   - /**
256   - * Set to true to disable the floating label. Bind this to the
257   - * `<paper-input-container>`'s `noLabelFloat` property.
258   - */
259   - noLabelFloat: {
260   - type: Boolean,
261   - value: false,
262   - reflectToAttribute: true
263   - },
264   -
265   - /**
266   - * Set to true to always float the label. Bind this to the
267   - * `<paper-input-container>`'s `alwaysFloatLabel` property.
268   - */
269   - alwaysFloatLabel: {
270   - type: Boolean,
271   - value: false
272   - },
273   -
274   - /**
275   - * Set to true to disable animations when opening and closing the
276   - * dropdown.
277   - */
278   - noAnimations: {
279   - type: Boolean,
280   - value: false
281   - },
282   -
283   - inputValue: {
284   - type: String,
285   - value: undefined,
286   - observer: '_fireInputValue'
287   - },
288   -
289   - fireInputValue: {
290   - type: Boolean,
291   - value: true,
292   - }
293   - },
294   -
295   - listeners: {
296   - 'tap': '_onTap'
297   - },
298   -
299   - keyBindings: {
300   - 'up down': 'open',
301   - 'esc': 'close'
302   - },
303   -
304   - hostAttributes: {
305   - role: 'group',
306   - 'aria-haspopup': 'true'
307   - },
308   -
309   - observers: [
310   -// '_selectedItemChanged(selectedItem)'
311   - ],
312   -
313   - attached: function() {
314   - // NOTE(cdata): Due to timing, a preselected value in a `IronSelectable`
315   - // child will cause an `iron-select` event to fire while the element is
316   - // still in a `DocumentFragment`. This has the effect of causing
317   - // handlers not to fire. So, we double check this value on attached:
318   - var contentElement = this.contentElement;
319   - if (contentElement && contentElement.selectedItem) {
320   - this._setSelectedItem(contentElement.selectedItem);
321   - }
322   - },
323   -
324   - _fireInputValue: function() {//console.log(this.inputValue);
325   - if(this.fireInputValue) {//change NO DDL
326   - this.fire('paper-input-search_input-value', {inputValue: this.inputValue});
327   - if(this.contentElement.selectedItem){
328   -// this._setSelectedItem(null);
329   - this.contentElement.select(-1);
330   -// console.log("deselected");
331   - }
332   - }
333   -
334   - this.fireInputValue = true;
335   - },
336   -
337   - /**
338   - * The content element that is contained by the dropdown menu, if any.
339   - */
340   - get contentElement() {
341   - return Polymer.dom(this.$.content).getDistributedNodes()[0];
342   - },
343   -
344   - /**
345   - * Show the dropdown content.
346   - */
347   - open: function() {
348   - this.$.menuButton.open();
349   - },
350   -
351   - /**
352   - * Hide the dropdown content.
353   - */
354   - close: function() {
355   - this.$.menuButton.close();
356   - },
357   -
358   - /**
359   - * A handler that is called when `iron-select` is fired.
360   - *
361   - * @param {CustomEvent} event An `iron-select` event.
362   - */
363   - _onIronSelect: function(event) {
364   -// console.log("select");
365   - this.fireInputValue = false;
366   - this._setSelectedItem(event.detail.item);
367   - this.inputValue = event.detail.item.label || event.detail.item.textContent.trim();
368   - },
369   -
370   - /**
371   - * A handler that is called when `iron-deselect` is fired.
372   - *
373   - * @param {CustomEvent} event An `iron-deselect` event.
374   - */
375   - _onIronDeselect: function(event) {
376   -// console.log("deselect");
377   - this.fireInputValue = false;
378   - this._setSelectedItem(null);
379   - },
380   -
381   - /**
382   - * A handler that is called when the dropdown is tapped.
383   - *
384   - * @param {CustomEvent} event A tap event.
385   - */
386   - _onTap: function(event) {
387   - if (Polymer.Gestures.findOriginalTarget(event) === this) {
388   - this.open();
389   - }
390   - this.async(function(){this.$.inputField.$.input.focus();},200);//to improve
391   -// console.log(this.selectedItemLabel);
392   -// console.log(this.value);
393   -// console.log(this.$.inputField.value);
394   -// console.log(this.inputValue);
395   - },
396   -
397   - /**
398   - * Compute the label for the dropdown given a selected item.
399   - *
400   - * @param {Element} selectedItem A selected Element item, with an
401   - * optional `label` property.
402   - */
403   -// _selectedItemChanged: function(selectedItem) {
404   -// var value = '';
405   -// if (!selectedItem) {
406   -// value = '';
407   -// } else {
408   -// value = selectedItem.label || selectedItem.textContent.trim();
409   -// }
410   -//
411   -// this._setValue(value);
412   -// this._setSelectedItemLabel(value);
413   -// this.inputValue = selectedItem.label || selectedItem.textContent.trim();
414   -// },
415   -
416   - /**
417   - * Compute the vertical offset of the menu based on the value of
418   - * `noLabelFloat`.
419   - *
420   - * @param {boolean} noLabelFloat True if the label should not float
421   - * above the input, otherwise false.
422   - */
423   - _computeMenuVerticalOffset: function(noLabelFloat) {
424   - // NOTE(cdata): These numbers are somewhat magical because they are
425   - // derived from the metrics of elements internal to `paper-input`'s
426   - // template. The metrics will change depending on whether or not the
427   - // input has a floating label.
428   -// return noLabelFloat ? -4 : 8;
429   - return noLabelFloat ? 46-4 : 46+8;
430   -// return 64;
431   - },
432   -
433   - /**
434   - * Returns false if the element is required and does not have a selection,
435   - * and true otherwise.
436   - * @return {Boolean} true if `required` is false, or if `required` is true
437   - * and the element has a valid selection.
438   - */
439   - _getValidity: function() {
440   - return this.disabled || !this.required || (this.required && this.value);
441   - }
442   - });
443   - })();
444   -</script>
445 0 \ No newline at end of file
controllets/dataset-table-controllet/dataset-table-controllet.html
... ... @@ -434,7 +434,10 @@
434 434  
435 435 //2nd loop will extract each column and convert it in string comma-seprated
436 436 for (var index in arrData[i]) {
437   - row += arrData[i][index] + ',';
  437 + if(typeof arrData[i][index] == 'string')
  438 + row += '"' + arrData[i][index].replace('"', '""') + '",';
  439 + else
  440 + row += arrData[i][index] + ',';
438 441 }
439 442  
440 443 row.slice(0, row.length - 1);
... ...
controllets/datasets-list-controllet/datasets-list-controllet.html 0 → 100644
  1 +<link rel="import" href="../../bower_components/polymer/polymer.html">
  2 +
  3 +<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
  4 +<link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
  5 +<link rel="import" href="../../bower_components/paper-menu/paper-menu.html">
  6 +<link rel="import" href="../../bower_components/paper-item/paper-item.html">
  7 +<link rel="import" href="../../bower_components/paper-spinner/paper-spinner.html">
  8 +
  9 +<dom-module id="datasets-list-controllet">
  10 + <template>
  11 + <style>
  12 +
  13 + #datasets_list_container {
  14 + height: 100%;
  15 + width: 100%;
  16 + }
  17 +
  18 + #datasets_list_container * {
  19 + font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  20 + font-size: 16px;
  21 + line-height: 24px;
  22 + }
  23 +
  24 + #datasets_list_container #list_info {
  25 + display: flex;
  26 + height: calc(100% - 48px);
  27 + width: 100%;
  28 +
  29 + background: #E0E0E0;
  30 + }
  31 +
  32 + #datasets_list_container #menu {
  33 + background: #E0E0E0;
  34 + }
  35 +
  36 + #datasets_list_container #list_container {
  37 + position: relative;
  38 + height: calc(100% - 28px);
  39 + width: calc(50% - 24px);
  40 + margin-top: 12px;
  41 + padding: 0 12px;
  42 + overflow: hidden;
  43 + background: #E0E0E0;
  44 + }
  45 +
  46 + #datasets_list_container #info_container {
  47 + position: relative;
  48 + height: calc(100% - 32px);
  49 + width: calc(50% - 32px);
  50 + padding: 16px;
  51 + background: #E0E0E0;
  52 + }
  53 +
  54 + #datasets_list_container #info {
  55 + position: relative;
  56 + height: calc(100% - 2px);
  57 + width: calc(100% - 2px);
  58 + border: 1px solid #B6B6B6;
  59 + border-radius: 2px;
  60 + background: #FFFFFF;
  61 + }
  62 +
  63 + #datasets_list_container #footer {
  64 + width: 100%;
  65 + height: 48px;
  66 + background: #B6B6B6;
  67 + display: flex;
  68 + flex-direction: row;
  69 + }
  70 +
  71 + #datasets_list_container .footer_block {
  72 + height: 24px;
  73 + padding: 12px 8px;
  74 + text-align: right;
  75 + }
  76 +
  77 + #datasets_list_container .footer_block:nth-child(1) {
  78 + width: 30%;
  79 + overflow: hidden;
  80 + white-space: nowrap;
  81 + text-overflow: ellipsis;
  82 + }
  83 +
  84 + #datasets_list_container .footer_block:nth-child(2) {
  85 + width: 40%;
  86 + height: 48px;
  87 + padding: 0 8px;
  88 + text-align: center;
  89 + }
  90 +
  91 + #datasets_list_container .footer_block:nth-child(3) {
  92 + width: 30%;
  93 + height: 40px;
  94 + padding: 4px 8px;
  95 + text-align: left;
  96 + }
  97 +
  98 + #datasets_list_container #info_header {
  99 + height: 24px;
  100 + padding: 12px;
  101 + text-align: center;
  102 + font-weight: 700;
  103 + color: #FFFFFF;
  104 + background: #2196F3;
  105 +
  106 + overflow: hidden;
  107 + white-space: nowrap;
  108 + text-overflow: ellipsis;
  109 +
  110 + border-bottom: 1px solid #B6B6B6;
  111 + }
  112 +
  113 + #datasets_list_container #info_body {
  114 + padding: 12px;
  115 + }
  116 +
  117 + #datasets_list_container br {
  118 + display: block;
  119 + margin-top: 8px;
  120 + content: " ";
  121 + }
  122 +
  123 + paper-input {
  124 + max-width: 288px;
  125 + --paper-input-container-focus-color: #2196F3;
  126 + }
  127 +
  128 + paper-menu {
  129 + padding: 0;
  130 + }
  131 +
  132 + paper-item {
  133 + cursor: pointer;
  134 + color: #000000;
  135 + margin: 4px;
  136 + padding: 0 12px;
  137 + border-radius: 2px;
  138 + border: 1px solid #B6B6B6;
  139 +
  140 + background: #FFFFFF;
  141 + }
  142 +
  143 + paper-item span {
  144 + width: 100%;
  145 + overflow: hidden;
  146 + white-space: nowrap;
  147 + text-overflow: ellipsis;
  148 + }
  149 +
  150 + paper-item.iron-selected {
  151 + background: #2196F3 !important;;
  152 + color: #FFFFFF;
  153 + /*font-weight: 700;*/
  154 + }
  155 +
  156 + paper-item:focus:before {
  157 + opacity: 0 !important;
  158 + background: white;
  159 + }
  160 +
  161 + paper-item:focus:after {
  162 + opacity: 0 !important;
  163 + background: white;
  164 + }
  165 +
  166 + paper-item:hover:not(.iron-selected) {
  167 + background: #BBDEFB !important;
  168 + }
  169 +
  170 + paper-icon-button{
  171 + height: 48px;
  172 + width: 48px;
  173 + padding: 0;
  174 + --paper-icon-button-ink-color: #FFFFFF;
  175 + }
  176 +
  177 + paper-icon-button:hover{
  178 + color: #2196F3;
  179 + }
  180 +
  181 + paper-icon-button.clear {
  182 + width: 24px;
  183 + height: 24px;
  184 + padding: 0 4px;
  185 + color: #F44336;
  186 + --paper-icon-button-ink-color: #FFFFFF;
  187 + }
  188 +
  189 + #datasets_list_container #spinner_container {
  190 + height: calc(100% - 49px);
  191 + width: 100%;
  192 + text-align: center;
  193 + display: none;
  194 + }
  195 +
  196 + paper-spinner {
  197 + top: calc(50% - 32px);
  198 + height: 64px;
  199 + width: 64px;
  200 +
  201 + --paper-spinner-stroke-width: 8px;
  202 +
  203 + --paper-spinner-layer-1-color: #2196F3;
  204 + --paper-spinner-layer-2-color: #F44336;;
  205 + --paper-spinner-layer-3-color: #FFEB3B;;
  206 + --paper-spinner-layer-4-color: #4CAF50;;
  207 + }
  208 +
  209 + </style>
  210 +
  211 + <div id="datasets_list_container">
  212 + <div id="list_info">
  213 + <div id="list_container">
  214 + <div id="menu_container">
  215 + <paper-menu id="menu">
  216 + <template is="dom-repeat" items="{{shownDatasets}}">
  217 + <paper-item id={{index}} title="{{item.resource_name}}" on-click="_selectDataset" style$="background: {{_getColorForItem(item)}};"><span>{{_getVersionedResourceName(item)}}</span></paper-item>
  218 + </template>
  219 + </paper-menu>
  220 + </div>
  221 + </div>
  222 + <div id="info_container">
  223 + <div id="info">
  224 + <div id="info_header"><span id="datasets_info"></span></div>
  225 + <div id="info_body"></div>
  226 + <div id="spinner_container">
  227 + <paper-spinner id="spinner"></paper-spinner>
  228 + </div>
  229 + </div>
  230 + </div>
  231 + </div>
  232 +
  233 + <div id="footer">
  234 + <div class="footer_block">
  235 + <span id="showing"></span> {{shownPrev}} <span id="to"></span> {{shownNext}} <span id="of"></span> {{length}} <span id="rows"></span>
  236 + </div>
  237 + <div class="footer_block">
  238 + <paper-icon-button id="slider_chevron_left" class="chevron-left" on-click="_onPrevClick" icon="chevron-left"></paper-icon-button>
  239 + <paper-icon-button id="slider_chevron_right" class="chevron-right" on-click="_onNextClick" icon="chevron-right"></paper-icon-button>
  240 + </div>
  241 + <div class="footer_block">
  242 + <paper-input id="filter" value={{filter}} no-label-float>
  243 + <iron-icon class="search" icon="search" prefix></iron-icon>
  244 + <paper-icon-button class="clear" suffix on-click="_clearInput" icon="clear"></paper-icon-button>
  245 + </paper-input>
  246 + </div>
  247 + </div>
  248 + </div>
  249 +
  250 + </template>
  251 +
  252 + <script>
  253 + HTMLImports.whenReady(function() {
  254 + Polymer({
  255 + is: 'datasets-list-controllet',
  256 +
  257 + properties: {
  258 +
  259 + datasets: {
  260 + type: Object,
  261 + value: undefined
  262 + },
  263 +
  264 + providers: {
  265 + type: Object,
  266 + value: undefined
  267 + },
  268 +
  269 + filter : {
  270 + type : String,
  271 + value : "",
  272 + observer : '_filter'
  273 + }
  274 +
  275 + },
  276 +
  277 +// _loadTreeMap : function(){
  278 +// this.async(function () {
  279 +// var h = $("#list_info").height();
  280 +// var w = $("#list_info").width();
  281 +//
  282 +// var data = JSON.stringify({result : {providers: this.providers, datasets: this.datasets}}).replace(/'/g, "");
  283 +//
  284 +// this.$.list_info.innerHTML = "<datasetexplorer-datalet data='"+data+"' width=\""+w+"\" height=\""+h+"\" fields='[\"provider_name\",\"organization_name\",\"package_name\",\"resource_name\",\"url\",\"w\",\"metas\"]'></datasetexplorer-datalet>";
  285 +// }, 100);
  286 +// },
  287 +//
  288 +// setProviders : function(providers) {
  289 +// this.providers = this._copy(providers);
  290 +// },
  291 +
  292 + ready : function() {
  293 + $(this.$.list_container).perfectScrollbar();
  294 + $(this.$.info).perfectScrollbar();
  295 +
  296 + this.step = 20;
  297 + this.version = true;
  298 + this.selectedItemId = -1;
  299 + },
  300 +
  301 + attached: function() {
  302 + this._translate();
  303 + },
  304 +
  305 + setDatasets : function(datasets) {
  306 + this.datasets = this._copy(datasets);
  307 +
  308 + this.prev = 1;
  309 + this.next = this.step;
  310 + this.length = this.datasets.length;
  311 +
  312 + this.shownPrev = Math.min(this.prev, this.length);
  313 + this.shownNext = Math.min(this.next, this.length);
  314 + this.shownDatasets = this.datasets.slice(this.prev-1, this.next);
  315 +
  316 + this.$.info_header.innerHTML = ln["datasetsInfo_" + ln["localization"]];
  317 + this.$.info_body.innerHTML = "";
  318 + this.$.spinner.active = false;
  319 + this.selectedItemId = -1;
  320 + this.fire("datasets-list-controllet_dataset", { dataset: {url:""} });
  321 +
  322 + this._filter();
  323 + },
  324 +
  325 + showDatasetInfo : function() {
  326 + this.$.spinner_container.style.display = "none";
  327 + this.$.info_body.style.display = "block";
  328 + this.$.spinner.active = false;
  329 + },
  330 +
  331 + showVersion : function(flag) {
  332 + this.version = flag;
  333 + },
  334 +
  335 + _loadDatasetInfo : function() {
  336 + $(this.$.info).animate({ scrollTop: 0}, 0);
  337 + this.$.info_body.style.display = "none";
  338 + this.$.spinner_container.style.display = "block";
  339 + this.$.spinner.active = true;
  340 + },
  341 +
  342 + _onPrevClick : function(){
  343 + if(this.prev != 1) {
  344 + this.prev -= this.step;
  345 + this.next -= this.step;
  346 +
  347 + this.shownPrev = Math.min(this.prev, this.length);
  348 + this.shownNext = Math.min(this.next, this.length);
  349 + this.shownDatasets = this.datasets.slice(this.prev - 1, this.next);
  350 + }
  351 + $(this.$.list_container).animate({ scrollTop: 0}, 0);
  352 + this.$.menu.selected = -1;
  353 + },
  354 +
  355 + _onNextClick : function(){
  356 + if(this.next < this.length) {
  357 + this.prev += this.step;
  358 + this.next += this.step;
  359 +
  360 + this.shownPrev = Math.min(this.prev, this.length);
  361 + this.shownNext = Math.min(this.next, this.length);
  362 + this.shownDatasets = this.datasets.slice(this.prev - 1, this.next);
  363 + }
  364 + $(this.$.list_container).animate({ scrollTop: 0}, 0);
  365 + this.$.menu.selected = -1;
  366 + },
  367 +
  368 + _filter : function() {
  369 + this.debounce('_filter', function () {
  370 + if(this.datasets && this.datasets.length) {
  371 + var filter = this.filter.toLowerCase();
  372 +
  373 + if(filter == "")
  374 + this.shownDatasets = this.datasets;
  375 + else
  376 + this.shownDatasets = this.datasets.filter(function (el) {
  377 + return (el.resource_name.toLowerCase().indexOf(filter) > -1);
  378 + });
  379 +
  380 + this.prev = 1;
  381 + this.next = this.step;
  382 + this.length = this.shownDatasets.length;
  383 +
  384 + this.shownPrev = Math.min(this.prev, this.length);
  385 + this.shownNext = Math.min(this.next, this.length);
  386 + this.shownDatasets = this.shownDatasets.slice(this.prev - 1, this.next);
  387 +
  388 + $(this.$.list_container).animate({ scrollTop: 0}, 0);
  389 + this.$.menu.selected = -1;
  390 + }
  391 + }, 0);
  392 + },
  393 +
  394 + _clearInput : function() {
  395 + this.$.filter.value = "";
  396 + },
  397 +
  398 + _translate : function(){
  399 + this.$.datasets_info.innerHTML = ln["datasetsInfo_" + ln["localization"]];
  400 +
  401 + this.$.showing.innerHTML = ln["showing_" + ln["localization"]];
  402 + this.$.to.innerHTML = ln["to_" + ln["localization"]];
  403 + this.$.of.innerHTML = ln["of_" + ln["localization"]];
  404 + this.$.rows.innerHTML = ln["datasetsRows_" + ln["localization"]];
  405 +
  406 + this.$.filter.setAttribute("label", ln["search_" + ln["localization"]]);
  407 + },
  408 +
  409 + _selectDataset : function(){
  410 + var id = this.$.menu.selectedItem.id;
  411 + if(id == this.selectedItemId)
  412 + return;
  413 +
  414 + this.selectedItemId = id;
  415 +
  416 + this._loadDatasetInfo();
  417 +
  418 + var dataset = this.shownDatasets[id];
  419 +
  420 + var html = '';
  421 +
  422 + var users = dataset.users;
  423 + var metas = JSON.parse(dataset.metas);
  424 +
  425 + if(users) {
  426 + html += '<b>users:</b><div class="user_icons" style="display: flex; flex-direction: row;">';
  427 + for(var j in users) {
  428 + html += '<a href="' + users[j].href + '">';
  429 + html += '<div class="user_icon" style="background-image: url(' + users[j].src + '); background-size: 40px 40px; height:40px; width:40px; border-radius: 50%; cursor: pointer; margin-right: 12px;" title="' + users[j].user + '"></div>';
  430 + html += '</a>';
  431 +
  432 + }
  433 + html += '</div>';
  434 + html += '<b> version:</b> ' + dataset.version + '<br>';
  435 + }
  436 +
  437 + for(var i in metas)
  438 + html += '<b>' + i + ':</b> ' + metas[i] + '<br>';
  439 +
  440 +// this.$.info_header.innerHTML = this._getVersionedResourceName(dataset);
  441 + this.$.info_header.innerHTML = dataset.resource_name;
  442 + this.$.info_body.innerHTML = html;
  443 +
  444 + this.fire("datasets-list-controllet_dataset", { dataset: dataset });
  445 + },
  446 +
  447 + _getVersionedResourceName : function(dataset){
  448 + if(this.version && dataset.version)
  449 +// return dataset.resource_name + ' [' + ln["Version_" + ln["localization"]] + ' ' + dataset.version + ']';
  450 + return dataset.resource_name + ' [VER ' + dataset.version + ']';
  451 + return dataset.resource_name;
  452 + },
  453 +
  454 + _getColorForItem : function(item) {
  455 + if(!item.provider_name && !item.version)
  456 + return "#FFEB3B";
  457 + },
  458 +
  459 + _copy : function(o) {
  460 + var out, v, key;
  461 + out = Array.isArray(o) ? new Array(o.length) : {};
  462 + for (key in o) {
  463 + v = o[key];
  464 + out[key] = (typeof v === "object") ? this._copy(v) : v;
  465 + }
  466 + return out;
  467 + }
  468 +
  469 + });
  470 + });
  471 + </script>
  472 +</dom-module>
0 473 \ No newline at end of file
... ...
controllets/datasets-list-controllet/demo/index.html 0 → 100644
  1 +<html>
  2 +
  3 +<head>
  4 + <script src="../../shared_js/jquery-1.11.2.min.js"></script>
  5 +
  6 + <script src="../../../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
  7 +
  8 + <script src="../../shared_js/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js"></script>
  9 + <link rel="stylesheet" href="../../shared_js/perfect-scrollbar/css/perfect-scrollbar.min.css">
  10 +
  11 + <script src="../../../locales/controllet_ln.js"></script>
  12 + <script>
  13 + ln["localization"] = "en";
  14 + </script>
  15 +
  16 + <link rel="import" href="../datasets-list-controllet.html" />
  17 +</head>
  18 +
  19 +<body>
  20 +
  21 +<style>
  22 +
  23 + .container {
  24 + width: 1200px;
  25 + height: 600px;
  26 + position: relative;
  27 + top: 96px;
  28 + left: calc((100% - 1200px) / 2);
  29 + }
  30 +
  31 +</style>
  32 +
  33 +<div class="container">
  34 + <datasets-list-controllet datasets='{"result":{"providers":{"1":{"title":"CKAN","api_url":"http:\/\/ckan.routetopa.eu","image_hash":"11","id":"1"}},"datasets":[{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"}]}}'></datasets-list-controllet>
  35 +
  36 + <!--<select-dataset-controllet id="ds" datasets="we"></select-dataset-controllet>-->
  37 +
  38 + <!--<select-dataset-controllet id="ds" datasets='{"result":{"providers":{"1":{"title":"CKAN","api_url":"http:\/\/ckan.routetopa.eu","image_hash":"11","id":"1"}},"datasets":[{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 2","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b056c5e6-76af-4526-a35d-7dee664fb6ee\/download\/isislab.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"Year 1 Dissemination of the ROUTE-TO-PA project (2015)","resource_name":"First year (2015) ROUTE-TO-PA Dissemination","url":"http:\/\/ckan.routetopa.eu\/dataset\/d81d451d-8b3d-47f4-b57f-e295e8f51da0\/resource\/818c2edb-0cb7-4288-b340-e4dd1933d817\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New-&#45;&#45;Link-Upd.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"Year 1 Dissemination of the ROUTE-TO-PA project (2015)","resource_name":"First year (2015) ROUTE-TO-PA Dissemination - dl","url":"http:\/\/ckan.routetopa.eu\/dataset\/d81d451d-8b3d-47f4-b57f-e295e8f51da0\/resource\/fd8c4d6f-315d-4aa0-b7bd-4fdde7bf641b\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New-&#45;&#45;Link-Upd.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"Year 1 Dissemination of the ROUTE-TO-PA project (2015)","resource_name":"First year (2015) dissemination of ROUTE-TO-PA project","url":"http:\/\/ckan.routetopa.eu\/dataset\/d81d451d-8b3d-47f4-b57f-e295e8f51da0\/resource\/b0ef6017-8c64-4e11-8046-7e51a8561856\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New-&#45;&#45;Link-Upd.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"test dissemination with link","resource_name":"Year 1 Dissemination of the ROUTE-TO-PA project (2015)","url":"http:\/\/ckan.routetopa.eu\/dataset\/ba5054af-7561-4f99-9504-76ea004a1e85\/resource\/4cc2349d-bf7b-4bbe-a7ca-db5312bb6c94\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New-&#45;&#45;Link.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"ROUTE-TO-PA","package_name":"Dissemination activity of the first year","resource_name":"Dissemination activity of the first year (2015)","url":"http:\/\/ckan.routetopa.eu\/dataset\/61f07087-210a-4c35-9606-2aafe183633b\/resource\/5f9d8d8b-1c41-45f7-9dbb-61b9a7bcd076\/download\/ROUTE-TO-PA-Individual-Dissemination-Activity-Report-Form-Responses-New.csv","metas":"{\"organization\":\"ROUTE-TO-PA\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"},{"w":1,"provider_name":"p:1","organization_name":"City of the Hague Municipality","package_name":"Test 3- Buurten","resource_name":"Test Buurten - 3","url":"http:\/\/ckan.routetopa.eu\/dataset\/1248d447-2901-4beb-91ae-c2f249fd8a99\/resource\/1fdbc765-8945-4271-8dce-9c7eba45a67d\/download\/Test-3-Compare.csv","metas":"{\"organization\":\"City of the Hague Municipality\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"}]}}'-->
  39 + <!--suggested-datasets='[{"resource_name":"SUGGESTED 1","url":"noUrl.csv","metas":"{\"description\":\"noDescriione\"}"},{"resource_name":"SUGGESTED 2","url":"noUrl.csv","metas":"{\"description\":\"noDescriione\"}"},{"resource_name":"SUGGESTED 3","url":"noUrl.csv","metas":"{\"description\":\"noDescriione\"}"}]'-->
  40 + <!--<select-dataset-controllet id="ds" datasets='{"result":{"providers":{"1":{"title":"CKAN","api_url":"http:\/\/ckan.routetopa.eu","image_hash":"11","id":"1"}},"datasets":[{"w":1,"provider_name":"p:1","organization_name":"Dublin","package_name":"isislab DATA","resource_name":"Resource 1","url":"http:\/\/ckan.routetopa.eu\/dataset\/566c2867-ea89-45a2-bd7a-30ae82606007\/resource\/b3d3d9ff-291e-47ca-a0d2-a15deef81737\/download\/isislab2.csv","metas":"{\"organization\":\"Dublin\",\"description\":\"\",\"format\":\"\",\"last_modified\":\"\",\"name\":\"\",\"created\":\"\"}"}]}}'></select-dataset-controllet>-->
  41 +</div>
  42 +
  43 +<script>
  44 + var description = "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa "+
  45 + " aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa "+
  46 + " aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa "+
  47 + "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
  48 + "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
  49 + "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
  50 + "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
  51 + "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
  52 + "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
  53 + "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
  54 + "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
  55 + "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
  56 + "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
  57 + "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
  58 + "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
  59 + "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"+
  60 + "aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa";
  61 +
  62 + var dataset1 = {description: description, name: "Data", url: "http://ckan.routetopa.eu/api/action/datastore_search?resource_id=c3b52992-ba61-4a73-a637-0f2e1ca26aab"};
  63 + var dataset2 = {description: "", name: "Klassen", url: "http://ckan.routetopa.eu/api/action/datastore_search?resource_id=dfd27de5-0790-466c-af59-6a82509e7fbb"};
  64 + var dataset3 = {description: "descrizione bellissima purissima levissima sbiricuda antani", name: "Derelict Sites", url: "http://ckan.routetopa.eu/api/action/datastore_search?resource_id=fcbee83e-3d3d-4303-a568-24dd33d02adc"};
  65 + var datasets = [dataset1, dataset2, dataset3];
  66 + var datasets = [dataset1, dataset2, dataset3, dataset1, dataset2, dataset3, dataset1, dataset2, dataset3, dataset1, dataset2, dataset3, dataset1, dataset2, dataset3];
  67 +
  68 + // var ds = document.getElementById('ds');
  69 + // ds.setAttribute("items", JSON.stringify(datasets));
  70 + // ds.setAttribute("items", a);
  71 +
  72 +</script>
  73 +
  74 +</body>
  75 +
  76 +</html>
... ...
controllets/document-card-controllet/spreadsheet-card-controllet.html
... ... @@ -114,6 +114,14 @@
114 114 display: none;
115 115 }
116 116  
  117 + button#delete-sheet {
  118 + display: none;
  119 + }
  120 +
  121 + button#rename-sheet{
  122 + display: none;
  123 + }
  124 +
117 125 </style>
118 126  
119 127  
... ...
controllets/expert-query-controllet/expert-query-controllet.html
... ... @@ -359,7 +359,8 @@
359 359 .replace('WHERE', '<br><br><span style="color:#2196F3; font-weight: 700;">WHERE</span>')
360 360 .replace('GROUP BY', '<br><br><span style="color:#2196F3; font-weight: 700;">GROUP BY</span>')
361 361 .replace(/\[/g, '')
362   - .replace(/\]/g, '');
  362 + .replace(/\]/g, '')
  363 + .replace(/`/g, '');
363 364 else
364 365 this.$.query_container.innerHTML = "";
365 366 }
... ...
controllets/select-dataset-controllet/demo-select-dataset-controllet.html 0 → 100644
  1 +<link rel="import" href="../../bower_components/polymer/polymer.html">
  2 +
  3 +<link rel="import" href="../../bower_components/paper-material/paper-material.html" />
  4 +<link rel="import" href="../../bower_components/paper-tabs/paper-tabs.html">
  5 +<link rel="import" href="../../bower_components/paper-tabs/paper-tab.html">
  6 +<link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
  7 +<link rel="import" href="../../bower_components/paper-menu/paper-menu.html">
  8 +<link rel="import" href="../../bower_components/paper-item/paper-item.html">
  9 +<link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
  10 +<link rel="import" href="../../bower_components/paper-tooltip/paper-tooltip.html">
  11 +
  12 +<link rel="import" href="../datasets-list-controllet/datasets-list-controllet.html">
  13 +
  14 +<dom-module id="demo-select-dataset-controllet">
  15 + <template>
  16 + <style>
  17 +
  18 + #select_dataset_container {
  19 + margin-top: 8px;
  20 + }
  21 +
  22 + #select_dataset_container * {
  23 + font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  24 + font-size: 16px;
  25 + line-height: 24px;
  26 + }
  27 +
  28 + #select_dataset_container #options {
  29 + display: flex;
  30 + flex-direction: row;
  31 +
  32 + height: 48px;
  33 + padding: 0;
  34 + font-weight: 700;
  35 + background: #B6B6B6;
  36 +
  37 + margin-top: 2px;
  38 +
  39 + overflow: hidden;
  40 + }
  41 +
  42 + #select_dataset_container #options_header {
  43 + width: calc(100% - 96px);
  44 + text-align: center;
  45 + padding: 12px 0 12px 48px;
  46 + }
  47 +
  48 + #select_dataset_container .header_block {
  49 + /*width: calc((100% - 48px) / 2);*/
  50 + /*max-width: 400px;*/
  51 + width: calc(50% - 24px);
  52 + padding:0 12px;
  53 +
  54 + line-height: 40px;
  55 +
  56 + display: none;
  57 + }
  58 +
  59 + #select_dataset_container #url {
  60 + padding: 0 12px 12px 12px;
  61 + height: 60px;
  62 +
  63 + border: 2px solid #B6B6B6;
  64 + border-top: 0;
  65 + }
  66 +
  67 + #select_dataset_container #datasets_list_container {
  68 + height: calc(100% - 96px - 2px - 74px);
  69 + width: 100%;
  70 + }
  71 +
  72 + paper-tabs {
  73 + background: #B6B6B6;
  74 + }
  75 +
  76 + paper-tab {
  77 + font-weight: 700;
  78 + border-right: 2px solid #FFFFFF;
  79 + }
  80 +
  81 + paper-tab:nth-last-child(2) {
  82 + border-right: 0;
  83 + }
  84 +
  85 + paper-tab.iron-selected {
  86 + color: #FFFFFF;
  87 + background: #2196F3;;
  88 + }
  89 +
  90 + paper-tab:not(.iron-selected):hover {
  91 + color: #2196F3;
  92 + }
  93 +
  94 + paper-input {
  95 + --paper-input-container-focus-color: #2196F3;
  96 + }
  97 +
  98 + paper-icon-button {
  99 + height: 48px;
  100 + width: 48px;
  101 + padding: 8px;
  102 + }
  103 +
  104 + paper-icon-button[icon="settings"] {
  105 + cursor: pointer;
  106 + color: #00BCD4;
  107 + --paper-icon-button-ink-color: #00BCD4;
  108 +
  109 + background: #E0E0E0;
  110 + float: right;
  111 + position: absolute;
  112 + right: 0;
  113 + }
  114 +
  115 + paper-icon-button[icon="info-outline"] {
  116 + cursor: help;
  117 + }
  118 +
  119 + :host {
  120 + --paper-dropdown-menu-icon: {
  121 + color: #000000;
  122 + };
  123 + --paper-dropdown-menu-ripple: {
  124 + color: #FFFFFF;
  125 + };
  126 + }
  127 +
  128 + paper-dropdown-menu {
  129 + /*width: 200px;*/
  130 + width: 50%;
  131 + --paper-input-container-focus-color: #2196F3;
  132 + }
  133 +
  134 + paper-item {
  135 + min-width: 128px;
  136 + white-space: nowrap;
  137 + }
  138 +
  139 + paper-item.iron-selected {
  140 + background-color: #2196F3;
  141 + color: #FFFFFF;
  142 + }
  143 +
  144 + paper-tooltip {
  145 + min-width: 400px;
  146 + --paper-tooltip-background: black;
  147 + }
  148 +
  149 + #select_dataset_container br {
  150 + display: block;
  151 + margin-top: 8px;
  152 + content: " ";
  153 + }
  154 +
  155 + #select_dataset_container p {
  156 + margin: 0;
  157 + padding: 0;
  158 + }
  159 +
  160 + #select_dataset_container p .option {
  161 + color: #2196F3;;
  162 + font-weight: 700;
  163 + }
  164 +
  165 + #select_dataset_container p .description {
  166 + }
  167 +
  168 + </style>
  169 +
  170 + <paper-material id="select_dataset_container" elevation="5">
  171 + <paper-tabs selected={{tabIndex}} no-bar>
  172 + <paper-tab noink on-tap="">EXAMPLE DATASETS LIST</paper-tab>
  173 + <!--<paper-tab noink on-tap="_setLocalDatasets"><span id="spod_users_datasets"></span></paper-tab>-->
  174 + <!--<paper-tab noink on-tap="_setExtendedDatasets"><span id="extended_datasets"></span></paper-tab>-->
  175 + </paper-tabs>
  176 +
  177 + <div id="options">
  178 +
  179 + <div id="options_header"></div>
  180 +
  181 + <div id="provider_option" class="header_block">
  182 + {{_getLocalization('provider')}}:&nbsp;
  183 + <paper-dropdown-menu id="ddl_provider" label="" no-label-float>
  184 + <paper-menu id="menu_provider" class="dropdown-content">
  185 + <paper-item id="0" on-tap="_setProvidersDatasets"><span id="all"></span></paper-item>
  186 + <template is="dom-repeat" items={{_toArray(providers)}}>
  187 + <paper-item id={{item.value.id}} on-tap="_setProvidersDatasets">{{item.value.title}}</paper-item>
  188 + </template>
  189 + </paper-menu>
  190 + </paper-dropdown-menu>
  191 + <paper-icon-button id="info_provider" icon="info-outline" noink></paper-icon-button>
  192 + <paper-tooltip id="tooltip_provider" for="info_provider" offset="8">
  193 + <p>
  194 + <span class="option">{{_getLocalization('all')}}</span><br>
  195 + <span class="description">{{_getLocalization('allDescription')}}</span><br>
  196 + <span class="option">{{_getLocalization('providerName')}}</span><br>
  197 + <span class="description">{{_getLocalization('providerNameDescription')}}</span><br>
  198 + </p>
  199 + </paper-tooltip>
  200 + </div>
  201 +
  202 + <!--<div id="view_option" class="header_block">-->
  203 + <!--{{_getLocalization('view')}}:&nbsp;-->
  204 + <!--<paper-dropdown-menu id="ddl_view" label="" no-label-float>-->
  205 + <!--<paper-menu id="menu_view" class="dropdown-content">-->
  206 + <!--<paper-item id="0" on-tap=""><span id="list"></span></paper-item>-->
  207 + <!--<paper-item id="1" on-tap="" disabled><span id="tree"></span></paper-item>-->
  208 + <!--</paper-menu>-->
  209 + <!--</paper-dropdown-menu>-->
  210 + <!--<paper-icon-button id="info_view" icon="info-outline" noink></paper-icon-button>-->
  211 + <!--<paper-tooltip id="tooltip_view" for="info_view" offset="8">-->
  212 + <!--<p>-->
  213 + <!--<span class="option">{{_getLocalization('list')}}</span><br>-->
  214 + <!--<span class="description">{{_getLocalization('listDescription')}}</span><br>-->
  215 + <!--<span class="option">{{_getLocalization('tree')}}</span><br>-->
  216 + <!--<span class="description">{{_getLocalization('treeDescription')}}</span><br>-->
  217 + <!--</p>-->
  218 + <!--</paper-tooltip>-->
  219 + <!--</div>-->
  220 +
  221 + <!--<div id="search_option" class="header_block">-->
  222 + <!--{{_getLocalization('search')}}:&nbsp;-->
  223 + <!--<paper-dropdown-menu id="ddl_search" label="" no-label-float>-->
  224 + <!--<paper-menu id="menu_search" class="dropdown-content">-->
  225 + <!--<paper-item><span id="standard"></span></paper-item>-->
  226 + <!--<paper-item disabled><span id="extended"></span></paper-item>-->
  227 + <!--</paper-menu>-->
  228 + <!--</paper-dropdown-menu>-->
  229 + <!--<paper-icon-button id="info_search" icon="info-outline" noink></paper-icon-button>-->
  230 + <!--<paper-tooltip id="tooltip_search" for="info_search" offset="8">-->
  231 + <!--<p>-->
  232 + <!--<span class="option">{{_getLocalization('standard')}}</span><br>-->
  233 + <!--<span class="description">{{_getLocalization('standardDescription')}}</span><br>-->
  234 + <!--<span class="option">{{_getLocalization('extended')}}</span><br>-->
  235 + <!--<span class="description">{{_getLocalization('extendedDescription')}}</span><br>-->
  236 + <!--</p>-->
  237 + <!--</paper-tooltip>-->
  238 + <!--</div>-->
  239 +
  240 + <div id="version_option" class="header_block">
  241 + {{_getLocalization('version')}}:&nbsp;
  242 + <paper-dropdown-menu id="ddl_version" label="" no-label-float>
  243 + <paper-menu id="menu_version" class="dropdown-content">
  244 + <paper-item id="0" on-tap="_showLast"><span id="show_last"></span></paper-item>
  245 + <paper-item id="1" on-tap="_showAll"><span id="show_all"></span></paper-item>
  246 + </paper-menu>
  247 + </paper-dropdown-menu>
  248 + <paper-icon-button id="tooltip_version" icon="info-outline" noink></paper-icon-button>
  249 + <paper-tooltip id="tooltip_version" for="tooltip_version" offset="8">
  250 + <p>
  251 + <span class="option">{{_getLocalization('showLast')}}</span><br>
  252 + <span class="description">{{_getLocalization('showLastDescription')}}</span><br>
  253 + <span class="option">{{_getLocalization('showAll')}}</span><br>
  254 + <span class="description">{{_getLocalization('showAllDescription')}}</span><br>
  255 + </p>
  256 + </paper-tooltip>
  257 + </div>
  258 +
  259 + <!--<paper-icon-button icon="settings" on-click="_optionsMenu"></paper-icon-button>-->
  260 +
  261 + </div>
  262 +
  263 + <div id="datasets_list_container">
  264 + <datasets-list-controllet id="datasets_list"></datasets-list-controllet>
  265 + </div>
  266 +
  267 + <div id="url"><paper-input id="selected_url" label="" value={{dataUrl}} error-message={{errorMessage}}></paper-input></div>
  268 + </paper-material>
  269 +
  270 + </template>
  271 +
  272 + <script>
  273 + HTMLImports.whenReady(function() {
  274 + Polymer({
  275 + is: 'demo-select-dataset-controllet',
  276 +
  277 + properties: {
  278 +
  279 + tabIndex: {
  280 + type: Number,
  281 + value: 0
  282 + },
  283 +
  284 + datasets: {
  285 + type: Object,
  286 + value: undefined
  287 + },
  288 +
  289 + suggestedDatasets : {
  290 + type : Array,
  291 + value : undefined
  292 + },
  293 +
  294 + dataUrl : {
  295 + type : String,
  296 + value : undefined,
  297 + observer : '_fireDataUrl'
  298 + }
  299 +
  300 + },
  301 +
  302 + listeners: {
  303 + 'datasets-list-controllet_dataset' : '_selectDataUrl'
  304 + },
  305 +
  306 + ready : function() {
  307 + this._translate();
  308 +
  309 + $(this.$.list_container).perfectScrollbar();
  310 + $(this.$.info).perfectScrollbar();
  311 +
  312 + this.options = true;
  313 + },
  314 +
  315 + attached : function() {
  316 + this._translate();
  317 +
  318 + this._resize();
  319 + var that = this;
  320 + window.addEventListener("resize", function() { that._resize() });
  321 +
  322 + this.providers = this.datasets["result"]["providers"];
  323 + this.providersDatasets = this.datasets["result"]["datasets"];
  324 +
  325 + if(this.suggestedDatasets)
  326 + this.providersDatasets = this.suggestedDatasets.concat(this.providersDatasets);
  327 +
  328 + $.ajax({
  329 + url: "/cocreation/ajax/get-all-dataset",
  330 + dataType: "json",
  331 + success: function(localDatasets){
  332 + that.localDatasets = localDatasets;
  333 + that.lastLocalDatasets = [];
  334 + var resource_name = "";
  335 + for(var i in localDatasets)
  336 + if(localDatasets[i].resource_name != resource_name) {
  337 + that.lastLocalDatasets.push(localDatasets[i]);
  338 + resource_name = localDatasets[i].resource_name;
  339 + }
  340 + },
  341 + error: function(){
  342 + that.localDatasets = [];
  343 + that.lastLocalDatasets = [];
  344 + }
  345 + });
  346 +
  347 + this._setProvidersDatasets();
  348 + },
  349 +
  350 + showDatasetInfo : function() {
  351 + this.$.datasets_list.showDatasetInfo();
  352 + },
  353 +
  354 + _translate : function(){
  355 + this.$.selected_url.setAttribute("label", ln["selectedUrl_" + ln["localization"]]);
  356 + this.errorMessage = ln["wrongUrl_" + ln["localization"]];
  357 +
  358 +// this.$.providers_datasets.innerHTML = ln["providersDatasets_" + ln["localization"]];
  359 +// this.$.spod_users_datasets.innerHTML = ln["spodUsersDatasets_" + ln["localization"]];
  360 +// this.$.extended_datasets.innerHTML = ln["extendedDatasets_" + ln["localization"]];
  361 +
  362 + this.$.options_header.innerHTML = ln["datasets_" + ln["localization"]];
  363 +
  364 + this.$.all.innerHTML = ln["all_" + ln["localization"]];
  365 +// this.$.list.innerHTML = ln["list_" + ln["localization"]];
  366 +// this.$.tree.innerHTML = ln["tree_" + ln["localization"]];
  367 +// this.$.standard.innerHTML = ln["standard_" + ln["localization"]];
  368 +// this.$.extended.innerHTML = ln["extended_" + ln["localization"]];
  369 + this.$.show_last.innerHTML = ln["showLast_" + ln["localization"]];
  370 + this.$.show_all.innerHTML = ln["showAll_" + ln["localization"]];
  371 +
  372 + this.$.menu_provider.select(0);
  373 +// this.$.menu_view.select(0);
  374 +// this.$.menu_search.select(0);
  375 + this.$.menu_version.select(0);
  376 + },
  377 +
  378 + _setProvidersDatasets : function() {
  379 + this.async(function () {
  380 + var ddl_provider = $(this.$.ddl_provider).find("paper-menu")[0].selectedItem;
  381 + var name = ddl_provider.innerHTML.trim();
  382 + var id = this._getIdByProviderName(name);
  383 + if (id) {
  384 + var providerDatasets = this.providersDatasets.filter(function (el) {
  385 + return el.provider_name == "p:" + id;
  386 + });
  387 + this.$.datasets_list.setDatasets(providerDatasets);
  388 + }
  389 + else
  390 + this.$.datasets_list.setDatasets(this.providersDatasets);
  391 +
  392 + this._showOptions();
  393 + }, 0);
  394 + },
  395 +
  396 + _setLocalDatasets : function() {
  397 + if(this.$.ddl_version.selectedItem.id == 0)
  398 + this._showLast();
  399 + else
  400 + this._showAll();
  401 + this._showOptions();
  402 + },
  403 +
  404 + _setExtendedDatasets : function() {
  405 + this.$.datasets_list.setDatasets([]);//tutto molto bello, clap, clap, clapù
  406 + this._showOptions()
  407 + },
  408 +
  409 + _getIdByProviderName : function(name) {
  410 + for(var id in this.providers) {
  411 + if (this.providers[id].title == name)
  412 + return this.providers[id].id;
  413 + }
  414 + },
  415 +
  416 + _optionsMenu : function() {
  417 + this.options = !this.options;
  418 + this._showOptions();
  419 + },
  420 +
  421 + _showOptions : function() {
  422 + this.async(function () {
  423 + if(!this.options) {
  424 + this.$.options_header.style.display = "block";
  425 + this.$.provider_option.style.display = "none";
  426 +// this.$.view_option.style.display = "none";
  427 +// this.$.search_option.style.display = "none";
  428 + this.$.version_option.style.display = "none";
  429 + }
  430 + else if(this.tabIndex == 0) {
  431 + this.$.options_header.style.display = "none";
  432 + this.$.provider_option.style.display = "block";
  433 +// this.$.view_option.style.display = "block";
  434 +// this.$.search_option.style.display = "block";
  435 + this.$.version_option.style.display = "none";
  436 + }
  437 + else if(this.tabIndex == 1) {
  438 + this.$.options_header.style.display = "none";
  439 + this.$.provider_option.style.display = "none";
  440 +// this.$.view_option.style.display = "none";
  441 +// this.$.search_option.style.display = "none";
  442 + this.$.version_option.style.display = "block";
  443 + }
  444 + else if(this.tabIndex == 2) {
  445 + this.$.options_header.style.display = "block";
  446 + this.$.provider_option.style.display = "none";
  447 +// this.$.view_option.style.display = "none";
  448 +// this.$.search_option.style.display = "none";
  449 + this.$.version_option.style.display = "none";
  450 + }
  451 + }, 0);
  452 + },
  453 +
  454 + _showAll : function() {
  455 + this.$.datasets_list.showVersion(true);
  456 + this.$.datasets_list.setDatasets(this.localDatasets);
  457 + },
  458 +
  459 + _showLast : function() {
  460 + this.$.datasets_list.showVersion(false);
  461 + this.$.datasets_list.setDatasets(this.lastLocalDatasets);
  462 + },
  463 +
  464 + _getLocalization : function(text){
  465 + return ln[text + "_" + ln["localization"]];
  466 + },
  467 +
  468 + _toArray: function(obj) {
  469 + return Object.keys(obj).map(function(key) {
  470 + return {
  471 + name: key,
  472 + value: obj[key]
  473 + };
  474 + });
  475 + },
  476 +
  477 + _selectDataUrl : function(e){
  478 + this.async(function () {
  479 + this.dataUrl = e.detail.dataset.url;
  480 + }, 0);
  481 + },
  482 +
  483 + _fireDataUrl : function(){
  484 + this.fire('select-dataset-controllet_data-url', {url: this.dataUrl});
  485 + },
  486 +
  487 + _resize : function(){
  488 + var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0) - 16;
  489 + h = h - 64 - 8; //height with page scroller
  490 + $("#select_dataset_container").height(h);
  491 + }
  492 + });
  493 + });
  494 + </script>
  495 +</dom-module>
0 496 \ No newline at end of file
... ...
controllets/select-dataset-controllet/select-dataset-controllet.html
1 1 <link rel="import" href="../../bower_components/polymer/polymer.html">
2 2  
  3 +<link rel="import" href="../../bower_components/paper-material/paper-material.html" />
3 4 <link rel="import" href="../../bower_components/paper-tabs/paper-tabs.html">
4 5 <link rel="import" href="../../bower_components/paper-tabs/paper-tab.html">
5   -
6   -<link rel="import" href="../../bower_components/neon-animation/neon-animation.html">
7   -<link rel="import" href="../../bower_components/neon-animation/neon-animatable.html">
8   -<link rel="import" href="../../bower_components/neon-animation/neon-animations.html">
9   -
10   -<link rel="import" href="../../bower_components/iron-flex-layout/iron-flex-layout.html">
11   -<!--<link rel="import" href="../../bower_components/app-layout/app-toolbar/app-toolbar.html">-->
12   -<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
13   -<link rel="import" href="../../bower_components/paper-styles/color.html">
14   -<link rel="import" href="../../bower_components/paper-styles/typography.html">
15   -<link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
16   -<link rel="import" href="../../bower_components/iron-icons/iron-icons.html">
17   -<link rel="import" href="../../bower_components/iron-image/iron-image.html">
18   -<link rel="import" href="../../bower_components/iron-list/iron-list.html">
19   -
20 6 <link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
21 7 <link rel="import" href="../../bower_components/paper-menu/paper-menu.html">
22 8 <link rel="import" href="../../bower_components/paper-item/paper-item.html">
  9 +<link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
  10 +<link rel="import" href="../../bower_components/paper-tooltip/paper-tooltip.html">
23 11  
24   -<link rel="import" href="../../bower_components/paper-input/paper-input.html">
25   -
26   -<link rel="import" href="../../bower_components/paper-input/paper-textarea.html">
27   -
28   -<link rel="import" href="../../bower_components/paper-material/paper-material.html" />
29   -
30   -<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
31   -<link rel="import" href="../../bower_components/iron-icons/hardware-icons.html">
32   -<!--<link rel="import" href="../../bower_components/iron-icons/iron-icons.html">-->
33   -
34   -<link rel="import" href="../../bower_components/paper-checkbox/paper-checkbox.html">
35   -
36   -<link rel="import" href="../providers-utility-controllet/providers-utility-controllet.html">
37   -<link rel="import" href="ortelio-controllet.html">
38   -<link rel="import" href="../../datalets/datasetexplorer-datalet/datasetexplorer-datalet.html">
  12 +<link rel="import" href="../datasets-list-controllet/datasets-list-controllet.html">
39 13  
40 14 <dom-module id="select-dataset-controllet">
41 15 <template>
42 16 <style>
43   - :host {
44   - --paper-dropdown-menu-icon: {
45   - color: #000000;
46   - };
47   - --paper-dropdown-menu-ripple: {
48   - color: #FFFFFF;
49   - };
50   - /*--paper-tab-ink: {*/
51   - /*color: #FFFFFF;*/
52   - /*};*/
53   - }
54 17  
55   - iron-list {
56   - --iron-list-items-container: {
57   - margin:16px 16px 8px 16px;
58   - };
  18 + #select_dataset_container {
  19 + margin-top: 8px;
59 20 }
60 21  
61   - paper-textarea {
62   - width: 100%;
63   - --paper-input-container-focus-color: #2196F3;
  22 + #select_dataset_container * {
  23 + font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  24 + font-size: 16px;
  25 + line-height: 24px;
64 26 }
65 27  
66   - paper-input {
67   - --paper-input-container-focus-color: #2196F3;
68   - }
69   - paper-dropdown-menu {
70   - width: 100%;
71   - --paper-input-container-focus-color: #2196F3;
72   - }
  28 + #select_dataset_container #options {
  29 + display: flex;
  30 + flex-direction: row;
73 31  
74   - paper-item.iron-selected {
75   - background-color: #2196F3;
76   - color: #FFFFFF;
77   - }
  32 + height: 48px;
  33 + padding: 0;
  34 + font-weight: 700;
  35 + background: #B6B6B6;
78 36  
79   - paper-checkbox {
80   - height: 24px;
81   - /*margin-top: 8px*/
82   - --paper-checkbox-checked-color: #2196F3;
83   - --paper-checkbox-checked-ink-color: #FFFFFF;
84   - --paper-checkbox-unchecked-color: #000000;
85   - --paper-checkbox-unchecked-ink-color: #FFFFFF;
86   - --paper-checkbox-label-color: #000000;
87   - }
  37 + margin-top: 2px;
88 38  
89   - paper-icon-button{
90   - height: 48px;
91   - width: 48px;
92   - padding: 0px;
93   - --paper-icon-button-ink-color: #FFFFFF;
  39 + overflow: hidden;
94 40 }
95 41  
96   - paper-icon-button:hover{
97   - color: #2196F3;
  42 + #select_dataset_container #options_header {
  43 + width: calc(100% - 96px);
  44 + text-align: center;
  45 + padding: 12px 0 12px 48px;
98 46 }
99 47  
100   - paper-icon-button[disabled]{
101   - color: #B6B6B6;
102   - }
  48 + #select_dataset_container .header_block {
  49 + /*width: calc((100% - 48px) / 2);*/
  50 + /*max-width: 400px;*/
  51 + width: calc(50% - 24px);
  52 + padding:0 12px;
103 53  
104   - paper-icon-button.clear {
105   - width: 24px;
106   - height: 24px;
107   - padding: 0px 4px;
108   - color: #F44336;
109   - --paper-icon-button-ink-color: #FFFFFF;
110   - }
  54 + line-height: 40px;
111 55  
112   - paper-tabs {
113   - font-weight: bold;
  56 + display: none;
114 57 }
115 58  
116   - paper-tab {
117   - transition: all 1.0s;
118   - }
  59 + #select_dataset_container #url {
  60 + padding: 0 12px 12px 12px;
  61 + height: 60px;
119 62  
120   - paper-tab.iron-selected {
121   - background-color: #2196F3;
122   - color: #FFFFFF;
  63 + border: 2px solid #B6B6B6;
  64 + border-top: 0;
123 65 }
124 66  
125   - paper-tab:not(.iron-selected):hover {
126   - color: #2196F3;
  67 + #select_dataset_container #datasets_list_container {
  68 + height: calc(100% - 96px - 2px - 74px);
  69 + width: 100%;
127 70 }
128 71  
129   - .item {
130   - /*@apply(--layout-horizontal);*/
131   - display: flex;
132   - padding: 11px;
133   - border: 1px solid #B6B6B6;
134   - border-radius: 4px;
135   - cursor: pointer;
136   - margin-bottom: 8px;
137   - background-color: #E0E0E0;
  72 + paper-tabs {
  73 + background: #B6B6B6;
138 74 }
139 75  
140   - .item.expanded {
141   - /*border: 2px solid #2196F3;*/
142   - border-color: #2196F3;
  76 + paper-tab {
  77 + font-weight: 700;
  78 + border-right: 2px solid #FFFFFF;
143 79 }
144 80  
145   - .pad {
146   - @apply(--layout-flex);
147   - /*@apply(--layout-vertical);*/
  81 + paper-tab:nth-last-child(2) {
  82 + border-right: 0;
148 83 }
149 84  
150   - .primary {
151   - font-weight: bold;
  85 + paper-tab.iron-selected {
  86 + color: #FFFFFF;
  87 + background: #2196F3;;
152 88 }
153 89  
154   - .item.expanded .primary {
  90 + paper-tab:not(.iron-selected):hover {
155 91 color: #2196F3;
156 92 }
157 93  
158   - .longText {
159   - display: none;
160   - }
161   -
162   - .item.expanded .longText {
163   - display: block;
  94 + paper-input {
  95 + --paper-input-container-focus-color: #2196F3;
164 96 }
165 97  
166   - #select_dataset_container {
167   - margin-top: 8px;
  98 + paper-icon-button {
  99 + height: 48px;
  100 + width: 48px;
  101 + padding: 8px;
168 102 }
169 103  
170   - #select_dataset_container * {
171   - font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
172   - font-size: 16px;
173   - line-height: 24px;
174   - }
  104 + paper-icon-button[icon="settings"] {
  105 + cursor: pointer;
  106 + color: #00BCD4;
  107 + --paper-icon-button-ink-color: #00BCD4;
175 108  
176   - #select_dataset_container #neon_container {
177   - height: calc(100% - 172px);
178   - width: calc(100% - 8px);
  109 + background: #E0E0E0;
  110 + float: right;
  111 + position: absolute;
  112 + right: 0;
179 113 }
180 114  
181   - #select_dataset_container #list_info {
182   - display: flex;
183   - height: calc(100% - 48px);
184   - width: calc(100% + 8px);/*bad*/
  115 + paper-icon-button[icon="info-outline"] {
  116 + cursor: help;
185 117 }
186 118  
187   - #select_dataset_container #list_container {
188   - position: relative;
189   - height: 100%;
190   - width: 50%;
191   - border-left: 4px solid #B6B6B6;
  119 + :host {
  120 + --paper-dropdown-menu-icon: {
  121 + color: #000000;
  122 + };
  123 + --paper-dropdown-menu-ripple: {
  124 + color: #FFFFFF;
  125 + };
192 126 }
193 127  
194   - #select_dataset_container #info_container {
195   - position: relative;
196   - height: 100%;
  128 + paper-dropdown-menu {
  129 + /*width: 200px;*/
197 130 width: 50%;
198   - border-right: 4px solid #B6B6B6;
199   - }
200   -
201   - #select_dataset_container #info {
202   - position: relative;
203   - height: calc(100% - 56px);
204   - width: calc(100% - 56px);
205   - padding: 11px;
206   - border: 1px solid #B6B6B6;
207   - border-radius: 4px;
208   - background-color: #E0E0E0;
209   - margin: 16px;
210   - }
211   -
212   - #select_dataset_container #treemap_container {
213   - /*height: calc(100% - 244px);*/
214   - /*width: calc(100% - 8px);*/
215   - height: calc(100% - 48px);
216   - width: 100%;
217   - border: 4px solid #B6B6B6;
218   - border-top: 0px;
219   - border-bottom: 0px;
220   - position: relative;
221   - }
222   -
223   - #select_dataset_container #header {
224   - position: relative;
225   - z-index: 1;
226   - -webkit-box-shadow: 0 30px 24px -12px rgba(0, 0, 0, 0.14), 0 20px 30px -9px rgba(0, 0, 0, 0.12), 0 20px 10px -19px rgba(0, 0, 0, 0.4);
227   - -moz-box-shadow: 0 30px 24px -12px rgba(0, 0, 0, 0.14), 0 20px 30px -9px rgba(0, 0, 0, 0.12), 0 20px 10px -19px rgba(0, 0, 0, 0.4);
228   - box-shadow: 0 30px 24px -12px rgba(0, 0, 0, 0.14), 0 20px 30px -9px rgba(0, 0, 0, 0.12), 0 20px 10px -19px rgba(0, 0, 0, 0.4);
229   -
230   - background-color: #B6B6B6;
231   - display: flex;
232   - padding: 0px 4px;
233   - }
234   -
235   - #select_dataset_container #footer_list {
236   - position: relative;
237   - z-index: 1;
238   - -webkit-box-shadow: 0 -30px 24px -12px rgba(0, 0, 0, 0.14), 0 -20px 30px -9px rgba(0, 0, 0, 0.12), 0 -20px 10px -19px rgba(0, 0, 0, 0.4);
239   - -moz-box-shadow: 0 -30px 24px -12px rgba(0, 0, 0, 0.14), 0 -20px 30px -9px rgba(0, 0, 0, 0.12), 0 -20px 10px -19px rgba(0, 0, 0, 0.4);
240   - box-shadow: 0 -30px 24px -12px rgba(0, 0, 0, 0.14), 0 -20px 30px -9px rgba(0, 0, 0, 0.12), 0 -20px 10px -19px rgba(0, 0, 0, 0.4);
241   - }
242   -
243   - .noshadow {
244   - -webkit-box-shadow: none !important;
245   - -moz-box-shadow: none !important;
246   - box-shadow: none !important;
  131 + --paper-input-container-focus-color: #2196F3;
247 132 }
248 133  
249   - #select_dataset_container #footer_list,
250   - #select_dataset_container #footer_treemap {
251   - width: 100%;
252   - background-color: #B6B6B6;
253   - display: flex;
254   - padding: 0px 4px;
  134 + paper-item {
  135 + min-width: 128px;
  136 + white-space: nowrap;
255 137 }
256 138  
257   - #select_dataset_container #url {
258   - height: 76px;/*100*/
259   - border: 4px solid #B6B6B6;
260   - border-top: 0px;
261   - padding: 0px 16px;
262   - margin-top: -4px;
  139 + paper-item.iron-selected {
  140 + background-color: #2196F3;
  141 + color: #FFFFFF;
263 142 }
264 143  
265   - #header .header_block {
266   - width: 20%;
267   - height: 40px;
268   - padding: 4px 16px 4px 16px;
  144 + paper-tooltip {
  145 + min-width: 400px;
  146 + --paper-tooltip-background: black;
269 147 }
270 148  
271   - /*.header_block:nth-child(2), .header_block:nth-child(3), .header_block:nth-child(3), .header_block:nth-child(4){*/
272   - /*visibility: hidden;*/
273   - /*}*/
274   -
275   - #header .header_block:nth-child(4) {
276   - text-align: center;
  149 + #select_dataset_container br {
  150 + display: block;
  151 + margin-top: 8px;
  152 + content: " ";
277 153 }
278 154  
279   - .footer_block {
280   - width: calc((100% - 0px) / 3);
281   - height: 24px;
282   - padding: 12px 8px 12px 8px;
283   - text-align: center;
  155 + #select_dataset_container p {
  156 + margin: 0;
  157 + padding: 0;
284 158 }
285 159  
286   - .footer_block:nth-child(2) {
287   - height: 48px;
288   - padding: 0px 8px;
  160 + #select_dataset_container p .option {
  161 + color: #2196F3;;
  162 + font-weight: 700;
289 163 }
290 164  
291   - #suggested_div {
292   - visibility: hidden;
  165 + #select_dataset_container p .description {
293 166 }
294 167  
295   - /*.info_resource_name {*/
296   - /*color: #2196F3;*/
297   - /*font-weight: bold;*/
298   - /*line-height: 48px;*/
299   - /*}*/
300   -
301   - /*#ortelio {*/
302   - /*/!*height: calc(100% - 172px);*!/*/
303   - /*/!*width: calc(100% - 8px);*!/*/
304   - /*height: 100%;*/
305   - /*width: 100%;*/
306   - /*background-color: red;*/
307   - /*}*/
308 168 </style>
309 169  
310 170 <paper-material id="select_dataset_container" elevation="5">
311   -
312   - <paper-tabs selected="{{selected}}" no-bar>
313   - <paper-tab on-tap="_refreshList" noink><span id="listView"></span></paper-tab>
314   - <paper-tab on-tap="_noShadow" noink><span id="treeMapView"></span></paper-tab>
315   - <paper-tab on-tap="_hideSearch" noink><span id="extendedSearch"></span></paper-tab>
  171 + <paper-tabs selected={{tabIndex}} no-bar>
  172 + <paper-tab noink on-tap="_setProvidersDatasets"><span id="providers_datasets"></span></paper-tab>
  173 + <paper-tab noink on-tap="_setLocalDatasets"><span id="spod_users_datasets"></span></paper-tab>
  174 + <paper-tab noink on-tap="_setExtendedDatasets"><span id="extended_datasets"></span></paper-tab>
316 175 </paper-tabs>
317 176  
318   - <div id="header">
319   - <div class="header_block">
  177 + <div id="options">
  178 +
  179 + <div id="options_header"></div>
  180 +
  181 + <div id="provider_option" class="header_block">
  182 + {{_getLocalization('provider')}}:&nbsp;
320 183 <paper-dropdown-menu id="ddl_provider" label="" no-label-float>
321   - <paper-menu class="dropdown-content" selected="0">
322   - <paper-item id="0" on-tap="_filter"></paper-item>
323   - <template is="dom-repeat" items={{_toArray(providers)}} as="provider">
324   - <!--<paper-item id={{provider.value.id}} style$="background: {{_getProviderColor(provider.value.id)}};">{{provider.value.title}}</paper-item>-->
325   - <paper-item id={{provider.value.id}} on-tap="_filter">{{provider.value.title}}</paper-item>
  184 + <paper-menu id="menu_provider" class="dropdown-content">
  185 + <paper-item id="0" on-tap="_setProvidersDatasets"><span id="all"></span></paper-item>
  186 + <template is="dom-repeat" items={{_toArray(providers)}}>
  187 + <paper-item id={{item.value.id}} on-tap="_setProvidersDatasets">{{item.value.title}}</paper-item>
326 188 </template>
327 189 </paper-menu>
328 190 </paper-dropdown-menu>
  191 + <paper-icon-button id="info_provider" icon="info-outline" noink></paper-icon-button>
  192 + <paper-tooltip id="tooltip_provider" for="info_provider" offset="8">
  193 + <p>
  194 + <span class="option">{{_getLocalization('all')}}</span><br>
  195 + <span class="description">{{_getLocalization('allDescription')}}</span><br>
  196 + <span class="option">{{_getLocalization('providerName')}}</span><br>
  197 + <span class="description">{{_getLocalization('providerNameDescription')}}</span><br>
  198 + </p>
  199 + </paper-tooltip>
329 200 </div>
330   - <div class="header_block">
331   - </div>
332   - <div class="header_block">
333   - </div>
334   - <div class="header_block">
335   - </div>
336   - <div class="header_block">
337   - <paper-input id="datasets_filter" value={{filter}} no-label-float label="">
338   - <iron-icon class="search" icon="search" prefix></iron-icon>
339   - <paper-icon-button class="clear" suffix on-click="_clearInput" icon="clear" tabindex="0"></paper-icon-button>
340   - </paper-input>
  201 +
  202 + <!--<div id="view_option" class="header_block">-->
  203 + <!--{{_getLocalization('view')}}:&nbsp;-->
  204 + <!--<paper-dropdown-menu id="ddl_view" label="" no-label-float>-->
  205 + <!--<paper-menu id="menu_view" class="dropdown-content">-->
  206 + <!--<paper-item id="0" on-tap=""><span id="list"></span></paper-item>-->
  207 + <!--<paper-item id="1" on-tap="" disabled><span id="tree"></span></paper-item>-->
  208 + <!--</paper-menu>-->
  209 + <!--</paper-dropdown-menu>-->
  210 + <!--<paper-icon-button id="info_view" icon="info-outline" noink></paper-icon-button>-->
  211 + <!--<paper-tooltip id="tooltip_view" for="info_view" offset="8">-->
  212 + <!--<p>-->
  213 + <!--<span class="option">{{_getLocalization('list')}}</span><br>-->
  214 + <!--<span class="description">{{_getLocalization('listDescription')}}</span><br>-->
  215 + <!--<span class="option">{{_getLocalization('tree')}}</span><br>-->
  216 + <!--<span class="description">{{_getLocalization('treeDescription')}}</span><br>-->
  217 + <!--</p>-->
  218 + <!--</paper-tooltip>-->
  219 + <!--</div>-->
  220 +
  221 + <!--<div id="search_option" class="header_block">-->
  222 + <!--{{_getLocalization('search')}}:&nbsp;-->
  223 + <!--<paper-dropdown-menu id="ddl_search" label="" no-label-float>-->
  224 + <!--<paper-menu id="menu_search" class="dropdown-content">-->
  225 + <!--<paper-item><span id="standard"></span></paper-item>-->
  226 + <!--<paper-item disabled><span id="extended"></span></paper-item>-->
  227 + <!--</paper-menu>-->
  228 + <!--</paper-dropdown-menu>-->
  229 + <!--<paper-icon-button id="info_search" icon="info-outline" noink></paper-icon-button>-->
  230 + <!--<paper-tooltip id="tooltip_search" for="info_search" offset="8">-->
  231 + <!--<p>-->
  232 + <!--<span class="option">{{_getLocalization('standard')}}</span><br>-->
  233 + <!--<span class="description">{{_getLocalization('standardDescription')}}</span><br>-->
  234 + <!--<span class="option">{{_getLocalization('extended')}}</span><br>-->
  235 + <!--<span class="description">{{_getLocalization('extendedDescription')}}</span><br>-->
  236 + <!--</p>-->
  237 + <!--</paper-tooltip>-->
  238 + <!--</div>-->
  239 +
  240 + <div id="version_option" class="header_block">
  241 + {{_getLocalization('version')}}:&nbsp;
  242 + <paper-dropdown-menu id="ddl_version" label="" no-label-float>
  243 + <paper-menu id="menu_version" class="dropdown-content">
  244 + <paper-item id="0" on-tap="_showLast"><span id="show_last"></span></paper-item>
  245 + <paper-item id="1" on-tap="_showAll"><span id="show_all"></span></paper-item>
  246 + </paper-menu>
  247 + </paper-dropdown-menu>
  248 + <paper-icon-button id="tooltip_version" icon="info-outline" noink></paper-icon-button>
  249 + <paper-tooltip id="tooltip_version" for="tooltip_version" offset="8">
  250 + <p>
  251 + <span class="option">{{_getLocalization('showLast')}}</span><br>
  252 + <span class="description">{{_getLocalization('showLastDescription')}}</span><br>
  253 + <span class="option">{{_getLocalization('showAll')}}</span><br>
  254 + <span class="description">{{_getLocalization('showAllDescription')}}</span><br>
  255 + </p>
  256 + </paper-tooltip>
341 257 </div>
  258 +
  259 + <!--<paper-icon-button icon="settings" on-click="_optionsMenu"></paper-icon-button>-->
  260 +
342 261 </div>
343 262  
344   - <neon-animated-pages id="neon_container" selected="{{selected}}" entry-animation="fade-in-animation" exit-animation="fade-out-animation">
345   -
346   - <neon-animatable>
347   - <div id="list_info">
348   - <div id="list_container">
349   - <iron-list id="list" items="{{shownDatasets}}" selection-enabled>
350   - <template>
351   - <div>
352   - <div class$="{{getClassForItem(selected)}}" on-tap="_selectDataUrl" style$="background: {{_getColorForItem(item)}};">
353   - <span style="display:none;">{{item.url}}</span>
354   - <div class="pad">
355   - <div class="primary">{{item.resource_name}}</div>
356   - <!--<div class="longText">-->
357   - <!--<template is="dom-repeat" items="{{_stringToArray(item.metas)}}" as="mata">-->
358   - <!--<b>{{mata.name}}:</b>-->
359   - <!--<span inner-h-t-m-l="{{mata.value}}"></span> <br>-->
360   - <!--</template>-->
361   - <!--</div>-->
362   - </div>
363   - <iron-icon icon$="{{_getIconForItem(item)}}" style$="color: {{_getColorForIcon(item)}};"></iron-icon>
364   - </div>
365   - </div>
366   - </template>
367   - </iron-list>
368   - </div>
369   - <div id="info_container">
370   - <div id="info">
371   - </div>
372   - </div>
373   - </div>
374   -
375   - <div id="footer_list">
376   - <div class="footer_block"><span id="showing"></span> {{shownPrev}} <span id="to"></span> {{shownNext}} <span id="of"></span> {{length}} <span id="datasets"></span></div>
377   - <div class="footer_block">
378   - <paper-icon-button id="slider_chevron_left" class="chevron-left" on-click="_onPrevClick" icon="chevron-left"></paper-icon-button>
379   - <paper-icon-button id="slider_chevron_right" class="chevron-right" on-click="_onNextClick" icon="chevron-right"></paper-icon-button>
380   - </div>
381   - <div id="suggested_div" class="footer_block">
382   - <!--<template is="dom-if" if={{suggestedDatasets}}>-->
383   - <paper-checkbox checked on-change="showSuggested"><span id="suggested_datasets"></span></paper-checkbox>
384   - <!--</template>-->
385   - </div>
386   - </div>
387   - </neon-animatable>
388   -
389   - <neon-animatable>
390   - <div id="treemap_container"></div>
391   -
392   - <div id="footer_treemap">
393   - <div class="footer_block"><span id="showing2"></span> {{tLength}} <span id="datasets2"></span></div>
394   - <div class="footer_block"></div>
395   - <div class="footer_block"></div>
396   - </div>
397   - </neon-animatable>
398   -
399   - <neon-animatable>
400   - <!--<div id="ortelio">-->
401   - <ortelio-controllet datasets={{datasets}}></ortelio-controllet>
402   - <!--</div>-->
403   - </neon-animatable>
404   -
405   - </neon-animated-pages>
406   -
407   - <div id="url">
408   - <paper-textarea id="selected_url" label="" value={{dataUrl}} error-message={{errorMessage}}></paper-textarea>
  263 + <div id="datasets_list_container">
  264 + <datasets-list-controllet id="datasets_list"></datasets-list-controllet>
409 265 </div>
410 266  
  267 + <div id="url"><paper-input id="selected_url" label="" value={{dataUrl}} error-message={{errorMessage}}></paper-input></div>
411 268 </paper-material>
412 269  
413 270 </template>
... ... @@ -416,211 +273,137 @@
416 273 HTMLImports.whenReady(function() {
417 274 Polymer({
418 275 is: 'select-dataset-controllet',
  276 +
419 277 properties: {
  278 +
  279 + tabIndex: {
  280 + type: Number,
  281 + value: 0
  282 + },
  283 +
420 284 datasets: {
421 285 type: Object,
422 286 value: undefined
423 287 },
424   - filteredDatasets : {
425   - type : Array,
426   - value : undefined
427   - },
428   - shownDatasets : {
429   - type : Array,
430   - value : undefined
431   - },
  288 +
432 289 suggestedDatasets : {
433 290 type : Array,
434 291 value : undefined
435 292 },
436 293  
437   - providers : {
438   - type : Array,
439   - value : undefined
440   - },
441 294 dataUrl : {
442 295 type : String,
443 296 value : undefined,
444 297 observer : '_fireDataUrl'
445   - },
446   - filter : {
447   - type : String,
448   - value : "",
449   - observer : '_filter'
450   - },
451   - selected : {
452   - type : Number,
453   - value : 0
454   - },
455   - prev : {type : Number, value : undefined},
456   - next : {type : Number, value : undefined},
457   - shownPrev : {type : Number, value : undefined},
458   - shownNext : {type : Number, value : undefined},
459   - length : {type : Number, value : undefined},
460   - tLength : {type : Number, computed : 'treemapLength(length)'},
461   - step : {type : Number, value : 20},
462   - colors : {
463   - type : Array,
464   - value : ["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"]
465 298 }
  299 +
466 300 },
467 301  
468 302 listeners: {
469   - 'datasetexplorer-datalet_data-url': '_selectDataUrl_treeMap'
  303 + 'datasets-list-controllet_dataset' : '_selectDataUrl'
470 304 },
471 305  
472 306 ready : function() {
  307 + this._translate();
  308 +
473 309 $(this.$.list_container).perfectScrollbar();
474 310 $(this.$.info).perfectScrollbar();
475 311  
476   -// this.$.selected_url.invalid = true;
  312 + this.options = true;
477 313 },
478 314  
479   - attached: function() {
  315 + attached : function() {
  316 + this._translate();
  317 +
480 318 this._resize();
481 319 var that = this;
482   - window.addEventListener("resize", function() { that._resize(); that._loadTreeMap();});
  320 + window.addEventListener("resize", function() { that._resize() });
  321 +
  322 + this.providers = this.datasets["result"]["providers"];
  323 + this.providersDatasets = this.datasets["result"]["datasets"];
483 324  
484   -// this.providers = that.datasets["result"]["providers"];
485   -// this.datasets = that.datasets["result"]["datasets"];
  325 + if(this.suggestedDatasets)
  326 + this.providersDatasets = this.suggestedDatasets.concat(this.providersDatasets);
486 327  
487 328 $.ajax({
488 329 url: "/cocreation/ajax/get-all-dataset",
489 330 dataType: "json",
490   - success: function(spodDatasets){
491   -
492   - that.providers = $.extend(that.datasets["result"]["providers"], {99: {api_url: "/cocreation/ajax/get-all-dataset", id: "99", image_hash: "SPOD", title: "SPOD"}});
493   - that.datasets = $.merge(spodDatasets, that.datasets["result"]["datasets"]);
494   -
495   - if(that.suggestedDatasets) {
496   - that.tempDatasets = that.datasets;
497   - that.datasets = that.suggestedDatasets.concat(that.datasets);
498   - that.$.suggested_div.style.visibility = "visible";
499   - }
500   -
501   - that.filteredDatasets = that.datasets;
502   -
503   - that.prev = 1;
504   - that.next = that.step;
505   - that.length = that.filteredDatasets.length;
506   -
507   - that.shownPrev = Math.min(that.prev, that.length);
508   - that.shownNext = Math.min(that.next, that.length);
509   - that.shownDatasets = that.filteredDatasets.slice(that.prev-1, that.next);
510   -
511   - that.$.list.scrollTarget = that.ownerDocument.documentElement;
512   -
513   - that._translate();
514   -
515   - that._loadTreeMap();
  331 + success: function(localDatasets){
  332 + that.localDatasets = localDatasets;
  333 + that.lastLocalDatasets = [];
  334 + var resource_name = "";
  335 + for(var i in localDatasets)
  336 + if(localDatasets[i].resource_name != resource_name) {
  337 + that.lastLocalDatasets.push(localDatasets[i]);
  338 + resource_name = localDatasets[i].resource_name;
  339 + }
  340 + },
  341 + error: function(){
  342 + that.localDatasets = [];
  343 + that.lastLocalDatasets = [];
516 344 }
517 345 });
518   - },
519   -
520   - _translate : function(){
521   - this.$.listView.innerHTML = ln["listView_" + ln["localization"]];
522   - this.$.treeMapView.innerHTML = ln["treeMapView_" + ln["localization"]];
523   - this.$.extendedSearch.innerHTML = ln["extendedSearch_" + ln["localization"]];
524   -
525   - this.$.ddl_provider.setAttribute("label", ln["provider_" + ln["localization"]]);
526   - this.$.datasets_filter.setAttribute("label", ln["search_" + ln["localization"]]);
527 346  
528   - this.$.suggested_datasets.innerHTML = ln["suggestedDatasets_" + ln["localization"]];
  347 + this._setProvidersDatasets();
  348 + },
529 349  
530   - this.$.showing.innerHTML = ln["showing_" + ln["localization"]];
531   - this.$.showing2.innerHTML = ln["showing_" + ln["localization"]];
532   - this.$.to.innerHTML = ln["to_" + ln["localization"]];
533   - this.$.of.innerHTML = ln["of_" + ln["localization"]];
534   - this.$.datasets.innerHTML = ln["datasets_" + ln["localization"]];
535   - this.$.datasets2.innerHTML = ln["datasets_" + ln["localization"]];
  350 + showDatasetInfo : function() {
  351 + this.$.datasets_list.showDatasetInfo();
  352 + },
536 353  
  354 + _translate : function(){
537 355 this.$.selected_url.setAttribute("label", ln["selectedUrl_" + ln["localization"]]);
538 356 this.errorMessage = ln["wrongUrl_" + ln["localization"]];
539   - },
540 357  
541   - showSuggested : function(e) {
542   - if(e.target.checked)
543   - this.datasets = this.suggestedDatasets.concat(this.tempDatasets);
544   - else
545   - this.datasets = this.tempDatasets;
546   - this._filter();
547   - },
  358 + this.$.providers_datasets.innerHTML = ln["providersDatasets_" + ln["localization"]];
  359 + this.$.spod_users_datasets.innerHTML = ln["spodUsersDatasets_" + ln["localization"]];
  360 + this.$.extended_datasets.innerHTML = ln["extendedDatasets_" + ln["localization"]];
548 361  
549   - _loadTreeMap : function(){
550   - var h = $("#neon_container").height() - 48;
551   - var w = $("#neon_container").width();
  362 + this.$.options_header.innerHTML = ln["datasets_" + ln["localization"]];
552 363  
553   - var data = JSON.stringify({result : {providers: this.providers, datasets: this.filteredDatasets}}).replace(/'/g, "");
  364 + this.$.all.innerHTML = ln["all_" + ln["localization"]];
  365 +// this.$.list.innerHTML = ln["list_" + ln["localization"]];
  366 +// this.$.tree.innerHTML = ln["tree_" + ln["localization"]];
  367 +// this.$.standard.innerHTML = ln["standard_" + ln["localization"]];
  368 +// this.$.extended.innerHTML = ln["extended_" + ln["localization"]];
  369 + this.$.show_last.innerHTML = ln["showLast_" + ln["localization"]];
  370 + this.$.show_all.innerHTML = ln["showAll_" + ln["localization"]];
554 371  
555   - if(this.filteredDatasets.length > 0)
556   - this.$.treemap_container.innerHTML = "<datasetexplorer-datalet data='"+data+"' width=\""+w+"\" height=\""+h+"\" fields='[\"provider_name\",\"organization_name\",\"package_name\",\"resource_name\",\"url\",\"w\",\"metas\"]'></datasetexplorer-datalet>";
557   - else
558   - this.$.treemap_container.innerHTML = "";
  372 + this.$.menu_provider.select(0);
  373 +// this.$.menu_view.select(0);
  374 +// this.$.menu_search.select(0);
  375 + this.$.menu_version.select(0);
559 376 },
560 377  
561   - _filter : function() {
562   - if(this.filteredDatasets) {
563   - this.async(function () {
564   - var ddl_provider = $(this.$.ddl_provider).find("paper-menu")[0].selectedItem;
565   - var name = ddl_provider.innerHTML.trim();
566   - var id = this._getIdByProviderName(name);
567   - this.prev = 1;
568   - this.next = this.step;
569   - if (id) {
570   - //filtered by provider name
571   - this.filteredDatasets = this.datasets.filter(function (el) {
572   - return el.provider_name == "p:" + id;
573   - });
574   - }
575   - else {
576   - this.filteredDatasets = this.datasets;
577   - }
578   -
579   - //filtered by filter
580   - var filter = this.filter;
581   - this.filteredDatasets = this.filteredDatasets.filter(function (el) {
582   - return el.resource_name.toLowerCase().indexOf(filter.toLowerCase()) > -1;
  378 + _setProvidersDatasets : function() {
  379 + this.async(function () {
  380 + var ddl_provider = $(this.$.ddl_provider).find("paper-menu")[0].selectedItem;
  381 + var name = ddl_provider.innerHTML.trim();
  382 + var id = this._getIdByProviderName(name);
  383 + if (id) {
  384 + var providerDatasets = this.providersDatasets.filter(function (el) {
  385 + return el.provider_name == "p:" + id;
583 386 });
  387 + this.$.datasets_list.setDatasets(providerDatasets);
  388 + }
  389 + else
  390 + this.$.datasets_list.setDatasets(this.providersDatasets);
584 391  
585   - this.length = this.filteredDatasets.length;
586   -
587   - this.shownPrev = Math.min(this.prev, this.length);
588   - this.shownNext = Math.min(this.next, this.length);
589   - this.shownDatasets = this.filteredDatasets.slice(this.prev - 1, this.next);
590   -
591   - $("#list_container").animate({scrollTop: 0}, 0);
592   -
593   - this._loadTreeMap();
594   - }, 0);
595   - }
596   - },
597   -
598   - _refreshList : function() {
599   - this.shownDatasets = this.filteredDatasets.slice(this.prev - 1, this.next);
600   -
601   - this.$.header.style.display = "flex";
602   - this.$.header.style.visibility = "visible";
603   -// this.$.url.style.marginTop = "-4px";
604   -
605   - this.$.header.className = this.$.header.className.replace(" noshadow", "");
606   - },
607   -
608   - _noShadow : function() {
609   - this.$.header.style.display = "flex";
610   - this.$.header.style.visibility = "visible";
611   -// this.$.url.style.marginTop = "-4px";
612   -
613   - this.$.header.className += " noshadow";
  392 + this._showOptions();
  393 + }, 0);
614 394 },
615 395  
616   - _hideSearch : function() {
617   -// this.$.header.style.display = "none";
618   - this.$.header.style.visibility = "hidden";
619   -// this.$.url.style.marginTop = "44px";
  396 + _setLocalDatasets : function() {
  397 + if(this.$.ddl_version.selectedItem.id == 0)
  398 + this._showLast();
  399 + else
  400 + this._showAll();
  401 + this._showOptions();
620 402 },
621 403  
622   - _clearInput : function() {
623   - this.$.datasets_filter.value = "";
  404 + _setExtendedDatasets : function() {
  405 + this.$.datasets_list.setDatasets([]);//tutto molto bello, clap, clap, clapù
  406 + this._showOptions()
624 407 },
625 408  
626 409 _getIdByProviderName : function(name) {
... ... @@ -630,104 +413,56 @@
630 413 }
631 414 },
632 415  
633   -// iconForItem: function(item) {
634   -// return item ? (item.integer < 50 ? 'star-border' : 'info-outline') : '';
635   -// },
636   -
637   - treemapLength : function(length) {
638   - var ddl_provider = $(this.$.ddl_provider).find("paper-menu")[0].selectedItem;
639   - var name = ddl_provider.innerHTML.trim();
640   - var id = this._getIdByProviderName(name);
641   -
642   - if(this.suggestedDatasets && !id)
643   - return Math.max(length - this.suggestedDatasets.length, 0);
644   - return length;
645   - },
646   -
647   - _getColorForIcon : function(item) {
648   - var ddl_provider = $(this.$.ddl_provider).find("paper-menu")[0].selectedItem;
649   - var name = ddl_provider.innerHTML.trim();
650   - var id = this._getIdByProviderName(name);
651   - if (id) {
652   - return this.colors[0];
653   - }
654   - if(!item.provider_name) {
655   - return "#00BCD4";
656   - }
657   - var id = item.provider_name.substring(2, item.provider_name.length);
658   - var i = this.getProviderById(id) % this.colors.length;
659   - return this.colors[i];
660   - },
661   -
662   - _getColorForItem : function(item) {
663   -// var ddl_provider = $(this.$.ddl_provider).find("paper-menu")[0].selectedItem;
664   -// var name = ddl_provider.innerHTML.trim();
665   -// var id = this._getIdByProviderName(name);
666   -// if (id) {
667   -// return this.colors[0];
668   -// }
669   - if(!item.provider_name) {
670   - return "#FFEB3B";
671   - }
672   -// var id = item.provider_name.substring(2, item.provider_name.length);
673   -// var i = this.getProviderById(id) % this.colors.length;
674   -// return this.colors[i];
  416 + _optionsMenu : function() {
  417 + this.options = !this.options;
  418 + this._showOptions();
675 419 },
676 420  
677   - _getIconForItem : function(item) {
678   - return item.provider_name ? 'bookmark' : 'star';
679   - },
680   -
681   -// _getProviderColor: function(id) {
682   -// var i = this.getProviderById(id) % this.colors.length;
683   -// return this.colors[i];
684   -// },
685   -
686   - getClassForItem: function(selected) {
687   - return selected ? 'item expanded' : 'item';
  421 + _showOptions : function() {
  422 + this.async(function () {
  423 + if(!this.options) {
  424 + this.$.options_header.style.display = "block";
  425 + this.$.provider_option.style.display = "none";
  426 +// this.$.view_option.style.display = "none";
  427 +// this.$.search_option.style.display = "none";
  428 + this.$.version_option.style.display = "none";
  429 + }
  430 + else if(this.tabIndex == 0) {
  431 + this.$.options_header.style.display = "none";
  432 + this.$.provider_option.style.display = "block";
  433 +// this.$.view_option.style.display = "block";
  434 +// this.$.search_option.style.display = "block";
  435 + this.$.version_option.style.display = "none";
  436 + }
  437 + else if(this.tabIndex == 1) {
  438 + this.$.options_header.style.display = "none";
  439 + this.$.provider_option.style.display = "none";
  440 +// this.$.view_option.style.display = "none";
  441 +// this.$.search_option.style.display = "none";
  442 + this.$.version_option.style.display = "block";
  443 + }
  444 + else if(this.tabIndex == 2) {
  445 + this.$.options_header.style.display = "block";
  446 + this.$.provider_option.style.display = "none";
  447 +// this.$.view_option.style.display = "none";
  448 +// this.$.search_option.style.display = "none";
  449 + this.$.version_option.style.display = "none";
  450 + }
  451 + }, 0);
688 452 },
689 453  
690   - getProviderById: function(providerId) {
691   - var i = 0;
692   - for(var id in this.providers){
693   - if(this.providers[id].id == providerId)
694   - return i;
695   - i++;
696   - }
  454 + _showAll : function() {
  455 + this.$.datasets_list.showVersion(true);
  456 + this.$.datasets_list.setDatasets(this.localDatasets);
697 457 },
698 458  
699   - _onPrevClick : function(){
700   - if(this.prev != 1) {
701   - this.prev -= this.step;
702   - this.next -= this.step;
703   -
704   - this.shownPrev = Math.min(this.prev, this.length);
705   - this.shownNext = Math.min(this.next, this.length);
706   - this.shownDatasets = this.filteredDatasets.slice(this.prev - 1, this.next);
707   - }
708   - $("#list_container").animate({ scrollTop: 0}, 0);
  459 + _showLast : function() {
  460 + this.$.datasets_list.showVersion(false);
  461 + this.$.datasets_list.setDatasets(this.lastLocalDatasets);
709 462 },
710 463  
711   - _onNextClick : function(){
712   - if(this.next < this.length) {
713   - this.prev += this.step;
714   - this.next += this.step;
715   -
716   - this.shownPrev = Math.min(this.prev, this.length);
717   - this.shownNext = Math.min(this.next, this.length);
718   - this.shownDatasets = this.filteredDatasets.slice(this.prev - 1, this.next);
719   - }
720   - $("#list_container").animate({ scrollTop: 0}, 0);
721   - },
722   -
723   - _stringToArray: function(obj) {
724   - obj = JSON.parse(obj);
725   - return Object.keys(obj).map(function(key) {
726   - return {
727   - name: key,
728   - value: obj[key]
729   - };
730   - });
  464 + _getLocalization : function(text){
  465 + return ln[text + "_" + ln["localization"]];
731 466 },
732 467  
733 468 _toArray: function(obj) {
... ... @@ -739,74 +474,16 @@
739 474 });
740 475 },
741 476  
742   - _selectDataUrl : function(){
  477 + _selectDataUrl : function(e){
743 478 this.async(function () {
744   - if(this.$.list.selectedItem) {
745   -
746   - var metas = JSON.parse(this.$.list.selectedItem.metas);
747   - var html = "<span style=\"color: #2196F3; font-weight: bold;\">" + this.$.list.selectedItem.resource_name + "</span><br><br>";
748   - /*font-weight: bold;*/
749   - /*line-height: 48px;*/
750   - for(var i in metas)
751   - html += "<b>" + i + ":</b> " + metas[i] + "<br>";
752   - this.$.info.innerHTML = html;
753   -
754   - this.dataUrl = this.$.list.selectedItem.url;
755   -// var url = this.$.list.selectedItem.url;
756   -
757   -// url = utility_getResourceUrl(url);
758   -
759   -// // Check if CKAN
760   -// var strDatasetPos = url.indexOf('/dataset/');
761   -// var strResourcePos = (strDatasetPos >= 0) ? url.indexOf('/resource/') : -1;
762   -// if (strDatasetPos >= 0 && strResourcePos > strDatasetPos) {
763   -// var urlSegment1 = url.substring(0, strDatasetPos);
764   -// var urlResourceEnd = url.indexOf('/', strResourcePos + 10);
765   -// var resourceId = url.substring(strResourcePos + 10, urlResourceEnd);
766   -// url = urlSegment1 + "/api/action/datastore_search?resource_id=" + resourceId;
767   -// }
768   -//
769   -// // Check if OPENDATASOFT
770   -// var strExploreDatasetPos = url.indexOf('/explore/dataset/');
771   -// if (strExploreDatasetPos >= 0) {
772   -// var urlSegment1 = url.substring(0, strExploreDatasetPos);
773   -// var datasetEnd = url.indexOf(strExploreDatasetPos + 17, '/');
774   -// var datasetId = url.substring(strExploreDatasetPos + 17, datasetEnd >= 0 ? datasetEnd : url.length);
775   -// url = urlSegment1 + '/api/records/1.0/search?dataset=' + datasetId;
776   -// }
777   -
778   -// this.dataUrl = this._addlimitUrl(url);
779   -// this.dataUrl = url;
780   - }
781   - else {
782   - this.dataUrl = "";
783   - this.$.info.innerHTML = "";
784   - }
  479 + this.dataUrl = e.detail.dataset.url;
785 480 }, 0);
786 481 },
787 482  
788   - _selectDataUrl_treeMap : function(e) {
789   -// this.dataUrl = this._addlimitUrl(e.detail.url);
790   - this.dataUrl = e.detail.url;
791   - },
792   -
793 483 _fireDataUrl : function(){
794   - this.fire('dataset-selection-controllet_data-url', {url: this.dataUrl});
  484 + this.fire('select-dataset-controllet_data-url', {url: this.dataUrl});
795 485 },
796 486  
797   -// _addlimitUrl : function(url){
798   -// //CKAN --> action no limit
799   -// if((url.indexOf("api/action") > -1) && !(url.indexOf("limit") > -1))
800   -// {
801   -// url += "&limit=99999";
802   -// }
803   -// //OpenDataSoft --> action no limit
804   -// if((url.indexOf("api/records") > -1) && !(url.indexOf("rows") > -1)){
805   -// url += "&rows=10000";
806   -// }
807   -// return url;
808   -// },
809   -
810 487 _resize : function(){
811 488 var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0) - 16;
812 489 h = h - 64 - 8; //height with page scroller
... ...
controllets/select-dataset-controllet/select-dataset-controllet_purelist.html deleted
1   -<link rel="import" href="../../bower_components/polymer/polymer.html">
2   -
3   -<link rel="import" href="../../bower_components/paper-tabs/paper-tabs.html">
4   -<link rel="import" href="../../bower_components/paper-tabs/paper-tab.html">
5   -
6   -<link rel="import" href="../../bower_components/neon-animation/neon-animation.html">
7   -<link rel="import" href="../../bower_components/neon-animation/neon-animatable.html">
8   -<link rel="import" href="../../bower_components/neon-animation/neon-animations.html">
9   -
10   -<link rel="import" href="../../bower_components/iron-flex-layout/iron-flex-layout.html">
11   -<!--<link rel="import" href="../../bower_components/app-layout/app-toolbar/app-toolbar.html">-->
12   -<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
13   -<link rel="import" href="../../bower_components/paper-styles/color.html">
14   -<link rel="import" href="../../bower_components/paper-styles/typography.html">
15   -<link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
16   -<link rel="import" href="../../bower_components/iron-icons/iron-icons.html">
17   -<link rel="import" href="../../bower_components/iron-image/iron-image.html">
18   -<link rel="import" href="../../bower_components/iron-list/iron-list.html">
19   -
20   -<link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
21   -<link rel="import" href="../../bower_components/paper-menu/paper-menu.html">
22   -<link rel="import" href="../../bower_components/paper-item/paper-item.html">
23   -
24   -<link rel="import" href="../../bower_components/paper-input/paper-input.html">
25   -
26   -<link rel="import" href="../../bower_components/paper-input/paper-textarea.html">
27   -
28   -<link rel="import" href="../../bower_components/paper-material/paper-material.html" />
29   -
30   -<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
31   -<link rel="import" href="../../bower_components/iron-icons/hardware-icons.html">
32   -<!--<link rel="import" href="../../bower_components/iron-icons/iron-icons.html">-->
33   -
34   -<link rel="import" href="../../bower_components/paper-checkbox/paper-checkbox.html">
35   -
36   -<link rel="import" href="../../datalets/datasetexplorer-datalet/datasetexplorer-datalet.html">
37   -
38   -<dom-module id="select-dataset-controllet">
39   - <template>
40   - <style>
41   - :host {
42   - --paper-dropdown-menu-icon: {
43   - color: #000000;
44   - };
45   - --paper-dropdown-menu-ripple: {
46   - color: #FFFFFF;
47   - };
48   - /*--paper-tab-ink: {*/
49   - /*color: #FFFFFF;*/
50   - /*};*/
51   - }
52   -
53   - iron-list {
54   - --iron-list-items-container: {
55   - margin:16px 16px 8px 16px;
56   - };
57   - }
58   -
59   - paper-textarea {
60   - width: 100%;
61   - --paper-input-container-focus-color: #2196F3;
62   - }
63   -
64   - paper-input {
65   - --paper-input-container-focus-color: #2196F3;
66   - }
67   - paper-dropdown-menu {
68   - width: 100%;
69   - --paper-input-container-focus-color: #2196F3;
70   - }
71   -
72   - paper-item.iron-selected {
73   - background-color: #2196F3;
74   - color: #FFFFFF;
75   - }
76   -
77   - paper-checkbox {
78   - height: 24px;
79   - /*margin-top: 8px*/
80   - --paper-checkbox-checked-color: #2196F3;
81   - --paper-checkbox-checked-ink-color: #FFFFFF;
82   - --paper-checkbox-unchecked-color: #000000;
83   - --paper-checkbox-unchecked-ink-color: #FFFFFF;
84   - --paper-checkbox-label-color: #000000;
85   - }
86   -
87   - paper-icon-button{
88   - height: 48px;
89   - width: 48px;
90   - padding: 0px;
91   - --paper-icon-button-ink-color: #FFFFFF;
92   - }
93   -
94   - paper-icon-button:hover{
95   - color: #2196F3;
96   - }
97   -
98   - paper-icon-button[disabled]{
99   - color: #B6B6B6;
100   - }
101   -
102   - paper-icon-button.clear {
103   - width: 24px;
104   - height: 24px;
105   - padding: 0px 4px;
106   - color: #F44336;
107   - --paper-icon-button-ink-color: #FFFFFF;
108   - }
109   -
110   - paper-tabs {
111   - font-weight: bold;
112   - }
113   -
114   - paper-tab {
115   - transition: all 1.0s;
116   - }
117   -
118   - paper-tab.iron-selected {
119   - background-color: #2196F3;
120   - color: #FFFFFF;
121   - }
122   -
123   - paper-tab:not(.iron-selected):hover {
124   - color: #2196F3;
125   - }
126   -
127   - .item {
128   - /*@apply(--layout-horizontal);*/
129   - display: flex;
130   - padding: 11px;
131   - border: 1px solid #B6B6B6;
132   - border-radius: 4px;
133   - cursor: pointer;
134   - margin-bottom: 8px;
135   - background-color: #E0E0E0;
136   - }
137   -
138   - .pad {
139   - @apply(--layout-flex);
140   - /*@apply(--layout-vertical);*/
141   - }
142   -
143   - .primary {
144   - font-weight: bold;
145   - }
146   -
147   - .item.expanded .primary {
148   - color: #2196F3;
149   - }
150   -
151   - .longText {
152   - display: none;
153   - }
154   -
155   - .item.expanded .longText {
156   - display: block;
157   - }
158   -
159   - #select_dataset_container {
160   - margin-top: 8px;
161   - }
162   -
163   - #select_dataset_container * {
164   - font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
165   - font-size: 16px;
166   - line-height: 24px;
167   - }
168   -
169   - #select_dataset_container #neon_container {
170   - height: calc(100% - 172px);
171   - width: calc(100% - 8px);
172   - }
173   -
174   - #select_dataset_container #list_container {
175   - /*height: calc(100% - 244px);*/
176   - /*width: calc(100% - 8px);*/
177   - height: calc(100% - 48px);
178   - width: 100%;
179   - border: 4px solid #B6B6B6;
180   - border-top: 0px;
181   - border-bottom: 0px;
182   - position: relative;
183   - }
184   -
185   - #select_dataset_container #treemap_container {
186   - /*height: calc(100% - 244px);*/
187   - /*width: calc(100% - 8px);*/
188   - height: calc(100% - 48px);
189   - width: 100%;
190   - border: 4px solid #B6B6B6;
191   - border-top: 0px;
192   - border-bottom: 0px;
193   - position: relative;
194   - }
195   -
196   - #select_dataset_container #header {
197   - position: relative;
198   - z-index: 1;
199   - -webkit-box-shadow: 0 30px 24px -12px rgba(0, 0, 0, 0.14), 0 20px 30px -9px rgba(0, 0, 0, 0.12), 0 20px 10px -19px rgba(0, 0, 0, 0.4);
200   - -moz-box-shadow: 0 30px 24px -12px rgba(0, 0, 0, 0.14), 0 20px 30px -9px rgba(0, 0, 0, 0.12), 0 20px 10px -19px rgba(0, 0, 0, 0.4);
201   - box-shadow: 0 30px 24px -12px rgba(0, 0, 0, 0.14), 0 20px 30px -9px rgba(0, 0, 0, 0.12), 0 20px 10px -19px rgba(0, 0, 0, 0.4);
202   -
203   - background-color: #B6B6B6;
204   - display: flex;
205   - padding: 0px 4px;
206   - }
207   -
208   - #select_dataset_container #footer_list {
209   - position: relative;
210   - z-index: 1;
211   - -webkit-box-shadow: 0 -30px 24px -12px rgba(0, 0, 0, 0.14), 0 -20px 30px -9px rgba(0, 0, 0, 0.12), 0 -20px 10px -19px rgba(0, 0, 0, 0.4);
212   - -moz-box-shadow: 0 -30px 24px -12px rgba(0, 0, 0, 0.14), 0 -20px 30px -9px rgba(0, 0, 0, 0.12), 0 -20px 10px -19px rgba(0, 0, 0, 0.4);
213   - box-shadow: 0 -30px 24px -12px rgba(0, 0, 0, 0.14), 0 -20px 30px -9px rgba(0, 0, 0, 0.12), 0 -20px 10px -19px rgba(0, 0, 0, 0.4);
214   - }
215   -
216   - .noshadow {
217   - -webkit-box-shadow: none !important;
218   - -moz-box-shadow: none !important;
219   - box-shadow: none !important;
220   - }
221   -
222   - #select_dataset_container #footer_list,
223   - #select_dataset_container #footer_treemap {
224   - width: 100%;
225   - background-color: #B6B6B6;
226   - display: flex;
227   - padding: 0px 4px;
228   - }
229   -
230   - #select_dataset_container #url {
231   - height: 76px;/*100*/
232   - border: 4px solid #B6B6B6;
233   - border-top: 0px;
234   - padding: 0px 16px;
235   - margin-top: -4px;
236   - }
237   -
238   - #header .header_block {
239   - width: 20%;
240   - height: 40px;
241   - padding: 4px 16px 4px 16px;
242   - }
243   -
244   - /*.header_block:nth-child(2), .header_block:nth-child(3), .header_block:nth-child(3), .header_block:nth-child(4){*/
245   - /*visibility: hidden;*/
246   - /*}*/
247   -
248   - #header .header_block:nth-child(4) {
249   - text-align: center;
250   - }
251   -
252   - .footer_block {
253   - width: calc((100% - 0px) / 3);
254   - height: 24px;
255   - padding: 12px 8px 12px 8px;
256   - text-align: center;
257   - }
258   -
259   - .footer_block:nth-child(2) {
260   - height: 48px;
261   - padding: 0px 8px;
262   - }
263   -
264   - #suggested_div {
265   - visibility: hidden;
266   - }
267   - </style>
268   -
269   - <paper-material id="select_dataset_container" elevation="5">
270   -
271   - <paper-tabs selected="{{selected}}" no-bar>
272   - <paper-tab noink on-tap="_refreshList"><span id="listView"></span></paper-tab>
273   - <!--<paper-tab noink ><span id="listView"></span></paper-tab>-->
274   - <paper-tab on-tap="_noShadow" noink><span id="treeMapView"></span></paper-tab>
275   - </paper-tabs>
276   -
277   - <div id="header">
278   - <div class="header_block">
279   - <paper-dropdown-menu id="ddl_provider" label="" no-label-float>
280   - <paper-menu class="dropdown-content" selected="0">
281   - <paper-item id="0" on-tap="_filter"></paper-item>
282   - <template is="dom-repeat" items={{_toArray(providers)}} as="provider">
283   - <!--<paper-item id={{provider.value.id}} style$="background: {{_getProviderColor(provider.value.id)}};">{{provider.value.title}}</paper-item>-->
284   - <paper-item id={{provider.value.id}} on-tap="_filter">{{provider.value.title}}</paper-item>
285   - </template>
286   - </paper-menu>
287   - </paper-dropdown-menu>
288   - </div>
289   - <div class="header_block">
290   - </div>
291   - <div class="header_block">
292   - </div>
293   - <div class="header_block">
294   - </div>
295   - <div class="header_block">
296   - <paper-input id="datasets_filter" value={{filter}} no-label-float label="">
297   - <iron-icon class="search" icon="search" prefix></iron-icon>
298   - <paper-icon-button class="clear" suffix on-click="_clearInput" icon="clear" tabindex="0"></paper-icon-button>
299   - </paper-input>
300   - </div>
301   - </div>
302   -
303   - <neon-animated-pages id="neon_container" selected="{{selected}}" entry-animation="fade-in-animation" exit-animation="fade-out-animation">
304   -
305   - <neon-animatable>
306   - <div id="list_container">
307   - <iron-list id="list" items="{{shownDatasets}}" selection-enabled><!--multi-selection-->
308   - <template>
309   - <div>
310   - <div class$="{{getClassForItem(selected)}}" on-tap="_selectDataUrl" style$="background: {{_getColorForItem(item)}};">
311   - <!--<div class$="{{getClassForItem(selected)}}" on-tap="_selectDataUrl">-->
312   - <span style="display:none;">{{item.url}}</span>
313   - <div class="pad">
314   - <div class="primary">{{item.resource_name}}</div>
315   - <!--<div class="shortText" style="display:none;">{{item.url}}</div>-->
316   - <div class="longText">
317   - <template is="dom-repeat" items="{{_stringToArray(item.metas)}}" as="mata">
318   - <b>{{mata.name}}:</b>
319   - <span inner-h-t-m-l="{{mata.value}}"></span> <br>
320   - </template>
321   - </div>
322   - </div>
323   - <!--<iron-icon icon$="[[iconForItem(item)]]"></iron-icon>-->
324   - <!--<iron-icon icon="bookmark" style$="color: {{_getColorForItem(item)}};"></iron-icon>-->
325   - <iron-icon icon$="{{_getIconForItem(item)}}" style$="color: {{_getColorForIcon(item)}};"></iron-icon>
326   - </div>
327   - </div>
328   - </template>
329   - </iron-list>
330   - </div>
331   -
332   - <div id="footer_list">
333   - <div class="footer_block"><span id="showing"></span> {{shownPrev}} <span id="to"></span> {{shownNext}} <span id="of"></span> {{length}} <span id="datasets"></span></div>
334   - <div class="footer_block">
335   - <paper-icon-button id="slider_chevron_left" class="chevron-left" on-click="_onPrevClick" icon="chevron-left"></paper-icon-button>
336   - <paper-icon-button id="slider_chevron_right" class="chevron-right" on-click="_onNextClick" icon="chevron-right"></paper-icon-button>
337   - </div>
338   - <div id="suggested_div" class="footer_block">
339   - <!--<template is="dom-if" if={{suggestedDatasets}}>-->
340   - <paper-checkbox checked on-change="showSuggested"><span id="suggested_datasets"></span></paper-checkbox>
341   - <!--</template>-->
342   - </div>
343   - </div>
344   - </neon-animatable>
345   -
346   - <neon-animatable>
347   - <div id="treemap_container"></div>
348   -
349   - <div id="footer_treemap">
350   - <div class="footer_block"><span id="showing2"></span> {{tLength}} <span id="datasets2"></span></div>
351   - <div class="footer_block"></div>
352   - <div class="footer_block"></div>
353   - </div>
354   - </neon-animatable>
355   -
356   - </neon-animated-pages>
357   -
358   - <div id="url">
359   - <paper-textarea id="selected_url" label="" value={{dataUrl}} error-message={{errorMessage}}></paper-textarea>
360   - </div>
361   -
362   - </paper-material>
363   -
364   - </template>
365   -
366   - <script>
367   - HTMLImports.whenReady(function() {
368   - Polymer({
369   - is: 'select-dataset-controllet',
370   - properties: {
371   - datasets: {
372   - type: Object,
373   - value: undefined
374   - },
375   - filteredDatasets : {
376   - type : Array,
377   - value : undefined
378   - },
379   - shownDatasets : {
380   - type : Array,
381   - value : undefined
382   - },
383   - suggestedDatasets : {
384   - type : Array,
385   - value : undefined
386   - },
387   -
388   - providers : {
389   - type : Array,
390   - value : undefined
391   - },
392   - dataUrl : {
393   - type : String,
394   - value : undefined,
395   - observer : '_fireDataUrl'
396   - },
397   - filter : {
398   - type : String,
399   - value : "",
400   - observer : '_filter'
401   - },
402   - selected : {
403   - type : Number,
404   - value : 0
405   - },
406   - prev : {type : Number, value : undefined},
407   - next : {type : Number, value : undefined},
408   - shownPrev : {type : Number, value : undefined},
409   - shownNext : {type : Number, value : undefined},
410   - length : {type : Number, value : undefined},
411   - tLength : {type : Number, computed : 'treemapLength(length)'},
412   - step : {type : Number, value : 20},
413   - colors : {
414   - type : Array,
415   - value : ["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"]
416   - }
417   - },
418   -
419   - listeners: {
420   - 'datasetexplorer-datalet_data-url': '_selectDataUrl_treeMap'
421   - },
422   -
423   - ready : function() {
424   - $(this.$.list_container).perfectScrollbar();
425   -
426   -// this.$.selected_url.invalid = true;
427   - },
428   -
429   - attached: function() {
430   - this._resize();
431   - var that = this;
432   - window.addEventListener("resize", function() { that._resize(); that._loadTreeMap();});
433   -
434   - this.providers = this.datasets["result"]["providers"];
435   - this.datasets = this.datasets["result"]["datasets"];
436   -
437   - if(this.suggestedDatasets) {
438   - this.tempDatasets = this.datasets;
439   - this.datasets = this.suggestedDatasets.concat(this.datasets);
440   - this.$.suggested_div.style.visibility = "visible";
441   - }
442   -
443   - this.filteredDatasets = this.datasets;
444   -
445   - this.prev = 1;
446   - this.next = this.step;
447   - this.length = this.filteredDatasets.length;
448   -
449   - this.shownPrev = Math.min(this.prev, this.length);
450   - this.shownNext = Math.min(this.next, this.length);
451   - this.shownDatasets = this.filteredDatasets.slice(this.prev-1, this.next);
452   -
453   - this.$.list.scrollTarget = this.ownerDocument.documentElement;
454   -
455   - this._translate();
456   -
457   - this._loadTreeMap();
458   - },
459   -
460   - _translate : function(){
461   - this.$.listView.innerHTML = ln["listView_" + ln["localization"]];
462   - this.$.treeMapView.innerHTML = ln["treeMapView_" + ln["localization"]];
463   -
464   - this.$.ddl_provider.setAttribute("label", ln["provider_" + ln["localization"]]);
465   - this.$.datasets_filter.setAttribute("label", ln["search_" + ln["localization"]]);
466   -
467   - this.$.suggested_datasets.innerHTML = ln["suggestedDatasets_" + ln["localization"]];
468   -
469   - this.$.showing.innerHTML = ln["showing_" + ln["localization"]];
470   - this.$.showing2.innerHTML = ln["showing_" + ln["localization"]];
471   - this.$.to.innerHTML = ln["to_" + ln["localization"]];
472   - this.$.of.innerHTML = ln["of_" + ln["localization"]];
473   - this.$.datasets.innerHTML = ln["datasets_" + ln["localization"]];
474   - this.$.datasets2.innerHTML = ln["datasets_" + ln["localization"]];
475   -
476   - this.$.selected_url.setAttribute("label", ln["selectedUrl_" + ln["localization"]]);
477   - this.errorMessage = ln["wrongUrl_" + ln["localization"]];
478   - },
479   -
480   - showSuggested : function(e) {
481   - if(e.target.checked)
482   - this.datasets = this.suggestedDatasets.concat(this.tempDatasets);
483   - else
484   - this.datasets = this.tempDatasets;
485   - this._filter();
486   - },
487   -
488   - _loadTreeMap : function(){
489   - var h = $("#neon_container").height() - 48;
490   - var w = $("#neon_container").width();
491   -
492   - var data = JSON.stringify({result : {providers: this.providers, datasets: this.filteredDatasets}}).replace(/'/g, "");
493   -
494   - if(this.filteredDatasets.length > 0)
495   - this.$.treemap_container.innerHTML = "<datasetexplorer-datalet data='"+data+"' width=\""+w+"\" height=\""+h+"\" fields='[\"result,datasets,provider_name\",\"result,datasets,organization_name\",\"result,datasets,package_name\",\"result,datasets,resource_name\",\"result,datasets,url\",\"result,datasets,w\",\"result,datasets,metas\"]'></datasetexplorer-datalet>";
496   - else
497   - this.$.treemap_container.innerHTML = "";
498   - },
499   -
500   - _filter : function() {
501   - if(this.filteredDatasets) {
502   - this.async(function () {
503   - var ddl_provider = $(this.$.ddl_provider).find("paper-menu")[0].selectedItem;
504   - var name = ddl_provider.innerHTML.trim();
505   - var id = this._getIdByProviderName(name);
506   - this.prev = 1;
507   - this.next = this.step;
508   - if (id) {
509   - //filtered by provider name
510   - this.filteredDatasets = this.datasets.filter(function (el) {
511   - return el.provider_name == "p:" + id;
512   - });
513   - }
514   - else {
515   - this.filteredDatasets = this.datasets;
516   - }
517   -
518   - //filtered by filter
519   - var filter = this.filter;
520   - this.filteredDatasets = this.filteredDatasets.filter(function (el) {
521   - return el.resource_name.toLowerCase().indexOf(filter.toLowerCase()) > -1;
522   - });
523   -
524   - this.length = this.filteredDatasets.length;
525   -
526   - this.shownPrev = Math.min(this.prev, this.length);
527   - this.shownNext = Math.min(this.next, this.length);
528   - this.shownDatasets = this.filteredDatasets.slice(this.prev - 1, this.next);
529   -
530   - $("#list_container").animate({scrollTop: 0}, 0);
531   -
532   - this._loadTreeMap();
533   - }, 0);
534   - }
535   - },
536   -
537   - _refreshList : function() {
538   - this.shownDatasets = this.filteredDatasets.slice(this.prev - 1, this.next);
539   - this.$.header.className = this.$.header.className.replace(" noshadow", "");
540   - },
541   -
542   - _noShadow : function() {
543   - console.log(this.$.header);
544   - this.$.header.className += " noshadow";
545   - },
546   -
547   - _clearInput : function() {
548   - this.$.datasets_filter.value = "";
549   - },
550   -
551   - _getIdByProviderName : function(name) {
552   - for(var id in this.providers) {
553   - if (this.providers[id].title == name)
554   - return this.providers[id].id;
555   - }
556   - },
557   -
558   -// iconForItem: function(item) {
559   -// return item ? (item.integer < 50 ? 'star-border' : 'info-outline') : '';
560   -// },
561   -
562   - treemapLength : function(length) {
563   - var ddl_provider = $(this.$.ddl_provider).find("paper-menu")[0].selectedItem;
564   - var name = ddl_provider.innerHTML.trim();
565   - var id = this._getIdByProviderName(name);
566   -
567   - if(this.suggestedDatasets && !id)
568   - return Math.max(length - this.suggestedDatasets.length, 0);
569   - return length;
570   - },
571   -
572   - _getColorForIcon : function(item) {
573   - var ddl_provider = $(this.$.ddl_provider).find("paper-menu")[0].selectedItem;
574   - var name = ddl_provider.innerHTML.trim();
575   - var id = this._getIdByProviderName(name);
576   - if (id) {
577   - return this.colors[0];
578   - }
579   - if(!item.provider_name) {
580   - return "#00BCD4";
581   - }
582   - var id = item.provider_name.substring(2, item.provider_name.length);
583   - var i = this.getProviderById(id) % this.colors.length;
584   - return this.colors[i];
585   - },
586   -
587   - _getColorForItem : function(item) {
588   -// var ddl_provider = $(this.$.ddl_provider).find("paper-menu")[0].selectedItem;
589   -// var name = ddl_provider.innerHTML.trim();
590   -// var id = this._getIdByProviderName(name);
591   -// if (id) {
592   -// return this.colors[0];
593   -// }
594   - if(!item.provider_name) {
595   - return "#FFEB3B";
596   - }
597   -// var id = item.provider_name.substring(2, item.provider_name.length);
598   -// var i = this.getProviderById(id) % this.colors.length;
599   -// return this.colors[i];
600   - },
601   -
602   - _getIconForItem : function(item) {
603   - return item.provider_name ? 'bookmark' : 'star';
604   - },
605   -
606   -// _getProviderColor: function(id) {
607   -// var i = this.getProviderById(id) % this.colors.length;
608   -// return this.colors[i];
609   -// },
610   -
611   - getClassForItem: function(selected) {
612   - return selected ? 'item expanded' : 'item';
613   - },
614   -
615   - getProviderById: function(providerId) {
616   - var i = 0;
617   - for(var id in this.providers){
618   - if(this.providers[id].id == providerId)
619   - return i;
620   - i++;
621   - }
622   - },
623   -
624   - _onPrevClick : function(){
625   - if(this.prev != 1) {
626   - this.prev -= this.step;
627   - this.next -= this.step;
628   -
629   - this.shownPrev = Math.min(this.prev, this.length);
630   - this.shownNext = Math.min(this.next, this.length);
631   - this.shownDatasets = this.filteredDatasets.slice(this.prev - 1, this.next);
632   - }
633   - $("#list_container").animate({ scrollTop: 0}, 0);
634   - },
635   -
636   - _onNextClick : function(){
637   - if(this.next < this.length) {
638   - this.prev += this.step;
639   - this.next += this.step;
640   -
641   - this.shownPrev = Math.min(this.prev, this.length);
642   - this.shownNext = Math.min(this.next, this.length);
643   - this.shownDatasets = this.filteredDatasets.slice(this.prev - 1, this.next);
644   - }
645   - $("#list_container").animate({ scrollTop: 0}, 0);
646   - },
647   -
648   - _stringToArray: function(obj) {
649   - obj = JSON.parse(obj);
650   - return Object.keys(obj).map(function(key) {
651   - return {
652   - name: key,
653   - value: obj[key]
654   - };
655   - });
656   - },
657   -
658   - _toArray: function(obj) {
659   - return Object.keys(obj).map(function(key) {
660   - return {
661   - name: key,
662   - value: obj[key]
663   - };
664   - });
665   - },
666   -
667   - _selectDataUrl : function(){
668   - this.async(function () {
669   - if(this.$.list.selectedItem) {
670   - var url = this.$.list.selectedItem.url;
671   -
672   - // Check if CKAN
673   - var strDatasetPos = url.indexOf('/dataset/');
674   - var strResourcePos = (strDatasetPos >= 0) ? url.indexOf('/resource/') : -1;
675   - if (strDatasetPos >= 0 && strResourcePos > strDatasetPos) {
676   - var urlSegment1 = url.substring(0, strDatasetPos);
677   - var urlResourceEnd = url.indexOf('/', strResourcePos + 10);
678   - var resourceId = url.substring(strResourcePos + 10, urlResourceEnd);
679   - url = urlSegment1 + "/api/action/datastore_search?resource_id=" + resourceId;
680   - }
681   -
682   - // Check if OPENDATASOFT
683   - var strExploreDatasetPos = url.indexOf('/explore/dataset/');
684   - if (strExploreDatasetPos >= 0) {
685   - var urlSegment1 = url.substring(0, strExploreDatasetPos);
686   - var datasetEnd = url.indexOf(strExploreDatasetPos + 17, '/');
687   - var datasetId = url.substring(strExploreDatasetPos + 17, datasetEnd >= 0 ? datasetEnd : url.length);
688   - url = urlSegment1 + '/api/records/1.0/search?dataset=' + datasetId;
689   - }
690   -
691   - this.dataUrl = this._addlimitUrl(url);
692   - }
693   - else {
694   - this.dataUrl = "";
695   - }
696   - }, 0);
697   - },
698   -
699   - _selectDataUrl_treeMap : function(e) {
700   - this.dataUrl = this._addlimitUrl(e.detail.url);
701   - },
702   -
703   - _fireDataUrl : function(){
704   - this.fire('dataset-selection-controllet_data-url', {url: this.dataUrl});
705   - },
706   -
707   - _addlimitUrl : function(url){
708   - //CKAN --> action no limit
709   - if((url.indexOf("api/action") > -1) && !(url.indexOf("limit") > -1))
710   - {
711   - url += "&limit=99999";
712   - }
713   - //OpenDataSoft --> action no limit
714   - if((url.indexOf("api/records") > -1) && !(url.indexOf("rows") > -1)){
715   - url += "&rows=10000";
716   - }
717   - return url;
718   - },
719   -
720   - _resize : function(){
721   - var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0) - 16;
722   - h = h - 64 - 8; //height with page scroller
723   - $("#select_dataset_container").height(h);
724   - }
725   - });
726   - });
727   - </script>
728   -</dom-module>
729 0 \ No newline at end of file
controllets/select-fields-controllet/select-fields-controllet.html
... ... @@ -45,8 +45,14 @@
45 45 paper-item {
46 46 cursor: pointer;
47 47 color: #000000;
  48 + background: #FFFFFF;
48 49 margin: 4px;
49   - padding: 0px 12px;
  50 + padding: 0 12px;
  51 + /*background: rgba(0, 0, 0, 0.12);*/
  52 + border-radius: 2px;
  53 + border: 1px solid #B6B6B6;
  54 +
  55 + /*background: #E0E0E0;*/
50 56 }
51 57  
52 58 paper-item span {
... ... @@ -72,7 +78,11 @@
72 78 }
73 79  
74 80 paper-item:hover:not(.iron-selected) {
75   - background-color: rgba(0, 0, 0, 0.12);
  81 + background-color: #BBDEFB;
  82 + }
  83 +
  84 + #menu, #menu_container {
  85 + background-color: #E0E0E0;
76 86 }
77 87  
78 88 </style>
... ...
controllets/select-marker-map-controllet/select-marker-map-controllet.html
1 1 <link rel="import" href="../../bower_components/polymer/polymer.html"/>
2 2 <link rel="import" href="../../bower_components/paper-material/paper-material.html"/>
3 3 <link rel="import" href="../../bower_components/paper-fab/paper-fab.html"/>
  4 +<link rel="import" href="../../bower_components/iron-icons/maps-icons.html">
4 5 <link rel="import" href="../../bower_components/iron-icons/iron-icons.html"/>
5 6 <link rel="import" href="../../bower_components/paper-dialog/paper-dialog.html"/>
6 7 <link rel="import" href="../../bower_components/neon-animation/neon-animation.html"/>
... ... @@ -48,6 +49,7 @@
48 49 </paper-dropdown-menu>
49 50  
50 51 <!--<paper-input id="shape_label" label="Shape label" maxlenght="30" value="{{label}}"></paper-input>-->
  52 + <paper-fab id="map_layer" class="cocreation_view_modes_button" mini icon="maps:satellite" on-click="_handleMapLayerClick" style="background-color:#B6B6B6"></paper-fab>
51 53  
52 54 </div>
53 55  
... ... @@ -139,7 +141,25 @@
139 141 label: {
140 142 type: String,
141 143 value: ""
  144 + },
  145 +
  146 + satLayer: {
  147 + type: Object,
  148 + value: new ol.layer.Tile({
  149 + title: 'Global Imagery',
  150 + visible: false,
  151 + source: new ol.source.BingMaps({
  152 + key : "AiAjdlCagGtE5269Z4YP3e3VtMkzzAKvowq5cQadahNZjVxttUxdDS40u91Uv8qP",
  153 + imagerySet: 'AerialWithLabels'
  154 + })
  155 + })
  156 + },
  157 +
  158 + layers: {
  159 + type : Array,
  160 + value : []
142 161 }
  162 +
143 163 },
144 164  
145 165 ready : function(){
... ... @@ -162,7 +182,7 @@
162 182 anchor: [0.5, 46],
163 183 anchorXUnits: 'fraction',
164 184 anchorYUnits: 'pixels',
165   - opacity: 0.75,
  185 + opacity: 0.9,
166 186 src: 'http://services.routetopa.eu/DEEalerProvider/COMPONENTS/datalets/leafletjs-datalet/leafletsjs/images/marker-icon.png'
167 187 }))
168 188 });
... ... @@ -176,7 +196,7 @@
176 196 source: this.source,
177 197 style: new ol.style.Style({
178 198 fill: new ol.style.Fill({
179   - color: 'rgba(255, 255, 255, 0.6)'
  199 + color: 'rgba(255, 255, 255, 1.0)'
180 200 }),
181 201 stroke: new ol.style.Stroke({
182 202 color: '#ffff00',
... ... @@ -201,8 +221,9 @@
201 221 loadTilesWhileAnimating: true,
202 222 loadTilesWhileInteracting: true,
203 223 layers: [baseLayer,
  224 + this.satLayer,
204 225 new ol.layer.Vector({
205   - source: this.vectorSource
  226 + source: this.vectorSource
206 227 }),
207 228 this.draw_layer
208 229 ]
... ... @@ -326,6 +347,11 @@
326 347 this.addInteraction();
327 348 },
328 349  
  350 + _handleMapLayerClick: function(e){
  351 + this.satLayer.setVisible(!this.satLayer.getVisible());
  352 +
  353 + },
  354 +
329 355 getTextStyle: function(offsetX) {
330 356 return new ol.style.Style({
331 357 fill: new ol.style.Fill({
... ...
controllets/select-visualization-controllet/select-datalet-inputs.html deleted
1   -<link rel="import" href="../../bower_components/polymer/polymer.html" />
2   -
3   -<link rel="import" href="../../bower_components/paper-material/paper-material.html" />
4   -
5   -<link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
6   -<link rel="import" href="../../bower_components/paper-menu/paper-menu.html">
7   -<link rel="import" href="../../bower_components/paper-item/paper-item.html">
8   -
9   -<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
10   -<link rel="import" href="../../bower_components/iron-icons/iron-icons.html">
11   -<link rel="import" href="../../bower_components/iron-icon/iron-icon.html">
12   -
13   -<dom-module id="select-datalet-inputs">
14   -
15   - <template>
16   -
17   - <style is="custom-style">
18   - :host {
19   - --paper-dropdown-menu-icon: {
20   - color: #2196F3;
21   - };
22   - }
23   -
24   - #inputs_container {
25   - font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
26   - font-size: 16px;
27   -
28   - height: 100%;
29   - width: 258px;
30   - }
31   -
32   - .inputs{
33   - position: relative;
34   - }
35   -
36   - .input_header {
37   - height: 32px;
38   - padding-top: 16px;
39   - text-align: center;
40   - font-weight: 700;
41   - background-color: #B6B6B6;
42   - }
43   -
44   - #expert_container {
45   - display: none;
46   - }
47   -
48   - #expert_header {
49   - height: 32px;
50   - padding-top: 16px;
51   - margin-top: 8px;
52   - text-align: center;
53   - font-weight: 700;
54   - color: #00BCD4;
55   - cursor: pointer;
56   -
57   - display: none;
58   - }
59   -
60   - .info_button {
61   - position: absolute;
62   - top: 18px;
63   - right: 0px;
64   - }
65   -
66   - paper-dropdown-menu {
67   - height: 48px;
68   - width: 210px;;
69   - padding-left: 8px;
70   - padding-bottom: 8px;
71   - --paper-input-container-focus-color: #2196F3;
72   - }
73   -
74   - paper-item.iron-selected {
75   - background-color: #2196F3;
76   - color: #FFFFFF;
77   - }
78   -
79   - paper-icon-button {
80   - color: #2196F3;
81   - --paper-icon-button-ink-color: #2196F3;
82   - margin: 0px;
83   - }
84   - </style>
85   -
86   - <paper-material id="inputs_container" elevation="5">
87   -
88   - <div class="input_header"><span id="inputs"></span></div>
89   -
90   - <template is="dom-repeat" items="{{inputs}}" index-as="ddl_index">
91   - <div class="inputs">
92   - <paper-dropdown-menu id={{ddl_index}} label={{_getLabelName(item.name)}}>
93   - <paper-menu class="dropdown-content">
94   - <template is="dom-repeat" items={{fields}}>
95   - <paper-item id={{index}} on-tap="_addInput">{{_fieldName(item)}}</paper-item>
96   - </template>
97   - </paper-menu>
98   - </paper-dropdown-menu>
99   - <div class="info_button">
100   - <paper-icon-button id="{{ddl_index}}" on-click="_setOrders" icon="unfold-more" title=""></paper-icon-button>
101   - </div>
102   - </div>
103   - </template>
104   -
105   - <div id="expert_header" on-click="_showExpertMode"><span id="groupBy"></span></div>
106   -
107   - <div id="expert_container">
108   -
109   - <div class="inputs">
110   - <paper-dropdown-menu id="group_by" disabled>
111   - <paper-menu class="dropdown-content">
112   - <template is="dom-repeat" items={{groupableFields}}>
113   - <paper-item id={{index}} on-tap="_setAggregatorsFields">{{_fieldName(item)}}</paper-item>
114   - </template>
115   - </paper-menu>
116   - </paper-dropdown-menu>
117   - </div>
118   -
119   - <template is="dom-repeat" items="{{aggregateFields}}" as="field">
120   - <div class="inputs">
121   - <paper-dropdown-menu id="calculate_{{index}}" label="{{_calculateLabel()}}">
122   - <paper-menu class="dropdown-content">
123   - <template is="dom-repeat" items="{{functions}}">
124   - <paper-item id={{index}} on-tap="_setAggregators">{{_operationName(index)}} : {{_fieldName(field)}}</paper-item>
125   - </template>
126   - </paper-menu>
127   - </paper-dropdown-menu>
128   - </div>
129   - </template>
130   -
131   - </div>
132   -
133   - </paper-material>
134   -
135   -
136   - </template>
137   -
138   - <script>
139   -
140   - Polymer({
141   -
142   - is : 'select-datalet-inputs',
143   -
144   - properties : {
145   -
146   - //INPUT
147   - fields : {type : Array, value : []},
148   -
149   - //OUTPUT
150   - selectedFields : {type : Array, value : []},
151   - aggregators : {type : Array, value : []},
152   - orders : {type : Array, value : []},
153   -
154   - expert : {
155   - type : Boolean,
156   - value : false
157   - },
158   -
159   - functions : {
160   - type : Array,
161   - value : ["COUNT", "SUM", "MIN", "MAX", "AVG", "FIRST", "LAST"]
162   - },
163   -
164   - inputs : {
165   - type : Array,
166   - value : []
167   - },
168   -
169   - groupableFields : {
170   - type : Array,
171   - value : []
172   - },
173   -
174   - aggregateFields : {
175   - type : Array,
176   - value : []
177   - }
178   -
179   - },
180   -
181   - ready : function() {
182   - $(this.$.inputs_container).perfectScrollbar();
183   - },
184   -
185   - attached : function() {
186   - this._translate();
187   - },
188   -
189   - _preselectInputs : function(fields, aggregators, orders) {
190   - aggregators = JSON.parse(aggregators);
191   - orders = JSON.parse(orders);
192   -
193   - this.selectedFields = this._copy(fields);
194   -
195   - var ddls = this.$.inputs_container.querySelectorAll("paper-dropdown-menu");
196   -
197   - for (var i = 0; i < fields.length; i++)
198   - $(ddls[i]).find("paper-menu")[0].select(i+1);
199   -
200   - if(orders.length > 0) {
201   - this.orders = this._copy(orders);//wrong
202   - }
203   -
204   - if(aggregators.length > 0) {
205   -
206   - this.$.group_by.removeAttribute("disabled");
207   - this._showExpertMode();
208   -
209   - var groupableFields = [];
210   - for (var i = 0; i < this.selectedFields.length; i++) {
211   - if(this.selectedFields[i])
212   - groupableFields.push(this.selectedFields[i]);
213   - }
214   - this.groupableFields = this._copy(groupableFields);
215   - this.aggregateFields = [];
216   -
217   - var index = this.groupableFields.indexOf(aggregators[0].field);
218   -
219   - this.async(function () {
220   - var menu = $(this.$.group_by).find("paper-menu")[0];
221   - menu.select(index);
222   - }, 0);
223   -
224   - var aggregateFields = [];
225   - for (var i = 0; i < this.groupableFields.length; i++) {
226   - if (i != index && this.groupableFields[i])
227   - aggregateFields.push(this.groupableFields[i]);
228   - }
229   - this.aggregateFields = this._copy(aggregateFields);
230   -
231   - this.async(function() {
232   - var ddls = document.getElementsByTagName("paper-dropdown-menu");
233   - var j = 1;
234   - for (var i = 0; i < ddls.length; i++){
235   - var id = ddls[i].id;
236   - if(id.indexOf("calculate") > -1) {
237   - var ii = this.functions.indexOf(aggregators[j].operation);
238   - j++;
239   - $(ddls[i]).find("paper-menu")[0].select(-1);
240   - $(ddls[i]).find("paper-menu")[0].select(ii);
241   - }
242   - }
243   -
244   -// this._setAggregators();
245   - this.aggregators = this._copy(aggregators);
246   -
247   - this.fireReady();
248   - }, 0);
249   - }
250   - else
251   - this.fireReady();
252   - },
253   -
254   - getSelectedFields : function () {
255   - return this.selectedFields.filter(function(field){ return field != "" });
256   - },
257   -
258   - getAggregators : function () {
259   - return this.aggregators;
260   - },
261   -
262   - getOrders : function () {
263   - return this.orders;
264   - },
265   -
266   - setFields : function(fields) {
267   - var temp = this._copy(fields);
268   - temp.unshift("");
269   -
270   - if (JSON.stringify(this.fields) != JSON.stringify(temp)) {
271   - this.fields = this._copy(temp);
272   - this.$.expert_header.style.display = "block";
273   - this._reset();
274   - }
275   - },
276   -
277   - setInputs : function(inputs) {
278   - var temp = this._copy(inputs);
279   - if (inputs.constructor != Array && inputs.name == "GEOJSON") {
280   - temp = [];
281   - temp.push(inputs);
282   - }
283   - else if (inputs.constructor != Array) {//table --> 1 input
284   - var name = inputs.name;
285   - var description = inputs.description;
286   - var selection = inputs.selection;
287   - temp = [];
288   - for (var i = 1; i < this.fields.length; i++)
289   - temp.push({name: name + " " + i, description: description, selection: selection});
290   - }
291   - else if (inputs.length > 2 && inputs[2].selection == "*") {//map --> multiple baloon content
292   - name = inputs[2].name;
293   - description = inputs[2].description;
294   - selection = inputs[2].selection;
295   - temp = [inputs[0], inputs[1]];
296   - temp.push({name: name + " 1", description: description, selection: selection});
297   - for (var i = 4; i < this.fields.length; i++)
298   - temp.push({name: name + " " +(i-2), description: description, selection: selection});
299   - }
300   -// else if (inputs.length > 4 && inputs[4].selection == "+") {//bubble --> multiple bubble content
301   -// name = inputs[4].name;
302   -// description = inputs[4].description;
303   -// selection = inputs[4].selection;
304   -// temp = [inputs[0], inputs[1], inputs[2], inputs[3]];
305   -// temp.push({name: name + " 1", description: description, selection: selection});
306   -// for (var i = 6; i < this.fields.length; i++)
307   -// temp.push({name: name + " " + (i-4), description: description, selection: selection});
308   -// }
309   -
310   - else if (inputs.length == 2 && inputs[1].selection == "*") {//
311   - name = inputs[1].name;
312   - description = inputs[1].description;
313   - selection = inputs[1].selection;
314   - temp = [inputs[0]];
315   - temp.push({name: name + " 1", description: description, selection: selection});
316   - for (var i = 3; i < this.fields.length; i++)
317   - temp.push({name: name + " " +(i-1), description: description, selection: selection});
318   - }
319   -
320   - else if (inputs.length == 3 && inputs[1].selection == "*") {//
321   - name = inputs[1].name;
322   - description = inputs[1].description;
323   - selection = inputs[1].selection;
324   - temp = [inputs[0]];
325   - temp.push({name: name + " 1", description: description, selection: selection});
326   - for (var i = 3; i < this.fields.length; i++)
327   - temp.push({name: name + " " +(i-1), description: description, selection: selection});
328   -
329   - temp.push(inputs[2]);
330   - }
331   -
332   - this.inputs = this._copy(temp);
333   -
334   - this.selectedFields = new Array(temp.length);
335   -
336   - this.selectedFields2 = new Array(temp.length);
337   - },
338   -
339   - fireReady : function() {
340   - if(this._isReady())
341   - this.fire('select_visualization_inputs_ready', {isReady: true});
342   - else
343   - this.fire('select_visualization_inputs_ready', {isReady: false});
344   - },
345   -
346   - _isReady : function() {
347   - var fire = true;
348   - for (var i = 0; i < this.selectedFields.length; i++) {
349   - if (!this.selectedFields[i] && this.inputs[i].selection != "+" && this.inputs[i].selection != "*" && this.inputs[i].selection != "?")
350   - return false;
351   - if(this.inputs[i].selection == "+")
352   - fire = false;
353   - }
354   -
355   - if(!fire) {
356   - for (var i = 0; i < this.selectedFields.length; i++) {
357   - if (this.selectedFields[i] && this.inputs[i].selection == "+") {
358   - fire = true;
359   - break;
360   - }
361   - }
362   - }
363   -
364   - return fire;
365   - },
366   -
367   - _reset : function() {
368   - //this.fields = []; --> setFields
369   - //this.inputs = []; --> setInputs
370   - this.selectedFields = [];
371   - this.aggregators = [];
372   - //this.orders = []; --> _resetOrders
373   - this._resetOrders();
374   - this.expert = true;
375   - this._showExpertMode();//expert --> false
376   - this.groupableFields = [];
377   - this.aggregateFields = [];
378   -
379   - this.async(function () {
380   - //reset ddl
381   - var ddls = this.$.inputs_container.getElementsByTagName("paper-dropdown-menu");
382   - for (var i = 0; i < ddls.length; i++)
383   - $(ddls[i]).find("paper-menu")[0].select(-1);
384   - this.$.group_by.setAttribute("disabled", "");
385   - //reset orders
386   - this._resetOrders();
387   - }, 1);
388   - },
389   -
390   - _translate : function(){
391   - this.$.inputs.innerHTML = ln["inputs_" + ln["localization"]];
392   - this.$.groupBy.innerHTML = ln["expertGroupBy_" + ln["localization"]];
393   -
394   - this.$.group_by.setAttribute("label", ln["groupBy_" + ln["localization"]]);
395   - },
396   -
397   - _showExpertMode : function() {
398   - if(!this.expert) {
399   - this.$.expert_header.style.color = "#000000";
400   - this.$.expert_header.style.background = "#B6B6B6";
401   - this.$.expert_container.style.display = "block";
402   - }
403   - else {
404   - this.$.expert_header.style.color = "#00BCD4";
405   - this.$.expert_header.style.background = "#FFFFFF";
406   - this.$.expert_container.style.display = "none";
407   - }
408   -
409   - this.expert = !this.expert;
410   - },
411   -
412   - getFields : function () {
413   - return this.selectedFields2;
414   - },
415   -
416   - _addInput : function(e){
417   - var selectedFields = this._copy(this.selectedFields);
418   -
419   - var ddl_index = $(e.target).parents("paper-dropdown-menu")[0].id;
420   -
421   - var index = e.target.id;
422   - selectedFields[ddl_index] = this.fields[index];
423   -
424   - this.selectedFields = this._copy(selectedFields);
425   -
426   -// console.log(this.inputs[ddl_index].name);
427   - this.selectedFields2[ddl_index] = {field: this.fields[index], input: this.inputs[ddl_index].name};
428   -
429   - if(!this._isReady()) {
430   - this.$.group_by.setAttribute("disabled", "");
431   -
432   - this.groupableFields = [];
433   - this.aggregateFields = [];
434   - }
435   - else {
436   - this.$.group_by.removeAttribute("disabled");
437   -
438   - var groupableFields = [];
439   - for (var i = 0; i < this.selectedFields.length; i++) {
440   - if(this.selectedFields[i])
441   - groupableFields.push(this.selectedFields[i]);
442   - }
443   - this.groupableFields = this._copy(groupableFields);
444   - this.aggregateFields = [];
445   -
446   - this.async(function () {
447   - var menu = $(this.$.group_by).find("paper-menu")[0];
448   - menu.select(-1);
449   - }, 0);
450   - }
451   - this._setAggregators();
452   - },
453   -
454   - _setAggregatorsFields : function(e){
455   - var index = e.target.id;
456   - var aggregateFields = [];
457   - for (var i = 0; i < this.groupableFields.length; i++) {
458   - if (i != index && this.groupableFields[i])
459   - aggregateFields.push(this.groupableFields[i]);
460   - }
461   - this.aggregateFields = this._copy(aggregateFields);
462   -
463   - this.async(function() {
464   - var ddls = document.getElementsByTagName("paper-dropdown-menu");
465   - for (var i = 0; i < ddls.length; i++){
466   - var id = ddls[i].id;
467   - if(id.indexOf("calculate") > -1) {
468   - $(ddls[i]).find("paper-menu")[0].select(-1);
469   - $(ddls[i]).find("paper-menu")[0].select(0);
470   - }
471   - }
472   -
473   - this._setAggregators();
474   - }, 0);
475   - },
476   -
477   - _setAggregators : function(){
478   - this.async(function() {
479   - this.aggregators = [];
480   -
481   - this._resetOrders();
482   -
483   - var gb_menu = $(this.$.group_by).find("paper-menu")[0];
484   - var groupByField = this.groupableFields[gb_menu.selected];
485   - if(groupByField) {
486   - this.aggregators.push({"field": groupByField, "operation": "GROUP BY"});
487   - for (var i = 0; i < this.aggregateFields.length; i++){
488   - var c_menu = $("#calculate_"+i).find("paper-menu")[0];
489   - var operationIndex = c_menu.selectedItem.id;
490   - this.aggregators.push({"field": this.aggregateFields[i], "operation": this.functions[operationIndex]})
491   - }
492   - }
493   -
494   - this.fireReady();
495   - }, 1);
496   - },
497   -
498   - _setOrders : function(e){
499   - var t = e.target;
500   - if(t.tagName.indexOf("IRON-ICON") > -1)
501   - t = $(e.target).parents("paper-icon-button")[0];
502   -
503   - var icon = t.getAttribute("icon");
504   - var id = t.getAttribute("id");
505   - var field = this.selectedFields[id];
506   -
507   - if(icon.indexOf("unfold-more") > -1){
508   - t.setAttribute("icon", "expand-less");
509   - t.setAttribute("title", ln["sortAscending_" + ln["localization"]]);
510   - var orders = this.orders.filter(function (el) { return el.field !== field; });
511   - orders.unshift({"field": field, "operation": "ASC"});
512   - this.orders = this._copy(orders);
513   - }
514   - else if(icon.indexOf("expand-less") > -1){
515   - t.setAttribute("icon", "expand-more");
516   - t.setAttribute("title", ln["sortDescending_" + ln["localization"]]);
517   - var orders = this.orders.filter(function (el) { return el.field !== field; });
518   - orders.unshift({"field": field, "operation": "DESC"});
519   - this.orders = this._copy(orders);
520   - }
521   - else if(icon.indexOf("expand-more") > -1){
522   - t.setAttribute("icon", "unfold-more");
523   - t.setAttribute("title", ln["unsort_" + ln["localization"]]);
524   - var orders = this.orders.filter(function (el) { return el.field !== field; });
525   - this.orders = this._copy(orders);
526   - }
527   -
528   - this.fireReady();
529   - },
530   -
531   - _resetOrders : function(){
532   - var icons = this.$.inputs_container.querySelectorAll("paper-icon-button");
533   - for (var i = 0; i < icons.length; i++){
534   - icons[i].setAttribute("icon", "unfold-more");
535   - icons[i].setAttribute("title", ln["unsort_" + ln["localization"]]);
536   - }
537   - this.orders = [];
538   - },
539   -
540   - _fieldName : function(field) {
541   - return field.substring(field.lastIndexOf(",")+1, field.length);
542   - },
543   -
544   - _getLabelName: function(key) {
545   - if(key.indexOf("Column") > -1) {
546   - return ln["Column" + "_" +ln["localization"]] + key.slice(-2);
547   - }
548   - if(key.indexOf("Level") > -1) {
549   - return ln["Level" + "_" +ln["localization"]] + key.slice(-2);
550   - }
551   - if(key.indexOf("BalloonContent") > -1) {
552   - return ln["BalloonContent" + "_" +ln["localization"]] + key.slice(-2);
553   - }
554   -// if(key.indexOf("BubbleContent") > -1) {
555   -// return ln["BubbleContent" + "_" +ln["localization"]] + key.slice(-2);
556   -// }
557   - if(key.indexOf("NumericYAxis") > -1) {
558   - return ln["NumericYAxis" + "_" +ln["localization"]] + key.slice(-2);
559   - }
560   -
561   - return ln[key + "_" +ln["localization"]];
562   - },
563   -
564   - _operationName: function(index) {
565   - var key = this.functions[index];
566   - return ln[key + "_" +ln["localization"]];
567   - },
568   -
569   - _calculateLabel: function() {
570   - return ln["calculate" + "_" +ln["localization"]];
571   - },
572   -
573   - _copy : function(o) {
574   - var out, v, key;
575   - out = Array.isArray(o) ? new Array(o.length) : {};
576   - for (key in o) {
577   - v = o[key];
578   - out[key] = (typeof v === "object") ? this._copy(v) : v;
579   - }
580   - return out;
581   - }
582   -
583   - });
584   -
585   - </script>
586   -
587   -</dom-module>
588 0 \ No newline at end of file
controllets/select-visualization-controllet/select-datalet-inputs_series.html deleted
1   -<link rel="import" href="../../bower_components/polymer/polymer.html" />
2   -
3   -<link rel="import" href="../../bower_components/paper-material/paper-material.html" />
4   -
5   -<link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
6   -<link rel="import" href="../../bower_components/paper-menu/paper-menu.html">
7   -<link rel="import" href="../../bower_components/paper-item/paper-item.html">
8   -
9   -<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
10   -<link rel="import" href="../../bower_components/iron-icons/iron-icons.html">
11   -<link rel="import" href="../../bower_components/iron-icon/iron-icon.html">
12   -
13   -<dom-module id="select-datalet-inputs_series">
14   -
15   - <template>
16   -
17   - <style is="custom-style">
18   - :host {
19   - --paper-dropdown-menu-icon: {
20   - color: #2196F3;
21   - };
22   - }
23   -
24   - #inputs_series_container {
25   - font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
26   - font-size: 16px;
27   -
28   - height: 100%;
29   - width: 258px;
30   - }
31   -
32   - .inputs{
33   - position: relative;
34   - }
35   -
36   - .input_header {
37   - height: 32px;
38   - padding-top: 16px;
39   - text-align: center;
40   - font-weight: 700;
41   - background-color: #B6B6B6;
42   - }
43   -
44   - #expert_container {
45   - display: none;
46   - }
47   -
48   - #expert_header {
49   - height: 32px;
50   - padding-top: 16px;
51   - margin-top: 8px;
52   - text-align: center;
53   - font-weight: 700;
54   - color: #00BCD4;
55   - cursor: pointer;
56   - }
57   -
58   - .info_button {
59   - position: absolute;
60   - top: 18px;
61   - right: 0px;
62   - }
63   -
64   - paper-dropdown-menu {
65   - height: 48px;
66   - width: 210px;;
67   - padding-left: 8px;
68   - padding-bottom: 8px;
69   - --paper-input-container-focus-color: #2196F3;
70   - }
71   -
72   - paper-item.iron-selected {
73   - background-color: #2196F3;
74   - color: #FFFFFF;
75   - }
76   -
77   - paper-icon-button {
78   - color: #2196F3;
79   - --paper-icon-button-ink-color: #2196F3;
80   - margin: 0px;
81   - }
82   - </style>
83   -
84   - <paper-material id="inputs_series_container" elevation="5">
85   -
86   - <div class="input_header"><span id="inputs"></span></div>
87   -
88   - <template is="dom-repeat" items="{{inputs}}" index-as="ddl_index">
89   - <div class="inputs">
90   - <paper-dropdown-menu id={{ddl_index}} label={{_getLabelName(item.name)}}>
91   - <paper-menu class="dropdown-content">
92   - <template is="dom-repeat" items={{fields}}>
93   - <paper-item id={{index}} on-tap="_addInput">{{_fieldName(item)}}</paper-item>
94   - </template>
95   - </paper-menu>
96   - </paper-dropdown-menu>
97   - <div class="info_button">
98   - <paper-icon-button id="{{ddl_index}}" on-click="_setOrders" icon="unfold-more" title=""></paper-icon-button>
99   - </div>
100   - </div>
101   - </template>
102   -
103   - <div id="expert_header" on-click="_showExpertMode"><span id="groupBy"></span></div>
104   -
105   - <div id="expert_container">
106   -
107   - <div class="inputs">
108   - <paper-dropdown-menu id="group_by" disabled>
109   - <paper-menu class="dropdown-content">
110   - <template is="dom-repeat" items={{groupableFields}}>
111   - <paper-item id={{index}} on-tap="_setAggregatorsFields">{{_fieldName(item)}}</paper-item>
112   - </template>
113   - </paper-menu>
114   - </paper-dropdown-menu>
115   - <div class="info_button">
116   - <paper-icon-button id="gb" on-click="_setOrders" icon="unfold-more" title="" disabled></paper-icon-button>
117   - </div>
118   - </div>
119   -
120   - <template is="dom-repeat" items="{{aggregateFields}}" as="field">
121   - <div class="inputs">
122   - <paper-dropdown-menu id="calculate_{{index}}" label="{{_calculateLabel()}}" disabled>
123   - <paper-menu class="dropdown-content">
124   - <template is="dom-repeat" items="{{functions}}">
125   - <paper-item id={{index}} on-tap="_setAggregators">{{_operationName(index)}} : {{_fieldName(field)}}</paper-item>
126   - </template>
127   - </paper-menu>
128   - </paper-dropdown-menu>
129   - </div>
130   - </template>
131   -
132   - </div>
133   -
134   - </paper-material>
135   -
136   -
137   - </template>
138   -
139   - <script>
140   -
141   - Polymer({
142   -
143   - is : 'select-datalet-inputs_series',
144   -
145   - properties : {
146   -
147   - //INPUT
148   - fields : {type : Array, value : []},
149   -
150   - //OUTPUT
151   - selectedFields : {type : Array, value : ["", ""]},
152   - aggregators : {type : Array, value : []},
153   - orders : {type : Array, value : []},
154   -
155   - expert : {
156   - type : Boolean,
157   - value : false
158   - },
159   -
160   - functions : {
161   - type : Array,
162   - value : ["COUNT", "SUM", "MIN", "MAX", "AVG", "FIRST", "LAST"]
163   - },
164   -
165   - inputs : {
166   - type : Array,
167   - value : []
168   - },
169   -
170   - groupableFields : {
171   - type : Array,
172   - value : []
173   - },
174   -
175   - aggregateFields : {
176   - type : Array,
177   - value : [""]
178   - }
179   -
180   - },
181   -
182   - ready : function() {
183   - $(this.$.inputs_series_container).perfectScrollbar();
184   - },
185   -
186   - attached : function() {
187   - this._translate();
188   - },
189   -
190   - _preselectInputs : function(fields, aggregators, orders) {
191   - aggregators = JSON.parse(aggregators);
192   - orders = JSON.parse(orders);
193   -
194   - //fields = [f1 gb(opt) f2] --> si può cambiare in f1 f2 gb ???
195   -
196   - this.selectedFields = this._copy(fields);
197   -
198   - var ddls = this.$.inputs_series_container.querySelectorAll("paper-dropdown-menu");
199   -
200   - $(ddls[0]).find("paper-menu")[0].select(1);
201   - $(ddls[1]).find("paper-menu")[0].select(2);
202   -
203   - if(orders.length > 0) {
204   - this.orders = this._copy(orders);//wrong
205   - }
206   -
207   - if(aggregators.length > 0) {
208   - if(fields.length == 2) {
209   - this.selectedFields = [fields[0], fields[1]];
210   -
211   - this.$.group_by.removeAttribute("disabled");
212   - $("#calculate_0")[0].removeAttribute("disabled");
213   - $("#gb")[0].removeAttribute("disabled");
214   - this._showExpertMode();
215   -
216   - var groupableFields = [];
217   - for (var i = 0; i < this.fields.length; i++) {
218   - if(this.fields[i] != this.selectedFields[1])
219   - groupableFields.push(this.fields[i]);
220   - }
221   - this.groupableFields = this._copy(groupableFields);
222   - this.aggregateFields = [this.selectedFields[1]];
223   -
224   - $(ddls[0]).find("paper-menu")[0].select(1);
225   - $(ddls[1]).find("paper-menu")[0].select(2);
226   -
227   - this.async(function () {
228   - var i = this.functions.indexOf(aggregators[1].operation);
229   -
230   - $(this.$.group_by).find("paper-menu")[0].select(1);
231   - $("#calculate_0").find("paper-menu")[0].select(i);
232   -
233   -// this._setAggregators();//if dont --> $("#gb")[0].removeAttribute("disabled");
234   - this.aggregators = this._copy(aggregators);
235   -
236   - this.fireReady();
237   - }, 0);
238   - }
239   - else/*if(fields.length == 3)*/ {
240   - this.selectedFields = [fields[0], fields[2]];
241   -
242   - this.$.group_by.removeAttribute("disabled");
243   - $("#calculate_0")[0].removeAttribute("disabled");
244   - $("#gb")[0].removeAttribute("disabled");
245   - this._showExpertMode();
246   -
247   - var groupableFields = [];
248   - for (var i = 0; i < this.fields.length; i++) {
249   - if(this.fields[i] != this.selectedFields[1])
250   - groupableFields.push(this.fields[i]);
251   - }
252   - this.groupableFields = this._copy(groupableFields);
253   - this.aggregateFields = [this.selectedFields[1]];
254   -
255   - $(ddls[0]).find("paper-menu")[0].select(1);
256   - $(ddls[1]).find("paper-menu")[0].select(3);
257   -
258   - this.async(function () {
259   - var i = this.functions.indexOf(aggregators[2].operation);
260   -
261   - $(this.$.group_by).find("paper-menu")[0].select(2);
262   - $("#calculate_0").find("paper-menu")[0].select(i);
263   -
264   -// this._setAggregators();//if dont --> $("#gb")[0].removeAttribute("disabled");
265   - this.aggregators = this._copy(aggregators);
266   -
267   - this.fireReady();
268   - }, 0);
269   - }
270   - }
271   - else
272   - this.fireReady();
273   - },
274   -
275   - getSelectedFields : function () {
276   - var gb_menu = $(this.$.group_by).find("paper-menu")[0];
277   - var c_menu = $("#calculate_0").find("paper-menu")[0];
278   -
279   - if(gb_menu.selectedItem && c_menu.selectedItem && gb_menu.selectedItem.id != 0) {
280   - var groupByField = this.groupableFields[gb_menu.selected];
281   - if (groupByField != this.selectedFields[0])
282   - return [this.selectedFields[0], groupByField, this.selectedFields[1]];
283   - }
284   - return this.selectedFields;
285   - },
286   -
287   - getAggregators : function () {
288   - return this.aggregators;
289   - },
290   -
291   - getOrders : function () {
292   - return this.orders;
293   - },
294   -
295   - setFields : function(fields) {
296   - var temp = this._copy(fields);
297   - temp.unshift("");
298   -
299   - if (JSON.stringify(this.fields) != JSON.stringify(temp)) {
300   - this.fields = this._copy(temp);
301   - this._reset();
302   - }
303   - },
304   -
305   - getFields : function () {
306   - return null;
307   - },
308   -
309   - setInputs : function(inputs) {
310   - this.inputs = this._copy(inputs);
311   - },
312   -
313   - fireReady : function() {
314   - if(this.selectedFields[0] != "" && this.selectedFields[1] != "")
315   - this.fire('select_visualization_inputs_ready', {isReady: true});
316   - else
317   - this.fire('select_visualization_inputs_ready', {isReady: false});
318   - },
319   -
320   - _reset : function() {
321   - //this.fields = []; --> setFields
322   - //this.inputs = []; --> setInputs
323   - this.selectedFields = ["", ""];
324   - this.aggregators = [];
325   - //this.orders = []; --> _resetOrders
326   - this.expert = true;
327   - this._showExpertMode();//expert --> false
328   - this.groupableFields = [];
329   - this.aggregateFields = [""];
330   -
331   - this.async(function () {
332   - //reset ddl
333   - var ddls = this.$.inputs_series_container.getElementsByTagName("paper-dropdown-menu");
334   - for (var i = 0; i < ddls.length; i++)
335   - $(ddls[i]).find("paper-menu")[0].select(-1);
336   - this.$.group_by.setAttribute("disabled", "");
337   - $("#calculate_0")[0].setAttribute("disabled", "");
338   - //reset orders
339   - this._resetOrders();
340   - }, 1);
341   - },
342   -
343   - _translate : function(){
344   - this.$.inputs.innerHTML = ln["inputs_" + ln["localization"]];
345   - this.$.groupBy.innerHTML = ln["expertGroupBy_" + ln["localization"]];
346   -
347   - this.$.group_by.setAttribute("label", ln["groupBy_" + ln["localization"]]);
348   - },
349   -
350   - _showExpertMode : function() {
351   - if(!this.expert) {
352   - this.$.expert_header.style.color = "#000000";
353   - this.$.expert_header.style.background = "#B6B6B6";
354   - this.$.expert_container.style.display = "block";
355   - }
356   - else {
357   - this.$.expert_header.style.color = "#00BCD4";
358   - this.$.expert_header.style.background = "#FFFFFF";
359   - this.$.expert_container.style.display = "none";
360   - }
361   -
362   - this.expert = !this.expert;
363   - },
364   -
365   - _addInput : function(e){
366   - var selectedFields = this._copy(this.selectedFields);
367   -
368   - var ddl_index = $(e.target).parents("paper-dropdown-menu")[0].id;
369   - var index = e.target.id;
370   - selectedFields[ddl_index] = this.fields[index];
371   -
372   - this.selectedFields = this._copy(selectedFields);
373   -
374   - if(this.selectedFields[0] == "" || this.selectedFields[1] == "") {
375   - this.$.group_by.setAttribute("disabled", "");
376   - $("#calculate_0")[0].setAttribute("disabled", "");
377   -
378   - this.groupableFields = [];
379   - this.aggregateFields = [""];
380   - var menu = $("#calculate_0").find("paper-menu")[0];
381   - menu.select(-1);
382   - }
383   - else {
384   - this.$.group_by.removeAttribute("disabled");
385   - $("#calculate_0")[0].removeAttribute("disabled");
386   -
387   - var groupableFields = [];
388   - for (var i = 0; i < this.fields.length; i++) {
389   - if(this.fields[i] != this.selectedFields[1])
390   - groupableFields.push(this.fields[i]);
391   - }
392   - this.groupableFields = this._copy(groupableFields);
393   - this.aggregateFields = [this.selectedFields[1]];
394   -
395   - this.async(function () {
396   - var menu = $(this.$.group_by).find("paper-menu")[0];
397   - menu.select(-1);
398   - var menu = $("#calculate_0").find("paper-menu")[0];
399   - //var selected = menu.selected;
400   - menu.select(-1);
401   - //menu.select(selected);
402   - }, 0);
403   - }
404   - this._setAggregators();
405   - },
406   -
407   - _setAggregatorsFields : function(){
408   - this.async(function() {
409   - var c_menu = $("#calculate_0").find("paper-menu")[0];
410   - var selected = c_menu.selected > 0 ? c_menu.selected : 0;
411   - c_menu.select(-1);
412   - c_menu.select(selected);
413   -
414   - this._setAggregators();
415   - }, 0);
416   - },
417   -
418   - _setAggregators : function(){
419   - this.async(function() {
420   - this.aggregators = [];
421   -
422   - this._resetOrders();
423   -
424   - $("#gb")[0].setAttribute("disabled", "");
425   -
426   - var gb_menu = $(this.$.group_by).find("paper-menu")[0];
427   - var c_menu = $("#calculate_0").find("paper-menu")[0];
428   -
429   - if(gb_menu.selectedItem && c_menu.selectedItem && gb_menu.selectedItem.id != 0) {
430   - var groupByField = this.groupableFields[gb_menu.selected];
431   - var operationIndex = c_menu.selectedItem.id;
432   -
433   - if (groupByField == this.selectedFields[0]){// X Axis field
434   - this.aggregators.push({"field": groupByField, "operation": "GROUP BY"});
435   - }
436   - else{
437   - $("#gb")[0].removeAttribute("disabled");
438   - this.aggregators.push({"field": this.selectedFields[0], "operation": "GROUP BY"});
439   - this.aggregators.push({"field": groupByField, "operation": "GROUP BY"});
440   - }
441   -
442   - this.aggregators.push({"field": this.selectedFields[1], "operation": this.functions[operationIndex]});
443   - }
444   -
445   - this.fireReady();
446   - }, 0);
447   - },
448   -
449   - _setOrders : function(e){
450   - var t = e.target;
451   - if(t.tagName.indexOf("IRON-ICON") > -1)
452   - t = $(e.target).parents("paper-icon-button")[0];
453   -
454   - var icon = t.getAttribute("icon");
455   - var id = t.getAttribute("id");
456   - var field;
457   -
458   - if(id == "gb"){
459   - var gb_menu = $(this.$.group_by).find("paper-menu")[0];
460   - field = this.groupableFields[gb_menu.selected];
461   - }
462   - else {
463   - field = this.selectedFields[id];
464   - }
465   -
466   - if(icon.indexOf("unfold-more") > -1){
467   - t.setAttribute("icon", "expand-less");
468   - t.setAttribute("title", ln["sortAscending_" + ln["localization"]]);
469   - var orders = this.orders.filter(function (el) { return el.field !== field; });
470   - orders.unshift({"field": field, "operation": "ASC"});
471   - this.orders = this._copy(orders);
472   - }
473   - else if(icon.indexOf("expand-less") > -1){
474   - t.setAttribute("icon", "expand-more");
475   - t.setAttribute("title", ln["sortDescending_" + ln["localization"]]);
476   - var orders = this.orders.filter(function (el) { return el.field !== field; });
477   - orders.unshift({"field": field, "operation": "DESC"});
478   - this.orders = this._copy(orders);
479   - }
480   - else if(icon.indexOf("expand-more") > -1){
481   - t.setAttribute("icon", "unfold-more");
482   - t.setAttribute("title", ln["unsort_" + ln["localization"]]);
483   - var orders = this.orders.filter(function (el) { return el.field !== field; });
484   - this.orders = this._copy(orders);
485   - }
486   -
487   - this.fireReady();
488   - },
489   -
490   - _resetOrders : function(){
491   - var icons = this.$.inputs_series_container.querySelectorAll("paper-icon-button");
492   - for (var i = 0; i < icons.length; i++){
493   - icons[i].setAttribute("icon", "unfold-more");
494   - icons[i].setAttribute("title", ln["unsort_" + ln["localization"]]);
495   - }
496   - this.orders = [];
497   - },
498   -
499   - _fieldName : function(field) {
500   - return field.substring(field.lastIndexOf(",")+1, field.length);
501   - },
502   -
503   - _getLabelName: function(key) {
504   - return ln[key + "_" +ln["localization"]];
505   - },
506   -
507   - _operationName: function(index) {
508   - var key = this.functions[index];
509   - return ln[key + "_" +ln["localization"]];
510   - },
511   -
512   - _calculateLabel: function() {
513   - return ln["calculate" + "_" +ln["localization"]];
514   - },
515   -
516   - _copy : function(o) {
517   - var out, v, key;
518   - out = Array.isArray(o) ? new Array(o.length) : {};
519   - for (key in o) {
520   - v = o[key];
521   - out[key] = (typeof v === "object") ? this._copy(v) : v;
522   - }
523   - return out;
524   - }
525   -
526   - });
527   -
528   - </script>
529   -
530   -</dom-module>
531 0 \ No newline at end of file
controllets/select-visualization-controllet/select-datalet-options.html deleted
1   -<link rel="import" href="../../bower_components/polymer/polymer.html" />
2   -
3   -<link rel="import" href="../../bower_components/paper-material/paper-material.html" />
4   -
5   -<link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
6   -<link rel="import" href="../../bower_components/paper-menu/paper-menu.html">
7   -<link rel="import" href="../../bower_components/paper-item/paper-item.html">
8   -
9   -<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
10   -<link rel="import" href="../../bower_components/iron-icons/iron-icons.html">
11   -<link rel="import" href="../../bower_components/iron-icon/iron-icon.html">
12   -
13   -<link rel="import" href="../../bower_components/paper-input/paper-textarea.html">
14   -<link rel="import" href="../../bower_components/paper-input/paper-input.html">
15   -
16   -<link rel="import" href="../../bower_components/paper-dialog/paper-dialog.html">
17   -
18   -<dom-module id="select-datalet-options">
19   -
20   - <template>
21   -
22   - <style is="custom-style">
23   - :host {
24   - --paper-dropdown-menu-icon: {
25   - color: #2196F3;
26   - };
27   - }
28   -
29   - #select_datalet_options_container {
30   - font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
31   - font-size: 16px;
32   -
33   - /*height: 100vh;*/
34   - height: 100%;
35   - width: 258px;
36   - }
37   -
38   - .inputs{
39   - position: relative;
40   - }
41   -
42   - .input_header {
43   - height: 32px;
44   - padding-top: 16px;
45   - text-align: center;
46   - font-weight: 700;
47   - background-color: #B6B6B6;
48   - }
49   -
50   - .info_button {
51   - position: absolute;
52   - top: 18px;
53   - right: 0px;
54   - }
55   -
56   - #dialog_info_input {
57   - display: flex;
58   - flex-direction: column;
59   - color: #000000;
60   - border: 2px solid #2196F3;
61   - background-color: #E0E0E0;
62   - min-width: 244px;
63   - padding: 8px;
64   - }
65   -
66   - #dialog_name{
67   - font-size: 24px;
68   - line-height: 24px;
69   - font-weight: 700;
70   - padding: 0px;
71   - margin: 0px;
72   - }
73   -
74   - #dialog_description{
75   -
76   - font-size: 16px;
77   - line-height: 16px;
78   - font-weight: normal;
79   - padding: 0px;
80   - margin: 8px 0px 0px 0px;
81   - }
82   -
83   - paper-dropdown-menu {
84   - height: 48px;
85   - width: 210px;;
86   - padding-left: 8px;
87   - padding-bottom: 8px;
88   - --paper-input-container-focus-color: #2196F3;
89   - }
90   -
91   - paper-item.iron-selected {
92   - background-color: #2196F3;
93   - color: #FFFFFF;
94   - }
95   -
96   - paper-icon-button {
97   - color: #2196F3;
98   - --paper-icon-button-ink-color: #2196F3;
99   - margin: 0px;
100   - }
101   -
102   - paper-input {
103   - display: inline-block;
104   - height: 48px;
105   - /*padding: 0px 8px;*/
106   - width: 210px;
107   - padding-left: 8px;
108   - padding-bottom: 8px;
109   - --paper-input-container-focus-color: #2196F3;
110   - }
111   -
112   - paper-input.base_input {
113   - width: 242px;
114   - }
115   -
116   - paper-textarea {
117   - width: 242px;
118   - padding-left: 8px;
119   - padding-bottom: 4px;
120   - --paper-input-container-focus-color: #2196F3;
121   - }
122   - </style>
123   -
124   - <paper-material id="select_datalet_options_container" elevation="5">
125   -
126   - <div class="input_header"><span id="baseInfo"></span></div>
127   -
128   - <div class="inputs">
129   - <paper-input id="base_title" maxlength="32" class="base_input" on-change="_updateParams" value=""></paper-input>
130   - </div>
131   -
132   - <div class="inputs">
133   - <paper-textarea id="base_description" maxlength="100" class="base_input" on-change="_updateParams" value=""></paper-textarea>
134   - </div>
135   -
136   - <div class="input_header"><span id="layouts"></span></div>
137   -
138   - <template is="dom-repeat" items={{options}} index-as="index">
139   - <div class="inputs">
140   - <template is="dom-if" if="{{_checkType(item.type, 'TEXT')}}">
141   - <paper-input label={{_getLabelName(item.name)}} on-change="_updateParams"></paper-input>
142   - </template>
143   -
144   - <template is="dom-if" if="{{_checkType(item.type, 'LIST')}}">
145   - <paper-dropdown-menu label={{_getLabelName(item.name)}}>
146   - <paper-menu class="dropdown-content" selected = 0>
147   - <!--<paper-item on-tap="_updateParams"></paper-item>-->
148   - <template is="dom-repeat" items={{item.list.item}}>
149   - <paper-item id={{index}} on-tap="_updateParams">{{item}}</paper-item>
150   - </template>
151   - </paper-menu>
152   - </paper-dropdown-menu>
153   - </template>
154   -
155   - <div class="info_button">
156   - <paper-icon-button id={{item.name}} on-click="_showInfo" icon="info-outline" title="{{_getLabelName(item.name)}} info"></paper-icon-button>
157   - </div>
158   - </div>
159   - </template>
160   -
161   - </paper-material>
162   -
163   - <paper-dialog id="dialog_info_input">
164   - <span id="dialog_name"></span>
165   - <span id="dialog_description"></span>
166   - </paper-dialog>
167   -
168   - </template>
169   -
170   - <script>
171   -
172   - Polymer({
173   -
174   - is : 'select-datalet-options',
175   -
176   - properties : {
177   -
178   - options : {
179   - type : Array,
180   - value : []
181   - },
182   -
183   - params : {
184   - type : Object,
185   - value : {}
186   - }
187   -
188   - },
189   -
190   - ready : function() {
191   - $(this.$.select_datalet_options_container).perfectScrollbar();
192   - },
193   -
194   - attached : function() {
195   - this._translate();
196   - },
197   -
198   - _preselectOptions : function(params) {
199   - var textarea = this.$.select_datalet_options_container.querySelectorAll("paper-textarea");
200   - textarea[0].value = params["description"];
201   -
202   - var inputs = this.$.select_datalet_options_container.querySelectorAll("paper-input");
203   - inputs[0].value = params["title"];
204   -
205   - for (var i = 1; i < inputs.length; i++)
206   - if(params[this.options[i - 1].name])
207   - inputs[i].value = params[this.options[i - 1].name];
208   -
209   - this._updateParams();
210   -
211   -// var menus = this.$.select_datalet_options_container.querySelectorAll("paper-menu");
212   -// var ddls = this.$.select_datalet_options_container.querySelectorAll("paper-dropdown-menu");
213   -// for (var i = 0; i < ddls.length; i++) {
214   -// var menu = $(ddls[i]).find("paper-menu")[0];
215   -// if(params[ddls[i].label])
216   -// menu.select(1);//select item con nome params[ddls[i].label]
217   -// }
218   - },
219   -
220   - setOptions : function(options) {
221   - this.options = [];
222   - this.params = [];
223   - this.async(function() {
224   - this.options = options;
225   - }, 0);
226   -
227   -// this.params["title"] = "";
228   -// this.params["description"] = "";
229   - },
230   -
231   - checkOptions : function(options) {
232   - if(options.length != this.options.length)
233   - this.setOptions(options);
234   - },
235   -
236   - getParams : function() {
237   - return this.params;
238   - },
239   -
240   - _reset : function() {
241   - this.options = [];
242   - this.params = [];
243   - },
244   -
245   - _updateParams : function() {
246   - this.async(function() {
247   - var textarea = this.$.select_datalet_options_container.querySelectorAll("paper-textarea");
248   - this.params["description"] = textarea[0].value;
249   -
250   - var inputs = this.$.select_datalet_options_container.querySelectorAll("paper-input");
251   - this.params["title"] = inputs[0].value;
252   -
253   - for (var i = 1; i < inputs.length; i++)
254   - this.params[this.options[i-1].name] = inputs[i].value;
255   -
256   - this.fire('select_visualization_options_changed');
257   - }, 0);
258   - },
259   -
260   - _translate : function(){
261   - this.$.baseInfo.innerHTML = ln["baseInfo_" + ln["localization"]];
262   - this.$.layouts.innerHTML = ln["layouts_" + ln["localization"]];
263   -
264   - this.$.base_title.label = ln["title_" + ln["localization"]];
265   - this.$.base_description.label = ln["description_" + ln["localization"]];
266   - },
267   -
268   - _checkType: function(type, check){
269   - return (type == check);
270   - },
271   -
272   - _getLabelName: function(key) {
273   - return ln[key + "_" +ln["localization"]];
274   - },
275   -
276   - _showInfo : function(e){
277   - var t = e.target;
278   - if(t.tagName.indexOf("IRON-ICON") != -1)
279   - t = $(e.target).parents("paper-icon-button")[0];
280   -
281   - var name = t.getAttribute("id");
282   -
283   - this.$.dialog_name.innerHTML = ln[name + "_" + ln["localization"]];
284   - this.$.dialog_description.innerHTML = ln[name + "_description_" + ln["localization"]];
285   - this.$.dialog_info_input.open();
286   -
287   - var pos = t.getBoundingClientRect();
288   - $("#dialog_info_input").css("top", pos.top - 4);
289   - $("#dialog_info_input").css("left", pos.left - 4);
290   - },
291   -
292   - });
293   -
294   - </script>
295   -
296   -</dom-module>
297 0 \ No newline at end of file
controllets/select-visualization-controllet/select-visualization-controllet_old.html deleted
1   -<link rel="import" href="../../bower_components/polymer/polymer.html" />
2   -
3   -<link rel="import" href="../../bower_components/paper-material/paper-material.html" />
4   -
5   -<link rel="import" href="../../bower_components/paper-button/paper-button.html">
6   -
7   -<link rel="import" href="../items-vslider-controllet/items-vslider-controllet.html" />
8   -<link rel="import" href="select-datalet-inputs_series.html" />
9   -<link rel="import" href="select-datalet-inputs.html" />
10   -<link rel="import" href="select-datalet-options.html" />
11   -
12   -<script src="../../../DEEPCLIENT/js/deepClient.js"></script>
13   -
14   -<dom-module id="select-visualization-controllet">
15   -
16   - <template>
17   -
18   - <style is="custom-style">
19   - #select_visualization_container {
20   - display: flex;
21   - font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
22   - font-size: 16px;
23   - margin-top: 8px;
24   - }
25   -
26   - #items_vslider_controllet {
27   - position: relative;
28   - min-width: 172px;
29   - }
30   -
31   - #datalet_selection_inputs {
32   - position: relative;
33   - margin-left: 32px;
34   - min-width: 258px;
35   - }
36   -
37   - #datalet_selection_options {
38   - position: relative;
39   - margin-left: 32px;
40   - min-width: 258px;
41   - }
42   -
43   - #datalet_preview_container {
44   - position: relative;
45   - width: 100%;
46   - margin-left: 32px;
47   - }
48   -
49   - #datalet_selection_datalet {
50   - position: relative;
51   - height: 100vh;
52   - width: 100%;
53   - }
54   -
55   - #datalet_selection_datalet_placeholder {
56   - padding: 16px;
57   - }
58   -
59   - .input_header {
60   - height: 32px;
61   - padding-top: 16px;
62   - text-align: center;
63   - font-weight: 700;
64   - background-color: #B6B6B6;
65   - }
66   -
67   - paper-button {
68   - position: absolute;
69   - bottom: 16px;
70   - right: 11px;
71   -
72   - height: 48px;
73   - width: 172px;
74   - background-color: #00BCD4;
75   - color: white;
76   - font-weight: 700;
77   - padding: 16px;
78   - }
79   -
80   - paper-button:hover {
81   - background-color: #00AABF;
82   -
83   - box-shadow: 0px 8px 12px #888;
84   - -webkit-box-shadow: 0px 8px 12px #888;
85   - -moz-box-shadow: 0px 8px 12px #888;
86   - }
87   -
88   - paper-button[disabled] {
89   - background-color: #B6B6B6;
90   - }
91   - </style>
92   -
93   - <iron-ajax id="selectedDatalet_request" on-response="_handleSelectedDatalet"></iron-ajax>
94   -
95   - <div id="select_visualization_container">
96   -
97   - <div id="items_vslider_controllet">
98   - <items-vslider-controllet id="vslider" datalets-list-url={{dataletsListUrl}} preselected-datalet={{preselectedDatalet}}></items-vslider-controllet>
99   - </div>
100   -
101   - <div id="datalet_selection_inputs">
102   - <template is="dom-if" if="{{_checkType(type, 'multiseries')}}">
103   - <select-datalet-inputs_series id="inputs_series"></select-datalet-inputs_series>
104   - </template>
105   - <template is="dom-if" if="{{_checkType(type, 'default')}}">
106   - <select-datalet-inputs id="inputs"></select-datalet-inputs>
107   - </template>
108   - <template is="dom-if" if="{{_checkType(type, '')}}">
109   - <select-datalet-inputs></select-datalet-inputs>
110   - </template>
111   - </div>
112   -
113   - <div id="datalet_selection_options">
114   - <select-datalet-options id="options"></select-datalet-options>
115   - </div>
116   -
117   - <div id="datalet_preview_container">
118   -
119   - <paper-material id="datalet_selection_datalet" elevation="5">
120   - <div class="input_header"><span id="dataletPreview"></span></div>
121   - <div id="datalet_selection_datalet_placeholder"></div>
122   - </paper-material>
123   -
124   - <paper-button id="add_button" disabled raised on-click="_addDatalet"></paper-button>
125   -
126   - </div>
127   -
128   - </div>
129   -
130   - </template>
131   -
132   - <script>
133   -
134   - Polymer({
135   -
136   - is : 'select-visualization-controllet',
137   -
138   - properties : {
139   -
140   - deepUrl : {
141   - type : String,
142   - value : undefined
143   - },
144   -
145   - dataletsListUrl : {
146   - type : String,
147   - value : undefined
148   - },
149   -
150   - selectedDatalet : {
151   - type : String,
152   - value : undefined
153   - },
154   -
155   - preselectedDatalet : {
156   - type : String,
157   - value : undefined
158   - },
159   -
160   - type : {
161   - type : String,
162   - value : ""
163   - },
164   -
165   - filters : {
166   - type : Array,
167   - value : []
168   - },
169   -
170   - fields : {
171   - type : Array,
172   - value : []
173   - },
174   -
175   - selectedFields : {
176   - type : Array,
177   - value : []
178   - },
179   -
180   - dataletPreset : {
181   - type : Object,
182   - value : []
183   - },
184   -
185   - dataUrl : {
186   - type : String,
187   - value : undefined
188   - },
189   -
190   - params:{
191   - type: Object,
192   - value: undefined
193   - },
194   -
195   - data : {
196   - type : Object,
197   - value : undefined
198   - },
199   -
200   - },
201   -
202   - listeners: {
203   -// 'select-fields-controllet_selected-fields': '_updateFields',
204   -// 'filters-controllet_filters': '_updateFilters',
205   - 'items-vslider-controllet_selected-datalet': '_selectDatalet',
206   - 'select_visualization_inputs_ready': '_loadDatalet',
207   - 'select_visualization_options_changed': '_tryLoadDatalet'
208   - },
209   -
210   - ready : function() {
211   - this._resize();
212   -
213   - $(this.$.datalet_selection_datalet).perfectScrollbar();
214   -
215   -// this.params = {'data-url' : this.dataUrl};//not here
216   - },
217   -
218   - attached : function() {
219   - this._resize();
220   - var that = this;
221   - window.addEventListener("resize", function() { that._resize(); });
222   -
223   - this._translate();
224   - },
225   -
226   - setFilters : function(filters) {
227   - this.filters = this._copy(filters);
228   - },
229   -
230   - setFields : function(fields) {
231   -// if (this.fields.length > 0 && JSON.stringify(this.fields) != JSON.stringify(fields))
232   -// this.init();
233   -
234   - this.fields = this._copy(fields);
235   -
236   - var inputs = this._getInputs();
237   - if (inputs)
238   - inputs.setFields(this.fields);
239   - },
240   -
241   - setData : function(data) {
242   - this.data = this._copy(data);
243   - },
244   -
245   - init : function() {
246   - this.$.vslider._reset();
247   - },
248   -
249   - show : function() {//show --> preselect
250   -// if(this.preselectedDatalet)
251   - if(this.dataletPreset)
252   - this._preselectDatalet();
253   -
254   -// if (this.$.datalet_selection_datalet_placeholder.innerHTML == "") {
255   -// var inputs = this._getInputs();
256   -// inputs.fireReady();
257   -// }
258   - },
259   -
260   - _translate : function(){
261   - if(this.preselectedDatalet)
262   - this.$.add_button.innerHTML = ln["modifyDatalet_" + ln["localization"]];
263   - else
264   - this.$.add_button.innerHTML = ln["addDatalet_" + ln["localization"]];
265   -
266   - this.$.dataletPreview.innerHTML = ln["dataletPreview_" + ln["localization"]];
267   - },
268   -
269   - _selectDatalet : function(e){
270   -
271   - this.$.add_button.setAttribute("disabled", "true");
272   -
273   - this.selectedDatalet = e.detail.datalet;
274   -
275   - this.$.datalet_selection_datalet_placeholder.innerHTML = "";
276   -
277   - if(!this.selectedDatalet){
278   - this.type = "";
279   - this.$.options.setOptions([]);
280   - }
281   - else{
282   - this.$.selectedDatalet_request.url = this.deepUrl + e.detail.datalet + "-datalet";
283   - this.$.selectedDatalet_request.generateRequest();
284   - }
285   - },
286   -
287   - _handleSelectedDatalet : function(e){
288   -
289   - if(this.type != e.detail.response.type) {
290   -
291   - this.type = e.detail.response.type;
292   -
293   - this.async(function () {
294   - var inputs = this._getInputs();
295   - inputs.setFields(this.fields);
296   - inputs.setInputs(e.detail.response.idm.inputs.input);// Cannot read property '0' of undefined
297   - }, 0);
298   -
299   - this.$.options.setOptions(e.detail.response.idm.inputs.layouts.input);
300   - }
301   - else {
302   - this.$.options.checkOptions(e.detail.response.idm.inputs.layouts.input);
303   - }
304   -
305   - this.async(function () {
306   - var inputs = this._getInputs();
307   - inputs.fireReady();
308   - }, 0);
309   -
310   -// this.async(function () {
311   -// if(this.preselectedDatalet)
312   -// this._preselectDatalet();
313   -// }, 1);
314   - },
315   -
316   - _preselectDatalet : function() {
317   - this.$.vslider._preselectDatalet();
318   -
319   - this.async(function () {
320   - this.$.options._preselectOptions(this.dataletPreset);
321   - }, 100);
322   -
323   - this.async(function () {
324   - var inputs = this._getInputs();
325   - inputs._preselectInputs(this.fields, this.dataletPreset["aggregators"], this.dataletPreset["orders"]);
326   - this.dataletPreset = undefined;
327   - }, 200);
328   - },
329   -
330   - _tryLoadDatalet : function(){
331   - var inputs = this._getInputs();
332   - inputs.fireReady();
333   - },
334   -
335   - _loadDatalet : function(e){
336   - if(!e.detail.isReady) {
337   - this.$.datalet_selection_datalet_placeholder.innerHTML = "";
338   - return;
339   - }
340   -
341   - var inputs = this._getInputs();
342   -
343   - this.selectedFields = inputs.getSelectedFields();
344   -
345   -// console.log(inputs.getFields());
346   -
347   - this.params = {'data-url' : this.dataUrl};//??????????????????
348   -// this.params = {};
349   -
350   - this.params["selectedfields"] = JSON.stringify(inputs.getFields());
351   -
352   - this.params["filters"] = JSON.stringify(this.filters);
353   - this.params["aggregators"] = JSON.stringify(inputs.getAggregators());
354   - this.params["orders"] = JSON.stringify(inputs.getOrders());
355   -
356   - this.params["export_menu"] = "0";
357   -
358   - var params = this.$.options.getParams();
359   - for (var key in params) { this.params[key] = params[key]; }
360   -
361   - //use cache
362   - var data = alasql_QUERY(this.data, this.selectedFields, null, inputs.getAggregators(), inputs.getOrders());
363   -
364   - var converter = new DataTypeConverter();
365   - var result = converter.inferJsonDataType(data, ["*"]);
366   - result = converter.cast(result);
367   - data = result.dataset;
368   -
369   - data = alasql_transformData(data, this.selectedFields, true);
370   -
371   - this.params["data"] = JSON.stringify(data).replace(/'/g, "&#39;");
372   - //
373   -
374   - var dataletParams ={
375   - component: this.selectedDatalet+"-datalet",
376   - fields: this.selectedFields,
377   - params: this.params,
378   - placeHolder: this.$.datalet_selection_datalet_placeholder,
379   - };
380   -
381   - ComponentService.deep_url = this.deepUrl;
382   - ComponentService.getComponent(dataletParams);
383   -
384   - this.$.add_button.removeAttribute("disabled");
385   - },
386   -
387   - _addDatalet : function(){
388   - delete this.params["export_menu"];
389   - delete this.params["data"];
390   -
391   - var data = {
392   - dataUrl: this.dataUrl,
393   - datalet: this.selectedDatalet+"-datalet",
394   - fields: this.selectedFields,
395   - params: this.params,
396   - staticData: JSON.stringify(this.$.datalet_selection_datalet_placeholder.children[1].behavior.data)
397   - }
398   -
399   - this.fire('data-sevc-controllet.dataletCreated', {data : data});
400   - },
401   -
402   - _checkType: function(type, check){
403   - if (type == "multiseries" || type == "")
404   - return (type == check);
405   - else if(check == "default")
406   - return true;
407   - return false;
408   - },
409   -
410   - _getInputs : function(){
411   - if(this.type == "multiseries")
412   - return this.$$("#inputs_series")
413   - return this.$$("#inputs");
414   - },
415   -
416   - _copy : function(o) {
417   - var out, v, key;
418   - out = Array.isArray(o) ? new Array(o.length) : {};
419   - for (key in o) {
420   - v = o[key];
421   - out[key] = (typeof v === "object") ? this._copy(v) : v;
422   - }
423   - return out;
424   - },
425   -
426   - _resize : function(){
427   - var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0) - 16;
428   - h = h - 64 - 8; //height with page scroller
429   -
430   - $("#items_vslider_controllet").height(h);//vslider controllet
431   - $("#datalet_selection_inputs").height(h);
432   - $("#datalet_selection_options").height(h);
433   -
434   - $("#datalet_selection_datalet").height(h);
435   - }
436   -
437   - });
438   -
439   - </script>
440   -
441   -</dom-module>
442 0 \ No newline at end of file
controllets/text-element-controllet/metadata-element-controllet.html
... ... @@ -31,6 +31,7 @@
31 31  
32 32 <link rel="import" href="../../bower_components/polymer/polymer.html">
33 33 <link rel="import" href="../../bower_components/paper-styles/color.html">
  34 +<link rel="import" href="../../bower_components/paper-input/paper-textarea.html">
34 35  
35 36 <!--
36 37 `text-element-controllet` is a text area with heading. It fires an event when the text value is modified. This event can be useful when you have to monitor many af this elements.
... ...
datalets/areachart-datalet/areachart-datalet.html
... ... @@ -62,6 +62,13 @@ Example:
62 62 * @method transformData
63 63 */
64 64 presentData: function(){
  65 + var min = 0;
  66 + for (var i in this.properties.series.value) {
  67 + min = Math.min(Math.min.apply(Math, this.properties.series.value[i].data), min);
  68 + }
  69 + if(min < 0)
  70 + min--;
  71 +
65 72 options = {
66 73 chart: {
67 74 type: 'area',
... ... @@ -77,7 +84,7 @@ Example:
77 84 }
78 85 },
79 86 yAxis: {
80   - min: 0,
  87 + min: min,
81 88 title: {
82 89 text: this._component.yAxisLabel,
83 90 }
... ...
datalets/barchart-datalet/barchart-datalet.html
... ... @@ -62,6 +62,13 @@ Example:
62 62 * @method transformData
63 63 */
64 64 presentData: function(){
  65 + var min = 0;
  66 + for (var i in this.properties.series.value) {
  67 + min = Math.min(Math.min.apply(Math, this.properties.series.value[i].data), min);
  68 + }
  69 + if(min < 0)
  70 + min--;
  71 +
65 72 options = {
66 73 chart: {
67 74 type: 'bar',
... ... @@ -77,7 +84,7 @@ Example:
77 84 }
78 85 },
79 86 yAxis: {
80   - min: 0,
  87 + min: min,
81 88 title: {
82 89 text: this._component.yAxisLabel,
83 90 }
... ...
datalets/base-ajax-json-alasql-datalet/static/js/AjaxJsonAlasqlBehavior.js
... ... @@ -100,22 +100,27 @@ var AjaxJsonAlasqlBehavior = {
100 100 var aggregators = JSON.parse(this._component.getAttribute("aggregators"));
101 101 var orders = JSON.parse(this._component.getAttribute("orders"));
102 102  
103   - this._component.fields = JSON.parse(this._component.fields); /*deprecated*/
104   - if(selectedFields) { /*if deprecated*/
105   - this._component.fields = []; /*deprecated*/
106   - for (var i=0; i < selectedFields.length; i++)
107   - if (selectedFields[i])
108   - this._component.fields.push(selectedFields[i].value);
109   - }
110   -
111   - var fields = this._component.fields;
112   -
113   - //preview my space ?
114   - if(filters && filters[0] && filters[0].constructor == Array){
115   - filters = filters[0];
116   - aggregators = aggregators[0];
117   - orders = orders[0];
118   - }
  103 + //this._component.fields = JSON.parse(this._component.fields); /*deprecated*/
  104 + //if(selectedFields) { /*if deprecated*/
  105 + // this._component.fields = []; /*deprecated*/
  106 + // for (var i=0; i < selectedFields.length; i++)
  107 + // if (selectedFields[i])
  108 + // this._component.fields.push(selectedFields[i].value);
  109 + //}
  110 + //
  111 + //var fields = this._component.fields;
  112 +
  113 + fields = [];
  114 + for (var i=0; i < selectedFields.length; i++)
  115 + if (selectedFields[i])
  116 + fields.push(selectedFields[i].value);
  117 +
  118 + ////preview my space ?
  119 + //if(filters && filters[0] && filters[0].constructor == Array){
  120 + // filters = filters[0];
  121 + // aggregators = aggregators[0];
  122 + // orders = orders[0];
  123 + //}
119 124  
120 125 var converter = new DataTypeConverter();
121 126 var data = [];
... ...
datalets/base-datalet/base-datalet.html
... ... @@ -170,7 +170,7 @@ Example :
170 170 </div>
171 171  
172 172 <div id="base_datalet_source_link">
173   - <b>Source:</b> <a id="base_datalet_source" target="_blank"></a> (<a id="base_datalet_link" target="_blank">dataset</a>)
  173 + <b>Source:</b> <a id="base_datalet_source" target="_blank"></a> <a id="base_datalet_link" target="_blank">(dataset)</a>
174 174 </div>
175 175  
176 176 <div id="base_datalet_rtp">
... ... @@ -248,6 +248,10 @@ Example :
248 248 }
249 249 });
250 250 }
  251 + else
  252 + {
  253 + this.$.base_datalet_link.style.display = 'none';
  254 + }
251 255 }
252 256  
253 257 else {
... ... @@ -272,6 +276,7 @@ Example :
272 276 this.$.base_datalet_container.innerHTML = "";
273 277 this.$.base_datalet_container.style.margin = 0;
274 278 this.$.base_datalet_container.style.border = 0;
  279 + this.removeLoader();
275 280 },
276 281  
277 282 setExportMenu: function()
... ... @@ -321,12 +326,11 @@ Example :
321 326 '\<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"\>\<\/script\>\n' +
322 327 '<!-- REMOVE THE PREVIOUS SCRIPT TAGS IF YOUR PAGE ALREADY USES JQUERY AND POLYFILL LIBRARIES -->\n';
323 328  
324   - var dataletLink = '<link rel="import" href="http://deep.routetopa.eu/COMPONENTS/datalets/'+parent.is+'/'+parent.is+'.html" /> \n';
  329 + var dataletLink = '<link rel="import" href="http://deep.routetopa.eu/deep_1_7/COMPONENTS/datalets/'+parent.is+'/'+parent.is+'.html" /> \n';
325 330  
326 331 window.prompt("Copy to clipboard: Ctrl+C, Enter", dataletImport+dataletLink+html);
327 332 },
328 333  
329   -
330 334 exportToIMG: function () {
331 335 var parent = this.parentElement;
332 336 while(!parent.hasAttribute("data-url"))
... ...
datalets/base-datalet/static/js/WorkcycleBehavior.js
... ... @@ -102,7 +102,7 @@ var WorkcycleBehavior = {
102 102 that.presentData();
103 103 $(that._component).find("base-datalet")[0].removeLoader();
104 104 that.redraw();
105   - }, 300);
  105 + }, 600);
106 106 },
107 107  
108 108 /**
... ...
datalets/columnchart-datalet/columnchart-datalet.html
... ... @@ -63,6 +63,13 @@ Example:
63 63 * @method transformData
64 64 */
65 65 presentData: function(){
  66 + var min = 0;
  67 + for (var i in this.properties.series.value) {
  68 + min = Math.min(Math.min.apply(Math, this.properties.series.value[i].data), min);
  69 + }
  70 + if(min < 0)
  71 + min--;
  72 +
66 73 options = {
67 74 chart: {
68 75 type: 'column',
... ... @@ -78,7 +85,7 @@ Example:
78 85 }
79 86 },
80 87 yAxis: {
81   - min: 0,
  88 + min: min,
82 89 title: {
83 90 text: this._component.yAxisLabel,
84 91 }
... ...
datalets/datasetexplorer-datalet/datasetexplorer-datalet.html
... ... @@ -67,7 +67,8 @@ Example:
67 67 width: 100%;
68 68 height: 70%;
69 69 /*min-height: 500px;*/
70   - background: #ffffff;
  70 + /*background: #ffffff;*/
  71 + background: transparent;
71 72 position: relative;
72 73 }
73 74  
... ... @@ -115,6 +116,10 @@ Example:
115 116 fill: #bbb;
116 117 }
117 118  
  119 + :host ::content iframe.iframe {
  120 + border: 0 !important;
  121 + }
  122 +
118 123 /*:host ::content .children svg.foreignObject {*/
119 124 /*font: 9px sans-serif;*/
120 125 /*text-overflow: ellipsis;*/
... ... @@ -206,7 +211,7 @@ Example:
206 211 var xyz = function(url) {
207 212 me.selectResource(url);
208 213 }
209   - this.map.name = this._component.name;
  214 + this.map.name = datasetexplorer_ln["path_" + datasetexplorer_ln["ln"]];
210 215 build2(this.map, this.meta, this._component.$.treemap_placeholder, xyz, this._component.width, this._component.height);
211 216 },
212 217  
... ...
datalets/datasetexplorer-datalet/js/buildtreemap2.js
... ... @@ -249,7 +249,7 @@ function build2(root, meta, place_holder, select_listener, width, height) {
249 249 .attr("width", root.dx)
250 250 .attr("height", root.dy - root.y)
251 251 .append("xhtml:body")
252   - .html('<iframe src="'+pageurl+'" width="'+root.dx+'" height="'+root.dy+'"></iframe>');
  252 + .html('<iframe class="iframe" src="'+pageurl+'" width="'+root.dx+'" height="'+root.dy+'"></iframe>');
253 253 }
254 254  
255 255 return g;
... ...
datalets/graph-datalet/graph-clustering-datalet.html
... ... @@ -471,9 +471,9 @@ Example:
471 471  
472 472  
473 473 _this.gnodes.attr("cx", function (t) {
474   - return t.x = Math.max(25, Math.min(_this.width - 50, t.x))
  474 + return t.x = Math.max(25, Math.min(_this.width, t.x))
475 475 }).attr("cy", function (t) {
476   - return t.y = Math.max(8, Math.min(600, t.y))
  476 + return t.y = Math.max(8, Math.min(_this.height, t.y))
477 477 });
478 478  
479 479 _this.glinks.attr("x1", function (t) {
... ...
datalets/graph-datalet/graph-datalet.html
... ... @@ -270,7 +270,7 @@ Example:
270 270 },
271 271  
272 272 tick : function () {
273   - if(_this.gnodes != undefined && _this.graph.nodes.length > 0)
  273 + if(_this.gnodes != undefined && _this.graph.nodes != undefined && _this.graph.nodes.length > 0)
274 274 {
275 275 d3.selectAll("g foreignObject").attr("x", function (t) {
276 276 return t.x + (t.r ? 0.8 * t.r : 15)
... ... @@ -286,7 +286,7 @@ Example:
286 286  
287 287  
288 288 _this.gnodes.attr("cx", function (t) {
289   - return t.x = Math.max(25, Math.min(_this.width - 50, t.x))
  289 + return t.x = Math.max(25, Math.min(_this.width, t.x))
290 290 }).attr("cy", function (t) {
291 291 return t.y = Math.max(8, Math.min(_this.height, t.y))
292 292 });
... ...
datalets/graph-datalet/graph-with-clustering-datalet.html
... ... @@ -461,7 +461,7 @@ Example:
461 461 });
462 462  
463 463 _this.svgNodes.attr("cx", function (t) {
464   - return t.x = Math.max(25, Math.min(_this.width - 50, t.x))
  464 + return t.x = Math.max(25, Math.min(_this.width, t.x))
465 465 }).attr("cy", function (t) {
466 466 return t.y = Math.max(8, Math.min(_this.height, t.y))
467 467 });
... ...
datalets/graph-datalet/graph-with-clustering-extend-datalet.html
... ... @@ -493,9 +493,9 @@ Example:
493 493 });
494 494  
495 495 _this.svgNodes.attr("cx", function (t) {
496   - return t.x = Math.max(25, Math.min(_this.width - 50, t.x))
  496 + return t.x = Math.max(25, Math.min(_this.width, t.x))
497 497 }).attr("cy", function (t) {
498   - return t.y = Math.max(8, Math.min(600, t.y))
  498 + return t.y = Math.max(8, Math.min(_this.height, t.y))
499 499 });
500 500  
501 501 _this.svgLinks.attr("x1", function (t) {
... ...
datalets/leafletjs-datalet/demo/index.html
... ... @@ -13,8 +13,8 @@
13 13 <script src="https://code.jquery.com/jquery-2.1.4.min.js" type="text/javascript"></script>
14 14 <link rel="import" href="../leafletjs-datalet.html" />
15 15  
16   -<leafletjs-datalet data-url="http://ckan.routetopa.eu/api/action/datastore_search?resource_id=73e02092-85a1-434e-85fe-0c9a43aa9a52&amp;limit=10000"
17   - fields='["result,records,Lat","result,records,Lng", "result,records,Link"]'></leafletjs-datalet>
  16 +<leafletjs-datalet data-url="http://ckan.routetopa.eu/api/action/datastore_search?resource_id=73e02092-85a1-434e-85fe-0c9a43aa9a52&amp;limit=99999" selectedfields="[{&quot;field&quot;:&quot;Latitude&quot;,&quot;value&quot;:&quot;Lat&quot;,&quot;index&quot;:1},{&quot;field&quot;:&quot;Longitude&quot;,&quot;value&quot;:&quot;Lng&quot;,&quot;index&quot;:2},{&quot;field&quot;:&quot;BalloonContent&quot;,&quot;value&quot;:&quot;Link&quot;,&quot;index&quot;:3}]" filters="[]" aggregators="[]" orders="[]" data="" fields="[&quot;Lat&quot;,&quot;Lng&quot;,&quot;Link&quot;]">
  17 + </leafletjs-datalet>
18 18  
19 19  
20 20 </body>
... ...
datalets/leafletjs-datalet/leafletjs-datalet.html
... ... @@ -91,6 +91,7 @@ Example:
91 91 var coordinates = [];
92 92 var coordinates_index = 0;
93 93 var isArray = t.data[0].data[0].constructor === Array;
  94 + var geo;
94 95  
95 96 for(var i=0; i<t.data[0].data.length; i++)
96 97 {
... ... @@ -101,25 +102,34 @@ Example:
101 102 else
102 103 continue;
103 104 }
  105 + else if(typeof t.data[0].data[i] == 'string' && t.data[0].data[i].startsWith('{"type":"'))
  106 + {
  107 + try
  108 + {
  109 + t.data[0].data[i] = JSON.parse(t.data[0].data[i]);
  110 + geo = L.geoJson(t.data[0].data[i]).addTo(t._component.map);
  111 + }catch(e) {continue;}
  112 + }
104 113 else if(typeof t.data[0].data[i] == 'string' && t.data[0].data[i].indexOf(","))
105 114 {
106 115 var coords = t.data[0].data[i].split(",");
107   - if(!isNaN(coords[0]) && !isNaN(coords[1]))
  116 + if(!isNaN(coords[0]) && !isNaN(coords[1])) {
108 117 coordinates.push([parseFloat(coords[0]), parseFloat(coords[1])]);
109   - else
  118 + geo = L.marker([coordinates[coordinates_index][0], coordinates[coordinates_index][1]]).addTo(t._component.map);
  119 + coordinates_index++;
  120 + }else
110 121 continue;
111 122 }
112 123 else
113 124 {
114   - if(!isNaN(t.data[0].data[i]) && !isNaN(t.data[1].data[i]))
  125 + if(!isNaN(t.data[0].data[i]) && !isNaN(t.data[1].data[i])) {
115 126 coordinates.push([parseFloat(t.data[0].data[i]), parseFloat(t.data[1].data[i])]);
116   - else
  127 + geo = L.marker([coordinates[coordinates_index][0], coordinates[coordinates_index][1]]).addTo(t._component.map);
  128 + coordinates_index++;
  129 + }else
117 130 continue;
118 131 }
119 132  
120   - var marker = L.marker([coordinates[coordinates_index][0], coordinates[coordinates_index][1]]).addTo(t._component.map);
121   - coordinates_index++;
122   -
123 133 if(t.data.length > 2)
124 134 {
125 135 var popupText = "";
... ... @@ -135,7 +145,7 @@ Example:
135 145 }
136 146  
137 147 var popup = L.popup().setContent(popupText);
138   - marker.bindPopup(popup);
  148 + geo.bindPopup(popup);
139 149 }
140 150 }
141 151  
... ...
datalets/leafletjs-geojson-datalet/leafletjs-geojson-datalet.html
... ... @@ -89,23 +89,53 @@ Example:
89 89  
90 90 L.Icon.Default.imagePath = 'http://services.routetopa.eu/DEEalerProvider/COMPONENTS/datalets/leafletjs-datalet/leafletsjs/images';
91 91  
92   - var bounding_box = L.geoJson(t.data[0].data);
  92 + //var coordinates = [];
  93 + //var coordinates_index = 0;
  94 + var geo_layer = L.geoJson();
  95 + var geo;
93 96  
94 97 for (var i = 0; i < t.data[0].data.length; i++)
95 98 {
96   - try{
97   - if(typeof t.data[0].data[i] != 'object')
  99 + if(Array.isArray(t.data[0].data[i]))
  100 + {
  101 + if(!isNaN(t.data[0].data[i][0]) && !isNaN(t.data[0].data[i][1])) {
  102 + //coordinates.push([parseFloat(t.data[0].data[i][0]), parseFloat(t.data[0].data[i][1])]);
  103 + geo_layer.addData({"type": "Feature","geometry": {"type": "Point", "coordinates": [parseFloat(t.data[0].data[i][0]), parseFloat(t.data[0].data[i][1])]}});
  104 + }else
  105 + continue;
  106 + }
  107 + else if(typeof t.data[0].data[i] == 'object')
  108 + {
  109 + geo = L.geoJson(t.data[0].data[i]).addTo(t._component.map);
  110 + geo_layer.addData(t.data[0].data[i]);
  111 + }
  112 + else if(typeof t.data[0].data[i] == 'string' && t.data[0].data[i].startsWith('{"type":"'))
  113 + {
  114 + try
  115 + {
98 116 t.data[0].data[i] = JSON.parse(t.data[0].data[i]);
99   - }catch(e){}
100   -
101   - var geoJsonLayer = L.geoJson(t.data[0].data[i]).addTo(t._component.map);
  117 + geo = L.geoJson(t.data[0].data[i]).addTo(t._component.map);
  118 + geo_layer.addData(t.data[0].data[i]);
  119 + }catch(e) {continue;}
  120 + }
  121 + else if(typeof t.data[0].data[i] == 'string' && t.data[0].data[i].indexOf(","))
  122 + {
  123 + var coords = t.data[0].data[i].split(",");
  124 + if(!isNaN(coords[0]) && !isNaN(coords[1])) {
  125 + //coordinates.push([parseFloat(coords[0]), parseFloat(coords[1])]);
  126 + geo_layer.addData({"type": "Feature","geometry": {"type": "Point", "coordinates": [parseFloat(coords[0]), parseFloat(coords[1])]}});
  127 + geo = L.marker([parseFloat(coords[0]), parseFloat(coords[1])]).addTo(t._component.map);
  128 + //coordinates_index++;
  129 + }else
  130 + continue;
  131 + }
102 132  
103 133 if(t.data.length > 1)
104 134 {
105 135 var popupText = "";
106 136 for(var j=1; j<t.data.length; j++)
107 137 {
108   - if(typeof t.data[j] != 'undefined' && typeof t.data[j].data[i] != 'undefined')
  138 + if(typeof t.data[j] != 'undefined' && t.data[j].data[i] && typeof t.data[j].data[i] != 'undefined')
109 139 {
110 140 if (t.data[j].data[i].toString().match(new RegExp("^(http[s]?:\\/\\/(www\\.)?|ftp:\\/\\/(www\\.)?|www\\.){1}([0-9A-Za-z-\\.@:%_\+~#=]+)+((\\.[a-zA-Z]{2,3})+)(/(.)*)?(\\?(.)*)?")))
111 141 popupText += '<image height="100" width="100" src="' + t.data[j].data[i] + '" /><br/>';
... ... @@ -115,13 +145,13 @@ Example:
115 145 }
116 146  
117 147 var popup = L.popup().setContent(popupText);
118   - geoJsonLayer.bindPopup(popup);
  148 + geo.bindPopup(popup);
119 149 }
120 150 }
121 151  
122 152 t._component.map._onResize();
123 153 t._component.map.invalidateSize(false);
124   - t._component.map.fitBounds(bounding_box);
  154 + t._component.map.fitBounds(geo_layer);
125 155  
126 156 }
127 157 };
... ...
datalets/linechart-datalet/linechart-datalet.html
... ... @@ -62,6 +62,13 @@ Example:
62 62 * @method presentData
63 63 */
64 64 presentData: function(){
  65 + var min = 0;
  66 + for (var i in this.properties.series.value) {
  67 + min = Math.min(Math.min.apply(Math, this.properties.series.value[i].data), min);
  68 + }
  69 + if(min < 0)
  70 + min--;
  71 +
65 72 options = {
66 73 chart: {
67 74 zoomType: 'xy'
... ... @@ -76,7 +83,7 @@ Example:
76 83 }
77 84 },
78 85 yAxis: {
79   - min: 0,
  86 + min: min,
80 87 title: {
81 88 text: this._component.yAxisLabel,
82 89 }
... ...
demo.html
... ... @@ -5,21 +5,18 @@
5 5  
6 6 <link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
7 7  
  8 + <script type="text/javascript" src="datalets/shared_js/jquery-1.11.2.min.js"></script>
  9 + <script type="text/javascript" src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
  10 +
8 11 <link rel="import" href="bower_components/iron-component-page/iron-component-page.html">
9   - <link rel="import" href="bower_components/paper-item/paper-item.html">
10   - <link rel="import" href="bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
11 12 <link rel="import" href="bower_components/paper-icon-button/paper-icon-button.html">
12   - <link rel="import" href="bower_components/iron-flex-layout/iron-flex-layout.html">
13 13  
14   - <script type="text/javascript" src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
15   - <script type="text/javascript" src="datalets/shared_js/jquery-1.11.2.min.js"></script>
16 14 <script type="text/javascript" src="docs/js/editarea_0_8_2/edit_area/edit_area_full.js"></script>
17 15  
18   -
19 16 <script type="text/javascript">
20 17 $(document).ready(function () {
21 18 editAreaLoader.init({
22   - id : "sbiricuda", // textarea id
  19 + id : "text_area", // textarea id
23 20 syntax: "html", // syntax to be uses for highgliting
24 21 start_highlight: true, // to display with highlight mode on start-up
25 22 replace_tab_by_spaces: 4,
... ... @@ -49,120 +46,117 @@
49 46 '\<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"\>\<\/script\>\n' +
50 47 '<!-- REMOVE THE PREVIOUS SCRIPT TAGS IF YOUR PAGE ALREADY USES JQUERY AND POLYFILL LIBRARIES -->\n';
51 48  
52   - var dataletLink = '<link rel="import" href="http://deep.routetopa.eu/COMPONENTS/datalets/'+e.detail.data.datalet+'/'+e.detail.data.datalet+'.html" /> \n';
  49 + var dataletLink = '<link rel="import" href="http://deep.routetopa.eu/deep_1_7/COMPONENTS/datalets/'+e.detail.data.datalet+'/'+e.detail.data.datalet+'.html" /> \n';
53 50  
54   - editAreaLoader.setValue("sbiricuda", dataletImport+dataletLink+dataletHTML);
  51 + editAreaLoader.setValue("text_area", dataletImport+dataletLink+dataletHTML);
55 52 }
56 53  
57 54 </script>
58 55  
59   - <style>
  56 + <style is="custom-style">
  57 +
  58 + #creator_container {
  59 + width: 100%;
  60 + height: 100%;
  61 + }
  62 +
  63 + #creator_container * {
  64 + font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  65 + font-size: 16px;
  66 + line-height: 24px;
  67 + }
  68 +
  69 + #text_container {
  70 + padding: 8px;
  71 + background: #BBDEFB;
  72 +
  73 + margin-top: 8px;
  74 + }
  75 +
  76 + #controllet_iframe {
  77 + height: 100%;
  78 + width: 100%;
  79 + }
  80 +
  81 + #iframe_container {
  82 + border: 2px solid #BBDEFB;
  83 + border-top: 0;
  84 + width: calc(100% - 4px);
  85 + height: 698px;
  86 + }
60 87  
61   - body {
62   - font-family: 'Roboto', sans-serif;
  88 + #toolbar {
  89 + background: #2196F3;
63 90 }
64 91  
65   - #toolbar{
66   - background: #2196F3 ;
  92 + .title {
  93 + font-weight: 700 !important;
67 94 }
68 95  
69 96 #logo{
70   - width: 56px;
71   - height: 56px;
72   - background-image: url("http://spod.routetopa.eu/ow_static/themes/rtpa_matter/images/logo.png");
73   - background-size: auto 41px;
  97 + width: 64px;
  98 + height: 64px;
  99 + background-image: url("http://spod.routetopa.eu/ow_static/themes/spod_theme_matter/images/logo.png");
74 100 background-repeat: no-repeat;
75 101 background-position: center center;
  102 + }
  103 +
  104 + paper-icon-button {
  105 + --paper-icon-button-ink-color: #FFFFFF;
  106 + height: 48px;
  107 + width: 48px;
  108 + padding: 8px;
  109 + }
  110 +
  111 + a {
  112 + color: #FFFFFF;
  113 + text-decoration: none;
  114 + }
  115 + #text_area_container {
  116 + width: 100%;
  117 + height: calc(100vh - 884px);
  118 + min-height: 192px;
76 119  
  120 + margin-top: 8px;
  121 + /*background: red;*/
77 122 }
  123 +
  124 + #text_area {
  125 + width: calc(100% - 18px);
  126 + height: calc(100% - 18px);
  127 + margin: 0;
  128 + padding: 8px;
  129 + }
  130 +
78 131 </style>
79 132  
80 133 </head>
81 134 <body>
82 135  
83   - <paper-toolbar id="toolbar">
84   - <paper-menu-button>
85   - <paper-icon-button icon="menu" class="dropdown-trigger"></paper-icon-button>
86   - <paper-menu class="dropdown-content">
87   - <paper-item><a href="http://routetopa.eu/" target="_blank">ROUTE-TO PA European Project</a></paper-item>
88   - <paper-item><a href="docs/docs.html" target="_blank">DEEP Documentation</a></paper-item>
89   - </paper-menu>
90   - </paper-menu-button>
91   - <span class="title">DatalEts-Ecosystem Provider - Datalet Creator</span>
92   - <a href="http://routetopa.eu/" target="_blank"><paper-icon-button id="logo"></paper-icon-button></a>
93   - </paper-toolbar>
94   -
95   - <div class="">
96   - <p>
  136 + <div id="creator_container">
  137 +
  138 + <paper-toolbar id="toolbar">
  139 + <a href="http://routetopa.eu/" target="_blank"><paper-icon-button id="logo" title="ROUTE-TO PA European Project"></paper-icon-button></a>
  140 + <span class="title">DatalEts-Ecosystem Provider - Datalet Creator</span>
  141 + <a href="docs/docs.html" target="_blank"><paper-icon-button icon="description" title="DEEP Documentation"></paper-icon-button></a>
  142 + <a href="http://routetopa.eu/" target="_blank"><paper-icon-button icon="forward" title="ROUTE-TO PA European Project"></paper-icon-button></a>
  143 + </paper-toolbar>
  144 +
  145 + <div id="text_container">
97 146 Using this page you can create a Datalet, a off-the-shelf, reusable web-component able to load,
98 147 query, filter, and visualise any dataset content (e.g. through HighCharts Javascript library).
99 148 Datalet are reusable since they can be placed in every web page, like institutional web-sites,
100 149 blogs, forums and so on, without any knowledge on how it effectively is implemented.
101   - </p>
102   - </div>
  150 + </div>
103 151  
104   - <iframe style="width:100%; height:62vh" frameborder="0" srcdoc='
105   - <head>
106   - <script type="text/javascript" src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
107   - <script type="text/javascript" src="datalets/shared_js/jquery-1.11.2.min.js"></script>
108   - <link rel="import" href="controllets/data-sevc-controllet/data-sevc-controllet.html" />
109   - <script src="controllets/shared_js/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js"></script>
110   - <link rel="stylesheet" href="controllets/shared_js/perfect-scrollbar/css/perfect-scrollbar.min.css">
111   - <script type="text/javascript">
112   - $(document).ready(function () {
113   -
114   - var datasets = [
115   - {decription:"", name:"Italy - Consuntivo entrate 2009", url:"http://ckan.routetopa.eu/api/action/datastore_search?resource_id=07843fc3-07e1-4c66-9be4-fed43ca4a26f"},
116   - {decription:"", name:"Italy - Consuntivo entrate 2010",url:"http://ckan.routetopa.eu/api/action/datastore_search?resource_id=48a4db73-d3d4-4639-bbc2-9c797d0e6cda"},
117   - {decription:"", name:"Italy - Consuntivo entrate 2011",url:"http://ckan.routetopa.eu/api/action/datastore_search?resource_id=a14cc2fb-0c24-48d7-9370-834045797d89"},
118   - {decription:"", name:"Italy - Consuntivo entrate 2012",url:"http://ckan.routetopa.eu/api/action/datastore_search?resource_id=fb32fcb6-5e44-4e52-b132-01c6540ddbee"},
119   - {decription:"", name:"Italy - Consuntivo entrate 2014",url:"http://ckan.routetopa.eu/api/action/datastore_search?resource_id=0cb600fc-19ad-4aaf-9794-1e6ea851840a"},
120   - {decription:"", name:"Holland - Vestigingen register gemeente Groningen",url:"http://ckan.routetopa.eu/api/action/datastore_search?resource_id=ba554c1f-02a7-4d76-b449-fb9daa1f8bfd"},
121   - {decription:"", name:"Holland - Woonruimte gemeente Groningen",url:"http://ckan.routetopa.eu/api/action/datastore_search?resource_id=af7b3916-4347-469a-8354-3c2d559bd92f"},
122   - {decription:"", name:"Ireland - SDCC Traffic Cameras",url:"http://ckan.routetopa.eu/api/action/datastore_search?resource_id=73e02092-85a1-434e-85fe-0c9a43aa9a52"},
123   - {decription:"", name:"Ireland - Derelict Site Register",url:"http://ckan.routetopa.eu/api/action/datastore_search?resource_id=fcbee83e-3d3d-4303-a568-24dd33d02adc"},
124   - {decription:"", name:"Ireland - Dublin City Council Commencement Notices",url:"http://ckan.routetopa.eu/api/action/datastore_search?resource_id=ee00de68-f2e4-482f-a003-3c0561351075"},
125   - {decription:"", name:"Ireland - Dublin City Council Planning Applications",url:"http://ckan.routetopa.eu/api/action/datastore_search?resource_id=2f4a9d44-b52f-4c8b-a5db-d8f4a676d81e"},
126   - {decription:"", name:"Ireland - Dun Laoghaire-Rathdown County Council Planning Application 2008-2014",url:"http://ckan.routetopa.eu/api/action/datastore_search?resource_id=c479f061-9638-489d-ac55-0c68765548ff"},
127   - {decription:"", name:"Ireland - Fingal Council Planning Applications for last 7 years",url:"http://ckan.routetopa.eu/api/action/datastore_search?resource_id=d29a477a-4734-43ef-8002-048c8640d441"},
128   - {decription:"", name:"Ireland - Planning Register",url:"http://ckan.routetopa.eu/api/action/datastore_search?resource_id=2b23f32d-e27e-4eef-af1e-27e05103df7d"},
129   - {decription:"", name:"Ireland - Fingal Development Plan 2011-2017 Record of Protected Structures",url:"http://ckan.routetopa.eu/api/action/datastore_search?resource_id=5ea813bc-fdf9-4edb-b3b1-0142b593d5c6"},
130   - {decription:"", name:"Bubble example",url:"http://ckan.routetopa.eu/api/action/datastore_search?resource_id=0cb600fc-19ad-4aaf-9794-1e6ea851840a"},
131   - {decription:"", name:"Issy - 3d pie chart", url:"https://data.issy.com/api/records/1.0/search?dataset=flux-rss-des-offres-demplois-a-issy-les-moulineaux&sort=published&facet=published&refine.published=2015%2F10"}
132   - ];
133   -
134   - var dsc = document.getElementById("dsc");
135   - dsc.setAttribute("datasets", JSON.stringify(datasets));
136   -
137   - $("#treeMapView").parent().parent().hide();
138   - window.addEventListener("data-sevc-controllet.dataletCreated", function(e){parent.createHTML(e);});
139   -
140   - /*var h = $("#material_container").height() - 48;
141   - var w = $("#material_container").width();
142   - console.log($("#div_datasetexplorer"));
143   - console.log($("#div_datasetexplorer").html());
144   - $("#div_datasetexplorer").html("CIAO !!");
145   - console.log($("#div_datasetexplorer").html());
146   - $("#div_datasetexplorer").html("<datasetexplorer-datalet width=\""+w+"\" height=\""+h+"\" data-url=\"http://spod.routetopa.eu/openwall/api/datasetTree\" fields=\"[\"result,datasets,provider_name\",\"result,datasets,organization_name\",\"result,datasets,package_name\",\"result,datasets,resource_name\",\"result,datasets,url\",\"result,datasets,w\"]\"></datasetexplorer-datalet>");
147   - console.log($("#div_datasetexplorer").html());*/
148   - });
149   - </script>
150   - </head>
151   - <body>
152   - <data-sevc-controllet localization="en" id="dsc" deep-url="http://deep.routetopa.eu/DEEP/" datalets-list-url="http://deep.routetopa.eu/DEEP/datalets-list"></data-sevc-controllet>
153   - </body>
154   - '>
155   - </iframe>
156   -
157   - <div id="code_area">
158   - <textarea id="sbiricuda" style="position:relative;width: 100%;min-height: 15vh;max-height: 15vh;" style="" rows="4" cols="50">
159   -Copy and paste this code to inject the datalet in you page.
160   - </textarea>
161   - </div>
  152 + <div id="iframe_container">
  153 + <iframe id="controllet_iframe" frameborder="0" src="./controllet.html"></iframe>
  154 + </div>
162 155  
163   - <!--<div>
164   - <textarea style="width: 90%; margin-left:10px; height: 110px" id="code-textarea"></textarea>
165   - </div>-->
  156 + <div id="text_area_container">
  157 + <textarea id="text_area">Copy and paste this code to inject the datalet in you page.</textarea>
  158 + </div>
  159 + </div>
166 160  
167 161 </body>
168 162 </html>
169 163 \ No newline at end of file
... ...
locales/cocreation_paper_card_ln.js 0 → 100644
  1 +cocreation_room_ln = [];
  2 +
  3 +/*EN*/
  4 +cocreation_room_ln["explore_en"] = "EXPLORE";
  5 +cocreation_room_ln["goal_en"] = "GOAL";
  6 +
  7 +/*IT*/
  8 +cocreation_room_ln["explore_it"] = "ESPLORA";
  9 +cocreation_room_ln["goal_it"] = "GOAL";
  10 +
  11 +/*FR*/
  12 +cocreation_room_ln["explore_fr"] = "EXPLORE";
  13 +cocreation_room_ln["goal_fr"] = "GOAL";
  14 +
  15 +/*NL*/
  16 +cocreation_room_ln["explore_nl"] = "EXPLORE";
  17 +cocreation_room_ln["goal_nl"] = "GOAL";
0 18 \ No newline at end of file
... ...
locales/controllet_ln.js
... ... @@ -17,17 +17,45 @@ ln[&quot;forward_en&quot;] = &quot;FORWARD&quot;;
17 17  
18 18 //SELECT DATASET
19 19  
20   -ln["listView_en"] = "LIST VIEW";
21   -ln["treeMapView_en"] = "TREE MAP VIEW";
22   -ln["extendedSearch_en"] = "EXTENDED SEARCH";
  20 +ln["selectedUrl_en"] = "Selected url";
  21 +ln["wrongUrl_en"] = "Invalid url or data provider not supported yet.";
  22 +
  23 +ln["providersDatasets_en"] = "FROM PROVIDERS";
  24 +ln["spodUsersDatasets_en"] = "FROM COCREATED";
  25 +ln["extendedDatasets_en"] = "FROM EXTENDED SEARCH";
  26 +ln["datasets_en"] = "DATASETS LIST";
  27 +
23 28 ln["provider_en"] = "Provider";
  29 +ln["all_en"] = "All";
  30 +ln["allDescription_en"] = "Shows the datasets of all associated providers.";
  31 +ln["providerName_en"] = "Provider";
  32 +ln["providerNameDescription_en"] = "Shows only the datasets of the selected provider.";
  33 +
  34 +//ln["view_en"] = "View";
  35 +//ln["list_en"] = "List";
  36 +//ln["listDescription_en"] = "Shows the datasets with a classic list.";
  37 +//ln["tree_en"] = "Tree";
  38 +//ln["treeDescription_en"] = "Shows the datasets with a tree map.";
  39 +
  40 +//ln["search_en"] = "Search";
  41 +//ln["standard_en"] = "Standard";
  42 +//ln["standardDescription_en"] = "The search function works only on datasets names.";
  43 +//ln["extended_en"] = "Extended [NOT AVAILABLE]";
  44 +//ln["extendedDescription_en"] = "The search function works the entire contents of the datasets.";
  45 +
  46 +ln["version_en"] = "Version";
  47 +ln["showLast_en"] = "Show last";
  48 +ln["showLastDescription_en"] = "Shows only the latest version of the datasets.";
  49 +ln["showAll_en"] = "Show all";
  50 +ln["showAllDescription_en"] = "Shows all versions of the datasets.";
  51 +
  52 +//select-dataset-controllet
  53 +ln["datasetsInfo_en"] = "DATASET INFO";
24 54 ln["showing_en"] = "Showing";
25 55 ln["to_en"] = "to";
26 56 ln["of_en"] = "of";
27   -ln["datasets_en"] = "datasets";
28   -ln["suggestedDatasets_en"] = "Suggested datasets";
29   -ln["selectedUrl_en"] = "Selected url";
30   -ln["wrongUrl_en"] = "Invalid url or data provider not supported yet.";
  57 +ln["datasetsRows_en"] = "datasets";
  58 +ln["search_en"] = "Search";
31 59  
32 60 //SELECT DATA
33 61  
... ... @@ -179,7 +207,7 @@ ln[&quot;CategoriesDescription_en&quot;] = &quot;The category that splits the y-axis values. If
179 207 ln["x-axis-label_en"] = "X Axis Label";
180 208 ln["y-axis-label_en"] = "Y Axis Label";
181 209 ln["suffix_en"] = "Tooltip Suffix";
182   -ln["legend_en"] = "Leged";
  210 +ln["legend_en"] = "Legend";
183 211 ln["data-labels_en"] = "Show Data Labels";
184 212 ln["stack_en"] = "Stack";
185 213 ln["theme_en"] = "Theme";
... ... @@ -200,7 +228,7 @@ ln[&quot;themeSpod_en&quot;] = &quot;Spod&quot;;
200 228 ln["x-axis-labelDescription_en"] = "The x-axis label.";
201 229 ln["y-axis-labelDescription_en"] = "The y-axis label.";
202 230 ln["suffixDescription_en"] = "The suffix added to data labels in the tooltip.";
203   -ln["legendDescription_en"] = "The leged position.";
  231 +ln["legendDescription_en"] = "The legend position.";
204 232 ln["data-labelsDescription_en"] = "Show/hide data labels.";
205 233 ln["themeDescription_en"] = "The theme affects the appearance and colors of the chart.";
206 234 ln["stackDescription_en"] = "The stack type.";
... ... @@ -210,409 +238,451 @@ ln[&quot;donutDescription_en&quot;] = &quot;Pie will become Donut! :) (or viceversa).&quot;;
210 238  
211 239 //PAGE SLIDER
212 240  
213   -ln["slide1Title_it"] = "SELECT DATASET";
214   -ln["slide1Subtitle_it"] = "Select a dataset from the list or copy and paste the url of dataset.";
215   -ln["slide2Title_it"] = "SELECT DATA";
216   -ln["slide2Subtitle_it"] = "Select the fields on the left. The table will show the values related to the selected fields.";
217   -ln["slide3Title_it"] = "SELECT VISUALIZATION";
218   -ln["slide3Subtitle_it"] = "Select a visualization, fill out inputs and options.";
219   -ln["back_it"] = "BACK TO THE FUTURE";
220   -ln["forward_it"] = "FORWARD";
  241 +ln["slide1Title_it"] = "SELEZIONA UN DATASET";
  242 +ln["slide1Subtitle_it"] = "Seleziona un dataset dall'elenco oppure copia-incolla l'url di un dataset.";
  243 +ln["slide2Title_it"] = "SELEZIONA I DATI";
  244 +ln["slide2Subtitle_it"] = "Seleziona i campi sulla sinistra. La tabella mostrerà i valori relativi ai campi selezionati";
  245 +ln["slide3Title_it"] = "SELEZIONA LA VISUALIZZAZIONE";
  246 +ln["slide3Subtitle_it"] = "Seleziona una visualizzazione, compila i campi e le opzioni.";
  247 +ln["back_it"] = "RITORNO AL FUTURO";
  248 +ln["forward_it"] = "AVANTI";
221 249  
222 250 //SELECT DATASET
223 251  
224   -ln["listView_it"] = "LIST VIEW";
225   -ln["treeMapView_it"] = "TREE MAP VIEW";
226   -ln["extendedSearch_it"] = "EXTENDED SEARCH";
  252 +ln["selectedUrl_it"] = "Url selezionato";
  253 +ln["wrongUrl_it"] = "Url non valido o provider dati non ancora supportato.";
  254 +
  255 +ln["providersDatasets_it"] = "DATASET DEI PROVIDER";
  256 +ln["spodUsersDatasets_it"] = "DATASET COCREATI";
  257 +ln["extendedDatasets_it"] = "RICERCA ESTESA";
  258 +ln["datasets_it"] = "LISTA DEI DATASET";
  259 +
227 260 ln["provider_it"] = "Provider";
228   -ln["showing_it"] = "Showing";
229   -ln["to_it"] = "to";
230   -ln["of_it"] = "of";
231   -ln["datasets_it"] = "datasets";
232   -ln["suggestedDatasets_it"] = "Suggested datasets";
233   -ln["selectedUrl_it"] = "Selected url";
234   -ln["wrongUrl_it"] = "Invalid url or data provider not supported yet.";
  261 +ln["all_it"] = "Tutti";
  262 +ln["allDescription_it"] = "Mostra i dataset di tutti i provider associati..";
  263 +ln["providerName_it"] = "Provider";
  264 +ln["providerNameDescription_it"] = "Mostra solo i dataset del provider selezionato.";
  265 +
  266 +ln["search_it"] = "Ricerca";
  267 +ln["standard_it"] = "Standard";
  268 +ln["standardDescription_it"] = "La ricerca funziona solo sui nommi dei dataset.";
  269 +ln["extended_it"] = "Extended [NOT AVAILABLE]";
  270 +ln["extendedDescription_it"] = "La ricerca funziona sull'intero contenuto dei dataset;.";
  271 +
  272 +ln["version_it"] = "Version";
  273 +ln["showLast_it"] = "Mostra l'ultima";
  274 +ln["showLastDescription_it"] = "Mostra solo l'ultima versione dei dataset.";
  275 +ln["showAll_it"] = "Mostra tutti";
  276 +ln["showAllDescription_it"] = "Mostra tutte le versioni dei dataset.";
  277 +
  278 +//select-dataset-controllet
  279 +ln["datasetsInfo_it"] = "INFORMAZIONI SUL DATASET";
  280 +ln["showing_it"] = "Mostrati";
  281 +ln["to_it"] = "a";
  282 +ln["of_it"] = "di";
  283 +ln["datasetsRows_it"] = "dataset";
  284 +ln["search_it"] = "Ricerca";
235 285  
236 286 //SELECT DATA
237 287  
238 288 //select-fields
239   -ln["fields_it"] = "FIELDS";
  289 +ln["fields_it"] = "CAMPI";
240 290  
241 291 //data-table
242   -ln["selectedData_it"] = "SELECTED DATA";
243   -ln["showing_it"] = "Showing";
244   -ln["to_it"] = "to";
245   -ln["of_it"] = "of";
246   -ln["rows_it"] = "rows";
247   -ln["type_it"] = "TYPE";
248   -ln["warning_it"] = "WARNING";
  292 +ln["selectedData_it"] = "DATI SELEZIONATI";
  293 +ln["showing_it"] = "Mostrati";
  294 +ln["to_it"] = "a";
  295 +ln["of_it"] = "di";
  296 +ln["rows_it"] = "file";
  297 +ln["type_it"] = "SCRIVERE";
  298 +ln["warning_it"] = "ATTENZIONE";
249 299  
250 300 //expert
251   -ln["expert_it"] = "EXPERT MODE";
252   -ln["filters_it"] = "FILTERS";
253   -ln["groupBy_it"] = "GROUP BY";
254   -ln["query_it"] = "QUERY";
  301 +ln["expert_it"] = "MODALITA' ESPERTO";
  302 +ln["filters_it"] = "FILTRI";
  303 +ln["groupBy_it"] = "RAGGRUPPA PER";
  304 +ln["query_it"] = "INTERROGARE";
255 305  
256 306 //filters
257   -ln["filterField_it"] = "Field";
258   -ln["filterOperation_it"] = "Operation";
259   -ln["filterValue_it"] = "Value";
  307 +ln["filterField_it"] = "Campo";
  308 +ln["filterOperation_it"] = "Operazione";
  309 +ln["filterValue_it"] = "Valore";
260 310  
261   -ln["disableFilters_it"] = "DISABLE FILTERS";
262   -ln["enableFilters_it"] = "ENABLE FILTERS";
  311 +ln["disableFilters_it"] = "DISABILITA FILTRI";
  312 +ln["enableFilters_it"] = "ABILITA FILTRI";
263 313  
264 314 ln["=_it"] = "="; //is equal to
265   -ln["!=_it"] = "not ="; //is not equal to
  315 +ln["!=_it"] = "non ="; //is not equal to
266 316 ln[">_it"] = ">"; //is greater than
267 317 ln[">=_it"] = ">="; //is greater than or equal to
268 318 ln["<_it"] = "<"; //is less than
269 319 ln["<=_it"] = "<="; //is less than or equal to
270   -ln["contains_it"] = "contains";
271   -ln["notContains_it"] = "not contains";
272   -ln["start_it"] = "start with";
273   -ln["ends_it"] = "ends with";
  320 +ln["contains_it"] = "contiene";
  321 +ln["notContains_it"] = "non contiene";
  322 +ln["start_it"] = "inizia con";
  323 +ln["ends_it"] = "termina con";
274 324  
275 325 //aggregators
276   -ln["GROUP BY_it"] = "GROUP BY";
277   -ln["CALCULATE_it"] = "CALCULATE";
278   -ln["Calculate_it"] = "Calculate";
279   -ln["aggregatorField_it"] = "Field";
280   -
281   -ln["disableGroupBy_it"] = "DISABLE GROUP BY";
282   -ln["enableGroupBy_it"] = "ENABLE GROUP BY";
283   -
284   -ln["COUNT_it"] = "COUNT of";
285   -ln["SUM_it"] = "SUM of";
286   -ln["MIN_it"] = "MIN of";
287   -ln["MAX_it"] = "MAX of";
288   -ln["AVG_it"] = "AVG of";
289   -ln["FIRST_it"] = "FIRST of";
290   -ln["LAST_it"] = "LAST of";
  326 +ln["GROUP BY_it"] = "RAGGRUPPA PER";
  327 +ln["CALCULATE_it"] = "CALCOLA";
  328 +ln["Calculate_it"] = "Calcola";
  329 +ln["aggregatorField_it"] = "Campo";
  330 +
  331 +ln["disableGroupBy_it"] = "DISABILITA RAGGRUPPAMENTO ";
  332 +ln["enableGroupBy_it"] = "ABILITA RAGGRUPPAMENTO";
  333 +
  334 +ln["COUNT_it"] = "TOTALE di";
  335 +ln["SUM_it"] = "SOMMA di";
  336 +ln["MIN_it"] = "MINORE di";
  337 +ln["MAX_it"] = "MASSIMO di";
  338 +ln["AVG_it"] = "AVG di";
  339 +ln["FIRST_it"] = "PRIMO di";
  340 +ln["LAST_it"] = "ULTIMO di";
291 341  
292 342 //SELECT VISUALIZATION
293 343  
294   -ln["addDatalet_it"] = "ADD";
295   -ln["modifyDatalet_it"] = "MODIFY";
  344 +ln["addDatalet_it"] = "AGGIUNGI";
  345 +ln["modifyDatalet_it"] = "MODIFICA";
296 346  
297 347 //datalet-preview
298   -ln["previewTab_it"] = "DATALET PREVIEW";
  348 +ln["previewTab_it"] = "ANTEPRIMA DATALET";
299 349 ln["infoTab_it"] = "DATALET INFO";
300 350  
301 351 //select-inputs
302   -ln["baseInfo_it"] = "BASE INFO";
303   -ln["inputs_it"] = "INPUTS";
304   -ln["options_it"] = "OPTIONS";
  352 +ln["baseInfo_it"] = "INFO BASE";
  353 +ln["inputs_it"] = "INPUT";
  354 +ln["options_it"] = "OPZIONI";
305 355  
306 356 //vslider
307   -ln["search_it"] = "Search";
  357 +ln["search_it"] = "Cerca";
308 358  
309   -ln["datatable_it"] = "Table";
310   -ln["barchart_it"] = "Bar Chart";
311   -ln["columnchart_it"] = "Column Chart";
312   -ln["areachart_it"] = "Area Chart";
313   -ln["linechart_it"] = "Line Chart";
  359 +ln["datatable_it"] = "Tabella";
  360 +ln["barchart_it"] = "Grafico a barre";
  361 +ln["columnchart_it"] = "Istogramma";
  362 +ln["areachart_it"] = "Grafico ad area";
  363 +ln["linechart_it"] = "Grafico a linee";
314 364 ln["heatmap_it"] = "Heat Map";
315   -ln["piechart_it"] = "Pie Chart";
316   -ln["scatterchart_it"] = "Scatter Chart";
317   -ln["bubblechart_it"] = "Bubble Chart";
318   -ln["treemap_it"] = "Tree Map";
319   -ln["leafletjs_it"] = "Map";
320   -ln["leafletjs-geojson_it"] = "Geojson Map";
321   -
322   -ln["datatableDescription_it"] = "A table is a means of arranging data in rows and columns.";
323   -ln["barchartDescription_it"] = "A bar chart is a chart that presents grouped data with rectangular bars plotted horizontally with lengths proportional to the values that they represent.";
324   -ln["columnchartDescription_it"] = "A column chart is a chart that presents grouped data with rectangular bars plotted vertically with lengths proportional to the values that they represent.";
325   -ln["areachartDescription_it"] = "An area chart is a chart which displays graphically quantitive data. The area between axis and line are emphasized with colors and textures. Commonly one compares with the area chart two or more quantities.";
326   -ln["linechartDescription_it"] = "A line chart is chart which displays information as a series of data points called 'markers' connected by straight line segments. A line chart is often used to visualize a trend in data over intervals of time.";
327   -ln["heatmapDescription_it"] = "A heat map is a graphical representation of data where the individual values contained in a matrix are represented as colors.";
328   -ln["piechartDescription_it"] = "A pie chart is a circular statistical graphic, which is divided into slices to illustrate numerical proportion. In the pie chart, the arc length of each slice, and consequently its central angle and area, is proportional to the quantity it represents.";
329   -ln["scatterchartDescription_it"] = "A scatter chart is a type of plot or mathematical diagram using Cartesian coordinates to display values for typically two variables for a set of data. The data is displayed as a collection of points, each having the value of one variable determining the position on the horizontal axis and the value of the other variable determining the position on the vertical axis.";
330   -ln["bubblechartDescription_it"] = "A bubble chart is a type of chart that displays three dimensions of data. Each entity with its triplet (v1, v2, v3) of associated data is plotted as a disk that expresses two of the vi values through the disk's xy location and the third through its size.";
331   -ln["treemapDescription_it"] = "A tree map is a chart for displaying hierarchical data by using nested rectangles.";
  365 +ln["piechart_it"] = "Grafico a torta";
  366 +ln["scatterchart_it"] = "Grafico a dispersione";
  367 +ln["bubblechart_it"] = "Diagramma a bolle";
  368 +ln["treemap_it"] = "Mappa ad albero";
  369 +ln["leafletjs_it"] = "Mappa";
  370 +ln["leafletjs-geojson_it"] = "Mappa Geojson";
  371 +
  372 +ln["datatableDescription_it"] = "Una tabella è un mezzo per organizzare i dati in righe e colonne.";
  373 +ln["barchartDescription_it"] = "Un grafico a barre è un grafico che presenta dati raggruppati in barre rettangolari impostate orizzontalmente con la lunghezza proporzionale al valore rappresentato.";
  374 +ln["columnchartDescription_it"] = "Un istogramma è un grafico raffigurante dati raggruppati in barre rettangolari impostate verticalmente con lunghezza proporzionale al valore rappresentato.";
  375 +ln["areachartDescription_it"] = "Un grafico ad area è un grafico che mostra graficamente dati quantitativi. L'area tra le assi e la linea sono enfatizzate con colori e texture. Usualmente si compara il grafico ad area con due o più quantità.";
  376 +ln["linechartDescription_it"] = "Un grafico a linee è un grafico che mostra le informazioni sottoforma di una serie di dati puntuali definiti 'markers' e collegati tra loro con segmenti di linee dritte. Il grafico a linee è spesso utilizzato per visualizzare trend lungo un intervallo temporale.";
  377 +ln["heatmapDescription_it"] = "Una heat map è una rappresentazione grafica di dati in cui i valori individuali contenuti in una matrice sono rappresentati con colori.";
  378 +ln["piechartDescription_it"] = "Un grafico a torta è un grafico statistico e circolare che è diviso in fette che mostrano la proporzione numerica. Nel grafico a torta la lunghezza dell'arco di ogni fetta, e di conseguenza il suo angolo al centro e l'area, è proporzionato alla quantita che rappresenta.";
  379 +ln["scatterchartDescription_it"] = "Un grafico a dispersione è un tipo di grafico o diagramma matematico che utilizza coordinate cartesiane per mostrare valori tipicamente per due variabili per un set di dati. I dati sono mostrati come un insieme di punti, ciascuno avente il valore di una variabile che ne determina la posizione sull'asse orizzontale e il valore dell'altra variabile ne determina la posizione sull'asse verticale.";
  380 +ln["bubblechartDescription_it"] = " Un diagramma a bolle è un tipo di diagramma che mostra tre dimensioni dei dati. Ciascuna entità con la sua tripletta (v1,v2,v3) di dati associati viene impostata come un disco che esprime due dei valori di vi attraverso la localizzazione dell'xy del disco mentre la terza vi è la dimensione del disco stessa.";
  381 +ln["treemapDescription_it"] = " Una mappa ad albero è un diagramma per rappresentare dati gerarchicamente utilizzando rettangoli nidificati.";
332 382 ln["leafletjsDescription_it"] = "";
333 383 ln["leafletjs-geojsonDescription_it"] = "";
334 384  
335 385 //inputs
336   -ln["title_it"] = "Title"
337   -ln["description_it"] = "Description";
338   -
339   -ln["sortAscending_it"] = "SORTED ASCENDING";
340   -ln["sortDescending_it"] = "SORTED DESCENDING";
341   -ln["unsort_it"] = "UNSORTED";
342   -
343   -//--> "_" not allowed!
344   -ln["TITLE_it"] = "TITLE";
345   -ln["DESCRIPTION_it"] = "DESCRIPTION";
346   -ln["XAxis_it"] = "X-AXIS";
347   -ln["YAxis_it"] = "Y-AXIS";
348   -ln["NumericXAxis_it"] = "X-AXIS";
349   -ln["NumericYAxis_it"] = "Y-AXIS";
350   -ln["Column_it"] = "COLUMN";
351   -ln["Level_it"] = "LEVEL";
352   -ln["SliceLabels_it"] = "LABEL";
353   -ln["SliceSizes_it"] = "SIZE";
354   -ln["Latitude_it"] = "LATITUDE";
355   -ln["Longitude_it"] = "LONGITUDE";
356   -ln["BalloonContent_it"] = "BALLOON CONTENT";
  386 +ln["title_it"] = "Titolo"
  387 +ln["description_it"] = "Descrizione";
  388 +
  389 +ln["sortAscending_it"] = "ORDINE CRESCENTE";
  390 +ln["sortDescending_it"] = "ORDINE DECRESCENTE";
  391 +ln["unsort_it"] = "NON ORDINATI";
  392 +
  393 +ln["TITLE_it"] = "TITOLO";
  394 +ln["DESCRIPTION_it"] = "DESCRIZIONE";
  395 +ln["XAxis_it"] = "ASSE X";
  396 +ln["YAxis_it"] = "ASSE Y";
  397 +ln["NumericXAxis_it"] = "ASSE X";
  398 +ln["NumericYAxis_it"] = "ASSE Y";
  399 +ln["Column_it"] = "COLONNA";
  400 +ln["Level_it"] = "LIVELLO";
  401 +ln["SliceLabels_it"] = "ETICHETTA";
  402 +ln["SliceSizes_it"] = "DIMENSIONE";
  403 +ln["Latitude_it"] = "LATITUDINE";
  404 +ln["Longitude_it"] = "LONGITUDINE";
  405 +ln["BalloonContent_it"] = "CONTENUTO DEL BALLOON";
357 406 ln["GEOJSON_it"] = "GEOJSON";
358   -ln["GEOJSONContent_it"] = "GEOJSON CONTENT";
359   -ln["BubbleContent_it"] = "BUBBLE CONTENT";
360   -ln["BubbleSize_it"] = "BUBBLE SIZE";
361   -ln["Categories_it"] = "CATEGORY";
362   -
363   -ln["TITLEDescription_it"] = "The datalet title.";
364   -ln["DESCRIPTIONDescription_it"] = "The datalet description.";
365   -ln["XAxisDescription_it"] = "The x-axis.";
366   -ln["YAxisDescription_it"] = "The y-axis.";
367   -ln["NumericXAxisDescription_it"] = "The x-axis.";
368   -ln["NumericYAxisDescription_it"] = "The y-axis.";
369   -ln["ColumnDescription_it"] = "The column of the table.";
370   -ln["LevelDescription_it"] = "The level of the tree map.";
371   -ln["SliceLabelsDescription_it"] = "The label of the slices.";
372   -ln["SliceSizesDescription_it"] = "The size of the slices.";
373   -ln["LatitudeDescription_it"] = "The latitude of locations.";
374   -ln["LongitudeDescription_it"] = "The longitude of locations.";
375   -ln["BalloonContentDescription_it"] = "The content of balloons.";
376   -ln["GEOJSONDescription_it"] = "The GeoJSON data.";
377   -ln["GEOJSONContentDescription_it"] = "The content of GeoJSON.";
378   -ln["BubbleContentDescription_it"] = "The content of bubbles.";
379   -ln["BubbleSizeDescription_it"] = "The size of bubbles.";
380   -ln["CategoriesDescription_it"] = "The category that splits the y-axis values. If selected only the first selected y-axis will be considered.";
  407 +ln["GEOJSONContent_it"] = "CONTENUTO DEL GEOJSON";
  408 +ln["BubbleContent_it"] = "CONTENUTO DELLA BOLLA";
  409 +ln["BubbleSize_it"] = "DIMENSIONE DELLA BOLLA";
  410 +ln["Categories_it"] = "CATEGORIA";
  411 +
  412 +ln["TITLEDescription_it"] = "Titolo del datalet";
  413 +ln["DESCRIPTIONDescription_it"] = "Descrizione datalet";
  414 +ln["XAxisDescription_it"] = "Asse x";
  415 +ln["YAxisDescription_it"] = "Asse y";
  416 +ln["NumericXAxisDescription_it"] = "Asse x";
  417 +ln["NumericYAxisDescription_it"] = "Asse y";
  418 +ln["ColumnDescription_it"] = "Colonna della tabella";
  419 +ln["LevelDescription_it"] = "Livello della mappa ad albero";
  420 +ln["SliceLabelsDescription_it"] = "Etichette delle fette";
  421 +ln["SliceSizesDescription_it"] = "Dimensione delle fette";
  422 +ln["LatitudeDescription_it"] = "Latitudine della posizione";
  423 +ln["LongitudeDescription_it"] = "Longitudine della posizione";
  424 +ln["BalloonContentDescription_it"] = "Contenuto dei balloons";
  425 +ln["GEOJSONDescription_it"] = "Dati GeoJSON.";
  426 +ln["GEOJSONContentDescription_it"] = "Contenuto del GeoJSON.";
  427 +ln["BubbleContentDescription_it"] = "Contenuto delle bolle.";
  428 +ln["BubbleSizeDescription_it"] = "Dimensione delle bolle.";
  429 +ln["CategoriesDescription_it"] = "Categoria che separa l'asse y. Se selezionata, solo l'asse y scelta per prima sarà considerata.";
381 430  
382 431 //options
383   -ln["x-axis-label_it"] = "X Axis Label";
384   -ln["y-axis-label_it"] = "Y Axis Label";
385   -ln["suffix_it"] = "Tooltip Suffix";
386   -ln["legend_it"] = "Leged";
387   -ln["data-labels_it"] = "Show Data Labels";
388   -ln["stack_it"] = "Stack";
389   -ln["theme_it"] = "Theme";
390   -ln["donut_it"] = "Donut";
391   -
392   -ln["true_it"] = "Yes";
  432 +ln["x-axis-label_it"] = "Etichetta asse X";
  433 +ln["y-axis-label_it"] = "Etichetta asse Y";
  434 +ln["suffix_it"] = "Suffisso Tooltip";
  435 +ln["legend_it"] = "Leggenda";
  436 +ln["data-labels_it"] = "Mostra etichette dati";
  437 +ln["stack_it"] = "Pila";
  438 +ln["theme_it"] = "Tema";
  439 +ln["donut_it"] = "Ciambella";
  440 +
  441 +ln["true_it"] = "Si";
393 442 ln["false_it"] = "No";
394   -ln["bottom_it"] = "Yes: Bottom";
395   -ln["topRight_it"] = "Yes: Top Right";
396   -ln["normal_it"] = "Yes: Normal";
397   -ln["percent_it"] = "Yes: Percent";
  443 +ln["bottom_it"] = "Si: in fondo";
  444 +ln["topRight_it"] = "Si: in alto a destra";
  445 +ln["normal_it"] = "Si: Normale";
  446 +ln["percent_it"] = "Si: Percentuale";
398 447 ln["themeBase_it"] = "Base";
399 448 ln["themeDarkUnika_it"] = "Dark Unika";
400 449 ln["themeSandSignika_it"] = "Sand Signika";
401 450 ln["themeGridLight_it"] = "Grid Light";
402 451 ln["themeSpod_it"] = "Spod";
403 452  
404   -ln["x-axis-labelDescription_it"] = "The x-axis label.";
405   -ln["y-axis-labelDescription_it"] = "The y-axis label.";
406   -ln["suffixDescription_it"] = "The suffix added to data labels in the tooltip.";
407   -ln["legendDescription_it"] = "The leged position.";
408   -ln["data-labelsDescription_it"] = "Show/hide data labels.";
409   -ln["themeDescription_it"] = "The theme affects the appearance and colors of the chart.";
410   -ln["stackDescription_it"] = "The stack type.";
411   -ln["donutDescription_it"] = "Pie will become Donut! :) (or viceversa).";
  453 +ln["x-axis-labelDescription_it"] = "Etichetta asse X";
  454 +ln["y-axis-labelDescription_it"] = "Etichetta asse Y";
  455 +ln["suffixDescription_it"] = " Suffisso aggiunto all'etichette dati nel tooltip.";
  456 +ln["legendDescription_it"] = "Posizione leggenda";
  457 +ln["data-labelsDescription_it"] = "Mostra/Nascondi etichette dati";
  458 +ln["themeDescription_it"] = "Il tema influenza l'aspetto e i colori del grafico.";
  459 +ln["stackDescription_it"] = "Tipologia di pila";
  460 +ln["donutDescription_it"] = "La torta si trasforma in ciambella! :) (o viceversa).";
412 461  
413 462 /******** FR ********/
414 463  
415 464 //PAGE SLIDER
416 465  
417   -ln["slide1Title_fr"] = "SELECT DATASET";
418   -ln["slide1Subtitle_fr"] = "Select a dataset from the list or copy and paste the url of dataset.";
419   -ln["slide2Title_fr"] = "SELECT DATA";
420   -ln["slide2Subtitle_fr"] = "Select the fields on the left. The table will show the values related to the selected fields.";
421   -ln["slide3Title_fr"] = "SELECT VISUALIZATION";
422   -ln["slide3Subtitle_fr"] = "Select a visualization, fill out inputs and options.";
423   -ln["back_fr"] = "BACK TO THE FUTURE";
424   -ln["forward_fr"] = "FORWARD";
  466 +ln["slide1Title_fr"] = "SÉLECTIONNER UN JEU DE DONNÉES";
  467 +ln["slide1Subtitle_fr"] = "Rechercher ou copier/coller l’url du jeu de données.";
  468 +ln["slide2Title_fr"] = "SÉLECTIONNER DONNÉES";
  469 +ln["slide2Subtitle_fr"] = "Sélectionner les champs sur la gauche. Le tableau présentera les valeurs liées aux champs sélectionnés.";
  470 +ln["slide3Title_fr"] = "SÉLECTIONNER UN MODE DE VISUALISATION";
  471 +ln["slide3Subtitle_fr"] = "Sélectionner une visualisation, compléter les données et les options.";
  472 +ln["back_fr"] = "RETOUR VERS LE FUTUR";
  473 +ln["forward_fr"] = "AVANT";
425 474  
426 475 //SELECT DATASET
427 476  
428   -ln["listView_fr"] = "LIST VIEW";
429   -ln["treeMapView_fr"] = "TREE MAP VIEW";
430   -ln["extendedSearch_fr"] = "EXTENDED SEARCH";
  477 +ln["selectedUrl_fr"] = "API URL sélectionné";
  478 +ln["wrongUrl_fr"] = "URL invalide ou fournisseur de données pas encore supporté.";
  479 +
  480 +ln["providersDatasets_fr"] = "DATASET DE PROVIDER";
  481 +ln["spodUsersDatasets_fr"] = "DATASET COCRÉE";
  482 +ln["extendedDatasets_fr"] = "RECHERCHE AVANCÉE";
  483 +ln["datasets_fr"] = "LISTE DE DATASET";
  484 +
431 485 ln["provider_fr"] = "Provider";
432   -ln["showing_fr"] = "Showing";
433   -ln["to_fr"] = "to";
434   -ln["of_fr"] = "of";
435   -ln["datasets_fr"] = "datasets";
436   -ln["suggestedDatasets_fr"] = "Suggested datasets";
437   -ln["selectedUrl_fr"] = "Selected url";
438   -ln["wrongUrl_fr"] = "Invalid url or data provider not supported yet.";
  486 +ln["all_fr"] = "Tout";
  487 +ln["allDescription_fr"] = "Hows les ensembles de données de tous les fournisseurs associés.";
  488 +ln["providerName_fr"] = "Provider";
  489 +ln["providerNameDescription_fr"] = "Affiche uniquement les ensembles de données du fournisseur sélectionné.";
  490 +
  491 +ln["search_fr"] = "Rechercher";
  492 +ln["standard_fr"] = "Standard";
  493 +ln["standardDescription_fr"] = "La fonction de recherche ne fonctionne que sur des ensembles de données des noms.";
  494 +ln["extended_fr"] = "Extended [NON DISPONIBLE]";
  495 +ln["extendedDescription_fr"] = "La fonction de recherche fonctionne tout le contenu des ensembles de données.";
  496 +
  497 +ln["version_fr"] = "Version";
  498 +ln["showLast_fr"] = "Montre la dernière";
  499 +ln["showLastDescription_fr"] = "Indique que la dernière version des ensembles de données.";
  500 +ln["showAll_fr"] = "Montre tout";
  501 +ln["showAllDescription_fr"] = "Montre toutes les versions des ensembles de données.";
  502 +
  503 +//select-dataset-controllet
  504 +ln["datasetsInfo_fr"] = "INFORMATIONS SUR DATASET";
  505 +ln["showing_fr"] = "Aperçu";
  506 +ln["to_fr"] = "à";
  507 +ln["of_fr"] = "de";
  508 +ln["datasetsRows_fr"] = "dataset";
  509 +ln["search_fr"] = "Rechercher";
439 510  
440 511 //SELECT DATA
441 512  
442 513 //select-fields
443   -ln["fields_fr"] = "FIELDS";
  514 +ln["fields_fr"] = "CHAMPS";
444 515  
445 516 //data-table
446   -ln["selectedData_fr"] = "SELECTED DATA";
447   -ln["showing_fr"] = "Showing";
448   -ln["to_fr"] = "to";
449   -ln["of_fr"] = "of";
450   -ln["rows_fr"] = "rows";
  517 +ln["selectedData_fr"] = "DONNÉES SÉLECTIONNÉES";
  518 +ln["showing_fr"] = "Aperçu";
  519 +ln["to_fr"] = "à";
  520 +ln["of_fr"] = "de";
  521 +ln["rows_fr"] = "rangées";
451 522 ln["type_fr"] = "TYPE";
452   -ln["warning_fr"] = "WARNING";
  523 +ln["warning_fr"] = "AVERTISSEMENT";
453 524  
454 525 //expert
455   -ln["expert_fr"] = "EXPERT MODE";
456   -ln["filters_fr"] = "FILTERS";
457   -ln["groupBy_fr"] = "GROUP BY";
458   -ln["query_fr"] = "QUERY";
  526 +ln["expert_fr"] = "MODE EXPERT";
  527 +ln["filters_fr"] = "FILTRES";
  528 +ln["groupBy_fr"] = "GROUPE PAR";
  529 +ln["query_fr"] = "REQUÊTE";
459 530  
460 531 //filters
461   -ln["filterField_fr"] = "Field";
462   -ln["filterOperation_fr"] = "Operation";
463   -ln["filterValue_fr"] = "Value";
464   -
465   -ln["disableFilters_fr"] = "DISABLE FILTERS";
466   -ln["enableFilters_fr"] = "ENABLE FILTERS";
467   -
468   -ln["=_fr"] = "="; //is equal to
469   -ln["!=_fr"] = "not ="; //is not equal to
470   -ln[">_fr"] = ">"; //is greater than
471   -ln[">=_fr"] = ">="; //is greater than or equal to
472   -ln["<_fr"] = "<"; //is less than
473   -ln["<=_fr"] = "<="; //is less than or equal to
474   -ln["contains_fr"] = "contains";
475   -ln["notContains_fr"] = "not contains";
476   -ln["start_fr"] = "start with";
477   -ln["ends_fr"] = "ends with";
  532 +ln["filterField_fr"] = "Champ";
  533 +ln["filterOperation_fr"] = "Opération";
  534 +ln["filterValue_fr"] = "Valeur";
  535 +
  536 +ln["disableFilters_fr"] = "DÉSACTIVER LES FILTRES";
  537 +ln["enableFilters_fr"] = "ACTIVER LES FILTRES";
  538 +
  539 +ln["=_fr"] = "="; //est égal à
  540 +ln["!=_fr"] = "not ="; //n'est pas égal à
  541 +ln[">_fr"] = ">"; //est plus grand que
  542 +ln[">=_fr"] = ">="; //est plus grand ou égal à
  543 +ln["<_fr"] = "<"; //est inférieur à
  544 +ln["<=_fr"] = "<="; //est inférieur ou égal à
  545 +ln["contains_fr"] = "contient";
  546 +ln["notContains_fr"] = "ne contient pas";
  547 +ln["start_fr"] = "commence par";
  548 +ln["ends_fr"] = "se finit par";
478 549  
479 550 //aggregators
480   -ln["GROUP BY_fr"] = "GROUP BY";
481   -ln["CALCULATE_fr"] = "CALCULATE";
482   -ln["Calculate_fr"] = "Calculate";
483   -ln["aggregatorField_fr"] = "Field";
484   -
485   -ln["disableGroupBy_fr"] = "DISABLE GROUP BY";
486   -ln["enableGroupBy_fr"] = "ENABLE GROUP BY";
487   -
488   -ln["COUNT_fr"] = "COUNT of";
489   -ln["SUM_fr"] = "SUM of";
490   -ln["MIN_fr"] = "MIN of";
491   -ln["MAX_fr"] = "MAX of";
492   -ln["AVG_fr"] = "AVG of";
493   -ln["FIRST_fr"] = "FIRST of";
494   -ln["LAST_fr"] = "LAST of";
  551 +ln["GROUP BY_fr"] = "GROUPE PAR";
  552 +ln["CALCULATE_fr"] = "CALCULER";
  553 +ln["Calculate_fr"] = "Calculer";
  554 +ln["aggregatorField_fr"] = "Champ";
  555 +
  556 +ln["disableGroupBy_fr"] = "DÉSACTIVER LE GROUPE PAR";
  557 +ln["enableGroupBy_fr"] = "ACTIVER LE GROUPE PAR";
  558 +
  559 +ln["COUNT_fr"] = "COMPTE de";
  560 +ln["SUM_fr"] = "SOMME de";
  561 +ln["MIN_fr"] = "MIN de";
  562 +ln["MAX_fr"] = "MAX de";
  563 +ln["AVG_fr"] = "AVG de";
  564 +ln["FIRST_fr"] = "PREMIER de";
  565 +ln["LAST_fr"] = "DERNIER de";
495 566  
496 567 //SELECT VISUALIZATION
497 568  
498   -ln["addDatalet_fr"] = "ADD";
499   -ln["modifyDatalet_fr"] = "MODIFY";
  569 +ln["addDatalet_fr"] = "AJOUTER";
  570 +ln["modifyDatalet_fr"] = "MODIFIER";
500 571  
501 572 //datalet-preview
502   -ln["previewTab_fr"] = "DATALET PREVIEW";
503   -ln["infoTab_fr"] = "DATALET INFO";
  573 +ln["previewTab_fr"] = "APERÇU DU DATALET";
  574 +ln["infoTab_fr"] = "INFORMATIONS DU DATALET";
504 575  
505 576 //select-inputs
506   -ln["baseInfo_fr"] = "BASE INFO";
507   -ln["inputs_fr"] = "INPUTS";
  577 +ln["baseInfo_fr"] = "INFORMATIONS DE BASE";
  578 +ln["inputs_fr"] = "DONNÉES";
508 579 ln["options_fr"] = "OPTIONS";
509 580  
510 581 //vslider
511   -ln["search_fr"] = "Search";
512   -
513   -ln["datatable_fr"] = "Table";
514   -ln["barchart_fr"] = "Bar Chart";
515   -ln["columnchart_fr"] = "Column Chart";
516   -ln["areachart_fr"] = "Area Chart";
517   -ln["linechart_fr"] = "Line Chart";
518   -ln["heatmap_fr"] = "Heat Map";
519   -ln["piechart_fr"] = "Pie Chart";
520   -ln["scatterchart_fr"] = "Scatter Chart";
521   -ln["bubblechart_fr"] = "Bubble Chart";
522   -ln["treemap_fr"] = "Tree Map";
523   -ln["leafletjs_fr"] = "Map";
524   -ln["leafletjs-geojson_fr"] = "Geojson Map";
525   -
526   -ln["datatableDescription_fr"] = "A table is a means of arranging data in rows and columns.";
527   -ln["barchartDescription_fr"] = "A bar chart is a chart that presents grouped data with rectangular bars plotted horizontally with lengths proportional to the values that they represent.";
528   -ln["columnchartDescription_fr"] = "A column chart is a chart that presents grouped data with rectangular bars plotted vertically with lengths proportional to the values that they represent.";
529   -ln["areachartDescription_fr"] = "An area chart is a chart which displays graphically quantitive data. The area between axis and line are emphasized with colors and textures. Commonly one compares with the area chart two or more quantities.";
530   -ln["linechartDescription_fr"] = "A line chart is chart which displays information as a series of data points called 'markers' connected by straight line segments. A line chart is often used to visualize a trend in data over intervals of time.";
531   -ln["heatmapDescription_fr"] = "A heat map is a graphical representation of data where the individual values contained in a matrix are represented as colors.";
532   -ln["piechartDescription_fr"] = "A pie chart is a circular statistical graphic, which is divided into slices to illustrate numerical proportion. In the pie chart, the arc length of each slice, and consequently its central angle and area, is proportional to the quantity it represents.";
533   -ln["scatterchartDescription_fr"] = "A scatter chart is a type of plot or mathematical diagram using Cartesian coordinates to display values for typically two variables for a set of data. The data is displayed as a collection of points, each having the value of one variable determining the position on the horizontal axis and the value of the other variable determining the position on the vertical axis.";
534   -ln["bubblechartDescription_fr"] = "A bubble chart is a type of chart that displays three dimensions of data. Each entity with its triplet (v1, v2, v3) of associated data is plotted as a disk that expresses two of the vi values through the disk's xy location and the third through its size.";
535   -ln["treemapDescription_fr"] = "A tree map is a chart for displaying hierarchical data by using nested rectangles.";
  582 +ln["search_fr"] = "Rechercher";
  583 +
  584 +ln["datatable_fr"] = "Tableau";
  585 +ln["barchart_fr"] = "Diagramme à barres";
  586 +ln["columnchart_fr"] = "Histogramme";
  587 +ln["areachart_fr"] = "Diagramme de zone";
  588 +ln["linechart_fr"] = "Diagramme linéaire";
  589 +ln["heatmap_fr"] = "Carte Thermique";
  590 +ln["piechart_fr"] = "Diagramme Circulaire";
  591 +ln["scatterchart_fr"] = "Diagramme de dispersion";
  592 +ln["bubblechart_fr"] = "Diagramme à bulles";
  593 +ln["treemap_fr"] = "Carte d'arborescence";
  594 +ln["leafletjs_fr"] = "Carte";
  595 +ln["leafletjs-geojson_fr"] = "Carte Geojson";
  596 +
  597 +ln["datatableDescription_fr"] = "Un tableau est un moyen d'organiser les données dans des rangées et des colonnes.";
  598 +ln["barchartDescription_fr"] = "Un diagramme à barres est un graphique qui représente des données groupées au moyen de barres rectangulaires disposées horizontallement avec des longueurs proportionnelles aux valeurs qu'elles représentent.";
  599 +ln["columnchartDescription_fr"] = "Un histogramme est un graphique qui représente des données groupées au moyen de barres rectangulaires disposées verticallement avec des longueurs proportionnelles aux valeurs qu'elles représentent.";
  600 +ln["areachartDescription_fr"] = "Un diagramme de zone est un graphique qui propose des données quantitatives de manière graphique. La zone entre l'axe et la ligne est accentuée par des couleurs et des textures. En général, minimum deux données quantitatives sont utilisées pour être comparées dans ce genre de graphique.";
  601 +ln["linechartDescription_fr"] = "Un diagramme linéaire est un graphique qui propose des informations sous forme d'une série de points de données appelés des 'marqueurs', reliés entre eux pour former des lignes continues. Un diagramme linéaire est souvent utilisé pour visualiser une tendance dans les données en parallèle avec des périodes de temps données.";
  602 +ln["heatmapDescription_fr"] = "Une carte thermique est une représentation graphique de données dans laquelle les valeurs individuelles contenues dans une matrice sont représentées à l'aide de couleurs.";
  603 +ln["piechartDescription_fr"] = "Un diagramme circulaire est un graphique statistique qui est séparé en deux pour illustrer des proportions numériques. Dans un diagramme circulaire, la longueur de l'arc de chaque parties, et par conséquent son angle central et sa superficie, est proportionnelle à la quantité qu'elle représente.";
  604 +ln["scatterchartDescription_fr"] = "Un diagramme de dispersion est un type de graphique ou de diagramme mathématque qui utilise des coordonnées cartésiennes pour mettre en évidence des valeurs pour deux variables d'un jeu de données. Les données sont mises se traduisent par un regroupement de points, chacun ayant la valeur d'une variable déterminant la position sur l'axe horizontal et la valeur de l'autre variable qui détermine la position sur l'axe vertical.";
  605 +ln["bubblechartDescription_fr"] = "Un diagramme à bulles est un graphique qui propose des données à trois dimensions. Chaque entité avec ses triplets (v1, v2, v3) de données associées est agencée comme un disque qui exprime deux des valeurs vi au moyen de l'emplacement xy du disque ainsi que de la taille du troisième.";
  606 +ln["treemapDescription_fr"] = "Une arte d'arborescence est un graphique qui permet de visualiser les données hiérarchiques à l'aide de rectangles imbriqués.";
536 607 ln["leafletjsDescription_fr"] = "";
537 608 ln["leafletjs-geojsonDescription_fr"] = "";
538 609  
539 610 //inputs
540   -ln["title_fr"] = "Title"
  611 +ln["title_fr"] = "Titre";
541 612 ln["description_fr"] = "Description";
542 613  
543   -ln["sortAscending_fr"] = "SORTED ASCENDING";
544   -ln["sortDescending_fr"] = "SORTED DESCENDING";
545   -ln["unsort_fr"] = "UNSORTED";
  614 +ln["sortAscending_fr"] = "CLASSÉ DE MANIÈRE ASCENDANTE";
  615 +ln["sortDescending_fr"] = "CLASSÉ DE MANIÈRE DESCENDANTE";
  616 +ln["unsort_fr"] = "PAS CLASSÉ";
546 617  
547   -//--> "_" not allowed!
548   -ln["TITLE_fr"] = "TITLE";
  618 +ln["TITLE_fr"] = "TITRE";
549 619 ln["DESCRIPTION_fr"] = "DESCRIPTION";
550   -ln["XAxis_fr"] = "X-AXIS";
551   -ln["YAxis_fr"] = "Y-AXIS";
552   -ln["NumericXAxis_fr"] = "X-AXIS";
553   -ln["NumericYAxis_fr"] = "Y-AXIS";
554   -ln["Column_fr"] = "COLUMN";
555   -ln["Level_fr"] = "LEVEL";
  620 +ln["XAxis_fr"] = "AXE DES X";
  621 +ln["YAxis_fr"] = "AXE DES Y";
  622 +ln["NumericXAxis_fr"] = "AXE DES X";
  623 +ln["NumericYAxis_fr"] = "AXE DES Y";
  624 +ln["Column_fr"] = "COLONNE";
  625 +ln["Level_fr"] = "NIVEAU";
556 626 ln["SliceLabels_fr"] = "LABEL";
557   -ln["SliceSizes_fr"] = "SIZE";
  627 +ln["SliceSizes_fr"] = "TAILLE";
558 628 ln["Latitude_fr"] = "LATITUDE";
559 629 ln["Longitude_fr"] = "LONGITUDE";
560   -ln["BalloonContent_fr"] = "BALLOON CONTENT";
  630 +ln["BalloonContent_fr"] = "CONTENU DE LA BULLE";
561 631 ln["GEOJSON_fr"] = "GEOJSON";
562   -ln["GEOJSONContent_fr"] = "GEOJSON CONTENT";
563   -ln["BubbleContent_fr"] = "BUBBLE CONTENT";
564   -ln["BubbleSize_fr"] = "BUBBLE SIZE";
565   -ln["Categories_fr"] = "CATEGORY";
566   -
567   -ln["TITLEDescription_fr"] = "The datalet title.";
568   -ln["DESCRIPTIONDescription_fr"] = "The datalet description.";
569   -ln["XAxisDescription_fr"] = "The x-axis.";
570   -ln["YAxisDescription_fr"] = "The y-axis.";
571   -ln["NumericXAxisDescription_fr"] = "The x-axis.";
572   -ln["NumericYAxisDescription_fr"] = "The y-axis.";
573   -ln["ColumnDescription_fr"] = "The column of the table.";
574   -ln["LevelDescription_fr"] = "The level of the tree map.";
575   -ln["SliceLabelsDescription_fr"] = "The label of the slices.";
576   -ln["SliceSizesDescription_fr"] = "The size of the slices.";
577   -ln["LatitudeDescription_fr"] = "The latitude of locations.";
578   -ln["LongitudeDescription_fr"] = "The longitude of locations.";
579   -ln["BalloonContentDescription_fr"] = "The content of balloons.";
580   -ln["GEOJSONDescription_fr"] = "The GeoJSON data.";
581   -ln["GEOJSONContentDescription_fr"] = "The content of GeoJSON.";
582   -ln["BubbleContentDescription_fr"] = "The content of bubbles.";
583   -ln["BubbleSizeDescription_fr"] = "The size of bubbles.";
584   -ln["CategoriesDescription_fr"] = "The category that splits the y-axis values. If selected only the first selected y-axis will be considered.";
  632 +ln["GEOJSONContent_fr"] = "CONTENU GEOJSON";
  633 +ln["BubbleContent_fr"] = "CONTENU DE LA BULLE";
  634 +ln["BubbleSize_fr"] = "TAILLE DE LA BULLE";
  635 +ln["Categories_fr"] = "CATÉGORIE";
  636 +
  637 +ln["TITLEDescription_fr"] = "Le titre du datalet.";
  638 +ln["DESCRIPTIONDescription_fr"] = "La description du datalet.";
  639 +ln["XAxisDescription_fr"] = "L'axe des x.";
  640 +ln["YAxisDescription_fr"] = "L'axe des y.";
  641 +ln["NumericXAxisDescription_fr"] = "L'axe des x.";
  642 +ln["NumericYAxisDescription_fr"] = "L'axe des y.";
  643 +ln["ColumnDescription_fr"] = "La colonne du tableau.";
  644 +ln["LevelDescription_fr"] = "Le niveau de la carte d'arborescence.";
  645 +ln["SliceLabelsDescription_fr"] = "Le label des parts.";
  646 +ln["SliceSizesDescription_fr"] = "La taille des parts.";
  647 +ln["LatitudeDescription_fr"] = "La latitude des localisations.";
  648 +ln["LongitudeDescription_fr"] = "La longitude des localisations.";
  649 +ln["BalloonContentDescription_fr"] = "Le contenu des bulles.";
  650 +ln["GEOJSONDescription_fr"] = "Les données GeoJSON.";
  651 +ln["GEOJSONContentDescription_fr"] = "Le contenu de GeoJSON.";
  652 +ln["BubbleContentDescription_fr"] = "Le contenu des bulles.";
  653 +ln["BubbleSizeDescription_fr"] = "La taille des bulles.";
  654 +ln["CategoriesDescription_fr"] = "La catégorie qui sépare les valeurs de l'axe des x. Si sélectionné, seulement le premier axe des y sera considéré.";
585 655  
586 656 //options
587   -ln["x-axis-label_fr"] = "X Axis Label";
588   -ln["y-axis-label_fr"] = "Y Axis Label";
589   -ln["suffix_fr"] = "Tooltip Suffix";
590   -ln["legend_fr"] = "Leged";
591   -ln["data-labels_fr"] = "Show Data Labels";
592   -ln["stack_fr"] = "Stack";
593   -ln["theme_fr"] = "Theme";
  657 +ln["x-axis-label_fr"] = "Label de l'Axe des X";
  658 +ln["y-axis-label_fr"] = "Label de l'Axe des Y";
  659 +ln["suffix_fr"] = "Suffixe d'aide";
  660 +ln["legend_fr"] = "Légende";
  661 +ln["data-labels_fr"] = "Montrer les labels de données";
  662 +ln["stack_fr"] = "Empiler";
  663 +ln["theme_fr"] = "Thème";
594 664 ln["donut_fr"] = "Donut";
595 665  
596   -ln["true_fr"] = "Yes";
597   -ln["false_fr"] = "No";
598   -ln["bottom_fr"] = "Yes: Bottom";
599   -ln["topRight_fr"] = "Yes: Top Right";
600   -ln["normal_fr"] = "Yes: Normal";
601   -ln["percent_fr"] = "Yes: Percent";
  666 +ln["true_fr"] = "Oui";
  667 +ln["false_fr"] = "Non";
  668 +ln["bottom_fr"] = "Oui: En Bas";
  669 +ln["topRight_fr"] = "Oui: En Haut à Droite";
  670 +ln["normal_fr"] = "Oui: Normal";
  671 +ln["percent_fr"] = "Oui: Pourcentage";
602 672 ln["themeBase_fr"] = "Base";
603 673 ln["themeDarkUnika_fr"] = "Dark Unika";
604 674 ln["themeSandSignika_fr"] = "Sand Signika";
605 675 ln["themeGridLight_fr"] = "Grid Light";
606 676 ln["themeSpod_fr"] = "Spod";
607 677  
608   -ln["x-axis-labelDescription_fr"] = "The x-axis label.";
609   -ln["y-axis-labelDescription_fr"] = "The y-axis label.";
610   -ln["suffixDescription_fr"] = "The suffix added to data labels in the tooltip.";
611   -ln["legendDescription_fr"] = "The leged position.";
612   -ln["data-labelsDescription_fr"] = "Show/hide data labels.";
613   -ln["themeDescription_fr"] = "The theme affects the appearance and colors of the chart.";
614   -ln["stackDescription_fr"] = "The stack type.";
615   -ln["donutDescription_fr"] = "Pie will become Donut! :) (or viceversa).";
  678 +ln["x-axis-labelDescription_fr"] = "Le label de l'axe des x.";
  679 +ln["y-axis-labelDescription_fr"] = "Le label de l'axe des y.";
  680 +ln["suffixDescription_fr"] = "Le suffixe ajouté aux labels des données dans l'aide.";
  681 +ln["legendDescription_fr"] = "La position de la légende.";
  682 +ln["data-labelsDescription_fr"] = "Montrer/cacher les labels de données.";
  683 +ln["themeDescription_fr"] = "Le thème affecte l'apparence des couleurs du graphique.";
  684 +ln["stackDescription_fr"] = "Le type de regroupement.";
  685 +ln["donutDescription_fr"] = "La Tarte va devenir un Donut! :) (ou vice versa).";
616 686  
617 687 /******** NL ********/
618 688  
... ... @@ -624,22 +694,44 @@ ln[&quot;slide2Title_nl&quot;] = &quot;SELECT DATA&quot;;
624 694 ln["slide2Subtitle_nl"] = "Select the fields on the left. The table will show the values related to the selected fields.";
625 695 ln["slide3Title_nl"] = "SELECT VISUALIZATION";
626 696 ln["slide3Subtitle_nl"] = "Select a visualization, fill out inputs and options.";
627   -ln["back_nl"] = "BACK TO THE FUTURE";
  697 +ln["back_nl"] = "TERUG NAAR DE TOEKOMST";
628 698 ln["forward_nl"] = "FORWARD";
629 699  
630 700 //SELECT DATASET
631 701  
632   -ln["listView_nl"] = "LIST VIEW";
633   -ln["treeMapView_nl"] = "TREE MAP VIEW";
634   -ln["extendedSearch_nl"] = "EXTENDED SEARCH";
  702 +ln["selectedUrl_nl"] = "Selected url";
  703 +ln["wrongUrl_nl"] = "Invalid url or data provider not supported yet.";
  704 +
  705 +ln["providersDatasets_nl"] = "PROVIDERS DATASETS";
  706 +ln["spodUsersDatasets_nl"] = "COCREATED DATASETS";
  707 +ln["extendedDatasets_nl"] = "FROM EXTENDED SEARCH";
  708 +ln["datasets_nl"] = "DATASETS LIST";
  709 +
635 710 ln["provider_nl"] = "Provider";
  711 +ln["all_nl"] = "All";
  712 +ln["allDescription_nl"] = "Shows the datasets of all associated providers.";
  713 +ln["providerName_nl"] = "Provider";
  714 +ln["providerNameDescription_nl"] = "Shows only the datasets of the selected provider.";
  715 +
  716 +ln["search_nl"] = "Search";
  717 +ln["standard_nl"] = "Standard";
  718 +ln["standardDescription_nl"] = "The search function works only on datasets names.";
  719 +ln["extended_nl"] = "Extended [NOT AVAILABLE]";
  720 +ln["extendedDescription_nl"] = "The search function works the entire contents of the datasets.";
  721 +
  722 +ln["version_nl"] = "Version";
  723 +ln["showLast_nl"] = "Show last";
  724 +ln["showLastDescription_nl"] = "Shows only the latest version of the datasets.";
  725 +ln["showAll_nl"] = "Show all";
  726 +ln["showAllDescription_nl"] = "Shows all versions of the datasets.";
  727 +
  728 +//select-dataset-controllet
  729 +ln["datasetsInfo_nl"] = "DATASET INFO";
636 730 ln["showing_nl"] = "Showing";
637 731 ln["to_nl"] = "to";
638 732 ln["of_nl"] = "of";
639   -ln["datasets_nl"] = "datasets";
640   -ln["suggestedDatasets_nl"] = "Suggested datasets";
641   -ln["selectedUrl_nl"] = "Selected url";
642   -ln["wrongUrl_nl"] = "Invalid url or data provider not supported yet.";
  733 +ln["datasetsRows_nl"] = "dataset";
  734 +ln["search_nl"] = "Search";
643 735  
644 736 //SELECT DATA
645 737  
... ... @@ -748,7 +840,6 @@ ln[&quot;sortAscending_nl&quot;] = &quot;SORTED ASCENDING&quot;;
748 840 ln["sortDescending_nl"] = "SORTED DESCENDING";
749 841 ln["unsort_nl"] = "UNSORTED";
750 842  
751   -//--> "_" not allowed!
752 843 ln["TITLE_nl"] = "TITLE";
753 844 ln["DESCRIPTION_nl"] = "DESCRIPTION";
754 845 ln["XAxis_nl"] = "X-AXIS";
... ... @@ -791,7 +882,7 @@ ln[&quot;CategoriesDescription_nl&quot;] = &quot;The category that splits the y-axis values. If
791 882 ln["x-axis-label_nl"] = "X Axis Label";
792 883 ln["y-axis-label_nl"] = "Y Axis Label";
793 884 ln["suffix_nl"] = "Tooltip Suffix";
794   -ln["legend_nl"] = "Leged";
  885 +ln["legend_nl"] = "Legend";
795 886 ln["data-labels_nl"] = "Show Data Labels";
796 887 ln["stack_nl"] = "Stack";
797 888 ln["theme_nl"] = "Theme";
... ... @@ -812,7 +903,7 @@ ln[&quot;themeSpod_nl&quot;] = &quot;Spod&quot;;
812 903 ln["x-axis-labelDescription_nl"] = "The x-axis label.";
813 904 ln["y-axis-labelDescription_nl"] = "The y-axis label.";
814 905 ln["suffixDescription_nl"] = "The suffix added to data labels in the tooltip.";
815   -ln["legendDescription_nl"] = "The leged position.";
  906 +ln["legendDescription_nl"] = "The legend position.";
816 907 ln["data-labelsDescription_nl"] = "Show/hide data labels.";
817 908 ln["themeDescription_nl"] = "The theme affects the appearance and colors of the chart.";
818 909 ln["stackDescription_nl"] = "The stack type.";
... ...
locales/dataset_table_ln.js
... ... @@ -50,25 +50,25 @@ ln[&quot;download_docs_it&quot;] = &quot;Download documento&quot;;
50 50 /******** fr ********/
51 51  
52 52 //data-table
53   -ln["selectedData_fr"] = "DATASET";
54   -ln["rows_fr"] = "rows";
  53 +ln["selectedData_fr"] = "JEU DE DONNÉES";
  54 +ln["rows_fr"] = "rangées";
55 55 ln["type_fr"] = "TYPE";
56   -ln["warning_fr"] = "WARNING";
57   -ln["showing_fr"] = "Showing";
58   -ln["to_fr"] = "to";
59   -ln["of_fr"] = "of";
60   -ln["search_fr"] = "Search";
  56 +ln["warning_fr"] = "AVERTISSEMENT";
  57 +ln["showing_fr"] = "Aperçu";
  58 +ln["to_fr"] = "à";
  59 +ln["of_fr"] = "de";
  60 +ln["search_fr"] = "Rechercher";
61 61 ln["VER_fr"] = "VER";
62   -ln["USER_fr"] = "USER";
63   -ln["NAME_fr"] = "NAME";
64   -ln["DATA_fr"] = "DATA";
  62 +ln["USER_fr"] = "UTILISATEUR";
  63 +ln["NAME_fr"] = "NOM";
  64 +ln["DATA_fr"] = "DONNÉES";
65 65 ln["DESCRIPTION_fr"] = "DESCRIPTION";
66   -ln["TOOLS_fr"] = "TOOLS";
67   -ln["last_version_fr"] = "Last version";
68   -ln["open_fr"] = "Open";
69   -ln["download_csv_fr"] = "Download as CSV";
70   -ln["copy_link_fr"] = "Copy link";
71   -ln["download_docs_fr"] = "Download docs";
  66 +ln["TOOLS_fr"] = "OUTILS";
  67 +ln["last_version_fr"] = "Dernière version";
  68 +ln["open_fr"] = "Ouvrir";
  69 +ln["download_csv_fr"] = "Télécharger en CSV";
  70 +ln["copy_link_fr"] = "Copier le lien";
  71 +ln["download_docs_fr"] = "Télécharger les documents";
72 72  
73 73 /******** nl ********/
74 74  
... ...
locales/datasetexplorer_ln.js
... ... @@ -2,12 +2,16 @@ datasetexplorer_ln = [];
2 2  
3 3 /*EN*/
4 4 datasetexplorer_ln["ode+back_en"] = "<< Click to navigate back to the top level.";
  5 +datasetexplorer_ln["path_en"] = "Path: ";
5 6  
6 7 /*IT*/
7 8 datasetexplorer_ln["ode+back_it"] = "<< Clicca qui per tornare al livello precedente.";
  9 +datasetexplorer_ln["path_it"] = "Path: ";
8 10  
9 11 /*FR*/
10 12 datasetexplorer_ln["ode+back_fr"] = "<< Click to navigate back to the top level.";
  13 +datasetexplorer_ln["path_fr"] = "Path: ";
11 14  
12 15 /*NL*/
13 16 datasetexplorer_ln["ode+back_nl"] = "<< Click to navigate back to the top level.";
  17 +datasetexplorer_ln["path_nl"] = "Path: ";
... ...
locales/room_controllet_ln.js
... ... @@ -26,15 +26,15 @@ room_ln[&quot;and_it&quot;] = &quot;e&quot;;
26 26  
27 27 /* FR */
28 28  
29   -room_ln["thisRoom_fr"] = "This room";
30   -room_ln["createdBy_fr"] = "created by";
31   -room_ln["has_fr"] = "has";
32   -room_ln["many_fr"] = "many";
33   -room_ln["few_fr"] = "few";
34   -room_ln["views_fr"] = "views";
35   -room_ln["comments_fr"] = "comments";
36   -room_ln["datasets_fr"] = "datasets";
37   -room_ln["and_fr"] = "and";
  29 +room_ln["thisRoom_fr"] = "Cet espace commun";
  30 +room_ln["createdBy_fr"] = "créé par";
  31 +room_ln["has_fr"] = "contient";
  32 +room_ln["many_fr"] = "plusieurs";
  33 +room_ln["few_fr"] = "peu";
  34 +room_ln["views_fr"] = "visualisations";
  35 +room_ln["comments_fr"] = "commentaires";
  36 +room_ln["datasets_fr"] = "jeux de données";
  37 +room_ln["and_fr"] = "et";
38 38  
39 39 /* NL */
40 40  
... ...