wasmcomponents

package
v0.0.0-...-44f2542 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const JS = `` /* 240-byte string literal not displayed */

JS is a JavaScript function that uses chart.js to render a pie chart.

View Source
const Styles = `
	.chartjs-render-monitor {
		width: 100%;	
	}
`

Styles is the component's CSS.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChartData

type ChartData struct {
	Labels   []string
	Datasets []ChartDataset
}

type ChartDataset

type ChartDataset struct {
	Label           string
	Data            []float64
	BackgroundColor []string
}

type ItemLinkComponent

type ItemLinkComponent struct {
	app.Compo

	Text   string
	Href   string
	Active bool
}

ItemLinkComponent is a wasm component that renders a link to an item.

func (*ItemLinkComponent) Render

func (i *ItemLinkComponent) Render() app.UI

Render renders the item link component.

type Navbar struct {
	app.Compo

	LogoPath string
	Title    string
	Subtitle string
	// contains filtered or unexported fields
}
func (n *Navbar) OnNav(ctx app.Context)
func (n *Navbar) Render() app.UI

type PieChart

type PieChart struct {
	app.Compo

	Data any
}

PieChart is a component that uses chart.js to render a pie chart.

func (*PieChart) JS

func (p *PieChart) JS()

JS is called after the component is rendered.

func (*PieChart) Render

func (p *PieChart) Render() app.UI

Render returns the component's HTML markup.

func (*PieChart) Styles

func (p *PieChart) Styles() string

Styles returns the component's CSS.

type ScrollingList

type ScrollingList struct {
	app.Compo

	Items []ScrollingListItem
}

ScrollingList is a wasm component that renders a list of items. Items can be scrolled horizontally. This component uses Bootstrap.

func (*ScrollingList) OnMount

func (l *ScrollingList) OnMount(ctx app.Context)

func (ScrollingList) Render

func (l ScrollingList) Render() app.UI

Render renders the list using the items and Bootstrap.

type ScrollingListItem

type ScrollingListItem struct {
	app.Compo

	// Avatar is the component that renders the avatar of the item.
	// This is optional.
	Avatar app.UI

	// Title is the title of the item.
	Title string

	// Subtitle is the subtitle of the item.
	Subtitle string

	// Actions are the actions that can be performed on the item.
	// This is optional.
	Actions app.UI
}

ScrollingListItem is a wasm component that renders an item in a scrolling list. This component uses Bootstrap.

func (ScrollingListItem) Render

func (i ScrollingListItem) Render() app.UI

Render renders the item.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL