Reference · Facts, line drawings and positions
lineSvgfunction
A body as a line drawing, as an SVG string: the outline (squeezed by its flattening and leaning at its axial tilt), bands and features, rings with their gaps, and the dark side
dashed off. Give it a time to draw the body as the Earth sees it then; leave it out for a portrait. moons: true draws a planet with its moons on their orbits.
Import it
import { lineSvg } from "@johnmorrisdotca/wakusei-planets";
Definition
function lineSvg(id: BodyId, options?: LineOptions): string
Parameters
| Name | Type | Description |
|---|---|---|
id | BodyId | The body's name: |
options (optional) | LineOptions | The size, the pose ( |
Returns
string
The SVG markup, <svg ...> to </svg>.
Examples
import { lineSvg } from "@johnmorrisdotca/wakusei-planets";
const svg = lineSvg("saturn", { size: 320 });
console.log(svg.startsWith("<svg"), svg.includes("Saturn"));true trueWhat it prints (run when this page was built)