score:0
The point of the force layout is to automatically lay out a graph like this so that you don't have to specify the positions of the nodes yourself. How it does that is largely affected by the connections between the nodes. The graph you have doesn't lend itself very well to being laid out in a wide screen format because of its high connectivity -- that is, many nodes are connected to many other nodes. If you were to stretch the graph, some links would become much longer than others and some nodes would be much closer together than others -- this is exactly what the force layout prevents.
You can of course manually "hack" the layout to achieve what you want -- you could, for example, specify different link distances/strengths for each link so that the ones you want to be larger are weaker. Similarly, you could specify a charge function that assigns a weaker repulsion charge to the nodes you want to be closer together.
However, for all of this you would need a pretty good idea of what you want the graph to look like when finished. It would probably be easier to ditch the force layout altogether and simply specify the positions of the nodes yourself.
score:2
You can easily squeeze diagram to fit 16:9 better.
9/16 is .5625
. In this fiddle you just look for lines that contain .5625
, thats all you need to get your diagram squeezed.
And in this another fiddle you can see your diagram completely smashed, with smaller constant. :) .
Since diagram has a little chaotic look, maybe the good constant for your case would be around 0.4. that way it will fit 16:9 with more certainty.
Source: stackoverflow.com
Related Query
- d3.js - How can I expand force directed graph horizontally?
- How can I determine the overall size of a force directed graph
- How can I use crossfilter to filter graph data and visualize them on a force directed graph?
- How can I append text to and render that text from a line in a force directed graph in D3.js?
- How can I add text to edges in a force directed graph d3?
- How can I show a graph using d3 force layout with initial positions set and no movement at all?
- How do I control the bounce entry of a Force Directed Graph in D3?
- how to stop movement of force directed graph on force.start
- How to calculate in-degree, out-degree and weigted degree for force directed graph (d3.js)?
- How to add a dynamic legend to a D3 force directed graph in Apex?
- How to render links as elbow connectors in d3 force directed graph
- How do I make a d3.js force directed graph interactive using ajax and python?
- how to add mouse events to force directed graph using the d3 canvas renderer?
- How can I dynamically change the position and the size of direction arrows on a directed d3.js force layout?
- How to label a force directed Graph on d3?
- How can i put label to my node in d3 directed graph
- How to restrict number of nodes initially in d3 Force directed graph
- How to expand child from JSON, load data after click parent - D3.Js - force directed layout
- D3.js: How to make force directed graph faster
- How do I group the nodes in a force directed graph
- how to highlight(change color) of all connected(neighbours) nodes and links in a d3 force directed graph
- How to change color of nodes in force directed graph
- How can i convert d3 force directive graph to use with angularjs?
- How to show edges in force directed graph using d3.js and Angular?
- How to make d3js force directed graph less shaky when a node is dragged?
- how to detect element drag in d3.js force directed graph
- How can on make a static force graph in D3.js V4?
- How to zoom and translate to center of force directed graph in D3
- How to make it so D3 Force Directed Graph generates nodes in same position each time
- How to position nodes Force Directed Graph D3 with CSS?
More Query from same tag
- d3.js right align nested bar chart
- D3js loop through variable length series for scatter plot
- D3 v4 line chart with JSON dates
- Possibility of creating reusable D3.js/jQuery data-attribute components or modules
- Change xaxis text orientation on waterfall chart example
- d3.js force directed graph: How to make node size depends on the value of the links?
- Create hierarchy from row data
- Why is data not updating correctly on this D3.js barchart?
- reading data from Ruby in D3 (JSON)
- how to add text on line in D3?
- GraphStream: Interactive Web Application
- d3 lines between dots not working
- Reposition nodes in a multi-foci d3 force layout
- Dynamically project a Single County
- Getting data from json file for D3 bubble chart
- d3.js pie chart clock
- How do I scroll d3 elements while keeping a portion of the svg in a fixed position?
- Strange D3 pan/zoom behaviour - accelerating pan
- Building dynamic lists of billboard.js charts
- d3 zoomable treemap - adding new captions in the right place
- Insert child elements in d3.js
- d3 line and points on map from geojson or csv data
- access var outside function scope
- Updating mpld3 figure with JSON data
- What is the best way to combine multiple csv files data input using d3.csv in d3.json ?
- line chart unable to draw with month on x axis
- Using the selection index in looped d3.js transition
- Calculate absolute position for d3 graph nodes
- d3 js linear scale bar position and height in stacked to multiple charts
- Convert JSON made by PHP "json_encode", into array to plot those values with D3