Closed juliannej closed 6 years ago
Sure, you can add the column if missing, but also make sure to validate that the column with that id might already exist and have a different type (non numeric), in which case you have to tell the user it's incorrect.
The actual addition - would this be using the toolkit addColumn() function?
I think this would be the case. If I want to allow weight to be a dynamic property OR a static property - what do I put in type when I am adding the column? e.g. addColumn(String id, Class type)
Hi,
The column cannot be static and dynamic at the same time. If you want static, use any number type such as Double.class
.
For dynamic, it depends on the TimeRepresentation
(https://gephi.org/gephi/0.9.2/apidocs/org/gephi/graph/api/TimeRepresentation.html) of the graph. For INTERVAL
, use IntervalDoubleMap.class
, for TIMESTAMP
, use TimestampDoubleMap.class
.
Thank you. With addColumn() do I expect that a new column should be visible in Data Observatory? So far I have not been able to do this. Do I need to alter the table after import?
It should not be necessary, data laboratory does it like this: https://github.com/gephi/gephi/blob/master/modules/DataLaboratoryAPI/src/main/java/org/gephi/datalab/impl/AttributeColumnsControllerImpl.java#L124
Sorry - can you clarify:
Thank you, Julianne
Yes, you should only need to call addColumn on the nodes table. Does it succeed? Then you should be able to see the column in the data laboratory table, it should be that simple.
Other example: https://github.com/gephi/gephi/blob/master/modules/StatisticsPlugin/src/main/java/org/gephi/statistics/plugin/Modularity.java#L641
Thank you!!
I am working on a plugin for node weight. I want 'weight' to become a default column once my plugin (layout) is selected that can be overwritten if the data already had a column entitled 'weight' or if the user wants to copy over a column they already have to act as node weight.
Do you think it is possible to do this for my plugin? Is this the correct place to ask? Would I be using the ToolKit (e.g. addColumn())?
The example I am following is the multi gravity plugin, but they don't create a column by default - they just read the column if present or use 0 and inform the user that they are missing attribute(s).