Giter Site home page Giter Site logo

example code not runable about d3-dag HOT 4 CLOSED

seahurt avatar seahurt commented on August 16, 2024
example code not runable

from d3-dag.

Comments (4)

seahurt avatar seahurt commented on August 16, 2024

It's the version misleading me. I should use 1.0.0-1 not 0.11.1

here is the passing example

<!DOCTYPE html>

<head>
</head>

<body>
    <script src="https://unpkg.com/[email protected]"></script>
    <script>
        var data =[
            {
                "id": "0",
                "parentIds": []
            },
            {
                "id": "1",
                "parentIds": ["0"]
            },
            {
                "id": "2",
                "parentIds": ["0"]
            },
            {
                "id": "3",
                "parentIds": ["1", "2"]
            },
            {
                "id": "4",
                "parentIds": ["0"]
            },
            {
                "id": "5",
                "parentIds": ["4"]
            }
        ]
        const dag = d3.graphStratify()(data); 
        const layout = d3.sugiyama();
        layout(dag);

        // ... actually render here ...
        for (const node of dag.nodes()) {
            console.log(node.x, node.y);
        }
        for (const { points } of dag.links()) {
            console.log(points);
        }

    </script>
</body>

from d3-dag.

erikbrinkman avatar erikbrinkman commented on August 16, 2024

Ideally you should be using the fully released 1.0.0. I updated the example code in the README where I forgot to update it. Is there anywhere else you saw a reference to 0.11? A grep didn't turn up anything meaningful.

from d3-dag.

seahurt avatar seahurt commented on August 16, 2024

https://erikbrinkman.github.io/d3-dag/index.html

this page still using 0.11.1

from d3-dag.

erikbrinkman avatar erikbrinkman commented on August 16, 2024

Thanks! It should be fixed now. Had to rebuild the docs. It will still say the wrong thing on npm, but I don't want to release a patch version just to update it.

from d3-dag.

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.