FLUTTER ECOSYSTEM

beroso/dart_polylabel

Dart port of https://github.com/mapbox/polylabel

dart_polylabel project cover
Stars
8
Forks
5
Last push (UTC)
Sep 6, 2023
Project status
Active
André Sousa GitHub avatar
GITHUB User

André Sousa ↗

BeropixelCeará, BrasilOfficial website ↗
LanguagesDart

Packages published by this repository

Dependencies used

Dependency list 3 items

Original README

English project snapshot. Visit GitHub for the latest content.

Expand / collapse project README

polylabel

build pub package pub points popularity likes

Dart port of https://github.com/mapbox/polylabel.

A fast algorithm for finding polygon pole of inaccessibility implemented as a Dart library. Useful for optimal placement of a text label on a polygon.

Usage

import 'dart:math';

import 'package:polylabel/polylabel.dart';

final polygon = [[Point(0, 0), Point(1, 0), Point(1, 1), Point(0, 1), Point(0, 0)]];
final result = polylabel(polygon); // PolylabelResult(Point(0.5, 0.5), distance: 0.5)