Widget formatting using CLI
An attribute that has a specific widget format will be displayed automatically on the IPLM Web page for the object on which it has been set. For example, if an attribute with a format describing a table has been set on a specific IP Version, then that IPV's page will interpret that attribute and display a table.
| Widget field | Required or optional | Example |
|---|---|---|
| display | Required | The widget type to be displayed, for example, 'graph', 'table', or 'links' |
| widgetHeader | Optional | If provided, the markdown-enabled text is displayed in the widget header. If omitted, the widget header will not be displayed. |
| placement | Optional - If the placement field is specified for one widget on the dashboard, it must be specified for all. | Ordered list to control the widget position, width and height across a 6-column layout. Parameters include:
The values are specified in order: [x, y, w, h] Example: "placement": [4,8,2,4] |
| tab: { name: <value> } | Optional | The name of a tab on which the widget should be displayed. For a particular IP, IPV, Library, or Saved query, if at least one of its attributes specifies a tab name, then widgets for any of its other attributes not assigned to a tab will appear on the “Other” tab. |
| tab: { rank: <value> } | Optional |
A numeric ranking (1-99) for a tab which assists in ordering the set of named tabs from left-to-right. Tabs are ordered based on their rank, then secondarily by their name. The “Other” tab, if present, will always appear to the right of the named tabs (or last on the drop-down menu, if there is no room to comfortably display all the tabs).
The tab.name field is required if tab.rank is specified. Example:
“tab”: {
“name”: “My Tab”,
“rank”: 1
} |
| config | Optional | Options for configuring how your widget displays. |
| data | Required | The widget data to be displayed. |
| dashboard | Optional |
Set to Check out Create widget for IP page custom title for more information. Custom title widgets for the IP page must be enabled by an Admin.
|
| xKeyData | Optional | For an x-axis of type “category”, this field specifies the labels to be displayed for each category (tick).
For an x-axis of type “number” or “time”, this field specifies the coordinates along the x-axis. This field is relevant for the following widgets: bar, line, scatter, and area. |
| column (deprecated) | Optional | Display the widget in either column 1 or column 2. Column 2 is the default. |
| order (deprecated) | Optional | The order of the widget in its column. Lower order numbers will display earlier in their column, as referenced by the 'position' argument. Lowest possible order is 0. |
| position (deprecated) | Optional | Sets whether the 'order' of the widget is referenced from the top or the bottom of the column. Either 'top' or 'bottom'; 'bottom' is the default. |
Example:
pi lib attribute set tutorial FAQ '{"widgetHeader": "#####FAQ", "display":"text", "placement": [0,0,2,2], "data":[{"title":"When does this IP ship?","text":"This IP has already shipped 3 times"}]}'}'
Example project dashboard
This image shows a dashboard that uses the widgetHeader and tab options.
See the individual widget format pages for more information on each type: