Reference · Facts, line drawings and positions
portraitCodefunction
The text that puts a portrait scene in a page, for each way a page is made, as embedCode does for a single body. The bodies' own entry points are loaded only for the bodies in the scene
(all of them when there are more than six kinds), and none for the line look.
Import it
import { portraitCode } from "@johnmorrisdotca/wakusei-planets";
Definition
function portraitCode(options: PortraitEmbed, kind?: EmbedKind, settings?: EmbedSettings): string
Parameters
| Name | Type | Description |
|---|---|---|
options | PortraitEmbed | The scene 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 { portraitCode } from "@johnmorrisdotca/wakusei-planets";
console.log(portraitCode({ scene: "look:painted~jupiter_0_0_0.3_0~io_0_0_0.1_0" }, "vue"));<script setup lang="ts">
import { onMounted } from "vue";
onMounted(() => {
void import("@johnmorrisdotca/wakusei-planets/portrait");
void import("@johnmorrisdotca/wakusei-planets/jupiter");
void import("@johnmorrisdotca/wakusei-planets/moons-jupiter");
});
</script>
<template>
<wakusei-portrait scene="look:painted~jupiter_0_0_0.3_0~io_0_0_0.1_0"></wakusei-portrait>
</template>What it prints (run when this page was built)