# dn_nearest_link_finder

> Finds the nearest point belonging to the graph

Latest version **1.0.3** (published 2023-05-27) · MIT License license · 0 weekly downloads

## Install

```sh
npm install dn_nearest_link_finder
pnpm add dn_nearest_link_finder
yarn add dn_nearest_link_finder
bun add dn_nearest_link_finder
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2023-05-27 |
| First published | 2021-01-18 |
| Weekly downloads | 0 |
| License | MIT License |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 13.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Anatolii Lebedev |
| Maintainers | dnap |
| Keywords | graph, graph theory, edge, vertex, node, network, connection, ngraph, vivagraph, ngraphjs |

## Links

- npm: https://www.npmjs.com/package/dn_nearest_link_finder
- Repository: https://github.com/DnAp/DnNearestLinkFinder
- Homepage: https://github.com/DnAp/DnNearestLinkFinder#readme
- Issues: https://github.com/DnAp/DnNearestLinkFinder/issues
- npm.io page: https://npm.io/package/dn_nearest_link_finder

## Dependencies (1)

- [ngraph.graph](https://npm.io/package/ngraph.graph.md) ^19.1.0

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2023-05-27
- 1.0.1 — 2023-05-26
- 1.0.0 — 2021-01-18

## README

# DnNearestLinkFinder
Finds the nearest point belonging to the graph.

This library uses the graph from the library [ngraph](https://github.com/anvaka/ngraph.graph).


# Example
```js
import createGraph from 'ngraph.graph';
import DnNearestLinkFinder from 'dn_nearest_link_finder';

// Create graph
let graph = createGraph();

graph.addNode(1, { xy: [0, 0] });
graph.addNode(2, { xy: [0, 1] });
graph.addNode(3, { xy: [1, 1] });
graph.addNode(4, { xy: [1, 0] });

graph.addLink(1, 2);
graph.addLink(2, 3);
graph.addLink(3, 4);
graph.addLink(4, 1);

let finder = new DnNearestLinkFinder(graph);
let result = finder.findLink([0.65, 0.5]);
console.log(result.nodeA.id);
console.log(result.nodeB.id);
console.log(result.nearestPoint);
```

# License
MIT License

Copyright 2021 DnAp<dnlebedev@gmail.com>

---
_Source: https://npm.io/package/dn_nearest_link_finder · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
