theta.js 920 B

12345678910111213141516171819202122232425262728
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.Theta = exports.getThetaOptions = void 0;
  4. const polar_1 = require("./polar");
  5. const transpose_1 = require("./transpose");
  6. const getThetaOptions = (options = {}) => {
  7. const defaultOptions = {
  8. startAngle: -Math.PI / 2,
  9. endAngle: (Math.PI * 3) / 2,
  10. innerRadius: 0,
  11. outerRadius: 1,
  12. };
  13. return Object.assign(Object.assign({}, defaultOptions), options);
  14. };
  15. exports.getThetaOptions = getThetaOptions;
  16. /**
  17. * Theta = Transpose + Polar.
  18. */
  19. const Theta = (options) => {
  20. const { startAngle, endAngle, innerRadius, outerRadius } = (0, exports.getThetaOptions)(options);
  21. return [
  22. ...(0, transpose_1.Transpose)(),
  23. ...(0, polar_1.Polar)({ startAngle, endAngle, innerRadius, outerRadius }),
  24. ];
  25. };
  26. exports.Theta = Theta;
  27. exports.Theta.props = {};
  28. //# sourceMappingURL=theta.js.map