{"renderer":{"visualVariables":[{"type":"transparencyInfo","valueExpression":"$feature[\"P10_RP_LOC\"];\n$feature[\"P10RP_PROP\"];\n$feature[\"P10RP_GRAT\"];\n$feature[\"P10RP_HLM\"];\nvar fieldNames = [ \"P10_RP_LOC\", \"P10RP_PROP\", \"P10RP_GRAT\", \"P10RP_HLM\" ];\nvar numFields = 4;\nvar maxValueField = null;\nvar maxValue = -Infinity;\nvar value, i, totalValue = null;\nfor(i = 0; i < numFields; i++) {\nvalue = $feature[fieldNames[i]];\nif(value > 0) {\nif(value > maxValue) {\nmaxValue = value;\nmaxValueField = fieldNames[i];\n}\nelse if (value == maxValue) {\nmaxValueField = null;\n}\n}\nif(value != null && value >= 0) {\nif (totalValue == null) { totalValue = 0; }\ntotalValue = totalValue + value;\n}\n}\nvar strength = null;\nif (maxValueField != null && totalValue > 0) {\nstrength = (maxValue / totalValue) * 100;\n}\nreturn strength;","valueExpressionTitle":"Importance de la prédominance","stops":[{"value":49,"transparency":70},{"value":73,"transparency":0}]},{"type":"sizeInfo","target":"outline","expression":"view.scale","valueExpression":"$view.scale","stops":[{"size":1.5,"value":24101},{"size":0.75,"value":75314},{"size":0.375,"value":301256},{"size":0,"value":602513}]}],"authoringInfo":{"visualVariables":[{"type":"transparencyInfo","minSliderValue":34.766697163769443,"maxSliderValue":100}]},"type":"uniqueValue","valueExpression":"// Rédigez un script qui renvoie une valeur qui sera utilisée pour dessiner des entités.\n// Par exemple, déterminez le pourcentage d'hommes :\n// Round(($feature.MalePop / $feature.TotalPop) * 100, 2)\n\nvar propriétaire = $feature[\"P10RP_PROP\"];\nvar locataire = $feature[\"P10_RP_LOC\"];\nvar vacant = $feature[\"P10RP_GRAT\"];\nvar social = $feature[\"P10RP_HLM\"];\n\n// The fields from which to calculate predominance\n// The expression will return the alias of the predominant field\n\nvar fields = [\n { value: $feature[\"P10RP_PROP\"], alias: \"Part des propriétaires en 2010\" },\n { value: $feature[\"P10_RP_LOC\"], alias: \"Part des locataires en 2010\" },\n { value: $feature[\"P10RP_GRAT\"], alias: \"Part des logements vacants en 2010\" },\n { value: $feature[\"P10RP_HLM\"], alias: \"Part des logements sociaux en 2010\" }\n];\n\n// Returns the predominant category as the alias\n// defined in the fields array. If there is a tie,\n// then both names are concatenated and used to\n// indicate the tie\n\nfunction getPredominantCategory(fieldsArray){\n var maxValue = -Infinity;\n var maxCategory = \"\";\n for(var k in fieldsArray){\n if(fieldsArray[k].value > maxValue){\n maxValue = fieldsArray[k].value;\n maxCategory = fieldsArray[k].alias;\n } else if (fieldsArray[k].value == maxValue){\n// maxCategory = maxCategory + \"/\" + fieldsArray[k].alias;\n maxCategory = \"Pas de dominance\";\n }\n }\n return IIF(maxValue <= 0, null, maxCategory);\n}\n\ngetPredominantCategory(fields);","valueExpressionTitle":"Propriétaires ou locataires ? ","defaultSymbol":null,"uniqueValueInfos":[{"value":"Part des propriétaires en 2010","symbol":{"color":[6,107,45,255],"outline":{"color":[85,255,0,64],"width":0.75,"type":"esriSLS","style":"esriSLSSolid"},"type":"esriSFS","style":"esriSFSSolid"},"label":"Part des propriétaires en 2010"},{"value":"Part des locataires en 2010","symbol":{"color":[0,38,115,255],"outline":{"color":[115,178,255,64],"width":0.75,"type":"esriSLS","style":"esriSLSSolid"},"type":"esriSFS","style":"esriSFSSolid"},"label":"Part des locataires en 2010"},{"value":"Part des logements vacants en 2010","symbol":{"color":[140,11,0,255],"outline":{"color":[255,0,0,64],"width":0.75,"type":"esriSLS","style":"esriSLSSolid"},"type":"esriSFS","style":"esriSFSSolid"},"label":"Part des logements vacants en 2010"},{"value":"Pas de dominance","symbol":{"color":[235,235,235,255],"outline":{"color":[255,255,255,64],"width":0.75,"type":"esriSLS","style":"esriSLSSolid"},"type":"esriSFS","style":"esriSFSSolid"},"label":"Pas de dominance"}],"backgroundFillSymbol":{"color":[0,0,0,0],"outline":{"color":[153,153,153,64],"width":0.75,"type":"esriSLS","style":"esriSLSSolid"},"type":"esriSFS","style":"esriSFSSolid"}},"transparency":20}