Skip to content

Commit 707f162

Browse files
committed
Document config signal definitions.
1 parent 5cfd3d5 commit 707f162

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/docs/config.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ For example, this Vega spec includes light-gray axis grid lines by default:
4141
- [Legend Properties](#legends)
4242
- [Title Properties](#title)
4343
- [Scale Range Properties](#scale-range)
44+
- [Signals](#signals)
4445
{: .column-list }
4546

4647
## <a name="view"></a>View Properties
@@ -463,3 +464,25 @@ This example sets new default color palettes.
463464
```
464465

465466
[Back to Top](#reference)
467+
468+
469+
## <a name="signals"></a>Signal Definitions
470+
471+
Configuration files may also contain signal definitions for the top-level scope of a Vega specification. The syntax is identical to [standard signal definitions](../signals/): an array of named signal objects. Adding signal definitions to a configuration can be useful for defining style variables (colors, font sizes, etc.) that may be used elsewhere within either the config or a spec itself. Signals directly defined within a specification itself take precedence over those defined in the configuration.
472+
473+
### Usage
474+
475+
To enable dynamic scaling of font sizes, one can define a signal that for a font size scale factor, then define other config entries relative to this value:
476+
477+
```json
478+
{
479+
"signals": [
480+
{"name": "fontSizeScale", "value": 1}
481+
],
482+
"text": {
483+
"fontSize": {"signal": "11 * fontSizeScale"}
484+
}
485+
}
486+
```
487+
488+
[Back to Top](#reference)

0 commit comments

Comments
 (0)