Class DashboardSpec
Added to a builder page with PageSpec.dashboard(DashboardSpec), which adds the panel and card-section cards
to the page and the dashboard toolkit pack. A page has at most one dashboard. Every structural problem is
E-77 when the page is built.
Example:
- Since:
- 10.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic DashboardSpecCreates a dashboard.grid(int value) Sets the number of grid columns.Appends a panel for a card already added to the page (for example withPageSpec.html(...)), spanning one column.Appends a panel for a card already added to the page.Appends a card panel spanning one column.Appends a card panel.Appends a chart panel spanning one column.Appends a chart panel.persist(PersistSpec value) Saves and restores state topics.Sets the rail.Binds the status header to data sources.Sets the heading.toJson()Checks this dashboard against no page cards and returns its JSON.
-
Method Details
-
create
Creates a dashboard.- Parameters:
id- The dashboard id: theviewIdof every section payload, and the default storage namespacedashboard.<id>for the rail width.- Returns:
- A new dashboard.
-
title
Sets the heading.- Parameters:
value- The title.- Returns:
- This object.
-
rail
Sets the rail.- Parameters:
value- The rail.- Returns:
- This object.
-
grid
Sets the number of grid columns.- Parameters:
value- 1 to 4. Defaults to 2.- Returns:
- This object.
-
panel
Appends a chart panel spanning one column.The chart is snapshotted when it is added; later changes to the
ChartDefare not reflected.- Parameters:
chart- The chart.- Returns:
- This object.
-
panel
Appends a chart panel.The chart is snapshotted when it is added; later changes to the
ChartDefare not reflected.- Parameters:
chart- The chart.span- The columns it spans, 1 togrid(int).- Returns:
- This object.
-
panel
Appends a card panel spanning one column.- Parameters:
card- The card. Nothtmlordatatables; usepanel(String)for those.- Returns:
- This object.
-
panel
Appends a card panel.- Parameters:
card- The card. Nothtmlordatatables; usepanel(String, int)for those.span- The columns it spans, 1 togrid(int).- Returns:
- This object.
-
panel
Appends a panel for a card already added to the page (for example withPageSpec.html(...)), spanning one column.- Parameters:
cardId- The card id. The card must be on the page beforePageSpec.dashboard(DashboardSpec).- Returns:
- This object.
-
panel
Appends a panel for a card already added to the page.- Parameters:
cardId- The card id. Seepanel(String).span- The columns it spans, 1 togrid(int).- Returns:
- This object.
-
status
Binds the status header to data sources.- Parameters:
topics-data:<sourceId>topics, normallyTopics.data(id). Each must be a declared source.- Returns:
- This object.
-
persist
Saves and restores state topics.- Parameters:
value- The persistence spec.- Returns:
- This object.
-
toJson
Checks this dashboard against no page cards and returns its JSON.PageSpec.dashboardcallstoJson(Map)instead, so by-id panels resolve.- Returns:
- The
dashboardcontract object. - Throws:
IllegalArgumentException- E-77 on the first problem.
-