Hierarchy (View Summary)

Constructors

Properties

__doc__: Document
_tooltip?: HTMLDivElement
config: any
contentDiv: HTMLDivElement
contextMenu: ContextMenu
data: any[]
dataStore: DataStore
defaultBandWidth: number
dialogs: BaseDialog[] = []
div: HTMLElement
extra_legends?: any[]
graph_area: Selection<SVGGElement, any, null, undefined>
height: number = 0
isPinned: boolean = false
legend: any
legendIcon: HTMLElement
listeners: Record<string, Listener>
margins: undefined | { bottom: any; left: any; right: any; top: any }
menuSpace: HTMLDivElement
observable: { container: HTMLElement }
resetButton: HTMLSpanElement | HTMLButtonElement
ry_axis_label: undefined | Selection<SVGTextElement, any, null, undefined>
ry_axis_svg: Selection<SVGGElement, any, null, undefined>
settingsDialog?: BaseDialog
svg: Selection<SVGSVGElement, any, null, undefined>
ticks: any
title: HTMLDivElement
titleBar: HTMLDivElement
tx_axis_svg: Selection<SVGGElement, any, null, undefined>
unpinIcon?: HTMLElement
width: number = 0
x_axis_call: undefined | Axis<string>
x_axis_label: undefined | Selection<SVGTextElement, any, null, undefined>
x_axis_svg: Selection<SVGGElement, any, null, undefined>
x_scale: undefined | ScaleBand<string> | ScaleLinear<number, number>
y_axis_call: undefined | Axis<string>
y_axis_label: undefined | Selection<SVGTextElement, any, null, undefined>
y_axis_svg: Selection<SVGGElement, any, null, undefined>
y_scale: undefined | ScaleBand<string> | ScaleLinear<number, number>

Accessors

Methods

  • Adds a listener to the datastore that will be called when an event occurs, passing the event type and any data. There are the following different types of event:-

    • removed - called when the chart has been removed

    Parameters

    • id: string

      a unique id indetifying the listener

    • listener: Listener

      a function that accepts two paramaters, the type of event and the data associated with it

    Returns void

  • Adds a menu icon with tooltip to the title bar

    Parameters

    • icon: string

      the css classs of the icon (space delimited).

    • tooltip: string

      the tooltip text

    • config: { func?: (e: MouseEvent) => void; position?: string; size?: string } = {}

      extra inormation about the icon/tooltip

      • Optionalfunc?: (e: MouseEvent) => void

        a function that is called when the icon is clicked

      • Optionalposition?: string

        the position of the tooltip.

      • Optionalsize?: string

        the size of the tooltip

    Returns HTMLSpanElement

    • the icon
  • Instructs the chart to use a different document. This is only required if you are going to add the chart to a different browser window

    Parameters

    • doc: Document

      the document that the chart will use

    Returns void

  • Parameters

    • column: string
    • OptionalasArray: boolean

    Returns (i: number) => [number, number, number]

  • Parameters

    • svg: any
    • callback: (canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D) => void

    Returns void

  • Returns information about which controls to add to the settings dialog. Subclasses should call this method and then add their own controls e.g.

    getSettings(){
        let settings = super.getSettings();
        return settings.concat([{
          label:"A value"
          type:"slider",
          default_value:this.config.value,
          max:10,
          min:10,
          func:x=>{
              this.config.value=x;
              //update chart
          }
        }]);
    }
    

    wrapping controls with a call to @{link g} will perform type checking todo- specifiy the link to g above properly/ document better

    Returns AnyGuiSpec[]

    an array of objects describing tweakable parameters

  • Checks to see if the column is used in the chart If so, the chart will be removed but no callbacks will be involved

    Parameters

    • column: string

    Returns boolean

    true if the chart has been removed

  • Called by the datastore when the data is filtered. Needs to be implemented on any subclasses.

    Parameters

    • dim: any

      the dimension that has been filtered

    Returns void

  • adds (or removes) the color legend depending on the chart's config color_legend.display value - assumes chart has a get colorLegend method

    Returns void

  • Sets the size of the graph. If no parameters are supplied then the graph will be resized based on it container. Subclasses should overide this, but call the super method first which will calculate width and height of the content div

    Parameters

    • x: any

      The new width

    • y: any

      The new height;

    Returns void