'follow up question: theta and theta2 chanel encoding by field

this is a follow-up question to my previous question: theta and theta2 chanel encoding by field

Here is a working example, now the data is more complete (5 arcs instead of 1, but 11 are still missing): 5 arcs

I'm using this code to encode the channels radius, radius2, theta, and theta2

"radius": {"value": {"expr": "datum.rdius"}},
"radius2": {"value": {"expr": "datum.rdius2"}},
"theta": {"value": {"expr": "datum.thta"}},
"theta2": {"value": {"expr": "datum.thta2"}},

but what I want is using the field notation style, but unfortunately I'm not able to get the scaling right. The link to the spec that is not working: 5 arcs not working

I use this code:

"radius": {"field": "rdius", "scale": {"domain": [0, "radius2"]}},
"radius2": {"field": "rdius2", "scale": {"domain": [0, "radius2"]}},
"theta": {"field": "thta", "scale": {"domain": [0, "PI*2"]}},
"theta2": {"field": "thta2", "scale": {"domain": [0, "PI*2"]}},

Can someone help with the proper scaling?

Thanks,



Solution 1:[1]

The domain [0, "radius2"] is invalid. In place of "radius2" you either need to specify a number, or a valid expression without any data dependence, like "PI * 2".

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jakevdp