MCPcopy
hub / github.com/apache/echarts / setStatesStylesFromModel

Function setStatesStylesFromModel

src/util/states.ts:806–820  ·  view source on GitHub ↗
(
    el: Displayable,
    itemModel: Model<Partial<Record<'emphasis' | 'blur' | 'select', any>>>,
    styleType?: string, // default itemStyle
    getter?: (model: Model) => Dictionary<any>
)

Source from the content-addressed store, hash-verified

804 * Set emphasis/blur/selected states of element.
805 */
806export function setStatesStylesFromModel(
807 el: Displayable,
808 itemModel: Model<Partial<Record<'emphasis' | 'blur' | 'select', any>>>,
809 styleType?: string, // default itemStyle
810 getter?: (model: Model) => Dictionary<any>
811) {
812 styleType = styleType || 'itemStyle';
813 for (let i = 0; i < OTHER_STATES.length; i++) {
814 const stateName = OTHER_STATES[i];
815 const model = itemModel.getModel([stateName, styleType]);
816 const state = el.ensureState(stateName);
817 // Let it throw error if getterType is not found.
818 state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]]();
819 }
820}
821
822
823/**

Callers 15

updateDataMethod · 0.90
updateDataMethod · 0.90
renderMethod · 0.90
updateStyleFunction · 0.90
updateNormalBoxDataFunction · 0.90
updateElCommonFunction · 0.90
setBoxCommonFunction · 0.90
_renderPointerMethod · 0.90
updateDataMethod · 0.90
updateDataMethod · 0.90
processMethod · 0.90
renderMethod · 0.90

Calls 1

getModelMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…