Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.
JsonExplorer class
JsonExplorer
JsonExplorer allows you to render JSON objects in HTML with a **collapsible** navigation.
Signature
export declare class JsonExplorer
Import
import { JsonExplorer } from '@grafana/ui';
Constructors
Properties
Methods
constructor(json, open, config, key)
Constructs a new instance of the JsonExplorer
class
Signature
constructor(json: any, open?: number, config?: JsonExplorerConfig, key?: string | undefined);
Parameters
json property
Signature
json: any;
appendChildren method
Appends all the children to children element Animated option is used when user triggers this via a click
Signature
appendChildren(animated?: boolean): void;
Parameters
Returns:
void
isNumberArray method
Signature
isNumberArray(): boolean;
Returns:
boolean
openAtDepth method
Open all children up to a certain depth. Allows actions such as expand all/collapse all
Signature
openAtDepth(depth?: number): void;
Parameters
Returns:
void
removeChildren method
Removes all the children from children element Animated option is used when user triggers this via a click
Signature
removeChildren(animated?: boolean): void;
Parameters
Returns:
void
render method
Renders an HTML element and installs event listeners
Signature
render(skipRoot?: boolean): HTMLDivElement;
Parameters
Returns:
HTMLDivElement
{HTMLDivElement}
renderArray method
Signature
renderArray(): Element;
Returns:
Element
toggleOpen method
Toggles isOpen
state
Signature
toggleOpen(): void;
Returns:
void