Skip to content

Commit

Permalink
Merge pull request #4293 from GordonSmith/V3_MAP
Browse files Browse the repository at this point in the history
feat: Upgrade map to v3
  • Loading branch information
GordonSmith authored Nov 13, 2024
2 parents 3e146cd + 87da3c6 commit 962c56a
Show file tree
Hide file tree
Showing 69 changed files with 373,183 additions and 1,000 deletions.
1,214 changes: 780 additions & 434 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"packages/graph",
"packages/html",
"packages/layout",
"xpackages/leaflet-shim",
"packages/leaflet-shim",
"xpackages/loader",
"xpackages/map",
"packages/map",
"xpackages/map-deck",
"packages/markdown-it-plugins",
"xpackages/marshaller",
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/SVGZoomWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ export class SVGZoomWidget extends SVGWidget {
.attr("class", "zoomBackground")
.attr("width", this.width())
.attr("height", this.height())
.style("fill", "transparent")
.on("mousedown", () => {
if (d3Event.shiftKey && this.mouseMode() === "zoom") {
d3Event.stopPropagation();
Expand Down
10 changes: 8 additions & 2 deletions packages/leaflet-shim/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "2.5.0",
"description": "hpcc-js - leaflet shim",
"main": "dist/index.js",
"module": "dist/index.js",
"unpkg": "dist/index.min.js",
"jsdelivr": "dist/index.min.js",
"types": "types/index.d.ts",
Expand Down Expand Up @@ -41,13 +42,18 @@
"@types/leaflet-draw": "1.0.11",
"@types/leaflet.heat": "0.2.4",
"@types/leaflet.markercluster": "1.5.4",
"css-loader": "7.1.2",
"d3-geo": "^1",
"d3-selection": "^1",
"leaflet-draw": "1.0.4",
"leaflet.heat": "0.2.0",
"leaflet.markercluster": "1.5.3",
"simpleheat": "0.4.0",
"tslib": "2.6.3"
"style-loader": "4.0.0",
"tslib": "2.6.3",
"url-loader": "4.1.1",
"webpack": "5.95.0",
"webpack-cli": "5.1.4"
},
"repository": {
"type": "git",
Expand All @@ -60,4 +66,4 @@
"url": "https://github.com/hpcc-systems/Visualization/issues"
},
"homepage": "https://github.com/hpcc-systems/Visualization"
}
}
4 changes: 2 additions & 2 deletions packages/leaflet-shim/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import "leaflet.markercluster/dist/MarkerCluster.css";
import "leaflet.markercluster/dist/MarkerCluster.Default.css";

export * from "./plugins/Leaflet.GoogleMutant";
export * from "./plugins/BeautifyIcon";
export { BeautifyIcon } from "./plugins/BeautifyIcon";
export * from "./plugins/D3SvgOverlay";
export * from "./plugins/HeatLayer";
export { HeatLayer as LHeatLayer } from "./plugins/HeatLayer";

export type MarkerClusterGroup = L.MarkerClusterGroup;
export const MarkerClusterGroup = L.MarkerClusterGroup;
Expand Down
3 changes: 2 additions & 1 deletion packages/leaflet-shim/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ module.exports = {
test: /\.min\.js$/
})
]
}
},
devtool: "source-map"
};
51 changes: 31 additions & 20 deletions packages/map/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,46 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "index.html",
"type": "chrome",
"name": "test-browser",
"type": "msedge",
"request": "launch",
"url": "file:///${workspaceRoot}/index.html",
"runtimeArgs": [
"--disable-web-security"
"url": "http://localhost:8888",
"webRoot": "${workspaceFolder}",
"outFiles": [
"${workspaceFolder}/**/*.js",
"!**/node_modules/**"
],
"webRoot": "${workspaceRoot}"
},
{
"name": "Mocha Tests",
"type": "pwa-node",
"name": "test-node",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/../../node_modules/mocha/bin/_mocha",
"args": [
"-u",
"tdd",
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/lib-umd/__tests__"
"runtimeArgs": [
"run-script",
"test-node"
],
"internalConsoleOptions": "openOnSessionStart",
"runtimeExecutable": "npm",
"skipFiles": [
"<node_internals>/**"
],
"outFiles": [
"${workspaceFolder}/**/*.js",
"!**/node_modules/**"
],
},
{
"name": "index.html",
"request": "launch",
"type": "msedge",
"url": "file:///${workspaceFolder}/index.html",
"runtimeArgs": [
"--disable-web-security"
],
"webRoot": "${workspaceFolder}",
"outFiles": [
"${workspaceFolder}/**/*.js",
"!**/node_modules/**"
]
}
]
Expand Down
25 changes: 6 additions & 19 deletions packages/map/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"version": "2.0.0",
"tasks": [
{
"label": "es6 watch",
"label": "gen-types-watch",
"type": "npm",
"script": "compile-es6-watch",
"script": "gen-types-watch",
"problemMatcher": [
"$tsc-watch"
],
Expand All @@ -13,18 +13,7 @@
}
},
{
"label": "umd watch",
"type": "npm",
"script": "compile-umd-watch",
"problemMatcher": [
"$tsc-watch"
],
"presentation": {
"group": "group-build"
}
},
{
"label": "bundle watch",
"label": "bundle-watch",
"type": "npm",
"script": "bundle-watch",
"problemMatcher": [],
Expand All @@ -35,15 +24,13 @@
{
"label": "build",
"dependsOn": [
"es6 watch",
"umd watch",
"bundle watch"
"gen-types-watch",
"bundle-watch",
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
}
}
]
}
29 changes: 29 additions & 0 deletions packages/map/esbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { browserTpl } from "@hpcc-js/esbuild-plugins";
import pkg from "./package.json" with { type: "json" };

// config ---
await Promise.all([
browserTpl("src/index.ts", "dist/index", {
keepNames: true,
alias: {
"d3-array": "@hpcc-js/common",
"d3-brush": "@hpcc-js/common",
"d3-collection": "@hpcc-js/common",
"d3-color": "@hpcc-js/common",
"d3-dispatch": "@hpcc-js/common",
"d3-drag": "@hpcc-js/common",
"d3-dsv": "@hpcc-js/common",
"d3-ease": "@hpcc-js/common",
"d3-format": "@hpcc-js/common",
"d3-interpolate": "@hpcc-js/common",
"d3-scale": "@hpcc-js/common",
"d3-selection": "@hpcc-js/common",
"d3-time-format": "@hpcc-js/common",
"d3-transition": "@hpcc-js/common",
"d3-zoom": "@hpcc-js/common"
},
external: [
...Object.keys(pkg.dependencies),
]
})
]);
147 changes: 108 additions & 39 deletions packages/map/index.html

Large diffs are not rendered by default.

74 changes: 35 additions & 39 deletions packages/map/package.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,51 @@
{
"name": "@hpcc-js/map",
"version": "2.79.0",
"version": "3.0.0",
"description": "hpcc-js - Viz Map",
"main": "dist/index.js",
"module": "dist/index.es6",
"unpkg": "dist/index.min.js",
"jsdelivr": "dist/index.min.js",
"types": "types/index.d.ts",
"typesVersions": {
"<3.8": {
"*": [
"types-3.4/index.d.ts"
]
}
"type": "module",
"exports": {
".": {
"types": "./types/index.d.ts",
"default": "./dist/index.js"
},
"./dist/*": "./dist/*"
},
"module": "./dist/index.js",
"browser": "./dist/index.js",
"types": "./types/index.d.ts",
"files": [
"dist/*",
"types/*",
"types-3.4/*",
"TopoJSON/*",
"src/*"
"src/*",
"types/*"
],
"scripts": {
"clean": "rimraf --glob lib* types dist *.tsbuildinfo",
"compile-es6": "tsc --module es6 --outDir ./lib-es6",
"compile-es6-watch": "npm run compile-es6 -- -w",
"compile-umd": "tsc --module umd --outDir ./lib-umd",
"compile-umd-watch": "npm run compile-umd -- -w",
"bundle": "rollup -c",
"bundle-watch": "npm run bundle -- -w",
"minimize": "terser dist/index.js -c -m --source-map \"content='dist/index.js.map',url='index.min.js.map'\" -o dist/index.min.js",
"gen-legacy-types": "downlevel-dts ./types ./types-3.4",
"build": "npm run compile-es6 && npm run bundle",
"watch": "npm-run-all compile-es6 -p compile-es6-watch bundle-watch",
"clean": "rimraf --glob lib* types dist *.tsbuildinfo .turbo",
"bundle": "node esbuild.js",
"bundle-watch": "npm run bundle -- --development --watch",
"gen-types": "tsc --project tsconfig.json",
"gen-types-watch": "npm run gen-types -- --watch",
"build": "run-p gen-types bundle",
"stamp": "node ../../node_modules/@hpcc-js/bundle/src/stamp.js",
"lint": "eslint ./src",
"lint-fix": "eslint --fix src/**/*.ts",
"docs": "typedoc --options tdoptions.json .",
"update": "npx --yes npm-check-updates -u -t minor"
"test-browser": "vitest run --project browser",
"test": "vitest run",
"coverage": "vitest run --coverage",
"update": "npx --yes npm-check-updates -u -t minor",
"update-major": "npx --yes npm-check-updates -u"
},
"dependencies": {
"@hpcc-js/api": "^2.14.0",
"@hpcc-js/common": "^2.73.0",
"@hpcc-js/graph": "^2.87.0",
"@hpcc-js/layout": "^2.51.0",
"@hpcc-js/leaflet-shim": "^2.5.0",
"@hpcc-js/other": "^2.17.0",
"@hpcc-js/util": "^2.53.0"
"@hpcc-js/api": "^3.0.0",
"@hpcc-js/common": "^3.0.0",
"@hpcc-js/graph": "^3.0.0",
"@hpcc-js/layout": "^3.0.0",
"@hpcc-js/other": "^3.0.0",
"@hpcc-js/util": "^3.0.0"
},
"devDependencies": {
"@hpcc-js/bundle": "^2.12.0",
"@hpcc-js/esbuild-plugins": "^1.2.0",
"@hpcc-js/leaflet-shim": "^2.5.0",
"d3-collection": "^1",
"d3-color": "3.1.0",
"d3-format": "^1",
Expand All @@ -58,8 +55,7 @@
"d3-selection": "^1",
"d3-tile": "^1",
"google-maps": "3.3.0",
"topojson-client": "3.1.0",
"tslib": "2.7.0"
"topojson-client": "3.1.0"
},
"repository": {
"type": "git",
Expand All @@ -72,4 +68,4 @@
"url": "https://github.com/hpcc-systems/Visualization/issues"
},
"homepage": "https://github.com/hpcc-systems/Visualization"
}
}
57 changes: 0 additions & 57 deletions packages/map/rollup.config.mjs

This file was deleted.

4 changes: 2 additions & 2 deletions packages/map/src/CanvasPinLayer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CanvasPins } from "./CanvasPins";
import { Layer } from "./Layer";
import { CanvasPins } from "./CanvasPins.ts";
import { Layer } from "./Layer.ts";

export class CanvasPinLayer extends Layer {
_pinsTransform;
Expand Down
Loading

0 comments on commit 962c56a

Please sign in to comment.