Comments (2)
Yeah, this would be really nice to have.
Loading the data is more convoluted than necessary. This is simply because I had a dataset in the format like objects.json
that you see, and I needed to get it into the format that d3.layout.force
consumes (data values + the links between them, with source
and target
properties).
Here is roughly the code path for transforming and loading the data:
script.js
#L17 - Browser makes a request tojson.php
common.php
#L93 - Server readsobjects.json
which hasdepends
(child dependencies) for each object, and uses them to computedependedOnBy
(parent dependencies). Also loads documentation for each objectscript.js
#L83 - Browser computesgraph.links
which is the list of{ source: x, target: y }
objects thatd3.layout.force()
needs.
So, to implement a simple filter, I'd put some code in between steps 2 and 3 above. See #13 for a code sample.
To make the filter fully dynamic (so that it does not require a page refresh), there would be a good bit more work needed - I didn't anticipate that sort of usage when I wrote the code. When the filter changes, you'd probably want to track which objects and links are changing visibility as a result, and use the standard d3 enter
and exit
selections to add/remove them from the DOM. Then, you'd want to recompute the force layout with graph.force.start()
or similar.
(A semi-related enhancement: update the layout when the browser window is resized. See #15 for that.)
from d3-process-map.
Thanks for the detailed response Nylen, I'll let you know our findings and provide you with a sample once we have it working. I'll detail some simple tests as well and keep flexibility in mind so we can push it.
We may stick to the easier solution of refreshing the page as that's acceptable for our purpose.
from d3-process-map.
Related Issues (20)
- Hierarchical edge bundling
- Blue highlight doesn't show on Firefox HOT 2
- Change the color of highlight arrows
- Hide orphan nodes HOT 1
- Update object layout when browser window is resized
- Compatibility between D3.js BSD License and d3-process-map MIT license HOT 1
- Possible to change arrow direction? HOT 1
- Example links are not working anymore HOT 1
- Position of All Nodes to be remain same when page refreshed HOT 1
- Ability to group nodes HOT 1
- D3JS V4 version? HOT 1
- How to change rect text color? HOT 1
- About multiple relationships? HOT 1
- Any Idea How I can Improve Performance HOT 1
- Improving the max number of objects HOT 1
- Colored arrows HOT 2
- how can I use this in a Django project HOT 1
- Is it possible to integrate this with R Shiny? HOT 1
- Possible to connect a vertex to itself? HOT 2
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 d3-process-map.