vasturiano / d3-force-limit Goto Github PK
View Code? Open in Web Editor NEWA positioning hard limit force type for the d3-force simulation engine
Home Page: https://observablehq.com/@vasturiano/d3-force-limit
License: MIT License
A positioning hard limit force type for the d3-force simulation engine
Home Page: https://observablehq.com/@vasturiano/d3-force-limit
License: MIT License
I like the way this is going forward! The demos work well, and the computation at each step is quite simple (which means fast and understandable).
Can we explore changes in the API:
set the values in one go (ie .extent([extent]) rather than x0 x1โฆ)
(optionally?) specify the cushion's size as a proportion of the dimensions (e.g. %) rather than pixels.
have default values that already do some work (e.g. extent [0,0,960,500], cushion "2%")
In terms of code:
no need to specify numDimensions in the initialization: just set the list of coordinates to inspect whenever the x,y,z accessor is set (that is, when by default it's infinite)
check undefined/null/NaN instead of hasownproperty?
Also, I'd love to use a (convex) polygon rather than just an horizontal rectangle, but I imagine it might make things a bit slower and it's not that easy to specify in 3D.
I'm trying to constrain some nodes in 3D to a sphere. I'm using 3d-force-graph and hoping to do the constraining with d3-force-limit.
My current naive approach is here: https://codepen.io/jokroese/pen/ExQMrpj.
The problems are:
Do you have suggestions on next steps for moving forward with this?
Possible options:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.