diff --git a/IPython/core/display.py b/IPython/core/display.py index fa64d9c..41d9378 100644 --- a/IPython/core/display.py +++ b/IPython/core/display.py @@ -800,7 +800,7 @@ class JSON(DisplayObject): """ # wrap data in a property, which warns about passing already-serialized JSON _data = None - def __init__(self, data=None, url=None, filename=None, expanded=False, metadata=None, **kwargs): + def __init__(self, data=None, url=None, filename=None, expanded=False, metadata=None, root='root', **kwargs): """Create a JSON display object given raw data. Parameters @@ -817,8 +817,13 @@ class JSON(DisplayObject): Metadata to control whether a JSON display component is expanded. metadata: dict Specify extra metadata to attach to the json display object. + root : str + The name of the root element of the JSON tree """ - self.metadata = {'expanded': expanded} + self.metadata = { + 'expanded': expanded, + 'root': root, + } if metadata: self.metadata.update(metadata) if kwargs: