Skip to content

[WIP] Overhaul symbology schema and menus #754

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

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"opacity": {
"type": "number",
"description": "The opacity of the source",
"description": "The opacity of the layer",
"default": 1,
"multipleOf": 0.1,
"minimum": 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/src/schema/project/layers/imageLayer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"opacity": {
"type": "number",
"description": "The opacity of the source",
"description": "The opacity of the layer",
"default": 1,
"multipleOf": 0.1,
"minimum": 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/src/schema/project/layers/rasterLayer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"opacity": {
"type": "number",
"description": "The opacity of the source",
"description": "The opacity of the layer",
"default": 1,
"multipleOf": 0.1,
"minimum": 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"type": "object",
"description": "The state of the GeoTiff layer's multiband coloring symbology options",
"required": [],
"additionalProperties": false,
"properties": {
"red": {
"type": "string",
"description": "The name of the band used for the red channel."
},
"green": {
"type": "string",
"description": "The name of the band used for the green channel."
},
"blue": {
"type": "string",
"description": "The name of the band used for the blue channel."
},
"alpha": {
"type": "string",
"description": "The name of the band used for the alpha channel."
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "object",
"description": "The state of the GeoTiff layer's single band coloring symbology options",
"required": [],
"additionalProperties": false,
"properties": {
"band": {
"type": "string",
"description": "The name of the band used for coloring."
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"title": "IVectorColor",
"description": "The state of the layer's color symbology options (fill color, stroke color etc.)",
"type": "object",
"required": ["renderType"],
"additionalProperties": false,
"properties": {
"renderType": {
"type": "string",
"enum": ["Single Symbol", "Graduated", "Categorized", "Canonical", "Heatmap"]
},
"selectedAttribute": {
"type": "string",
"description": "The selected attribute for varying the color"
},
"colorRamp": {
"type": "string",
"default": "cool"
},
"nStops": {
"type": "number",
"description": "The number of segments to use when mapping colors to data values",
"default": 9
},
"stopsDistributionMode": {
"type": "string",
"description": "The method of distributing segments when mapping colors to data values",
"default": "equal interval",
"enum": [
"quantile",
"equal interval",
"jenks",
"pretty",
"logarithmic"
]
},
"stopsValues": {
"type": "object",
"description": "The mapping of input data values to size values",
"patternProperties": {
"^[0-9]+$": {
"type": "string",
"pattern": "^#[0-9a-fA-F]{6}$",
"description": "The hex color value at the stop index, where the key is the index of the stop"
}
}
},
"strokeColor": {
"type": "string",
"description": "The color of the stroke for the symbol",
"default": "#ffffff"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"title": "IVectorSize",
"description": "The state of the layer's size symbology options (radius, line thickness etc.)",
"type": "object",
"required": ["renderType"],
"additionalProperties": false,
"properties": {
"renderType": {
"type": "string",
"enum": ["Single Symbol", "Graduated", "Canonical", "Categorized"]
},
"selectedAttribute": {
"type": "string",
"description": "The selected attribute for varying the size"
},
"nStops": {
"type": "number",
"description": "The number of segments to use when mapping colors to data values",
"default": 9
},
"stopsDistributionMode": {
"type": "string",
"description": "The method of distributing segments when mapping colors to data values",
"default": "equal interval",
"enum": [
"quantile",
"equal interval",
"jenks",
"pretty",
"logarithmic"
]
},
"stopsValues": {
"type": "object",
"description": "The mapping of input data values to size values",
"patternProperties": {
"^[0-9]+$": {
"type": "number",
"description": "The size value in pixels at the stop index, where the key is the index of the stop"
}
}
},
"strokeThickness": {
"type": "number",
"description": "The thickness of the stroke in pixels",
"default": 1.25
},
"symbolRadius": {
"type": "number",
"description": "The radius of the symbols in pixels",
"default": 1
}
}
}
47 changes: 9 additions & 38 deletions packages/schema/src/schema/project/layers/vectorLayer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,55 +9,26 @@
"type": "string",
"description": "The id of the source"
},
"color": {
"type": "object",
"description": "The color of the the object"
},
"opacity": {
"type": "number",
"description": "The opacity of the the object",
"description": "The opacity of the layer",
"default": 1,
"multipleOf": 0.1,
"minimum": 0,
"maximum": 1
},
"symbologyState": {
"symbology": {
"type": "object",
"description": "The state of the symbology panel options",
"required": ["renderType"],
"description": "The user inputs for symbology options",
"additionalProperties": false,
"properties": {
"renderType": {
"type": "string",
"enum": ["Single Symbol", "Graduated", "Categorized"]
},
"value": {
"type": "string"
},
"method": {
"type": "string",
"enum": ["color", "radius"]
},
"colorRamp": {
"type": "string",
"default": "cool"
},
"nClasses": {
"type": "string",
"default": "9"
"color": {
"$ref": "project/layers/symbology/vectorColor.json"
},
"mode": {
"type": "string",
"default": "equal interval",
"enum": [
"quantile",
"equal interval",
"jenks",
"pretty",
"logarithmic"
]
"size": {
"$ref": "project/layers/symbology/vectorSize.json"
}
},
"additionalProperties": false
}
}
}
}
8 changes: 8 additions & 0 deletions packages/schema/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,21 @@ export * from './_interface/project/layers/stacLayer';
export * from './_interface/project/layers/vectorTileLayer';
export * from './_interface/project/layers/webGlLayer';

// Symbology
export * from './_interface/project/layers/symbology/vectorColor';
export * from './_interface/project/layers/symbology/vectorSize';
export * from './_interface/project/layers/symbology/geoTiffSingleBand';
export * from './_interface/project/layers/symbology/geoTiffMultiBand';


// Processing
export * from './processing/_generated/exportProcessingSchema';

// exportLayer
export * from './_interface/export/exportGeoJson';
export * from './_interface/export/exportGeoTiff';


// Other
export * from './doc';
export * from './index';
Expand Down
Loading