The Template is a Vue.js app which uses ngraph.graph a Library which implements an API to modify graph structure and supports event-driven notifications when graph changes.
The main component of the template is App.vue.
LINK : https://ngraph-youtube.herokuapp.com
REPO: https://github.com/donc310/vue-graph-youtube
LINK : https://ngraph-amazon.herokuapp.com/#?q=books
REPO: https://github.com/donc310/vue-graph-amazon
-
Clone this Repo
-
install dependencies using
npm install
-
Create an
App.vue
file in in src/components/app which will be the entry point of your app -
Import
EventBus
fromsrc/component/util/event.js
-
then either build or serve your app using
npm run serve
OR
npm run build
<graph-component :fileName="fileName"
:client="client">
:origin="origin"
<!-- other template stuff goes here -->
</graph-component>
type: String
default: json
The type of client which the app should use. Possible values: json
or youtube
type: String
default: data
Name of the Json File if client
is json
type: String
default: "api/v1/graphdata"
The Url path
Events are emitted from the GraphView.vue component using An EventBus.
An EventBus is a mode of transportation for one component to pass props from one component to another
no matter where those components are located in the tree. To Listen to changes from the Main component you should
#1 import EventBus into your component using
import EventBus from "@/lib/util/event";
#2 Listen to events on your Mounted Hook
mounted() {
EventBus.$on("CORE::NODE_SELECTED", selected_node => {});
EventBus.$on("CORE::NODES_UPDATE", NODES => {});
}
Fired before the graph is initiated
emits: { Node }
Fired when a node is clicked.
emits: {Nodes}
Fired when the nodes change
Fired before the graph is disposed.