Skip to content

Instantly share code, notes, and snippets.

@rcfox
Created April 16, 2016 11:12
Show Gist options
  • Save rcfox/648c4bdfa2660d8fa47ee023c7c19b63 to your computer and use it in GitHub Desktop.
Save rcfox/648c4bdfa2660d8fa47ee023c7c19b63 to your computer and use it in GitHub Desktop.
Production graph of science packs in Factorio
digraph Science {
style=invis; // Remove borders around clusters
edge[dir=back]; // Too lazy to fix the way I input everything...
node[label=""]; // Remove all of the text from nodes.
science1 [image="Science-pack-1.png"]
science2 [image="Science-pack-2.png"];
science3 [image="Science-pack-3.png"];
// Clusters make the contained nodes prefer to stay together.
subgraph cluster_iron {
iron_ore [image="Iron-ore.png"];
iron_plate [image="Iron-plate.png"];
steel_plate [image="Steel-plate.png"];
iron_gear [image="Iron-gear-wheel.png"];
steel_plate -> iron_plate -> iron_ore;
iron_gear -> iron_plate;
}
subgraph cluster_copper {
copper_ore [image="Copper-ore.png"];
copper_plate [image="Copper-plate.png"];
copper_wire [image="Copper-cable.png"];
copper_wire -> copper_plate -> copper_ore;
}
subgraph cluster_circuit {
circuit [image="Electronic-circuit.png"];
advanced_circuit [image="Advanced-circuit.png"];
circuit -> iron_plate;
circuit -> copper_wire;
advanced_circuit -> circuit;
advanced_circuit -> copper_wire;
advanced_circuit -> plastic_bar;
}
subgraph cluster_inserter {
inserter [image="Inserter-icon.png"];
fast_inserter [image="Fast-inserter.png"];
smart_inserter [image="Smart-inserter.png"];
inserter -> iron_plate;
inserter -> iron_gear;
inserter -> circuit;
fast_inserter -> inserter;
fast_inserter -> iron_plate;
fast_inserter -> circuit;
smart_inserter [image="Smart-inserter.png" label=""];
smart_inserter -> fast_inserter;
smart_inserter -> circuit;
}
subgraph cluster_belt {
basic_belt [image="Basic-transport-belt.png"];
basic_belt -> iron_plate;
basic_belt -> iron_gear;
}
subgraph cluster_oil {
plastic_bar [image="Plastic-bar.png"];
battery [image="Battery.png"];
sulfuric_acid [image="Sulfuric-acid.png"];
sulfur [image="Sulfur.png"];
petroleum [image="Petroleum-gas.png"];
crude_oil [image="Crude-oil.png"];
water [image="Water.png"];
coal [image="Coal.png"];
plastic_bar -> coal;
plastic_bar -> petroleum;
battery -> iron_plate;
battery -> copper_plate;
battery -> sulfuric_acid;
sulfuric_acid -> sulfur;
sulfuric_acid -> iron_plate;
sulfuric_acid -> water;
sulfur -> water;
sulfur -> petroleum;
petroleum -> crude_oil;
}
subgraph cluster_s1 {
science1 -> copper_plate;
science1 -> iron_gear;
}
subgraph cluster_s2 {
science2 -> inserter;
science2 -> basic_belt;
}
subgraph cluster_s3 {
science3 -> battery;
science3 -> advanced_circuit;
science3 -> smart_inserter;
science3 -> steel_plate;
}
// Force force some nodes to be closer to each other to make things look nicer.
sulfuric_acid -> plastic_bar [style=invis];
{
rank=same;
coal;
iron_ore;
}
{
rank=same;
steel_plate;
smart_inserter;
advanced_circuit;
battery;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment