MCPcopy Create free account
hub / github.com/microsoft/SandDance / gridLayoutGroups

Function gridLayoutGroups

docs/tests/v2/es6/js/sanddance.js:103766–103824  ·  view source on GitHub ↗
(group)

Source from the content-addressed store, hash-verified

103764var _vegaUtil = require("vega-util");
103765
103766function gridLayoutGroups(group) {
103767 var groups = group.items,
103768 n = groups.length,
103769 i = 0,
103770 mark,
103771 items;
103772 var views = {
103773 marks: [],
103774 rowheaders: [],
103775 rowfooters: [],
103776 colheaders: [],
103777 colfooters: [],
103778 rowtitle: null,
103779 coltitle: null
103780 }; // layout axes, gather legends, collect bounds
103781
103782 for (; i < n; ++i) {
103783 mark = groups[i];
103784 items = mark.items;
103785
103786 if (mark.marktype === _constants.Group) {
103787 switch (mark.role) {
103788 case _constants.AxisRole:
103789 case _constants.LegendRole:
103790 case _constants.TitleRole:
103791 break;
103792
103793 case _constants.RowHeader:
103794 views.rowheaders.push(...items);
103795 break;
103796
103797 case _constants.RowFooter:
103798 views.rowfooters.push(...items);
103799 break;
103800
103801 case _constants.ColHeader:
103802 views.colheaders.push(...items);
103803 break;
103804
103805 case _constants.ColFooter:
103806 views.colfooters.push(...items);
103807 break;
103808
103809 case _constants.RowTitle:
103810 views.rowtitle = items[0];
103811 break;
103812
103813 case _constants.ColTitle:
103814 views.coltitle = items[0];
103815 break;
103816
103817 default:
103818 views.marks.push(...items);
103819 }
103820 }
103821 }
103822
103823 return views;

Callers 1

trellisLayoutFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected