@devgateway/dvz-ui-react 1.3.5 → 1.5.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.
- package/dist/cjs/_virtual/_commonjsHelpers.js +1 -0
- package/dist/cjs/_virtual/_nodeUtil.js +1 -0
- package/dist/cjs/_virtual/isBuffer.js +1 -0
- package/dist/cjs/_virtual/isEqual.js +1 -0
- package/dist/cjs/embeddable/big-number-trend/index.js +1 -1
- package/dist/cjs/embeddable/body/index.js +1 -1
- package/dist/cjs/embeddable/chart/Bar.js +1 -1
- package/dist/cjs/embeddable/chart/Line.js +1 -1
- package/dist/cjs/embeddable/chart/colors/ColorProvider.js +1 -1
- package/dist/cjs/embeddable/chart/colors/ManualColors.js +1 -1
- package/dist/cjs/embeddable/chart/colors/SystemColors.js +1 -1
- package/dist/cjs/embeddable/chart/data/Bar.js +1 -1
- package/dist/cjs/embeddable/chart/data/Line.js +1 -1
- package/dist/cjs/embeddable/chart/data/Utils.js +1 -1
- package/dist/cjs/embeddable/d3Map/BaseLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/DataLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/FlowLayer.js +1 -1
- package/dist/cjs/embeddable/data/DataContext.js +1 -1
- package/dist/cjs/embeddable/featuredtabs/index.js +1 -1
- package/dist/cjs/embeddable/filter/index.js +1 -1
- package/dist/cjs/embeddable/filtered-posts/NoData.js +11 -0
- package/dist/cjs/embeddable/filtered-posts/index.js +1 -0
- package/dist/cjs/embeddable/index.js +1 -1
- package/dist/cjs/embeddable/inlinelist/index.js +1 -1
- package/dist/cjs/embeddable/map/MapDataFrame.js +1 -1
- package/dist/cjs/embeddable/map/index.js +2 -2
- package/dist/cjs/embeddable/map/map.js +4 -4
- package/dist/cjs/embeddable/new-time-line/index.js +1 -1
- package/dist/cjs/embeddable/new-time-line/timeline.js +1 -1
- package/dist/cjs/embeddable/posts-filter/PostsFilterDropdown.js +1 -0
- package/dist/cjs/embeddable/posts-filter/index.js +1 -0
- package/dist/cjs/embeddable/posts-filters-reset-button/index.js +1 -0
- package/dist/cjs/embeddable/posts-pagination/index.js +1 -0
- package/dist/cjs/embeddable/postscarousel/index.js +1 -1
- package/dist/cjs/embeddable/reducers/data-api.js +1 -1
- package/dist/cjs/embeddable/reducers/data.js +1 -1
- package/dist/cjs/embeddable/showcase/index.js +1 -1
- package/dist/cjs/embeddable/time-line/desktop.js +1 -1
- package/dist/cjs/embeddable/time-line/mobile.js +1 -1
- package/dist/cjs/embeddable/vertical-featuredtabs/index.js +2 -2
- package/dist/cjs/layout/ClassicHeader.js +1 -1
- package/dist/cjs/layout/CustomSemanticSearch.js +1 -1
- package/dist/cjs/layout/Header.js +3 -3
- package/dist/cjs/layout/Layout.js +1 -1
- package/dist/cjs/layout/SearchControl.js +1 -1
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_DataView.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Hash.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_ListCache.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Map.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Promise.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Set.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_SetCache.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Stack.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Uint8Array.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_WeakMap.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayFilter.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayLikeKeys.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayPush.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arraySome.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetAllKeys.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsArguments.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsEqual.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsEqualDeep.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsNative.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsTypedArray.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseKeys.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTimes.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseUnary.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_cacheHas.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_coreJsData.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_equalArrays.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_equalByTag.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_equalObjects.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getAllKeys.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getMapData.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getNative.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getSymbols.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getTag.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getValue.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashClear.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashDelete.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashGet.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashHas.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashSet.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isIndex.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isKeyable.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isMasked.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isPrototype.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheClear.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheGet.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheHas.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheSet.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheClear.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheDelete.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheGet.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheHas.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheSet.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapToArray.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_nativeCreate.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_nativeKeys.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_nodeUtil.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_overArg.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_setCacheAdd.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_setCacheHas.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_setToArray.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackClear.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackDelete.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackGet.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackHas.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackSet.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_toSource.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/eq.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArguments.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArray.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArrayLike.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isBuffer.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isEqual.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isFunction.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isLength.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isTypedArray.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/keys.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/stubArray.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/stubFalse.js +1 -0
- package/dist/cjs/node_modules/.pnpm/pure-react-carousel@1.32.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/pure-react-carousel/dist/react-carousel.es.css +1 -0
- package/dist/cjs/styles.css +1 -1
- package/dist/cjs/translations/am.json.js +1 -0
- package/dist/cjs/utils/data.js +1 -1
- package/dist/esm/_virtual/_commonjsHelpers.js +8 -0
- package/dist/esm/_virtual/_nodeUtil.js +4 -0
- package/dist/esm/_virtual/isBuffer.js +4 -0
- package/dist/esm/_virtual/isEqual.js +7 -0
- package/dist/esm/embeddable/big-number-trend/index.js +36 -36
- package/dist/esm/embeddable/body/index.js +141 -95
- package/dist/esm/embeddable/chart/Bar.js +390 -382
- package/dist/esm/embeddable/chart/Line.js +101 -102
- package/dist/esm/embeddable/chart/colors/ColorProvider.js +42 -39
- package/dist/esm/embeddable/chart/colors/ManualColors.js +40 -29
- package/dist/esm/embeddable/chart/colors/SystemColors.js +28 -17
- package/dist/esm/embeddable/chart/data/Bar.js +112 -114
- package/dist/esm/embeddable/chart/data/Line.js +126 -126
- package/dist/esm/embeddable/chart/data/Utils.js +32 -26
- package/dist/esm/embeddable/d3Map/BaseLayer.js +3 -8
- package/dist/esm/embeddable/d3Map/DataLayer.js +2 -9
- package/dist/esm/embeddable/d3Map/FlowLayer.js +12 -15
- package/dist/esm/embeddable/data/DataContext.js +1 -0
- package/dist/esm/embeddable/featuredtabs/index.js +128 -124
- package/dist/esm/embeddable/filter/index.js +207 -206
- package/dist/esm/embeddable/filtered-posts/NoData.js +31 -0
- package/dist/esm/embeddable/filtered-posts/index.js +123 -0
- package/dist/esm/embeddable/index.js +34 -31
- package/dist/esm/embeddable/inlinelist/index.js +82 -70
- package/dist/esm/embeddable/map/MapDataFrame.js +17 -14
- package/dist/esm/embeddable/map/index.js +180 -169
- package/dist/esm/embeddable/map/map.js +520 -437
- package/dist/esm/embeddable/new-time-line/index.js +9 -8
- package/dist/esm/embeddable/new-time-line/timeline.js +3 -2
- package/dist/esm/embeddable/posts-filter/PostsFilterDropdown.js +190 -0
- package/dist/esm/embeddable/posts-filter/index.js +215 -0
- package/dist/esm/embeddable/posts-filters-reset-button/index.js +33 -0
- package/dist/esm/embeddable/posts-pagination/index.js +69 -0
- package/dist/esm/embeddable/postscarousel/index.js +12 -11
- package/dist/esm/embeddable/reducers/data-api.js +40 -25
- package/dist/esm/embeddable/reducers/data.js +180 -99
- package/dist/esm/embeddable/showcase/index.js +1 -1
- package/dist/esm/embeddable/time-line/desktop.js +3 -2
- package/dist/esm/embeddable/time-line/mobile.js +140 -162
- package/dist/esm/embeddable/vertical-featuredtabs/index.js +177 -168
- package/dist/esm/layout/ClassicHeader.js +62 -62
- package/dist/esm/layout/CustomSemanticSearch.js +40 -102
- package/dist/esm/layout/Header.js +152 -144
- package/dist/esm/layout/Layout.js +4 -3
- package/dist/esm/layout/SearchControl.js +130 -113
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_DataView.js +12 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Hash.js +22 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_ListCache.js +22 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Map.js +12 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js +22 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Promise.js +12 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Set.js +12 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_SetCache.js +18 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Stack.js +20 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js +11 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Uint8Array.js +11 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_WeakMap.js +12 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayFilter.js +16 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayLikeKeys.js +26 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayPush.js +14 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arraySome.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js +17 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetAllKeys.js +16 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +16 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsArguments.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsEqual.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsEqualDeep.js +38 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsNative.js +22 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsTypedArray.js +17 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseKeys.js +20 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTimes.js +14 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseUnary.js +14 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_cacheHas.js +12 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_coreJsData.js +11 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_equalArrays.js +46 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_equalByTag.js +51 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_equalObjects.js +42 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +11 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getAllKeys.js +16 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getMapData.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getNative.js +16 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js +21 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getSymbols.js +16 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getTag.js +33 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getValue.js +12 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashClear.js +14 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashDelete.js +13 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashGet.js +19 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashHas.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashSet.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isIndex.js +14 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isKeyable.js +13 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isMasked.js +17 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isPrototype.js +14 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheClear.js +12 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js +18 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheGet.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheHas.js +14 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheSet.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheClear.js +20 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheDelete.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheGet.js +14 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheHas.js +14 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheSet.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapToArray.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_nativeCreate.js +11 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_nativeKeys.js +11 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_nodeUtil.js +19 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js +13 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_overArg.js +14 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js +11 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_setCacheAdd.js +13 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_setCacheHas.js +12 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_setToArray.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackClear.js +14 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackDelete.js +13 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackGet.js +12 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackHas.js +12 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stackSet.js +23 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_toSource.js +23 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/eq.js +12 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArguments.js +16 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArray.js +10 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArrayLike.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isBuffer.js +14 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isEqual.js +14 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isFunction.js +18 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isLength.js +13 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js +13 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js +12 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isTypedArray.js +13 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/keys.js +16 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/stubArray.js +12 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/stubFalse.js +12 -0
- package/dist/esm/node_modules/.pnpm/pure-react-carousel@1.32.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/pure-react-carousel/dist/react-carousel.es.css +1 -0
- package/dist/esm/styles.css +1 -1
- package/dist/esm/translations/am.json.js +46 -0
- package/dist/esm/utils/data.js +4 -9
- package/dist/types/dvz-ui/src/countries.d.ts +7 -0
- package/dist/types/dvz-ui/src/embeddable/chart/colors/ManualColors.d.ts +1 -1
- package/dist/types/dvz-ui/src/embeddable/chart/colors/SystemColors.d.ts +1 -1
- package/dist/types/dvz-ui/src/embeddable/data/DataContext.d.ts +1 -0
- package/dist/types/dvz-ui/src/embeddable/featuredtabs/index.d.ts +1 -0
- package/dist/types/dvz-ui/src/embeddable/filtered-posts/NoData.d.ts +7 -0
- package/dist/types/dvz-ui/src/embeddable/filtered-posts/index.d.ts +21 -0
- package/dist/types/dvz-ui/src/embeddable/inlinelist/index.d.ts +2 -0
- package/dist/types/dvz-ui/src/embeddable/map/MapDataFrame.d.ts +1 -6
- package/dist/types/dvz-ui/src/embeddable/map/map.d.ts +1 -0
- package/dist/types/dvz-ui/src/embeddable/posts-filter/PostsFilterDropdown.d.ts +21 -0
- package/dist/types/dvz-ui/src/embeddable/posts-filter/index.d.ts +25 -0
- package/dist/types/dvz-ui/src/embeddable/posts-filters-reset-button/index.d.ts +3 -0
- package/dist/types/dvz-ui/src/embeddable/posts-pagination/index.d.ts +10 -0
- package/dist/types/dvz-ui/src/embeddable/reducers/data-api.d.ts +11 -0
- package/dist/types/dvz-ui/src/embeddable/reducers/post-reducer.d.ts +158 -0
- package/dist/types/dvz-ui/src/embeddable/vertical-featuredtabs/index.d.ts +1 -0
- package/dist/types/dvz-ui/src/layout/Header.d.ts +2 -2
- package/dist/types/dvz-ui/src/translations/am.json.d.ts +39 -0
- package/package.json +3 -3
- package/dist/cjs/embeddable/posts-with-filters/DropDownFilter.js +0 -1
- package/dist/cjs/embeddable/posts-with-filters/Post.js +0 -1
- package/dist/cjs/embeddable/posts-with-filters/index.js +0 -1
- package/dist/esm/embeddable/posts-with-filters/DropDownFilter.js +0 -25
- package/dist/esm/embeddable/posts-with-filters/Post.js +0 -51
- package/dist/esm/embeddable/posts-with-filters/index.js +0 -206
- package/dist/types/dvz-ui/src/embeddable/posts-with-filters/DropDownFilter.d.ts +0 -4
- package/dist/types/dvz-ui/src/embeddable/posts-with-filters/Post.d.ts +0 -5
- package/dist/types/dvz-ui/src/embeddable/posts-with-filters/index.d.ts +0 -21
- /package/dist/cjs/{utils/countries.js → countries.js} +0 -0
- /package/dist/cjs/embeddable/{posts-with-filters → filtered-posts}/utils.js +0 -0
- /package/dist/esm/{utils/countries.js → countries.js} +0 -0
- /package/dist/esm/embeddable/{posts-with-filters → filtered-posts}/utils.js +0 -0
- /package/dist/types/dvz-ui/src/embeddable/{posts-with-filters → filtered-posts}/utils.d.ts +0 -0
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { jsx as b, jsxs as
|
|
5
|
-
import { injectIntl as
|
|
6
|
-
import * as
|
|
7
|
-
import { Container as
|
|
8
|
-
import
|
|
9
|
-
import * as
|
|
10
|
-
import
|
|
1
|
+
var X = Object.defineProperty;
|
|
2
|
+
var Y = (w, F, e) => F in w ? X(w, F, { enumerable: !0, configurable: !0, writable: !0, value: e }) : w[F] = e;
|
|
3
|
+
var H = (w, F, e) => Y(w, typeof F != "symbol" ? F + "" : F, e);
|
|
4
|
+
import { jsx as b, jsxs as M, Fragment as R } from "react/jsx-runtime";
|
|
5
|
+
import { injectIntl as q, FormattedMessage as K } from "react-intl";
|
|
6
|
+
import * as g from "d3";
|
|
7
|
+
import { Container as U, Segment as Q, Dimmer as ee, Loader as te, Message as N, Icon as E, Popup as se, Grid as S } from "semantic-ui-react";
|
|
8
|
+
import V from "react";
|
|
9
|
+
import * as ie from "topojson-client";
|
|
10
|
+
import oe from "./legend.js";
|
|
11
11
|
import { formatContent as k } from "../common/MapTooltip.js";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
12
|
+
import T from "../../utils/deviceType.js";
|
|
13
|
+
import ae from "geostats";
|
|
14
14
|
import { Config as re } from "../../conf/index.js";
|
|
15
|
-
|
|
15
|
+
function O(w, F, e) {
|
|
16
|
+
var l;
|
|
17
|
+
if (!(w != null && w.length)) return F;
|
|
18
|
+
const s = ((l = w[0]) == null ? void 0 : l.items) ?? [], i = (a) => (a == null ? void 0 : a.trim().toLowerCase()) ?? "", o = i(F), t = i(e).toUpperCase(), r = s.find(
|
|
19
|
+
(a) => i(a.value) === o || a.code.trim().toLowerCase() === o
|
|
20
|
+
) ?? null;
|
|
21
|
+
if (!r) return F;
|
|
22
|
+
const n = t && r.labels && r.labels[t] ? r.labels[t] : r.value;
|
|
23
|
+
return (n == null ? void 0 : n.trim()) || r.value.trim();
|
|
24
|
+
}
|
|
25
|
+
const le = "_Color_", G = "location", j = "showAll", B = "ifUnitHasData", ne = 10, pe = {
|
|
16
26
|
mobile: 4,
|
|
17
27
|
tablet: 4,
|
|
18
28
|
midTablet: 2,
|
|
@@ -26,14 +36,14 @@ const ae = "_Color_", U = "location", S = "showAll", j = "ifUnitHasData", le = 1
|
|
|
26
36
|
laptop: 200,
|
|
27
37
|
desktop: 100,
|
|
28
38
|
wide: 100
|
|
29
|
-
},
|
|
39
|
+
}, Z = {
|
|
30
40
|
mobile: 250,
|
|
31
41
|
tablet: 250,
|
|
32
42
|
midTablet: 250,
|
|
33
43
|
laptop: 0,
|
|
34
44
|
desktop: 0,
|
|
35
45
|
wide: 0
|
|
36
|
-
},
|
|
46
|
+
}, he = {
|
|
37
47
|
greens: [
|
|
38
48
|
"#ccffdd",
|
|
39
49
|
"#b3ffcc",
|
|
@@ -106,102 +116,144 @@ const ae = "_Color_", U = "location", S = "showAll", j = "ifUnitHasData", le = 1
|
|
|
106
116
|
"#1a66ff",
|
|
107
117
|
"#0055ff"
|
|
108
118
|
]
|
|
109
|
-
},
|
|
110
|
-
|
|
119
|
+
}, de = ["mobile", "tablet", "midTablet"].includes(
|
|
120
|
+
T()
|
|
121
|
+
), $ = ["mobile", "tablet"].includes(T());
|
|
122
|
+
class ue extends V.Component {
|
|
111
123
|
constructor(e) {
|
|
124
|
+
var s;
|
|
112
125
|
super(e);
|
|
113
|
-
|
|
126
|
+
H(this, "handleScroll", () => {
|
|
114
127
|
let e = null;
|
|
115
128
|
clearTimeout(e), e = setTimeout(() => {
|
|
116
|
-
|
|
129
|
+
g.select(this.getMapId()).selectAll(".map-labels-container").size() > 0 || this.updateFeatures(this.getFeatures(), !1);
|
|
117
130
|
}, 300);
|
|
118
131
|
});
|
|
119
|
-
this.mapContainer =
|
|
132
|
+
this.mapContainer = V.createRef(), this.state = { mainLayer: null, layers: null }, this.classColor = this.classColor.bind(this), this.featuresZoom = this.featuresZoom.bind(this), this.fullView = this.fullView.bind(this), this.onZoomIn = this.onZoomIn.bind(this), this.onZoomOut = this.onZoomOut.bind(this), this.onReset = this.onReset.bind(this), this.onClick = this.onClick.bind(this), this.showTooltip = this.showTooltip.bind(this), this.mousemove = this.mousemove.bind(this), this.mouseout = this.mouseout.bind(this), this.updateFeatures = this.updateFeatures.bind(this), this.d3Map = this.d3Map.bind(this), this.getFeatures = this.getFeatures.bind(this), this.boundingExtent = this.boundingExtent.bind(this), this.getMapId = this.getMapId.bind(this), this.zoomed = this.zoomed.bind(this), this.zoomEnd = this.zoomEnd.bind(this), this.drawPoints = this.drawPoints.bind(this), this.extractFeatures = this.extractFeatures.bind(this), this.getLayers = this.getLayers.bind(this), this.onPointClick = this.onPointClick.bind(this), this.onPolygonClick = this.onPolygonClick.bind(this), this.getCenter = this.getCenter.bind(this), this.mapPosition = null, this.zooming = !1, this.translateValue = pe[T()], this.projection = g.geoMercator().scale(e.scale).center(e.center).translate([this.getWidth() / this.translateValue, this.getHeight() / 2]), this.path = g.geoPath().projection(this.projection), this.zoom = g.zoom().scaleExtent([1, 16]).on("zoom", this.zoomed).on("end", this.zoomEnd), this.centered = null, this.state = {
|
|
120
133
|
selectedMeasure: e.transformedData && e.transformedData.measures && e.transformedData.measures.length > 1 ? e.transformedData.measures[0] : null,
|
|
121
134
|
generatedBreaks: [],
|
|
122
135
|
selectedPolygon: null,
|
|
123
136
|
layersLoading: !1
|
|
124
|
-
};
|
|
137
|
+
}, this.metadataTypes = ((s = e.transformedData) == null ? void 0 : s.types) || [];
|
|
125
138
|
}
|
|
126
139
|
componentDidMount() {
|
|
127
|
-
window.addEventListener("scroll", this.handleScroll, { passive: !0 }), window.addEventListener("touchmove", this.handleScroll, { passive: !0 }), this.loadLayers(), this.tooltip =
|
|
140
|
+
window.addEventListener("scroll", this.handleScroll, { passive: !0 }), window.addEventListener("touchmove", this.handleScroll, { passive: !0 }), this.loadLayers(), this.tooltip = g.select("body").append("div").style("position", "absolute").style("visibility", "hidden"), console.log("Map props", this.metadataTypes);
|
|
128
141
|
}
|
|
129
|
-
componentDidCatch(e,
|
|
142
|
+
componentDidCatch(e, s) {
|
|
130
143
|
console.log(e);
|
|
131
144
|
}
|
|
132
145
|
componentWillUnmount() {
|
|
133
146
|
window.removeEventListener("scroll", this.handleScroll);
|
|
134
147
|
}
|
|
135
148
|
loadLayers() {
|
|
136
|
-
const { source: e, mainLayerId:
|
|
149
|
+
const { source: e, mainLayerId: s, enabledLayers: i } = this.props;
|
|
137
150
|
if (this.setState({
|
|
138
151
|
layers: [],
|
|
139
152
|
layersLoading: !0
|
|
140
153
|
}), i && i.length > 0) {
|
|
141
154
|
const o = [];
|
|
142
|
-
i.forEach((
|
|
155
|
+
i.forEach((t) => {
|
|
143
156
|
o.push(
|
|
144
|
-
new Promise((
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
157
|
+
new Promise((r, n) => {
|
|
158
|
+
g.json(re.REACT_APP_WP_API + "/wp/v2/media/" + t.id).then((l) => {
|
|
159
|
+
r({
|
|
160
|
+
id: t.id,
|
|
161
|
+
url: l.source_url,
|
|
162
|
+
index: t.index,
|
|
163
|
+
layerMappingField: t.layerMappingField,
|
|
164
|
+
layerDatasource: t.datasource,
|
|
165
|
+
layerApiField: t.apiField,
|
|
166
|
+
layerLocale: t.locale,
|
|
167
|
+
displayLayerLabels: t.displayLayerLabels
|
|
168
|
+
});
|
|
169
|
+
}).catch(function(l) {
|
|
170
|
+
r({
|
|
171
|
+
id: t.id,
|
|
172
|
+
url: null,
|
|
173
|
+
index: t.index,
|
|
174
|
+
layerMappingField: t.layerMappingField,
|
|
175
|
+
layerDatasource: t.datasource,
|
|
176
|
+
layerApiField: t.apiField,
|
|
177
|
+
layerLocale: t.locale,
|
|
178
|
+
displayLayerLabels: t.displayLayerLabels
|
|
179
|
+
});
|
|
149
180
|
});
|
|
150
181
|
})
|
|
151
182
|
);
|
|
152
|
-
}), Promise.all(o).then((
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
new Promise((
|
|
157
|
-
|
|
158
|
-
|
|
183
|
+
}), Promise.all(o).then((t) => {
|
|
184
|
+
const r = [];
|
|
185
|
+
t.forEach((n) => {
|
|
186
|
+
n.url && r.push(
|
|
187
|
+
new Promise((l, a) => {
|
|
188
|
+
g.json(n.url).then((h) => {
|
|
189
|
+
l({
|
|
190
|
+
id: n.id,
|
|
191
|
+
data: h,
|
|
192
|
+
index: n.index,
|
|
193
|
+
layerMappingField: n.layerMappingField,
|
|
194
|
+
layerDatasource: n.layerDatasource,
|
|
195
|
+
layerApiField: n.layerApiField,
|
|
196
|
+
layerLocale: n.layerLocale,
|
|
197
|
+
displayLayerLabels: n.displayLayerLabels
|
|
198
|
+
});
|
|
159
199
|
});
|
|
160
200
|
})
|
|
161
201
|
);
|
|
162
|
-
}), Promise.all(
|
|
202
|
+
}), Promise.all(r).then((n) => {
|
|
163
203
|
this.setState({
|
|
164
|
-
layers:
|
|
204
|
+
layers: n,
|
|
165
205
|
layersLoading: !1
|
|
166
206
|
});
|
|
167
207
|
});
|
|
168
208
|
});
|
|
169
209
|
} else
|
|
170
|
-
|
|
210
|
+
g.json(e).then((o) => {
|
|
171
211
|
this.setState({
|
|
172
|
-
layers: [
|
|
212
|
+
layers: [
|
|
213
|
+
{
|
|
214
|
+
id: null,
|
|
215
|
+
url: e,
|
|
216
|
+
data: o,
|
|
217
|
+
index: 0,
|
|
218
|
+
layerMappingField: null,
|
|
219
|
+
layerDatasource: null,
|
|
220
|
+
layerApiField: null,
|
|
221
|
+
layerLocale: null,
|
|
222
|
+
displayLayerLabels: !1
|
|
223
|
+
}
|
|
224
|
+
],
|
|
173
225
|
layersLoading: !1
|
|
174
226
|
});
|
|
175
227
|
});
|
|
176
228
|
}
|
|
177
229
|
getMainLayer() {
|
|
178
|
-
const e = this.getLayers(), { mainLayerId:
|
|
230
|
+
const e = this.getLayers(), { mainLayerId: s, enabledLayers: i } = this.props;
|
|
179
231
|
let o;
|
|
180
232
|
return e && (o = e.filter(
|
|
181
|
-
(
|
|
233
|
+
(t) => t.id == s || t.id == null
|
|
182
234
|
)[0] || e[0]), o ? o.data : null;
|
|
183
235
|
}
|
|
184
|
-
componentDidUpdate(e,
|
|
185
|
-
const { selectedMeasure: o, layers:
|
|
236
|
+
componentDidUpdate(e, s, i) {
|
|
237
|
+
const { selectedMeasure: o, layers: t, selectedPolygon: r } = this.state, n = this.getMainLayer(), { transformedData: l, intl: a, zoomOnFilterField: h, appliedFilters: p } = this.props, { appliedFilters: d } = e;
|
|
186
238
|
if (h) {
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
...
|
|
191
|
-
(
|
|
239
|
+
const v = [], c = [];
|
|
240
|
+
d && Object.keys(d).forEach((f) => {
|
|
241
|
+
d[f] != null && d[f] instanceof Array && v.push(
|
|
242
|
+
...d[f].filter(
|
|
243
|
+
(y) => y != Number.MIN_SAFE_INTEGER
|
|
192
244
|
)
|
|
193
245
|
);
|
|
194
|
-
}),
|
|
195
|
-
|
|
196
|
-
...
|
|
246
|
+
}), p && Object.keys(p).forEach((f) => {
|
|
247
|
+
p[f] != null && p[f] instanceof Array && c.push(
|
|
248
|
+
...p[f].filter((y) => y != Number.MIN_SAFE_INTEGER)
|
|
197
249
|
);
|
|
198
|
-
}),
|
|
250
|
+
}), v.length > 0 && c.length == 0 && this.onReset();
|
|
199
251
|
}
|
|
200
252
|
this.tooltip.style("visibility", "hidden"), e.enabledLayers.length != this.props.enabledLayers.length && this.loadLayers();
|
|
201
|
-
const
|
|
253
|
+
const u = this.getFeatures();
|
|
202
254
|
e.center !== this.props.center && (this.mapPosition = null, this.projection.scale(this.props.scale).center(this.props.center).translate([this.getWidth() / 2, this.getHeight() / 2]));
|
|
203
|
-
const
|
|
204
|
-
this.d3Map(
|
|
255
|
+
const m = this.filterUpdated(e, s);
|
|
256
|
+
this.d3Map(u, m), t && l && (l != e.transformedData || t != s.layers || o != s.selectedMeasure || r != s.selectedPolygon || n != s.mainLayer || e.mainLayerId !== this.props.mainLayerId || JSON.stringify(e.enabledLayers) != JSON.stringify(this.props.enabledLayers)) && this.updateFeatures(this.getFeatures(), m);
|
|
205
257
|
}
|
|
206
258
|
getHeight() {
|
|
207
259
|
return this.props.height;
|
|
@@ -210,99 +262,99 @@ class de extends H.Component {
|
|
|
210
262
|
return this.mapContainer.current ? this.mapContainer.current.offsetWidth : this.props.width;
|
|
211
263
|
}
|
|
212
264
|
boundingExtent(e) {
|
|
213
|
-
let
|
|
214
|
-
for (const
|
|
215
|
-
const [[
|
|
216
|
-
(
|
|
265
|
+
let s, i, o, t;
|
|
266
|
+
for (const r in e) {
|
|
267
|
+
const [[n, l], [a, h]] = this.path.bounds(e[r]);
|
|
268
|
+
(n < s || s == null) && (s = n), (a > i || i == null) && (i = a), (l < o || o == null) && (o = l), (h > t || t == null) && (t = h);
|
|
217
269
|
}
|
|
218
270
|
return [
|
|
219
|
-
[
|
|
220
|
-
[i,
|
|
271
|
+
[s, o],
|
|
272
|
+
[i, t]
|
|
221
273
|
];
|
|
222
274
|
}
|
|
223
275
|
onReset() {
|
|
224
276
|
this.mapPosition = null, this.tooltip.style("visibility", "hidden"), this.fullView();
|
|
225
277
|
}
|
|
226
278
|
resizeLabels(e) {
|
|
227
|
-
const { labelFontSize:
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
const
|
|
232
|
-
|
|
279
|
+
const { labelFontSize: s, mapLabelField: i } = this.props;
|
|
280
|
+
g.select(this.getMapId()).selectAll(".map-labels-container").each((o, t, r) => {
|
|
281
|
+
const n = g.select(r[t]), l = n.select("div"), a = e.k > 1 ? e.k : 1, h = s / a;
|
|
282
|
+
l.style("font-size", `${h}px`);
|
|
283
|
+
const p = this.getLabelPosition(o), d = this.getLabelBoxWidth(o) / a, u = p[0] - d / 2, m = e.k > 1 ? 10 / e.k : 10, v = p[1] - m;
|
|
284
|
+
n.attr("x", u).attr("y", v).attr("width", this.getLabelBoxWidth(o) / a).attr("height", this.getLabelBoxHeight(o) / a);
|
|
233
285
|
});
|
|
234
286
|
}
|
|
235
287
|
resizePointLabels(e) {
|
|
236
|
-
const { labelFontSize:
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
|
|
288
|
+
const { labelFontSize: s } = this.props;
|
|
289
|
+
g.select(this.getMapId()).selectAll(".point-labels-container").each((i, o, t) => {
|
|
290
|
+
const r = g.select(t[o]), n = r.select("div"), l = e.k > 1 ? e.k : 1, a = s / l;
|
|
291
|
+
n.style("font-size", `${a}px`);
|
|
240
292
|
const h = this.projection([
|
|
241
293
|
i.geometry.coordinates[1],
|
|
242
294
|
i.geometry.coordinates[0]
|
|
243
|
-
]),
|
|
244
|
-
|
|
295
|
+
]), p = (this.getLabelBoxWidth(i) + 20) / l, d = this.getLabelBoxHeight(i) / l, u = h[0] - p / 2, m = h[1] - d / 2;
|
|
296
|
+
r.attr("x", u).attr("y", m).attr("width", p).attr("height", d);
|
|
245
297
|
});
|
|
246
298
|
}
|
|
247
299
|
resizeCircles(e) {
|
|
248
|
-
|
|
300
|
+
g.select(this.getMapId()).select("svg").selectAll("circle").attr("r", e.k > 1 ? 6 / e.k : 6);
|
|
249
301
|
}
|
|
250
302
|
zoomed(e) {
|
|
251
303
|
this.tooltip.style("visibility", "hidden");
|
|
252
|
-
const
|
|
253
|
-
|
|
304
|
+
const s = e.transform;
|
|
305
|
+
g.select(this.getMapId()).select("svg").select("g").attr("transform", s), this.resizeCircles(s), this.resizeLabels(s), this.resizePointLabels(s);
|
|
254
306
|
}
|
|
255
307
|
zoomEnd(e) {
|
|
256
|
-
const { editing:
|
|
257
|
-
this.mapPosition = { k: i.k, x: i.x, y: i.y },
|
|
308
|
+
const { editing: s } = this.props, i = e.transform;
|
|
309
|
+
this.mapPosition = { k: i.k, x: i.x, y: i.y }, s && window.parent.postMessage(
|
|
258
310
|
{ type: "map", value: JSON.stringify(this.mapPosition) },
|
|
259
311
|
"*"
|
|
260
312
|
);
|
|
261
313
|
}
|
|
262
314
|
classColor(e) {
|
|
263
|
-
let { zoomEnabled:
|
|
264
|
-
return
|
|
265
|
-
|
|
266
|
-
)),
|
|
315
|
+
let { zoomEnabled: s } = this.props;
|
|
316
|
+
return s || (s = !!["mobile", "tablet", "midTablet"].includes(
|
|
317
|
+
T()
|
|
318
|
+
)), s ? "active zoom-enabled" : "active";
|
|
267
319
|
}
|
|
268
320
|
generateBreaks(e) {
|
|
269
|
-
const { autoGenerateBreaks:
|
|
270
|
-
if (
|
|
271
|
-
const
|
|
272
|
-
|
|
321
|
+
const { autoGenerateBreaks: s, numberOfBreaks: i, colorScheme: o } = this.props, t = [];
|
|
322
|
+
if (s && e && e.length > 0) {
|
|
323
|
+
const r = e.filter((a) => a.properties && a.properties.value != null).map((a) => a.properties.value.toFixed(2)), n = [];
|
|
324
|
+
r.forEach((a) => {
|
|
273
325
|
if (a > 0) {
|
|
274
|
-
const h = a * 0.99,
|
|
275
|
-
|
|
326
|
+
const h = a * 0.99, p = a * 1.01;
|
|
327
|
+
n.indexOf(h) === -1 && n.push(h), n.indexOf(p) === -1 && n.push(p);
|
|
276
328
|
}
|
|
277
329
|
});
|
|
278
|
-
const
|
|
279
|
-
if (
|
|
280
|
-
const a = new
|
|
330
|
+
const l = he[o];
|
|
331
|
+
if (n.length > 0) {
|
|
332
|
+
const a = new ae(n);
|
|
281
333
|
a.setPrecision(2);
|
|
282
|
-
const h =
|
|
283
|
-
return a.getJenks(Math.min(i, h)), a.ranges.forEach((
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
),
|
|
288
|
-
}),
|
|
334
|
+
const h = n.length > 1 ? n.length - 1 : n.length;
|
|
335
|
+
return a.getJenks(Math.min(i, h)), a.ranges.forEach((p, d) => {
|
|
336
|
+
const u = {};
|
|
337
|
+
u.min = parseFloat(p.substr(0, p.indexOf("-") - 1)) + (d > 0 ? 0.01 : 0), u.max = parseFloat(
|
|
338
|
+
p.substr(p.indexOf("-") + 2, p.length)
|
|
339
|
+
), u.color = l[d], t.push(u);
|
|
340
|
+
}), t;
|
|
289
341
|
}
|
|
290
342
|
}
|
|
291
|
-
return
|
|
343
|
+
return t;
|
|
292
344
|
}
|
|
293
345
|
getBreaks() {
|
|
294
|
-
const { legendBreaks: e, autoGenerateBreaks:
|
|
295
|
-
if (
|
|
346
|
+
const { legendBreaks: e, autoGenerateBreaks: s } = this.props;
|
|
347
|
+
if (s) {
|
|
296
348
|
const i = this.getFeatures();
|
|
297
349
|
return this.generateBreaks(i);
|
|
298
350
|
} else {
|
|
299
351
|
let i = e;
|
|
300
352
|
return this.getSelectedMeasure() && (i = e.filter((o) => o.measure === this.getSelectedMeasure()).filter((o) => {
|
|
301
353
|
if (o.filters && o.filters.length > 0 && this.props.appliedFilters && JSON.stringify(this.props.appliedFilters) !== "{}") {
|
|
302
|
-
const
|
|
303
|
-
return o.filters.filter((
|
|
304
|
-
if (
|
|
305
|
-
const a = this.props.appliedFilters[
|
|
354
|
+
const r = Object.keys(this.props.appliedFilters);
|
|
355
|
+
return o.filters.filter((l) => {
|
|
356
|
+
if (r.indexOf(l.field) != -1) {
|
|
357
|
+
const a = this.props.appliedFilters[l.field], h = l.values;
|
|
306
358
|
return a.join(",").indexOf(h) != -1;
|
|
307
359
|
}
|
|
308
360
|
return !1;
|
|
@@ -312,33 +364,33 @@ class de extends H.Component {
|
|
|
312
364
|
})), i;
|
|
313
365
|
}
|
|
314
366
|
}
|
|
315
|
-
fillColor(e,
|
|
367
|
+
fillColor(e, s) {
|
|
316
368
|
const { mapNoDataColor: i, mainLayerId: o } = this.props;
|
|
317
|
-
let
|
|
369
|
+
let t;
|
|
318
370
|
if (e.properties && e.properties.variables && this.state.selectedMeasure && e.properties.value != null) {
|
|
319
|
-
const
|
|
320
|
-
if (
|
|
321
|
-
return
|
|
371
|
+
const n = le + this.state.selectedMeasure;
|
|
372
|
+
if (t = e.properties.variables[n.trim()], t)
|
|
373
|
+
return t;
|
|
322
374
|
}
|
|
323
375
|
if (e.properties.value != null && (o && e.properties.layerId === o || !o)) {
|
|
324
|
-
const
|
|
325
|
-
if (
|
|
326
|
-
return e.properties.value >=
|
|
327
|
-
if (
|
|
328
|
-
return e.properties.value >=
|
|
329
|
-
if (
|
|
330
|
-
return e.properties.value <=
|
|
376
|
+
const n = s.find((l) => {
|
|
377
|
+
if (l.min != null && l.max != null)
|
|
378
|
+
return e.properties.value >= l.min && e.properties.value <= l.max;
|
|
379
|
+
if (l.min != null)
|
|
380
|
+
return e.properties.value >= l.min;
|
|
381
|
+
if (l.max != null)
|
|
382
|
+
return e.properties.value <= l.max;
|
|
331
383
|
});
|
|
332
|
-
return
|
|
384
|
+
return n && n.color ? n.color : i;
|
|
333
385
|
}
|
|
334
|
-
const
|
|
335
|
-
(
|
|
386
|
+
const r = this.props.enabledLayers.filter(
|
|
387
|
+
(n) => n.id === e.properties.layerId
|
|
336
388
|
)[0];
|
|
337
|
-
return
|
|
389
|
+
return r && r.bgColor && r.bgColor != "undefined" ? r.bgColor : i;
|
|
338
390
|
}
|
|
339
391
|
setValues() {
|
|
340
392
|
const e = this.getFeatures();
|
|
341
|
-
|
|
393
|
+
g.select(this.getMapId()).select("svg").select("g").selectAll("path").data(e).join("path").attr("d", this.path);
|
|
342
394
|
}
|
|
343
395
|
getLabelPosition(e) {
|
|
344
396
|
return e.properties.LABEL_LATITUDE && e.properties.LABEL_LONGITUDE ? this.projection([
|
|
@@ -346,158 +398,166 @@ class de extends H.Component {
|
|
|
346
398
|
e.properties.LABEL_LATITUDE
|
|
347
399
|
]) : this.path.centroid(e);
|
|
348
400
|
}
|
|
349
|
-
updateFeatures(e,
|
|
350
|
-
const { mapLabelField: i, symbols: o, highlightedLocation:
|
|
351
|
-
...e.filter((
|
|
352
|
-
...e.filter((
|
|
401
|
+
updateFeatures(e, s) {
|
|
402
|
+
const { mapLabelField: i, symbols: o, highlightedLocation: t } = this.props, r = [
|
|
403
|
+
...e.filter((n) => t != n.properties[i]),
|
|
404
|
+
...e.filter((n) => t == n.properties[i])
|
|
353
405
|
];
|
|
354
|
-
this.drawPolygons(
|
|
406
|
+
this.drawPolygons(r), this.drawLabels(r), this.drawPoints(r, s), o.length > 0 && this.addSymbols(o, r);
|
|
355
407
|
}
|
|
356
408
|
drawLabels(e) {
|
|
357
409
|
const {
|
|
358
|
-
mapLabelField:
|
|
410
|
+
mapLabelField: s,
|
|
359
411
|
mapLabelShowValue: i,
|
|
360
412
|
intl: o,
|
|
361
|
-
valueFormat:
|
|
362
|
-
showNoDataLabel:
|
|
363
|
-
labelFontColor:
|
|
364
|
-
labelFontWeight:
|
|
413
|
+
valueFormat: t,
|
|
414
|
+
showNoDataLabel: r,
|
|
415
|
+
labelFontColor: n,
|
|
416
|
+
labelFontWeight: l,
|
|
365
417
|
labelFontSize: a,
|
|
366
418
|
showAdminUnitLabel: h,
|
|
367
|
-
mapType:
|
|
368
|
-
noDataText:
|
|
369
|
-
labelsExclusionList:
|
|
370
|
-
} = this.props,
|
|
371
|
-
if (
|
|
419
|
+
mapType: p,
|
|
420
|
+
noDataText: d,
|
|
421
|
+
labelsExclusionList: u
|
|
422
|
+
} = this.props, m = g.select(this.getMapId()).select("svg").select("g");
|
|
423
|
+
if (m.selectAll(".map-labels-container").size() > 0) {
|
|
372
424
|
console.log("Labels already exist, skipping redraw...");
|
|
373
425
|
return;
|
|
374
426
|
}
|
|
375
|
-
|
|
376
|
-
e.filter((
|
|
377
|
-
).enter().append("foreignObject").attr("class", "map-labels-container").attr("x", (
|
|
378
|
-
const
|
|
379
|
-
if (
|
|
380
|
-
const
|
|
381
|
-
return
|
|
427
|
+
m.selectAll(".map-labels").data(
|
|
428
|
+
e.filter((c) => u && u.length > 0 ? !u.includes(c.properties[s]) : !0)
|
|
429
|
+
).enter().append("foreignObject").attr("class", "map-labels-container").attr("x", (c) => {
|
|
430
|
+
const f = this.getLabelPosition(c);
|
|
431
|
+
if (c.properties[s]) {
|
|
432
|
+
const y = this.getLabelBoxWidth(c);
|
|
433
|
+
return f[0] - y / 2;
|
|
382
434
|
}
|
|
383
|
-
return
|
|
384
|
-
}).attr("y", (
|
|
435
|
+
return f[0];
|
|
436
|
+
}).attr("y", (c) => this.getLabelPosition(c)[1] - 10).attr("width", (c) => this.getLabelBoxWidth(c)).attr("height", (c) => this.getLabelBoxHeight(c)).attr("font-size", (c, f) => `${a}px`).attr("overflow", "visible").attr("opacity", 1).style("display", (c) => h === j || h === B && c.properties.hasDataRow || c.properties.displayLayerLabels ? "block" : "none").attr("pointer-events", p == "POINTS_MAP" ? "none" : "all").on("mouseover", this.showTooltip).on("mousemove", this.mousemove).on("mouseout", this.mouseout).append("xhtml:div").style("font-size", (c) => `${a}px`).style("color", (c, f) => n).style("font-weight", (c) => l).style("background-color", (c) => c.properties.hasDataRow && i && (c.properties.value != null || c.properties.value == null && r) ? "#fff6e1" : "none").style("border-radius", (c) => "4px").style("line-height", "95%").style("text-align", "center").html((c, f) => this.createLabel(c));
|
|
437
|
+
}
|
|
438
|
+
getTranslatedLocationName(e, s, i) {
|
|
439
|
+
if (e.properties.displayLayerLabels && e.properties.layerLocale) {
|
|
440
|
+
const o = e.properties.layerMappingField || s, t = e.properties[o];
|
|
441
|
+
return O(this.metadataTypes, t, e.properties.layerLocale);
|
|
442
|
+
}
|
|
443
|
+
return e.properties[s];
|
|
385
444
|
}
|
|
386
445
|
createLabel(e) {
|
|
387
446
|
const {
|
|
388
|
-
mapLabelField:
|
|
447
|
+
mapLabelField: s,
|
|
389
448
|
mapLabelShowValue: i,
|
|
390
449
|
intl: o,
|
|
391
|
-
valueFormat:
|
|
392
|
-
showNoDataLabel:
|
|
393
|
-
showAdminUnitLabel:
|
|
394
|
-
noDataText:
|
|
450
|
+
valueFormat: t,
|
|
451
|
+
showNoDataLabel: r,
|
|
452
|
+
showAdminUnitLabel: n,
|
|
453
|
+
noDataText: l
|
|
395
454
|
} = this.props;
|
|
396
455
|
let a = "";
|
|
397
|
-
if (
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
456
|
+
if (n == j || n == B && e.properties.hasDataRow || e.properties.displayLayerLabels) {
|
|
457
|
+
const h = e.properties.displayLayerLabels && e.properties.layerMappingField ? e.properties.layerMappingField : s, p = e.properties[h], d = e.properties.layerLocale || (o == null ? void 0 : o.locale);
|
|
458
|
+
a = O(this.metadataTypes, p, d);
|
|
459
|
+
const u = e.properties.abbrev;
|
|
460
|
+
if (a && a.length > ne && u && (a = u), i)
|
|
401
461
|
if (e.properties.value != null) {
|
|
402
|
-
const
|
|
462
|
+
const m = e.properties.variables || {};
|
|
403
463
|
a += "<br><span class='map-label-value'>" + k(
|
|
404
|
-
|
|
464
|
+
t,
|
|
405
465
|
{
|
|
406
466
|
value: e.properties.value,
|
|
407
467
|
measure: this.getSelectedMeasure(),
|
|
408
|
-
...
|
|
468
|
+
...m
|
|
409
469
|
},
|
|
410
470
|
o
|
|
411
471
|
) + "</span>";
|
|
412
472
|
} else
|
|
413
|
-
|
|
473
|
+
r == !0 && e.properties.value == null && e.properties.hasDataRow && (a += "<br><span class='map-label-value'>" + l + "</span>");
|
|
414
474
|
}
|
|
415
475
|
return a;
|
|
416
476
|
}
|
|
417
477
|
drawPolygons(e) {
|
|
418
478
|
const {
|
|
419
|
-
mapLabelField:
|
|
479
|
+
mapLabelField: s,
|
|
420
480
|
mapBoundaryColor: i,
|
|
421
481
|
mapFocusBoundaryColor: o,
|
|
422
|
-
highlightedLocation:
|
|
423
|
-
} = this.props,
|
|
482
|
+
highlightedLocation: t
|
|
483
|
+
} = this.props, r = this.getBreaks(), n = g.select(this.getMapId()).select("svg").select("g"), l = e.filter(
|
|
424
484
|
(a) => a.geometry && a.geometry && (a.geometry.type == "Polygon" || a.geometry.type == "MultiPolygon")
|
|
425
485
|
);
|
|
426
|
-
|
|
486
|
+
l.length > 0 && n.selectAll("path").data(l).join("path").attr("d", this.path).attr("fill", (a) => this.fillColor(a, r)).attr("stroke-width", (a) => t == a.properties[s] ? 1.2 : 0.4).attr("stroke", (a) => t == a.properties[s] ? o : i).on("click", this.onPolygonClick);
|
|
427
487
|
}
|
|
428
|
-
drawPoints(e,
|
|
488
|
+
drawPoints(e, s) {
|
|
429
489
|
const {
|
|
430
490
|
intl: i,
|
|
431
491
|
pointLabelColor: o,
|
|
432
|
-
pointLabelFormat:
|
|
433
|
-
transformedData:
|
|
434
|
-
defaultPointColor:
|
|
435
|
-
appliedFilters:
|
|
492
|
+
pointLabelFormat: t,
|
|
493
|
+
transformedData: r,
|
|
494
|
+
defaultPointColor: n,
|
|
495
|
+
appliedFilters: l,
|
|
436
496
|
zoomOnFilterField: a,
|
|
437
497
|
noDataText: h,
|
|
438
|
-
showShadingLayerLabels:
|
|
439
|
-
} = this.props,
|
|
440
|
-
let
|
|
441
|
-
if (
|
|
442
|
-
let
|
|
443
|
-
|
|
498
|
+
showShadingLayerLabels: p
|
|
499
|
+
} = this.props, d = g.select(this.getMapId()).select("svg").select("g");
|
|
500
|
+
let u = [];
|
|
501
|
+
if (r.pointsData) {
|
|
502
|
+
let c = this.state.selectedPolygon;
|
|
503
|
+
s && l && l[a] && (c = l[a]), u = r.pointsData.filter((f) => f.lat && f.lng && f.label == c).map((f) => ({
|
|
444
504
|
properties: {
|
|
445
|
-
label:
|
|
446
|
-
lat:
|
|
447
|
-
lng:
|
|
448
|
-
value:
|
|
449
|
-
variables:
|
|
505
|
+
label: f.label,
|
|
506
|
+
lat: f.lat,
|
|
507
|
+
lng: f.lng,
|
|
508
|
+
value: f.value,
|
|
509
|
+
variables: f.variables
|
|
450
510
|
}
|
|
451
|
-
})),
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
])[0]).attr("cy", (
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
])[1]).attr("r", (
|
|
511
|
+
})), d.selectAll(".circle").data(u).enter().append("circle").attr("id", (f, y) => "circle" + y).attr("cx", (f) => this.projection([
|
|
512
|
+
f.properties.lng,
|
|
513
|
+
f.properties.lat
|
|
514
|
+
])[0]).attr("cy", (f) => this.projection([
|
|
515
|
+
f.properties.lng,
|
|
516
|
+
f.properties.lat
|
|
517
|
+
])[1]).attr("r", (f, y) => 2).style("stroke-width", 0.5).style("fill", (f, y) => n).on("mouseover", (f, y) => this.onPointClick(f, y)).on("mouseout", this.mouseout);
|
|
458
518
|
}
|
|
459
|
-
const
|
|
460
|
-
let
|
|
461
|
-
|
|
462
|
-
(
|
|
463
|
-
) :
|
|
464
|
-
(
|
|
465
|
-
)),
|
|
466
|
-
const
|
|
519
|
+
const m = this.getBreaks();
|
|
520
|
+
let v = [];
|
|
521
|
+
p == j ? v = e.filter(
|
|
522
|
+
(c) => c.geometry && c.geometry.type == "Point"
|
|
523
|
+
) : p == B && (v = e.filter(
|
|
524
|
+
(c) => c.geometry && c.geometry.type == "Point" && c.properties.hasDataRow
|
|
525
|
+
)), v.length > 0 && d.selectAll(".point-labels").data(v).enter().append("foreignObject").attr("id", (c, f) => "point-label" + f).attr("class", "point-labels-container").attr("x", (c) => {
|
|
526
|
+
const f = this.getLabelBoxWidth(c) + 20;
|
|
467
527
|
return this.projection([
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
])[0] -
|
|
471
|
-
}).attr("y", (
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
])[1] - this.getLabelBoxHeight(
|
|
475
|
-
|
|
528
|
+
c.geometry.coordinates[1],
|
|
529
|
+
c.geometry.coordinates[0]
|
|
530
|
+
])[0] - f / 2;
|
|
531
|
+
}).attr("y", (c) => this.projection([
|
|
532
|
+
c.geometry.coordinates[1],
|
|
533
|
+
c.geometry.coordinates[0]
|
|
534
|
+
])[1] - this.getLabelBoxHeight(c) / 2).attr("width", (c) => this.getLabelBoxWidth(c) + 20).attr("height", (c) => "1px").attr("overflow", "visible").attr("font-size", "12px").style("opacity", 1).append("xhtml:div").style("color", (c, f) => o).style("font-weight", (c) => "bold").style("background-color", (c) => this.fillColor(c, m)).style("padding", (c) => "5px 3px 5px 3px").style("border-radius", (c) => "4px").style("line-height", "100%").style("text-align", "center").html((c, f) => k(
|
|
535
|
+
t,
|
|
476
536
|
{
|
|
477
|
-
value:
|
|
478
|
-
locationName:
|
|
537
|
+
value: c.properties.value,
|
|
538
|
+
locationName: c.properties[this.props.mapLabelField]
|
|
479
539
|
},
|
|
480
540
|
i
|
|
481
|
-
)).on("mouseover", (
|
|
482
|
-
|
|
541
|
+
)).on("mouseover", (c, f, y) => {
|
|
542
|
+
g.select(this.getMapId()).select("svg").select("g").select("#point-label" + y).raise(), this.showTooltip(c, f);
|
|
483
543
|
}).on("mousemove", this.mousemove).on("mouseout", this.mouseout);
|
|
484
544
|
}
|
|
485
|
-
addSymbols(e,
|
|
486
|
-
const { mappingField: i } = this.props, o =
|
|
487
|
-
e.forEach((
|
|
488
|
-
if (
|
|
489
|
-
const
|
|
490
|
-
const a =
|
|
491
|
-
return
|
|
492
|
-
(
|
|
545
|
+
addSymbols(e, s) {
|
|
546
|
+
const { mappingField: i } = this.props, o = g.select(this.getMapId()).select("svg").select("g");
|
|
547
|
+
e.forEach((t) => {
|
|
548
|
+
if (t.field && t.image && t.values) {
|
|
549
|
+
const r = s.filter((l) => {
|
|
550
|
+
const a = G == t.field ? i : "value", h = (l.properties[a] || (l.properties.variables ? l.properties.variables[a] : "")) + "", d = (t.values + "").split(",");
|
|
551
|
+
return l.properties.LATITUDE && l.properties.LONGITUDE && d.filter(
|
|
552
|
+
(u) => u.trim().toLowerCase() == h.trim().toLowerCase()
|
|
493
553
|
).length > 0;
|
|
494
|
-
}),
|
|
495
|
-
const a =
|
|
496
|
-
return !
|
|
497
|
-
(
|
|
554
|
+
}), n = s.filter((l) => {
|
|
555
|
+
const a = G == t.field ? i : "value", h = (l.properties[a] || (l.properties.variables ? l.properties.variables[a] : "")) + "", d = (t.values + "").split(",");
|
|
556
|
+
return !l.properties.LATITUDE && !l.properties.LONGITUDE && d.filter(
|
|
557
|
+
(u) => u.trim().toLowerCase() == h.trim().toLowerCase()
|
|
498
558
|
).length > 0;
|
|
499
559
|
});
|
|
500
|
-
o.selectAll("image").data(
|
|
560
|
+
o.selectAll("image").data(r).enter().append("image").attr("width", 40).attr("height", 40).attr("class", "map-symbol").attr("xlink:href", "/" + t.image).attr("transform", (l) => "translate(" + this.projection([l.properties.LONGITUDE, l.properties.LATITUDE]) + ")").on("mouseover", this.showTooltip).on("mousemove", this.mousemove).on("mouseout", this.mouseout), o.selectAll("image").data(n).enter().append("image").attr("width", 40).attr("height", 40).attr("class", "map-symbol").attr("xlink:href", "/" + t.image).attr("x", (l) => this.path.centroid(l)[0] - 20).attr("y", (l) => this.path.centroid(l)[1]).on("mouseover", this.showTooltip).on("mousemove", this.mousemove).on("mouseout", this.mouseout);
|
|
501
561
|
}
|
|
502
562
|
});
|
|
503
563
|
}
|
|
@@ -506,187 +566,196 @@ class de extends H.Component {
|
|
|
506
566
|
return e ? 30 : 25;
|
|
507
567
|
}
|
|
508
568
|
getLabelBoxWidth(e) {
|
|
509
|
-
const { mapLabelField:
|
|
510
|
-
if (e.properties[
|
|
511
|
-
const o = e.properties[
|
|
569
|
+
const { mapLabelField: s } = this.props, i = 80;
|
|
570
|
+
if (e.properties[s]) {
|
|
571
|
+
const o = e.properties[s].length;
|
|
512
572
|
return o < 10 ? i : o * 8;
|
|
513
573
|
}
|
|
514
574
|
return 0;
|
|
515
575
|
}
|
|
516
|
-
featuresZoom(e,
|
|
517
|
-
const o =
|
|
576
|
+
featuresZoom(e, s, i) {
|
|
577
|
+
const o = g.select(this.getMapId()).select("svg"), t = this.boundingExtent(e), [[r, n], [l, a]] = t, h = this.getWidth(), p = this.getHeight(), d = Math.min(
|
|
518
578
|
8,
|
|
519
|
-
0.9 / Math.max((
|
|
520
|
-
),
|
|
521
|
-
|
|
579
|
+
0.9 / Math.max((l - r) / h, (a - n) / p)
|
|
580
|
+
), u = [h / 2 - (r + l) / 2, p / 2 - (n + a) / 2];
|
|
581
|
+
s ? o.call(
|
|
522
582
|
this.zoom.transform,
|
|
523
|
-
|
|
583
|
+
g.zoomIdentity.translate(u[0], u[1]).scale(d)
|
|
524
584
|
) : o.transition().duration(450).call(
|
|
525
585
|
this.zoom.transform,
|
|
526
|
-
|
|
586
|
+
g.zoomIdentity.translate(u[0], u[1]).scale(d)
|
|
527
587
|
).on("end", i);
|
|
528
588
|
}
|
|
529
589
|
fullView() {
|
|
530
|
-
const { mapPosition: e, editing:
|
|
590
|
+
const { mapPosition: e, editing: s } = this.props, i = g.select(this.getMapId()).select("svg");
|
|
531
591
|
i.select("g").selectAll(".active").attr("class", function() {
|
|
532
|
-
return
|
|
592
|
+
return g.select(this).attr("class").replace(/background/gi, "");
|
|
533
593
|
});
|
|
534
|
-
let
|
|
535
|
-
e && !
|
|
594
|
+
let t = g.zoomIdentity;
|
|
595
|
+
e && !s ? t = t.translate(e.x, e.y).scale(e.k) : t = t.translate(0, 0).scale(1), i.transition().duration(300).call(this.zoom.transform, t);
|
|
536
596
|
}
|
|
537
|
-
showTooltip(e,
|
|
597
|
+
showTooltip(e, s) {
|
|
538
598
|
let {
|
|
539
599
|
showTooltip: i,
|
|
540
600
|
zoomEnabled: o,
|
|
541
|
-
tooltipTheme:
|
|
542
|
-
customTooltips:
|
|
543
|
-
tooltipFontSize:
|
|
544
|
-
tooltipFormat:
|
|
601
|
+
tooltipTheme: t,
|
|
602
|
+
customTooltips: r,
|
|
603
|
+
tooltipFontSize: n,
|
|
604
|
+
tooltipFormat: l,
|
|
545
605
|
intl: a,
|
|
546
606
|
mappingField: h,
|
|
547
|
-
showNoDataTooltip:
|
|
548
|
-
fields:
|
|
549
|
-
mapType:
|
|
550
|
-
noDataText:
|
|
607
|
+
showNoDataTooltip: p,
|
|
608
|
+
fields: d,
|
|
609
|
+
mapType: u,
|
|
610
|
+
noDataText: m
|
|
551
611
|
} = this.props;
|
|
552
612
|
if (o = !!["mobile", "tablet", "midTablet"].includes(
|
|
553
|
-
|
|
554
|
-
), i &&
|
|
555
|
-
|
|
556
|
-
const
|
|
557
|
-
{label}: %({value},2)`,
|
|
558
|
-
...
|
|
559
|
-
value:
|
|
613
|
+
T()
|
|
614
|
+
), i && s.properties.value != null || i && p) {
|
|
615
|
+
g.select(this.getMapId()).select("svg").select("g").selectAll(".active").attr("class", (A) => A.properties[h] === s.properties[h] ? "focus" + (o ? " zoom-enabled" : "") : "active" + (o ? " zoom-enabled" : ""));
|
|
616
|
+
const f = l || `{locationName} %({value},2)
|
|
617
|
+
{label}: %({value},2)`, y = s.properties.variables || {}, I = {
|
|
618
|
+
...s.properties,
|
|
619
|
+
value: s.properties.value,
|
|
560
620
|
measure: this.getSelectedMeasure(),
|
|
561
|
-
measureLabel:
|
|
562
|
-
locationName:
|
|
563
|
-
|
|
621
|
+
measureLabel: s.properties.measureLabel,
|
|
622
|
+
locationName: this.getTranslatedLocationName(s, h, a),
|
|
623
|
+
label: this.getTranslatedLocationName(s, h, a),
|
|
624
|
+
...y
|
|
564
625
|
};
|
|
565
|
-
this.tooltip.attr("class",
|
|
566
|
-
let
|
|
567
|
-
if (
|
|
568
|
-
const x =
|
|
569
|
-
`),
|
|
570
|
-
let
|
|
571
|
-
|
|
572
|
-
const
|
|
626
|
+
this.tooltip.attr("class", t).style("position", "absolute").style("visibility", "hidden").style("visibility", "visible").html((A) => {
|
|
627
|
+
let L = `<div style='font-size:${n}px;' class='tooltip-content' >`;
|
|
628
|
+
if (s.properties.value != null) {
|
|
629
|
+
const x = f.split(`
|
|
630
|
+
`), D = x[0], W = x.length > 1 ? x[1] : null;
|
|
631
|
+
let z = 1, P;
|
|
632
|
+
d.length > 1 && u != "POINTS_MAP" ? (z = x.length > 2 ? 2 : 1, P = x[z]) : P = null, D && (L += k(D, I, a)), W && (L.endsWith("<hr>") || (L += "<hr>"), L += k(W, I, a)), P && s.properties.children && s.properties.children.forEach((C, _) => {
|
|
633
|
+
const J = {
|
|
573
634
|
value: C.value,
|
|
574
635
|
label: C.label,
|
|
575
636
|
measure: this.getSelectedMeasure(),
|
|
576
|
-
measureLabel:
|
|
577
|
-
...
|
|
637
|
+
measureLabel: s.properties.measureLabel,
|
|
638
|
+
...y
|
|
578
639
|
};
|
|
579
|
-
|
|
640
|
+
L.endsWith("<hr>") || (L += "<hr>"), L += k(
|
|
580
641
|
P,
|
|
581
|
-
|
|
642
|
+
J,
|
|
582
643
|
a
|
|
583
644
|
);
|
|
584
|
-
}), x.length >
|
|
585
|
-
|
|
586
|
-
})),
|
|
587
|
-
(C) => C.location ===
|
|
645
|
+
}), x.length > z + 1 && (L.endsWith("<hr>") || (L += "<hr>"), x.forEach((C, _) => {
|
|
646
|
+
_ > z && (L.endsWith("<hr>") || (L += "<hr>"), L += k(C, I, a));
|
|
647
|
+
})), r.filter(
|
|
648
|
+
(C) => C.location === s.properties[h]
|
|
588
649
|
).forEach((C) => {
|
|
589
|
-
|
|
650
|
+
L.endsWith("<hr>") || (L += "<hr>"), L += C.tooltip;
|
|
590
651
|
});
|
|
591
652
|
} else {
|
|
592
|
-
const x =
|
|
593
|
-
{label}: %({value},2)`,
|
|
653
|
+
const x = l || `{locationName} %({value},2)
|
|
654
|
+
{label}: %({value},2)`, D = {
|
|
594
655
|
value: null,
|
|
595
656
|
measure: this.getSelectedMeasure(),
|
|
596
|
-
measureLabel:
|
|
597
|
-
locationName:
|
|
598
|
-
...
|
|
657
|
+
measureLabel: s.properties.measureLabel,
|
|
658
|
+
locationName: this.getTranslatedLocationName(s, h, a),
|
|
659
|
+
...y
|
|
599
660
|
};
|
|
600
|
-
|
|
661
|
+
L += k(x, D, a), L += "</div>";
|
|
601
662
|
}
|
|
602
|
-
return
|
|
663
|
+
return L;
|
|
603
664
|
});
|
|
604
665
|
}
|
|
605
666
|
}
|
|
606
|
-
mousemove(e,
|
|
667
|
+
mousemove(e, s) {
|
|
607
668
|
this.tooltip.style("top", e.pageY + "px").style("left", e.pageX + 5 + "px");
|
|
608
669
|
}
|
|
609
|
-
mouseout(e,
|
|
670
|
+
mouseout(e, s) {
|
|
610
671
|
const { showTooltip: i } = this.props;
|
|
611
|
-
i && (
|
|
672
|
+
i && (g.select(this.getMapId()).select("svg").select("g").selectAll(".focus").attr("class", "active"), this.tooltip.style("visibility", "hidden"));
|
|
612
673
|
}
|
|
613
|
-
onClick(e,
|
|
614
|
-
|
|
674
|
+
onClick(e, s) {
|
|
675
|
+
s.properties && this.tooltip.style("visibility", "visible").style("top", e.pageY + "px").style("left", e.pageX + 5 + "px"), e.stopPropagation(), e.preventDefault();
|
|
615
676
|
}
|
|
616
|
-
onPointClick(e,
|
|
617
|
-
this.showTooltip(e,
|
|
618
|
-
const o =
|
|
677
|
+
onPointClick(e, s, i) {
|
|
678
|
+
this.showTooltip(e, s), this.tooltip.style("visibility", "visible").style("top", e.pageY + "px").style("left", e.pageX + 5 + "px");
|
|
679
|
+
const o = g.select(this.getMapId()).select("svg").select("g");
|
|
619
680
|
o.selectAll("circle").style("fill", this.props.defaultPointColor).style("stroke", "none"), o.select("#circle" + i).raise().style("fill", "#fff");
|
|
620
681
|
}
|
|
621
|
-
onPolygonClick(e,
|
|
682
|
+
onPolygonClick(e, s) {
|
|
622
683
|
const { mappingField: i } = this.props;
|
|
623
|
-
this.state.selectedPolygon !==
|
|
684
|
+
this.state.selectedPolygon !== s.properties[i] && s.properties.value !== null && this.setState({ selectedPolygon: s.properties[i] });
|
|
624
685
|
}
|
|
625
686
|
onZoomIn(e) {
|
|
626
|
-
|
|
687
|
+
g.select(this.getMapId()).select("svg").transition().call(this.zoom.scaleBy, 1.5);
|
|
627
688
|
}
|
|
628
689
|
onZoomOut() {
|
|
629
|
-
|
|
690
|
+
g.select(this.getMapId()).select("svg").transition().call(this.zoom.scaleBy, 0.6667);
|
|
630
691
|
}
|
|
631
692
|
getSelectedMeasure() {
|
|
632
693
|
let e = this.state.selectedMeasure;
|
|
633
694
|
return !e && this.props.transformedData && this.props.transformedData.measures && this.props.transformedData.measures.length > 1 && (e = this.props.transformedData.measures[0]), e;
|
|
634
695
|
}
|
|
635
696
|
getCollectionField(e) {
|
|
636
|
-
const { topoJSONField:
|
|
697
|
+
const { topoJSONField: s } = this.props;
|
|
637
698
|
if (e && e.objects) {
|
|
638
699
|
const i = Object.keys(e.objects);
|
|
639
700
|
for (const o in i) {
|
|
640
|
-
const
|
|
641
|
-
if (e.objects[
|
|
642
|
-
return
|
|
701
|
+
const t = i[o];
|
|
702
|
+
if (e.objects[t].type == "GeometryCollection")
|
|
703
|
+
return t;
|
|
643
704
|
}
|
|
644
705
|
}
|
|
645
|
-
return
|
|
706
|
+
return s;
|
|
646
707
|
}
|
|
647
708
|
extractFeatures(e) {
|
|
648
|
-
const
|
|
649
|
-
return e && e.objects && e.objects[
|
|
709
|
+
const s = this.getCollectionField(e);
|
|
710
|
+
return e && e.objects && e.objects[s] ? ie.feature(e, e.objects[s]).features : e && e.features ? e.features : [];
|
|
650
711
|
}
|
|
651
712
|
getLayers() {
|
|
652
|
-
const { layers: e } = this.state, { enabledLayers:
|
|
713
|
+
const { layers: e } = this.state, { enabledLayers: s } = this.props;
|
|
653
714
|
return e && e.length > 0 ? e.map((o) => {
|
|
654
|
-
const
|
|
655
|
-
return o.index =
|
|
656
|
-
}).sort((o,
|
|
715
|
+
const t = s.find((r) => r.id == o.id);
|
|
716
|
+
return o.index = t ? t.index : 0, o;
|
|
717
|
+
}).sort((o, t) => parseInt(o.index) < parseInt(t.index) ? 1 : parseInt(o.index) > parseInt(t.index) ? -1 : 0) : [];
|
|
657
718
|
}
|
|
658
719
|
getFeatures() {
|
|
659
|
-
const e = this.getMainLayer(),
|
|
720
|
+
const e = this.getMainLayer(), s = this.getLayers();
|
|
660
721
|
if (e) {
|
|
661
|
-
const { transformedData: i, mappingField: o, app:
|
|
662
|
-
let
|
|
722
|
+
const { transformedData: i, mappingField: o, app: t, mainLayerId: r, enabledLayers: n } = this.props;
|
|
723
|
+
let l = [];
|
|
663
724
|
try {
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
725
|
+
l = this.extractFeatures(e), l.map((p) => {
|
|
726
|
+
p.properties.layerId = r;
|
|
727
|
+
const d = s.find((u) => String(u.id) === String(r));
|
|
728
|
+
return d && (p.properties.layerMappingField = d.layerMappingField, p.properties.layerDatasource = d.layerDatasource, p.properties.layerApiField = d.layerApiField, p.properties.layerLocale = d.layerLocale, p.properties.displayLayerLabels = d.displayLayerLabels), n.forEach((u) => {
|
|
729
|
+
String(u.id) == r && Object.keys(u || {}).forEach((m) => {
|
|
730
|
+
p.properties[m] = u[m];
|
|
731
|
+
});
|
|
732
|
+
}), p;
|
|
733
|
+
}), s && s.forEach((p) => {
|
|
734
|
+
if (p.id != r) {
|
|
735
|
+
let d = this.extractFeatures(p.data);
|
|
736
|
+
d = d.map((u) => (u.properties.layerId = p.id, u.properties.layerMappingField = p.layerMappingField, u.properties.layerDatasource = p.layerDatasource, u.properties.layerApiField = p.layerApiField, u.properties.layerLocale = p.layerLocale, u.properties.displayLayerLabels = p.displayLayerLabels, u)), l = [...d, ...l];
|
|
668
737
|
}
|
|
669
738
|
});
|
|
670
|
-
} catch (
|
|
671
|
-
console.log("error updating features .." +
|
|
739
|
+
} catch (p) {
|
|
740
|
+
console.log("error updating features .." + p);
|
|
672
741
|
}
|
|
673
|
-
const a =
|
|
742
|
+
const a = l.filter((p) => p.properties != null);
|
|
674
743
|
let h = i.locationsData;
|
|
675
744
|
return i.measures && i.measures.length > 1 && (h = i.locationsData.filter(
|
|
676
|
-
(
|
|
677
|
-
)), a.map((
|
|
745
|
+
(p) => p.measure === this.getSelectedMeasure()
|
|
746
|
+
)), a.map((p) => {
|
|
678
747
|
if (h) {
|
|
679
|
-
const
|
|
680
|
-
const
|
|
681
|
-
return
|
|
748
|
+
const d = h.find((u) => {
|
|
749
|
+
const m = u.label ? ("" + u.label).toLowerCase() : "", v = p.properties[o] ? p.properties[o].toLowerCase() : "";
|
|
750
|
+
return m === v;
|
|
682
751
|
});
|
|
683
|
-
if (
|
|
684
|
-
let
|
|
685
|
-
i.measureLabelMap &&
|
|
686
|
-
|
|
752
|
+
if (d) {
|
|
753
|
+
let u = d.measure;
|
|
754
|
+
i.measureLabelMap && d.measure && i.measureLabelMap[d.measure] && (u = i.measureLabelMap[d.measure]), p.properties.value = d.value, p.properties.measure = d.measure, p.properties.measureLabel = u, p.properties.children = d.children, p.properties.variables = d.variables, p.properties.hasDataRow = !0, Object.keys(d).forEach((m) => {
|
|
755
|
+
p.properties[m] = d[m];
|
|
687
756
|
});
|
|
688
757
|
} else
|
|
689
|
-
|
|
758
|
+
p.properties.value = null, p.properties.measure = null, p.properties.children = null, p.properties.measureLabel = null, p.properties.hasDataRow = !1;
|
|
690
759
|
}
|
|
691
760
|
}), a;
|
|
692
761
|
}
|
|
@@ -696,75 +765,75 @@ class de extends H.Component {
|
|
|
696
765
|
const { unique: e } = this.props;
|
|
697
766
|
return ".map.wrapper." + e;
|
|
698
767
|
}
|
|
699
|
-
filterUpdated(e,
|
|
700
|
-
const { zoomOnFilterField: i } = this.props, o = e && e.appliedFilters || {},
|
|
701
|
-
let
|
|
702
|
-
return o[i] !=
|
|
768
|
+
filterUpdated(e, s) {
|
|
769
|
+
const { zoomOnFilterField: i } = this.props, o = e && e.appliedFilters || {}, t = this.props.appliedFilters || {};
|
|
770
|
+
let r = !1;
|
|
771
|
+
return o[i] != t[i] && (r = !0), r;
|
|
703
772
|
}
|
|
704
|
-
getCenter(e,
|
|
705
|
-
const { zoomOnFilter: i, zoomOnFilterField: o, mappingField:
|
|
706
|
-
let
|
|
773
|
+
getCenter(e, s) {
|
|
774
|
+
const { zoomOnFilter: i, zoomOnFilterField: o, mappingField: t, appliedFilters: r } = this.props;
|
|
775
|
+
let n = null;
|
|
707
776
|
if (i && o) {
|
|
708
|
-
let
|
|
709
|
-
|
|
777
|
+
let l = this.state.selectedPolygon;
|
|
778
|
+
s && r && r[o] && (l = r[o]);
|
|
710
779
|
const a = e.filter(
|
|
711
|
-
(h) => h.properties != null && h.properties[
|
|
780
|
+
(h) => h.properties != null && h.properties[t] == l
|
|
712
781
|
)[0];
|
|
713
|
-
a && a.properties != null && a.properties.value && (
|
|
782
|
+
a && a.properties != null && a.properties.value && (n = a);
|
|
714
783
|
}
|
|
715
|
-
return
|
|
784
|
+
return n;
|
|
716
785
|
}
|
|
717
786
|
area(e) {
|
|
718
|
-
let
|
|
787
|
+
let s = 0;
|
|
719
788
|
const i = e.coordinates.length > 1 ? e.coordinates[0][0] : e.coordinates[0];
|
|
720
789
|
for (let o = 0; o < i.length - 1; o++)
|
|
721
|
-
|
|
722
|
-
return 0.5 *
|
|
790
|
+
s += i[o][0] * i[o + 1][1] - i[o + 1][0] * i[o][1];
|
|
791
|
+
return 0.5 * s;
|
|
723
792
|
}
|
|
724
793
|
centroid(e) {
|
|
725
|
-
const
|
|
726
|
-
for (let
|
|
727
|
-
|
|
794
|
+
const s = [0, 0], i = e.coordinates.length > 1 ? e.coordinates[0][0] : e.coordinates[0];
|
|
795
|
+
for (let t = 0; t < i.length - 1; t++)
|
|
796
|
+
s[0] += (i[t][0] + i[t + 1][0]) * (i[t][0] * i[t + 1][1] - i[t + 1][0] * i[t][1]), s[1] += (i[t][1] + i[t + 1][1]) * (i[t][0] * i[t + 1][1] - i[t + 1][0] * i[t][1]);
|
|
728
797
|
const o = this.area(e);
|
|
729
|
-
return
|
|
730
|
-
}
|
|
731
|
-
d3Map(e,
|
|
732
|
-
let { zoomEnabled: i, mapContainerBgColor: o, mapPosition:
|
|
733
|
-
i || (i = !!["mobile", "tablet"].includes(
|
|
734
|
-
const
|
|
735
|
-
let h = a.select("svg"),
|
|
736
|
-
|
|
737
|
-
const
|
|
738
|
-
if (h.empty() ? h = a.append("svg") : h.selectAll("*").remove(), h.attr("style", `background-color:${o};`).attr("viewBox", `0 0 ${
|
|
798
|
+
return s[0] /= o * 6, s[1] /= o * 6, s;
|
|
799
|
+
}
|
|
800
|
+
d3Map(e, s) {
|
|
801
|
+
let { zoomEnabled: i, mapContainerBgColor: o, mapPosition: t, editing: r, mapType: n } = this.props;
|
|
802
|
+
i || (i = !!["mobile", "tablet"].includes(T()));
|
|
803
|
+
const l = this.getBreaks(), a = g.select(this.getMapId());
|
|
804
|
+
let h = a.select("svg"), p = this.getWidth();
|
|
805
|
+
p === 0 ? p = window.innerWidth + Z[T()] : p += Z[T()];
|
|
806
|
+
const d = this.getHeight() - 100;
|
|
807
|
+
if (h.empty() ? h = a.append("svg") : h.selectAll("*").remove(), h.attr("style", `background-color:${o};`).attr("viewBox", `0 0 ${p} ${d}`).attr("preserveAspectRatio", "xMidYMid meet"), h.append("g").selectAll("path").data(e).enter().append("path").attr("fill", (m) => this.fillColor(m, l)).attr("d", g.geoPath().projection(this.projection)).attr("class", (m) => this.classColor(m)).on("mouseover", n !== "POINTS_MAP" ? this.showTooltip : null).on("mousemove", n !== "POINTS_MAP" ? this.mousemove : null).on("mouseout", n !== "POINTS_MAP" ? this.mouseout : null), this.mapPosition && h.transition().duration(300).call(
|
|
739
808
|
this.zoom.transform,
|
|
740
|
-
|
|
741
|
-
), !this.mapPosition &&
|
|
809
|
+
g.zoomIdentity.translate(this.mapPosition.x, this.mapPosition.y).scale(this.mapPosition.k)
|
|
810
|
+
), !this.mapPosition && t && t.x && t.y && t.k && (h.transition().duration(300).call(
|
|
742
811
|
this.zoom.transform,
|
|
743
|
-
|
|
744
|
-
),
|
|
745
|
-
const
|
|
812
|
+
g.zoomIdentity.translate(t.x, t.y).scale(t.k)
|
|
813
|
+
), n === "POINTS_MAP")) {
|
|
814
|
+
const v = {
|
|
746
815
|
mobile: 100,
|
|
747
816
|
tablet: 0,
|
|
748
817
|
midTablet: 0,
|
|
749
818
|
desktop: 0,
|
|
750
819
|
laptop: 0,
|
|
751
820
|
wide: 0
|
|
752
|
-
}[
|
|
821
|
+
}[T()];
|
|
753
822
|
h.transition().duration(300).call(
|
|
754
823
|
this.zoom.transform,
|
|
755
|
-
|
|
824
|
+
g.zoomIdentity.translate(t.x + v, t.y).scale(t.k)
|
|
756
825
|
);
|
|
757
826
|
}
|
|
758
|
-
i ||
|
|
759
|
-
const
|
|
760
|
-
if (
|
|
761
|
-
const
|
|
762
|
-
(
|
|
763
|
-
(
|
|
827
|
+
i || r ? h.call(this.zoom) : h.on("dblclick.zoom", null);
|
|
828
|
+
const u = this.getCenter(e, s);
|
|
829
|
+
if (u) {
|
|
830
|
+
const m = this.path.bounds(u), v = [
|
|
831
|
+
(m[0][0] + m[1][0]) / 2,
|
|
832
|
+
(m[0][1] + m[1][1]) / 2
|
|
764
833
|
];
|
|
765
834
|
h.transition().duration(750).call(
|
|
766
835
|
this.zoom.transform,
|
|
767
|
-
|
|
836
|
+
g.zoomIdentity.translate(p / 2, d / 2).scale(12).translate(-v[0], -v[1])
|
|
768
837
|
);
|
|
769
838
|
}
|
|
770
839
|
}
|
|
@@ -776,52 +845,65 @@ class de extends H.Component {
|
|
|
776
845
|
this.state.selectedMeasure != e && this.setState({ selectedMeasure: e });
|
|
777
846
|
}
|
|
778
847
|
getFilters() {
|
|
779
|
-
const { appliedFilters: e } = this.props,
|
|
848
|
+
const { appliedFilters: e } = this.props, s = {};
|
|
780
849
|
return e && Object.keys(e).forEach((o) => {
|
|
781
|
-
const
|
|
782
|
-
|
|
783
|
-
}),
|
|
850
|
+
const t = e[o];
|
|
851
|
+
t && (s[o] = Array.isArray(t) ? t.join(" ,") : t);
|
|
852
|
+
}), s;
|
|
784
853
|
}
|
|
785
854
|
getHighlightedLocationData() {
|
|
786
|
-
const { highlightedLocation: e, transformedData:
|
|
787
|
-
let i =
|
|
788
|
-
return
|
|
789
|
-
(
|
|
855
|
+
const { highlightedLocation: e, transformedData: s } = this.props;
|
|
856
|
+
let i = s.locationsData;
|
|
857
|
+
return s.measures && s.measures.length > 1 && (i = s.locationsData.filter(
|
|
858
|
+
(t) => t.measure === this.getSelectedMeasure()
|
|
790
859
|
)), i.find(
|
|
791
|
-
(
|
|
860
|
+
(t) => t.label === e
|
|
861
|
+
);
|
|
862
|
+
}
|
|
863
|
+
getTranslatedHighlightedLocationName() {
|
|
864
|
+
const { highlightedLocation: e, mapLabelField: s, intl: i } = this.props;
|
|
865
|
+
if (!e)
|
|
866
|
+
return null;
|
|
867
|
+
const t = this.getFeatures().find(
|
|
868
|
+
(r) => r.properties[s] === e
|
|
792
869
|
);
|
|
870
|
+
if (t && t.properties.displayLayerLabels && t.properties.layerLocale) {
|
|
871
|
+
const r = t.properties.layerMappingField || s, n = t.properties[r];
|
|
872
|
+
return O(this.metadataTypes, n, t.properties.layerLocale);
|
|
873
|
+
}
|
|
874
|
+
return e;
|
|
793
875
|
}
|
|
794
876
|
getHighlightedLocationColor(e) {
|
|
795
|
-
const
|
|
877
|
+
const s = this.getBreaks(), { mapNoDataColor: i } = this.props, o = e ? e.value : null;
|
|
796
878
|
if (o != null) {
|
|
797
|
-
const
|
|
798
|
-
if (
|
|
799
|
-
return o >=
|
|
800
|
-
if (
|
|
801
|
-
return o >=
|
|
802
|
-
if (
|
|
803
|
-
return o <=
|
|
879
|
+
const t = s.find((r) => {
|
|
880
|
+
if (r.min != null && r.max != null)
|
|
881
|
+
return o >= r.min && o <= r.max;
|
|
882
|
+
if (r.min != null)
|
|
883
|
+
return o >= r.min;
|
|
884
|
+
if (r.max != null)
|
|
885
|
+
return o <= r.max;
|
|
804
886
|
});
|
|
805
|
-
return
|
|
887
|
+
return t && t.color ? t.color : i;
|
|
806
888
|
}
|
|
807
889
|
return i;
|
|
808
890
|
}
|
|
809
891
|
renderLoader() {
|
|
810
|
-
return /* @__PURE__ */ b(
|
|
811
|
-
|
|
892
|
+
return /* @__PURE__ */ b(U, { className: "loading", children: /* @__PURE__ */ b(
|
|
893
|
+
Q,
|
|
812
894
|
{
|
|
813
895
|
basic: !0,
|
|
814
896
|
padded: !0,
|
|
815
897
|
textAlign: "center",
|
|
816
898
|
style: { margin: "30px" },
|
|
817
|
-
children: /* @__PURE__ */ b(
|
|
899
|
+
children: /* @__PURE__ */ b(ee, { active: !0, inverted: !0, children: /* @__PURE__ */ b(te, { size: "medium" }) })
|
|
818
900
|
}
|
|
819
901
|
) });
|
|
820
902
|
}
|
|
821
903
|
noMapSelected() {
|
|
822
|
-
return /* @__PURE__ */
|
|
904
|
+
return /* @__PURE__ */ M(N, { icon: !0, warning: !0, children: [
|
|
823
905
|
/* @__PURE__ */ b(E, { name: "map outline" }),
|
|
824
|
-
/* @__PURE__ */
|
|
906
|
+
/* @__PURE__ */ M(N.Content, { children: [
|
|
825
907
|
/* @__PURE__ */ b(N.Header, { children: "No map selected" }),
|
|
826
908
|
"Pick one from the list in the ",
|
|
827
909
|
/* @__PURE__ */ b("strong", { children: "Map Layers" }),
|
|
@@ -832,53 +914,53 @@ class de extends H.Component {
|
|
|
832
914
|
render() {
|
|
833
915
|
let {
|
|
834
916
|
app: e,
|
|
835
|
-
legendTitle:
|
|
917
|
+
legendTitle: s,
|
|
836
918
|
nationalAverageLabel: i,
|
|
837
919
|
intl: o,
|
|
838
|
-
zoomEnabled:
|
|
839
|
-
transformedData:
|
|
840
|
-
measureSelectorLabel:
|
|
841
|
-
valueFormat:
|
|
920
|
+
zoomEnabled: t,
|
|
921
|
+
transformedData: r,
|
|
922
|
+
measureSelectorLabel: n,
|
|
923
|
+
valueFormat: l,
|
|
842
924
|
showOverallValue: a,
|
|
843
925
|
unique: h,
|
|
844
|
-
highlightedLocation:
|
|
845
|
-
labelFontColor:
|
|
846
|
-
legendFontSize:
|
|
847
|
-
editing:
|
|
848
|
-
highlightedLocLabelFormat:
|
|
849
|
-
noDataText:
|
|
926
|
+
highlightedLocation: p,
|
|
927
|
+
labelFontColor: d,
|
|
928
|
+
legendFontSize: u,
|
|
929
|
+
editing: m,
|
|
930
|
+
highlightedLocLabelFormat: v,
|
|
931
|
+
noDataText: c
|
|
850
932
|
} = this.props;
|
|
851
|
-
|
|
852
|
-
|
|
933
|
+
t || (t = !!["mobile", "tablet", "midTablet"].includes(
|
|
934
|
+
T()
|
|
853
935
|
));
|
|
854
|
-
const
|
|
855
|
-
backgroundColor: this.getHighlightedLocationColor(
|
|
856
|
-
color:
|
|
857
|
-
fontSize:
|
|
936
|
+
const f = this.getAvg(), y = this.getFilters(), I = this.getHighlightedLocationData(), A = {
|
|
937
|
+
backgroundColor: this.getHighlightedLocationColor(I),
|
|
938
|
+
color: d,
|
|
939
|
+
fontSize: u + "px"
|
|
858
940
|
};
|
|
859
|
-
|
|
860
|
-
const
|
|
861
|
-
/* @__PURE__ */
|
|
862
|
-
e !== "csv" && a && /* @__PURE__ */ b(
|
|
941
|
+
m && (A.marginTop = "25px");
|
|
942
|
+
const L = () => /* @__PURE__ */ M(U, { fluid: !0, className: "footnote ", children: [
|
|
943
|
+
/* @__PURE__ */ M(S, { columns: 2, children: [
|
|
944
|
+
e !== "csv" && a && /* @__PURE__ */ b(S.Column, { textAlign: "left", width: 4, children: /* @__PURE__ */ M("div", { className: "national-average-div", children: [
|
|
863
945
|
/* @__PURE__ */ b("span", { className: "national-avg-label", children: i }),
|
|
864
946
|
/* @__PURE__ */ b("span", { className: "national-avg-value", children: k(
|
|
865
|
-
|
|
866
|
-
{ value:
|
|
947
|
+
l,
|
|
948
|
+
{ value: f },
|
|
867
949
|
o
|
|
868
950
|
) })
|
|
869
951
|
] }) }),
|
|
870
952
|
/* @__PURE__ */ b(
|
|
871
|
-
|
|
953
|
+
S.Column,
|
|
872
954
|
{
|
|
873
955
|
textAlign: "right",
|
|
874
956
|
width: e !== "csv" && a ? 12 : 16,
|
|
875
957
|
children: /* @__PURE__ */ b(
|
|
876
|
-
|
|
958
|
+
oe,
|
|
877
959
|
{
|
|
878
960
|
filteredBreaks: this.getBreaks(),
|
|
879
961
|
formattedLegendTitle: k(
|
|
880
|
-
|
|
881
|
-
{ ...
|
|
962
|
+
s,
|
|
963
|
+
{ ...y },
|
|
882
964
|
o
|
|
883
965
|
),
|
|
884
966
|
selectedMeasure: this.state.selectedMeasure,
|
|
@@ -888,9 +970,9 @@ class de extends H.Component {
|
|
|
888
970
|
}
|
|
889
971
|
)
|
|
890
972
|
] }),
|
|
891
|
-
/* @__PURE__ */ b("div", { className: "measure-selector", children: /* @__PURE__ */
|
|
892
|
-
|
|
893
|
-
|
|
973
|
+
/* @__PURE__ */ b("div", { className: "measure-selector", children: /* @__PURE__ */ M("ul", { children: [
|
|
974
|
+
n && /* @__PURE__ */ b("li", { children: /* @__PURE__ */ b("span", { className: "label", children: n }) }),
|
|
975
|
+
r && r.measures && r.measures.length > 1 && r.measures.map((x) => /* @__PURE__ */ M("li", { onClick: this.selectedMeasureChanged.bind(this, x), children: [
|
|
894
976
|
/* @__PURE__ */ b(
|
|
895
977
|
"input",
|
|
896
978
|
{
|
|
@@ -899,49 +981,49 @@ class de extends H.Component {
|
|
|
899
981
|
value: x
|
|
900
982
|
}
|
|
901
983
|
),
|
|
902
|
-
/* @__PURE__ */ b("label", { children:
|
|
984
|
+
/* @__PURE__ */ b("label", { children: r.measureLabelMap[x] || x })
|
|
903
985
|
] }))
|
|
904
986
|
] }) })
|
|
905
987
|
] });
|
|
906
|
-
return /* @__PURE__ */
|
|
907
|
-
this.state.layersLoading && (
|
|
908
|
-
!this.state.layersLoading && /* @__PURE__ */
|
|
909
|
-
|
|
910
|
-
/* @__PURE__ */
|
|
988
|
+
return /* @__PURE__ */ M("div", { className: "map component wp-data-viz-map", ref: this.mapContainer, children: [
|
|
989
|
+
this.state.layersLoading && (m ? this.noMapSelected() : this.renderLoader()),
|
|
990
|
+
!this.state.layersLoading && /* @__PURE__ */ M(R, { children: [
|
|
991
|
+
!$ && /* @__PURE__ */ b(L, {}),
|
|
992
|
+
/* @__PURE__ */ M(
|
|
911
993
|
"div",
|
|
912
994
|
{
|
|
913
995
|
className: "map wrapper scaling-svg-container " + h,
|
|
914
996
|
style: {
|
|
915
|
-
height: this.props.height - ce[
|
|
997
|
+
height: this.props.height - ce[T()] + "px"
|
|
916
998
|
},
|
|
917
999
|
children: [
|
|
918
|
-
|
|
1000
|
+
I ? /* @__PURE__ */ b(
|
|
919
1001
|
"div",
|
|
920
1002
|
{
|
|
921
1003
|
className: "highlighted-loc-info",
|
|
922
|
-
style:
|
|
923
|
-
children: /* @__PURE__ */
|
|
1004
|
+
style: A,
|
|
1005
|
+
children: /* @__PURE__ */ M("span", { children: [
|
|
924
1006
|
" ",
|
|
925
1007
|
k(
|
|
926
|
-
|
|
1008
|
+
v,
|
|
927
1009
|
{
|
|
928
|
-
value:
|
|
929
|
-
locationName:
|
|
930
|
-
measureName:
|
|
1010
|
+
value: I.value,
|
|
1011
|
+
locationName: this.getTranslatedHighlightedLocationName() || I.label,
|
|
1012
|
+
measureName: I.measure
|
|
931
1013
|
},
|
|
932
1014
|
o
|
|
933
1015
|
)
|
|
934
1016
|
] })
|
|
935
1017
|
}
|
|
936
|
-
),
|
|
937
|
-
(
|
|
1018
|
+
) : /* @__PURE__ */ b(R, { children: " " }),
|
|
1019
|
+
(m || t) && !de && /* @__PURE__ */ M("div", { className: "control panel ignore", children: [
|
|
938
1020
|
/* @__PURE__ */ b("div", { className: "zoom plus", onClick: this.onZoomIn, children: /* @__PURE__ */ b(E, { name: "plus", size: "large" }) }),
|
|
939
1021
|
/* @__PURE__ */ b("div", { className: "zoom minus", onClick: this.onZoomOut, children: /* @__PURE__ */ b(E, { name: "minus", size: "large" }) }),
|
|
940
1022
|
/* @__PURE__ */ b(
|
|
941
|
-
|
|
1023
|
+
se,
|
|
942
1024
|
{
|
|
943
1025
|
content: /* @__PURE__ */ b(
|
|
944
|
-
|
|
1026
|
+
K,
|
|
945
1027
|
{
|
|
946
1028
|
id: "map.reset.tooltip",
|
|
947
1029
|
defaultMessage: "Reset zoom"
|
|
@@ -954,12 +1036,13 @@ class de extends H.Component {
|
|
|
954
1036
|
]
|
|
955
1037
|
}
|
|
956
1038
|
),
|
|
957
|
-
|
|
1039
|
+
$ && /* @__PURE__ */ b(L, {})
|
|
958
1040
|
] })
|
|
959
1041
|
] });
|
|
960
1042
|
}
|
|
961
1043
|
}
|
|
962
|
-
const
|
|
1044
|
+
const Te = q(ue);
|
|
963
1045
|
export {
|
|
964
|
-
|
|
1046
|
+
Te as default,
|
|
1047
|
+
O as getTranslatedItemLabel
|
|
965
1048
|
};
|