Comments (4)
Yes there is. Every option component receives some props, one of them being the node instance. Example:
module.exports = {
props: ["node"],
methods: {
onClick() {
this.node.state.counter++;
}
}
}
Admittedly, the documentation is not very good at the moment. I actually reworked the documentation about node options a few days ago, but apparently it is still not clear. Maybe I should add some code examples like the one above. Would that help?
from baklavajs.
Awesome! Thanks for the quick reply.
As far as the doc goes, having the project written in typescript definitely help me navigate the library and understand what each part does. More code example would definitely helped.
How about adding code sandbox to the doc?
Setting up based on https://newcat.github.io/baklavajs/#/plugins/view
https://codesandbox.io/s/baklavajs-setup-zvevk
Creating a customNode:
https://codesandbox.io/s/baklavajs-customnode-i0lzl
Some unrelated questions:
If I want to have more granular control over the node component, let say I want to change the template of the node itself, is extending the Node.vue component is the way to go?
from baklavajs.
I really like the code sandbox idea and will definetely implement that.
Yes you can "extend" the node component. Unfortunately, extending in Vue is not really possible, so you have to copy the source code and modify the copy. Have a look here (hope it helps π): https://newcat.github.io/baklavajs/#/styling?id=hardcore-customization
from baklavajs.
yup thats what i needed! thank you πββοΈ
closing this issue.
from baklavajs.
Related Issues (20)
- Select multiple nodes key modifier conflicts with defaults in Chrome / Mac
- Move multiple nodes HOT 1
- Copy-Paste does not retain connection involving dynamic interfaces. HOT 1
- Critical error on Subgraph creation HOT 2
- Feature Request : Convert a graph to a node HOT 1
- Feature Request : convert a graph into a function HOT 1
- Copy-Paste from a text control also duplicates the node HOT 1
- How to update SelectInterface options HOT 2
- bug [v2] BaseNumericInterface min 0 HOT 3
- feature request: Add support for calling preventdefault from Hotkeys HOT 1
- See Previous Bug #327 - Weird Precision Issues persisting with v2.3 HOT 1
- Feature request: Is it possible to add a right-click selection feature? HOT 5
- Is it possible to customize the toolbar? HOT 6
- Right-clicking to display the node palette shows it at the wrong position. I think the floating node palette shouldn't appear when right-clicking in the node palette area. HOT 2
- After converting the graph to a graphTemplate, it is not usable
- Nested subgraphs within a subgraph will result in an error. HOT 1
- Input with `allowMultipleConnections: true` not handled correctly when made into a Subgraph HOT 1
- Unable to use in Nest.js HOT 5
- Serious problemοΌThe calculation speed is very, very slow. HOT 3
- SelectionBox: Wrong nodes get selected when zoomed/panned
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from baklavajs.