MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / parseStyleAttribute

Function parseStyleAttribute

libs/echarts/echarts.simple.js:26970–26992  ·  view source on GitHub ↗
(xmlNode)

Source from the content-addressed store, hash-verified

26968// Value may contain space.
26969var styleRegex = /([^\s:;]+)\s*:\s*([^:;]+)/g;
26970function parseStyleAttribute(xmlNode) {
26971 var style = xmlNode.getAttribute('style');
26972 var result = {};
26973
26974 if (!style) {
26975 return result;
26976 }
26977
26978 var styleList = {};
26979 styleRegex.lastIndex = 0;
26980 var styleRegResult;
26981 while ((styleRegResult = styleRegex.exec(style)) != null) {
26982 styleList[styleRegResult[1]] = styleRegResult[2];
26983 }
26984
26985 for (var svgAttrName in attributesMap) {
26986 if (attributesMap.hasOwnProperty(svgAttrName) && styleList[svgAttrName] != null) {
26987 result[attributesMap[svgAttrName]] = styleList[svgAttrName];
26988 }
26989 }
26990
26991 return result;
26992}
26993
26994/**
26995 * @param {Array.<number>} viewBoxRect

Callers 1

parseAttributesFunction · 0.70

Calls 1

execMethod · 0.45

Tested by

no test coverage detected