Inuvialuit Research
  • Climate Action Map
  • Indicator Dashboard
  1. Indicators
  2. Mobility
  • Indicators
    • Preface
    • General
    • Dwellings
    • Education
    • Labour Force
    • Language
    • Mobility
    • Population
    • Prices
    • Traditional Activities
    • Community Summary
  • Climate Action Map
    • Highlights
    • Map
    • Story Map

Mobility

1 Year Mobility

tData = transpose(data)
regions = [...new Set(df_regions.Region)]
statistic = [...new Set(df_statistic.Statistic)]
identity = [...new Set(df_identity.Identity)]
enrollment = [...new Set(df_enrollment.Enrollment)]
viewof region1 = Inputs.select(regions, {value:"Inuvialuit Region",label:"Region 1"})
viewof region2 = Inputs.select(regions.filter(d=>d!=region1), {value:"Inuvik",label:"Region 2"})
viewof statisticInput = Inputs.select(statistic, {label:"Mobility"})
viewof identityInput = Inputs.select(identity,{label:"Identity"})
viewof enrollmentInput = Inputs.select(enrollment,{label:"Enrollment"})
viewof values = Inputs.select(["Percent","Count"],{label:"Values"})
Plotly = require("plotly.js-dist")
d3 = require("d3")
filteredDataRegion1 = tData.filter((d)=> d.Identity === identityInput && d.Enrollment ===enrollmentInput && d.Statistic===statisticInput &&d.Region ===region1 )
filteredDataRegion2 = tData.filter((d)=> d.Identity === identityInput && d.Enrollment ===enrollmentInput && d.Statistic===statisticInput &&d.Region ===region2 )
groupedAgeRegion1 = d3.rollup(filteredDataRegion1, v=>d3.sum(v,d=> d.Count), d=>d.Age)
groupedAgeRegion2 = d3.rollup(filteredDataRegion2, v=>d3.sum(v,d=> d.Count), d=>d.Age)

{

const countsRegion1 = Array.from( groupedAgeRegion1.values() )
const totalCountsRegion1 = countsRegion1.reduce( ( partialSum, a ) => partialSum + a, 0 )
const percentsRegion1 = countsRegion1.map( (c)=> c/totalCountsRegion1 * 100 )
const countsRegion2 = Array.from( groupedAgeRegion2.values() )
const totalCountsRegion2 = countsRegion2.reduce( ( partialSum, a ) => partialSum + a, 0 )
const percentsRegion2 = countsRegion2.map( (c)=> c/totalCountsRegion2 * 100 )

const trace1 = {
    y: values==="Count"? countsRegion1: percentsRegion1,
    x: Array.from(groupedAgeRegion1.keys()),
    type: 'line',
    name: region1
  }

const trace2 = {
    y: values==="Count"? countsRegion2: percentsRegion2,
    x: Array.from(groupedAgeRegion2.keys()),
    type: 'line',
    name: region2
  }

const traces = [trace1, trace2]
const div = DOM.element('div');
Plotly.newPlot(div,traces,{ width : width });
return div
}

Inuvialuit Regional Corporation

Established in 1984, the Inuvialuit Regional Corporation (IRC) manages the settlement outlined in the Inuvialuit Final Agreement (IFA) and represents the collective Inuvialuit interest in dealings with governments and the world at large. Our goal is to continually improve the economic, social and cultural well-being of Inuvialuit through the implementation of the IFA and by all other available means.

Our Sponsors

IRC would like to thank Environment and Climate Change Canada and the Climate Action Fund for supporting the development of the Inuvialuit Settlement Region Climate Change Action Map.

Contact

Roxanne Springer
IRC's Climate Change Program Coordinator
rspringer@inuvialuit.com