_48g.js 6.8 KB

123456
  1. // Licensed Materials - Property of IBM
  2. // IBM Cognos Products: rs
  3. // (C) Copyright IBM Corp. 2003, 2022.
  4. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  5. define(["_2jl","_o8j","com/ibm/vida/control/vida","text!reportstyles/VidaChartTypes.json"],function(_2jl,_o8j,_7cn,_vya){"use strict";function _fce(_4ya){this._8xb=_4ya;};_fce.prototype.request=function(_yal){if(_yal.name=="Atlas"){if(!_yal.payload){return;}this._8xb._v87(_yal.payload.type).then(function(_32e){if(!_32e){return;}_yal.complete({status: _32e.status,mapboxData: _32e.data,ambiguous: _32e.ambiguous,unmatched: _32e.unmatched});}.bind(this));}else if(_yal.name=="Schematics"){var _jal=_yal.payload;switch(_jal.method){case "get":var _apn=_jal.type&&_jal.type=="meta"? "../v1/visualizations/" + _jal.library + "/content/meta.json": "../v1/visualizations/" + _jal.library + "/content/" + _jal.name;var _r17=new _e57({_996:function(_pf9){ _yal.complete(_pf9._0r9());}}, "GET", _apn);_r17._ign();break;case "edit":window.parent.require(["authoring-common"],function(AuthoringCommon){AuthoringCommon.DialogWrapper.show(AuthoringCommon.SchematicEditor, {definition: _jal.metadata,okCallbackFn: function(_9h9){_yal.complete(_9h9);}});});break;case "publish":var _stm=_5ml._9zm(_frh._c6j("IDS_LBL_CUSTOM_VIS_UPLOAD_IN_PROGRESS"));require(["_5c6"],function(_5c6){_5c6._7fm(_jal.file, true).then(function(){_yal.complete(_jal.file);_stm._3ml();}).done();}); break;default:_vzm._6dm(false);break;}}};_fce.prototype._nl6=[ "atlas","invalid_latlong","on_zoom_max","multiple_categories","domain_correction","duplicate_features","decoration_render"];_fce.prototype.notify=function(_l2e){var _fwm=_l2e.getLevel();var _ka8=_l2e.getLocalizedMessage();var _oa8=_ka8?_ka8:_frh._c6j("IDS_VIS_FAIL_RENDER");var _jal=_l2e.getPayload();var _pen=_l2e.getType(); if(_fwm==="warn"&&this._nl6.indexOf(_pen)===-1){_fwm="error";if(_pen==="truncate"){_oa8="";var _46f=_jal?_jal.truncations:[];for(var i=0;i<_46f.length;++i){if(_46f[i].type=="unaggregated"){_oa8+= _frh._c6j("IDS_VIZ_AGGREGATION_ERROR");}else if(_46f[i].type=="limit"){_oa8+= _frh._c6j("IDS_VIZ_LIMIT_ERROR");}if(i<_46f.length){_oa8+= "\n";}}}}switch(_fwm){case "error":{switch(_pen){case "atlas":this._8xb._nqc(_pen);break;case "invalid_property":case "invalid_layer":case "invalid_mapid":var _33j=_l2e.id+":" + _pen;this._8xb._nqc(_33j, { _04n: _pen, _h5i: _l2e.id, _9tk: _oa8 });break;default:this._8xb._m5j(_oa8);break;}break;}case "warn":{switch(_pen){case "atlas":this._8xb._nqc(_pen);break;case "invalid_latlong":this._8xb._nqc(_pen, { _h5i: "data.latlong", _9tk: _oa8 });break;case "on_zoom_max":break;case "multiple_categories":if(_l2e.id==="tiledMap_multiple_categories"){this._8xb._nqc(_pen, { _9tk: _frh._c6j("IDS_GEODATA_DUPLICATE_COLORS")});}else{this._8xb._m5j(_oa8);}break;case "domain_correction":if(_l2e.id!=="tiledMap_domain_correction"){this._8xb._m5j(_oa8);}break;case "duplicate_features":if(_l2e.id==="tiledMap_duplicate_features"){var _hr6=JSON.parse( _oa8.split(": ")[1] ).map(function(_fmm){ return _fmm.join(", "); });this._8xb._nqc(_pen, { _hfg: _hr6 });}else{this._8xb._m5j(_oa8);}break;case "decoration_render":break;}break;}case "info":if(_pen==="clear"&&_l2e.payload){for(var i=0;i<_l2e.payload.length;i++){var _jal=_l2e.payload[i];if(_jal.id&&_jal.type){var _33j=_jal.id+":" + _jal.type;this._8xb._pn9(_33j);}}}break;} };var _tcm=_qkk._qik("VidaSmallMultiples")?_7cn.SmallMultipleGrid:_7cn.VIPRWidget;function _30g(){this._skg=JSON.parse(_vya);this._y13();this._wt4={};};_30g.prototype._ejb=function(_0um){var _8nn="../v1/visualizations/custom?&lang="+_qgn._9eb;var _yal=new _e57({_996:this._3p2.bind(this, _0um)}, "GET", _8nn);_yal._ign();};_30g.prototype._3p2=function(_0um,_yal){var _79e=_yal._0r9();var _5um=_yal._8ik();if(_5um){var _2ak=_5um._3q9()+" " + _5um._2q9();_vzm._ozm(_2ak);return _0um.resolve([]); }try{if(_79e){var _tpg=JSON.parse(_79e);_0um.resolve(_tpg);}else{_0um.resolve([]);}}catch(_5um){_0um.resolve([]);} };_30g.prototype._ssc=function(_iyk){if(_iyk){var _0um=Q.defer();this._d24=_0um.promise;this._ejb(_0um);}return this._d24;};_30g.prototype._y13=function(){return this._ssc(true).then(this._0nk.bind(this, true));};_30g.prototype._h5j=function(_mv6,_xrf,_k35,_4ya,_axa,_lgc){var _m7k=new _fce(_4ya); return this._d24.then(this._0nk.bind(this, false)).then(function(_9cn){var _a7m=new _tcm( { 'vipr': _9cn, 'hostAPI': _m7k }, _mv6 );_a7m.setFormatLocale(_qgn._5eb);return _a7m.newViz(_xrf, "client").then(function(){var _cnn=new _2jl(_a7m, _4ya, _lgc, _axa);var _m8k=this._hbg(_k35);if(_xrf==_gth._mc5&&this._wt4[ _m8k ]){_cnn._8k8("data.cache", this._wt4[ _m8k ]);}return _cnn;}.bind(this));}.bind(this));};_30g.prototype._546=function(_k35,_bdh){_bdh.then(function(_cnn){this._wt4[ this._hbg(_k35)]=_cnn._qg8("data.cache");}.bind(this)); };_30g.prototype._hbg=function(_k35){return _38g._g0n._79j+_k35;};_30g.prototype._g12=function(_k35){delete this._wt4[ this._hbg(_k35)];};_30g.prototype._8o9=function(_xrf){ return this._d24.then(this._0nk.bind(this, false)).then(function(_9cn){var _a7m=new _tcm( { 'vipr': _9cn, 'hostAPI': new _fce() }, null );_a7m.setFormatLocale(_qgn._5eb);return _a7m.newViz(_xrf, "client").then(function(){return _a7m;}.bind(this));}.bind(this));};_30g.prototype._hph=function(_hcl){return this._d24.then(this._0nk.bind(this, false)).then(function(_9cn){return _9cn.load(_hcl);}.bind(this)).then(function(_05m){return _tcm.extendVizBundle(_05m);}.bind(this));};_30g.prototype._sje=function(_hcl){return this._t0f.then(function(_9cn){return _9cn.unload(_hcl);}.bind(this));};_30g.prototype._tk8=function(_hcl){return this._t0f.then(function(_9cn){return _9cn.unregister(_hcl);}.bind(this));};_30g.prototype._0nk=function(_81c,_tpg){if(!this._t0f||_81c){var _gpg=[];for(var i=0; i<_tpg.length;++i){var _cnn=_tpg[i];var _lsn=_cnn.id;var _x8f=_cnn.type==="schematic";var _wbk;if(_x8f){_wbk=_gth._nc5;}else{_wbk="../v1/visualizations/"+ _lsn +"/content";}var _vtm={"id": _lsn,"location": _wbk,"icon": _cnn.icon,"customType": _cnn.type};if(_x8f){var _qvi={"schematicLibrary": _lsn};this._uv1(_vtm, _qvi);}_gpg.push(_vtm); }var _0um=Q.defer();_o8j._7gn().then(function(){for(var _hcl in this._skg){var _vtm={"id": _hcl,"location": this._skg[_hcl].location};var _qvi=_o8j._v5j(_hcl);if(_qvi){this._uv1(_vtm, _qvi);}_gpg.push(_vtm); }_gpg.push({"id": _gth._2sh,"location": _7cn.sdk.bundleLocation });var _j88={"id": _gth._mc5,"location": _gth._nc5};var _qvi={"debug.mode": true};this._uv1(_j88, _qvi);_gpg.push(_j88);_0um.resolve(_7cn.VIPR.create({ 'bundles': _gpg }));}.bind(this)).done();this._t0f=_0um.promise;}return this._t0f;};_30g.prototype._uv1=function(_vtm,_qvi){ var _bfc = _vtm.config={"properties": {"override":{}}}; var _y4n=Object.keys(_qvi);for(var i=0;i<_y4n.length;i++){var _n8e=_y4n[i];var _dmc=_qvi[_n8e];_bfc.properties.override[_n8e]={"defaultValue": _dmc};} };return new _30g();});