render_plotly
Render Plotly charts to SVG, PNG, JPG, or PDF format with customizable styling and output as a URL, file path, or base64 data.
Instructions
Render a Plotly chart to SVG, PNG, JPG, or PDF format with comprehensive styling and output options. Output options:
"link" (default): Returns a localhost URL for easy viewing
"filepath": Saves to disk and returns the file path
"raw": Returns base64 data for images or raw SVG string
Examples:
Basic chart: Provide plotlyCode with Plotly.newPlot() call
Localhost image: Set format='png' with output='link' (default) to get a localhost URL (always show the user the link he can view the diagram in a browser)
Save to disk: Set output='filepath' to save and get file path
Base64 image: Set output='raw' to get base64 data for tags
Custom styling: Use backgroundColor, width, height, and plotlyConfig options
Plotly Code Example: Plotly.newPlot('plotly-chart', [{ x: [1, 2, 3, 4, 5], y: [1, 2, 4, 8, 16], type: 'scatter' }], { margin: { t: 0 } });
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | No | ||
| format | No | svg | |
| height | No | ||
| output | No | link | |
| quality | No | ||
| filePath | No | ||
| plotlyCode | Yes | ||
| responsive | No | ||
| displaylogo | No | ||
| displayModeBar | No | ||
| backgroundColor | No | ||
| modeBarButtonsToRemove | No |