visualizer

package
v0.0.0-...-da54a8e Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Converts an array on ingeres as a graphic for stdout or gif representation

Index

Constants

This section is empty.

Variables

View Source
var Fps int
View Source
var MaxHeight int
View Source
var Mode int

Functions

func WriteGif

func WriteGif(name string, gifdata *gif.GIF)

Writes GIF image to the filesystem

func WriteStdout

func WriteStdout(array []int, currentValue int)

Represents the array as chart on the screen

Types

type FrameGen

type FrameGen func([]int, int)

func (FrameGen) AddFrame

func (fg FrameGen) AddFrame(array []int, currentValue int)

func (FrameGen) Complete

func (fg FrameGen) Complete()

func (FrameGen) Setup

func (fg FrameGen) Setup(name string)

type GifVisualizer

type GifVisualizer struct {
	// contains filtered or unexported fields
}

Represents name of an algorithm and GIF data of the algorithm

func (*GifVisualizer) AddFrame

func (gv *GifVisualizer) AddFrame(array []int, currentValue int)

Builds the frame and added in to a GIF data

func (*GifVisualizer) Complete

func (gv *GifVisualizer) Complete()

Writes GIF image to the filesystem when alorithm is done

func (*GifVisualizer) Setup

func (gv *GifVisualizer) Setup(name string)

Setups base config of gif image

type Visualizer

type Visualizer interface {
	Setup(string)
	AddFrame([]int, int)
	Complete()
}

Jump to

Keyboard shortcuts

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