UNPKG

@fusioncharts/core

Version:

JavaScript Data Visualisation Library

1 lines 7.41 kB
"use strict";exports.__esModule=true;exports.attribDefs=void 0;exports.hasAttribDefs=hasAttribDefs;exports.parseConfiguration=parseConfiguration;exports.setAttribDefs=setAttribDefs;var attrTypeNum=1,attrTypeBool=2,UNDEF;var blankObj={},mathMax=Math.max,attribDefs;function parseConfiguration(userConfig,defaultConfig,parentConfig,_ignoreList,_helperComponents,_localAttribDefs){var key,val,type,attrUpdateCount=1,tempDefs,ignoreList=_ignoreList,localAttribDefs=_localAttribDefs,helperComponents=_helperComponents;exports.attribDefs=attribDefs=attribDefs||blankObj;ignoreList=ignoreList||blankObj;localAttribDefs=localAttribDefs||blankObj;helperComponents=helperComponents||{};for(key in userConfig){if(!ignoreList[key]){val=userConfig[key];if(!(!val&&val!==false&&val!==0)){type=(tempDefs=localAttribDefs[key]||attribDefs[key])&&tempDefs.type;switch(type){case attrTypeNum:val=Number(val);if(!isNaN(val)){defaultConfig[key]=val}break;case attrTypeBool:val=Number(val);if(!isNaN(val)){defaultConfig[key]=!!val}break;default:defaultConfig[key]=val}}}}if(parentConfig){for(key in defaultConfig){if(defaultConfig[key]===UNDEF&&(tempDefs=localAttribDefs[key]||attribDefs[key])&&tempDefs.pAttr){defaultConfig[key]=parentConfig[tempDefs.pAttr]}}}while(attrUpdateCount){attrUpdateCount=0;for(key in defaultConfig){if(defaultConfig[key]===UNDEF&&(tempDefs=localAttribDefs[key]||attribDefs[key])){if(tempDefs.attr){if((val=defaultConfig[tempDefs.attr])!==UNDEF){defaultConfig[key]=val;attrUpdateCount+=1}}else if(tempDefs.parser){if((val=tempDefs.parser(defaultConfig,parentConfig,helperComponents))!==UNDEF){defaultConfig[key]=val;attrUpdateCount+=1}}}}}}function setAttribDefs(name,def){var attribObj,key;exports.attribDefs=attribDefs=attribDefs||{};if(typeof name==="string"){attribObj={};attribObj[name]=def}else{attribObj=name}for(key in attribObj){if(!attribDefs[key]){attribDefs[key]=attribObj[key]}}}function hasAttribDefs(name){return!!attribDefs[name]}exports.attribDefs=attribDefs={setBorderWidth:{type:attrTypeNum,pAttr:"plotborderthickness"},plotborderthickness:{type:attrTypeNum,pAttr:"plotborderthickness"},showBorderEffect:{parser:function parser(){var pConfig=arguments[1],plotBorderThicknessLimit=.1;return+pConfig.showplotborder===1&&pConfig.plotborderthickness===plotBorderThicknessLimit?1:0}},alphaanimation:{type:attrTypeNum},showplotborder:{type:attrTypeNum,pAttr:"showplotborder"},zeroplanethickness:{type:attrTypeNum},showzeroplaneontop:{type:attrTypeNum},stickytracking:{type:attrTypeNum},usemessagelog:{type:attrTypeNum},showtooltip:{type:attrTypeNum,pAttr:"showtooltip"},seriesnameintooltip:{type:attrTypeNum},plothovereffect:{type:attrTypeNum,attr:"anchorhovereffect"},anchorhovereffect:{type:attrTypeNum,attr:"showhovereffect"},showhovereffect:{type:attrTypeNum},linethickness:{type:attrTypeNum,pAttr:"linethickness"},dashed:{type:attrTypeNum,pAttr:"linedashed"},linedashed:{type:attrTypeNum,attr:"plotborderdashed"},plotborderdashed:{type:attrTypeNum,pAttr:"plotborderdashed"},linedashlen:{type:attrTypeNum,pAttr:"linedashlen"},linedashgap:{type:attrTypeNum,pAttr:"linedashgap"},anchoralpha:{pAttr:"anchoralpha"},anchorsides:{type:attrTypeNum,pAttr:"anchorsides"},anchorradius:{type:attrTypeNum,pAttr:"anchorradius"},anchorbgalpha:{pAttr:"anchorbgalpha"},anchorbgcolor:{pAttr:"anchorbgcolor"},anchorbordercolor:{pAttr:"anchorbordercolor"},anchorstartangle:{type:attrTypeNum,pAttr:"anchorstartangle"},anchorimageurl:{pAttr:"anchorimageurl"},anchorimagescale:{type:attrTypeNum,pAttr:"anchorimagescale"},anchorimagealpha:{pAttr:"anchorimagealpha"},anchorimagepadding:{type:attrTypeNum,pAttr:"anchorimagepadding"},anchorborderthickness:{type:attrTypeNum,pAttr:"anchorborderthickness"},anchorshadow:{type:attrTypeNum,pAttr:"anchorshadow"},valuepadding:{type:attrTypeNum,pAttr:"valuepadding"},valueposition:{pAttr:"valueposition"},plotfillangle:{type:attrTypeNum,pAttr:"plotfillangle"},useplotgradientcolor:{type:attrTypeNum},rotatevalues:{type:attrTypeNum,pAttr:"rotatevalues"},includeinlegend:{type:attrTypeNum},connectnulldata:{type:attrTypeNum},plotfillalpha:{pAttr:"plotfillalpha"},alpha:{pAttr:"linealpha"},linealpha:{pAttr:"plotfillalpha"},showvalues:{type:attrTypeNum,pAttr:"showvalues"},showpercentvalues:{type:attrTypeNum,parser:function parser(config){return config.isstacked&&config.stack100percent?1:0}},showpercentintooltip:{type:attrTypeNum,parser:function parser(config){return config.isstacked&&config.stack100percent?1:0}},stack100percent:{type:attrTypeNum,attr:"usepercentdistribution"},drawfullareaborder:{type:attrTypeNum},use3dlineshift:{type:attrTypeNum},parentyaxis:{type:attrTypeNum},radarborderthickness:{type:attrTypeNum},radarborderradius:{type:attrTypeNum},gaugeoriginx:{type:attrTypeNum},hasgaugeoriginx:{attr:"gaugeoriginx"},gaugeoriginy:{type:attrTypeNum},hasgaugeoriginy:{attr:"gaugeoriginy"},gaugeradius:{type:attrTypeNum},hasgaugeradius:{attr:"gaugeradius"},showgaugeborder:{type:attrTypeNum},setAdaptiveMin:{type:attrTypeNum},adjustDiv:{type:attrTypeNum},axisNameWidth:{type:attrTypeNum},rotateAxisName:{type:attrTypeNum},useEllipsesWhenOverflow:{type:attrTypeNum},showZeroPlane:{type:attrTypeNum},zeroPlaneAlpha:{type:attrTypeNum},showZeroPlaneValue:{type:attrTypeNum},zeroPlaneOnTop:{type:attrTypeNum},trendlineThickness:{type:attrTypeNum},showTrendlinesOnTop:{type:attrTypeNum},trendlinesAreDashed:{type:attrTypeNum},trendlinesDashLen:{type:attrTypeNum},trendlinesDashGap:{type:attrTypeNum},showTrendlines:{type:attrTypeNum},showTrendlineLabels:{type:attrTypeNum},showLabels:{type:attrTypeNum},rotateLabels:{type:attrTypeNum},slantLabel:{type:attrTypeNum},showAxisValues:{type:attrTypeNum},showTooltip:{type:attrTypeNum},maxLabelHeight:{type:attrTypeNum},useroundedges:{type:attrTypeNum,pAttr:"useroundedges"},placevaluesinside:{type:attrTypeNum},plotpaddingpercent:{type:attrTypeNum},use3dlighting:{type:attrTypeNum,pAttr:"use3dlighting"},usedataplotcolorforlabels:{type:attrTypeNum},plotspacepercent:{type:attrTypeNum,parser:function parser(config){return mathMax(config.plotspacepercent%100,0)}},ratio:{pAttr:"plotfillratio"},base:{type:attrTypeNum},showMinorDivLineValues:{type:attrTypeNum},numMinorDivLines:{type:attrTypeNum},majorTMNumber:{type:attrTypeNum},majorTMHeight:{type:attrTypeNum},showTickMarks:{type:attrTypeNum},majorTMThickness:{type:attrTypeNum},adjustTM:{type:attrTypeBool},minorTMNumber:{type:attrTypeNum},minorTMThickness:{type:attrTypeNum},tickMarkDistance:{type:attrTypeNum},placeTicksInside:{type:attrTypeNum},placeValuesInside:{type:attrTypeNum},axisValuePadding:{type:attrTypeNum},gridLineWidth:{type:attrTypeNum},showRadarBorder:{type:attrTypeNum},radarBorderThickness:{type:attrTypeNum},maxcolwidth:{type:attrTypeNum,parser:function parser(config){return Math.abs(config.maxcolwidth)}},maxbarheight:{type:attrTypeNum,parser:function parser(config){return Math.abs(config.maxbarheight)}},plotborderalpha:{parser:function parser(config,pConfig){return pConfig.plotborderalpha||config.plotfillalpha}},autoscale:{type:attrTypeNum},plotborderdashlen:{type:attrTypeNum,pAttr:"plotborderdashlen"},plotborderdashgap:{type:attrTypeNum,pAttr:"plotborderdashgap"},plotfillratio:{pAttr:"plotfillratio"},drawverticaljoins:{type:attrTypeNum,pAttr:"drawverticaljoins"},useforwardsteps:{type:attrTypeNum,pAttr:"useforwardsteps"},minimizetendency:{type:attrTypeNum},usepercentdistribution:{type:attrTypeNum},stepatmiddle:{type:attrTypeNum}};