Skip to content
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

fix: updated types for projection fit #9260

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build/vega-lite-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -19991,7 +19991,8 @@
{
"$ref": "#/definitions/ExprRef"
}
]
],
"description": "GeoJSON data to which the projection should attempt to automatically fit the `translate` and `scale` parameters. If object-valued, this parameter should be a GeoJSON Feature or FeatureCollection. If array-valued, each array member may be a GeoJSON Feature, FeatureCollection, or a sub-array of GeoJSON Features."
},
"fraction": {
"anyOf": [
Expand Down
7 changes: 6 additions & 1 deletion src/projection.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {BaseProjection, SignalRef, Vector2} from 'vega';
import {BaseProjection, Fit, SignalRef, Vector2} from 'vega';
import {ExprRef} from './expr';
import {MapExcludeValueRefAndReplaceSignalWith, ProjectionType} from './vega.schema';

Expand All @@ -20,6 +20,11 @@ export interface Projection<ES extends ExprRef | SignalRef>
* The projection’s translation offset as a two-element array `[tx, ty]`.
*/
translate?: Vector2<number> | ES; // TODO: figure what's VL default value

/**
* GeoJSON data to which the projection should attempt to automatically fit the `translate` and `scale` parameters. If object-valued, this parameter should be a GeoJSON Feature or FeatureCollection. If array-valued, each array member may be a GeoJSON Feature, FeatureCollection, or a sub-array of GeoJSON Features.
*/
fit?: Fit | Fit[] | ES; // Re-declare to override docs
}

/**
Expand Down