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

lineupCodefunction

The text that puts the size line-up in a page, for each way a page is made, as embedCode does for a single body: a script tag, an ES module, React, Vue, Angular, Svelte or an iframe of the demo's embed.html. Every way is built, parsed or run by the package's tests.

Import it

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

Definition

function lineupCode(options: LineupEmbed, kind?: EmbedKind, settings?: EmbedSettings): string

Parameters

NameTypeDescription
optionsLineupEmbed

The stars, the planets, the layout, where the camera starts and the width.

kind (optional)"html" | "iframe" | "module" | "react" | "vue" | "angular" | "svelte"

The way the page is made; html by default.

settings (optional)EmbedSettings

The CDN and the demo's address, when they are not the package's own.

Returns

string

The text to paste into the page's source.

Examples

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

console.log(lineupCode({ stars: "largest", at: "vy-canis-majoris" }, "react"));
import { useEffect } from "react";

export function Lineup() {
  useEffect(() => {
    // The element needs a browser, so it is imported in an effect, never at the top of the file.
    void import("@johnmorrisdotca/wakusei-planets/lineup");
  }, []);
  return <wakusei-lineup stars="largest" at="vy-canis-majoris" />;
}

What it prints (run when this page was built)

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