Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
v-network-graph
Advanced tools
An interactive SVG based network-graph visualization component for Vue 3.
Install with npm
npm install v-network-graph
and setup in main.ts
// main.ts
import { createApp } from "vue"
import VNetworkGraph from "v-network-graph"
import "v-network-graph/lib/style.css"
import App from "./App.vue"
const app = createApp(App)
app.use(VNetworkGraph)
app.mount("#app")
Add css to nuxt.config.ts
// nuxt.config.ts
import { defineNuxtConfig } from "nuxt3"
// https://v3.nuxtjs.org/docs/directory-structure/nuxt.config
export default defineNuxtConfig({
css: ["v-network-graph/lib/style.css"],
})
Make the plugin to plugins/v-network-graph.ts
// plugins/v-network-graph.ts
import { defineNuxtPlugin } from "#app"
import VNetworkGraph from "v-network-graph"
export default defineNuxtPlugin(nuxtApp => {
nuxtApp.vueApp.use(VNetworkGraph)
})
<script setup lang="ts">
const nodes = {
node1: { name: "Node 1" },
node2: { name: "Node 2" },
node3: { name: "Node 3" },
node4: { name: "Node 4" },
}
const edges = {
edge1: { source: "node1", target: "node2" },
edge2: { source: "node2", target: "node3" },
edge3: { source: "node3", target: "node4" },
}
</script>
<template>
<v-network-graph
class="graph"
:nodes="nodes"
:edges="edges"
/>
</template>
<style>
.graph {
width: 800px;
height: 600px;
border: 1px solid #000;
}
</style>
For more examples, see here.
The requirements for visualizing network graphs are various, including the design and user actions for each component such as nodes, edges, paths, etc. Many libraries have been made to flexibly achieve these numerous requirements. However, many of these libraries have been around since before Vue was launched, so there are not many libraries that can be used with the concept of reactive programming. This means that using these libraries together with Vue, you need to learn how to use the graph libraries as well as Vue, and also having to design the integration with Vue. These are probably a lot of efforts.
This component aims to make it easy to realize applications with these various requirements while keeping the simplicity and reactive programming style of Vue. Using the power of Vue (especially reactive system and two-way binding), we hope to help developers quickly visualize interactively manipulable network graphs with less code and lower learning costs.
v-network-graph was designed with the following policy:
Reactive
All primitive data such as nodes, edges, node positions, and their styles are provided from outside the component, and the component can handle these data reactively with Vue. The developer can modify the data at any time to reactively perform manipulations such as adding/removing objects, moving node positions, changing appearance, etc.
Highly customizable
For visualizations, where the requirements vary widely from each application, it will be available a variety of customizations for ease of use. In addition to static specifications, it also supports dynamic changes due to the values of fields contained in node and edge data.
Extendable
Network graphs have many types of visualization objects, and in many cases there are application-specific requirements. It is difficult to cover all the requirements with pre-defined functions. Therefore, we also implement a mechanism that allows developers to flexibly add their own SVG elements and actions as needed.
With the above, we would like to contribute to helping application developers to focus on developing application-specific requirements for handling network graphs.
Currently, working on internal refactoring, and implementing the following features.
These are planned to be released in phases, but since this is a
personal project for dash14 and is ongoing on the side of other
commercial work, I cannot give a detailed timeline.
Your support is especially encouraging!
I' d appreciate it if you could support this project with a GitHub
starring, an issue/PR submission, a code contribution, a message of
cheer, a sponsorship, or anything else!
If you find any bugs and/or want to contribute, feel free to submit issues or pull requests.
Under the MIT license.
See LICENSE file for more details.
I love to hear from people using it, giving me the motivation to keep working on this project.
If you find this library helpful, please consider giving it a star ⭐ on GitHub!
You may GitHub Sponsors or Buy Me a Coffee if you would like to show some support for this open-source project. It will be greatly appreciated!
FAQs
An interactive network graph visualization component for Vue 3
The npm package v-network-graph receives a total of 3,510 weekly downloads. As such, v-network-graph popularity was classified as popular.
We found that v-network-graph demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.