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

Function normalizeDimensionsDefine

libs/echarts/echarts-en.simple.js:20816–20853  ·  view source on GitHub ↗
(dimensionsDefine)

Source from the content-addressed store, hash-verified

20814// which is reasonable. But dimension name is duplicated.
20815// Returns undefined or an array contains only object without null/undefiend or string.
20816function normalizeDimensionsDefine(dimensionsDefine) {
20817 if (!dimensionsDefine) {
20818 // The meaning of null/undefined is different from empty array.
20819 return;
20820 }
20821 var nameMap = createHashMap();
20822 return map(dimensionsDefine, function (item, index) {
20823 item = extend({}, isObject$1(item) ? item : {name: item});
20824
20825 // User can set null in dimensions.
20826 // We dont auto specify name, othewise a given name may
20827 // cause it be refered unexpectedly.
20828 if (item.name == null) {
20829 return item;
20830 }
20831
20832 // Also consider number form like 2012.
20833 item.name += '';
20834 // User may also specify displayName.
20835 // displayName will always exists except user not
20836 // specified or dim name is not specified or detected.
20837 // (A auto generated dim name will not be used as
20838 // displayName).
20839 if (item.displayName == null) {
20840 item.displayName = item.name;
20841 }
20842
20843 var exist = nameMap.get(item.name);
20844 if (!exist) {
20845 nameMap.set(item.name, {count: 1});
20846 }
20847 else {
20848 item.name += '-' + exist.count++;
20849 }
20850
20851 return item;
20852 });
20853}
20854
20855function arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) {
20856 maxLoop == null && (maxLoop = Infinity);

Callers 1

completeBySourceDataFunction · 0.70

Calls 6

createHashMapFunction · 0.70
mapFunction · 0.70
extendFunction · 0.70
isObject$1Function · 0.70
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected