GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bertin/src/links.js at main · riatelab/bertin

Expand file tree

/

links.js

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
43 lines (38 loc) · 1.22 KB
/

links.js

Copy path

File metadata and controls

43 lines (38 loc) · 1.22 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { figuration } from "./helpers/figuration.js";
import { centroid } from "./helpers/centroid.js";
import { geoimport } from "./helpers/geoimport.js";
export function links(options = {}) {
let geojson = geoimport(options.geojson);
let geojson_id = options.geojson_id;
let data = options.data;
let data_i = options.data_i != undefined ? options.data_i : "i";
let data_j = options.data_j != undefined ? options.data_j : "j";
let planar = options.planar ? true : false;
let dots;
if (figuration(geojson) == "p") {
dots = geojson.features;
} else {
dots = centroid(geojson, { planar: planar }).features;
}
const coordsbyid = new Map(
dots.map((d) => [d.properties[geojson_id], d.geometry.coordinates])
);
// PUISQUE 2 POINTS UFFISENT, FAIRE SANS TURF.JS
let features = [];
data.forEach((d) => {
if (
coordsbyid.get(d[data_i]) != undefined &&
coordsbyid.get(d[data_j]) != undefined
) {
features.push({
type: "Feature",
properties: d,
geometry: {
type: "LineString",
coordinates: [coordsbyid.get(d[data_i]), coordsbyid.get(d[data_j])],
},
});
}
});
return { type: "FeatureCollection", features: features };
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.