polylabel

v1.0.1

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.

Package archive: https://pubdev.letsnova.ru/api/archives/polylabel/1.0.1.tar.gz

Installdart pub add polylabel

Readme

polylabel

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)
                

Changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[1.0.1] - 2021-11-11

Changed

  • Adopt "Keep a Chagelog" format.

[1.0.0] - 2021-11-11

Added

  • Add unit tests.

Changed

  • Changed PolylabelResult structure.

[0.3.1] - 2021-11-11

Changed

  • Refactor code.

[0.3.0] - 2021-11-11

Changed

  • Better package description.

[0.2.0] - 2021-11-10

Changed

  • Update example docs.

[0.1.0] - 2021-11-10

Added

  • Initial version.