Skip to the content

Wakusei Planets惑星

The Sun, the planets and their moons as a clean line drawing, a shaded realistic drawing or a painted surface map, with real sizes, tilt and rotation, and the moons where they are at any date and time.

Wakusei is the Japanese word 惑星 for a planet. About the name

Contents

Reference · Facts, line drawings and positions

lineupLabelsfunction

The labels and rings for a picture: the biggest bodies first, each with as much as fits, a label dropped when it would cover one already placed, and a ring round a body too small to see. A body outside the picture has none.

Import it

import { lineupLabels } from "@johnmorrisdotca/wakusei-planets";

Definition

function lineupLabels(dots: readonly LineupDot[], width: number, height: number, lang: LineupLang, options?: { font?: number; keep?: string; }): { labels: LineupLabel[]; rings: { id: string; cx: number; cy: number; r: number; }[]; }

Parameters

NameTypeDescription
dotsreadonly LineupDot[]

The bodies on the picture (lineupProject).

widthnumber

The picture's width in pixels.

heightnumber

The picture's height in pixels.

langLineupLang

en or ja.

options (optional){ font?: number; keep?: string; }

font (pixels, 12 by default), keep (the id of a body whose label is never dropped).

Returns

{ labels: LineupLabel[]; rings: { id: string; cx: number; cy: number; r: number; }[]; }

The labels and the rings (rings: a centre and a radius for each body under 6 pixels across).

Examples

import { lineupBodies, lineupLabels, lineupProject, lineupView, placeLineup } from "@johnmorrisdotca/wakusei-planets";

const places = placeLineup(lineupBodies({ planets: true }), "row");
const plan = lineupLabels(lineupProject(places, lineupView(places, 0.05), 800, 450), 800, 450, "en");
console.log(plan.labels.length, plan.rings.length);
2 0

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/wakusei-planets 0.29.0.