1package memberstore23import (4 "strings"56 "gno.land/p/samcrew/piechart/v0"7)89// RenderCharts generates two pie charts for member tiers:10// 1) distribution of member counts per tier11// 2) distribution of power per tier12func RenderCharts(members MembersByTier) string {13 var sb strings.Builder1415 tierNames := []string{T1, T2, T3}16 pieSlicesTs := make([]piechart.PieSlice, 0, len(tierNames))17 pieSlicesTp := make([]piechart.PieSlice, 0, len(tierNames))1819 for _, tn := range tierNames {20 tier, ok := tiers.GetTier(tn)21 if !ok {22 return ""23 }2425 ts := float64(members.GetTierSize(tn))26 tp := tier.PowerHandler(members, tiers) * ts2728 pieSlicesTs = append(pieSlicesTs, piechart.PieSlice{29 Value: ts,30 Color: tierColor(tn),31 Label: tn,32 })33 pieSlicesTp = append(pieSlicesTp, piechart.PieSlice{34 Value: tp,35 Color: tierColor(tn),36 Label: tn,37 })38 }3940 // Render pie charts for members count and power distribution41 resultPieChartTs := piechart.Render(pieSlicesTs, "Members distribution:")42 resultPieChartTp := piechart.Render(pieSlicesTp, "Power distribution:")4344 sb.WriteString(resultPieChartTs + "\n")45 sb.WriteString(resultPieChartTp + "\n")4647 return sb.String()48}49Get(int, rlm interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}) struct{BPTree *gno.land/p/nt/bptree/v0.BPTree}
GetTier(name string) (struct{BasePower float64; InvitationPoints int; MaxSize func(gno.land/r/gov/dao/memberstore/v0.MembersByTier, gno.land/r/gov/dao/memberstore/v0.TiersByName) int; MinSize func(gno.land/r/gov/dao/memberstore/v0.MembersByTier, gno.land/r/gov/dao/memberstore/v0.TiersByName) int; PowerHandler func(gno.land/r/gov/dao/memberstore/v0.MembersByTier, gno.land/r/gov/dao/memberstore/v0.TiersByName) float64}, bool)
GetTierPower(tierName string, members struct{BPTree *gno.land/p/nt/bptree/v0.BPTree}) float64
IterateTiers(fn func(string, gno.land/r/gov/dao/memberstore/v0.Tier) bool)
NewChangeTiersRequest(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, tiers map[string]gno.land/r/gov/dao/memberstore/v0.Tier) struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}
NewMember(invitationPoints int) *gno.land/r/gov/dao/memberstore/v0.Member
NewMembersByTier() struct{BPTree *gno.land/p/nt/bptree/v0.BPTree}
Render(path string) string
RenderCharts(members struct{BPTree *gno.land/p/nt/bptree/v0.BPTree}) string
RenderMembers(path string, members struct{BPTree *gno.land/p/nt/bptree/v0.BPTree}) string
Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.
vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.