inject_plotly_chart
Inject a Plotly chart into a Hex notebook cell with automatic design-system styling. Define chart type, dataframe, and column mappings to generate the chart.
Instructions
Write a fully styled Plotly chart into a Hex Python cell. Design system (dark theme, color palette, typography) is applied automatically.
chart_type: line | bar | scatter | area | histogram | box | heatmap | funnel | treemap dataframe_var: name of the DataFrame variable already defined in the notebook x_col / y_col: column names for axes color_col: optional column for series coloring extra_kwargs: any additional px.chart() keyword args as a string, e.g. 'barmode="group"' auto_run: if True, immediately triggers run_and_wait to push to app view
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_id": "<project_id>",
"cell_id": "<cell_id>",
"chart_type": "<chart_type>",
"dataframe_var": "<dataframe_var>",
"x_col": "<x_col>",
"y_col": "<y_col>"
},
"name": "inject_plotly_chart"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | No | ||
| x_col | Yes | ||
| y_col | Yes | ||
| height | No | ||
| cell_id | Yes | ||
| auto_run | No | ||
| color_col | No | ||
| chart_type | Yes | ||
| project_id | Yes | ||
| extra_kwargs | No | ||
| dataframe_var | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |