atp-mipt / ljv Goto Github PK
View Code? Open in Web Editor NEWLightweight Java Visualizer
Home Page: https://atp-mipt.github.io/ljv/
License: GNU General Public License v3.0
Lightweight Java Visualizer
Home Page: https://atp-mipt.github.io/ljv/
License: GNU General Public License v3.0
Can we add methods like:
// Set the same label for all objects of the given class
public LJV setClassLabel(Class<?> cz, String label);
// Set a label for an individual object of the given class
public <T> LJV setObjectLabelProvider(Class<T> cz, ObjectLabelProvider<T> labelProvider);
// Set a label for individual objects of the given class (only if it's a specific field)
public <T> LJV setObjectLabelProvider(Field field, Class<T> cz, ObjectLabelProvider<T> labelProvider);
@FunctionalInterface
public interface ObjectLabelProvider<T> {
String getLabel(T obj);
}
var p = new SimpleImmutableEntry(1, 2);
browse(new LJV().setClassLabel(SimpleImmutableEntry.class, "Entry"), p);
var list = new ArrayList<>();
list.add(1);
list.add(2);
browse(new LJV()
.setTreatAsPrimitive(Integer.class)
.setObjectLabelProvider(ArrayList.class, lst -> lst.getClass().getName() + "@" + System.identityHashCode(lst)),
list);
var string = "hello";
browse(new LJV()
.setObjectLabelProvider(String.class, str -> str)
.setObjectLabelProvider(byte.class, b -> "0x" + Integer.toHexString(Byte.toUnsignedInt(b))),
string);
IntLabelProvider
, LongLabelProvider
, ByteLabelProvider
or use setObjectLabelProvider(int.class, (Integer x) -> )
?setClassLabel(List.class, ...)
work only for List
or ArrayList
, LinkedList
and other subclasses?Object[] array = {};
browse(new LJV(), array);
Graphviz Online doesn't render and reports an error:
in label of node n1
Any plan for ide plugins?
The artifact org.atp-fivt:ljv:1.01
uses org.atp-fivt:ljv-parent:${revision}
as its parent
, but that artifact is not deployed to Maven Central.
This causes attempts to use ljv
on a machine that hasn't built the package from source to fail with the error:
Could not resolve dependencies for project net.kemitix.binder:binder-app:jar:1.0.0-SNAPSHOT: Failed to collect dependencies at org.atp-fivt:ljv:jar:1.01: Failed to read artifact descriptor for org.atp-fivt:ljv:jar:1.01: Failure to find org.atp-fivt:ljv-parent:pom:${revision} in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
.
How do I show the relation between multiple Objects?
Let's say I have a class :
public class Node {
int data = 5;
}
The only way to show how n1,n2,n are connected is shown below
public static void main(String[] args) {
Node n = new Node();
Node n1 = n;
Node n2 = n;
System.out.println(new LJV().drawGraph(new Object[]{n1,n2,n}));
}
It would be great If I can do it as below.
LJV ljv = new LJV();
ljv.add(n);
ljv.add(n1);
ljv.add(n2);
ljv.drawGraph();
is this possible currently?
please let me know.
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.