0

I'm trying to represent a structure where one object falls under 2 other objects in an organization chart. Minified, it looks like this:

Organization chart

Which is constructed by the following JSON (and a lot of formatting):

{ 'name': 'Main',
  'children': [
    { 'name': '1',
      'children': [
        { 'name': 'Foo' },
        { 'name': 'Bar' }
      ]
    },
    { 'name': '2',
      'children': [
        { 'name': 'Woof' }
      ]
    },
    { 'name': '3',
      'children': [
        { 'name': 'Fizz' }
      ]
    },
    { 'name': '4',
      'children': [
        { 'name': 'Buzz' },
        { 'name': 'Bar' },
        { 'name': 'Ping' }
      ]
    }
  ]
}

Bar is both under 1 and 4, an unfortunate side effect of an otherwise sound UX decision. All fine, as long as Bar doesn't have children of it's own. Which it has (not currently drawn). Which gets very, very messy.

I'm starting to think an organization chart is going to cut it, but let's see if it's still salvageable.

I could:

  • leave it as is and write all children of Bar (and their children, it's at least 3 levels deep) at both locations. That would be a major data duplication problem.

  • move 4 between 1 and 2 and move Bar at 4 to the side, so they can be merged. To the best of my knowledge, this would break my current charting tool (no support for nodes with multiple parents), so would involve a lot of work to re-write software I haven't written myself (but I do have complete access to the source). It also would be less intuitive, since the order actually makes sense now (there's a reason the nodes have been numbered there).

  • use a signpost on any but one Bar to indicate the rest of it is located somewhere else. Whether the signpost should be part of Bar or a child of any but one of them I'm not sure, but it could work. I'm not sure it would be obvious to anyone not familiar with such uncommon notation.

The entire graph can be partially collapsed at will, so size isn't a major concern.

Actual code used to generate image (dependency).

Can I clean this mess up before making it any worse by writing down Bar's children? Solutions with decent scaling when more duplication arises (Bar has 3 parents, Bar has 4 parents, etc.) are preferred.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.