Comments (4)
Thank you very much. It works as expected.
from v-network-graph.
Hi @markus-ebner,
Thank you for your report.
First, is it possible to use UserConfigs
as an alias for RecursivePartial<Configs>
? I think UserConfigs
has already been exported.
import { UserConfigs } from 'v-network-graph'
...
const mainConfig: UnwrapNestedRefs<UserConfigs> = reactive({})
If you have a case where you want to use RecursivePartial
for something other than Configs
, please let me know again so I will modify it to export.
Best regards,
from v-network-graph.
Thanks for the fast response @dash14!
Yes, I tried it but I get the following problems with UserConfigs
:
const mainConfig: UnwrapNestedRefs<UserConfigs> = reactive({
view: {
// TS2322: Type 'false' is not assignable to type 'true'. Shouldn't this be a boolean type?
panEnabled: false,
// TS2322: Type 'false' is not assignable to type 'true'. Shouldn't this be a boolean type?
zoomEnabled: false,
...
},
edge: {
summarized: {
shape: {
// TS2322: Type '(edge: any) => number' is not assignable to type 'string | number'.
// Type '(edge: any) => number' is not assignable to type 'number'. Somehow the function isn't working here?
strokeDasharray: edge => edge.config.dashDensity as number ?? 0
...
}
...
}
}
}
from v-network-graph.
Hi @markus-ebner,
Thank you very much for your reply and report!
This was a bug...
The type definition was such that false could not be specified for view.{panEnabled, zoomEnabled}
.
edge.summarized.*
config did not support specifying a function, but this has been implemented along with the bug fix.
Note that edge.summarized.*
are the configs when multiple edges are merged into one, so the specified function's argument is not 'edge' but 'edges' ({ edgeId: edge }
object).
const mainConfig = reactive<UserConfigs>({
...
edge: {
summarized: {
shape: {
strokeDasharray: edges => Object.values(edges)[0].someParameterOfEdge as number ?? 0
...
}
...
}
}
}
I just released a new version (v0.3.2), please check it.
from v-network-graph.
Related Issues (20)
- Performance improvement HOT 2
- Unexpected behavior for path containing repeated edge IDs HOT 3
- Potentially unnecessary rendering HOT 2
- Error with curved edges & force layout HOT 1
- Make the graph fit to the edges of the canvas? HOT 7
- Binding does not work in my code HOT 2
- Dynamic node list, d3force and stored positions HOT 4
- Chose from where the edge are starting/ending
- How to avoid edge labels overlapping/obstructed by other nodes/edges? HOT 1
- Performance Issues HOT 1
- Failed to resolve import "v-network-graph/lib/layouts/force" Does the file exist? HOT 2
- Change default selection keys
- Bug: path does not update for computed prop HOT 1
- Add touch events for mobile
- `tick` not rendering properly in `ForceLayout`
- Documentation: Layer example not working
- Node width HOT 1
- Is it possible to set different width for edges or paths between nodes? HOT 1
- Reactive defineConfigs? HOT 1
- Summarized edges markers behavior
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 v-network-graph.