MCPcopy Index your code
hub / github.com/plotly/plotly.js / getStyleObj

Function getStyleObj

src/plots/map/map.js:781–803  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

779};
780
781function getStyleObj(val) {
782 var styleObj = {};
783
784 if(Lib.isPlainObject(val)) {
785 styleObj.id = val.id;
786 styleObj.style = val;
787 } else if(typeof val === 'string') {
788 styleObj.id = val;
789
790 if(constants.stylesMap[val]) {
791 styleObj.style = constants.stylesMap[val];
792 } else {
793 styleObj.style = val;
794 }
795 } else {
796 styleObj.id = constants.styleValueDflt;
797 styleObj.style = convertStyleVal(constants.styleValueDflt);
798 }
799
800 styleObj.transition = {duration: 0, delay: 0};
801
802 return styleObj;
803}
804
805// if style is part of the 'official' map values, add URL prefix and suffix
806function convertStyleVal(val) {

Callers 1

map.jsFile · 0.70

Calls 1

convertStyleValFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…