Best JavaScript code snippet using storybook-root
google.mock.js
Source:google.mock.js
1(function() {2 angular.module('googlechart.mocks', [])3 .factory('mockGoogleApi', mockGoogleApi);4 5 function mockGoogleApi() {6 // Copyright 2009 Google Inc.7 // All Rights Reserved.8 /**9 * This file exposes the external Google Visualization API.10 *11 * The file can be used to enable auto complete of objects and methods provided by the12 * Google Visualization API, and for easier exploration of the API.13 *14 * To enable auto complete in a development environment - copy the file into the project15 * you are working on where the development tool you are using can index the file.16 *17 * Disclaimer: there may be missing classes and methods and the file may18 * be updated and/or changed. For the most up to date API reference please visit:19 * {@link http://code.google.com/intl/iw/apis/visualization/documentation/reference.html}20 */21 var google = {};22 google.visualization = {};23 /** @constructor */24 google.visualization.DataTable = function(opt_data, opt_version) {};25 google.visualization.DataTable.prototype.getNumberOfRows = function() {};26 google.visualization.DataTable.prototype.getNumberOfColumns = function() {};27 google.visualization.DataTable.prototype.clone = function() {};28 google.visualization.DataTable.prototype.getColumnId = function(columnIndex) {};29 google.visualization.DataTable.prototype.getColumnIndex = function(columnId) {};30 google.visualization.DataTable.prototype.getColumnLabel = function(columnIndex) {};31 google.visualization.DataTable.prototype.getColumnPattern = function(columnIndex) {};32 google.visualization.DataTable.prototype.getColumnRole = function(columnIndex) {};33 google.visualization.DataTable.prototype.getColumnType = function(columnIndex) {};34 google.visualization.DataTable.prototype.getValue = function(rowIndex, columnIndex) {};35 google.visualization.DataTable.prototype.getFormattedValue = function(rowIndex, columnIndex) {};36 google.visualization.DataTable.prototype.getProperty = function(rowIndex, columnIndex, property) {};37 google.visualization.DataTable.prototype.getProperties = function(rowIndex, columnIndex) {};38 google.visualization.DataTable.prototype.getTableProperties = function() {};39 google.visualization.DataTable.prototype.getTableProperty = function(property) {};40 google.visualization.DataTable.prototype.setTableProperties = function(properties) {};41 google.visualization.DataTable.prototype.setTableProperty = function(property, value) {};42 google.visualization.DataTable.prototype.setValue = function(rowIndex, columnIndex, value) {};43 google.visualization.DataTable.prototype.setFormattedValue = function(rowIndex, columnIndex, formattedValue) {};44 google.visualization.DataTable.prototype.setProperties = function(rowIndex, columnIndex, properties) {};45 google.visualization.DataTable.prototype.setProperty = function(rowIndex, columnIndex, property, value) {};46 google.visualization.DataTable.prototype.setCell = function(rowIndex, columnIndex, opt_value, opt_formattedValue, opt_properties) {};47 google.visualization.DataTable.prototype.setRowProperties = function(rowIndex, properties) {};48 google.visualization.DataTable.prototype.setRowProperty = function(rowIndex, property, value) {};49 google.visualization.DataTable.prototype.getRowProperty = function(rowIndex, property) {};50 google.visualization.DataTable.prototype.getRowProperties = function(rowIndex) {};51 google.visualization.DataTable.prototype.setColumnLabel = function(columnIndex, newLabel) {};52 google.visualization.DataTable.prototype.setColumnProperties = function(columnIndex, properties) {};53 google.visualization.DataTable.prototype.setColumnProperty = function(columnIndex, property, value) {};54 google.visualization.DataTable.prototype.getColumnProperty = function(columnIndex, property) {};55 google.visualization.DataTable.prototype.getColumnProperties = function(columnIndex) {};56 google.visualization.DataTable.prototype.insertColumn = function(atColIndex, type, opt_label, opt_id) {};57 google.visualization.DataTable.prototype.addColumn = function(type, opt_label, opt_id) {};58 google.visualization.DataTable.prototype.insertRows = function(atRowIndex, numOrArray) {};59 google.visualization.DataTable.prototype.addRows = function(numOrArray) {};60 google.visualization.DataTable.prototype.addRow = function(opt_cellArray) {};61 google.visualization.DataTable.prototype.getColumnRange = function(columnIndex) {};62 google.visualization.DataTable.prototype.getSortedRows = function(sortColumns) {};63 google.visualization.DataTable.prototype.sort = function(sortColumns) {};64 google.visualization.DataTable.prototype.getDistinctValues = function(column) {};65 google.visualization.DataTable.prototype.getFilteredRows = function(columnFilters) {};66 google.visualization.DataTable.prototype.removeRows = function(fromRowIndex, numRows) {};67 google.visualization.DataTable.prototype.removeRow = function(rowIndex) {};68 google.visualization.DataTable.prototype.removeColumns = function(fromColIndex, numCols) {};69 google.visualization.DataTable.prototype.removeColumn = function(colIndex) {};70 /** @return {string} JSON representation. */71 google.visualization.DataTable.prototype.toJSON = function() {};72 /** @constructor */73 google.visualization.QueryResponse = function(responseObj) {};74 google.visualization.QueryResponse.getVersionFromResponse = function(responseObj) {};75 google.visualization.QueryResponse.prototype.getVersion = function() {};76 google.visualization.QueryResponse.prototype.getExecutionStatus = function() {};77 google.visualization.QueryResponse.prototype.isError = function() {};78 google.visualization.QueryResponse.prototype.hasWarning = function() {};79 google.visualization.QueryResponse.prototype.containsReason = function(reason) {};80 google.visualization.QueryResponse.prototype.getDataSignature = function() {};81 google.visualization.QueryResponse.prototype.getDataTable = function() {};82 google.visualization.QueryResponse.prototype.getReasons = function() {};83 google.visualization.QueryResponse.prototype.getMessage = function() {};84 google.visualization.QueryResponse.prototype.getDetailedMessage = function() {};85 /** @constructor */86 google.visualization.Query = function(dataSourceUrl, opt_options) {};87 google.visualization.Query.refreshAllQueries = function() {};88 google.visualization.Query.setResponse = function(response) {};89 google.visualization.Query.prototype.setRefreshInterval = function(intervalSeconds) {};90 google.visualization.Query.prototype.send = function(responseHandler) {};91 google.visualization.Query.prototype.makeRequest = function(responseHandler, opt_params) {};92 google.visualization.Query.prototype.abort = function() {};93 google.visualization.Query.prototype.setTimeout = function(timeoutSeconds) {};94 google.visualization.Query.prototype.setRefreshable = function(refreshable) {};95 google.visualization.Query.prototype.setQuery = function(queryString) {};96 google.visualization.errors = {};97 google.visualization.errors.addError = function(container, message, opt_detailedMessage, opt_options) {};98 google.visualization.errors.removeAll = function(container) {};99 google.visualization.errors.addErrorFromQueryResponse = function(container, response) {};100 google.visualization.errors.removeError = function(id) {};101 google.visualization.errors.getContainer = function(errorId) {};102 google.visualization.events = {};103 google.visualization.events.addListener = function(eventSource, eventName, eventHandler) {};104 google.visualization.events.trigger = function(eventSource, eventName, eventDetails) {};105 google.visualization.events.removeListener = function(listener) {};106 google.visualization.events.removeAllListeners = function(eventSource) {};107 /** @constructor */108 google.visualization.DataView = function(dataTable) {};109 google.visualization.DataView.fromJSON = function(dataTable, view) {};110 google.visualization.DataView.prototype.setColumns = function(colIndices) {};111 google.visualization.DataView.prototype.setRows = function(arg0, opt_arg1) {};112 google.visualization.DataView.prototype.getViewColumns = function() {};113 google.visualization.DataView.prototype.getViewRows = function() {};114 google.visualization.DataView.prototype.hideColumns = function(colIndices) {};115 google.visualization.DataView.prototype.hideRows = function(arg0, opt_arg1) {};116 google.visualization.DataView.prototype.getViewColumnIndex = function(tableColumnIndex) {};117 google.visualization.DataView.prototype.getViewRowIndex = function(tableRowIndex) {};118 google.visualization.DataView.prototype.getTableColumnIndex = function(viewColumnIndex) {};119 google.visualization.DataView.prototype.getUnderlyingTableColumnIndex = function(viewColumnIndex) {};120 google.visualization.DataView.prototype.getTableRowIndex = function(viewRowIndex) {};121 google.visualization.DataView.prototype.getUnderlyingTableRowIndex = function(viewRowIndex) {};122 google.visualization.DataView.prototype.getNumberOfRows = function() {};123 google.visualization.DataView.prototype.getNumberOfColumns = function() {};124 google.visualization.DataView.prototype.getColumnId = function(columnIndex) {};125 google.visualization.DataView.prototype.getColumnIndex = function(columnId) {};126 google.visualization.DataView.prototype.getColumnLabel = function(columnIndex) {};127 google.visualization.DataView.prototype.getColumnPattern = function(columnIndex) {};128 google.visualization.DataView.prototype.getColumnRole = function(columnIndex) {};129 google.visualization.DataView.prototype.getColumnType = function(columnIndex) {};130 google.visualization.DataView.prototype.getValue = function(rowIndex, columnIndex) {};131 google.visualization.DataView.prototype.getFormattedValue = function(rowIndex, columnIndex) {};132 google.visualization.DataView.prototype.getProperty = function(rowIndex, columnIndex, property) {};133 google.visualization.DataView.prototype.getColumnProperty = function(columnIndex, property) {};134 google.visualization.DataView.prototype.getColumnProperties = function(columnIndex) {};135 google.visualization.DataView.prototype.getTableProperty = function(property) {};136 google.visualization.DataView.prototype.getTableProperties = function() {};137 google.visualization.DataView.prototype.getRowProperty = function(rowIndex, property) {};138 google.visualization.DataView.prototype.getRowProperties = function(rowIndex) {};139 google.visualization.DataView.prototype.getColumnRange = function(columnIndex) {};140 google.visualization.DataView.prototype.getDistinctValues = function(columnIndex) {};141 google.visualization.DataView.prototype.getSortedRows = function(sortColumns) {};142 google.visualization.DataView.prototype.getFilteredRows = function(columnFilters) {};143 google.visualization.DataView.prototype.toDataTable = function() {};144 /** @return {string} JSON representation. */145 google.visualization.DataView.prototype.toJSON = function() {};146 /** @constructor */147 google.visualization.ArrowFormat = function(opt_options) {};148 google.visualization.ArrowFormat.prototype.format = function(dataTable, columnIndex) {};149 /** @constructor */150 google.visualization.BarFormat = function(opt_options) {};151 google.visualization.BarFormat.prototype.format = function(dataTable, columnIndex) {};152 /** @constructor */153 google.visualization.ColorFormat = function() {};154 google.visualization.ColorFormat.prototype.addRange = function(from, to, color, bgcolor) {};155 google.visualization.ColorFormat.prototype.addGradientRange = function(from, to, color, fromBgColor, toBgColor) {};156 google.visualization.ColorFormat.prototype.format = function(dataTable, columnIndex) {};157 /** @constructor */158 google.visualization.DateFormat = function(opt_options) {};159 google.visualization.DateFormat.prototype.format = function(dataTable, columnIndex) {};160 google.visualization.DateFormat.prototype.formatValue = function(value) {};161 /** @constructor */162 google.visualization.NumberFormat = function(opt_options) {};163 google.visualization.NumberFormat.prototype.format = function(dataTable, columnIndex) {};164 google.visualization.NumberFormat.prototype.formatValue = function(value) {};165 google.visualization.NumberFormat.DECIMAL_SEP;166 google.visualization.NumberFormat.GROUP_SEP;167 google.visualization.NumberFormat.DECIMAL_PATTERN;168 /** @constructor */169 google.visualization.PatternFormat = function(pattern) {};170 google.visualization.PatternFormat.prototype.format = function(dataTable, srcColumnIndices, opt_dstColumnIndex) {};171 /** @constructor */172 google.visualization.GadgetHelper = function() {};173 google.visualization.GadgetHelper.prototype.createQueryFromPrefs = function(prefs) {};174 google.visualization.GadgetHelper.prototype.validateResponse = function(response) {};175 /** @constructor */176 google.visualization.AnnotatedTimeLine = function(container) {};177 google.visualization.AnnotatedTimeLine.prototype.draw = function(data, opt_options) {};178 google.visualization.AnnotatedTimeLine.prototype.getSelection = function() {};179 google.visualization.AnnotatedTimeLine.prototype.getVisibleChartRange = function() {};180 google.visualization.AnnotatedTimeLine.prototype.setVisibleChartRange = function(firstDate, lastDate, opt_animate) {};181 google.visualization.AnnotatedTimeLine.prototype.showDataColumns = function(columnIndexes) {};182 google.visualization.AnnotatedTimeLine.prototype.hideDataColumns = function(columnIndexes) {};183 /** @constructor */184 google.visualization.AreaChart = function(container) {};185 google.visualization.AreaChart.prototype.draw = function(data, opt_options, opt_state) {};186 google.visualization.AreaChart.prototype.clearChart = function() {};187 google.visualization.AreaChart.prototype.getSelection = function() {};188 google.visualization.AreaChart.prototype.setSelection = function(selection) {};189 /** @constructor */190 google.visualization.BarChart = function(container) {};191 google.visualization.BarChart.prototype.draw = function(data, opt_options, opt_state) {};192 google.visualization.BarChart.prototype.clearChart = function() {};193 google.visualization.BarChart.prototype.getSelection = function() {};194 google.visualization.BarChart.prototype.setSelection = function(selection) {};195 /** @constructor */196 google.visualization.BubbleChart = function(container) {};197 google.visualization.BubbleChart.prototype.draw = function(data, opt_options, opt_state) {};198 google.visualization.BubbleChart.prototype.clearChart = function() {};199 google.visualization.BubbleChart.prototype.getSelection = function() {};200 google.visualization.BubbleChart.prototype.setSelection = function(selection) {};201 /** @constructor */202 google.visualization.CandlestickChart = function(container) {};203 google.visualization.CandlestickChart.prototype.draw = function(data, opt_options, opt_state) {};204 google.visualization.CandlestickChart.prototype.clearChart = function() {};205 google.visualization.CandlestickChart.prototype.getSelection = function() {};206 google.visualization.CandlestickChart.prototype.setSelection = function(selection) {};207 /** @constructor */208 google.visualization.ColumnChart = function(container) {};209 google.visualization.ColumnChart.prototype.draw = function(data, opt_options, opt_state) {};210 google.visualization.ColumnChart.prototype.clearChart = function() {};211 google.visualization.ColumnChart.prototype.getSelection = function() {};212 google.visualization.ColumnChart.prototype.setSelection = function(selection) {};213 /** @constructor */214 google.visualization.ComboChart = function(container) {};215 google.visualization.ComboChart.prototype.draw = function(data, opt_options, opt_state) {};216 google.visualization.ComboChart.prototype.clearChart = function() {};217 google.visualization.ComboChart.prototype.getSelection = function() {};218 google.visualization.ComboChart.prototype.setSelection = function(selection) {};219 /** @constructor */220 google.visualization.Gauge = function(container) {};221 google.visualization.Gauge.prototype.draw = function(dataTable, opt_options) {};222 google.visualization.Gauge.prototype.clearChart = function() {};223 /** @constructor */224 google.visualization.GeoChart = function(container) {};225 google.visualization.GeoChart.mapExists = function(userOptions) {};226 google.visualization.GeoChart.prototype.clearChart = function() {};227 google.visualization.GeoChart.prototype.draw = function(dataTable, userOptions, opt_state) {};228 google.visualization.GeoChart.prototype.getSelection = function() {};229 google.visualization.GeoChart.prototype.setSelection = function(selection) {};230 /** @constructor */231 google.visualization.GeoMap = function(container) {};232 google.visualization.GeoMap.clickOnRegion = function(id, zoomLevel, segmentBy, instanceIndex) {};233 google.visualization.GeoMap.prototype.draw = function(dataTable, opt_options) {};234 google.visualization.GeoMap.prototype.getSelection = function() {};235 google.visualization.GeoMap.prototype.setSelection = function(selection) {};236 /** @constructor */237 google.visualization.Map = function(container) {};238 google.visualization.Map.prototype.draw = function(dataTable, opt_options) {};239 google.visualization.Map.prototype.getSelection = function() {};240 google.visualization.Map.prototype.setSelection = function(selection) {};241 /** @constructor */242 google.visualization.ImageAreaChart = function(container) {};243 google.visualization.ImageAreaChart.prototype.draw = function(data, opt_options) {};244 /** @constructor */245 google.visualization.ImageBarChart = function(container) {};246 google.visualization.ImageBarChart.prototype.draw = function(data, opt_options) {};247 /** @constructor */248 google.visualization.ImageCandlestickChart = function(container) {};249 google.visualization.ImageCandlestickChart.prototype.draw = function(data, opt_options) {};250 /** @constructor */251 google.visualization.ImageChart = function(container) {};252 google.visualization.ImageChart.prototype.draw = function(data, opt_options) {};253 /** @constructor */254 google.visualization.ImageLineChart = function(container) {};255 google.visualization.ImageLineChart.prototype.draw = function(data, opt_options) {};256 /** @constructor */257 google.visualization.ImagePieChart = function(container) {};258 google.visualization.ImagePieChart.prototype.draw = function(data, opt_options) {};259 /** @constructor */260 google.visualization.ImageSparkLine = function(container, opt_domHelper) {};261 google.visualization.ImageSparkLine.prototype.draw = function(dataTable, opt_options) {};262 google.visualization.ImageSparkLine.prototype.getSelection = function() {};263 google.visualization.ImageSparkLine.prototype.setSelection = function(selection) {};264 /** @constructor */265 google.visualization.IntensityMap = function(container) {};266 google.visualization.IntensityMap.prototype.draw = function(dataTable, opt_options) {};267 google.visualization.IntensityMap.prototype.getSelection = function() {};268 google.visualization.IntensityMap.prototype.setSelection = function(selection) {};269 /** @constructor */270 google.visualization.LineChart = function(container) {};271 google.visualization.LineChart.prototype.draw = function(data, opt_options, opt_state) {};272 google.visualization.LineChart.prototype.clearChart = function() {};273 google.visualization.LineChart.prototype.getSelection = function() {};274 google.visualization.LineChart.prototype.setSelection = function(selection) {};275 /** @constructor */276 google.visualization.MotionChart = function(container) {};277 google.visualization.MotionChart.prototype.draw = function(dataTable, opt_options) {};278 google.visualization.MotionChart.prototype.getState = function() {};279 /** @constructor */280 google.visualization.OrgChart = function(container) {};281 google.visualization.OrgChart.prototype.draw = function(dataTable, opt_options) {};282 google.visualization.OrgChart.prototype.getSelection = function() {};283 google.visualization.OrgChart.prototype.setSelection = function(selection) {};284 google.visualization.OrgChart.prototype.getCollapsedNodes = function() {};285 google.visualization.OrgChart.prototype.getChildrenIndexes = function(rowInd) {};286 google.visualization.OrgChart.prototype.collapse = function(rowInd, collapse) {};287 /** @constructor */288 google.visualization.PieChart = function(container) {};289 google.visualization.PieChart.prototype.draw = function(data, opt_options, opt_state) {};290 google.visualization.PieChart.prototype.clearChart = function() {};291 google.visualization.PieChart.prototype.getSelection = function() {};292 google.visualization.PieChart.prototype.setSelection = function(selection) {};293 /** @constructor */294 google.visualization.ScatterChart = function(container) {};295 google.visualization.ScatterChart.prototype.draw = function(data, opt_options, opt_state) {};296 google.visualization.ScatterChart.prototype.clearChart = function() {};297 google.visualization.ScatterChart.prototype.getSelection = function() {};298 google.visualization.ScatterChart.prototype.setSelection = function(selection) {};299 /** @constructor */300 google.visualization.SparklineChart = function(container) {};301 google.visualization.SparklineChart.prototype.draw = function(data, opt_options, opt_state) {};302 google.visualization.SparklineChart.prototype.clearChart = function() {};303 google.visualization.SparklineChart.prototype.getSelection = function() {};304 google.visualization.SparklineChart.prototype.setSelection = function(selection) {};305 /** @constructor */306 google.visualization.SteppedAreaChart = function(container) {};307 google.visualization.SteppedAreaChart.prototype.draw = function(data, opt_options, opt_state) {};308 google.visualization.SteppedAreaChart.prototype.clearChart = function() {};309 google.visualization.SteppedAreaChart.prototype.getSelection = function() {};310 google.visualization.SteppedAreaChart.prototype.setSelection = function(selection) {};311 /** @constructor */312 google.visualization.Table = function(container) {};313 google.visualization.Table.prototype.draw = function(dataTable, opt_options) {};314 google.visualization.Table.prototype.clearChart = function() {};315 google.visualization.Table.prototype.getSortInfo = function() {};316 google.visualization.Table.prototype.getSelection = function() {};317 google.visualization.Table.prototype.setSelection = function(selection) {};318 /** @constructor */319 google.visualization.TreeMap = function(container) {};320 google.visualization.TreeMap.prototype.draw = function(dataTable, opt_options) {};321 google.visualization.TreeMap.prototype.clearChart = function() {};322 google.visualization.TreeMap.prototype.getSelection = function() {};323 google.visualization.TreeMap.prototype.setSelection = function(selection) {};324 google.visualization.drawToolbar = function(container, components) {};325 /** @constructor */326 google.visualization.ChartWrapper = function(opt_specification) {};327 google.visualization.ChartWrapper.prototype.draw = function(opt_container) {};328 google.visualization.ChartWrapper.prototype.getDataSourceUrl = function() {};329 google.visualization.ChartWrapper.prototype.getDataTable = function() {};330 // getChart() was not in original file, but is in documentation331 google.visualization.ChartWrapper.prototype.getChart = function() {};332 google.visualization.ChartWrapper.prototype.getChartName = function() {};333 google.visualization.ChartWrapper.prototype.getChartType = function() {};334 google.visualization.ChartWrapper.prototype.getContainerId = function() {};335 google.visualization.ChartWrapper.prototype.getQuery = function() {};336 google.visualization.ChartWrapper.prototype.getRefreshInterval = function() {};337 google.visualization.ChartWrapper.prototype.getView = function() {};338 google.visualization.ChartWrapper.prototype.getOption = function(key, opt_default) {};339 google.visualization.ChartWrapper.prototype.getOptions = function() {};340 google.visualization.ChartWrapper.prototype.setDataSourceUrl = function(dataSourceUrl) {};341 google.visualization.ChartWrapper.prototype.setDataTable = function(dataTable) {};342 google.visualization.ChartWrapper.prototype.setChartName = function(chartName) {};343 google.visualization.ChartWrapper.prototype.setChartType = function(chartType) {};344 google.visualization.ChartWrapper.prototype.setContainerId = function(containerId) {};345 google.visualization.ChartWrapper.prototype.setQuery = function(query) {};346 google.visualization.ChartWrapper.prototype.setRefreshInterval = function(refreshInterval) {};347 google.visualization.ChartWrapper.prototype.setView = function(view) {};348 google.visualization.ChartWrapper.prototype.setOption = function(key, value) {};349 google.visualization.ChartWrapper.prototype.setOptions = function(options) {};350 /** @return {string} JSON representation. */351 google.visualization.ChartWrapper.prototype.toJSON = function() {};352 /** @constructor */353 google.visualization.ControlWrapper = function(opt_specification) {};354 google.visualization.ControlWrapper.prototype.draw = function(opt_container) {};355 google.visualization.ControlWrapper.prototype.toJSON = function() {};356 google.visualization.ControlWrapper.prototype.getDataSourceUrl = function() {};357 google.visualization.ControlWrapper.prototype.getDataTable = function() {};358 google.visualization.ControlWrapper.prototype.getControlName = function() {};359 google.visualization.ControlWrapper.prototype.getControlType = function() {};360 google.visualization.ControlWrapper.prototype.getContainerId = function() {};361 google.visualization.ControlWrapper.prototype.getQuery = function() {};362 google.visualization.ControlWrapper.prototype.getRefreshInterval = function() {};363 google.visualization.ControlWrapper.prototype.getView = function() {};364 google.visualization.ControlWrapper.prototype.getOption = function(key, opt_default) {};365 google.visualization.ControlWrapper.prototype.getOptions = function() {};366 google.visualization.ControlWrapper.prototype.setDataSourceUrl = function(dataSourceUrl) {};367 google.visualization.ControlWrapper.prototype.setDataTable = function(dataTable) {};368 google.visualization.ControlWrapper.prototype.setControlName = function(controlName) {};369 google.visualization.ControlWrapper.prototype.setControlType = function(controlType) {};370 google.visualization.ControlWrapper.prototype.setContainerId = function(containerId) {};371 google.visualization.ControlWrapper.prototype.setQuery = function(query) {};372 google.visualization.ControlWrapper.prototype.setRefreshInterval = function(refreshInterval) {};373 google.visualization.ControlWrapper.prototype.setView = function(view) {};374 google.visualization.ControlWrapper.prototype.setOption = function(key, value) {};375 google.visualization.ControlWrapper.prototype.setOptions = function(options) {};376 /** @return {string} JSON representation. */377 google.visualization.ChartWrapper.prototype.toJSON = function() {};378 /** @constructor */379 google.visualization.ChartEditor = function(opt_config) {};380 google.visualization.ChartEditor.prototype.openDialog = function(specification, opt_options) {};381 google.visualization.ChartEditor.prototype.getChartWrapper = function() {};382 google.visualization.ChartEditor.prototype.setChartWrapper = function(chartWrapper) {};383 google.visualization.ChartEditor.prototype.closeDialog = function() {};384 /** @constructor */385 google.visualization.Dashboard = function(container) {};386 google.visualization.Dashboard.prototype.bind = function(controls, participants) {};387 google.visualization.Dashboard.prototype.draw = function(dataTable) {};388 /** @constructor */389 google.visualization.StringFilter = function(container) {};390 google.visualization.StringFilter.prototype.draw = function(dataTable, opt_options, opt_state) {};391 google.visualization.StringFilter.prototype.applyFilter = function() {};392 google.visualization.StringFilter.prototype.getState = function() {};393 google.visualization.StringFilter.prototype.resetControl = function() {};394 /** @constructor */395 google.visualization.NumberRangeFilter = function(container) {};396 google.visualization.NumberRangeFilter.prototype.draw = function(dataTable, opt_options, opt_state) {};397 google.visualization.NumberRangeFilter.prototype.applyFilter = function() {};398 google.visualization.NumberRangeFilter.prototype.getState = function() {};399 google.visualization.NumberRangeFilter.prototype.resetControl = function() {};400 /** @constructor */401 google.visualization.CategoryFilter = function(container) {};402 google.visualization.CategoryFilter.prototype.draw = function(dataTable, opt_options, opt_state) {};403 google.visualization.CategoryFilter.prototype.applyFilter = function() {};404 google.visualization.CategoryFilter.prototype.getState = function() {};405 google.visualization.CategoryFilter.prototype.resetControl = function() {};406 /** @constructor */407 google.visualization.ChartRangeFilter = function(container) {};408 google.visualization.ChartRangeFilter.prototype.draw = function(dataTable, opt_options, opt_state) {};409 google.visualization.ChartRangeFilter.prototype.applyFilter = function() {};410 google.visualization.ChartRangeFilter.prototype.getState = function() {};411 google.visualization.ChartRangeFilter.prototype.resetControl = function() {};412 return google;413 }...
api-visualizations-tests.js
Source:api-visualizations-tests.js
1var require = patchRequire( require ),2 spaceghost = require( 'spaceghost' ).fromCasper( casper ),3 xpath = require( 'casper' ).selectXPath,4 utils = require( 'utils' ),5 format = utils.format;6spaceghost.test.begin( 'Test the visualizations API', 0, function suite( test ){7 spaceghost.start();8 // =================================================================== SET UP9 var email = spaceghost.user.getRandomEmail(),10 password = '123456';11 if( spaceghost.fixtureData.testUser ){12 email = spaceghost.fixtureData.testUser.email;13 password = spaceghost.fixtureData.testUser.password;14 }15 spaceghost.user.loginOrRegisterUser( email, password );16 // =================================================================== TESTS17 spaceghost.openHomePage().then( function(){18 var ALWAYS_CREATE = true,19 indexKeys = [20 'id', 'title', 'type', 'dbkey', 'url'21 ],22 showKeys = indexKeys.concat([23 'user_id', 'model_class', 'revisions', 'latest_revision', 'annotation'24 ]),25 revisionKeys = [26 'id', 'title', 'visualization_id', 'dbkey', 'model_class', 'config'27 ];28 // ------------------------------------------------------------------------------------------- set up29 var visualizationIndex = this.api.visualizations.index();30 if( ALWAYS_CREATE || !visualizationIndex.length ){31 // post a visualization32 this.info( 'creating new visualization for tests' );33 var testVisualization = this.api.visualizations.create({34 title : 'Test Visualization',35 // needs to be unique36 slug : 'test-visualization-' + Date.now(),37 type : 'test',38 dbkey : 'hg17',39 annotation : 'this is a test of the emergency visualization system',40 config : {41 x : 10,42 y : 1243 }44 });45 this.debug( this.jsonStr( testVisualization ) );46 }47 // ------------------------------------------------------------------------------------------- INDEX48 this.test.comment( 'index should get a list of visualizations' );49 visualizationIndex = this.api.visualizations.index();50 this.debug( this.jsonStr( visualizationIndex ) );51 this.test.assert( utils.isArray( visualizationIndex ),52 "index returned an array: length " + visualizationIndex.length );53 this.test.assert( visualizationIndex.length >= 1, 'Has at least one visualization' );54 var firstVisualization = visualizationIndex[0];55 this.test.assert( this.hasKeys( firstVisualization, indexKeys ), 'Has the proper keys' );56 this.test.assert( this.api.isEncodedId( firstVisualization.id ), 'Id appears well-formed' );57 //TODO: index searching58 //TODO: anon user59 //TODO: admin user60 // ------------------------------------------------------------------------------------------- SHOW61 this.test.comment( 'show should get a visualization details object' );62 var visualizationShow = this.api.visualizations.show( firstVisualization.id );63 this.debug( this.jsonStr( visualizationShow ) );64 this.test.assert( this.hasKeys( visualizationShow, showKeys ), 'Has the proper keys' );65 this.test.assert( visualizationShow.model_class === 'Visualization',66 'Has the proper model_class: ' + visualizationShow.model_class );67 this.test.comment( 'a visualization details object should contain an array of revision ids' );68 var revisions = visualizationShow.revisions;69 this.test.assert( utils.isArray( revisions ), 'revisions is an array' );70 this.test.assert( revisions.length >= 1, 'revisions has at least one entry' );71 var areIds = true;72 revisions.forEach( function( revision ){73 if( !spaceghost.api.isEncodedId( revision ) ){ areIds = false; }74 });75 this.test.assert( areIds, 'all revisions are ids' );76 this.test.comment( 'a visualization details object should contain a subobject of the latest revision' );77 var latestRevision = visualizationShow.latest_revision;78 this.test.assert( utils.isObject( latestRevision ), 'latestRevision is an object' );79 this.test.assert( this.hasKeys( latestRevision, revisionKeys ), 'latestRevision has the proper keys' );80 this.test.assert( latestRevision.model_class === 'VisualizationRevision',81 'Has the proper model_class: ' + latestRevision.model_class );82 this.test.assert( latestRevision.visualization_id === visualizationShow.id,83 'revision visualization_id matches containing visualization id: ' + latestRevision.visualization_id );84 this.test.assert( visualizationShow.revisions.indexOf( latestRevision.id ) !== -1,85 'found latest_revision id in revisions' );86 this.test.comment( 'a visualization revision should contain a subobject for the config' );87 var config = latestRevision.config;88 this.test.assert( utils.isObject( config ), 'config is an object:\n' + this.jsonStr( config ) );89 //TODO: url in visualizationIndex == show url90 //TODO: non existing id throws error91 //TODO: anon user92 //TODO: user1 has no permissions to show user293 // ------------------------------------------------------------------------------------------- CREATE94 this.test.comment( 'Calling create should create a new visualization and allow setting the name' );95 var visualizationData = {96 title : 'Created Visualization',97 // needs to be unique98 slug : 'created-visualization-' + Date.now(),99 type : 'test',100 dbkey : 'hg17',101 annotation : 'invisible visualization',102 config : {103 x : 10,104 y : 12105 }106 };107 var created = this.api.visualizations.create( visualizationData );108 this.debug( 'returned from create:\n' + this.jsonStr( created ) );109 this.test.assert( this.api.isEncodedId( created.id ), "create returned an id: " + created.id );110 // check v. show111 visualizationShow = this.api.visualizations.show( created.id );112 this.debug( 'visualizationShow:\n' + this.jsonStr( visualizationShow ) );113 // config is re-located into a revision and won't be there114 //this.test.assert( compareObjs( visualizationShow, visualizationData, [ 'config' ] ),115 // "show results seem to match create data" );116 // the following errors are produced within base.controller.UsesVisualizationsMixin._create_visualization117 this.test.comment( 'Calling create with a non-unique slug will cause an API error' );118 this.api.assertRaises( function(){119 created = this.api.visualizations.create( visualizationData );120 }, 400, 'visualization identifier must be unique' );121 this.test.comment( 'Calling create with no title will cause an API error' );122 visualizationData.title = '';123 this.api.assertRaises( function(){124 created = this.api.visualizations.create( visualizationData );125 }, 400, 'visualization name is required' );126 visualizationData.title = 'Created Visualization';127 this.test.comment( 'Calling create with improper characters in the slug will cause an API error' );128 var oldSlug = visualizationData.slug;129 visualizationData.slug = '123_()';130 this.api.assertRaises( function(){131 created = this.api.visualizations.create( visualizationData );132 }, 400, "visualization identifier must consist of only lowercase letters, numbers, and the '-' character" );133 visualizationData.slug = oldSlug;134 this.test.comment( 'Calling create with an unrecognized key will be ignored' );135 visualizationData.title = 'Unrecognized key';136 visualizationData.slug = 'unrecognized-key';137 visualizationData.bler = 'blah';138 created = this.api.visualizations.create( visualizationData );139 this.test.assert( created.bler === undefined );140 delete visualizationData.bler;141 this.test.comment( 'Calling create with an unparsable JSON config will cause an API error' );142 visualizationData.title = 'Unparsable';143 visualizationData.slug = 'unparsable';144 visualizationData.config = '3 = nime';145 this.api.assertRaises( function(){146 created = this.api.visualizations.create( visualizationData );147 }, 400, "config must be a dictionary: <type 'unicode'>" );148 // ------------------------------------------------------------------------------------------ UPDATE149 // ........................................................................................... idiot proofing150 //this.test.comment( 'updating using a nonsense key should fail with an error' );151 //returned = this.api.visualizations.update( created.id, { bler : 'blah' });152 ////TODO: this isn't returning an object...153 //this.debug( 'returned:' + this.jsonStr( returned ) );154 //this.test.assert( returned.bler === undefined );155 this.test.comment( 'updating by attempting to change type should cause an error' );156 this.api.assertRaises( function(){157 returned = this.api.visualizations.update( created.id, { title : 30 });158 }, 400, 'title must be a string or unicode' );159 //TODO: the other types...160 // ........................................................................................... title161 //this.test.comment( 'update should create a new visualization revision' );162 //163 //this.test.comment( 'updating with a new title should NOT change the visualization title...' );164 //latestRevision = this.api.visualizations.show( created.id ).latest_revision;165 //returned = this.api.visualizations.update( created.id, {166 // title : 'New title'167 //});168 //visualizationShow = this.api.visualizations.show( created.id );169 //this.debug( this.jsonStr( visualizationShow ) );170 //this.test.assert( visualizationShow.title === visualizationData.title,171 // "Title does not set via update: " + visualizationShow.title );172 });173 // ===================================================================174 spaceghost.run( function(){ test.done(); });...
visualization-object.effects.ts
Source:visualization-object.effects.ts
1import { Injectable } from '@angular/core';2import { Actions, Effect } from '@ngrx/effects';3import * as _ from 'lodash';4import {5 InitializeVisualizationObjectAction, LoadVisualizationFavoriteAction,6 LoadVisualizationFavoriteSuccessAction,7 UpdateVisualizationObjectAction,8 VisualizationObjectActionTypes9} from '../actions/visualization-object.actions';10import { Store } from '@ngrx/store';11import { catchError, map, mergeMap, tap, withLatestFrom } from 'rxjs/operators';12import { VisualizationState, getVisualizationObjectEntities } from '../reducers';13import { Visualization } from '../../models/visualization.model';14import { FavoriteService } from '../../services/favorite.service';15import { of } from 'rxjs/observable/of';16import { getSelectionDimensionsFromFavorite } from '../../helpers/get-selection-dimensions-from-favorite.helper';17import { AddVisualizationLayerAction, LoadVisualizationAnalyticsAction } from '../actions/visualization-layer.actions';18import { VisualizationLayer } from '../../models/visualization-layer.model';19import {20 AddVisualizationConfigurationAction,21 UpdateVisualizationConfigurationAction22} from '../actions/visualization-configuration.actions';23import { getVisualizationLayerType } from '../../helpers/get-visualization-layer-type.helper';24import { getStandardizedVisualizationType } from '../../helpers/get-standardized-visualization-type.helper';25@Injectable()26export class VisualizationObjectEffects {27 constructor(private actions$: Actions, private store: Store<VisualizationState>,28 private favoriteService: FavoriteService) {29 }30 @Effect({dispatch: false}) initializeVisualizationObject$ = this.actions$.ofType(31 VisualizationObjectActionTypes.INITIALIZE_VISUALIZATION_OBJECT).32 pipe(withLatestFrom(this.store.select(getVisualizationObjectEntities)), tap(33 ([action, visualizationObjectEntities]: [InitializeVisualizationObjectAction, {[id: string]: Visualization}]) => {34 const visualizationObject: Visualization = visualizationObjectEntities[action.id];35 if (visualizationObject && visualizationObject.progress && visualizationObject.progress.percent === 0) {36 // set initial global visualization configurations37 this.store.dispatch(new AddVisualizationConfigurationAction(38 {39 id: visualizationObject.visualizationConfigId,40 type: visualizationObject.type,41 currentType: getStandardizedVisualizationType(visualizationObject.type),42 name: visualizationObject.favorite ? visualizationObject.favorite.name : ''43 }));44 // Load favorite information45 if (visualizationObject.favorite) {46 this.store.dispatch(47 new LoadVisualizationFavoriteAction(visualizationObject));48 }49 }50 }));51 @Effect() loadFavorite$ = this.actions$.ofType(VisualizationObjectActionTypes.LOAD_VISUALIZATION_FAVORITE).pipe(52 mergeMap(53 (action: LoadVisualizationFavoriteAction) => this.favoriteService.getFavorite(action.visualization.favorite).54 pipe(map((favorite: any) => new LoadVisualizationFavoriteSuccessAction(action.visualization, favorite)),55 catchError((error) => of(new UpdateVisualizationObjectAction(action.visualization.id, {56 progress: {57 statusCode: error.status,58 statusText: 'Error',59 percent: 100,60 message: error.error61 }62 })63 )))));64 @Effect({dispatch: false}) loadFavoriteSuccess$ = this.actions$.ofType(65 VisualizationObjectActionTypes.LOAD_VISUALIZATION_FAVORITE_SUCCESS).66 pipe(tap((action: LoadVisualizationFavoriteSuccessAction) => {67 const visualizationFavoriteOptions = action.visualization && action.visualization.favorite ?68 action.visualization.favorite : null;69 if (visualizationFavoriteOptions && action.favorite) {70 if (visualizationFavoriteOptions.requireAnalytics) {71 // update global visualization configurations72 this.store.dispatch(new UpdateVisualizationConfigurationAction(73 action.visualization.visualizationConfigId, {74 basemap: action.favorite.basemap,75 zoom: action.favorite.zoom,76 latitude: action.favorite.latitude,77 longitude: action.favorite.longitude,78 }));79 // generate visualization layers80 const visualizationLayers: VisualizationLayer[] = _.map(action.favorite.mapViews || [action.favorite],81 (favoriteLayer: any) => {82 const dataSelections = getSelectionDimensionsFromFavorite(favoriteLayer);83 return {84 id: favoriteLayer.id,85 dataSelections,86 layerType: getVisualizationLayerType(action.visualization.favorite.type, favoriteLayer),87 analytics: null,88 config: {...favoriteLayer, visualizationType: action.visualization.type}89 };90 });91 // Add visualization Layers92 _.each(visualizationLayers, visualizationLayer => {93 this.store.dispatch(new AddVisualizationLayerAction(visualizationLayer));94 });95 // Update visualization object96 this.store.dispatch(new UpdateVisualizationObjectAction(action.visualization.id, {97 layers: _.map(visualizationLayers, visualizationLayer => visualizationLayer.id),98 progress: {99 statusCode: 200,100 statusText: 'OK',101 percent: 50,102 message: 'Favorite information has been loaded'103 }104 }));105 //Load analytics for visualization layers106 this.store.dispatch(new LoadVisualizationAnalyticsAction(action.visualization.id, visualizationLayers));107 } else {108 const visualizationLayers: VisualizationLayer[] = _.map([action.favorite], favoriteLayer => {109 return {110 id: favoriteLayer.id,111 analytics: {112 rows: favoriteLayer[visualizationFavoriteOptions.type]113 }114 };115 });116 // Update visualization object117 this.store.dispatch(new UpdateVisualizationObjectAction(action.visualization.id, {118 layers: _.map(visualizationLayers, visualizationLayer => visualizationLayer.id),119 progress: {120 statusCode: 200,121 statusText: 'OK',122 percent: 100,123 message: 'Information has been loaded'124 }125 }));126 // Add visualization Layers127 _.each(visualizationLayers, visualizationLayer => {128 this.store.dispatch(new AddVisualizationLayerAction(visualizationLayer));129 });130 }131 } else {132 // Update visualization object133 this.store.dispatch(new UpdateVisualizationObjectAction(action.visualization.id, {134 layers: [visualizationFavoriteOptions.id],135 progress: {136 statusCode: 200,137 statusText: 'OK',138 percent: 100,139 message: 'Information has been loaded'140 }141 }));142 }143 }));...
Using AI Code Generation
1import React from 'react';2import { storiesOf } from '@storybook/react';3import { Visualization } from 'storybook-root';4storiesOf('Visualization', module)5 .add('default', () => (6 data={[7 {8 },9 {10 },11 {12 },13 ]}14 ));15import React from 'react';16import { storiesOf } from '@storybook/react';17import { Visualization } from 'storybook-root';18storiesOf('Visualization', module)19 .add('default', () => (20 data={[21 {22 },23 {24 },25 {26 },27 ]}28 ));29import React from 'react';30import { storiesOf } from '@storybook/react';31import { Visualization } from 'storybook-root';32storiesOf('Visualization', module)33 .add('default', () => (34 data={[35 {36 },37 {38 },39 {40 },41 ]}42 ));43import React from 'react';44import { storiesOf } from '@storybook/react';45import { Visualization } from 'storybook-root';46storiesOf('Visualization', module)47 .add('default', () => (48 data={[49 {50 },51 {52 },53 {54 },55 ]}56 ));57import React from 'react
Using AI Code Generation
1import { Visualization } from 'storybook-root';2import { storiesOf } from '@storybook/react';3import React from 'react';4storiesOf('Visualization', module)5 .add('default', () => <Visualization />);6import { Visualization } from 'storybook-root';7export default Visualization;8import { configure } from '@storybook/react';9import { setOptions } from '@storybook/addon-options';10setOptions({
Using AI Code Generation
1import { storiesOf } from '@storybook/react';2import { Visualization } from 'storybook-root';3storiesOf('Visualization', module)4 .add('default', () => <Visualization />);5import React from 'react';6export const Visualization = () => {7 return <div>Visualization</div>;8};9Visualization.propTypes = {};10Visualization.defaultProps = {};11export default Visualization;
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!