defineChartfunction
Define <hoshi-chart> in registry (the page's customElements by default) unless the name is taken. On a server, where there is no registry, it does nothing.
Import it
import { defineChart } from "@johnmorrisdotca/hoshi-stars/chart/define";
Definition
function defineChart(registry?: CustomElementRegistry | undefined): boolean
Parameters
| Name | Type | Description |
|---|---|---|
registry (optional) | CustomElementRegistry | undefined | Where to define it. |
Returns
boolean
Whether this call defined it.
Examples
import { defineChart } from "@johnmorrisdotca/hoshi-stars/chart/define";
defineChart();
document.body.insertAdjacentHTML("beforeend", '<hoshi-chart constellation="Ori"></hoshi-chart>');