Giter Club home page Giter Club logo

ljv's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar endevir avatar ilyashvetsov avatar inponomarev avatar orangeflag avatar orionchocopie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ljv's Issues

Allow customizing of object labels

Proposal

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);
}

Examples

var p = new SimpleImmutableEntry(1, 2);
browse(new LJV().setClassLabel(SimpleImmutableEntry.class, "Entry"), p);

class_label

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);

class_label

var string = "hello";
browse(new LJV()
        .setObjectLabelProvider(String.class, str -> str)
        .setObjectLabelProvider(byte.class, b -> "0x" + Integer.toHexString(Byte.toUnsignedInt(b))),
        string);

string

Issues

  • Primitives. Should we add IntLabelProvider, LongLabelProvider, ByteLabelProvider or use setObjectLabelProvider(int.class, (Integer x) -> )?
  • Inheritance. Should setClassLabel(List.class, ...) work only for List or ArrayList, LinkedList and other subclasses?

Empty arrays?

Object[] array = {};
browse(new LJV(), array);

Graphviz Online doesn't render and reports an error:

in label of node n1

Artifact deployed to Maven Central depends on parent - which isn't

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.

Adding multiple objects to same graph Instance

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.