With web-worker, layout algorithms performed on large data with high cost will not block the web page. For all the general graph layout algorithms in G6, you can enable the web-worker by configure workerEnabled: true in the layout configuration above. Graph ( ) ĭifferent layout algorithms have different configurations. More layout configurations can be found in the following sections.Ĭonst graph = new G6. The configurations preventOverlap: true and nodeSize: 30 are assigned to prevent node overlappings, where the nodeSize is used for collide detection. The following code assigns the layout with type: 'force', which means the classical force-directed layout algorithm. Dendrogram Layout: Arrange the leaves on the same level Ĭonfigure layout to the Graph instance to assign the layout methods and their configurations.Grid Layout: Arranges the nodes on grid.Concentric Layout: Arranges the nodes on concentric circles.Dagre Layout: Arranges the nodes hierarchically.Radial Layout: Arranges the nodes around a focus node radially.Circular Layout: Arranges the nodes on a circle.Fruchterman Layout: A kind of force-directed layout.Force Layout: Classical force-directed layout.Random Layout: Randomizes the node postions.In this ducoment, we will introduce the layout algorithms in detail. Once G6 find the x and y information on data, it will render the graph according to it. In other word, users can assign x and y to nodes by any other ways including the algorithms from the third-party libraries. The built-in layouts only calculate and manipulate the x and y in node data. In fact, 'layout' is a free mechanism in G6. Besides, G6 provides the web-worker for general graph layout in case layout calculation takes too long to block page interaction.īesides, G6 supports Custom Layout mechanism for users to design their own layout algorithm. By utilizing the built-in layouts, Translating the layouts and their configurations, translating the data can be achieved. There are several layout algorithms for them respectively. According to the differences of data strucutre, the layouts can be categorized into: general graph layout and tree graph layout. Graph layouts are the algorithms arranging the node positions to obtain a understandable visualizaiton.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |