Hosts
silverpoint in Plone
At a glance
| Integration | Package | Registry | Kind | Through | Status |
|---|---|---|---|---|---|
| Plone Volto | volto-silverpoint | npm | cms | react | released |
| Plone Classic UI | collective.silverpoint | pypi | cms | python | released |
Draws with volto-silverpoint: @silverpoint/react and @silverpoint/embed 0.11.2; collective.silverpoint: the silverpoint Python package 0.11.0.post1.
| Requirement | |
|---|---|
| Volto | 18 or 19 (tested on 18.36.0 and 19.8.1); Node 22+, pnpm 10 |
| Plone backend | 6.x with plone.volto and plone.restapi; the Volto block needs no backend package |
| Classic UI | Plone 6.0, 6.1 or 6.2 on Python 3.10–3.13 |
Volto: the Silverpoint chart block
pnpm add volto-silverpoint// volto.config.js
module.exports = { addons: ['volto-silverpoint'] };- Add a Silverpoint chart block (group Common, allowed in every content type).
- Give it a table: paste CSV (comma-, semicolon- or tab-separated) or JSON (
[{"col": value}]or{"columns": […], "values": [[…]]}), upload a.csvor.json, or choose a Table file: a File item, fetched each time the block renders. - Choose the chart, map its roles to columns (a role is preselected when exactly one column fits), then set the options, the appearance and the view fields.
A table to paste for a bar chart:
team;wins
A;12
B;9
C;15The block saves plain JSON, never rendered markup, and plone.restapi returns it unchanged:
{
"@type": "silverpointChart",
"chart": "bar-chart",
"table": { "columns": ["team", "wins"], "rows": [{ "team": "A", "wins": 12 }] },
"role_x": "team",
"role_value": "wins",
"opt_orientation": "rows",
"ground": "cyanotype",
"title": "Wins per team"
}Classic UI: the Chart content type
# requirements.txt (or your buildout's eggs)
collective.silverpointRestart, then activate collective.silverpoint under Site Setup → Add-ons (it also installs plone.restapi). Add a Chart: the chart, the data (a CSV or JSON Table file, or the Table as text), the Role mapping and the Options as JSON, and the appearance.
Chart Bar chart
Table as text team,wins
A,12
B,9
C,15
Role mapping {"x": "team", "value": "wins"}
Options {"orientation": "rows"}The add and edit forms validate the chart with the silverpoint package and show its message on the field at fault (an unknown column on the role mapping, an unknown option on the options). A Chart is content: workflow, permissions, versioning and search like any other item. The Silverpoint charts control panel holds the ground, substrate, mode and palette a chart takes when it sets none.
To draw a chart in any template, call the @@silverpoint-chart view:
<!-- a Chart item by UID -->
<div tal:replace="structure python: context.restrictedTraverse('@@silverpoint-chart')(uid=chart_uid)" />
<!-- or a spec built in the template -->
<div tal:replace="structure python: context.restrictedTraverse('@@silverpoint-chart')(
spec={'chart': 'bar-chart', 'data': rows, 'props': {'xKey': 'team', 'valueKey': 'wins'}})" />The view writes a <silverpoint-chart shadow> with the spec and, inside it, the title, the description and the data as an HTML table, which is what a reader without script and a search engine get. The script is served by the site at @@silverpoint-script.js?v=<version> with its integrity, only on pages holding a chart, and the markup has no inline script: it works under Plone's default Content-Security-Policy.
See also
- Plone Volto: the repository and its README
- Plone Classic UI: the repository and its README
- Embed in any page: the spec, the host catalog and
specFromTable, the conformance kit every integration runs - Every host integration