Skip to content

Commit

Permalink
Merge branch 'develop' into mpa-menu-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mayagbarnes committed Apr 26, 2024
2 parents 2d1b787 + 7266453 commit ddb92ad
Show file tree
Hide file tree
Showing 6 changed files with 559 additions and 276 deletions.
100 changes: 95 additions & 5 deletions NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ SOFTWARE.

The following software may be included in this product: @deck.gl/aggregation-layers, @deck.gl/carto, @deck.gl/core, @deck.gl/extensions, @deck.gl/geo-layers, @deck.gl/google-maps, @deck.gl/json, @deck.gl/layers, @deck.gl/mapbox, @deck.gl/mesh-layers, @deck.gl/react, deck.gl. A copy of the source code may be downloaded from https://github.com/visgl/deck.gl.git (@deck.gl/aggregation-layers), https://github.com/visgl/deck.gl.git (@deck.gl/carto), https://github.com/visgl/deck.gl.git (@deck.gl/core), https://github.com/visgl/deck.gl.git (@deck.gl/extensions), https://github.com/visgl/deck.gl.git (@deck.gl/geo-layers), https://github.com/visgl/deck.gl.git (@deck.gl/google-maps), https://github.com/visgl/deck.gl.git (@deck.gl/json), https://github.com/visgl/deck.gl.git (@deck.gl/layers), https://github.com/visgl/deck.gl.git (@deck.gl/mapbox), https://github.com/visgl/deck.gl.git (@deck.gl/mesh-layers), https://github.com/visgl/deck.gl.git (@deck.gl/react), https://github.com/visgl/deck.gl.git (deck.gl). This software contains the following license and notice below:

Copyright (c) 2020 Urban Computing Foundation
Copyright Vis.gl contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -510,7 +510,7 @@ SOFTWARE.

-----

The following software may be included in this product: @loaders.gl/3d-tiles, @loaders.gl/core, @loaders.gl/csv, @loaders.gl/draco, @loaders.gl/gis, @loaders.gl/gltf, @loaders.gl/images, @loaders.gl/loader-utils, @loaders.gl/math, @loaders.gl/mvt, @loaders.gl/schema, @loaders.gl/terrain, @loaders.gl/textures, @loaders.gl/tiles, @loaders.gl/worker-utils. A copy of the source code may be downloaded from https://github.com/visgl/loaders.gl (@loaders.gl/3d-tiles), https://github.com/visgl/loaders.gl (@loaders.gl/core), https://github.com/visgl/loaders.gl (@loaders.gl/csv), https://github.com/visgl/loaders.gl (@loaders.gl/draco), https://github.com/visgl/loaders.gl (@loaders.gl/gis), https://github.com/visgl/loaders.gl (@loaders.gl/gltf), https://github.com/visgl/loaders.gl (@loaders.gl/images), https://github.com/visgl/loaders.gl (@loaders.gl/loader-utils), https://github.com/visgl/loaders.gl (@loaders.gl/math), https://github.com/visgl/loaders.gl (@loaders.gl/mvt), https://github.com/visgl/loaders.gl (@loaders.gl/schema), https://github.com/visgl/loaders.gl (@loaders.gl/terrain), https://github.com/visgl/loaders.gl (@loaders.gl/textures), https://github.com/visgl/loaders.gl (@loaders.gl/tiles), https://github.com/visgl/loaders.gl (@loaders.gl/worker-utils). This software contains the following license and notice below:
The following software may be included in this product: @loaders.gl/3d-tiles, @loaders.gl/core, @loaders.gl/csv, @loaders.gl/draco, @loaders.gl/gis, @loaders.gl/gltf, @loaders.gl/images, @loaders.gl/loader-utils, @loaders.gl/math, @loaders.gl/mvt, @loaders.gl/schema, @loaders.gl/terrain, @loaders.gl/textures, @loaders.gl/tiles, @loaders.gl/wms, @loaders.gl/worker-utils, @loaders.gl/xml. A copy of the source code may be downloaded from https://github.com/visgl/loaders.gl (@loaders.gl/3d-tiles), https://github.com/visgl/loaders.gl (@loaders.gl/core), https://github.com/visgl/loaders.gl (@loaders.gl/csv), https://github.com/visgl/loaders.gl (@loaders.gl/draco), https://github.com/visgl/loaders.gl (@loaders.gl/gis), https://github.com/visgl/loaders.gl (@loaders.gl/gltf), https://github.com/visgl/loaders.gl (@loaders.gl/images), https://github.com/visgl/loaders.gl (@loaders.gl/loader-utils), https://github.com/visgl/loaders.gl (@loaders.gl/math), https://github.com/visgl/loaders.gl (@loaders.gl/mvt), https://github.com/visgl/loaders.gl (@loaders.gl/schema), https://github.com/visgl/loaders.gl (@loaders.gl/terrain), https://github.com/visgl/loaders.gl (@loaders.gl/textures), https://github.com/visgl/loaders.gl (@loaders.gl/tiles), https://github.com/visgl/loaders.gl (@loaders.gl/wms), https://github.com/visgl/loaders.gl (@loaders.gl/worker-utils), https://github.com/visgl/loaders.gl (@loaders.gl/xml). This software contains the following license and notice below:

Copyright (c) 2015 Uber Technologies, Inc.

Expand Down Expand Up @@ -701,7 +701,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

-----

The following software may be included in this product: @mapbox/tile-cover, @mapbox/tilebelt. A copy of the source code may be downloaded from https://github.com/mapbox/tile-cover.git (@mapbox/tile-cover), https://github.com/mapbox/tilebelt.git (@mapbox/tilebelt). This software contains the following license and notice below:
The following software may be included in this product: @mapbox/tile-cover, tilebelt. A copy of the source code may be downloaded from https://github.com/mapbox/tile-cover.git (@mapbox/tile-cover), https://github.com/mapbox/tilebelt.git (tilebelt). This software contains the following license and notice below:

The MIT License (MIT)

Expand Down Expand Up @@ -739,6 +739,20 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”

-----

The following software may be included in this product: @mapbox/tiny-sdf. A copy of the source code may be downloaded from git+https://github.com/mapbox/tiny-sdf.git. This software contains the following license and notice below:

BSD-2-Clause
Copyright (c) 2016-2022 Mapbox, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-----

The following software may be included in this product: @mapbox/vector-tile. A copy of the source code may be downloaded from https://github.com/mapbox/vector-tile-js.git. This software contains the following license and notice below:

Copyright (c) 2014, Mapbox
Expand Down Expand Up @@ -1378,7 +1392,7 @@ limitations under the License.

-----

The following software may be included in this product: @turf/area, @turf/bbox, @turf/centroid, @turf/helpers, @turf/meta. A copy of the source code may be downloaded from git://github.com/Turfjs/turf.git (@turf/area), git://github.com/Turfjs/turf.git (@turf/bbox), git://github.com/Turfjs/turf.git (@turf/centroid), git://github.com/Turfjs/turf.git (@turf/helpers), git://github.com/Turfjs/turf.git (@turf/meta). This software contains the following license and notice below:
The following software may be included in this product: @turf/area, @turf/bbox, @turf/boolean-clockwise, @turf/centroid, @turf/clone, @turf/helpers, @turf/invariant, @turf/meta, @turf/rewind. A copy of the source code may be downloaded from git://github.com/Turfjs/turf.git (@turf/area), git://github.com/Turfjs/turf.git (@turf/bbox), git://github.com/Turfjs/turf.git (@turf/boolean-clockwise), git://github.com/Turfjs/turf.git (@turf/centroid), git://github.com/Turfjs/turf.git (@turf/clone), git://github.com/Turfjs/turf.git (@turf/helpers), git://github.com/Turfjs/turf.git (@turf/invariant), git://github.com/Turfjs/turf.git (@turf/meta), git://github.com/Turfjs/turf.git (@turf/rewind). This software contains the following license and notice below:

The MIT License (MIT)

Expand Down Expand Up @@ -6277,7 +6291,7 @@ SOFTWARE.

-----

The following software may be included in this product: array-find-index, escape-string-regexp, is-obj, is-plain-obj, math-log2, number-is-integer, object-assign, path-is-absolute. A copy of the source code may be downloaded from https://github.com/sindresorhus/array-find-index.git (array-find-index), https://github.com/sindresorhus/escape-string-regexp.git (escape-string-regexp), https://github.com/sindresorhus/is-obj.git (is-obj), https://github.com/sindresorhus/is-plain-obj.git (is-plain-obj), https://github.com/sindresorhus/math-log2.git (math-log2), https://github.com/sindresorhus/number-is-integer.git (number-is-integer), https://github.com/sindresorhus/object-assign.git (object-assign), https://github.com/sindresorhus/path-is-absolute.git (path-is-absolute). This software contains the following license and notice below:
The following software may be included in this product: array-find-index, buf-compare, core-assert, deep-strict-equal, escape-string-regexp, is-obj, is-plain-obj, math-log2, number-is-integer, object-assign, path-is-absolute. A copy of the source code may be downloaded from https://github.com/sindresorhus/array-find-index.git (array-find-index), https://github.com/sindresorhus/buf-compare.git (buf-compare), https://github.com/sindresorhus/core-assert.git (core-assert), https://github.com/sindresorhus/deep-strict-equal.git (deep-strict-equal), https://github.com/sindresorhus/escape-string-regexp.git (escape-string-regexp), https://github.com/sindresorhus/is-obj.git (is-obj), https://github.com/sindresorhus/is-plain-obj.git (is-plain-obj), https://github.com/sindresorhus/math-log2.git (math-log2), https://github.com/sindresorhus/number-is-integer.git (number-is-integer), https://github.com/sindresorhus/object-assign.git (object-assign), https://github.com/sindresorhus/path-is-absolute.git (path-is-absolute). This software contains the following license and notice below:

The MIT License (MIT)

Expand Down Expand Up @@ -10862,6 +10876,32 @@ OTHER DEALINGS IN THE SOFTWARE.

-----

The following software may be included in this product: fast-xml-parser. A copy of the source code may be downloaded from https://github.com/NaturalIntelligence/fast-xml-parser. This software contains the following license and notice below:

MIT License

Copyright (c) 2017 Amit Kumar Gupta

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

-----

The following software may be included in this product: fbemitter. A copy of the source code may be downloaded from https://github.com/facebook/emitter.git. This software contains the following license and notice below:

BSD License
Expand Down Expand Up @@ -12262,6 +12302,30 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-----

The following software may be included in this product: is-error. A copy of the source code may be downloaded from git://github.com/mk-pmb/is-error-js.git. This software contains the following license and notice below:

Copyright (c) 2015 is-error.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

-----

The following software may be included in this product: is-extendable. A copy of the source code may be downloaded from https://github.com/jonschlinkert/is-extendable.git. This software contains the following license and notice below:

The MIT License (MIT)
Expand Down Expand Up @@ -17665,6 +17729,32 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.

-----

The following software may be included in this product: strnum. A copy of the source code may be downloaded from https://github.com/NaturalIntelligence/strnum. This software contains the following license and notice below:

MIT License

Copyright (c) 2021 Natural Intelligence

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

-----

The following software may be included in this product: style-to-object. A copy of the source code may be downloaded from https://github.com/remarkablemark/style-to-object. This software contains the following license and notice below:

The MIT License (MIT)
Expand Down
7 changes: 4 additions & 3 deletions frontend/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
"lint": "eslint --ext .js --ext .jsx --ext .ts --ext .tsx --max-warnings 0 src"
},
"dependencies": {
"@deck.gl/core": "^8.8.23",
"@deck.gl/json": "^8.8.24",
"@deck.gl/carto": "^8.9.36",
"@deck.gl/core": "^8.9.36",
"@deck.gl/json": "^8.9.36",
"@emotion-icons/emotion-icon": "^4.1.0",
"@emotion-icons/material-outlined": "^3.14.0",
"@emotion-icons/material-rounded": "^3.14.0",
Expand All @@ -55,7 +56,7 @@
"date-fns": "^2.29.3",
"date-fns-tz": "^2.0.0",
"decamelize": "^6.0.0",
"deck.gl": "^8.8.23",
"deck.gl": "^8.9.36",
"dompurify": "^3.0.9",
"fzy.js": "^0.4.1",
"hoist-non-react-statics": "^3.3.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,28 @@ describe("DeckGlJsonChart element", () => {
expect(result.html).toBe("<b>Elevation Value:</b> 10")
})

it("should interpolate the html from object with a properties field", () => {
deckGlInstance.props.element.tooltip = JSON.stringify({
html: "<b>Elevation Value:</b> {elevationValue}",
})
const result = deckGlInstance.createTooltip({
object: { properties: { elevationValue: 10 } },
})

expect(result.html).toBe("<b>Elevation Value:</b> 10")
})

it("should return the tooltip unchanged when object does have an expected schema", () => {
deckGlInstance.props.element.tooltip = JSON.stringify({
html: "<b>Elevation Value:</b> {elevationValue}",
})
const result = deckGlInstance.createTooltip({
object: { unexpectedSchema: { elevationValue: 10 } },
})

expect(result.html).toBe("<b>Elevation Value:</b> {elevationValue}")
})

it("should interpolate the html with the an empty string", () => {
deckGlInstance.props = getProps({
tooltip: "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ import {
} from "@streamlit/lib/src/theme"
// We don't have Typescript defs for these imports, which makes ESLint unhappy
/* eslint-disable import/no-extraneous-dependencies */
import {
colorBins,
colorCategories,
colorContinuous,
CartoLayer,
} from "@deck.gl/carto"
import * as layers from "@deck.gl/layers"
import { JSONConverter } from "@deck.gl/json"
import * as geoLayers from "@deck.gl/geo-layers"
Expand All @@ -50,7 +56,7 @@ import "mapbox-gl/dist/mapbox-gl.css"

interface PickingInfo {
object: {
[key: string]: string
[key: string]: any
}
}

Expand All @@ -64,7 +70,18 @@ interface DeckObject {
}

const configuration = {
classes: { ...layers, ...aggregationLayers, ...geoLayers, ...meshLayers },
classes: {
...layers,
...aggregationLayers,
...geoLayers,
...meshLayers,
CartoLayer,
},
functions: {
colorBins,
colorCategories,
colorContinuous,
},
}

registerLoaders([CSVLoader, GLTFLoader])
Expand Down Expand Up @@ -225,6 +242,11 @@ export class DeckGlJsonChart extends PureComponent<PropsWithHeight, State> {

if (info.object.hasOwnProperty(variable)) {
body = body.replace(match, info.object[variable])
} else if (
info.object.hasOwnProperty("properties") &&
info.object.properties.hasOwnProperty(variable)
) {
body = body.replace(match, info.object.properties[variable])
}
})
}
Expand Down
10 changes: 6 additions & 4 deletions frontend/lib/src/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@
// We don't have typings for deck.gl, so let's make it untyped.
declare module "deck.gl"

declare module "@deck.gl/json"

declare module "@deck.gl/layers"

declare module "@deck.gl/aggregation-layers"

declare module "@deck.gl/carto"

declare module "@deck.gl/geo-layers"

declare module "@deck.gl/json"

declare module "@deck.gl/layers"

declare module "@deck.gl/mesh-layers"

declare module "@loaders.gl/core"
Expand Down

0 comments on commit ddb92ad

Please sign in to comment.