cargo-coupling 0.3.2

A coupling analysis tool for Rust projects - measuring the 'right distance' in your code
Documentation
// =====================================================
// Shared State & Configuration
// =====================================================

export const CONFIG = {
    apiEndpoint: '',
    graphPath: '/api/graph',
    configPath: '/api/config'
};

// Global state (mutable)
export const state = {
    cy: null,
    graphData: null,
    currentLayout: 'cose',
    selectedNode: null,
    isSimpleView: false,
    centerMode: false,  // true = re-layout on click, false = zoom only
    currentLang: 'en',  // 'en' or 'ja'
    itemCy: null,
    currentModuleForItemGraph: null,
    showItems: false  // Show item-level nodes (functions, types)
};

// Setters for state (to maintain encapsulation where needed)
export function setCy(instance) {
    state.cy = instance;
}

export function setGraphData(data) {
    state.graphData = data;
}

export function setSelectedNode(node) {
    state.selectedNode = node;
}

export function setCurrentLayout(layout) {
    state.currentLayout = layout;
}

export function setSimpleView(isSimple) {
    state.isSimpleView = isSimple;
}

export function setCenterMode(mode) {
    state.centerMode = mode;
}

export function setCurrentLang(lang) {
    state.currentLang = lang;
}

export function setItemCy(instance) {
    state.itemCy = instance;
}

export function setCurrentModuleForItemGraph(moduleId) {
    state.currentModuleForItemGraph = moduleId;
}

export function setShowItems(show) {
    state.showItems = show;
}