jamesplease / jamesplease/simple-segment-aggregation.js
Generic aggregation
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
What would it take for this library to become generic?
I think it could work like this:
``` js
var aggregates = aggregate(segments, callback)
```
The callback would receive the following arguments:
`currentAggregate, previousAggregate, currentSegment`
Return `true` to aggregate it with the previous segment. False creates a new aggregation.
One interesting tidbit is the `continuesForward` and `continuesBackward` properties. In a generalized form, these are attributes attached to an aggregation based on the previous and next segment. I could easily generalize this...I'm imagining a system like...
``` js
(aggregation, prevAggregation, nextAggregation) => {
aggregation.continuesForward = calculateIfSegmentContinuesForward(...arguments);
aggregation.continuesForward = calculateIfSegmentContinuesForward(...arguments);
}
```
This would let us attach all sorts of properties to aggregations. Is it a sketch aggregation? Is the previous aggregation a different phase of the same project? All of this data may come into play in the UI in the future.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not name implementation files, tests, or an entry point. Review the library's current aggregation API and determine the callback contract and aggregation properties that would define a complete generic implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100