Skip to content

Commit 8bc1cf4

Browse files
committed
docs
1 parent b723a25 commit 8bc1cf4

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

build/generate-docs.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,16 @@ function convertPropertyToMarkdown(key: string, value: JsonObject, keyPrefix = '
219219

220220
markdown += '. ';
221221

222+
// Projection type:
223+
const isProjectionTransition = value.type === 'projectionTransition' && value.values && !Array.isArray(value.values);
224+
if (isProjectionTransition) {
225+
markdown += '\n\r';
226+
markdown += `Projections: ${value.values['projections'].map(val=>`\`${val}\``).join(', ')}. `;
227+
markdown += '\n\r';
228+
markdown += `Presets: ${value.values['presets'].map(val=>`\`${val}\``).join(', ')}. `;
229+
markdown += '\n\r';
230+
}
231+
222232
const isEnum = value.type === 'enum' && value.values && !Array.isArray(value.values);
223233
if (isEnum) {
224234
markdown += `Possible values: \`${Object.keys(value.values).join('`, `')}\`. `;

build/generate-style-spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,10 @@ fs.writeFileSync('src/types.g.ts',
124124
125125
export type ColorSpecification = string;
126126
127-
export type PrimitiveProjection = 'mercator' | 'globe';
128-
export type ProjectionTransition = [PrimitiveProjection, PrimitiveProjection, number];
129-
export type ProjectionTransitionSpecification = PrimitiveProjection | ProjectionTransition | PropertyValueSpecification<ProjectionTransition>
127+
export type ProjectionPreset = 'globe';
128+
export type ProjectionPrimitive = 'mercator' | 'stereographic';
129+
export type ProjectionTransition = [ProjectionPrimitive, ProjectionPrimitive, number];
130+
export type ProjectionTransitionSpecification = ProjectionPreset | ProjectionPrimitive | ProjectionTransition | PropertyValueSpecification<ProjectionTransition>
130131
131132
132133
export type PaddingSpecification = number | number[];
@@ -211,7 +212,7 @@ export type ExpressionSpecification =
211212
| ['interpolate', InterpolationSpecification, number | ExpressionSpecification,
212213
...(number | number[] | ColorSpecification | ExpressionSpecification)[]] // alternating number and number | number[] | ColorSpecification
213214
| ['interpolate-projection', InterpolationSpecification, number | ExpressionSpecification,
214-
...(number | PrimitiveProjection)[]] // alternating Projection
215+
...(number | ProjectionPrimitive)[]] // alternating Projection
215216
| ['interpolate-hcl', InterpolationSpecification, number | ExpressionSpecification,
216217
...(number | ColorSpecification)[]] // alternating number and ColorSpecificaton
217218
| ['interpolate-lab', InterpolationSpecification, number | ExpressionSpecification,

src/reference/v8.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
},
128128
"projection": {
129129
"type": "projection",
130-
"doc": "The projection type. Can be specified as a string, or as an expression for supported projection types.",
130+
"doc": "The projection configuration",
131131
"example": {
132132
"type": [
133133
"interpolate-projection",
@@ -4593,21 +4593,23 @@
45934593
"projection": {
45944594
"type": {
45954595
"type": "projectionTransition",
4596-
"doc": "The projection type. Can be specified as a string, or as an expression for supported projection types.",
4596+
"doc": "The projection type. Can be specified as a string, a transition state, or an expression.",
45974597
"default": "mercator",
45984598
"expression": {
45994599
"interpolated": true,
46004600
"parameters": [
46014601
"zoom"
4602+
]
4603+
},
4604+
"values": {
4605+
"projections": [
4606+
"mercator",
4607+
"stereographic"
46024608
],
4603-
"operators": [
4604-
"interpolate-projection"
4609+
"presets": [
4610+
"globe"
46054611
]
46064612
},
4607-
"values": [
4608-
"mercator",
4609-
"globe"
4610-
],
46114613
"property-type": "data-constant"
46124614
}
46134615
},

0 commit comments

Comments
 (0)