Comments (5)
This should be supper easy because particle is just png image so providing optional object property to vizceral like this:
shapes: {
squared: squaredParticleUrl
...
}
and then inside connection, optional shape: "squared"
with fallback to default particle if something bad happen. It can be useful but I don't know if it's aligning with project ideology.
/cc: @jrsquared
from vizceral.
Yep, something like that would be great. It's definitely been an ask for custom particle shapes that I would be happy to review a PR for. It gets a little interesting on what you map the shapes to; do you have it be overridable by connection? Overridable by metric name? Overridable by some other metadata? @tavor999, if you put together a proposal, i would be happy to review!
from vizceral.
Thanks for the fast response. As I mentioned we are using a pretty cookie cutter implementation based on the example app provided. I am not sure if I am well suited to provide a larger proposal for how this should/could be implemented. Our ask would be simply that we can define metrics (normal/warning/danger) by particle per connection. I can't think of a scenario where we would want to override it completely for a given connection. Maybe within the metadata we could define custom metrics which map to the particle color and shape (image).
from vizceral.
Not to be a wet blank, but it is a bit messier than just adding a new PNG. I added a custom particle shape to my setup, an arrow head, to make it clearer which way the particles were flowing.
Unfortunately, it exposed an issue that is more complicated than the arrow head is beneficial... to me at least. What it boils down to is that the particle, being an image, is a fixed orientation. So if a connection is a perfectly level horizontal line and the traffic was flowing from left-to-right my arrow head particle was perfect. The arrow pointed in the direction of the flow. If the traffic flow was from right-to-left the arrow head is pointed the wrong direction... it is just an image after all.
Depending on your particle "shape" the issue can be more complicated when you add in the angle of a connection. For example, a connection at a rising 45-degree angle from left-to-right the arrow head is still pointing to the right, not at 45-degrees.
At any rate, now I get why the particle PNG is a circle. It looks correct regardless of direction of travel or angle of the path. When you use a particle image with a natural "orientation" like an arrow head you then see issue. I speculate getting WebGL to constantly be rotating the PNG to keep it oriented in a particular direction, even if just on a connection by connection basis, would require a tracking a fair amount of additional "parameters." If someone knows please comment.
BUT for a text it might work just fine out of the box. Because you would want the constant orientation that comes with the image so that the text/letter is readable.
The real key to attribute to look out for even with text is if the traffic is moving in any direction other than left-to-right.
If you want to try it out it out for yourself, copy the attached file into vizceral/src/base
and rename it to particleD.png. You might have to rebuild the Vizceral library (npm run-script build) if you are using the vizceral with vizceral-react, and/or vizceral-example.
The image is a 512x512 pixels compared to the 256x256 of the circle,
arrow head png
I also went in and just for testing (it isn't reliable) I add 'this.setParticleSize(nextFreeParticleIndex, 15);' as the last line in of launchParticles
in connnectionView.js
. Otherwise, the arrows are still rendered at the same size as the circles and are indistinguishable.
Note: it was important to get the alpha channel/transparency set right along with the main color so that the particle coloring still works. Look at the particleD.psd to help sort it out.
Well, that's my experience. Good luck and please keep us informed of anything you learn.
from vizceral.
Yeah, it would definitely be more difficult if the images are directional. Thank you @aSqrd-eSqrd!
from vizceral.
Related Issues (20)
- memory leak?
- Allow embedding images/HTML in notices HOT 2
- Next in timeline? HOT 1
- Problem of calling updateData with same trafficData HOT 1
- Curved connections between nodes HOT 3
- problem HOT 2
- 'TypeError: Cannot read property 'showLabels' of undefined' when set showLabels to false HOT 2
- vizceral.js:formatted:37091 Uncaught TypeError: r.setValue is not a function : Upgrading to 4.7.0 version. HOT 3
- Problem with Dockerfile with a create-react-app and the Vizceral
- Delete merged branches
- Install fails with [email protected] HOT 1
- Class Vizceral can't accept external layout HOT 1
- Notices don't show
- Vizceral doesn't show live metrics
- Which tool is Netflix using now? HOT 4
- Next step after the installation of Vizceral HOT 2
- Request Dynamic font size for label
- how to change connection notice icon?
- How traffic data is collected HOT 1
- Is there any way to place each donut graph on specific place
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 vizceral.