{"id":24374374,"url":"https://github.com/pipefunc/graphvizsvg","last_synced_at":"2025-04-10T18:52:51.170Z","repository":{"id":264230569,"uuid":"892768399","full_name":"pipefunc/graphvizsvg","owner":"pipefunc","description":"A modern ESM module for interactive SVG visualization of Graphviz graph 🕸️🎨","archived":false,"fork":false,"pushed_at":"2025-04-07T17:20:24.000Z","size":109,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T18:31:32.182Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pipefunc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-22T18:35:06.000Z","updated_at":"2025-02-21T05:51:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"f19d26da-00bf-4ed0-b70a-92a8922e93a4","html_url":"https://github.com/pipefunc/graphvizsvg","commit_stats":null,"previous_names":["pipefunc/graphvizsvg"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pipefunc%2Fgraphvizsvg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pipefunc%2Fgraphvizsvg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pipefunc%2Fgraphvizsvg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pipefunc%2Fgraphvizsvg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pipefunc","download_url":"https://codeload.github.com/pipefunc/graphvizsvg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247709897,"owners_count":20983241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-19T05:28:23.574Z","updated_at":"2025-04-10T18:52:51.125Z","avatar_url":"https://github.com/pipefunc.png","language":"JavaScript","readme":"# graphvizsvg\n\nA modern ESM module for interactive SVG visualization of Graphviz graphs.\nThis is a modernized rewrite of [jquery.graphviz.svg](https://github.com/mountainstorm/jquery.graphviz.svg).\n\nhttps://github.com/user-attachments/assets/7371d1e6-a195-4e73-8670-3e5f8965ae53\n\n## Features\n\n* 🎯 Interactive SVG visualization of Graphviz graphs\n* 🔍 Node and edge highlighting with automatic color transitions\n* 🏷️ Tooltips for nodes and edges\n* 🎨 Automatic color handling and transitions\n* 📏 Node scaling options\n* 🔄 Bi-directional graph traversal\n* 💪 Strong TypeScript support\n* 📦 Modern ESM packaging\n* ✅ Comprehensive test coverage\n\n## Installation\n\n```bash\nnpm install graphvizsvg\n```\n\n## Usage\n\nSee [demo.html](demo.html) for a complete example.\nRun `python -m http.server` in the project root and open `http://localhost:8000/demo.html` in your browser.\n\nOr see the example below:\n\n```javascript\nimport GraphvizSvg from 'graphvizsvg';\n\n// Initialize with SVG content\nconst container = document.getElementById('graph');\nconst graphviz = new GraphvizSvg(container, {\n    svg: svgContent,\n    shrink: '0.125pt',\n    tooltips: {\n        init($graph) {\n            // Your tooltip initialization\n        },\n        show() {\n            // Show tooltip\n        },\n        hide() {\n            // Hide tooltip\n        },\n    },\n    ready() {\n        // Called when the graph is ready\n    }\n});\n\n// Interact with nodes\ngraphviz.nodes().click(function() {\n    const $set = $();\n    $set.push(this);\n    $set = $set.add(graphviz.linkedFrom(this, true));\n    $set = $set.add(graphviz.linkedTo(this, true));\n    graphviz.highlight($set, true);\n});\n```\n\n## API\n\n### Constructor Options\n\n- `svg`: SVG content string\n- `url`: URL to load SVG from\n- `shrink`: Node shrinking amount (string or object with x/y values)\n- `tooltips`: Tooltip configuration object\n- `ready`: Callback function when graph is ready\n\n### Methods\n\n- `nodes()`: Get all nodes\n- `edges()`: Get all edges\n- `highlight($elements, tooltips)`: Highlight elements\n- `linkedTo(node, includeEdges)`: Get nodes linked to\n- `linkedFrom(node, includeEdges)`: Get nodes linked from\n- `linked(node, includeEdges)`: Get all linked nodes\n- `tooltip($elements, show)`: Show/hide tooltips\n- `bringToFront($elements)`: Bring elements to front\n- `sendToBack($elements)`: Send elements to back\n\n## Dependencies\n\n- jQuery 3.7+\n- Bootstrap 4.6+ (for tooltips)\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nMIT\n\n## Credits\n\nBased on the original work by [mountainstorm](https://github.com/mountainstorm/jquery.graphviz.svg).\nThis project should have feature parity with the original except for the zooming feature, which has been removed.\nModernized and maintained by the pipefunc team.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpipefunc%2Fgraphvizsvg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpipefunc%2Fgraphvizsvg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpipefunc%2Fgraphvizsvg/lists"}