github.com/turbot/steampipe@v1.7.0-rc.0.0.20240517123944-7cef272d4458/tests/manual_testing/node_reuse/many_withs/dashboard.sp (about)

     1  dashboard "many_withs" {
     2    input "i1" {
     3      sql = <<-EOQ
     4            select arn as label, arn as value from aws_account
     5          EOQ
     6      placeholder = "enter a val"
     7    }
     8  
     9  
    10    title         = "Many Withs"
    11    with "n1" {
    12     query = query.q1
    13    }
    14    with "n2" {
    15      sql = <<-EOQ
    16            select $1
    17          EOQ
    18      args = [self.input.i1.value]
    19    }
    20  
    21    graph {
    22      title = "Relationships"
    23      width = 12
    24      type  = "graph"
    25  
    26  
    27      node "n1" {
    28        sql = <<-EOQ
    29      select
    30        $1 as id,
    31        $1 as title
    32  EOQ
    33        args = [ with.n1.rows[0]]
    34      }
    35      node "n2" {
    36        sql = <<-EOQ
    37      select
    38        $1 as id,
    39        $1 as title
    40  EOQ
    41  
    42        args = [ with.n2.rows[0]]
    43      }
    44      edge "n1_n2" {
    45        sql = <<-EOQ
    46      select
    47        $1 as from_id,
    48        $2 as to_id
    49  EOQ
    50        args = [with.n1.rows[0], with.n2.rows[0]]
    51      }
    52    }
    53  
    54  }
    55  
    56  query "q1"{
    57    sql = <<-EOQ
    58            select 'n1'
    59          EOQ
    60  }