Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is possible disabled user play with graph? #47

Open
loconluis opened this issue Apr 10, 2018 · 1 comment
Open

Is possible disabled user play with graph? #47

loconluis opened this issue Apr 10, 2018 · 1 comment

Comments

@loconluis
Copy link

It is possible to generate the drawing of the canvas, and disable that you can play with the graph. ?

@Skoreto
Copy link

Skoreto commented May 7, 2018

I guess it just depends on your settings of the manipulation and interaction parameters of the options object.

See http://visjs.org/docs/network/#options for all options parameters.

For example:

import React, {Component} from 'react';
import GraphVis from 'react-graph-vis'

class MyComponent extends Component {
    constructor(props) {
        super(props);
        this.state = {
            graphVis: {
                nodes: [],
                edges: []
            },
            options: {
                autoResize: true,
                height: '100%',
                width: '100%',
                manipulation: {
                    enabled: false,
                    initiallyActive: false,
                    editEdge: false,
                    deleteNode: false,
                    deleteEdge: false
                },
                interaction: {
                    dragNodes: false,
                    dragView: false,
                    hideEdgesOnDrag: false,
                    hideNodesOnDrag: false,
                    hover: true,
                    hoverConnectedEdges: false,
                    keyboard: {
                        enabled: false
                    },
                    multiselect: false,
                    navigationButtons: false,
                    selectable: false,
                    selectConnectedEdges: false,
                    zoomView: false
                }
            },
        };
    }

    render() {
        const events = {};

        return (
            <div>
                <GraphVis graph={this.state.graphVis} options={this.state.options}
                    events={events} style={{width: "650px", height: "400px" }} />
            </div>
        );
    }
}

export default MyComponent;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants