First, this changes the arrayify internal such that if values is a GeoJSON object, the corresponding array of features or geometries is returned. This makes GeoJSON objects usable as mark data for any mark, rather than being limited to the geo mark.
Second, this changes the field internal such that if the requested field is undefined on the given object d, it falls back to d.properties if d is a GeoJSON Feature object (d.type === "Feature"). This may have a slight performance overhead for such a core routine, but I expect the cost is negligible and I don’t think there is an alternative if we want GeoJSON to be more universally supported.
Fixes #1745. Fixes #1172.
First, this changes the
arrayify
internal such that ifvalues
is a GeoJSON object, the corresponding array of features or geometries is returned. This makes GeoJSON objects usable as mark data for any mark, rather than being limited to the geo mark.Second, this changes the
field
internal such that if the requested field is undefined on the given objectd
, it falls back tod.properties
ifd
is a GeoJSON Feature object (d.type === "Feature"
). This may have a slight performance overhead for such a core routine, but I expect the cost is negligible and I don’t think there is an alternative if we want GeoJSON to be more universally supported.