jamesplease / jamesplease/simple-segment-aggregation.js

Generic aggregation

Open
#10 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.