Documentation ¶
Overview ¶
Package describe generates descriptive plots of ClickHouse tables and query results. There are two types of images generated: histograms and quantile plots. Quantile plots are generated for fields of type float. Histograms are generated for fields of type string, date and int. If you want a quantile plot of an int field, cast it as float.
Values deemed "missing" in a field may be omitted from a graph.
In addition, there is a func to create a simple markdown file of the images created.
The command in the describe subdirectory.
Index ¶
- Constants
- func Drive(runDetail *RunDef, conn *chutils.Connect) error
- func FieldPlot(runDetail *RunDef, xField, yField, where, plotType, title string, ...) error
- func Markdown(runDetail *RunDef) error
- func Multiple(runDetail *RunDef, conn *chutils.Connect) error
- func Table(runDetail *RunDef, conn *chutils.Connect) error
- func XY(runDetail *RunDef, conn *chutils.Connect) error
- type RunDef
- type TaskType
Constants ¶
View Source
const (
SkipLevel = 1000 // a histogram isn't made if there are more than this many levels
)
Variables ¶
This section is empty.
Functions ¶
func FieldPlot ¶
func FieldPlot(runDetail *RunDef, xField, yField, where, plotType, title string, conn *chutils.Connect) error
FieldPlot builds the plot for a single field.
- qry. Query to pull the data.
- field. Field to keep from query.
- plotType. ("histogram" or "quantile")
- outDir. Directory for output.
- title. Title for plot.
- imageTypes. Type(s) of images to produce.
- show. If true, push plot to browser.
- conn. Connector to ClickHouse.
Types ¶
type RunDef ¶
type RunDef struct { Task TaskType // the kind of task to run Show bool // if true, send the plots to the browser ImageTypesCh []utilities.PlotlyImage // type(s) of image files to create // one of these two must be specified Qry string // query to pull data Table string // table to pull data XY string LineType string Color string Box bool Log bool Title string SubTitle string Width float64 Height float64 Xlim []float64 Ylim []float64 OutDir string // directory for image files FileName string ImageTypes string // types of images to create MissStr, MissDt, MissInt, MissFlt any // values which indicate a field value is missing. Ignored if nil. Markdown string // if not nil, the name of a markdown file to create with the images in OutDir. Fds *chutils.TableDef // field defs of query results (not required if describing a table). }
The RunDef struct holds the elements required to direct describe's activities.
Click to show internal directories.
Click to hide internal directories.