Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/erkkah/margaid
/ functions
Functions
145 in github.com/erkkah/margaid
⨍
Functions
145
◇
Types & classes
31
↓ 42 callers
Method
Add
Add appends one or more values, optionally peforming aggregation. If the series is capped, capping will be applied after aggregation.
series.go:118
↓ 33 callers
Function
MakeValue
MakeValue creates a Value from x and y values.
series.go:110
↓ 22 callers
Function
SecondsFromTime
SecondsFromTime converts from time.Time to seconds since the epoch
series.go:308
↓ 21 callers
Method
Equal
Equal verifies that the two arguments are equal
xt/testing.go:41
↓ 19 callers
Function
X
X wraps a *testing.T and extends its functionality
xt/testing.go:12
↓ 17 callers
Function
NewSeries
NewSeries - series constructor
series.go:30
↓ 13 callers
Method
Open
Open adds a new opening element with optional attributes.
brackets/brackets.go:133
↓ 13 callers
Method
String
()
brackets/brackets.go:72
↓ 13 callers
Method
Transform
Transform sets the current list of transforms that will be used by the next set of drawing operations. Specifying no transforms resets the transformat
svg/svg.go:323
↓ 13 callers
Function
ftos
Utilities
svg/svg.go:443
↓ 13 callers
Method
setAttribute
(attr string, value string)
svg/svg.go:216
↓ 11 callers
Method
Next
Next steps to the next value. A newly created iterator has no current value.
series.go:85
↓ 9 callers
Method
Assert
Assert verifies that a condition is true
xt/testing.go:17
↓ 9 callers
Function
New
New - Margaid constructor
margaid.go:49
↓ 8 callers
Method
Fill
Style Fill sets current fill style
svg/svg.go:343
↓ 8 callers
Method
StrokeWidth
StrokeWidth sets current stroke width
svg/svg.go:362
↓ 8 callers
Method
ValueTicker
ValueTicker returns tick labels by converting floats using strconv.FormatFloat
tickers.go:60
↓ 8 callers
Method
start
(axis Axis, series *Series, steps int)
tickers.go:14
↓ 7 callers
Method
Close
Close closes a child SVG and returns the parent. If the current SVG is not a child, this is a noop.
svg/svg.go:151
↓ 7 callers
Method
Get
Get returns the iterator current value. A newly created iterator has no current value.
series.go:79
↓ 7 callers
Function
Scaling
Scaling scales by (xScale, yScale)
svg/svg.go:312
↓ 7 callers
Method
Size
Size returns the current series value count
series.go:43
↓ 7 callers
Function
Translation
Translation moves by (x, y)
svg/svg.go:304
↓ 7 callers
Method
next
(previous float64)
tickers.go:15
↓ 6 callers
Method
Axis
Axis draws tick marks and labels using the specified ticker
axes.go:24
↓ 6 callers
Method
Stroke
Stroke sets current stroke
svg/svg.go:349
↓ 6 callers
Function
TimeFromSeconds
TimeFromSeconds converts from seconds since the epoch to time.Time
series.go:301
↓ 6 callers
Method
Values
Values returns an iterator to the series values
series.go:95
↓ 6 callers
Function
WithRange
WithRange sets a fixed plotting range for a given axis
margaid.go:108
↓ 5 callers
Method
Alignment
Alignment sets current text alignment
svg/svg.go:435
↓ 5 callers
Method
Font
Font sets current font family and size
svg/svg.go:382
↓ 5 callers
Method
FontStyle
FontStyle sets the current font style and weight
svg/svg.go:408
↓ 5 callers
Function
New
New - Brackets constructor
brackets/brackets.go:18
↓ 5 callers
Method
Text
Text draws text at x, y
svg/svg.go:276
↓ 5 callers
Method
project
Projects a value onto an axis using the current projection setting. The value returned is in user coordinates, [0..1] * width for the x-axis.
margaid.go:315
↓ 4 callers
Method
Marker
Marker adds start, mid and end markers to all following strokes. The specified marker has to be one of "circle" and "square". Setting the marker to th
svg/svg.go:370
↓ 4 callers
Method
getPlotColor
getPlotColor picks hues and saturations around the color wheel at prime indices. Kind of works for a quick selection of plotting colors.
margaid.go:377
↓ 3 callers
Function
AggregatedBy
AggregatedBy sets the series aggregator
series.go:286
↓ 3 callers
Method
Attributes
Attributes returns a copy of the element attributes
brackets/brackets.go:99
↓ 3 callers
Method
Close
Close closes the current element. If there are no children (elements or text), the current element will be self-closed. Otherwise, a matching close-el
brackets/brackets.go:175
↓ 3 callers
Method
CloseAll
CloseAll closes all elements to get a complete, matched structure.
brackets/brackets.go:190
↓ 3 callers
Function
EncodeText
EncodeText applies proper xml escaping and svg line breaking at each newline in the raw text and returns a section ready for inclusion in a <text> ele
svg/svg.go:455
↓ 3 callers
Method
False
False verifies that a condition is false
xt/testing.go:33
↓ 3 callers
Method
Frame
Frame draws a frame around the chart area
margaid.go:299
↓ 3 callers
Method
LabeledTicker
LabeledTicker places tick marks and labels for all values of a series. The labels are provided by the labeler function.
tickers.go:132
↓ 3 callers
Method
MinX
MinX returns the series smallest x value, or 0.0 if the series is empty
series.go:49
↓ 3 callers
Method
Polyline
Polyline adds a polyline from a list of points
svg/svg.go:247
↓ 3 callers
Method
Rect
Rect adds a rect defined by x, y, width and height
svg/svg.go:263
↓ 3 callers
Method
Render
Render generates SVG code for the current image, and clears the canvas
svg/svg.go:161
↓ 3 callers
Method
SetAttribute
SetAttribute resets an attribute to a new value
brackets/brackets.go:109
↓ 3 callers
Method
True
True verifies that a condition is true
xt/testing.go:25
↓ 3 callers
Method
addPlot
addPlot adds a named plot and returns its ID
margaid.go:369
↓ 3 callers
Method
error
(message string)
margaid.go:288
↓ 3 callers
Function
getPlotOptions
(using []Using)
plots.go:21
↓ 3 callers
Method
getProjectedValues
(series *Series, xAxis, yAxis Axis)
margaid.go:351
↓ 3 callers
Method
topElement
()
brackets/brackets.go:113
↓ 3 callers
Method
updateStyle
()
svg/svg.go:199
↓ 2 callers
Method
Add
Add adds a self-closing element
brackets/brackets.go:150
↓ 2 callers
Method
Clone
Clone creates a deep copy of a map
brackets/brackets.go:29
↓ 2 callers
Method
Color
Color sets current stroke and fill
svg/svg.go:355
↓ 2 callers
Method
Line
Line draws a series using straight lines
plots.go:58
↓ 2 callers
Method
MaxX
MaxX returns the series largest x value, or 0.0 if the series is empty
series.go:55
↓ 2 callers
Method
Name
Name returns the element name
brackets/brackets.go:104
↓ 2 callers
Method
Path
Drawing Path adds a SVG style path
svg/svg.go:230
↓ 2 callers
Method
Smooth
Smooth draws one series as a smooth curve
plots.go:84
↓ 2 callers
Method
TimeTicker
TimeTicker returns time valued tick labels in the specified time format. TimeTicker assumes that time is linear.
tickers.go:20
↓ 2 callers
Function
Titled
Titled sets the series title
series.go:294
↓ 2 callers
Function
WithAutorange
WithAutorange sets range for an axis from the values of one or more series
margaid.go:115
↓ 2 callers
Function
WithBackgroundColor
WithBackgroundColor sets the chart background color as a valid SVG color attribute string. Default is transparent.
margaid.go:171
↓ 2 callers
Function
WithProjection
WithProjection sets the projection for a given axis
margaid.go:101
↓ 2 callers
Function
XMLEscape
XMLEscape returns properly escaped XML equivalent of the provided string
brackets/brackets.go:230
↓ 2 callers
Function
makeSVG
()
svg/svg.go:125
↓ 2 callers
Method
updateMinMax
()
series.go:181
↓ 1 callers
Method
Append
Append adds all elements from another Brackets instance
brackets/brackets.go:214
↓ 1 callers
Method
Bar
Bar draws bars for the specified group of series.
plots.go:121
↓ 1 callers
Function
CappedByAge
CappedByAge caps a series by removing values older than cap in relation to the current value of the reference funcion.
series.go:227
↓ 1 callers
Function
CappedBySize
CappedBySize caps a series to at most cap values.
series.go:210
↓ 1 callers
Method
Current
Current returns a pointer to the currently open element, or nil if there is none.
brackets/brackets.go:199
↓ 1 callers
Method
First
First returns the first element of the underlying list of elements.
brackets/brackets.go:128
↓ 1 callers
Method
Last
Last returns a pointer to the most recently added element, or nil if there is none.
brackets/brackets.go:205
↓ 1 callers
Method
Legend
Legend draws a legend for named plots. If position is set to BottomLeft, it will grow the plot size to accommodate the number of legends displayed.
margaid.go:227
↓ 1 callers
Method
MaxY
MaxY returns the series largest y value, or 0.0 if the series is empty
series.go:67
↓ 1 callers
Method
MinY
MinY returns the series smallest y value, or 0.0 if the series is empty
series.go:61
↓ 1 callers
Function
New
New - SVG constructor
svg/svg.go:29
↓ 1 callers
Function
Rotation
Transformations Rotation rotates by angle degrees clockwise around (x, y)
svg/svg.go:296
↓ 1 callers
Method
SetSize
SetSize of SVG, redefining the value given during construction.
svg/svg.go:44
↓ 1 callers
Method
Title
Drawing Title draws a title top center
margaid.go:204
↓ 1 callers
Function
WithInset
WithInset sets the distance between the chart boundaries and the charting area.
margaid.go:154
↓ 1 callers
Function
WithPadding
WithPadding sets the padding inside the plotting area as a percentage [0..20] of the area width and height
margaid.go:162
↓ 1 callers
Method
addMarkers
()
svg/svg.go:50
↓ 1 callers
Function
attributeDiff
(old, new br.Attributes)
svg/svg.go:168
↓ 1 callers
Function
catmullRom2bezier
Pulled from: https://advancedweb.hu/plotting-charts-with-svg/
plots.go:173
↓ 1 callers
Method
label
(value float64)
tickers.go:13
↓ 1 callers
Method
next
(previous float64)
tickers.go:111
↓ 1 callers
Method
popElement
()
brackets/brackets.go:121
↓ 1 callers
Function
shouldExtendParentStyle
(old, new, diff br.Attributes)
svg/svg.go:195
Function
Avg
Avg calculates the Y average of a list of values, reported as observed at the given time.
series.go:250
Method
Child
Child adds a sub-SVG at x, y
svg/svg.go:139
Function
Delta
Delta calculates the Y difference between the first and last value in the list, reported as observed at the given time.
series.go:275
Method
Nil
Nil verifies that the argument is nil
xt/testing.go:59
next →
1–100 of 145, ranked by callers