thickPathfunction
A d3-geo path made fit for a thick line: simpler to within toleranceMm, loops whose longest side is under minLoopMm left out, corners rounded.
Import it
import { thickPath } from "@johnmorrisdotca/chikyu-earth/sheets";
Definition
function thickPath(d: string, toleranceMm: number, minLoopMm: number): string
Parameters
| Name | Type | Description |
|---|---|---|
d | string | The path as d3-geo's |
toleranceMm | number | How far the simpler line may stray from the real one. |
minLoopMm | number | The smallest island, by its longest side, that is kept. |
Returns
string
The path.
Examples
import { thickPath } from "@johnmorrisdotca/chikyu-earth/sheets";
console.log(thickPath("M0,0L5,0.1L10,0L20,0", 0.5, 0));M0 0L20 0What it prints (run when this page was built)