group.js 968 B

1234567891011121314151617181920212223
  1. var __rest = (this && this.__rest) || function (s, e) {
  2. var t = {};
  3. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  4. t[p] = s[p];
  5. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  6. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  7. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
  8. t[p[i]] = s[p[i]];
  9. }
  10. return t;
  11. };
  12. import { createGroups } from './utils/order';
  13. import { GroupN } from './groupN';
  14. /**
  15. * The Group transform group data by x and y channels, and aggregate.
  16. */
  17. export const Group = (options = {}) => {
  18. const { channels = ['x', 'y'] } = options, rest = __rest(options, ["channels"]);
  19. const groupBy = (I, mark) => createGroups(channels, I, mark);
  20. return GroupN(Object.assign(Object.assign({}, rest), { groupBy }));
  21. };
  22. Group.props = {};
  23. //# sourceMappingURL=group.js.map