You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Warn users when facet data doesn't match mark data (#1014)
* Add warning when facet data doesn't match mark data
* Adjust for tests, add warning svg
* Run prettier
* Renamed files, improved conditions for warning
* Fix typo
* Use arrayify to check the length
Co-authored-by: Mike Bostock <[email protected]>
* Update warning language used.
Co-authored-by: Mike Bostock <[email protected]>
* Remove facet_warning.svg file
* facet warning logic & wording (#1015)
* logic & wording
* remove fcet_warning.svg
* An arguably better test/example plot.
* fix my mistake (ref #1015 (review))
Not sure how to remove the warning from the yarn test log—but this doesn't seem to be blocking
* arrayify(mark.data)?.length
* facetData.length
* revert wording
Co-authored-by: Mike Bostock <[email protected]>
Co-authored-by: Philippe Rivière <[email protected]>
// Warn for the common pitfall of wanting to facet mapped data.
105
+
if(
106
+
facetIndex?.length>1&&// non-trivial faceting
107
+
mark.facet==="auto"&&// no explicit mark facet option
108
+
mark.data!==facet.data&&// mark not implicitly faceted (different data)
109
+
arrayify(mark.data)?.length===facetData.length// mark data seems parallel to facet data
110
+
){
111
+
warn(
112
+
`Warning: the ${mark.ariaLabel} mark appears to use faceted data, but isn’t faceted. The mark data has the same length as the facet data and the mark facet option is "auto", but the mark data and facet data are distinct. If this mark should be faceted, set the mark facet option to true; otherwise, suppress this warning by setting the mark facet option to false.`
0 commit comments