For fully support the relation project we need multiple links from A to B.

Is includes/graph.inc ok for this too?

Comments

clemens.tolboom’s picture

Springy solved this by numbering the links and then dis-align them a little

See ie http://dhotson.github.com/springy/demo.html

clemens.tolboom’s picture

There are two problems to solve:

Allow for multiple links into the data structure.

The functions to add a link are not allowing for multiple links.

function graphapi_add_link(&$graph, $from_id, $to_id) 

function graphapi_set_link_title(&$graph, $from_id, $to_id, $title)

We should allow for a link_id which ie relation module knows of as each relation is an entity. By adding argument link_id we can allow for this.

function graphapi_add_link(&$graph, $from_id, $to_id, $link_id = NULL) 

and new function

function graphapi_set_link_title_by_id(&$graph, $link_id, $title)

But are contrib modules thejit_* capable of managing this? Same goes for graph_phyz.module

graph_phyz is rendering based on from/to IDs

The html generated by graph_phyz is

<edges>
  <edge from="from-1" to="to-1">Title of link</edge>
  <edge from="from-1" to="to-2"></edge>
</edges>

thus graph_phyz need to get an edge id. That should be another issue.

clemens.tolboom’s picture

Note this is moving away from http://api.drupal.org/api/drupal/includes!graph.inc/7 data structure.

Shouldn't we stick to that structure? Relation module is deviating too.

I'm not aware of core use cases yet as module dependencies and hook_install_dependencies are just simple links.

Maybe #1247476: ModuleHandler::parseDependency fails on major version ops (>27.x) and (<=28.x) is a use case for core to improve on graph.inc as it has more edges between modules only distinguised by the versioned dependencies.

clemens.tolboom’s picture

Assigned: clemens.tolboom » Unassigned
ramazanaman’s picture

Just starting to learn Drupal. I will also be useful to know these methods. Thank you.

clemens.tolboom’s picture

@ramazanaman: please be more specific.

clemens.tolboom’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Issue tags: +D7 stable release blocker

As we now use https://github.com/clue/graph we can build this :)

clemens.tolboom’s picture

As can be seen in the image below http://drupal.org/project/graph_phyz supports multiple links

Graph API | Site-Install.png

As we are moving towards using Graph.php we have the problem how to prevent multiple links.

Please give some feedback on this.

clemens.tolboom’s picture

One puzzle is how to prevent unnecessary links. That is adding a links, then set the title, then set the data.

This should be done in one go.

$link = graphapi_add_link($from, $to)
$link->setTitle();
$link->setData();
etc;
clemens.tolboom’s picture

Version: 7.x-2.x-dev » 8.x-1.x-dev
Issue summary: View changes

This is postponed for 8.x-1.x