aletrn commited on
Commit
c0e13ed
·
1 Parent(s): a98096a

[feat] add user onboarding tour, remove section with direct huggingface space link

Browse files
static/package.json CHANGED
@@ -11,6 +11,7 @@
11
  "type": "module",
12
  "dependencies": {
13
  "@geoman-io/leaflet-geoman-free": "^2.15.0",
 
14
  "leaflet": "^1.9.4",
15
  "leaflet-providers": "^2.0.0",
16
  "vue": "^3.4.0"
 
11
  "type": "module",
12
  "dependencies": {
13
  "@geoman-io/leaflet-geoman-free": "^2.15.0",
14
+ "driver.js": "github:trincadev/driver.js",
15
  "leaflet": "^1.9.4",
16
  "leaflet-providers": "^2.0.0",
17
  "vue": "^3.4.0"
static/pnpm-lock.yaml CHANGED
@@ -8,6 +8,9 @@ dependencies:
8
  '@geoman-io/leaflet-geoman-free':
9
  specifier: ^2.15.0
10
  version: 2.15.0(leaflet@1.9.4)
 
 
 
11
  leaflet:
12
  specifier: ^1.9.4
13
  version: 1.9.4
@@ -2056,3 +2059,9 @@ packages:
2056
  resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
2057
  engines: {node: '>=10'}
2058
  dev: true
 
 
 
 
 
 
 
8
  '@geoman-io/leaflet-geoman-free':
9
  specifier: ^2.15.0
10
  version: 2.15.0(leaflet@1.9.4)
11
+ driver.js:
12
+ specifier: github:trincadev/driver.js
13
+ version: github.com/trincadev/driver.js/7418968e80d10bc79ea1212f43e76aa5f48aed9a
14
  leaflet:
15
  specifier: ^1.9.4
16
  version: 1.9.4
 
2059
  resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
2060
  engines: {node: '>=10'}
2061
  dev: true
2062
+
2063
+ github.com/trincadev/driver.js/7418968e80d10bc79ea1212f43e76aa5f48aed9a:
2064
+ resolution: {tarball: https://codeload.github.com/trincadev/driver.js/tar.gz/7418968e80d10bc79ea1212f43e76aa5f48aed9a}
2065
+ name: driver.js
2066
+ version: 1.3.1
2067
+ dev: false
static/src/components/PagePredictionMap.vue CHANGED
@@ -1,17 +1,14 @@
1
  <template>
2
- <div class="h-auto">
3
 
4
  <div class="grid grid-cols-1 2xl:grid-cols-5 lg:gap-1 lg:border-r ml-2 mt-2 md:ml-4 md:mr-4">
5
 
6
  <div class="lg:border-r lg:col-span-3">
7
  <div id="id-map-cont" class="">
8
- <p
9
- class="block lg:hidden"
10
- v-if="currentPathnameRef.startsWith(pathnameCheckRef)"
11
- >Trouble on page scrolling? Use the <a :href="embeddedSpaceRef">embedded space</a>.</p>
12
  <p class="hidden lg:block">{{ description }}</p>
13
  <div class="w-full md:pt-1 md:pb-1 lg:hidden portrait:xl:hidden">
14
  <ButtonMapSendRequest
 
15
  class="h-8 text-sm font-extralight min-w-[180px] max-w-[180px]"
16
  :current-base-map-name="currentBaseMapNameRef"
17
  :map="map"
@@ -25,6 +22,7 @@
25
  <ButtonMapSendRequest
26
  class="h-8 min-w-[240px] max-w-[240px] mt-2 mb-2 hidden sd:h-14 lg:block portrait:xl:block"
27
  :current-base-map-name="currentBaseMapNameRef"
 
28
  :map="map"
29
  :prompts-array="promptsArrayRef"
30
  :response-message="responseMessageRef"
@@ -36,7 +34,7 @@
36
  </div>
37
 
38
  <div class="lg:col-span-2">
39
- <div class="lg:pl-2 lg:pr-2 lg:border-l lg:border-3">
40
 
41
  <h1>Map Info</h1>
42
  <div class="grid grid-cols-1 md:grid-cols-3">
@@ -60,7 +58,7 @@
60
  </div>
61
  </div>
62
 
63
- <h1>ML request prompt</h1>
64
  <div v-if="promptsArrayRef.filter(el => {return el.type === 'point'}).length > 0">
65
  <TableGenericComponent
66
  :header="['id', 'data', 'label']"
@@ -99,6 +97,7 @@ import {
99
  import 'leaflet-providers'
100
  import '@geoman-io/leaflet-geoman-free'
101
  import { onMounted, ref, type Ref } from 'vue'
 
102
 
103
  import {
104
  durationRef,
@@ -109,7 +108,7 @@ import {
109
  responseMessageRef,
110
  Satellite,
111
  waitingString
112
- } from '@/components/constants'
113
  import {
114
  applyFnToObjectWithinArray,
115
  getExtentCurrentViewMapBBox,
@@ -123,13 +122,25 @@ import StatsGrid from '@/components/StatsGrid.vue';
123
  import TableGenericComponent from '@/components/TableGenericComponent.vue';
124
  import ButtonMapSendRequest from '@/components/buttons/ButtonMapSendRequest.vue';
125
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  const currentBaseMapNameRef = ref("")
127
  const currentMapBBoxRef = ref()
128
  const currentZoomRef = ref()
129
  const promptsArrayRef: Ref<Array<IPointPrompt | IRectanglePrompt>> = ref([])
130
- const pathnameCheckRef = ref(import.meta.env.VITE__PATHNAME_CHECK || "")
131
- const currentPathnameRef = ref("current-pathname-placeholder")
132
- const embeddedSpaceRef = ref(import.meta.env.VITE__SAMGIS_SPACE || "")
133
  let map: LMap
134
  type ServiceTiles = {
135
  [key: SourceTileType]: LTileLayer;
@@ -195,7 +206,6 @@ const getCurrentBasemap = (url: string, providersArray: ServiceTiles) => {
195
  }
196
 
197
  onMounted(async () => {
198
- currentPathnameRef.value = window.location.pathname || ""
199
  const osmTile = tileLayer.provider(OpenStreetMap)
200
  let localVarSatellite: SourceTileType = import.meta.env.VITE_SATELLITE_NAME ? String(import.meta.env.VITE_SATELLITE_NAME) : Satellite
201
  const satelliteTile = tileLayer.provider(localVarSatellite)
@@ -227,6 +237,8 @@ onMounted(async () => {
227
  map.on('baselayerchange', (e: LEvented) => {
228
  currentBaseMapNameRef.value = getCurrentBasemap(e.layer._url, baseMaps)
229
  })
 
 
230
  })
231
  </script>
232
 
 
1
  <template>
2
+ <div class="h-auto" id="id-prediction-map-container">
3
 
4
  <div class="grid grid-cols-1 2xl:grid-cols-5 lg:gap-1 lg:border-r ml-2 mt-2 md:ml-4 md:mr-4">
5
 
6
  <div class="lg:border-r lg:col-span-3">
7
  <div id="id-map-cont" class="">
 
 
 
 
8
  <p class="hidden lg:block">{{ description }}</p>
9
  <div class="w-full md:pt-1 md:pb-1 lg:hidden portrait:xl:hidden">
10
  <ButtonMapSendRequest
11
+ id="id-button-submit"
12
  class="h-8 text-sm font-extralight min-w-[180px] max-w-[180px]"
13
  :current-base-map-name="currentBaseMapNameRef"
14
  :map="map"
 
22
  <ButtonMapSendRequest
23
  class="h-8 min-w-[240px] max-w-[240px] mt-2 mb-2 hidden sd:h-14 lg:block portrait:xl:block"
24
  :current-base-map-name="currentBaseMapNameRef"
25
+ id="id-button-submit"
26
  :map="map"
27
  :prompts-array="promptsArrayRef"
28
  :response-message="responseMessageRef"
 
34
  </div>
35
 
36
  <div class="lg:col-span-2">
37
+ <div class="lg:pl-2 lg:pr-2 lg:border-l lg:border-3" id="id-map-info">
38
 
39
  <h1>Map Info</h1>
40
  <div class="grid grid-cols-1 md:grid-cols-3">
 
58
  </div>
59
  </div>
60
 
61
+ <h1 id="id-ml-request-prompt">ML request prompt</h1>
62
  <div v-if="promptsArrayRef.filter(el => {return el.type === 'point'}).length > 0">
63
  <TableGenericComponent
64
  :header="['id', 'data', 'label']"
 
97
  import 'leaflet-providers'
98
  import '@geoman-io/leaflet-geoman-free'
99
  import { onMounted, ref, type Ref } from 'vue'
100
+ import { driver } from "../../node_modules/driver.js/src/driver"
101
 
102
  import {
103
  durationRef,
 
108
  responseMessageRef,
109
  Satellite,
110
  waitingString
111
+ } from './constants'
112
  import {
113
  applyFnToObjectWithinArray,
114
  getExtentCurrentViewMapBBox,
 
122
  import TableGenericComponent from '@/components/TableGenericComponent.vue';
123
  import ButtonMapSendRequest from '@/components/buttons/ButtonMapSendRequest.vue';
124
 
125
+ const driverObj = driver({
126
+ showProgress: true,
127
+ steps: [
128
+ { element: 'id-prediction-map-container', popover: { title: 'SamGIS', description: 'A quick tour about SamGIS functionality' } },
129
+ { element: '#map', popover: { title: 'Webmap for ML prompt', description: 'Add here your machine learning prompt' } },
130
+ { element: '.leaflet-pm-icon-marker-include', popover: { title: '"Include" point prompt', description: 'add "include" points prompt for machine learning request' } },
131
+ { element: '.leaflet-pm-icon-marker-exclude', popover: { title: '"Exclude" point prompt', description: 'add "exclude" points prompt for machine learning request' } },
132
+ { element: '.leaflet-pm-icon-rectangle', popover: { title: '"Include" rectangle prompt', description: 'add "include" rectangles prompt for machine learning request' } },
133
+ { element: "#id-button-submit", popover: { title: 'ML submit button', description: 'Machine learning submit button' } },
134
+ { element: '.leaflet-control-layers-toggle', popover: { title: 'Map provider selector', description: 'select a different map provider' } },
135
+ { element: '#id-map-info', popover: { title: 'map info', description: 'Section about various map info' } },
136
+ { element: '#id-ml-request-prompt', popover: { title: 'ML prompt quest', description: 'Empty at beginning, this table will contain the machine learning prompt (points and rectangles) section' } }
137
+ ]
138
+ });
139
+
140
  const currentBaseMapNameRef = ref("")
141
  const currentMapBBoxRef = ref()
142
  const currentZoomRef = ref()
143
  const promptsArrayRef: Ref<Array<IPointPrompt | IRectanglePrompt>> = ref([])
 
 
 
144
  let map: LMap
145
  type ServiceTiles = {
146
  [key: SourceTileType]: LTileLayer;
 
206
  }
207
 
208
  onMounted(async () => {
 
209
  const osmTile = tileLayer.provider(OpenStreetMap)
210
  let localVarSatellite: SourceTileType = import.meta.env.VITE_SATELLITE_NAME ? String(import.meta.env.VITE_SATELLITE_NAME) : Satellite
211
  const satelliteTile = tileLayer.provider(localVarSatellite)
 
237
  map.on('baselayerchange', (e: LEvented) => {
238
  currentBaseMapNameRef.value = getCurrentBasemap(e.layer._url, baseMaps)
239
  })
240
+
241
+ driverObj.drive();
242
  })
243
  </script>
244
 
static/src/input.css CHANGED
@@ -1,6 +1,8 @@
1
  @import "leaflet/dist/leaflet.css";
2
  @import "leaflet-custom.css";
3
  @import "@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css";
 
 
4
  @tailwind base;
5
 
6
  @layer base {
 
1
  @import "leaflet/dist/leaflet.css";
2
  @import "leaflet-custom.css";
3
  @import "@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css";
4
+ @import "../node_modules/driver.js/src/driver.css";
5
+
6
  @tailwind base;
7
 
8
  @layer base {