Forcelayout is an Android library for visualizing data. You can drawing graph with spring-like attractive forces.
repositories {
jcenter()
}
dependencies {
compile 'jp.kai:forcelayout:1.0.3'
}
HashMap<String, Integer> nodes = new HashMap<>();
nodes.put("labelname_1",R.drawable.example1);
nodes.put("labelname_2",R.drawable.example2);
List<String> links = new ArrayList<String>();
links.put("labelname_1-labelname_2");
You can set node's size and linkstrength, and so on.
Forcelayout.with(this)
.nodesize(200)
.linkStrength(0.1)
.distance(200)
.gravity(0.04)
.nodes(nodes)
.links(links);
Inspired by force layout
in D3.js.
Copyright 2016 kai0masanari
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.