export class GraphUtil {
    static getExtendedStyle(graphSetting, stateIndex) {
        if (stateIndex < 0) {
            throw new Error('stateIndex can not less than zero.');
        }
        let result;
        if (graphSetting.styles != null) {
            result = graphSetting.styles.find(style => {
                if (style.version == null) {
                    return style.state != null && +style.state === stateIndex;
                }
                {
                    return style.stateIndex === stateIndex;
                }
            });
        }
        return result;
    }
}
