-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GPU Aggregation (1/8): Aggregator and AggregationLayer #8886
Conversation
c354c6e
to
af9e3ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this direction a lot! 👏🏻
Left a few questions, nothing critical.
modules/aggregation-layers/src/aggregation-layer-v9/aggregation-layer.ts
Show resolved
Hide resolved
modules/aggregation-layers/src/aggregation-layer-v9/aggregation-layer.ts
Outdated
Show resolved
Hide resolved
modules/aggregation-layers/src/aggregation-layer-v9/aggregation-layer.ts
Outdated
Show resolved
Hide resolved
modules/aggregation-layers/src/aggregation-layer-v9/aggregator.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. Being able to reason about and define Aggregators separately and have a layer that accepts them follows the true spirit of vis.gl composability
I would mostly encourage another pass to remove differences between GPUAggregator and CPUAggregator from being visible in the AggregationLayer. I think you are almost there, see detailed notes.
modules/aggregation-layers/src/aggregation-layer-v9/aggregation-layer.ts
Outdated
Show resolved
Hide resolved
modules/aggregation-layers/src/aggregation-layer-v9/aggregation-layer.ts
Outdated
Show resolved
Hide resolved
modules/aggregation-layers/src/aggregation-layer-v9/aggregation-layer.ts
Outdated
Show resolved
Hide resolved
modules/aggregation-layers/src/aggregation-layer-v9/aggregation-layer.ts
Outdated
Show resolved
Hide resolved
modules/aggregation-layers/src/aggregation-layer-v9/aggregation-layer.ts
Outdated
Show resolved
Hide resolved
|
||
export type AggregationOperation = 'SUM' | 'MEAN' | 'MIN' | 'MAX'; | ||
|
||
export type AggregationProps = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: TSDoc on the type as well.
modules/aggregation-layers/src/aggregation-layer-v9/aggregator.ts
Outdated
Show resolved
Hide resolved
modules/aggregation-layers/src/aggregation-layer-v9/aggregator.ts
Outdated
Show resolved
Hide resolved
@@ -41,6 +41,11 @@ export default abstract class CompositeLayer<PropsT extends {} = {}> extends Lay | |||
return true; | |||
} | |||
|
|||
/** `true` if the layer renders to screen */ | |||
get isDrawable(): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Is this extra wrinkle worth it? Should we just start calling draw on composite layers and just make sure we provide an empty implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have limited slots (255) in picking and including composite layers could be breaking to tiled use cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and extensively documented
The Aggregator class deserves extensive user facing documentation, to help end-users define their own aggregators and that could probably be copy pasted from your voluminous comments in the source.
@ibgreen I will add markdown documentation once the API discussion settles. I didn't want to write them prematurely as you can't type check those. |
modules/aggregation-layers/src/aggregation-layer-v9/aggregation-layer.ts
Outdated
Show resolved
Hide resolved
modules/aggregation-layers/src/aggregation-layer-v9/aggregator.ts
Outdated
Show resolved
Hide resolved
data: LayerDataSource<DataT>; | ||
}; | ||
|
||
export default abstract class AggregationLayer< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you thought about how this could work with a TileLayer
? I'm working on a cluster layer right now which works with a tiled data source, and aggregates whenever the visible data changes (outputting a single ScatterplotLayer
)
af9e3ff
to
dd55918
Compare
For #7457
The goals of this refactor:
Planned PRs:
Change List
Aggregator
interfaceAggregationLayer
abstract classisDrawable
toLayer
class to decoupleisComposite
from drawing behavior.AggregationLayer
is a composite layer (renders sublayers) but also participate in the draw cycle.