-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[layer-maplibre, layer-leaflet] better bbox management
- adding maplibre plugin - adding sync map to sigma, which is needed for some case, specially wehn the graph BBOX is outside the map possibilities
- Loading branch information
Showing
17 changed files
with
323,501 additions
and
33 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.gitignore | ||
node_modules | ||
src | ||
tsconfig.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Sigma.js - Maplibre background layer | ||
|
||
This package contains a maplibre background layer for [sigma.js](https://sigmajs.org). | ||
|
||
It displays a map on the graph's background and handle the camera synchronisation. | ||
|
||
## How to use | ||
|
||
First you need to install [maplibre](https://maplibre.org/) in your application. | ||
You can check this [page](https://maplibre.org/maplibre-gl-js/docs/) to see how to do it. | ||
Especially, don't forget to load `maplibre-gl.css` in your application. | ||
|
||
Then, within your application that uses sigma.js, you can use [`@sigma/layer-maplibre`](https://www.npmjs.com/package/@sigma/layer-maplibre) as following: | ||
|
||
```typescript | ||
import bindLeafletLayer from "@sigma/layer-maplibre"; | ||
|
||
const graph = new Graph(); | ||
graph.addNode("nantes", { x: 0, y: 0, lat: 47.2308, lng: 1.5566, size: 10, label: "Nantes" }); | ||
graph.addNode("paris", { x: 0, y: 0, lat: 48.8567, lng: 2.351, size: 10, label: "Paris" }); | ||
graph.addEdge("nantes", "paris"); | ||
|
||
const sigma = new Sigma(graph, container); | ||
bindMaplibreLayer(sigma); | ||
``` | ||
|
||
Please check the related [Storybook](https://github.com/jacomyal/sigma.js/tree/main/packages/storybook/stories/layer-maplibre) for more advanced examples. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"name": "@sigma/layer-maplibre", | ||
"version": "3.0.0-beta.1", | ||
"description": "A plugin to set a geographical map in background", | ||
"main": "dist/sigma-layer-maplibre.cjs.js", | ||
"module": "dist/sigma-layer-maplibre.esm.js", | ||
"types": "dist/sigma-layer-maplibre.cjs.d.ts", | ||
"files": [ | ||
"/dist" | ||
], | ||
"sideEffects": false, | ||
"homepage": "https://www.sigmajs.org", | ||
"bugs": "http://github.com/jacomyal/sigma.js/issues", | ||
"repository": { | ||
"type": "git", | ||
"url": "http://github.com/jacomyal/sigma.js.git" | ||
}, | ||
"keywords": [ | ||
"graph", | ||
"graphology", | ||
"sigma" | ||
], | ||
"contributors": [ | ||
{ | ||
"name": "Benoît Simard", | ||
"url": "http://github.com/sim51" | ||
} | ||
], | ||
"license": "MIT", | ||
"preconstruct": { | ||
"entrypoints": [ | ||
"index.ts" | ||
] | ||
}, | ||
"peerDependencies": { | ||
"maplibre-gl": "^4.5.0", | ||
"sigma": ">=3.0.0-beta.10" | ||
}, | ||
"exports": { | ||
".": { | ||
"module": "./dist/sigma-layer-maplibre.esm.js", | ||
"import": "./dist/sigma-layer-maplibre.cjs.mjs", | ||
"default": "./dist/sigma-layer-maplibre.cjs.js" | ||
}, | ||
"./package.json": "./package.json" | ||
} | ||
} |
Oops, something went wrong.