Skip to content

GraphModel

John Lee edited this page May 30, 2013 · 5 revisions

This component is responsible for getting the data from the server and creates an object called GraphModel.


Properties

All GraphModel properties are stored in an object called GraphModel.options

  • GraphModel.options.allData
    • Type: Object
    • Contains all optimized graph and script info
  • GraphModel.options.graphType
    • Type: String
    • The current graph type being displayed (‘optimized’ or ‘unoptimized’)
  • GraphModel.options.jobInfoSel
    • Type: String
    • Selector for script name and user in navbar
  • GraphModel.options.pigOptimizedData
    • Type: Object
    • Pig data for the optimized graph
  • GraphModel.options.pigUnoptimizedData
    • Type: Object
    • Pig data for the unoptimized graph
  • GraphModel.options.runStatsData
    • Type: Object
    • All run stats data for map-reduce jobs
  • GraphModel.options.sampleOutputsData
    • Type: Object
    • Contains sample output data for map-reduce jobs
  • GraphModel.options.svgOptimized
    • Type: Object
    • SVG markup for the optimized graph
  • GraphModel.options.svgUnoptimized
    • Type: Object
    • SVG markup for the unoptimized graph
  • GraphModel.options.uuid
    • Type: String
    • The uuid for the Lipstick job

Methods

  • GraphModel.getPigData()
    • Return the Pig data for the active graph type (optimized or unoptimized).
    • @return {Object} Returns Pig data
  • GraphModel.getRunStats()
    • Get the run stats data for the Graph.
  • GraphModel.getSvgData()
    • Return the SVG markup for the active graph type (optimized or unoptimized).
    • @return {String} Returns SVG markup
  • GraphModel.initialize(uuid)
    • Initialize the GraphModel object.
    • @param {String} uuid The uuid of graph
  • GraphModel.populateSampleOutputData(startNodeId, scopeId)
    • Populate the sample output data modal with sample data.
    • @param {Number} startNodeId The edge’s start node ID (this is used to get schema)
    • @param {Number} scopeId The map-reduce job’s scopeId
  • GraphModel.startListeners()
    • Start listening to custom events.

Custom Events

Triggers

  • loadGraphModel.tossboss-graph-model
  • loadRunStatsData.tossboss-graph-model
  • loadSampleOutputData.tossboss-graph-model

Listens

  • clickEdge.tossboss-graph-view
Clone this wiki locally