Skip to content
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
bec511f
Add `describedBy` to commands
arjxn-py Oct 28, 2025
c0ed545
lint
arjxn-py Oct 28, 2025
3e19dcf
command to add geojson with params
arjxn-py Oct 29, 2025
6f80029
`newRasterWithParams`
arjxn-py Oct 29, 2025
8375e73
`newVectorTileWithParams`
arjxn-py Oct 29, 2025
6e34acf
`newGeoParquetWithParams`
arjxn-py Oct 30, 2025
e54d397
`newHillshadeWithParams`
arjxn-py Oct 31, 2025
28e19e2
`newImageWithParams`
arjxn-py Oct 31, 2025
7b59b1c
`newVideoWithParams`
arjxn-py Oct 31, 2025
89d9a54
`newGeoTiffWithParams`
arjxn-py Oct 31, 2025
f1a942b
`newShapefileWithParams`
arjxn-py Oct 31, 2025
afb13c1
add undo redo in doc action commands
arjxn-py Oct 31, 2025
1127741
`identifyWithParams`
arjxn-py Oct 31, 2025
ba83fa1
`temporalControllerWithParams`
arjxn-py Oct 31, 2025
abdd670
`renameLayerWithParams`
arjxn-py Oct 31, 2025
9052a4f
lint
arjxn-py Oct 31, 2025
a8c9e9f
`removeLayerWithParams`
arjxn-py Oct 31, 2025
be53860
`renameGroupWithParams`
arjxn-py Oct 31, 2025
2b862ef
`removeGroupWithParams`, `moveLayersToGroupWithParams`
arjxn-py Oct 31, 2025
a8c75bd
`moveLayerToNewGroupWithParams`
arjxn-py Oct 31, 2025
717071a
`renameSourceWithParams`, `removeSourceWithParams`
arjxn-py Oct 31, 2025
8201547
`zoomToLayerWithParams`
arjxn-py Oct 31, 2025
94fdd20
`downloadGeoJSONWithParams`
arjxn-py Oct 31, 2025
078b87c
`getGeolocationWithParams`
arjxn-py Oct 31, 2025
9b83900
Processing commands from params [needs review]
arjxn-py Nov 3, 2025
34c4a54
usage
arjxn-py Nov 3, 2025
a7abf1c
fix processing commands
arjxn-py Nov 11, 2025
156496d
refactor layer addition commands
arjxn-py Nov 11, 2025
b2172c4
processing without dialog
arjxn-py Nov 11, 2025
1ed8ed8
try fixing CI build
arjxn-py Nov 12, 2025
5e8063b
Merge branch 'main' into add-describedby
arjxn-py Nov 12, 2025
e4ffcfe
fix
arjxn-py Nov 12, 2025
507de69
lint
arjxn-py Nov 12, 2025
a82ebb0
remove undowithparams command and just modify original undo
arjxn-py Nov 17, 2025
d5e7f86
just keep identify and remove identify with params
arjxn-py Nov 17, 2025
b640a66
lint
arjxn-py Nov 17, 2025
cfc66b1
rename `newGeoJSONEntry` to `openNewGeoJSONDialog`
arjxn-py Nov 17, 2025
8944cca
Rename new layer commands
arjxn-py Nov 18, 2025
57bd853
redo
arjxn-py Nov 18, 2025
92914db
temporal controller
arjxn-py Nov 18, 2025
bd68fda
rename layer
arjxn-py Nov 18, 2025
940e0b5
remove layer
arjxn-py Nov 18, 2025
a9786dc
rename group
arjxn-py Nov 18, 2025
f1da2bd
Merge branch 'main' into add-describedby
arjxn-py Nov 18, 2025
38eac11
fix
arjxn-py Nov 18, 2025
d9a3736
lint
arjxn-py Nov 18, 2025
38264e8
lint
arjxn-py Nov 18, 2025
8fcbc1b
remove group
arjxn-py Nov 18, 2025
fb4b103
move layer to group
arjxn-py Nov 18, 2025
1cf41e3
move to new group
arjxn-py Nov 18, 2025
4d45e49
rename source
arjxn-py Nov 18, 2025
2c1c010
remove source
arjxn-py Nov 18, 2025
47ddbde
zoom to layer
arjxn-py Nov 18, 2025
8001181
download as geojson
arjxn-py Nov 18, 2025
98cc5c2
geolocation
arjxn-py Nov 18, 2025
79c789e
lint
arjxn-py Nov 18, 2025
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
681 changes: 681 additions & 0 deletions packages/base/src/commands/documentActionCommands.ts

Large diffs are not rendered by default.

257 changes: 257 additions & 0 deletions packages/base/src/commands/index.ts

Large diffs are not rendered by default.

1,264 changes: 1,264 additions & 0 deletions packages/base/src/commands/operationCommands.ts

Large diffs are not rendered by default.

112 changes: 112 additions & 0 deletions packages/base/src/commands/processingCommandsFromParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import {
IJGISFormSchemaRegistry,
ProcessingLogicType,
ProcessingType,
ProcessingMerge,
} from '@jupytergis/schema';
import { JupyterFrontEnd } from '@jupyterlab/application';
import { CommandRegistry } from '@lumino/commands';

import { processSelectedLayer } from '../processing';
import { replaceInSql } from '../processing/processingCommands';
import { JupyterGISTracker } from '../types';

/**
* Dynamically registers processing commands from schemas and ProcessingMerge metadata.
*/
export function addProcessingCommandsFromParams(options: {
app: JupyterFrontEnd;
commands: CommandRegistry;
tracker: JupyterGISTracker;
trans: any;
formSchemaRegistry: IJGISFormSchemaRegistry;
processingSchemas: Record<string, any>;
}) {
const {
app,
commands,
tracker,
trans,
formSchemaRegistry,
processingSchemas,
} = options;

for (const processingElement of ProcessingMerge) {
if (processingElement.type !== ProcessingLogicType.vector) {
console.error(
`Skipping unsupported processing type: ${processingElement.type}`,
);
continue;
}

const schema = processingSchemas[processingElement.name];
if (!schema) {
console.warn(
`No schema found for ${processingElement.name}, skipping command`,
);
continue;
}

const commandId = `${processingElement.name}WithParams`;

commands.addCommand(commandId, {
label: trans.__(`${processingElement.label} from params`),
isEnabled: () => true,
describedBy: {
args: {
type: 'object',
required: ['filePath', 'params'],
properties: {
filePath: {
type: 'string',
description: 'Path to the .jGIS file containing the layer',
},
params: schema,
},
},
},
execute: (async (args: {
filePath: string;
params: Record<string, any>;
}) => {
const { filePath, params } = args;
const current = tracker.find(w => w.model.filePath === filePath);

if (!current) {
console.warn('No JupyterGIS widget found for', filePath);
return;
}

// Build SQL using replaceInSql()
const sql = replaceInSql(
processingElement.operations.sql,
Object.fromEntries(
Object.entries(params).map(([k, v]) => [k, String(v)]),
),
params.inputLayer ?? '',
);

// Execute using standard processSelectedLayer()
await processSelectedLayer(
tracker,
formSchemaRegistry,
processingElement as unknown as ProcessingType,
{
sqlQueryFn: () => sql,
gdalFunction: processingElement.operations.gdalFunction,
options: (query: string) => [
'-f',
'GeoJSON',
'-dialect',
'SQLITE',
'-sql',
query,
'output.geojson',
],
},
app,
);
}) as any,
});
}
}
14 changes: 10 additions & 4 deletions packages/base/src/mainview/mainView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,16 @@ export class MainView extends React.Component<IProps, IStates> {

addContextMenu = (): void => {
this._commands.addCommand(CommandIDs.addAnnotation, {
label: 'Add annotation',
describedBy: {
args: {
type: 'object',
properties: {},
},
},
isEnabled: () => {
return !!this._Map;
},
execute: () => {
if (!this._Map) {
return;
Expand All @@ -557,10 +567,6 @@ export class MainView extends React.Component<IProps, IStates> {
open: true,
});
},
label: 'Add annotation',
isEnabled: () => {
return !!this._Map;
},
});

this._contextMenu.addItem({
Expand Down
6 changes: 6 additions & 0 deletions packages/base/src/processing/processingCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ export function addProcessingCommands(
if (processingElement.type === ProcessingLogicType.vector) {
commands.addCommand(processingElement.name, {
label: trans.__(processingElement.label),
describedBy: {
args: {
type: 'object',
properties: {},
},
},
isEnabled: () => selectedLayerIsOfType(['VectorLayer'], tracker),
execute: async () => {
await processSelectedLayer(
Expand Down
16 changes: 16 additions & 0 deletions python/jupytergis_core/src/jgisplugin/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,22 @@ const activate = async (

app.commands.addCommand(CommandIDs.createNew, {
label: args => (args['label'] as string) ?? 'GIS Project',
describedBy: {
args: {
type: 'object',
properties: {
label: {
type: 'string',
description: 'The label for the file creation command',
},
cwd: {
type: 'string',
description:
'The current working directory where the file should be created',
},
},
},
},
caption: 'Create a new JGIS Editor',
icon: args => logoIcon,
execute: async args => {
Expand Down
12 changes: 12 additions & 0 deletions python/jupytergis_qgis/src/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,18 @@ const activate = async (
if (installed) {
app.commands.addCommand(CommandIDs.exportQgis, {
label: 'Export To QGZ',
describedBy: {
args: {
type: 'object',
properties: {
filepath: {
type: 'string',
description:
'Optional. Destination filename (with or without .qgz extension) for the exported QGIS project.',
},
},
},
},
isEnabled: () =>
tracker.currentWidget
? tracker.currentWidget.model.sharedModel.editable
Expand Down
Loading