Source: compute/types/typesVotesForGeom.js

  1. import * as typesVoteArrays from './typesVoteArrays.js'
  2. import * as typesVotesForGeomGrid from './typesVotesForGeomGrid.js'
  3. /**
  4. * @namespace typesVotesForGeom
  5. */
  6. /**
  7. * @typedef {typesVotesForGeomGrid.votesForGeomGrid | votesForGeomCells | votesForGeomIntervals | votesForGeomPlurality} votesForGeom
  8. */
  9. /**
  10. * @typedef {object} votesForGeomCells - Vote data for just one voter geometry in the form of 2D cells.
  11. * @property {number[][][]} cells - each cell is a list of points.
  12. * @property {typesVoteArrays.rankings} rankings - rankings for each cell
  13. * @property {typesVoteArrays.cansByRankList} cansByRankList - cansByRank for each cell
  14. * @property {number[]} voteCounts - number of votes for each cell
  15. * @property {number} totalVotes - total number of votes
  16. * @memberof typesVotesForGeom
  17. */
  18. /**
  19. * @typedef {object} rankingPolygons2D - calculated cells of 2D policy space where voters share the same ranking.
  20. * @property {number[][][]} cells - each cell is a list of points.
  21. * @property {typesVoteArrays.rankings} rankings - rankings for each cell
  22. * @property {typesVoteArrays.cansByRankList} cansByRankList - cansByRank for each cell
  23. * @memberof typesVotesForGeom
  24. */
  25. /**
  26. * @typedef {object} votesForGeomIntervals - Vote data for just one voter geometry in the form of 1D intervals.
  27. * @property {typesVoteArrays.rankings} rankings - rankings for each interval
  28. * @property {typesVoteArrays.cansByRankList} cansByRankList - cansByRank for each interval
  29. * @property {number[]} voteCounts - number of votes for each interval
  30. * @property {number} totalVotes - total number of votes
  31. * @property {number[]} intervalBorders - midpoints and two infinity points
  32. * @memberof typesVotesForGeom
  33. */
  34. /**
  35. * @typedef {object} rankingIntervals1D - calculated intervals of 1D policy space where voters share the same ranking.
  36. * @property {typesVoteArrays.rankings} rankings - rankings for each interval
  37. * @property {typesVoteArrays.cansByRankList} cansByRankList - cansByRank for each interval
  38. * @property {number[]} intervalBorders - midpoints and two infinity points
  39. * @memberof typesVotesForGeom
  40. */
  41. /**
  42. * @typedef {object} votesForGeomPlurality - Vote data for just one voter geometry in the form of 1D intervals.
  43. * @property {number[]} countByCan - The number of plurality votes for a candidate.
  44. * @property {number} totalVotes - total number of votes
  45. * @memberof typesVotesForGeom
  46. */
  47. export default {}