Module for creating smart graphs https://codepen.io/mirzaev-sexy/pen/Rwyxprz
Go to file
Arsen Mirzaev Tatyano-Muradovich 3a41f38c11 added the graph 2.0.0 demonstration 2025-01-11 15:36:18 +07:00
preview added the graph 2.0.0 demonstration 2025-01-11 15:36:18 +07:00
LICENSE Initial commit 2022-11-01 09:18:55 +10:00
README.md added example 2024-12-22 23:43:10 +07:00
graph.js resolved #6, resolved #10, resolved #11, resolved #4, resolved #8, resolved #5, and #3 2025-01-11 15:23:54 +07:00

graph.mjs

Module for creating smart graphs

Example

<section id='graph'>
</section>
import("/js/modules/graph.mjs").then((graph) => {
    // Imported the graph.mjs module

    // Initializing an instance of the graph.mjs
    const instance = new graph.default(document.getElementById('graph'));
        
    // Initializing node for the graph
    const bebra = instance.write({
      title: 'bebra',
      description: 'i am a fat juicy smelly bebra',
      link: 'https://bebra.mirzaev.sexy'
    });
        
    // Initializing node for the graph
    const root = instance.write({
      title: 'root node'
    });
        
    // Initializing node for the graph
    const anarchy = instance.write({
      title: 'anarchy',
    });

    // Connectiong the bebra node to the root node
    core.connect(bebra, root);

    // Connectiong the anarchy node to the root node
    core.connect(anarchy, root);

    // Initializing the feet node and connect to the bebra node
    core.connect(instance.write({ title: 'feet' }, bebra);
});