PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/p/samcrew/piechart/v0

Package
Open in gnoweb ↗

Overview

Kind
Pure package
Name
v0
Namespace
samcrew / piechart
Files
4 (README)(gnomod.toml)
Exported functions
n/a — not supported for pure packages by the node (vm/qfuncs)
Module
gno.land/p/samcrew/piechart/v0
gno
0.9

Files (4)

  • README.mdmarkdown
  • gnomod.tomltoml
  • piechart.gnogno
  • piechart_test.gnogno
piechart_test.gnogno
1package piechart23import (4	"strings"5	"testing"6)78func TestRender(t *testing.T) {9	title := "Test"10	slices := []PieSlice{11		{Value: 10, Color: "#00FF00", Label: "Green"},12		{Value: 20, Color: "#FFFF00", Label: "Yellow"},13		{Value: 30, Color: "#FF0000", Label: "Red"},14	}1516	result := Render(slices, title)1718	// Check if the result contains the expected image SVG structure19	if !strings.Contains(result, "data:image/svg+xml;base64,") {20		t.Errorf("Expected result to contain data:image/svg+xml;base64, got %s", result)21	}2223	// Check if the result contains the title24	if !strings.Contains(result, title) {25		t.Errorf("SVG does not contain the title %q", title)26	}2728	// Check if the result contains non-empty slices29	emptySlices := []PieSlice{}30	emptyResult := Render(emptySlices, title)31	expectedErr := "\npiechart fails: no data provided"32	if emptyResult != expectedErr {33		t.Errorf("Expected exact error for empty slices: %q, got %q", expectedErr, emptyResult)34	}35}36

Functions

not supported for pure packages by the node (vm/qfuncs)

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.