I'm trying to make OrientDB Studio display a string as a label for each node, like in this screenshot from Susheel Kumar
But when I run Susheel's code (posted below for posterity), the nodes all appear labelled by their @rid fields instead, like this screenshot:
Question: Is there an automated way to display all these labels?
I can tell an individual node to display its "name" field as a label by clicking (1) the node, (2) the "eye" symbol, (3) the settings symbol, and selecting "name" from the dropdown menu, but this will be impossible to do when I have a large number of nodes. This seems like the sort of thing you'd do when defining the "Person" node class, but I see no indication of this this in Susheel's code (posted below), and I haven't been able to reach him.
And for my application, the visualization is essentially useless if I can't visualize node labels, so any help would be much appreciated :)
Below is the code I took from Susheel's Introduction to OrientDB to produce my screenshot above:
-- Create a class Person and add two properties lastName & firstName using below commands create class Person extends V; create property Person.lastName string; create property Person.firstName string; -- Create a class Employee which extends from Person & add few properties to it create class Employee extends Person; create property Employee.empno integer; create property Employee.sal integer; -- Create a class Department extends from V create class Department extends V; create property Department.deptno integer; create property Department.name string; -- If you noticed we used Inheritance above when creating Employee class by extending it from Person. That's a cool feature!!! Now we have classes to represent vertex (a document) & let's create a class to represent Edge to establish the relationship. create class WorksAt extends E; -- So now we are all set to add/create data to graph model we create above. -- Let's create some employees (vertex or document) create vertex Employee set empno=101,firstName='John',lastName='Jacob',sal=5000; create vertex Employee set empno=102,firstName='Adam',lastName='Bill',sal=7000; create vertex Employee set empno=103,firstName='David',lastName='Manon',sal=4000; -- Similarly lets create some departments create vertex Department set deptno=10,name='Accounts'; create vertex Department set deptno=20,name='HR'; create vertex Department set deptno=20,name='IT'; -- Now time to establish relationship. Create some Edges create Edge WorksAt from #12:0 to #13:1; create Edge WorksAt from #12:1 to #13:0; create Edge WorksAt from #12:2 to #13:2; -- Show all employees select * from Employee;
This is a preference setting that can be easily changed, for each class. You can display the current display settings by issuing the following query (in Browse tab) :
select * from _studio
If there are no records, simply follow the procedure you have described before (click on the node, click the "eye" symbol, than change the "display" property). When you are done, simply click "Save Configuration".
Now the previous query should display a JSON object of type GraphConfig that you can edit. There are a lot of parameters that you can change, such as nodes width, color, icon, radius and display which is the option you are looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With