@jupytergis/base 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/lib/annotations/components/Annotation.d.ts +2 -2
  2. package/lib/annotations/components/Annotation.js +3 -3
  3. package/lib/annotations/components/AnnotationFloater.d.ts +1 -1
  4. package/lib/annotations/components/AnnotationFloater.js +2 -2
  5. package/lib/annotations/components/Message.d.ts +2 -1
  6. package/lib/annotations/components/Message.js +3 -3
  7. package/lib/annotations/model.js +5 -5
  8. package/lib/commands/BaseCommandIDs.d.ts +32 -0
  9. package/lib/commands/BaseCommandIDs.js +43 -0
  10. package/lib/{commands.d.ts → commands/index.d.ts} +1 -1
  11. package/lib/{commands.js → commands/index.js} +59 -99
  12. package/lib/console/consoleview.d.ts +3 -3
  13. package/lib/console/consoleview.js +5 -5
  14. package/lib/constants.d.ts +2 -36
  15. package/lib/constants.js +5 -47
  16. package/lib/dialogs/ProcessingFormDialog.d.ts +4 -4
  17. package/lib/dialogs/ProcessingFormDialog.js +9 -11
  18. package/lib/dialogs/layerBrowserDialog.d.ts +1 -1
  19. package/lib/dialogs/layerBrowserDialog.js +7 -7
  20. package/lib/dialogs/layerCreationFormDialog.d.ts +4 -4
  21. package/lib/dialogs/layerCreationFormDialog.js +6 -6
  22. package/lib/dialogs/symbology/components/color_ramp/CanvasSelectComponent.d.ts +1 -1
  23. package/lib/dialogs/symbology/components/color_ramp/CanvasSelectComponent.js +3 -3
  24. package/lib/dialogs/symbology/components/color_ramp/ColorRamp.d.ts +3 -2
  25. package/lib/dialogs/symbology/components/color_ramp/ColorRamp.js +6 -7
  26. package/lib/dialogs/symbology/components/color_ramp/ColorRampEntry.d.ts +1 -1
  27. package/lib/dialogs/symbology/components/color_ramp/ColorRampEntry.js +1 -1
  28. package/lib/dialogs/symbology/components/color_ramp/ModeSelectRow.d.ts +1 -1
  29. package/lib/dialogs/symbology/components/color_ramp/ModeSelectRow.js +1 -1
  30. package/lib/dialogs/symbology/components/color_stops/StopContainer.d.ts +2 -2
  31. package/lib/dialogs/symbology/components/color_stops/StopContainer.js +4 -4
  32. package/lib/dialogs/symbology/components/color_stops/StopRow.d.ts +3 -3
  33. package/lib/dialogs/symbology/components/color_stops/StopRow.js +2 -2
  34. package/lib/dialogs/symbology/hooks/useGetBandInfo.js +5 -5
  35. package/lib/dialogs/symbology/hooks/useGetProperties.d.ts +1 -1
  36. package/lib/dialogs/symbology/hooks/useGetProperties.js +4 -4
  37. package/lib/dialogs/symbology/symbologyDialog.d.ts +8 -0
  38. package/lib/dialogs/symbology/symbologyDialog.js +1 -1
  39. package/lib/dialogs/symbology/symbologyUtils.js +38 -31
  40. package/lib/dialogs/symbology/tiff_layer/TiffRendering.d.ts +2 -2
  41. package/lib/dialogs/symbology/tiff_layer/TiffRendering.js +2 -2
  42. package/lib/dialogs/symbology/tiff_layer/components/BandRow.d.ts +2 -2
  43. package/lib/dialogs/symbology/tiff_layer/components/BandRow.js +4 -4
  44. package/lib/dialogs/symbology/tiff_layer/types/MultibandColor.d.ts +2 -2
  45. package/lib/dialogs/symbology/tiff_layer/types/MultibandColor.js +30 -20
  46. package/lib/dialogs/symbology/tiff_layer/types/SingleBandPseudoColor.d.ts +2 -2
  47. package/lib/dialogs/symbology/tiff_layer/types/SingleBandPseudoColor.js +23 -21
  48. package/lib/dialogs/symbology/vector_layer/VectorRendering.d.ts +2 -2
  49. package/lib/dialogs/symbology/vector_layer/VectorRendering.js +81 -39
  50. package/lib/dialogs/symbology/vector_layer/components/ValueSelect.d.ts +1 -1
  51. package/lib/dialogs/symbology/vector_layer/components/ValueSelect.js +1 -1
  52. package/lib/dialogs/symbology/vector_layer/types/Canonical.d.ts +4 -0
  53. package/lib/dialogs/symbology/vector_layer/types/Canonical.js +66 -0
  54. package/lib/dialogs/symbology/vector_layer/types/Categorized.d.ts +2 -2
  55. package/lib/dialogs/symbology/vector_layer/types/Categorized.js +142 -47
  56. package/lib/dialogs/symbology/vector_layer/types/Graduated.d.ts +2 -2
  57. package/lib/dialogs/symbology/vector_layer/types/Graduated.js +193 -99
  58. package/lib/dialogs/symbology/vector_layer/types/Heatmap.d.ts +2 -2
  59. package/lib/dialogs/symbology/vector_layer/types/Heatmap.js +7 -6
  60. package/lib/dialogs/symbology/vector_layer/types/SimpleSymbol.d.ts +2 -2
  61. package/lib/dialogs/symbology/vector_layer/types/SimpleSymbol.js +33 -30
  62. package/lib/formbuilder/creationform.js +3 -3
  63. package/lib/formbuilder/editform.js +3 -3
  64. package/lib/formbuilder/formselectors.d.ts +1 -1
  65. package/lib/formbuilder/formselectors.js +2 -2
  66. package/lib/formbuilder/objectform/baseform.d.ts +5 -4
  67. package/lib/formbuilder/objectform/baseform.js +16 -14
  68. package/lib/formbuilder/objectform/fileselectorwidget.d.ts +1 -1
  69. package/lib/formbuilder/objectform/fileselectorwidget.js +5 -5
  70. package/lib/formbuilder/objectform/layer/heatmapLayerForm.js +2 -2
  71. package/lib/formbuilder/objectform/layer/hillshadeLayerForm.js +1 -1
  72. package/lib/formbuilder/objectform/layer/layerform.d.ts +1 -1
  73. package/lib/formbuilder/objectform/layer/layerform.js +3 -2
  74. package/lib/formbuilder/objectform/process/dissolveProcessForm.d.ts +1 -1
  75. package/lib/formbuilder/objectform/process/dissolveProcessForm.js +5 -5
  76. package/lib/formbuilder/objectform/source/geojsonsource.js +4 -4
  77. package/lib/formbuilder/objectform/source/geotiffsource.js +4 -4
  78. package/lib/formbuilder/objectform/source/pathbasedsource.js +6 -6
  79. package/lib/formbuilder/objectform/source/sourceform.d.ts +1 -1
  80. package/lib/formbuilder/objectform/source/sourceform.js +1 -1
  81. package/lib/formbuilder/objectform/source/tilesourceform.js +3 -3
  82. package/lib/gdal.js +2 -2
  83. package/lib/icons.js +29 -29
  84. package/lib/index.d.ts +4 -3
  85. package/lib/index.js +4 -3
  86. package/lib/mainview/CollaboratorPointers.d.ts +1 -1
  87. package/lib/mainview/CollaboratorPointers.js +5 -5
  88. package/lib/mainview/FollowIndicator.d.ts +2 -2
  89. package/lib/mainview/FollowIndicator.js +3 -3
  90. package/lib/mainview/TemporalSlider.d.ts +1 -1
  91. package/lib/mainview/TemporalSlider.js +7 -7
  92. package/lib/mainview/mainView.d.ts +4 -2
  93. package/lib/mainview/mainView.js +232 -137
  94. package/lib/menus.d.ts +1 -1
  95. package/lib/menus.js +7 -7
  96. package/lib/panelview/annotationPanel.d.ts +2 -2
  97. package/lib/panelview/annotationPanel.js +1 -1
  98. package/lib/panelview/components/filter-panel/Filter.d.ts +2 -2
  99. package/lib/panelview/components/filter-panel/Filter.js +5 -5
  100. package/lib/panelview/components/filter-panel/FilterRow.d.ts +2 -2
  101. package/lib/panelview/components/identify-panel/IdentifyPanel.d.ts +1 -1
  102. package/lib/panelview/components/identify-panel/IdentifyPanel.js +5 -5
  103. package/lib/panelview/components/layers.d.ts +1 -1
  104. package/lib/panelview/components/layers.js +12 -12
  105. package/lib/panelview/leftpanel.d.ts +4 -2
  106. package/lib/panelview/leftpanel.js +24 -6
  107. package/lib/panelview/model.d.ts +1 -1
  108. package/lib/panelview/objectproperties.d.ts +1 -1
  109. package/lib/panelview/objectproperties.js +3 -3
  110. package/lib/panelview/rightpanel.d.ts +2 -1
  111. package/lib/panelview/rightpanel.js +13 -5
  112. package/lib/{processing.d.ts → processing/index.d.ts} +4 -4
  113. package/lib/{processing.js → processing/index.js} +19 -24
  114. package/lib/processing/processingCommands.d.ts +6 -0
  115. package/lib/processing/processingCommands.js +47 -0
  116. package/lib/processing/processingFormToParam.d.ts +2 -0
  117. package/lib/processing/processingFormToParam.js +15 -0
  118. package/lib/shared/components/Badge.d.ts +7 -0
  119. package/lib/shared/components/Badge.js +19 -0
  120. package/lib/shared/components/Button.d.ts +9 -0
  121. package/lib/shared/components/Button.js +20 -0
  122. package/lib/shared/components/Calendar.d.ts +47 -0
  123. package/lib/shared/components/Calendar.js +184 -0
  124. package/lib/shared/components/Checkbox.d.ts +4 -0
  125. package/lib/shared/components/Checkbox.js +25 -0
  126. package/lib/shared/components/DropdownMenu.d.ts +27 -0
  127. package/lib/shared/components/DropdownMenu.js +92 -0
  128. package/lib/shared/components/Pagination.d.ts +25 -0
  129. package/lib/shared/components/Pagination.js +68 -0
  130. package/lib/shared/components/Popover.d.ts +7 -0
  131. package/lib/shared/components/Popover.js +32 -0
  132. package/lib/shared/components/Tabs.d.ts +7 -0
  133. package/lib/shared/components/Tabs.js +31 -0
  134. package/lib/shared/components/ToggleGroup.d.ts +12 -0
  135. package/lib/shared/components/ToggleGroup.js +52 -0
  136. package/lib/shared/components/loading.d.ts +12 -0
  137. package/lib/shared/components/loading.js +6 -0
  138. package/lib/shared/components/utils.d.ts +2 -0
  139. package/lib/shared/components/utils.js +4 -0
  140. package/lib/shared/hooks/useIsFirstRender.d.ts +2 -0
  141. package/lib/shared/hooks/useIsFirstRender.js +10 -0
  142. package/lib/stacBrowser/StacBrowser.d.ts +7 -0
  143. package/lib/stacBrowser/StacBrowser.js +16 -0
  144. package/lib/stacBrowser/StacPanel.d.ts +14 -0
  145. package/lib/stacBrowser/StacPanel.js +16 -0
  146. package/lib/stacBrowser/components/StacFilterSection.d.ts +23 -0
  147. package/lib/stacBrowser/components/StacFilterSection.js +49 -0
  148. package/lib/stacBrowser/components/StacPanelFilters.d.ts +14 -0
  149. package/lib/stacBrowser/components/StacPanelFilters.js +65 -0
  150. package/lib/stacBrowser/components/StacPanelResults.d.ts +13 -0
  151. package/lib/stacBrowser/components/StacPanelResults.js +48 -0
  152. package/lib/stacBrowser/components/StacPanelView.d.ts +7 -0
  153. package/lib/stacBrowser/components/StacPanelView.js +20 -0
  154. package/lib/stacBrowser/constants.d.ts +25 -0
  155. package/lib/stacBrowser/constants.js +197 -0
  156. package/lib/stacBrowser/hooks/useStacSearch.d.ts +30 -0
  157. package/lib/stacBrowser/hooks/useStacSearch.js +221 -0
  158. package/lib/stacBrowser/index.d.ts +1 -0
  159. package/lib/stacBrowser/index.js +1 -0
  160. package/lib/stacBrowser/types/types.d.ts +124 -0
  161. package/lib/stacBrowser/types/types.js +1 -0
  162. package/lib/statusbar/StatusBar.d.ts +1 -1
  163. package/lib/statusbar/StatusBar.js +3 -3
  164. package/lib/toolbar/index.d.ts +0 -1
  165. package/lib/toolbar/index.js +0 -1
  166. package/lib/toolbar/widget.js +15 -15
  167. package/lib/tools.d.ts +29 -4
  168. package/lib/tools.js +74 -69
  169. package/lib/types.d.ts +2 -0
  170. package/lib/widget.d.ts +1 -1
  171. package/lib/widget.js +5 -5
  172. package/package.json +22 -8
  173. package/style/base.css +26 -0
  174. package/style/layerBrowser.css +10 -0
  175. package/style/shared/badge.css +61 -0
  176. package/style/shared/button.css +164 -0
  177. package/style/shared/calendar.css +274 -0
  178. package/style/shared/checkbox.css +28 -0
  179. package/style/shared/dropdownMenu.css +240 -0
  180. package/style/shared/pagination.css +167 -0
  181. package/style/shared/popover.css +53 -0
  182. package/style/shared/tabs.css +57 -0
  183. package/style/shared/toggle.css +85 -0
  184. package/style/stacBrowser.css +74 -0
  185. package/style/symbologyDialog.css +0 -7
  186. package/lib/mainview/spinner.d.ts +0 -6
  187. package/lib/mainview/spinner.js +0 -5
  188. package/lib/toolbar/usertoolbaritem.d.ts +0 -19
  189. package/lib/toolbar/usertoolbaritem.js +0 -59
package/lib/menus.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Menu } from '@lumino/widgets';
2
1
  import { CommandRegistry } from '@lumino/commands';
2
+ import { Menu } from '@lumino/widgets';
3
3
  export declare const vectorSubMenu: (commands: CommandRegistry) => Menu;
4
4
  export declare const rasterSubMenu: (commands: CommandRegistry) => Menu;
package/lib/menus.js CHANGED
@@ -8,15 +8,15 @@ export const vectorSubMenu = (commands) => {
8
8
  subMenu.id = 'jp-gis-toolbar-vector-menu';
9
9
  subMenu.addItem({
10
10
  type: 'command',
11
- command: CommandIDs.newVectorTileEntry
11
+ command: CommandIDs.newVectorTileEntry,
12
12
  });
13
13
  subMenu.addItem({
14
14
  type: 'command',
15
- command: CommandIDs.newGeoJSONEntry
15
+ command: CommandIDs.newGeoJSONEntry,
16
16
  });
17
17
  subMenu.addItem({
18
18
  type: 'command',
19
- command: CommandIDs.newShapefileEntry
19
+ command: CommandIDs.newShapefileEntry,
20
20
  });
21
21
  return subMenu;
22
22
  };
@@ -27,19 +27,19 @@ export const rasterSubMenu = (commands) => {
27
27
  subMenu.id = 'jp-gis-toolbar-raster-menu';
28
28
  subMenu.addItem({
29
29
  type: 'command',
30
- command: CommandIDs.newRasterEntry
30
+ command: CommandIDs.newRasterEntry,
31
31
  });
32
32
  subMenu.addItem({
33
33
  type: 'command',
34
- command: CommandIDs.newHillshadeEntry
34
+ command: CommandIDs.newHillshadeEntry,
35
35
  });
36
36
  subMenu.addItem({
37
37
  type: 'command',
38
- command: CommandIDs.newImageEntry
38
+ command: CommandIDs.newImageEntry,
39
39
  });
40
40
  subMenu.addItem({
41
41
  type: 'command',
42
- command: CommandIDs.newGeoTiffEntry
42
+ command: CommandIDs.newGeoTiffEntry,
43
43
  });
44
44
  return subMenu;
45
45
  };
@@ -1,7 +1,7 @@
1
+ import { IAnnotationModel } from '@jupytergis/schema';
1
2
  import { PanelWithToolbar } from '@jupyterlab/ui-components';
2
3
  import { Component } from 'react';
3
- import { IAnnotationModel } from '@jupytergis/schema';
4
- import { IControlPanelModel } from '../types';
4
+ import { IControlPanelModel } from "../types";
5
5
  interface IAnnotationPanelProps {
6
6
  annotationModel: IAnnotationModel;
7
7
  rightPanelModel: IControlPanelModel;
@@ -1,6 +1,6 @@
1
1
  import { PanelWithToolbar, ReactWidget } from '@jupyterlab/ui-components';
2
2
  import React, { Component } from 'react';
3
- import Annotation from '../annotations/components/Annotation';
3
+ import Annotation from "../annotations/components/Annotation";
4
4
  export class AnnotationsPanel extends Component {
5
5
  constructor(props) {
6
6
  super(props);
@@ -1,7 +1,7 @@
1
1
  import { IJupyterGISTracker } from '@jupytergis/schema';
2
2
  import { Panel } from '@lumino/widgets';
3
3
  import React from 'react';
4
- import { IControlPanelModel } from '../../../types';
4
+ import { IControlPanelModel } from "../../../types";
5
5
  /**
6
6
  * The filters panel widget.
7
7
  */
@@ -20,5 +20,5 @@ interface IFilterComponentProps {
20
20
  model: IControlPanelModel;
21
21
  tracker: IJupyterGISTracker;
22
22
  }
23
- declare const FilterComponent: (props: IFilterComponentProps) => React.JSX.Element;
23
+ declare const FilterComponent: React.FC<IFilterComponentProps>;
24
24
  export default FilterComponent;
@@ -2,7 +2,7 @@ import { Button, ReactWidget } from '@jupyterlab/ui-components';
2
2
  import { Panel } from '@lumino/widgets';
3
3
  import { cloneDeep } from 'lodash';
4
4
  import React, { useEffect, useRef, useState } from 'react';
5
- import { debounce, loadFile } from '../../../tools';
5
+ import { debounce, loadFile } from "../../../tools";
6
6
  import FilterRow from './FilterRow';
7
7
  /**
8
8
  * The filters panel widget.
@@ -17,7 +17,7 @@ export class FilterPanel extends Panel {
17
17
  this.addWidget(ReactWidget.create(React.createElement(FilterComponent, { model: this._model, tracker: this._tracker })));
18
18
  }
19
19
  }
20
- const FilterComponent = (props) => {
20
+ const FilterComponent = props => {
21
21
  var _a;
22
22
  const featuresInLayerRef = useRef({});
23
23
  const [widgetId, setWidgetId] = useState('');
@@ -133,7 +133,7 @@ const FilterComponent = (props) => {
133
133
  const data = await loadFile({
134
134
  filepath: (_b = source.parameters) === null || _b === void 0 ? void 0 : _b.path,
135
135
  type: 'GeoJSONSource',
136
- model: model
136
+ model: model,
137
137
  });
138
138
  data === null || data === void 0 ? void 0 : data.features.forEach((feature) => {
139
139
  feature.properties &&
@@ -163,8 +163,8 @@ const FilterComponent = (props) => {
163
163
  {
164
164
  feature: Object.keys(featuresInLayer)[0],
165
165
  operator: '==',
166
- value: [...Object.values(featuresInLayer)[0]][0]
167
- }
166
+ value: [...Object.values(featuresInLayer)[0]][0],
167
+ },
168
168
  ]);
169
169
  };
170
170
  const deleteRow = (index) => {
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- declare const FilterRow: ({ index, features, filterRows, setFilterRows, deleteRow }: {
2
+ declare const FilterRow: React.FC<{
3
3
  index: number;
4
4
  features: Record<string, Set<string | number>>;
5
5
  filterRows: any;
6
6
  setFilterRows: any;
7
7
  deleteRow: () => void;
8
- }) => React.JSX.Element;
8
+ }>;
9
9
  export default FilterRow;
@@ -1,6 +1,6 @@
1
1
  import { IJupyterGISTracker } from '@jupytergis/schema';
2
2
  import { Panel } from '@lumino/widgets';
3
- import { IControlPanelModel } from '../../../types';
3
+ import { IControlPanelModel } from "../../../types";
4
4
  export declare class IdentifyPanel extends Panel {
5
5
  constructor(options: IdentifyPanel.IOptions);
6
6
  private _model;
@@ -1,8 +1,8 @@
1
+ import { faMagnifyingGlass } from '@fortawesome/free-solid-svg-icons';
2
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
1
3
  import { LabIcon, ReactWidget, caretDownIcon } from '@jupyterlab/ui-components';
2
4
  import { Panel } from '@lumino/widgets';
3
5
  import React, { useEffect, useRef, useState } from 'react';
4
- import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
5
- import { faMagnifyingGlass } from '@fortawesome/free-solid-svg-icons';
6
6
  export class IdentifyPanel extends Panel {
7
7
  constructor(options) {
8
8
  super();
@@ -15,12 +15,12 @@ export class IdentifyPanel extends Panel {
15
15
  this.addWidget(ReactWidget.create(React.createElement(IdentifyPanelComponent, { controlPanelModel: this._model, tracker: this._tracker })));
16
16
  }
17
17
  }
18
- const IdentifyPanelComponent = ({ controlPanelModel, tracker }) => {
18
+ const IdentifyPanelComponent = ({ controlPanelModel, tracker, }) => {
19
19
  var _a;
20
20
  const [widgetId, setWidgetId] = useState('');
21
21
  const [features, setFeatures] = useState();
22
22
  const [visibleFeatures, setVisibleFeatures] = useState({
23
- 0: true
23
+ 0: true,
24
24
  });
25
25
  const [remoteUser, setRemoteUser] = useState(null);
26
26
  const [jgisModel, setJgisModel] = useState(controlPanelModel === null || controlPanelModel === void 0 ? void 0 : controlPanelModel.jGISModel);
@@ -95,7 +95,7 @@ const IdentifyPanelComponent = ({ controlPanelModel, tracker }) => {
95
95
  return (React.createElement("div", { className: "jgis-identify-wrapper", style: {
96
96
  border: ((_a = jgisModel === null || jgisModel === void 0 ? void 0 : jgisModel.localState) === null || _a === void 0 ? void 0 : _a.remoteUser)
97
97
  ? `solid 3px ${remoteUser === null || remoteUser === void 0 ? void 0 : remoteUser.color}`
98
- : 'unset'
98
+ : 'unset',
99
99
  } }, features &&
100
100
  Object.values(features).map((feature, featureIndex) => (React.createElement("div", { key: featureIndex, className: "jgis-identify-grid-item" },
101
101
  React.createElement("div", { className: "jgis-identify-grid-item-header" },
@@ -1,5 +1,5 @@
1
1
  import { Panel } from '@lumino/widgets';
2
- import { ILayerPanelOptions } from '../leftpanel';
2
+ import { ILayerPanelOptions } from "../leftpanel";
3
3
  /**
4
4
  * The layers panel widget.
5
5
  */
@@ -1,9 +1,9 @@
1
1
  import { DOMUtils } from '@jupyterlab/apputils';
2
- import { Button, LabIcon, ReactWidget, caretDownIcon } from '@jupyterlab/ui-components';
2
+ import { Button, LabIcon, ReactWidget, caretDownIcon, } from '@jupyterlab/ui-components';
3
3
  import { Panel } from '@lumino/widgets';
4
- import React, { useEffect, useState } from 'react';
5
- import { icons } from '../../constants';
6
- import { nonVisibilityIcon, visibilityIcon } from '../../icons';
4
+ import React, { useEffect, useState, } from 'react';
5
+ import { icons } from "../../constants";
6
+ import { nonVisibilityIcon, visibilityIcon } from "../../icons";
7
7
  const LAYERS_PANEL_CLASS = 'jp-gis-layerPanel';
8
8
  const LAYER_GROUP_CLASS = 'jp-gis-layerGroup';
9
9
  const LAYER_GROUP_HEADER_CLASS = 'jp-gis-layerGroupHeader';
@@ -75,14 +75,14 @@ export class LayersPanel extends Panel {
75
75
  /**
76
76
  * The body component of the panel.
77
77
  */
78
- function LayersBodyComponent(props) {
78
+ const LayersBodyComponent = props => {
79
79
  var _a, _b;
80
80
  const [model, setModel] = useState((_a = props.model) === null || _a === void 0 ? void 0 : _a.jGISModel);
81
81
  const [layerTree, setLayerTree] = useState((model === null || model === void 0 ? void 0 : model.getLayerTree()) || []);
82
82
  /**
83
83
  * Propagate the layer selection.
84
84
  */
85
- const onItemClick = ({ type, item, nodeId, event }) => {
85
+ const onItemClick = ({ type, item, nodeId, event, }) => {
86
86
  props.onSelect({ type, item, nodeId, event });
87
87
  };
88
88
  /**
@@ -112,11 +112,11 @@ function LayersBodyComponent(props) {
112
112
  .slice()
113
113
  .reverse()
114
114
  .map(layer => typeof layer === 'string' ? (React.createElement(LayerComponent, { key: layer, gisModel: model, layerId: layer, onClick: onItemClick })) : (React.createElement(LayerGroupComponent, { key: layer.name, gisModel: model, group: layer, onClick: onItemClick, state: props.state })))));
115
- }
115
+ };
116
116
  /**
117
117
  * The component to handle group of layers.
118
118
  */
119
- function LayerGroupComponent(props) {
119
+ const LayerGroupComponent = props => {
120
120
  var _a, _b;
121
121
  const { group, gisModel, onClick, state } = props;
122
122
  if (group === undefined) {
@@ -168,7 +168,7 @@ function LayerGroupComponent(props) {
168
168
  .slice()
169
169
  .reverse()
170
170
  .map(layer => typeof layer === 'string' ? (React.createElement(LayerComponent, { key: layer, gisModel: gisModel, layerId: layer, onClick: onClick })) : (React.createElement(LayerGroupComponent, { key: layer.name, gisModel: gisModel, group: layer, onClick: onClick, state: props.state })))))));
171
- }
171
+ };
172
172
  function isSelected(layerId, model) {
173
173
  var _a, _b, _c, _d;
174
174
  return ((((_b = (_a = model === null || model === void 0 ? void 0 : model.localState) === null || _a === void 0 ? void 0 : _a.selected) === null || _b === void 0 ? void 0 : _b.value) &&
@@ -178,7 +178,7 @@ function isSelected(layerId, model) {
178
178
  /**
179
179
  * The component to display a single layer.
180
180
  */
181
- function LayerComponent(props) {
181
+ const LayerComponent = props => {
182
182
  const { layerId, gisModel, onClick } = props;
183
183
  const layer = gisModel === null || gisModel === void 0 ? void 0 : gisModel.getLayer(layerId);
184
184
  if (layer === undefined) {
@@ -224,7 +224,7 @@ function LayerComponent(props) {
224
224
  React.createElement(LabIcon.resolveReact, { icon: layer.visible ? visibilityIcon : nonVisibilityIcon, className: `${LAYER_ICON_CLASS}${layer.visible ? '' : ' jp-gis-mod-hidden'}`, tag: "span" })),
225
225
  icons.has(layer.type) && (React.createElement(LabIcon.resolveReact, Object.assign({}, icons.get(layer.type), { className: LAYER_ICON_CLASS }))),
226
226
  React.createElement("span", { id: id, className: LAYER_TEXT_CLASS, tabIndex: -2 }, name))));
227
- }
227
+ };
228
228
  var Private;
229
229
  (function (Private) {
230
230
  Private.dragIndicator = document.createElement('div');
@@ -232,7 +232,7 @@ var Private;
232
232
  Private.dragInfo = {
233
233
  draggedElement: null,
234
234
  dragOverElement: null,
235
- dragOverPosition: null
235
+ dragOverPosition: null,
236
236
  };
237
237
  Private.onDragStart = (e) => {
238
238
  Private.dragInfo.draggedElement = e.target;
@@ -1,10 +1,10 @@
1
1
  import { IJupyterGISTracker, JupyterGISDoc, SelectionType } from '@jupytergis/schema';
2
2
  import { IStateDB } from '@jupyterlab/statedb';
3
3
  import { SidePanel } from '@jupyterlab/ui-components';
4
+ import { CommandRegistry } from '@lumino/commands';
4
5
  import { Message } from '@lumino/messaging';
5
6
  import { MouseEvent as ReactMouseEvent } from 'react';
6
- import { IControlPanelModel } from '../types';
7
- import { CommandRegistry } from '@lumino/commands';
7
+ import { IControlPanelModel } from "../types";
8
8
  /**
9
9
  * Options of the left panel widget.
10
10
  */
@@ -36,6 +36,8 @@ export declare class LeftPanelWidget extends SidePanel {
36
36
  private _onSelect;
37
37
  resetSelected(type: SelectionType, nodeId?: string, item?: string): void;
38
38
  private _notifyCommands;
39
+ private _handleFileChange;
40
+ private _currentModel;
39
41
  private _lastSelectedNodeId;
40
42
  private _model;
41
43
  private _state;
@@ -1,8 +1,9 @@
1
1
  import { SidePanel } from '@jupyterlab/ui-components';
2
+ import { CommandIDs } from "../constants";
3
+ import StacPanel from "../stacBrowser/StacPanel";
4
+ import { FilterPanel } from './components/filter-panel/Filter';
2
5
  import { LayersPanel } from './components/layers';
3
6
  import { ControlPanelHeader } from './header';
4
- import { FilterPanel } from './components/filter-panel/Filter';
5
- import { CommandIDs } from '../constants';
6
7
  export class LeftPanelWidget extends SidePanel {
7
8
  constructor(options) {
8
9
  super();
@@ -11,7 +12,7 @@ export class LeftPanelWidget extends SidePanel {
11
12
  *
12
13
  * @param item - the selected layer or group.
13
14
  */
14
- this._onSelect = ({ type, item, nodeId, event }) => {
15
+ this._onSelect = ({ type, item, nodeId, event, }) => {
15
16
  var _a, _b;
16
17
  if (!this._model || !nodeId) {
17
18
  return;
@@ -64,24 +65,41 @@ export class LeftPanelWidget extends SidePanel {
64
65
  const layerTree = new LayersPanel({
65
66
  model: this._model,
66
67
  state: this._state,
67
- onSelect: this._onSelect
68
+ onSelect: this._onSelect,
68
69
  });
69
70
  layerTree.title.caption = 'Layer tree';
70
71
  layerTree.title.label = 'Layers';
71
72
  this.addWidget(layerTree);
73
+ const stacPanel = new StacPanel({
74
+ model: this._model,
75
+ tracker: options.tracker,
76
+ });
77
+ stacPanel.title.caption = 'STAC';
78
+ stacPanel.title.label = 'STAC';
79
+ this.addWidget(stacPanel);
72
80
  const filterPanel = new FilterPanel({
73
81
  model: this._model,
74
- tracker: options.tracker
82
+ tracker: options.tracker,
75
83
  });
76
84
  filterPanel.title.caption = 'Filters';
77
85
  filterPanel.title.label = 'Filters';
78
86
  this.addWidget(filterPanel);
87
+ this._handleFileChange = () => {
88
+ var _a;
89
+ header.title.label = ((_a = this._currentModel) === null || _a === void 0 ? void 0 : _a.filePath) || '-';
90
+ };
79
91
  options.tracker.currentChanged.connect((_, changed) => {
80
92
  if (changed) {
93
+ if (this._currentModel) {
94
+ this._currentModel.pathChanged.disconnect(this._handleFileChange);
95
+ }
96
+ this._currentModel = changed.model;
81
97
  header.title.label = changed.model.filePath;
98
+ this._currentModel.pathChanged.connect(this._handleFileChange);
82
99
  }
83
100
  else {
84
101
  header.title.label = '-';
102
+ this._currentModel = null;
85
103
  }
86
104
  });
87
105
  }
@@ -121,7 +139,7 @@ export class LeftPanelWidget extends SidePanel {
121
139
  if (item && nodeId) {
122
140
  selection[item] = {
123
141
  type,
124
- selectedNodeId: nodeId
142
+ selectedNodeId: nodeId,
125
143
  };
126
144
  this._lastSelectedNodeId = nodeId;
127
145
  }
@@ -1,6 +1,6 @@
1
1
  import { IJupyterGISDoc, IJupyterGISModel, IJupyterGISTracker, IJupyterGISWidget } from '@jupytergis/schema';
2
2
  import { ISignal } from '@lumino/signaling';
3
- import { IControlPanelModel } from '../types';
3
+ import { IControlPanelModel } from "../types";
4
4
  export declare class ControlPanelModel implements IControlPanelModel {
5
5
  constructor(options: ControlPanelModel.IOptions);
6
6
  get documentChanged(): ISignal<IJupyterGISTracker, IJupyterGISWidget | null>;
@@ -1,7 +1,7 @@
1
1
  import { IJGISFormSchemaRegistry, IJupyterGISTracker } from '@jupytergis/schema';
2
2
  import { PanelWithToolbar } from '@jupyterlab/ui-components';
3
3
  import { Panel } from '@lumino/widgets';
4
- import { IControlPanelModel } from '../types';
4
+ import { IControlPanelModel } from "../types";
5
5
  export declare class ObjectProperties extends PanelWithToolbar {
6
6
  constructor(params: ObjectProperties.IOptions);
7
7
  }
@@ -2,7 +2,7 @@ import { ReactWidget } from '@jupyterlab/apputils';
2
2
  import { PanelWithToolbar } from '@jupyterlab/ui-components';
3
3
  import * as React from 'react';
4
4
  import { v4 as uuid } from 'uuid';
5
- import { EditForm } from '../formbuilder/editform';
5
+ import { EditForm } from "../formbuilder/editform";
6
6
  export class ObjectProperties extends PanelWithToolbar {
7
7
  constructor(params) {
8
8
  super(params);
@@ -47,7 +47,7 @@ class ObjectPropertiesReact extends React.Component {
47
47
  this.state = {
48
48
  model: (_a = props.tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.model,
49
49
  clientId: null,
50
- id: uuid()
50
+ id: uuid(),
51
51
  };
52
52
  (_b = this.props.cpModel.jGISModel) === null || _b === void 0 ? void 0 : _b.sharedLayersChanged.connect(this._sharedJGISModelChanged);
53
53
  (_c = this.props.cpModel.jGISModel) === null || _c === void 0 ? void 0 : _c.sharedSourcesChanged.connect(this._sharedJGISModelChanged);
@@ -63,7 +63,7 @@ class ObjectPropertiesReact extends React.Component {
63
63
  else {
64
64
  this.setState({
65
65
  model: undefined,
66
- selectedObject: undefined
66
+ selectedObject: undefined,
67
67
  });
68
68
  }
69
69
  });
@@ -1,10 +1,11 @@
1
1
  import { IAnnotationModel, IJGISFormSchemaRegistry, IJupyterGISTracker, JupyterGISDoc } from '@jupytergis/schema';
2
2
  import { SidePanel } from '@jupyterlab/ui-components';
3
- import { IControlPanelModel } from '../types';
3
+ import { IControlPanelModel } from "../types";
4
4
  export declare class RightPanelWidget extends SidePanel {
5
5
  constructor(options: RightPanelWidget.IOptions);
6
6
  dispose(): void;
7
7
  private _currentModel;
8
+ private _handleFileChange;
8
9
  private _model;
9
10
  private _annotationModel;
10
11
  }
@@ -1,8 +1,8 @@
1
1
  import { SidePanel } from '@jupyterlab/ui-components';
2
- import { ControlPanelHeader } from './header';
3
- import { ObjectProperties } from './objectproperties';
4
2
  import { Annotations } from './annotationPanel';
5
3
  import IdentifyPanel from './components/identify-panel/IdentifyPanel';
4
+ import { ControlPanelHeader } from './header';
5
+ import { ObjectProperties } from './objectproperties';
6
6
  export class RightPanelWidget extends SidePanel {
7
7
  constructor(options) {
8
8
  super();
@@ -16,22 +16,26 @@ export class RightPanelWidget extends SidePanel {
16
16
  const properties = new ObjectProperties({
17
17
  controlPanelModel: this._model,
18
18
  formSchemaRegistry: options.formSchemaRegistry,
19
- tracker: options.tracker
19
+ tracker: options.tracker,
20
20
  });
21
21
  this.addWidget(properties);
22
22
  const annotations = new Annotations({
23
23
  rightPanelModel: this._model,
24
- annotationModel: this._annotationModel
24
+ annotationModel: this._annotationModel,
25
25
  });
26
26
  this.addWidget(annotations);
27
27
  const identifyPanel = new IdentifyPanel({
28
28
  model: this._model,
29
- tracker: options.tracker
29
+ tracker: options.tracker,
30
30
  });
31
31
  identifyPanel.title.caption = 'Identify';
32
32
  identifyPanel.title.label = 'Identify';
33
33
  identifyPanel.addClass('jgis-scrollable');
34
34
  this.addWidget(identifyPanel);
35
+ this._handleFileChange = () => {
36
+ var _a;
37
+ header.title.label = ((_a = this._currentModel) === null || _a === void 0 ? void 0 : _a.filePath) || '-';
38
+ };
35
39
  this._model.documentChanged.connect((_, changed) => {
36
40
  if (changed) {
37
41
  if (changed.model.sharedModel.editable) {
@@ -50,8 +54,12 @@ export class RightPanelWidget extends SidePanel {
50
54
  options.tracker.currentChanged.connect(async (_, changed) => {
51
55
  var _a;
52
56
  if (changed) {
57
+ if (this._currentModel) {
58
+ this._currentModel.pathChanged.disconnect(this._handleFileChange);
59
+ }
53
60
  this._currentModel = changed.model;
54
61
  header.title.label = this._currentModel.filePath;
62
+ this._currentModel.pathChanged.connect(this._handleFileChange);
55
63
  this._annotationModel.model =
56
64
  ((_a = options.tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.model) || undefined;
57
65
  // await changed.context.ready;
@@ -1,6 +1,6 @@
1
- import { IDict, IJGISLayer, IJupyterGISModel, IJGISFormSchemaRegistry, LayerType } from '@jupytergis/schema';
2
- import { JupyterGISTracker } from './types';
1
+ import { IDict, IJGISLayer, IJupyterGISModel, IJGISFormSchemaRegistry, LayerType, ProcessingType } from '@jupytergis/schema';
3
2
  import { JupyterFrontEnd } from '@jupyterlab/application';
3
+ import { JupyterGISTracker } from '../types';
4
4
  /**
5
5
  * Get the currently selected layer from the shared model. Returns null if there is no selection or multiple layer is selected.
6
6
  */
@@ -17,9 +17,9 @@ export type GdalFunctions = 'ogr2ogr' | 'gdal_rasterize' | 'gdalwarp' | 'gdal_tr
17
17
  /**
18
18
  * Generalized processing function for Buffer & Dissolve
19
19
  */
20
- export declare function processSelectedLayer(tracker: JupyterGISTracker, formSchemaRegistry: IJGISFormSchemaRegistry, processingType: 'Buffer' | 'Dissolve', processingOptions: {
20
+ export declare function processSelectedLayer(tracker: JupyterGISTracker, formSchemaRegistry: IJGISFormSchemaRegistry, processingType: ProcessingType, processingOptions: {
21
21
  sqlQueryFn: (layerName: string, param: any) => string;
22
22
  gdalFunction: GdalFunctions;
23
23
  options: (sqlQuery: string) => string[];
24
24
  }, app: JupyterFrontEnd): Promise<void>;
25
- export declare function executeSQLProcessing(model: IJupyterGISModel, geojsonString: string, gdalFunction: GdalFunctions, options: string[], layerNamePrefix: string, processingType: 'Buffer' | 'Dissolve', embedOutputLayer: boolean, tracker: JupyterGISTracker, app: JupyterFrontEnd): Promise<void>;
25
+ export declare function executeSQLProcessing(model: IJupyterGISModel, geojsonString: string, gdalFunction: GdalFunctions, options: string[], layerNamePrefix: string, processingType: ProcessingType, embedOutputLayer: boolean, tracker: JupyterGISTracker, app: JupyterFrontEnd): Promise<void>;
@@ -1,7 +1,9 @@
1
- import { getGdal } from './gdal';
1
+ import { processingList, } from '@jupytergis/schema';
2
2
  import { UUID } from '@lumino/coreutils';
3
- import { ProcessingFormDialog } from './dialogs/ProcessingFormDialog';
4
- import { getGeoJSONDataFromLayerSource } from './tools';
3
+ import { ProcessingFormDialog } from '../dialogs/ProcessingFormDialog';
4
+ import { getGdal } from '../gdal';
5
+ import { processingFormToParam } from './processingFormToParam';
6
+ import { getGeoJSONDataFromLayerSource } from '../tools';
5
7
  /**
6
8
  * Get the currently selected layer from the shared model. Returns null if there is no selection or multiple layer is selected.
7
9
  */
@@ -72,38 +74,31 @@ export async function processSelectedLayer(tracker, formSchemaRegistry, processi
72
74
  model,
73
75
  sourceData: {
74
76
  inputLayer: selectedLayerId,
75
- outputLayerName: selected.name
77
+ outputLayerName: selected.name,
76
78
  },
77
79
  formContext: 'create',
78
80
  processingType,
79
81
  syncData: (props) => {
80
82
  resolve(props);
81
83
  dialog.dispose();
82
- }
84
+ },
83
85
  });
84
86
  dialog.launch();
85
87
  });
86
88
  if (!formValues) {
87
89
  return;
88
90
  }
89
- let processParam;
90
- switch (processingType) {
91
- case 'Buffer':
92
- processParam = formValues.bufferDistance;
93
- break;
94
- case 'Dissolve':
95
- processParam = formValues.dissolveField;
96
- break;
97
- default:
98
- console.error(`Unsupported processing type: ${processingType}`);
99
- return;
91
+ if (!processingList.includes(processingType)) {
92
+ console.error(`Unsupported processing type: ${processingType}`);
93
+ return;
100
94
  }
95
+ const processParam = processingFormToParam(formValues, processingType);
101
96
  const embedOutputLayer = formValues.embedOutputLayer;
102
97
  const fileBlob = new Blob([geojsonString], {
103
- type: 'application/geo+json'
98
+ type: 'application/geo+json',
104
99
  });
105
100
  const geoFile = new File([fileBlob], 'data.geojson', {
106
- type: 'application/geo+json'
101
+ type: 'application/geo+json',
107
102
  });
108
103
  const Gdal = await getGdal();
109
104
  const result = await Gdal.open(geoFile);
@@ -137,21 +132,21 @@ export async function executeSQLProcessing(model, geojsonString, gdalFunction, o
137
132
  await app.serviceManager.contents.save(savePath, {
138
133
  type: 'file',
139
134
  format: 'text',
140
- content: processedGeoJSONString
135
+ content: processedGeoJSONString,
141
136
  });
142
137
  const newSourceId = UUID.uuid4();
143
138
  const sourceModel = {
144
139
  type: 'GeoJSONSource',
145
140
  name: outputFileName,
146
141
  parameters: {
147
- path: outputFileName
148
- }
142
+ path: outputFileName,
143
+ },
149
144
  };
150
145
  const layerModel = {
151
146
  type: 'VectorLayer',
152
147
  parameters: { source: newSourceId },
153
148
  visible: true,
154
- name: outputFileName
149
+ name: outputFileName,
155
150
  };
156
151
  model.sharedModel.addSource(newSourceId, sourceModel);
157
152
  model.addLayer(UUID.uuid4(), layerModel);
@@ -163,13 +158,13 @@ export async function executeSQLProcessing(model, geojsonString, gdalFunction, o
163
158
  const sourceModel = {
164
159
  type: 'GeoJSONSource',
165
160
  name: `${layerNamePrefix} ${processingType.charAt(0).toUpperCase() + processingType.slice(1)}`,
166
- parameters: { data: processedGeoJSON }
161
+ parameters: { data: processedGeoJSON },
167
162
  };
168
163
  const layerModel = {
169
164
  type: 'VectorLayer',
170
165
  parameters: { source: newSourceId },
171
166
  visible: true,
172
- name: `${layerNamePrefix} ${processingType.charAt(0).toUpperCase() + processingType.slice(1)}`
167
+ name: `${layerNamePrefix} ${processingType.charAt(0).toUpperCase() + processingType.slice(1)}`,
173
168
  };
174
169
  model.sharedModel.addSource(newSourceId, sourceModel);
175
170
  model.addLayer(UUID.uuid4(), layerModel);
@@ -0,0 +1,6 @@
1
+ import { IDict, IJGISFormSchemaRegistry } from '@jupytergis/schema';
2
+ import { JupyterFrontEnd } from '@jupyterlab/application';
3
+ import { CommandRegistry } from '@lumino/commands';
4
+ import { JupyterGISTracker } from '../types';
5
+ export declare function replaceInSql(sql: string, keyToVal: IDict<string>, layerName: string): string;
6
+ export declare function addProcessingCommands(app: JupyterFrontEnd, commands: CommandRegistry, tracker: JupyterGISTracker, trans: any, formSchemaRegistry: IJGISFormSchemaRegistry): void;