Reference · Facts, line drawings and positions
lineupLabelsSvgfunction
The labels and rings as SVG markup (the contents of an <svg> that is width by height): a dark plate with white lines for each label, and a thin ring and tick for each body too small to see. The first line of a
plate is bold.
Import it
import { lineupLabelsSvg } from "@johnmorrisdotca/wakusei-planets";
Definition
function lineupLabelsSvg(plan: ReturnType<typeof lineupLabels>, font?: number): string
Parameters
| Name | Type | Description |
|---|---|---|
plan | { labels: LineupLabel[]; rings: { id: string; cx: number; cy: number; r: number; }[]; } | What |
font (optional) | number | The pixel size of the text; the same as was given to |
Returns
string
SVG markup.
Examples
import { lineupBodies, lineupLabels, lineupLabelsSvg, lineupProject, lineupView, placeLineup } from "@johnmorrisdotca/wakusei-planets";
const places = placeLineup(lineupBodies(), "row");
const plan = lineupLabels(lineupProject(places, lineupView(places, 0.4), 800, 450), 800, 450, "en");
console.log(lineupLabelsSvg(plan).startsWith("<g"));trueWhat it prints (run when this page was built)