diff --git a/public/data/textile/processes.json b/public/data/textile/processes.json index 05b556354..c6d290386 100644 --- a/public/data/textile/processes.json +++ b/public/data/textile/processes.json @@ -2583,44 +2583,6 @@ "waste": 0, "alias": "passenger-car" }, - { - "name": "Mise en décharge de textiles, FR", - "displayName": "Mise en décharge de textiles, FR", - "info": "Traitement de fin de vie > Mise en décharge > Fractions de déchets", - "unit": "kg", - "source": "Ecobalyse", - "correctif": "Précalcul Ecobalyse à partir de Base Impacts", - "step_usage": "Utilisation", - "uuid": "9adaf403-4eda-4d9c-80c3-f231754644ca", - "impacts": { - "acd": 0, - "cch": 0, - "etf": 0, - "etf-c": 0, - "fru": 0, - "fwe": 0, - "htc": 0, - "htc-c": 0, - "htn": 0, - "htn-c": 0, - "ior": 0, - "ldu": 0, - "mru": 0, - "ozd": 0, - "pco": 0, - "pma": 0, - "swe": 0, - "tre": 0, - "wtu": 0, - "ecs": 66.8698252969278, - "pef": 68.14941102161761 - }, - "heat_MJ": 0, - "elec_pppm": 0, - "elec_MJ": 0, - "waste": 0, - "alias": null - }, { "name": "Fin de vie hors voiture (transport en camion, incinération, mise en décharge)", "displayName": "Fin de vie hors voiture (transport en camion, incinération, mise en décharge)", @@ -2964,7 +2926,7 @@ "alias": "dyeing-cellulosic-fiber" }, { - "name": "Blanchiment", + "name": "bleaching, textile//[RoW] bleaching, textile", "displayName": "Blanchiment", "info": "Textile > Ennoblissement > Blanchiment", "unit": "kg", diff --git a/src/Data/Gitbook.elm b/src/Data/Gitbook.elm index 52ed7febe..71b4e2e2e 100644 --- a/src/Data/Gitbook.elm +++ b/src/Data/Gitbook.elm @@ -16,6 +16,7 @@ type Path | FoodTransformation -- Transformation des ingrédients | FoodTransport -- Transport entre étapes | FoodUse -- Consommation + | TextileCircularFootprintFormula -- Circular Footprint Formula (CFF) | TextileComplementMicrofibers -- Complément textile microfibres | TextileDistribution -- Distribution textile | TextileDurability -- Durabilité textile @@ -69,6 +70,9 @@ pathToString path = FoodUse -> "alimentaire/etapes-du-cycles-de-vie/consommation" + TextileCircularFootprintFormula -> + "textile/cycle-de-vie-des-produits-textiles/circular-footpring-formula-cff" + TextileComplementMicrofibers -> "textile/complements-hors-acv/microfibres" @@ -124,7 +128,7 @@ pathToString path = "textile/etapes-du-cycle-de-vie/etape-1-matieres" TextileSpinning -> - "textile/etapes-du-cycle-de-vie/etape-2-fabrication-du-fil-new" + "textile/cycle-de-vie-des-produits-textiles/etape-2-fabrication-du-fil" TextileTransport -> "textile/parametres-transverses/transport" diff --git a/src/Page/Explore/Common.elm b/src/Page/Explore/Common.elm index 1a3ea90fd..a097ae159 100644 --- a/src/Page/Explore/Common.elm +++ b/src/Page/Explore/Common.elm @@ -1,10 +1,8 @@ module Page.Explore.Common exposing ( boolText , impactBarGraph - , scopesView ) -import Data.Scope as Scope exposing (Scope) import Html exposing (..) import Html.Attributes exposing (..) import Views.Format as Format @@ -19,17 +17,6 @@ boolText bool = "non" -scopesView : { a | scopes : List Scope } -> Html msg -scopesView = - .scopes - >> List.map - (\scope -> - span [ class "badge badge-success" ] - [ text <| Scope.toLabel scope ] - ) - >> div [ class "d-flex gap-1" ] - - impactBarGraph : Bool -> Float -> Float -> Html msg impactBarGraph detailed max score = let diff --git a/src/Page/Explore/Countries.elm b/src/Page/Explore/Countries.elm index 59d27e9a1..4c640feb1 100644 --- a/src/Page/Explore/Countries.elm +++ b/src/Page/Explore/Countries.elm @@ -9,7 +9,6 @@ import Data.Transport as Transport import Dict.Any as Dict import Html exposing (..) import Html.Attributes exposing (..) -import Page.Explore.Common as Common import Page.Explore.Table as Table exposing (Table) import Route import Views.Format as Format @@ -68,11 +67,6 @@ table distances countries { detailed, scope } = else Nothing - , Just - { label = "Domaines" - , toValue = Table.StringValue <| .scopes >> List.map Scope.toLabel >> String.join "/" - , toCell = Common.scopesView - } , if detailed then Just { label = "Distances" diff --git a/src/Page/Explore/Impacts.elm b/src/Page/Explore/Impacts.elm index fde85a3ff..06d9c0189 100644 --- a/src/Page/Explore/Impacts.elm +++ b/src/Page/Explore/Impacts.elm @@ -41,45 +41,45 @@ table { detailed, scope } = , toValue = Table.StringValue <| .unit , toCell = \def -> code [] [ text def.unit ] } - , { label = "Normalisation (PEF)" + , { label = "Normalisation (Coût Evt)" , toValue = Table.FloatValue <| - .pefData + .ecoscoreData >> Maybe.map (.normalization >> Unit.impactToFloat) >> Maybe.withDefault 0 , toCell = \def -> - def.pefData + def.ecoscoreData |> Maybe.map (.normalization >> Unit.impactToFloat >> Format.formatRichFloat 2 def.unit) |> Maybe.withDefault (text "N/A") } - , { label = "Pondération (PEF)" + , { label = "Pondération (Coût Evt)" , toValue = Table.FloatValue <| - .pefData + .ecoscoreData >> Maybe.map (.weighting >> Split.toFloat) >> Maybe.withDefault 0 - , toCell = .pefData >> Maybe.map (.weighting >> Format.splitAsPercentage 2) >> Maybe.withDefault (text "N/A") + , toCell = .ecoscoreData >> Maybe.map (.weighting >> Format.splitAsPercentage 2) >> Maybe.withDefault (text "N/A") } - , { label = "Normalisation (Sc. Imp.)" + , { label = "Normalisation (PEF)" , toValue = Table.FloatValue <| - .ecoscoreData + .pefData >> Maybe.map (.normalization >> Unit.impactToFloat) >> Maybe.withDefault 0 , toCell = \def -> - def.ecoscoreData + def.pefData |> Maybe.map (.normalization >> Unit.impactToFloat >> Format.formatRichFloat 2 def.unit) |> Maybe.withDefault (text "N/A") } - , { label = "Pondération (Sc. Imp.)" + , { label = "Pondération (PEF)" , toValue = Table.FloatValue <| - .ecoscoreData + .pefData >> Maybe.map (.weighting >> Split.toFloat) >> Maybe.withDefault 0 - , toCell = .ecoscoreData >> Maybe.map (.weighting >> Format.splitAsPercentage 2) >> Maybe.withDefault (text "N/A") + , toCell = .pefData >> Maybe.map (.weighting >> Format.splitAsPercentage 2) >> Maybe.withDefault (text "N/A") } , { label = "Description" , toValue = Table.StringValue .description diff --git a/src/Page/Explore/TextileMaterials.elm b/src/Page/Explore/TextileMaterials.elm index 0ac362b89..c631278a9 100644 --- a/src/Page/Explore/TextileMaterials.elm +++ b/src/Page/Explore/TextileMaterials.elm @@ -2,6 +2,7 @@ module Page.Explore.TextileMaterials exposing (table) import Data.Country as Country import Data.Dataset as Dataset +import Data.Gitbook as Gitbook import Data.Scope exposing (Scope) import Data.Split as Split import Data.Textile.Material as Material exposing (Material) @@ -14,6 +15,8 @@ import Route import Static.Db exposing (Db) import Views.Alert as Alert import Views.Format as Format +import Views.Icon as Icon +import Views.Link as Link recycledToString : Maybe Material.Id -> String @@ -25,6 +28,12 @@ recycledToString maybeMaterialID = table : Db -> { detailed : Bool, scope : Scope } -> Table Material String msg table db { detailed, scope } = + let + withPill url content = + div + [ classList [ ( "text-center", not detailed ) ] ] + [ content, Link.smallPillExternal [ href (Gitbook.publicUrlFromPath url) ] [ Icon.question ] ] + in { filename = "materials" , toId = .id >> Material.idToString , toRoute = .id >> Just >> Dataset.TextileMaterials >> Route.Explore scope @@ -64,16 +73,19 @@ table db { detailed, scope } = , { label = "Complément Microfibres" , toValue = Table.FloatValue <| .origin >> Origin.toMicrofibersComplement >> Unit.impactToFloat , toCell = - \{ origin } -> - div [ classList [ ( "text-center", not detailed ) ] ] - [ Origin.toMicrofibersComplement origin - |> Unit.impactToFloat - |> Format.formatImpactFloat { unit = "\u{202F}Pts/kg", decimals = 2 } - ] + .origin + >> Origin.toMicrofibersComplement + >> Unit.impactToFloat + >> Format.formatImpactFloat { unit = "\u{202F}Pts/kg", decimals = 2 } + >> withPill Gitbook.TextileComplementMicrofibers } , { label = "Procédé de fabrication du fil" , toValue = Table.StringValue <| .origin >> Origin.threadProcess - , toCell = .origin >> Origin.threadProcess >> text + , toCell = + .origin + >> Origin.threadProcess + >> text + >> withPill Gitbook.TextileSpinning } , { label = "Procédé de recyclage" , toValue = Table.StringValue <| .recycledProcess >> Maybe.map .name >> Maybe.withDefault "N/A" @@ -112,14 +124,13 @@ table db { detailed, scope } = >> Maybe.map (.manufacturerAllocation >> Split.toFloat) >> Maybe.withDefault 0 , toCell = - \{ cffData } -> - case cffData of - Just { manufacturerAllocation } -> - manufacturerAllocation - |> Format.splitAsFloat 1 - - Nothing -> - text "N/A" + .cffData + >> Maybe.map + (.manufacturerAllocation + >> Format.splitAsFloat 1 + >> withPill Gitbook.TextileCircularFootprintFormula + ) + >> Maybe.withDefault (text "N/A") } , { label = "CFF: Rapport de qualité" , toValue = @@ -128,14 +139,13 @@ table db { detailed, scope } = >> Maybe.map (.recycledQualityRatio >> Split.toFloat) >> Maybe.withDefault 0 , toCell = - \{ cffData } -> - case cffData of - Just { recycledQualityRatio } -> - recycledQualityRatio - |> Format.splitAsFloat 1 - - Nothing -> - text "N/A" + .cffData + >> Maybe.map + (.recycledQualityRatio + >> Format.splitAsFloat 1 + >> withPill Gitbook.TextileCircularFootprintFormula + ) + >> Maybe.withDefault (text "N/A") } ] }