Giter VIP home page Giter VIP logo

Comments (3)

dcsan avatar dcsan commented on August 15, 2024

memo for future me

const graphData = [
    {
        data: {
            id: 'start',
            label: "start",
            count: 50,
            color: 'green',
        },
    },

then

const Grafy = (props) => {
    // https://dash.plotly.com/cytoscape/styling
    const stylesheet =
        [
            {
                selector: 'node',
                label: "thing",
                style: {
                    'font-size': 6,
                    label: 'data(label)',
                    'background-color': 'data(color)',
                    shape: 'data(shape)',
                    width: 'data(count)',
                    height: 'data(count)'
                }
            },
            {
                selector: 'edge',
                style: {
                    'font-size': 6,
                    'curve-style': 'bezier',
                    'target-arrow-shape': 'triangle',
                    width: 'data(weight)',
                    label: 'data(label)',
                }
            }
        ]

    const layout = {
        name: 'cose-bilkent',
        ...graphOptions
    }

    // cy.nodes('[id = "yourId"]').style('background-color', 'desiredColor');

    return (
        <div className='content'>
            <TitleBox info={AppConfig.page('Grafy')} />
            <CytoscapeComponent
                className='cyto-box'
                elements={graphData}
                layout={layout}
                stylesheet={stylesheet}
            />
        </div>
    )
}

from cytoscape.js-cose-bilkent.

dcsan avatar dcsan commented on August 15, 2024

maybe worth adding something like this to the README even tho
https://dash.plotly.com/cytoscape/styling
has a lot of info.
this is the second time I've come to this library and spen tthe first couple hours digging into code samples to find out the basics.

from cytoscape.js-cose-bilkent.

ugurdogrusoz avatar ugurdogrusoz commented on August 15, 2024

@dcsan You might want to first read the Cytsocape.js documentation: https://js.cytoscape.org/.
Here are some tutorials: https://blog.js.cytoscape.org/tutorials/.
Your questions are not related to this particular extension, so closing this issue.

from cytoscape.js-cose-bilkent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.