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
| Name | Type | Description |
|---|---|---|
options | LineupEmbed | 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; |
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)