header:
  title: Car Traffic
  description: Traffic related analyses.
layout:
  index_by_hour:
  - type: plotly
    title: Network congestion index
    description: by hour
    datasets:
      dataset: analysis/traffic/traffic_stats_by_road_type_and_hour.csv
    traces:
    - fill: none
      "y": $dataset.congestion_index
      x: $dataset.hour
      mode: lines
      whiskerwidth: 0.0
      type: scatter
      name: $dataset.road_type
      colorRamp: Spectral
    layout:
      xaxis:
        title: Hour
        color: "#444"
        type: '-'
      barmode: overlay
      yaxis:
        title: Index
        color: "#444"
        type: '-'
  - type: csv
    title: Traffic stats per road type
    description: daily
    dataset: analysis/traffic/traffic_stats_by_road_type_daily.csv
    enableFilter: false
    showAllRows: true
  map:
  - type: map
    title: Traffic statistics
    height: 12.0
    datasets:
      traffic: analysis/traffic/traffic_stats_by_link_daily.csv
    display:
      lineWidth:
        dataset: traffic
        columnName: simulated_traffic_volume
        join: link_id
        scaleFactor: 20000.0
      lineColor:
        dataset: traffic
        columnName: avg_speed
        join: link_id
        colorRamp:
          steps: 5
          ramp: RdYlBu
          reverse: false
      fill: {}
      fillHeight: {}
      radius: {}
    shapes:
      file: analysis/network/network.avro
      join: id
  info:
  - type: text
    backgroundColor: transparent
    content: |
      ### Notes
      - The speed performance index is the ratio of average travel speed and the maximum permissible road speed.
      A performance index of 0.5, means that the average speed is half of the maximum permissible speed. A road with a performance index below 0.5 is considered to be in a congested state.
      - The congestion index is the ratio of time a road is in an uncongested state. 0.5 means that a road is congested half of the time. A road with 1.0 is always uncongested.

      cf. *A Traffic Congestion Assessment Method for Urban Road Networks Based on Speed Performance Index* by Feifei He, Xuedong Yan*, Yang Liu, Lu Ma.
