(facetRects)
| 10206 | return polygons; |
| 10207 | } |
| 10208 | function facetSelectionPolygons(facetRects) { |
| 10209 | const polygons = []; |
| 10210 | const linesAndSearches = facetRects.map(({ datum , lines }, i)=>{ |
| 10211 | let group = (0, _search.getSearchGroupFromVegaValue)(datum[(0, _sanddanceSpecs.FieldNames).FacetSearch]); |
| 10212 | return { |
| 10213 | lines, |
| 10214 | search: group |
| 10215 | }; |
| 10216 | }); |
| 10217 | linesAndSearches.forEach(({ lines , search }, i)=>{ |
| 10218 | //take any 2 lines to get a box dimension |
| 10219 | const [x, y] = minMaxPoints(lines.slice(2)); |
| 10220 | polygons.push({ |
| 10221 | search, |
| 10222 | polygon: [ |
| 10223 | [ |
| 10224 | x.min, |
| 10225 | y.min |
| 10226 | ], |
| 10227 | [ |
| 10228 | x.max, |
| 10229 | y.min |
| 10230 | ], |
| 10231 | [ |
| 10232 | x.max, |
| 10233 | y.max |
| 10234 | ], |
| 10235 | [ |
| 10236 | x.min, |
| 10237 | y.max |
| 10238 | ] |
| 10239 | ] |
| 10240 | }); |
| 10241 | }); |
| 10242 | return polygons; |
| 10243 | } |
| 10244 | function minMaxPoints(lines) { |
| 10245 | const points = []; |
| 10246 | lines.forEach((line)=>{ |
no test coverage detected