Text * Markdown
Type:
markdown
• Category:visualization
• Tags:text
,markdown
Description
Render markdown text widget
Parameters
Name | Type | Description | Required | Default |
---|---|---|---|---|
widgetId | string | Widget ID (auto-generated if not provided) | no | |
textExpr | string | Expr -> value (converted to string) | no | |
text | string | Direct text (used if no textExpr) | no | |
fontSize | string | Font size for markdown rendering (e.g. '14px', '1em'). Leave empty for default. | no | "" |
Help
Overview
The Markdown Text Widget worker renders a block of markdown‑styled text that can be displayed within a financial‑markets dashboard. It accepts either a direct text string or an expression that evaluates to a string, and optionally allows you to specify the font size used for rendering. If no widget identifier is supplied, the system will generate one automatically.
Inputs
- widgetId (
string
) – Unique identifier for the widget. When omitted, the worker creates an auto‑generated ID. - textExpr (
string
) – An expression that is evaluated to produce the markdown content. The resulting value is converted to a string before rendering. - text (
string
) – Plain markdown text supplied directly. This field is used only when textExpr is not provided. - fontSize (
string
, default =""
) – CSS‑compatible font size for the rendered markdown (e.g.,14px
,1em
). Leaving this empty lets the widget fall back to its default size.
Minimal Example Usage
Below is a concise example showing how to invoke the worker to display a simple markdown snippet with a custom font size:
{
"widgetId": "marketOverview",
"text": "# Market Summary\n- **S&P 500**: 4,500\n- **NASDAQ**: 14,200",
"fontSize": "16px"
}
In this example:
- The widget is explicitly named marketOverview.
- The text field contains a markdown heading and a bullet list describing two market indices.
- The fontSize is set to
16px
, which overrides the default rendering size.
If you prefer to compute the markdown content dynamically, replace the text field with textExpr, for instance:
{
"widgetId": "dynamicMarketInfo",
"textExpr": "generateMarketMarkdown()",
"fontSize": "1.2em"
}
Here, generateMarketMarkdown()
is a user‑defined function that returns a markdown string, and the widget will render it using a relative font size of 1.2em
.