### Summary

`ansible-inventory --graph` can be specified with a group though, the output is not a JSON format so that we cannot parse the output easily.

It would be helpful for us if the `ansible-inventory --list` could accept the group name.


### Issue Type

Feature Idea

### Component Name

inventory

### Additional Information

For example, I created an inventory file.

```
[groupA]
host1
host2
host3

[groupA:children]
groupA1

[groupB]
host11
host12

[groupC]
host21
host22
host23
host24

[groupC:children]
groupA1

[groupA1]
host101
host102
host103
host104
host105
```

Then I can get filtered output with `ansible-inventory --graph`.  It can catch all hosts in the child group as well.

```
$ ansible-inventory -i inventory --graph groupA
@groupA:
  |--@groupA1:
  |  |--host101
  |  |--host102
  |  |--host103
  |  |--host104
  |  |--host105
  |--host1
  |--host2
  |--host3
```

However `ansible-inventory --list` performs to output only for the whole hosts in the inventory.  We need the filtered output as the `--graph` in a JSON format.


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
result = []
        for (name, val) in sorted(dump.items()):
            result.append(InventoryCLI._graph_name('{%s = %s}' % (name, val), depth))
        return result
    @staticmethod
    def _graph_name(name, depth=0):
        if depth:
            name = "  |" * (depth) + "--%s" % name
        return name
    def _graph_group(self, group, depth=0):
        result = [self._graph_name('@%s:' % group.name, depth)]
        depth = depth + 1
        for kid in group.child_groups:
            result.extend(self._graph_group(kid, depth))
        if group.name != 'all':
            for host in group.hosts:
                result.append(self._graph_name(host.name, depth))
                if context.CLIARGS['show_vars']:
                    result.extend(self._show_vars(self._get_host_variables(host), depth + 1))
        if context.CLIARGS['show_vars']:
            result.extend(self._show_vars(self._get_group_variables(group), depth))
        return result
    def inventory_graph(self):
        start_at = self._get_group(context.CLIARGS['pattern'])
        if start_at:
            return '\n'.join(self._graph_group(start_at))
        else:
            raise AnsibleOptionsError("Pattern must be valid group name when using --graph")
    def json_inventory(self, top):