Signal scale updates on initialization
See original GitHub issueI would like to have a signal that computes scaled coordinates once, when the scale is initialized with a valid domain and range, and then no longer reacts to any further updates to the scale.
In the following spec, if react
is true
, only a single warning is printed which suggests that the signal is correctly marked as dependent on the scale. However, setting react
to false
produces a single [undefined, undefined]
which suggests that the signal is no longer being topologically evaluated after the scales are initialized? It’s unclear to me if this is a bug or by design and, if the latter, how I would accomplish my desired outcome.
{
"$schema": "https://vega.github.io/schema/vega/v4.json",
"width": 200,
"height": 200,
"data": [
{
"name": "source_0",
"url": "data/cars.json"
}
],
"signals": [
{
"name": "box_x",
"update": "warn('box_x', [scale(\"x\", 100),scale(\"x\", 150)])",
"react": false
}
],
"scales": [
{
"name": "x",
"type": "linear",
"domain": {"data": "source_0", "field": "Horsepower"},
"range": [0, {"signal": "width"}]
}
]
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Initialize a bound signal with expression · Issue #1435 - GitHub
I need to be able to initialize bound signals using an expression. ... Signal scale updates on initialization #1433.
Read more >Initialization of Signal, State, and Parameter Data ... - MathWorks
Model a system that reinitializes states during execution, which means that the application can restart the entire system. · Store initial values in...
Read more >Extreme Memorization via Scale of Initialization - OpenReview
Our empirical investigation reveals that increasing the scale of initialization correlates with misalignment of representations and gradients across examples ...
Read more >Signals | Vega
≥ 4.4 An initialization expression for the value of the signal. This expression will be invoked once and only once. The init and...
Read more >vega - Changing domain or label from signal more than once
When vegaEmbed first initializes from the spec, everything comes up fine. In the javascript console, the signal update expression prints out the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There are internal use cases for bridging event streams with the dataflow graph, but no JSON-spec level use cases I know of other than initialization.
Addressed with the
init
signal property, released in Vega v4.4.0.