syiplot

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package syiplot renders Insyra's go-echarts charts (insyra/plot) inline in a Syralit app, unlocking interactive chart types Syralit's built-in Chart.js layer doesn't have — Sankey, word cloud, K-line, gauge, funnel, theme-river, box plot, radar, and more.

It lives in its own package because insyra/plot pulls in heavy dependencies (go-echarts and, transitively, chromedp for its PNG snapshot path). Keeping it separate means apps that only use the core Insyra adapter don't pay that cost. Import it explicitly when you want native plotting:

import syiplot "github.com/HazelnutParadise/syralit/integrations/insyra/eplot"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EChart

func EChart(chart plot.Renderable, opts ...sy.Option)

EChart renders any insyra/plot chart (go-echarts) inline as a fully interactive chart, in a sandboxed iframe:

syiplot.EChart(plot.CreateSankeyChart(cfg, links...))
syiplot.EChart(plot.CreateKlineChart(cfg, data...), sy.Height(600))

Pass sy.Height/sy.Width to size the frame (defaults to 520px tall, full width). Note: go-echarts loads echarts.min.js from its own CDN, so an EChart needs internet at view time, like Syralit's other external chart helpers.

func Offline

func Offline() bool

Offline reports whether offline asset inlining is currently enabled.

func SetOffline

func SetOffline(v bool)

SetOffline controls whether EChart inlines the echarts JavaScript into the chart HTML (true) or references go-echarts' CDN (false, the default).

Enable it for air-gapped / offline deployments, strict-CSP environments, and `syralit build` single-binary apps: the rendered chart then needs no network at view time because its scripts are embedded directly in the iframe.

The bundled scripts (echarts core, the v4 build, and the word-cloud extension) cover every chart this package can produce. A chart that pulls in some other echarts extension still references that one from the CDN.

Trade-off: inlining repeats the (~1 MB) echarts source in each chart's iframe, so prefer it when a page has only a few charts.

func WordCloud

func WordCloud(dl *insyra.DataList, title string, opts ...sy.Option)

WordCloud renders an interactive word cloud from a DataList whose values are the word weights. There is no Chart.js equivalent. title is optional.

Types

This section is empty.

Jump to

Keyboard shortcuts

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