package
Version:
v0.0.0-...-bc8e4b0
Opens a new window with list of versions in this module.
Published: Jan 6, 2025
License: MIT
Opens a new window with license information.
Imports: 12
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package web provides utilities for drawing a sierpinski triangle using html
and javascript.
Serve starts an http server which provides visualizations of a sierpinski
triangle.
WriteHTML uses the given Triangle and RenderOpts to render an html template
and write it to the given io.Writer.
WriteJS uses the given Triangle and RenderOpts to render a javascript template
and write it to the given io.Writer.
WriteJSON uses the given Triangle and RenderOpts to render a JSON representation
of the Triangle and write it to the given io.Writer.
type RGB struct {
R int `json:"r"`
G int `json:"g"`
B int `json:"b"`
}
RGB represents a color used to draw a sierpinski triangle.
type RenderOpts struct {
Chaos *chaos.Triangle `json:"chaos"`
PointRadius float64 `json:"point_radius"`
PointColor *RGB `json:"point_color"`
}
RenderOpts represents the options available when rendering a sierpinski
triangle.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.