@anov/3d-ability 0.0.139 → 0.0.141
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/business/Animation/motion/index.js +35 -56
- package/dist/business/Animation/motion/index.js.map +1 -1
- package/dist/business/Animation/type.js +2 -2
- package/dist/business/Area/Fence/FenceBase.js +146 -187
- package/dist/business/Area/Fence/FenceBase.js.map +1 -1
- package/dist/business/Area/Fence/fence_base_01.js +120 -112
- package/dist/business/Area/Fence/fence_base_01.js.map +1 -1
- package/dist/business/Area/Fence/fence_feeting_01.js +218 -130
- package/dist/business/Area/Fence/fence_feeting_01.js.map +1 -1
- package/dist/business/Area/Fence/fence_roll_01.js +140 -130
- package/dist/business/Area/Fence/fence_roll_01.js.map +1 -1
- package/dist/business/Area/FillArea/FillAreaBase.js +87 -126
- package/dist/business/Area/FillArea/FillAreaBase.js.map +1 -1
- package/dist/business/Area/FillArea/fillArea_face_01.js +72 -98
- package/dist/business/Area/FillArea/fillArea_face_01.js.map +1 -1
- package/dist/business/Area/FillArea/fillArea_line_01.js +66 -94
- package/dist/business/Area/FillArea/fillArea_line_01.js.map +1 -1
- package/dist/business/Area/index.js +267 -483
- package/dist/business/Area/index.js.map +1 -1
- package/dist/business/Area/tool.js +14 -26
- package/dist/business/Area/tool.js.map +1 -1
- package/dist/business/Base/ObjectLayer.js +21 -46
- package/dist/business/Base/ObjectLayer.js.map +1 -1
- package/dist/business/Batch/index.js +189 -234
- package/dist/business/Batch/index.js.map +1 -1
- package/dist/business/Box/index.js +52 -81
- package/dist/business/Box/index.js.map +1 -1
- package/dist/business/Cylinder/index.js +51 -79
- package/dist/business/Cylinder/index.js.map +1 -1
- package/dist/business/Flyline/bubble/CircleBubble.js +1 -9
- package/dist/business/Flyline/bubble/CircleBubble.js.map +1 -1
- package/dist/business/Flyline/bubble/index.js +7 -21
- package/dist/business/Flyline/bubble/index.js.map +1 -1
- package/dist/business/Flyline/index.js +96 -162
- package/dist/business/Flyline/index.js.map +1 -1
- package/dist/business/Flyline/line/ArcLine.js +208 -291
- package/dist/business/Flyline/line/ArcLine.js.map +1 -1
- package/dist/business/Flyline/line/index.js +8 -22
- package/dist/business/Flyline/line/index.js.map +1 -1
- package/dist/business/HeatMap/HeatMap.js +380 -467
- package/dist/business/HeatMap/HeatMap.js.map +1 -1
- package/dist/business/HeatMap/core.js +405 -525
- package/dist/business/HeatMap/core.js.map +1 -1
- package/dist/business/HeatMap/shader.js +69 -3
- package/dist/business/HeatMap/shader.js.map +1 -1
- package/dist/business/InfoPanel/index.js +201 -242
- package/dist/business/InfoPanel/index.js.map +1 -1
- package/dist/business/Line/index.js +55 -88
- package/dist/business/Line/index.js.map +1 -1
- package/dist/business/Mark/KeyframeAnimation.js +145 -176
- package/dist/business/Mark/KeyframeAnimation.js.map +1 -1
- package/dist/business/Mark/index.js +196 -294
- package/dist/business/Mark/index.js.map +1 -1
- package/dist/business/Mark/shader/tanhao.js +36 -3
- package/dist/business/Mark/shader/tanhao.js.map +1 -1
- package/dist/business/Mark/type.js +1 -1
- package/dist/business/MaterialSwitch/MaterialSwitchSystem.js +377 -551
- package/dist/business/MaterialSwitch/MaterialSwitchSystem.js.map +1 -1
- package/dist/business/MaterialSwitch/inject.js +92 -58
- package/dist/business/MaterialSwitch/inject.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/finalFade.js +74 -2
- package/dist/business/MaterialSwitch/shader/finalFade.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/ground.js +95 -16
- package/dist/business/MaterialSwitch/shader/ground.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/groundBase64.js +9 -3
- package/dist/business/MaterialSwitch/shader/groundBase64.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/realFade.js +48 -9
- package/dist/business/MaterialSwitch/shader/realFade.js.map +1 -1
- package/dist/business/Plane/index.js +51 -78
- package/dist/business/Plane/index.js.map +1 -1
- package/dist/business/Poi/index.d.ts +5 -0
- package/dist/business/Poi/index.js +256 -295
- package/dist/business/Poi/index.js.map +1 -1
- package/dist/business/Poi/link/Cylinder.js +56 -89
- package/dist/business/Poi/link/Cylinder.js.map +1 -1
- package/dist/business/Poi/link/Pyramid.js +104 -165
- package/dist/business/Poi/link/Pyramid.js.map +1 -1
- package/dist/business/Poi/link/index.d.ts +1 -1
- package/dist/business/Poi/link/index.js +54 -114
- package/dist/business/Poi/link/index.js.map +1 -1
- package/dist/business/Poi/panel/index.d.ts +124 -0
- package/dist/business/Poi/panel/index.js +474 -0
- package/dist/business/Poi/panel/index.js.map +1 -0
- package/dist/business/Poi/panel/interfaces.d.ts +67 -0
- package/dist/business/Poi/panel/interfaces.js +2 -0
- package/dist/business/Poi/panel/interfaces.js.map +1 -0
- package/dist/business/Poi/panel/utils.d.ts +72 -0
- package/dist/business/Poi/panel/utils.js +126 -0
- package/dist/business/Poi/panel/utils.js.map +1 -0
- package/dist/business/Poi/particle/DoubleCircle.js +71 -107
- package/dist/business/Poi/particle/DoubleCircle.js.map +1 -1
- package/dist/business/Poi/particle/DynamicCircle.js +75 -111
- package/dist/business/Poi/particle/DynamicCircle.js.map +1 -1
- package/dist/business/Poi/particle/SingleCircle.js +62 -98
- package/dist/business/Poi/particle/SingleCircle.js.map +1 -1
- package/dist/business/Poi/particle/index.js +49 -117
- package/dist/business/Poi/particle/index.js.map +1 -1
- package/dist/business/Poi/shader/circle.js +31 -3
- package/dist/business/Poi/shader/circle.js.map +1 -1
- package/dist/business/Poi/shader/cylinder.js +37 -3
- package/dist/business/Poi/shader/cylinder.js.map +1 -1
- package/dist/business/Poi/shader/doubleCircle.js +55 -3
- package/dist/business/Poi/shader/doubleCircle.js.map +1 -1
- package/dist/business/Poi/shader/dynamicCircle.js +67 -3
- package/dist/business/Poi/shader/dynamicCircle.js.map +1 -1
- package/dist/business/Poi/title/Border.js +7 -27
- package/dist/business/Poi/title/Border.js.map +1 -1
- package/dist/business/Poi/title/Ellipse.js +7 -27
- package/dist/business/Poi/title/Ellipse.js.map +1 -1
- package/dist/business/Poi/title/index.js +208 -292
- package/dist/business/Poi/title/index.js.map +1 -1
- package/dist/business/Poi/tools.js +22 -19
- package/dist/business/Poi/tools.js.map +1 -1
- package/dist/business/Poi/types.d.ts +3 -0
- package/dist/business/Poi/types.js.map +1 -1
- package/dist/business/Sphere/index.js +47 -72
- package/dist/business/Sphere/index.js.map +1 -1
- package/dist/business/Spline/index.js +190 -245
- package/dist/business/Spline/index.js.map +1 -1
- package/dist/business/SplitBuilding/index.js +327 -536
- package/dist/business/SplitBuilding/index.js.map +1 -1
- package/dist/business/SplitBuilding/type.js +2 -2
- package/dist/business/TrafficComponents/RealismTraffic/RealismTraffic.js +218 -275
- package/dist/business/TrafficComponents/RealismTraffic/RealismTraffic.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/StreamerTraffic.js +132 -177
- package/dist/business/TrafficComponents/StreamerTraffic/StreamerTraffic.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/fragmentShader.js +51 -1
- package/dist/business/TrafficComponents/StreamerTraffic/fragmentShader.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/vertexShader.js +6 -1
- package/dist/business/TrafficComponents/StreamerTraffic/vertexShader.js.map +1 -1
- package/dist/business/TrafficComponents/base.js +32 -55
- package/dist/business/TrafficComponents/base.js.map +1 -1
- package/dist/business/TrafficComponents/utils.js +25 -24
- package/dist/business/TrafficComponents/utils.js.map +1 -1
- package/dist/business/Utils/Curve.js +40 -56
- package/dist/business/Utils/Curve.js.map +1 -1
- package/dist/business/Utils/constant.js +1 -1
- package/dist/business/Utils/constant.js.map +1 -1
- package/dist/business/Utils/defineProps.js +13 -14
- package/dist/business/Utils/defineProps.js.map +1 -1
- package/dist/business/Utils/round-curve.js +127 -153
- package/dist/business/Utils/round-curve.js.map +1 -1
- package/dist/business/VideoPanel/index.js +258 -319
- package/dist/business/VideoPanel/index.js.map +1 -1
- package/dist/business/Water/index.js +78 -108
- package/dist/business/Water/index.js.map +1 -1
- package/dist/business/Water/types.js +1 -1
- package/dist/business/Water/types.js.map +1 -1
- package/dist/core/Camera/PerspectiveCamera/CameraExpand.js +383 -449
- package/dist/core/Camera/PerspectiveCamera/CameraExpand.js.map +1 -1
- package/dist/core/Camera/PerspectiveCamera/FollowOrbitControls.js +107 -142
- package/dist/core/Camera/PerspectiveCamera/FollowOrbitControls.js.map +1 -1
- package/dist/core/Controls/FirstViewControl/index.js +84 -96
- package/dist/core/Controls/FirstViewControl/index.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/action/input.js +77 -98
- package/dist/core/Controls/ThirdViewControl/action/input.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/config/constants.js +1 -1
- package/dist/core/Controls/ThirdViewControl/config/constants.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/index.js +19 -28
- package/dist/core/Controls/ThirdViewControl/index.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/animation.js +126 -155
- package/dist/core/Controls/ThirdViewControl/player/animation.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/camera.js +47 -63
- package/dist/core/Controls/ThirdViewControl/player/camera.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/control.js +39 -49
- package/dist/core/Controls/ThirdViewControl/player/control.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player.js +66 -91
- package/dist/core/Controls/ThirdViewControl/player.js.map +1 -1
- package/dist/core/Controls/base.js +14 -30
- package/dist/core/Controls/base.js.map +1 -1
- package/dist/core/Curve/RoundedCornersCurve/RoundedCornersCurve.js +92 -131
- package/dist/core/Curve/RoundedCornersCurve/RoundedCornersCurve.js.map +1 -1
- package/dist/core/Debug/PerformanceInfo/Performance.js +22 -47
- package/dist/core/Debug/PerformanceInfo/Performance.js.map +1 -1
- package/dist/core/Light/PointLight/PointLightExt.js +4 -21
- package/dist/core/Light/PointLight/PointLightExt.js.map +1 -1
- package/dist/core/Material/FinirMaterial/FinirMaterial.js +37 -57
- package/dist/core/Material/FinirMaterial/FinirMaterial.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/PristineGridMaterial.js +116 -153
- package/dist/core/Material/PristineGridMaterial/PristineGridMaterial.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/shader/fragment.js +95 -1
- package/dist/core/Material/PristineGridMaterial/shader/fragment.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/shader/vertex.js +26 -1
- package/dist/core/Material/PristineGridMaterial/shader/vertex.js.map +1 -1
- package/dist/core/Material/SurfaceMaterial/index.js +76 -172
- package/dist/core/Material/SurfaceMaterial/index.js.map +1 -1
- package/dist/core/Material/decorators.js +6 -11
- package/dist/core/Material/decorators.js.map +1 -1
- package/dist/core/PostEffects/addACESFilmicToneMappingPass.js +16 -12
- package/dist/core/PostEffects/addACESFilmicToneMappingPass.js.map +1 -1
- package/dist/core/PostEffects/addBrightnessContrastPass.js +17 -13
- package/dist/core/PostEffects/addBrightnessContrastPass.js.map +1 -1
- package/dist/core/PostEffects/bloomPass.js +17 -10
- package/dist/core/PostEffects/bloomPass.js.map +1 -1
- package/dist/core/PostEffects/bloomSelect.js +60 -43
- package/dist/core/PostEffects/bloomSelect.js.map +1 -1
- package/dist/core/PostEffects/colorifyPass.js +17 -13
- package/dist/core/PostEffects/colorifyPass.js.map +1 -1
- package/dist/core/PostEffects/index.js +28 -22
- package/dist/core/PostEffects/index.js.map +1 -1
- package/dist/core/PostEffects/outlinePass.js +37 -50
- package/dist/core/PostEffects/outlinePass.js.map +1 -1
- package/dist/core/PostEffects/postprocessing.js +14 -12
- package/dist/core/PostEffects/postprocessing.js.map +1 -1
- package/dist/core/PostEffects/saoPass.js +15 -10
- package/dist/core/PostEffects/saoPass.js.map +1 -1
- package/dist/core/PostEffects/shader/colorify.js +22 -3
- package/dist/core/PostEffects/shader/colorify.js.map +1 -1
- package/dist/core/PostEffects/shader/gammaCorrectionShader.js +27 -3
- package/dist/core/PostEffects/shader/gammaCorrectionShader.js.map +1 -1
- package/dist/core/PostEffects/shader/mapping.js +66 -3
- package/dist/core/PostEffects/shader/mapping.js.map +1 -1
- package/dist/core/PostEffects/shader/thermalMaging.js +28 -3
- package/dist/core/PostEffects/shader/thermalMaging.js.map +1 -1
- package/dist/core/SceneEffect/grow/grow.js +85 -101
- package/dist/core/SceneEffect/grow/grow.js.map +1 -1
- package/dist/core/SceneEffect/grow/style_down.js +60 -77
- package/dist/core/SceneEffect/grow/style_down.js.map +1 -1
- package/dist/core/SceneEffect/grow/style_up.js +64 -81
- package/dist/core/SceneEffect/grow/style_up.js.map +1 -1
- package/dist/core/SceneEffect/grow/type.js +2 -2
- package/dist/core/SceneEffect/grow/type.js.map +1 -1
- package/dist/core/WeatherSystem/DynamicWeatherSystem.js +51 -76
- package/dist/core/WeatherSystem/DynamicWeatherSystem.js.map +1 -1
- package/dist/core/WeatherSystem/hdr/index.js +69 -105
- package/dist/core/WeatherSystem/hdr/index.js.map +1 -1
- package/dist/core/WeatherSystem/index.js +77 -124
- package/dist/core/WeatherSystem/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/fog/index.js +52 -80
- package/dist/core/WeatherSystem/objects/fog/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/index.js +72 -84
- package/dist/core/WeatherSystem/objects/rain/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/lineRain.js +88 -118
- package/dist/core/WeatherSystem/objects/rain/lineRain.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/plane.js +116 -146
- package/dist/core/WeatherSystem/objects/rain/plane.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/point.js +100 -148
- package/dist/core/WeatherSystem/objects/rain/point.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/cloud.js +71 -104
- package/dist/core/WeatherSystem/objects/sky/cloud.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/index.js +66 -84
- package/dist/core/WeatherSystem/objects/sky/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/outline.js +25 -45
- package/dist/core/WeatherSystem/objects/sky/outline.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/cloud.js +74 -3
- package/dist/core/WeatherSystem/shaders/cloud.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/fog.js +103 -3
- package/dist/core/WeatherSystem/shaders/fog.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/rain.js +206 -7
- package/dist/core/WeatherSystem/shaders/rain.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/sky.js +87 -3
- package/dist/core/WeatherSystem/shaders/sky.js.map +1 -1
- package/dist/core/WeatherSystem/sky/index.js +104 -135
- package/dist/core/WeatherSystem/sky/index.js.map +1 -1
- package/dist/core/WeatherSystem/utils/constant.js +44 -38
- package/dist/core/WeatherSystem/utils/constant.js.map +1 -1
- package/dist/core/WeatherSystem/utils/math.js +18 -25
- package/dist/core/WeatherSystem/utils/math.js.map +1 -1
- package/dist/core/WeatherSystem/utils/type.js +1 -1
- package/dist/core/WeatherSystem/utils/type.js.map +1 -1
- package/dist/core/WeatherSystem/weather/index.js +96 -141
- package/dist/core/WeatherSystem/weather/index.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,32 +1,13 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
1
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
2
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
7
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
9
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
10
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
12
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
-
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
14
|
-
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
15
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
16
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
17
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
19
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
20
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
21
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22
3
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" ==
|
|
24
|
-
function _toPrimitive(t, r) { if ("object" !=
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
25
6
|
import { CanvasTexture, DoubleSide, Mesh, NearestFilter, Object3D, PlaneGeometry, ShaderMaterial, Vector2, use } from '@anov/3d-core';
|
|
26
7
|
import h from 'anov-heat-map';
|
|
27
8
|
import Supercluster from 'supercluster';
|
|
28
9
|
import { heightFragmentShader, heightVertexShader } from "./shader";
|
|
29
|
-
|
|
10
|
+
const defaultGradient = {
|
|
30
11
|
0.25: 'rgb(0,0,255)',
|
|
31
12
|
0.55: 'rgb(0,255,0)',
|
|
32
13
|
0.85: 'yellow',
|
|
@@ -36,475 +17,407 @@ var defaultGradient = {
|
|
|
36
17
|
/**
|
|
37
18
|
* 区域热力图
|
|
38
19
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
20
|
+
|
|
21
|
+
class HeatMap extends Object3D {
|
|
22
|
+
get defaultMax() {
|
|
23
|
+
return Math.max(...this.data.map(item => item.value));
|
|
24
|
+
}
|
|
25
|
+
get url() {
|
|
26
|
+
return this._url;
|
|
27
|
+
}
|
|
28
|
+
constructor(options) {
|
|
43
29
|
var _options$radius, _options$height, _options$isPixel;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
_defineProperty(
|
|
48
|
-
_defineProperty(
|
|
49
|
-
_defineProperty(
|
|
50
|
-
_defineProperty(
|
|
51
|
-
_defineProperty(
|
|
52
|
-
_defineProperty(
|
|
53
|
-
_defineProperty(
|
|
54
|
-
_defineProperty(
|
|
55
|
-
_defineProperty(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
_this._isPixel = (_options$isPixel = options.isPixel) !== null && _options$isPixel !== void 0 ? _options$isPixel : false;
|
|
62
|
-
_this._range = options.range;
|
|
30
|
+
super();
|
|
31
|
+
_defineProperty(this, "data", []);
|
|
32
|
+
_defineProperty(this, "_height", void 0);
|
|
33
|
+
_defineProperty(this, "_radius", void 0);
|
|
34
|
+
_defineProperty(this, "_heatmap", void 0);
|
|
35
|
+
_defineProperty(this, "_url", void 0);
|
|
36
|
+
_defineProperty(this, "_colorMap", void 0);
|
|
37
|
+
_defineProperty(this, "_isPixel", void 0);
|
|
38
|
+
_defineProperty(this, "_canvasBox", void 0);
|
|
39
|
+
_defineProperty(this, "_attachmentMesh", void 0);
|
|
40
|
+
_defineProperty(this, "_supercluster", void 0);
|
|
41
|
+
_defineProperty(this, "_range", void 0);
|
|
42
|
+
this._colorMap = options.colorMap || defaultGradient;
|
|
43
|
+
this._radius = (_options$radius = options.radius) !== null && _options$radius !== void 0 ? _options$radius : 40;
|
|
44
|
+
this._height = (_options$height = options.height) !== null && _options$height !== void 0 ? _options$height : 70;
|
|
45
|
+
this._isPixel = (_options$isPixel = options.isPixel) !== null && _options$isPixel !== void 0 ? _options$isPixel : false;
|
|
46
|
+
this._range = options.range;
|
|
63
47
|
|
|
64
48
|
// this.initSupercluster()
|
|
65
|
-
return _this;
|
|
66
49
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}, {
|
|
75
|
-
key: "url",
|
|
76
|
-
get: function get() {
|
|
77
|
-
return this._url;
|
|
78
|
-
}
|
|
79
|
-
}, {
|
|
80
|
-
key: "initSupercluster",
|
|
81
|
-
value: function initSupercluster() {
|
|
82
|
-
this._supercluster = new Supercluster({
|
|
83
|
-
radius: 40,
|
|
84
|
-
minZoom: 1,
|
|
85
|
-
maxZoom: 16
|
|
86
|
-
});
|
|
87
|
-
}
|
|
50
|
+
initSupercluster() {
|
|
51
|
+
this._supercluster = new Supercluster({
|
|
52
|
+
radius: 40,
|
|
53
|
+
minZoom: 1,
|
|
54
|
+
maxZoom: 16
|
|
55
|
+
});
|
|
56
|
+
}
|
|
88
57
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
this._supercluster.load(featuresPoints);
|
|
107
|
-
}
|
|
58
|
+
/**
|
|
59
|
+
* set supercluster data
|
|
60
|
+
*/
|
|
61
|
+
setSuperclusterData() {
|
|
62
|
+
const featuresPoints = this.data.map(item => {
|
|
63
|
+
return {
|
|
64
|
+
type: 'Feature',
|
|
65
|
+
properties: {},
|
|
66
|
+
geometry: {
|
|
67
|
+
type: 'Point',
|
|
68
|
+
coordinates: [item.x, item.z]
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
console.log('正在加载点数据到supercluster:', featuresPoints.length);
|
|
73
|
+
this._supercluster.load(featuresPoints);
|
|
74
|
+
}
|
|
108
75
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return Math.max(minZoom, Math.min(maxZoom, (maxHeight - camera.position.y) / (maxHeight - minHeight) * (maxZoom - minZoom) + minZoom));
|
|
122
|
-
}
|
|
76
|
+
/**
|
|
77
|
+
* get zoom level
|
|
78
|
+
* @param camera
|
|
79
|
+
* @returns
|
|
80
|
+
*/
|
|
81
|
+
getZoomLevel(camera) {
|
|
82
|
+
const minZoom = 10;
|
|
83
|
+
const maxZoom = 16;
|
|
84
|
+
const minHeight = 10;
|
|
85
|
+
const maxHeight = 1000;
|
|
86
|
+
return Math.max(minZoom, Math.min(maxZoom, (maxHeight - camera.position.y) / (maxHeight - minHeight) * (maxZoom - minZoom) + minZoom));
|
|
87
|
+
}
|
|
123
88
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
89
|
+
/**
|
|
90
|
+
* get supercluster data
|
|
91
|
+
* @returns
|
|
92
|
+
*/
|
|
93
|
+
getSuperclusterData() {
|
|
94
|
+
const {
|
|
95
|
+
max
|
|
96
|
+
} = this.calDataMaxMin();
|
|
97
|
+
const zoom = this.getZoomLevel(use.useScene().camera);
|
|
98
|
+
const clusters = this._supercluster.getClusters([-max, -max, max, max], zoom);
|
|
99
|
+
console.log('当前缩放级别:', zoom, '输入点数量:', this.data.length, '聚类后点数量:', clusters.length);
|
|
100
|
+
return clusters;
|
|
101
|
+
}
|
|
138
102
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
var
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
max: max,
|
|
173
|
-
minX: minX,
|
|
174
|
-
minZ: minZ,
|
|
175
|
-
maxX: maxX,
|
|
176
|
-
maxZ: maxZ,
|
|
177
|
-
realShowMax: realShowMax,
|
|
178
|
-
realShowWidth: realShowWidth,
|
|
179
|
-
realShowHeight: realShowHeight,
|
|
180
|
-
maxRadius: maxRadius
|
|
181
|
-
};
|
|
182
|
-
}
|
|
103
|
+
/**
|
|
104
|
+
* calculate data max and min
|
|
105
|
+
* @returns
|
|
106
|
+
*/
|
|
107
|
+
calDataMaxMin() {
|
|
108
|
+
const maxX = Math.max(...this.data.map(item => item.x));
|
|
109
|
+
const minX = Math.min(...this.data.map(item => item.x));
|
|
110
|
+
const maxZ = Math.max(...this.data.map(item => item.z));
|
|
111
|
+
const minZ = Math.min(...this.data.map(item => item.z));
|
|
112
|
+
const max = Math.max(Math.abs(Math.ceil(maxX)), Math.abs(Math.ceil(minX)), Math.abs(Math.ceil(maxZ)), Math.abs(Math.ceil(minZ)), 60);
|
|
113
|
+
const maxRadius = Math.max(...this.data.map(item => {
|
|
114
|
+
var _item$radius;
|
|
115
|
+
return (_item$radius = item.radius) !== null && _item$radius !== void 0 ? _item$radius : this._radius;
|
|
116
|
+
}), this._radius);
|
|
117
|
+
const width = max * 2;
|
|
118
|
+
const height = max * 2;
|
|
119
|
+
const realShowWidth = maxX - minX;
|
|
120
|
+
const realShowHeight = maxZ - minZ;
|
|
121
|
+
const realShowMax = Math.max(Math.ceil(realShowWidth), Math.ceil(realShowHeight), 60);
|
|
122
|
+
return {
|
|
123
|
+
width,
|
|
124
|
+
height,
|
|
125
|
+
max,
|
|
126
|
+
minX,
|
|
127
|
+
minZ,
|
|
128
|
+
maxX,
|
|
129
|
+
maxZ,
|
|
130
|
+
realShowMax,
|
|
131
|
+
realShowWidth,
|
|
132
|
+
realShowHeight,
|
|
133
|
+
maxRadius
|
|
134
|
+
};
|
|
135
|
+
}
|
|
183
136
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
z: maxZ + maxRadius,
|
|
232
|
-
value: 0,
|
|
233
|
-
y: 0,
|
|
234
|
-
isBoundary: true,
|
|
235
|
-
radius: 0.001
|
|
236
|
-
}];
|
|
237
|
-
return {
|
|
238
|
-
boundaryPoints: boundaryPoints,
|
|
239
|
-
maxRadius: maxRadius
|
|
240
|
-
};
|
|
241
|
-
}
|
|
137
|
+
/**
|
|
138
|
+
* generateAsitePoints
|
|
139
|
+
* @param data
|
|
140
|
+
*/
|
|
141
|
+
generateAsitePoints(data) {
|
|
142
|
+
const maxX = Math.max(...data.map(item => item.x));
|
|
143
|
+
const minX = Math.min(...data.map(item => item.x));
|
|
144
|
+
const maxZ = Math.max(...data.map(item => item.z));
|
|
145
|
+
const minZ = Math.min(...data.map(item => item.z));
|
|
146
|
+
const maxRadius = 2 * Math.max(...data.map(item => {
|
|
147
|
+
var _item$radius2;
|
|
148
|
+
return (_item$radius2 = item.radius) !== null && _item$radius2 !== void 0 ? _item$radius2 : this._radius;
|
|
149
|
+
}), this._radius);
|
|
150
|
+
const boundaryPoints = [{
|
|
151
|
+
x: minX - maxRadius,
|
|
152
|
+
z: minZ - maxRadius,
|
|
153
|
+
value: 0,
|
|
154
|
+
y: 0,
|
|
155
|
+
isBoundary: true,
|
|
156
|
+
radius: 0.001
|
|
157
|
+
}, {
|
|
158
|
+
x: maxX + maxRadius,
|
|
159
|
+
z: minZ - maxRadius,
|
|
160
|
+
value: 0,
|
|
161
|
+
y: 0,
|
|
162
|
+
isBoundary: true,
|
|
163
|
+
radius: 0.001
|
|
164
|
+
}, {
|
|
165
|
+
x: minX - maxRadius,
|
|
166
|
+
z: maxZ + maxRadius,
|
|
167
|
+
value: 0,
|
|
168
|
+
y: 0,
|
|
169
|
+
isBoundary: true,
|
|
170
|
+
radius: 0.001
|
|
171
|
+
}, {
|
|
172
|
+
x: maxX + maxRadius,
|
|
173
|
+
z: maxZ + maxRadius,
|
|
174
|
+
value: 0,
|
|
175
|
+
y: 0,
|
|
176
|
+
isBoundary: true,
|
|
177
|
+
radius: 0.001
|
|
178
|
+
}];
|
|
179
|
+
return {
|
|
180
|
+
boundaryPoints,
|
|
181
|
+
maxRadius
|
|
182
|
+
};
|
|
183
|
+
}
|
|
242
184
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
185
|
+
/**
|
|
186
|
+
* generate new origin
|
|
187
|
+
* @returns
|
|
188
|
+
*/
|
|
189
|
+
get newOrigin() {
|
|
190
|
+
// need to consider one point and multiple points
|
|
191
|
+
const {
|
|
192
|
+
minX,
|
|
193
|
+
minZ,
|
|
194
|
+
maxX,
|
|
195
|
+
maxZ
|
|
196
|
+
} = this.calDataMaxMin();
|
|
197
|
+
return {
|
|
198
|
+
x: (maxX + minX) / 2,
|
|
199
|
+
z: (maxZ + minZ) / 2
|
|
200
|
+
};
|
|
201
|
+
}
|
|
261
202
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
return
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
z: item.z - z,
|
|
279
|
-
radius: (_item$radius3 = item.radius) !== null && _item$radius3 !== void 0 ? _item$radius3 : _this4._radius
|
|
280
|
-
});
|
|
203
|
+
/**
|
|
204
|
+
* coordinate 3D transformation
|
|
205
|
+
* @param data
|
|
206
|
+
* @returns
|
|
207
|
+
*/
|
|
208
|
+
coordinate3DTransformation(data) {
|
|
209
|
+
const {
|
|
210
|
+
x,
|
|
211
|
+
z
|
|
212
|
+
} = this.newOrigin;
|
|
213
|
+
return data.map(item => {
|
|
214
|
+
var _item$radius3;
|
|
215
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
216
|
+
x: item.x - x,
|
|
217
|
+
z: item.z - z,
|
|
218
|
+
radius: (_item$radius3 = item.radius) !== null && _item$radius3 !== void 0 ? _item$radius3 : this._radius
|
|
281
219
|
});
|
|
282
|
-
}
|
|
220
|
+
});
|
|
221
|
+
}
|
|
283
222
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
var
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
};
|
|
310
|
-
});
|
|
223
|
+
/**
|
|
224
|
+
* coordinate transformation, to canvas coordinate
|
|
225
|
+
* @param data
|
|
226
|
+
* @returns
|
|
227
|
+
*/
|
|
228
|
+
coordinateTransformation(data) {
|
|
229
|
+
const hanldeData = this.coordinate3DTransformation(data);
|
|
230
|
+
const {
|
|
231
|
+
width,
|
|
232
|
+
height,
|
|
233
|
+
realShowWidth,
|
|
234
|
+
realShowHeight
|
|
235
|
+
} = this.calDataMaxMin();
|
|
236
|
+
const resolutionScale = this.calResolutionScale();
|
|
237
|
+
const result = hanldeData.map(item => {
|
|
238
|
+
var _item$radius4;
|
|
239
|
+
return {
|
|
240
|
+
x: Math.floor((item.x - -realShowWidth / 2) / (realShowWidth / 2 - -realShowWidth / 2) * width) * resolutionScale,
|
|
241
|
+
y: Math.floor((item.z - -realShowHeight / 2) / (realShowHeight / 2 - -realShowHeight / 2) * height) * resolutionScale,
|
|
242
|
+
value: item.value,
|
|
243
|
+
radius: ((_item$radius4 = item.radius) !== null && _item$radius4 !== void 0 ? _item$radius4 : this._radius) * resolutionScale * 2,
|
|
244
|
+
// @ts-ignore
|
|
245
|
+
isBoundary: item === null || item === void 0 ? void 0 : item.isBoundary
|
|
246
|
+
};
|
|
247
|
+
});
|
|
311
248
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
249
|
+
// console.log('原始', data, realShowWidth, realShowHeight)
|
|
250
|
+
// console.log('newOrigin', this.newOrigin)
|
|
251
|
+
// console.log('hanldeData', hanldeData)
|
|
252
|
+
// console.log('结果', result)
|
|
253
|
+
// console.log('resolutionScale', resolutionScale, realShowWidth, realShowHeight, realShowWidth * resolutionScale, realShowHeight * resolutionScale)
|
|
317
254
|
|
|
318
|
-
|
|
319
|
-
|
|
255
|
+
return result;
|
|
256
|
+
}
|
|
320
257
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
return heatmap;
|
|
337
|
-
}
|
|
258
|
+
/**
|
|
259
|
+
* generate heatmap texture
|
|
260
|
+
* @param canvasBox
|
|
261
|
+
* @returns
|
|
262
|
+
*/
|
|
263
|
+
createHeatmapTool() {
|
|
264
|
+
const heatmap = h.create({
|
|
265
|
+
container: this._canvasBox,
|
|
266
|
+
radius: this._radius,
|
|
267
|
+
gradient: this._colorMap,
|
|
268
|
+
maxOpacity: 1,
|
|
269
|
+
minOpacity: 0
|
|
270
|
+
});
|
|
271
|
+
return heatmap;
|
|
272
|
+
}
|
|
338
273
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
return canvasBox;
|
|
353
|
-
}
|
|
274
|
+
/**
|
|
275
|
+
* create heatmap container canvas
|
|
276
|
+
* @returns
|
|
277
|
+
*/
|
|
278
|
+
createCanvas(width, height) {
|
|
279
|
+
const canvasBox = document.createElement('div');
|
|
280
|
+
canvasBox.style.width = `${width}px`;
|
|
281
|
+
canvasBox.style.height = `${height}px`;
|
|
282
|
+
canvasBox.style.top = '0';
|
|
283
|
+
canvasBox.style.right = '0';
|
|
284
|
+
use.useScene().domElement.parentElement.appendChild(canvasBox);
|
|
285
|
+
return canvasBox;
|
|
286
|
+
}
|
|
354
287
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
})));
|
|
386
|
-
var max = Math.max(maxX, maxY);
|
|
387
|
-
if (max <= 1000) {
|
|
388
|
-
var scale = (1000 - max) / 1000 * 15 + 1;
|
|
389
|
-
return Math.floor(maxRadius < 40 ? scale : 1);
|
|
390
|
-
}
|
|
391
|
-
if (max <= 5000) {
|
|
392
|
-
var _scale = (5000 - max) / 5000 * 5 + 1;
|
|
393
|
-
return Math.floor(maxRadius < 40 ? _scale : 1);
|
|
394
|
-
}
|
|
395
|
-
return 1;
|
|
288
|
+
/**
|
|
289
|
+
* calculate resolution scale
|
|
290
|
+
* @param width
|
|
291
|
+
* @returns
|
|
292
|
+
*/
|
|
293
|
+
calResolutionScale() {
|
|
294
|
+
const hanldeData = this.coordinate3DTransformation(this.data);
|
|
295
|
+
const {
|
|
296
|
+
width,
|
|
297
|
+
height,
|
|
298
|
+
realShowWidth,
|
|
299
|
+
realShowHeight
|
|
300
|
+
} = this.calDataMaxMin();
|
|
301
|
+
const result = hanldeData.map(item => ({
|
|
302
|
+
x: Math.floor((item.x - -realShowWidth / 2) / (realShowWidth / 2 - -realShowWidth / 2) * width),
|
|
303
|
+
y: Math.floor((item.z - -realShowHeight / 2) / (realShowHeight / 2 - -realShowHeight / 2) * height),
|
|
304
|
+
value: item.value,
|
|
305
|
+
radius: item.radius * 2
|
|
306
|
+
}));
|
|
307
|
+
const maxRadius = Math.max(...result.map(item => item.radius));
|
|
308
|
+
const maxX = Math.max(...result.map(item => item.x));
|
|
309
|
+
const maxY = Math.max(...result.map(item => item.y));
|
|
310
|
+
const max = Math.max(maxX, maxY);
|
|
311
|
+
if (max <= 1000) {
|
|
312
|
+
const scale = (1000 - max) / 1000 * 15 + 1;
|
|
313
|
+
return Math.floor(maxRadius < 40 ? scale : 1);
|
|
314
|
+
}
|
|
315
|
+
if (max <= 5000) {
|
|
316
|
+
const scale = (5000 - max) / 5000 * 5 + 1;
|
|
317
|
+
return Math.floor(maxRadius < 40 ? scale : 1);
|
|
396
318
|
}
|
|
319
|
+
return 1;
|
|
320
|
+
}
|
|
397
321
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
value: texture
|
|
420
|
-
},
|
|
421
|
-
granularity: {
|
|
422
|
-
value: realShowMax / 3 < 300 ? 300 : realShowMax / 3
|
|
423
|
-
},
|
|
424
|
-
threshold: {
|
|
425
|
-
value: threshold > 0.6 ? 0.6 : threshold < 0.25 ? 0.25 : threshold
|
|
426
|
-
},
|
|
427
|
-
uOpacity: {
|
|
428
|
-
value: 2.0
|
|
429
|
-
},
|
|
430
|
-
uHeight: {
|
|
431
|
-
value: this._height
|
|
432
|
-
},
|
|
433
|
-
isPixel: {
|
|
434
|
-
value: this._isPixel
|
|
435
|
-
},
|
|
436
|
-
uRange: {
|
|
437
|
-
value: new Vector2(-max, max)
|
|
438
|
-
}
|
|
322
|
+
/**
|
|
323
|
+
* create attachment mesh
|
|
324
|
+
*/
|
|
325
|
+
createAttachmentMesh() {
|
|
326
|
+
if (this._attachmentMesh) this.remove(this._attachmentMesh);
|
|
327
|
+
const {
|
|
328
|
+
realShowMax,
|
|
329
|
+
max,
|
|
330
|
+
realShowWidth,
|
|
331
|
+
realShowHeight
|
|
332
|
+
} = this.calDataMaxMin();
|
|
333
|
+
const canvas = this._heatmap._renderer.canvas;
|
|
334
|
+
const texture = new CanvasTexture(canvas);
|
|
335
|
+
texture.minFilter = NearestFilter;
|
|
336
|
+
texture.magFilter = NearestFilter;
|
|
337
|
+
this._url = canvas.toDataURL('image/png');
|
|
338
|
+
const threshold = 0.3 / 1000 * realShowMax;
|
|
339
|
+
const shaderMaterial = new ShaderMaterial({
|
|
340
|
+
uniforms: {
|
|
341
|
+
map: {
|
|
342
|
+
value: texture
|
|
439
343
|
},
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
344
|
+
granularity: {
|
|
345
|
+
value: realShowMax / 3 < 300 ? 300 : realShowMax / 3
|
|
346
|
+
},
|
|
347
|
+
threshold: {
|
|
348
|
+
value: threshold > 0.6 ? 0.6 : threshold < 0.25 ? 0.25 : threshold
|
|
349
|
+
},
|
|
350
|
+
uOpacity: {
|
|
351
|
+
value: 2.0
|
|
352
|
+
},
|
|
353
|
+
uHeight: {
|
|
354
|
+
value: this._height
|
|
355
|
+
},
|
|
356
|
+
isPixel: {
|
|
357
|
+
value: this._isPixel
|
|
358
|
+
},
|
|
359
|
+
uRange: {
|
|
360
|
+
value: new Vector2(-max, max)
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
vertexShader: heightVertexShader,
|
|
364
|
+
fragmentShader: heightFragmentShader,
|
|
365
|
+
transparent: true,
|
|
366
|
+
side: DoubleSide,
|
|
367
|
+
depthTest: false
|
|
368
|
+
});
|
|
369
|
+
const mesh = new Mesh(new PlaneGeometry(realShowWidth, realShowHeight, 500, 500), shaderMaterial);
|
|
370
|
+
const {
|
|
371
|
+
x,
|
|
372
|
+
z
|
|
373
|
+
} = this.newOrigin;
|
|
374
|
+
mesh.rotation.x = -Math.PI / 2;
|
|
375
|
+
mesh.position.set(x, 0, z);
|
|
376
|
+
mesh.renderOrder = 1000;
|
|
377
|
+
this._attachmentMesh = mesh;
|
|
378
|
+
this.add(mesh);
|
|
379
|
+
}
|
|
456
380
|
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
data: heatmapData.filter(function (item) {
|
|
478
|
-
return !item.isBoundary;
|
|
479
|
-
}),
|
|
480
|
-
max: (_this$_range$max = (_this$_range = this._range) === null || _this$_range === void 0 ? void 0 : _this$_range.max) !== null && _this$_range$max !== void 0 ? _this$_range$max : this.defaultMax,
|
|
481
|
-
min: (_this$_range$min = (_this$_range2 = this._range) === null || _this$_range2 === void 0 ? void 0 : _this$_range2.min) !== null && _this$_range$min !== void 0 ? _this$_range$min : 0
|
|
482
|
-
});
|
|
483
|
-
this.createAttachmentMesh();
|
|
381
|
+
/**
|
|
382
|
+
* set heatmap data
|
|
383
|
+
* @param data
|
|
384
|
+
*/
|
|
385
|
+
setData(data) {
|
|
386
|
+
var _this$_range$max, _this$_range, _this$_range$min, _this$_range2;
|
|
387
|
+
const {
|
|
388
|
+
boundaryPoints
|
|
389
|
+
} = this.generateAsitePoints(data);
|
|
390
|
+
this.data = [...boundaryPoints, ...data];
|
|
391
|
+
const heatmapData = this.coordinateTransformation(this.data);
|
|
392
|
+
this._canvasBox && use.useScene().domElement.parentElement.removeChild(this._canvasBox);
|
|
393
|
+
this._canvasBox = this.createCanvas(Math.max(...heatmapData.map(item => item.x)), Math.max(...heatmapData.map(item => item.y)));
|
|
394
|
+
this._heatmap = this.createHeatmapTool();
|
|
395
|
+
this._heatmap.setData({
|
|
396
|
+
data: heatmapData.filter(item => !item.isBoundary),
|
|
397
|
+
max: (_this$_range$max = (_this$_range = this._range) === null || _this$_range === void 0 ? void 0 : _this$_range.max) !== null && _this$_range$max !== void 0 ? _this$_range$max : this.defaultMax,
|
|
398
|
+
min: (_this$_range$min = (_this$_range2 = this._range) === null || _this$_range2 === void 0 ? void 0 : _this$_range2.min) !== null && _this$_range$min !== void 0 ? _this$_range$min : 0
|
|
399
|
+
});
|
|
400
|
+
this.createAttachmentMesh();
|
|
484
401
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
var _this$_attachmentMesh;
|
|
499
|
-
use.useScene().domElement.parentElement.removeChild(this._canvasBox);
|
|
402
|
+
// 聚类暂时不实现
|
|
403
|
+
// this.setSuperclusterData()
|
|
404
|
+
// use.useScene().orbitControls.addEventListener('change', () => {
|
|
405
|
+
// const clusters = this.getSuperclusterData()
|
|
406
|
+
// console.log(clusters)
|
|
407
|
+
// })
|
|
408
|
+
}
|
|
409
|
+
removeFromParent() {
|
|
410
|
+
super.removeFromParent();
|
|
411
|
+
// todo: 升级three.js后,父对象变化,会触发此函数,重组内部引起关系
|
|
412
|
+
if (this.parent) {
|
|
413
|
+
var _this$_attachmentMesh;
|
|
414
|
+
use.useScene().domElement.parentElement.removeChild(this._canvasBox);
|
|
500
415
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
}
|
|
504
|
-
return this;
|
|
416
|
+
// @ts-ignore
|
|
417
|
+
(_this$_attachmentMesh = this._attachmentMesh) === null || _this$_attachmentMesh === void 0 || _this$_attachmentMesh.material.dispose();
|
|
505
418
|
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
}
|
|
419
|
+
return this;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
509
422
|
export default HeatMap;
|
|
510
423
|
//# sourceMappingURL=HeatMap.js.map
|