Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Histogram

since

0.3.0

Hierarchy

  • AbstractRenderer
    • Histogram

Index

Constructors

constructor

Properties

_metric

_metric: string | string[]

background

background: HTMLCanvasElement = ...

environment

environment: Environment

Points to the Environment that this renderer is tied to. This is automatically set when the renderer is created.

height

height: number

markerWidth

markerWidth: number = 0

maxValue

maxValue: number

opts

opts: HistogramOptions = ...

width

width: number

Methods

drawBuckets

  • drawBuckets(bucketValues: number[], offset?: number): void

drawMarkers

  • drawMarkers(bucketValues: number[]): void

getBucketValues

  • getBucketValues(metric: string): number[]

metric

  • metric(_metric: string | string[], ...otherMetrics: string[]): void
  • Add a metric or metrics to this Histogram. For a single metric, pass the string matching the key of Agent data you would like to count. For multiple metrics, pass either an array of strings or strings as separate parameters, e.g.

    • histogram.metric("one", "two", "three"); or
    • histogram.metric(["one", "two", "three"]);
    since

    0.3.0

    Parameters

    • _metric: string | string[]
    • Rest ...otherMetrics: string[]

    Returns void

mount

  • mount(el: string | HTMLElement): void
  • Mount this renderer to a DOM element. Pass either a string representing a CSS selector matching the element or the element itself.

    // mounts the renderer to the element with the ID `container`
    renderer.mount('#container');
    
    // mounts the renderer to the element itself
    const container = document.getElementById('container');
    renderer.mount(container);
    

    Parameters

    • el: string | HTMLElement

    Returns void

render

  • render(): void

setMaxValue

  • setMaxValue(): void

x

  • x(value: number): number

y

  • y(value: number): number

Generated using TypeDoc