Skip to content

Commit bfbd24d

Browse files
authored
Merge pull request #87 from smplrspace/next
v2.29.0
2 parents 8e39074 + ea5ccdd commit bfbd24d

File tree

15 files changed

+180
-80
lines changed

15 files changed

+180
-80
lines changed

docs/api-reference/editor/editor.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,21 @@ const editor = new smplr.Editor({
2121
picture?: string
2222
}
2323
clientToken: string
24-
containerId: string
24+
containerId?: string
25+
container?: HTMLElement
2526
disableErrorReporting?: boolean
2627
whiteLabel?: boolean
2728
}) => Editor
2829
```
2930

30-
- `spaceId` is the unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
31+
- `spaceId` is the unique identifier of the space in Smplrspace, something like "spc_xxx". Refer to the [page on SIDs](/guides/sid) to learn more.
3132
- `user` is an object used to identify who is making the changes on the space.
3233
- `id` is a required unique identifier for the user. It does not represent anything on the Smplrspace side, it should most likely be your own internal `id`. It is used to track who made the changes.
3334
- `name` is an optional user-readable name for the user. The value is used in the Smplrspace app to indicate who made the changes. If you decide not to indicate the name, the app will indicate that "Someone" made the changes. This is purely an optional to improve your team's user experience of the Smplrspace app.
3435
- `picture` is an optional URL used as the avatar of the person who made changes in the app. If you decide not to provide a picture, the avatar will not be displayed in the app. This is purely an optional to improve your team's user experience of the Smplrspace app.
3536
- `clientToken` is an API token that is used to authenticate client-side requests. It is safe to have it exposed in your client code. You can manage your organisation's tokens in the Smplrspace app, by heading to the Developers page from the main menu. [More info](/guides/embedding#client-tokens).
3637
- `containerId` is the "id" of the html "div" container where smplr.js should render the editor, something like "smplr-container" that can be found in your html. Only ids are supported, not classes.
38+
- `container` is an alternative to `containerId` that lets you provide the HTML element directly instead of an id.
3739
- `disableErrorReporting` - _optional_ - can be set to "true" to disable the automated reporting of errors to our 3rd party error tracking tool, [Sentry](https://sentry.io/). We have discovered that Sentry's instrumentation could make it seem as if all network requests originated from smplr.js. Unfortunately, there is nothing simple we can do on our side to avoid that. If this is an issue for you, you can disable Sentry altogether. The tradeoff is that we will not automatically detect errors hapenning in your integration, and you may need to be more proactive to report them for us to roll out fixes.
3840
- `whiteLabel` - _optional_ - can be set to "true" to remove the "Powered by Smplrspace" attribution from the editor. This is a paid add-on. You can check if it is enabled from the Organization settings page. [Get in touch](mailto:hello@smplrspace.com) to learn more. _Note: there is currently no attribution in the editor, but there might be in the future._
3941

docs/api-reference/map/buildings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ To fetch spaces from your Smplrspace account and render them on the map, call th
1717
map.addSpacesById(spaceIds: string[]) => void
1818
```
1919

20-
- `spaceIds` - unique identifiers of the spaces in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
20+
- `spaceIds` - unique identifiers of the spaces in Smplrspace, something like "spc_xxx".
2121

2222
### Remove spaces by ID
2323

@@ -27,7 +27,7 @@ To remove specific spaces from the map, call this function:
2727
map.removeSpacesById(spaceIds: string[]) => void
2828
```
2929

30-
- `spaceIds` - unique identifiers of the spaces in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
30+
- `spaceIds` - unique identifiers of the spaces in Smplrspace, something like "spc_xxx".
3131

3232
### Remove all spaces
3333

docs/api-reference/map/map.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ To create a Map instance, initialise it as follow.
1414

1515
```ts
1616
const map = new smplr.Map({
17-
clientToken: string,
18-
containerId: string,
19-
disableErrorReporting?: boolean,
17+
clientToken: string
18+
containerId?: string
19+
container?: HTMLElement
20+
disableErrorReporting?: boolean
2021
}) => Map
2122
```
2223

2324
- `clientToken` is an API token that is used to authenticate client-side requests. It is safe to have it exposed in your client code. You can manage your organisation's tokens in the Smplrspace app, by heading to the Developers page from the main menu. [More info](/guides/embedding#client-tokens).
2425
- `containerId` is the "id" of the html "div" container where smplr.js should render the viewer, something like "smplr-container" that can be found in your html. Only ids are supported, not classes.
26+
- `container` is an alternative to `containerId` that lets you provide the HTML element directly instead of an id.
2527
- `disableErrorReporting` - _optional_ - can be set to "true" to disable the automated reporting of errors to our 3rd party error tracking tool, [Sentry](https://sentry.io/). We have discovered that Sentry's instrumentation could make it seem as if all network requests originated from smplr.js. Unfortunately, there is nothing simple we can do on our side to avoid that. If this is an issue for you, you can disable Sentry altogether. The tradeoff is that we will not automatically detect errors hapenning in your integration, and you may need to be more proactive to report them for us to roll out fixes.
2628

2729
## Interactive map viewer session
@@ -44,12 +46,12 @@ map.startViewer({
4446
}) => Promise<void>
4547
```
4648

47-
- `spaceIds` - _optional_ - lets you specify the Smplrspace ID of the spaces to render on the map when initializing the viewer. You can also do that dynamically as described on the [Building page](/api-reference/map/buildings).
49+
- `spaceIds` - _optional_ - lets you specify the Smplrspace ID ("spc_xxx") of the spaces to render on the map when initializing the viewer. You can also do that dynamically as described on the [Building page](/api-reference/map/buildings).
4850
- `osmBuildings` - _optional_ - lets you choose whether to render or not cities in 3D. City buildings data comes from OpenStreetMap and is automatically rendered in 3D. You can also do that dynamically as described in [3D cities](/api-reference/map/buildings#3d-cities). _Default value: true_.
4951
- `hash` - _optional_ - lets you choose whether to automatically sync the map location to the hash fragment of the page's URL. This makes it for easy to share links to specific map locations. It relies on Mapbox's corresponding [parameter](https://docs.mapbox.com/mapbox-gl-js/api/map/#map-parameters). _Default value: false_.
50-
- `fitNewSpacesInScreen` - _optional_ - lets you choose whether to automatically recenter the map to fit all the spaces when the spaces rendered on the map change. You can also center the map using [`fitAllSpacesInScreen`](#fit-all-spaces-in-screen). \_Default value: true.
52+
- `fitNewSpacesInScreen` - _optional_ - lets you choose whether to automatically recenter the map to fit all the spaces when the spaces rendered on the map change. You can also center the map using [`fitAllSpacesInScreen`](#fit-all-spaces-in-screen). _Default value: true._
5153
- `loadingMessage` - _optional_ - lets you override the text displayed while the space is loading. This can be change dynamically as well, see [UI controls](#ui-controls). _Default value: "Loading map"_.
52-
- `forceLoader` - _optional_ - provides programmatic control to whether the loader should be displayed or not. By default we display it while loading the map and initial spaces provided by `spaceIds`, but you can control this if you load your own data as well. This can be change dynamically as well, see [UI controls](#ui-controls). \_Default value: false.
54+
- `forceLoader` - _optional_ - provides programmatic control to whether the loader should be displayed or not. By default we display it while loading the map and initial spaces provided by `spaceIds`, but you can control this if you load your own data as well. This can be change dynamically as well, see [UI controls](#ui-controls). _Default value: false._
5355
- `onReady` - _optional_ - is called once the viewer's initial render is done. You may alternatively use the promise returned by startViewer, which resolves when the viewer is ready.
5456
- `onError` - _optional_ - is called if an error occur while starting the viewer. You may alternatively use the promise returned by startViewer to catch errors.
5557
- `onSpaceClick` - _optional_ - is called when the user clicks a 3D space, and provide data about which space and which level where clicked.
@@ -78,7 +80,7 @@ You can change automatically "fly" the map to a specific space, by providing the
7880
map.flyToSpace(spaceId: string) => void
7981
```
8082

81-
- `spaceId` - unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
83+
- `spaceId` - unique identifier of the space in Smplrspace, something like "spc_xxx".
8284

8385
### Fit all spaces in screen
8486

docs/api-reference/queryclient/doors-windows.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ interface Opening {
2828
```
2929

3030
- `id` - unique identifier of this particular opening.
31-
- `name` - name given to the furniture in the editor. It could be an empty string.
31+
- `name` - name given to the opening in the editor. It could be an empty string.
3232
- `dimensions.width` - horizontal width of the opening in centimeters.
3333
- `dimensions.baseHeight` - distance between the ground and the bottom of the opening. It is usually 0 for doors and positive for windows.
3434
- `dimensions.height` - distance between the bottom and the top of the opening.
@@ -39,21 +39,21 @@ interface Opening {
3939
To list all doors from a space, you can call the following query.
4040

4141
```ts
42-
smplrClient.getAllDoorsInSpace(id: string): Promise<Opening[]>
42+
smplrClient.getAllDoorsInSpace(spaceId: string): Promise<Opening[]>
4343
```
4444

45-
- `id` - unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
45+
- `spaceId` - unique identifier of the space in Smplrspace, something like "spc_xxx".
4646
- `Opening` - this main interface is described [here](#opening-interface).
4747

4848
## getAllDoorsInSpaceFromCache
4949

5050
This is the synchronous equivalent of the query right above.
5151

5252
```ts
53-
smplrClient.getAllDoorsInSpaceFromCache(id: string): Opening[]
53+
smplrClient.getAllDoorsInSpaceFromCache(spaceId: string): Opening[]
5454
```
5555

56-
where `id` and `Opening` are as defined in `getAllDoorsInSpace`.
56+
where `spaceId` and `Opening` are as defined in `getAllDoorsInSpace`.
5757

5858
## getDoorsOnLevel
5959

@@ -66,7 +66,7 @@ smplrClient.getDoorsOnLevel({
6666
}): Promise<Opening[]>
6767
```
6868

69-
- `spaceId` - unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
69+
- `spaceId` - unique identifier of the space in Smplrspace, something like "spc_xxx".
7070
- `levelIndex` - zero-based index of the level. Refer to the [Opening interface](#opening-interface) to learn more.
7171
- `Opening` - this main interface is described [here](#opening-interface).
7272

@@ -88,21 +88,21 @@ where `spaceId`, `levelIndex`, and `Opening` are as defined in `getDoorsOnLevel`
8888
To list all windows from a space, you can call the following query.
8989

9090
```ts
91-
smplrClient.getAllWindowsInSpace(id: string): Promise<Opening[]>
91+
smplrClient.getAllWindowsInSpace(spaceId: string): Promise<Opening[]>
9292
```
9393

94-
- `id` - unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
94+
- `spaceId` - unique identifier of the space in Smplrspace, something like "spc_xxx".
9595
- `Opening` - this main interface is described [here](#opening-interface).
9696

9797
## getAllWindowsInSpaceFromCache
9898

9999
This is the synchronous equivalent of the query right above.
100100

101101
```ts
102-
smplrClient.getAllWindowsInSpaceFromCache(id: string): Opening[]
102+
smplrClient.getAllWindowsInSpaceFromCache(spaceId: string): Opening[]
103103
```
104104

105-
where `id` and `Opening` are as defined in `getAllWindowsInSpace`.
105+
where `spaceId` and `Opening` are as defined in `getAllWindowsInSpace`.
106106

107107
## getWindowsOnLevel
108108

@@ -115,7 +115,7 @@ smplrClient.getWindowsOnLevel({
115115
}): Promise<Opening[]>
116116
```
117117

118-
- `spaceId` - unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
118+
- `spaceId` - unique identifier of the space in Smplrspace, something like "spc_xxx".
119119
- `levelIndex` - zero-based index of the level. Refer to the [Opening interface](#opening-interface) to learn more.
120120
- `Opening` - this main interface is described [here](#opening-interface).
121121

docs/api-reference/queryclient/furniture.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ sidebar_position: 6
44

55
# Furniture
66

7+
:::info
8+
"Furniture" is gradually being renamed to "Equipment". You'll read equipment is the app and furniture here, until the change is complete. They are one and the same concept.
9+
:::
10+
711
## Furniture interface
812

913
Multiple queries in this page return objects of the type `Furniture` described below:
@@ -47,21 +51,21 @@ interface Furniture {
4751
To list all furniture from a space, you can call the following query.
4852

4953
```ts
50-
smplrClient.getAllFurnitureInSpace(id: string): Promise<Furniture[]>
54+
smplrClient.getAllFurnitureInSpace(spaceId: string): Promise<Furniture[]>
5155
```
5256

53-
- `id` - unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
57+
- `spaceId` - unique identifier of the space in Smplrspace, something like "spc_xxx".
5458
- `Furniture` - this main interface is described [here](#furniture-interface).
5559

5660
## getAllFurnitureInSpaceFromCache
5761

5862
This is the synchronous equivalent of the query right above.
5963

6064
```ts
61-
smplrClient.getAllFurnitureInSpaceFromCache(id: string): Furniture[]
65+
smplrClient.getAllFurnitureInSpaceFromCache(spaceId: string): Furniture[]
6266
```
6367

64-
where `id` and `Furniture` are as defined in `getAllFurnitureInSpace`.
68+
where `spaceId` and `Furniture` are as defined in `getAllFurnitureInSpace`.
6569

6670
## getFurnitureOnLevel
6771

@@ -74,7 +78,7 @@ smplrClient.getFurnitureOnLevel({
7478
}): Promise<Furniture[]>
7579
```
7680

77-
- `spaceId` - unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
81+
- `spaceId` - unique identifier of the space in Smplrspace, something like "spc_xxx".
7882
- `levelIndex` - zero-based index of the level. Refer to the [Furniture interface](#furniture-interface) to learn more.
7983
- `Furniture` - this main interface is described [here](#furniture-interface).
8084

@@ -106,7 +110,7 @@ smplrClient.getFurnitureInPolygon({
106110
}): Promise<Furniture[]>
107111
```
108112

109-
- `spaceId` - unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
113+
- `spaceId` - unique identifier of the space in Smplrspace, something like "spc_xxx".
110114
- `polygon` - the definition of the area used as a mask to extract furniture. It has the same schema as the coordinates from the [polygon data layers](/api-reference/space/data-layers#polygon-layer). It is assumed here that all coordinates have the same `levelIndex` value.
111115
- `Furniture` - this main interface is described [here](#furniture-interface).
112116

@@ -138,8 +142,8 @@ smplrClient.getFurnitureById({
138142
}): Promise<Furniture | null>
139143
```
140144

141-
- `spaceId` - unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
142-
- `furnitureId` - unique identifier of the furniture in the space, has a similar format to `spaceId`.
145+
- `spaceId` - unique identifier of the space in Smplrspace, something like "spc_xxx".
146+
- `furnitureId` - unique identifier of the furniture in the space, something like "fbc5617e-5a27-4138-851e-839446121b2e".
143147
- `Furniture` - this main interface is described [here](#furniture-interface).
144148

145149
Returns `null` if the furniture is not found in the space.
@@ -173,8 +177,8 @@ smplrClient.getFurnitureGroundFootprintById({
173177
}[] | null>
174178
```
175179

176-
- `spaceId` - unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
177-
- `furnitureId` - unique identifier of the furniture in the space, has a similar format to `spaceId`.
180+
- `spaceId` - unique identifier of the space in Smplrspace, something like "spc_xxx".
181+
- `furnitureId` - unique identifier of the furniture in the space, something like "fbc5617e-5a27-4138-851e-839446121b2e".
178182
- `closed` - _optional_ - indicates whether the returned array should be "closed", i.e. the last element repeats the first element. _Default value: false._
179183

180184
Returns `null` if the furniture is not found in the space.
@@ -213,8 +217,8 @@ smplrClient.isFurnitureInPolygon({
213217
}): Promise<boolean | null>
214218
```
215219

216-
- `spaceId` - unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
217-
- `furnitureId` - unique identifier of the furniture in the space, has a similar format to `spaceId`.
220+
- `spaceId` - unique identifier of the space in Smplrspace, something like "spc_xxx".
221+
- `furnitureId` - unique identifier of the furniture in the space, something like "fbc5617e-5a27-4138-851e-839446121b2e".
218222
- `polygon` - the definition of the area used as a mask to extract furniture. It has the same schema as the coordinates from the [polygon data layers](/api-reference/space/data-layers#polygon-layer). It is assumed here that all coordinates have the same `levelIndex` value.
219223

220224
Returns `null` if the furniture is not found in the space, `false` if it is found but not in the polygon, `true` if it is found in the polygon.

docs/api-reference/queryclient/geometry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ smplrClient.isPointInPolygon({
155155
```
156156

157157
- `point` - the point coordinates in 2D, with the same schema as `polygon` below.
158-
- `polygon` - the definition of the area used as a mask to extract furniture. It has the same schema as the coordinates from the [polygon data layers](/api-reference/space/data-layers#polygon-layer). It is assumed here that all coordinates have the same `levelIndex` value.
158+
- `polygon` - the polygon in which the point should be located or not. It has the same schema as the coordinates from the [polygon data layers](/api-reference/space/data-layers#polygon-layer). It is assumed here that all coordinates have the same `levelIndex` value.
159159

160160
A similar query is available for furniture pieces, see [isFurnitureInPolygon](/api-reference/queryclient/furniture#isfurnitureinpolygon).
161161

docs/api-reference/queryclient/levels-rooms.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ smplrClient.getLevelBoundingBox({
2020
}[]>
2121
```
2222

23-
- `spaceId` - unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
23+
- `spaceId` - unique identifier of the space in Smplrspace, something like "spc_xxx".
2424
- `levelIndex` - zero-based index of the level. Refer to the [Furniture interface](/api-reference/queryclient/furniture#furniture-interface) to learn more.
2525
- `padding` - _optional_ - minimum space between the floor plate's grounds/walls and the bounding box in meters. _Default value: 0_
2626

@@ -57,7 +57,7 @@ smplrClient.getLevelAutomaticGround({
5757
}[] | null>
5858
```
5959

60-
- `spaceId` - unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
60+
- `spaceId` - unique identifier of the space in Smplrspace, something like "spc_xxx".
6161
- `levelIndex` - zero-based index of the level. Refer to the [Furniture interface](/api-reference/queryclient/furniture#furniture-interface) to learn more.
6262

6363
## getLevelAutomaticGroundFromCache
@@ -105,7 +105,7 @@ smplrClient.getRoomsOnLevel({
105105
}[] | null>
106106
```
107107

108-
- `spaceId` - unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
108+
- `spaceId` - unique identifier of the space in Smplrspace, something like "spc_xxx".
109109
- `levelIndex` - zero-based index of the level. Refer to the [Furniture interface](/api-reference/queryclient/furniture#furniture-interface) to learn more.
110110
- `useCache` - _optional_ - set this to control whether the request should use the client's local cache of computed automatic rooms. You can call this query with `useCache` set to `false` to refresh the cache for all automatic rooms related queries. _Default value: true_
111111

@@ -157,7 +157,7 @@ smplrClient.getRoomAtPoint({
157157
}[] | null>
158158
```
159159

160-
- `spaceId` - unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
160+
- `spaceId` - unique identifier of the space in Smplrspace, something like "spc_xxx".
161161
- `point` - the point coordinates in 2D, with the same schema as `polygon` below.
162162

163163
## getRoomAtPointFromCache

0 commit comments

Comments
 (0)