@hpcc-js/map 3.5.1 → 3.5.4
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/LICENSE +43 -43
- package/README.md +88 -88
- package/TopoJSON/BR.json +122 -122
- package/TopoJSON/GB_idx.json +1 -1
- package/TopoJSON/IE_idx.json +1 -1
- package/TopoJSON/ND_idx.json +1 -1
- package/TopoJSON/countries.json +257 -257
- package/TopoJSON/us-counties.json +16550 -16550
- package/TopoJSON/us-states.json +458 -458
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +9 -9
- package/src/CanvasPinLayer.ts +99 -99
- package/src/CanvasPins.ts +397 -397
- package/src/Choropleth.css +26 -26
- package/src/Choropleth.ts +203 -203
- package/src/ChoroplethContinents.ts +13 -13
- package/src/ChoroplethCounties.ts +111 -111
- package/src/ChoroplethCountries.ts +100 -100
- package/src/ChoroplethStates.ts +103 -103
- package/src/ChoroplethStatesHeat.ts +8 -8
- package/src/GMap.css +20 -20
- package/src/GMap.ts +880 -880
- package/src/GMapCounties.ts +93 -93
- package/src/GMapGraph.ts +61 -61
- package/src/GMapHeat.ts +27 -27
- package/src/GMapLayered.ts +94 -94
- package/src/GMapPin.ts +115 -115
- package/src/GMapPinLine.ts +138 -138
- package/src/GeoHash.css +14 -14
- package/src/GeoHash.ts +139 -139
- package/src/Graph.css +9 -9
- package/src/Graph.ts +98 -98
- package/src/Graticule.css +12 -12
- package/src/Graticule.ts +97 -97
- package/src/Heat.ts +87 -87
- package/src/IChoropleth.ts +8 -8
- package/src/Layer.ts +99 -99
- package/src/Layered.css +18 -18
- package/src/Layered.ts +206 -206
- package/src/Lines.css +8 -8
- package/src/Lines.ts +78 -78
- package/src/OpenStreet.css +15 -15
- package/src/OpenStreet.ts +126 -126
- package/src/Pins.css +17 -17
- package/src/Pins.ts +350 -350
- package/src/Projection.ts +42 -42
- package/src/TestHeatMap.ts +8 -8
- package/src/TopoJSONChoropleth.ts +125 -125
- package/src/Utility.ts +484 -484
- package/src/__package__.ts +3 -3
- package/src/index.ts +33 -33
- package/src/leaflet/AlbersPR.ts +48 -48
- package/src/leaflet/Blank.ts +9 -9
- package/src/leaflet/Circles.ts +139 -139
- package/src/leaflet/ClusterCircles.css +26 -26
- package/src/leaflet/ClusterCircles.ts +88 -88
- package/src/leaflet/Countries.ts +43 -43
- package/src/leaflet/DrawLayer.ts +167 -167
- package/src/leaflet/FeatureLayer.ts +138 -138
- package/src/leaflet/GMap.ts +44 -44
- package/src/leaflet/HeatLayer.ts +77 -77
- package/src/leaflet/Icons.ts +60 -60
- package/src/leaflet/Leaflet.css +3 -3
- package/src/leaflet/Leaflet.ts +239 -239
- package/src/leaflet/MapBox.ts +35 -35
- package/src/leaflet/Markers.ts +109 -109
- package/src/leaflet/OpenStreet.ts +27 -27
- package/src/leaflet/Path.ts +138 -138
- package/src/leaflet/Pins.ts +73 -73
- package/src/leaflet/Polygons.ts +113 -113
- package/src/leaflet/Region.ts +138 -138
- package/src/leaflet/Text.ts +99 -99
- package/src/leaflet/TileLayer.ts +81 -81
- package/src/leaflet/TopoJSON.ts +146 -146
- package/src/leaflet/US.ts +15 -15
- package/src/leaflet/USCounties.ts +43 -43
- package/src/leaflet/USStates.ts +41 -41
- package/src/leaflet/World.css +3 -3
- package/src/leaflet/World.ts +172 -172
- package/src/leaflet/index.ts +18 -18
- package/src/leaflet/leaflet-shim.ts +18 -18
- package/src/leaflet/plugins/BeautifyIcon.css +44 -44
- package/src/leaflet/plugins/BeautifyIcon.ts +190 -190
- package/src/leaflet/plugins/BeutifyIcon.licence +20 -20
- package/src/leaflet/plugins/D3SvgOverlay.css +2 -2
- package/src/leaflet/plugins/D3SvgOverlay.licence +20 -20
- package/src/leaflet/plugins/D3SvgOverlay.ts +175 -175
- package/src/leaflet/plugins/HeatLayer.license +21 -21
- package/src/leaflet/plugins/HeatLayer.ts +224 -224
- package/src/leaflet/plugins/Leaflet.GoogleMutant.ts +424 -424
- package/src/leaflet/plugins/lru_map.ts +352 -352
- package/src/test.ts +114 -114
- package/types/Layered.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hpcc-js/map",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.4",
|
|
4
4
|
"description": "hpcc-js - Viz Map",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.umd.cjs",
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
"update-major": "npx --yes npm-check-updates -u"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@hpcc-js/api": "^3.4.
|
|
43
|
-
"@hpcc-js/common": "^3.7.
|
|
44
|
-
"@hpcc-js/graph": "^3.7.
|
|
45
|
-
"@hpcc-js/layout": "^3.5.
|
|
46
|
-
"@hpcc-js/other": "^3.5.
|
|
47
|
-
"@hpcc-js/util": "^3.5.
|
|
42
|
+
"@hpcc-js/api": "^3.4.15",
|
|
43
|
+
"@hpcc-js/common": "^3.7.5",
|
|
44
|
+
"@hpcc-js/graph": "^3.7.4",
|
|
45
|
+
"@hpcc-js/layout": "^3.5.10",
|
|
46
|
+
"@hpcc-js/other": "^3.5.4",
|
|
47
|
+
"@hpcc-js/util": "^3.5.4"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@hpcc-js/esbuild-plugins": "^1.8.
|
|
50
|
+
"@hpcc-js/esbuild-plugins": "^1.8.7",
|
|
51
51
|
"@types/leaflet-draw": "1.0.13",
|
|
52
52
|
"@types/leaflet.heat": "0.2.5",
|
|
53
53
|
"@types/leaflet.markercluster": "1.5.6",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"url": "https://github.com/hpcc-systems/Visualization/issues"
|
|
78
78
|
},
|
|
79
79
|
"homepage": "https://github.com/hpcc-systems/Visualization",
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "f8bdd58fc6914054a2313a87bbe1257dc9720545"
|
|
81
81
|
}
|
package/src/CanvasPinLayer.ts
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
import { CanvasPins } from "./CanvasPins.ts";
|
|
2
|
-
import { Layer } from "./Layer.ts";
|
|
3
|
-
|
|
4
|
-
export class CanvasPinLayer extends Layer {
|
|
5
|
-
_pinsTransform;
|
|
6
|
-
pins;
|
|
7
|
-
_prevProjection;
|
|
8
|
-
|
|
9
|
-
constructor() {
|
|
10
|
-
super();
|
|
11
|
-
this.pins = new CanvasPins();
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
layerEnter(base, svgElement, domElement) {
|
|
15
|
-
Layer.prototype.layerEnter.apply(this, arguments);
|
|
16
|
-
this._parentOverlay.style("pointer-events", "none");
|
|
17
|
-
this._pinsTransform = domElement
|
|
18
|
-
.style("pointer-events", "none")
|
|
19
|
-
.append("div")
|
|
20
|
-
.attr("class", this.classID())
|
|
21
|
-
.style("width", base.width() + "px")
|
|
22
|
-
.style("height", base.height() + "px")
|
|
23
|
-
;
|
|
24
|
-
this.pins.target(this._pinsTransform.node());
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
layerUpdate(base) {
|
|
28
|
-
Layer.prototype.layerUpdate.apply(this, arguments);
|
|
29
|
-
|
|
30
|
-
this._pinsTransform
|
|
31
|
-
.style("opacity", this.opacity())
|
|
32
|
-
.style("width", base.width() + "px")
|
|
33
|
-
.style("height", base.height() + "px")
|
|
34
|
-
;
|
|
35
|
-
this.pins.resize(base.size());
|
|
36
|
-
this.layerZoomed(base);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
layerExit(base) {
|
|
40
|
-
delete this._prevProjection;
|
|
41
|
-
this.pins.target(null);
|
|
42
|
-
delete this.pins;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
layerZoomed(base) {
|
|
46
|
-
Layer.prototype.layerZoomed.apply(this, arguments);
|
|
47
|
-
const latField = this._db.fieldByLabel(this.latColumn());
|
|
48
|
-
const longField = this._db.fieldByLabel(this.longColumn());
|
|
49
|
-
const weightField = this._db.fieldByLabel(this.weightColumn());
|
|
50
|
-
this.pins
|
|
51
|
-
.columns(this.columns())
|
|
52
|
-
.data(this.visible() ? this.data().map(function (row) {
|
|
53
|
-
const lat = latField ? row[latField.idx] : row[0];
|
|
54
|
-
const long = longField ? row[longField.idx] : row[1];
|
|
55
|
-
const weight = weightField ? row[weightField.idx] : 1;
|
|
56
|
-
const transform = base.zoomTranslate();
|
|
57
|
-
const pos = base.project(lat, long);
|
|
58
|
-
const scale = base.zoomScale();
|
|
59
|
-
pos[0] *= scale;
|
|
60
|
-
pos[1] *= scale;
|
|
61
|
-
return [transform[0] + pos[0], transform[1] + pos[1], weight];
|
|
62
|
-
}) : [])
|
|
63
|
-
.render()
|
|
64
|
-
;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
CanvasPinLayer.prototype._class += " map_CanvasPinLayer";
|
|
68
|
-
|
|
69
|
-
export interface CanvasPinLayer {
|
|
70
|
-
latColumn(): string;
|
|
71
|
-
latColumn(_: string): CanvasPinLayer;
|
|
72
|
-
longColumn(): string;
|
|
73
|
-
longColumn(_: string): CanvasPinLayer;
|
|
74
|
-
weightColumn(): string;
|
|
75
|
-
weightColumn(_: string): CanvasPinLayer;
|
|
76
|
-
opacity(): number;
|
|
77
|
-
opacity(_: number): CanvasPinLayer;
|
|
78
|
-
opacity_exists(): boolean;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
CanvasPinLayer.prototype.publishProxy("clusterMode", "pins", "clusterMode");
|
|
82
|
-
CanvasPinLayer.prototype.publishProxy("allCircles", "pins", "allCircles");
|
|
83
|
-
CanvasPinLayer.prototype.publishProxy("showQuadtree", "pins", "showQuadtree");
|
|
84
|
-
CanvasPinLayer.prototype.publishProxy("useAveragePos", "pins", "useAveragePos");
|
|
85
|
-
CanvasPinLayer.prototype.publishProxy("shrinkFontToPin", "pins", "shrinkFontToPin");
|
|
86
|
-
CanvasPinLayer.prototype.publishProxy("enableClustering", "pins", "enableClustering");
|
|
87
|
-
CanvasPinLayer.prototype.publishProxy("useWeightedRadius", "pins", "useWeightedRadius");
|
|
88
|
-
CanvasPinLayer.prototype.publishProxy("radiusWeightMult", "pins", "radiusWeightMult");
|
|
89
|
-
CanvasPinLayer.prototype.publishProxy("searchRectMult", "pins", "searchRectMult");
|
|
90
|
-
CanvasPinLayer.prototype.publishProxy("pinHeight", "pins", "pinHeight");
|
|
91
|
-
CanvasPinLayer.prototype.publishProxy("pinWidth", "pins", "pinWidth");
|
|
92
|
-
CanvasPinLayer.prototype.publishProxy("pinFontFamily", "pins", "pinFontFamily");
|
|
93
|
-
CanvasPinLayer.prototype.publishProxy("pinFontSize", "pins", "pinFontSize");
|
|
94
|
-
CanvasPinLayer.prototype.publishProxy("arrowHeight", "pins", "arrowHeight");
|
|
95
|
-
CanvasPinLayer.prototype.publishProxy("arrowWidth", "pins", "arrowWidth");
|
|
96
|
-
CanvasPinLayer.prototype.publish("latColumn", null, "set", "latColumn", function () { return this.columns(); }, { optional: true });
|
|
97
|
-
CanvasPinLayer.prototype.publish("longColumn", null, "set", "longColumn", function () { return this.columns(); }, { optional: true });
|
|
98
|
-
CanvasPinLayer.prototype.publish("weightColumn", null, "set", "weightColumn", function () { return this.columns(); }, { optional: true });
|
|
99
|
-
CanvasPinLayer.prototype.publish("opacity", 1.0, "number", "Opacity", null, { tags: ["Advanced"] });
|
|
1
|
+
import { CanvasPins } from "./CanvasPins.ts";
|
|
2
|
+
import { Layer } from "./Layer.ts";
|
|
3
|
+
|
|
4
|
+
export class CanvasPinLayer extends Layer {
|
|
5
|
+
_pinsTransform;
|
|
6
|
+
pins;
|
|
7
|
+
_prevProjection;
|
|
8
|
+
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.pins = new CanvasPins();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
layerEnter(base, svgElement, domElement) {
|
|
15
|
+
Layer.prototype.layerEnter.apply(this, arguments);
|
|
16
|
+
this._parentOverlay.style("pointer-events", "none");
|
|
17
|
+
this._pinsTransform = domElement
|
|
18
|
+
.style("pointer-events", "none")
|
|
19
|
+
.append("div")
|
|
20
|
+
.attr("class", this.classID())
|
|
21
|
+
.style("width", base.width() + "px")
|
|
22
|
+
.style("height", base.height() + "px")
|
|
23
|
+
;
|
|
24
|
+
this.pins.target(this._pinsTransform.node());
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
layerUpdate(base) {
|
|
28
|
+
Layer.prototype.layerUpdate.apply(this, arguments);
|
|
29
|
+
|
|
30
|
+
this._pinsTransform
|
|
31
|
+
.style("opacity", this.opacity())
|
|
32
|
+
.style("width", base.width() + "px")
|
|
33
|
+
.style("height", base.height() + "px")
|
|
34
|
+
;
|
|
35
|
+
this.pins.resize(base.size());
|
|
36
|
+
this.layerZoomed(base);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
layerExit(base) {
|
|
40
|
+
delete this._prevProjection;
|
|
41
|
+
this.pins.target(null);
|
|
42
|
+
delete this.pins;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
layerZoomed(base) {
|
|
46
|
+
Layer.prototype.layerZoomed.apply(this, arguments);
|
|
47
|
+
const latField = this._db.fieldByLabel(this.latColumn());
|
|
48
|
+
const longField = this._db.fieldByLabel(this.longColumn());
|
|
49
|
+
const weightField = this._db.fieldByLabel(this.weightColumn());
|
|
50
|
+
this.pins
|
|
51
|
+
.columns(this.columns())
|
|
52
|
+
.data(this.visible() ? this.data().map(function (row) {
|
|
53
|
+
const lat = latField ? row[latField.idx] : row[0];
|
|
54
|
+
const long = longField ? row[longField.idx] : row[1];
|
|
55
|
+
const weight = weightField ? row[weightField.idx] : 1;
|
|
56
|
+
const transform = base.zoomTranslate();
|
|
57
|
+
const pos = base.project(lat, long);
|
|
58
|
+
const scale = base.zoomScale();
|
|
59
|
+
pos[0] *= scale;
|
|
60
|
+
pos[1] *= scale;
|
|
61
|
+
return [transform[0] + pos[0], transform[1] + pos[1], weight];
|
|
62
|
+
}) : [])
|
|
63
|
+
.render()
|
|
64
|
+
;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
CanvasPinLayer.prototype._class += " map_CanvasPinLayer";
|
|
68
|
+
|
|
69
|
+
export interface CanvasPinLayer {
|
|
70
|
+
latColumn(): string;
|
|
71
|
+
latColumn(_: string): CanvasPinLayer;
|
|
72
|
+
longColumn(): string;
|
|
73
|
+
longColumn(_: string): CanvasPinLayer;
|
|
74
|
+
weightColumn(): string;
|
|
75
|
+
weightColumn(_: string): CanvasPinLayer;
|
|
76
|
+
opacity(): number;
|
|
77
|
+
opacity(_: number): CanvasPinLayer;
|
|
78
|
+
opacity_exists(): boolean;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
CanvasPinLayer.prototype.publishProxy("clusterMode", "pins", "clusterMode");
|
|
82
|
+
CanvasPinLayer.prototype.publishProxy("allCircles", "pins", "allCircles");
|
|
83
|
+
CanvasPinLayer.prototype.publishProxy("showQuadtree", "pins", "showQuadtree");
|
|
84
|
+
CanvasPinLayer.prototype.publishProxy("useAveragePos", "pins", "useAveragePos");
|
|
85
|
+
CanvasPinLayer.prototype.publishProxy("shrinkFontToPin", "pins", "shrinkFontToPin");
|
|
86
|
+
CanvasPinLayer.prototype.publishProxy("enableClustering", "pins", "enableClustering");
|
|
87
|
+
CanvasPinLayer.prototype.publishProxy("useWeightedRadius", "pins", "useWeightedRadius");
|
|
88
|
+
CanvasPinLayer.prototype.publishProxy("radiusWeightMult", "pins", "radiusWeightMult");
|
|
89
|
+
CanvasPinLayer.prototype.publishProxy("searchRectMult", "pins", "searchRectMult");
|
|
90
|
+
CanvasPinLayer.prototype.publishProxy("pinHeight", "pins", "pinHeight");
|
|
91
|
+
CanvasPinLayer.prototype.publishProxy("pinWidth", "pins", "pinWidth");
|
|
92
|
+
CanvasPinLayer.prototype.publishProxy("pinFontFamily", "pins", "pinFontFamily");
|
|
93
|
+
CanvasPinLayer.prototype.publishProxy("pinFontSize", "pins", "pinFontSize");
|
|
94
|
+
CanvasPinLayer.prototype.publishProxy("arrowHeight", "pins", "arrowHeight");
|
|
95
|
+
CanvasPinLayer.prototype.publishProxy("arrowWidth", "pins", "arrowWidth");
|
|
96
|
+
CanvasPinLayer.prototype.publish("latColumn", null, "set", "latColumn", function () { return this.columns(); }, { optional: true });
|
|
97
|
+
CanvasPinLayer.prototype.publish("longColumn", null, "set", "longColumn", function () { return this.columns(); }, { optional: true });
|
|
98
|
+
CanvasPinLayer.prototype.publish("weightColumn", null, "set", "weightColumn", function () { return this.columns(); }, { optional: true });
|
|
99
|
+
CanvasPinLayer.prototype.publish("opacity", 1.0, "number", "Opacity", null, { tags: ["Advanced"] });
|