Skip to content

&src and &dst glob filters don't work on connections where both endpoints are in the same sub-container #2691

@thirstyice

Description

@thirstyice

Basically the title. See example below.
v0.7.1 and D2 Playground
All layout engines

classes: {
  orange: {
    style.stroke: orange
  }
}
direction: right

container: {
  w -> x: {style.stroke: green}
  x -> y
  y -> z
  y.class: orange
}

a -> container.y
container.y -> another.b

# Filters on connection globs work as expected
(** -> **)[*]: {
  &style.stroke: green
  label: I'm green!
}

# src/dst filters on connection globs do not work when both endpoints are in the same sub-container
(** -> container.y)[*]: {
  label: I should be red!
}
(** -> **)[*]: {
  &dst.class: orange
  style.stroke: red
}

# src/dst filters do work when the endpoints are in different sub-containers though
(container.y -> **)[*]: {
  label: I should be magenta!
}
(** -> **)[*]: {
  &src.class: orange
  style.stroke: magenta
}
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions