FigureCollection.publish¶
Publish a figure after local safety and live-limit preflight.
Returns the server's id, revision, validation status and support report.
The backend automatically selects the first valid figure when no preferred
view exists. set_preferred=True explicitly selects this upload with a
second permission-checked request. If that request fails, the figure remains
saved and the original SDK exception includes its response as published_figure.
Unsupported traces/frames are uploaded so the server report is preserved.
Signature¶
publish(*, target: Dataset | Notebook, figure: PlotlyFigure | dict[str, Any], title: str, config: dict[str, Any] | None=None, set_preferred: bool=False) -> Figure
Parameters¶
| Name | Type | Required | Default |
|---|---|---|---|
target |
Dataset \| Notebook |
yes | - |
figure |
PlotlyFigure \| dict[str, Any] |
yes | - |
title |
str |
yes | - |
config |
dict[str, Any] \| None |
no | None |
set_preferred |
bool |
no | False |
Fields¶
Schema: FigureCreateSchema
| Field | Type | Required |
|---|---|---|
author |
string |
no |
config |
object |
no |
conversation_id |
string |
no |
dataset_id |
string |
no |
figure |
object |
yes |
frames |
array<object> |
no |
name |
string |
yes |
notebook_id |
string |
no |
plotly_version |
string |
no |
producer |
string |
no |
project_id |
string |
yes |
source |
string |
no |
source_provenance |
object |
no |
spec |
object |
no |
title |
string |
no |
Return shape¶
HTTP 201 — Created
Schema: FigureSchema
| Field | Type | Required |
|---|---|---|
author |
string |
no |
config |
object |
no |
conversation_id |
string |
no |
created_at |
string |
yes |
dataset_id |
string |
no |
figure |
object |
yes |
frames |
array<object> |
no |
id |
string |
yes |
name |
string |
yes |
notebook_id |
string |
no |
original_upload_hash |
string |
no |
original_upload_id |
string |
no |
owner_id |
string |
no |
plotly_version |
string |
no |
point_count |
integer |
no |
producer |
string |
no |
project_id |
string |
yes |
revision |
integer |
no |
size_bytes |
integer |
no |
source |
string |
yes |
source_provenance |
object |
no |
spec |
object |
no |
support_report |
object |
no |
title |
string |
no |
updated_at |
string |
yes |
validation_reasons |
array<string> |
no |
validation_status |
string |
no |
Permission¶
Required permission: figure:create
HTTP¶
POST /api/figures/upload-json/ (uploadFigureJson)
Usage¶
figure_collection.publish(target, figure, title)