terrastruct / d2-vscode

VSCode extension for D2 files.
https://d2lang.com
BSD 3-Clause "New" or "Revised" License
226 stars 10 forks source link

loading screen #69

Closed alixander closed 1 year ago

alixander commented 1 year ago

Would be perceived as a lot snappier if we show an immediate loading screen that just streams CLI output until the render shows up.

Or perhaps an overlay so that subsequent renders don't jump from image to text.

https://user-images.githubusercontent.com/3120367/228016174-a3aae9ff-ce4a-4a1d-873e-82c4e89150ea.mp4

D2's CLI also spits out periodic messages when it takes a long time https://github.com/terrastruct/d2/pull/1058

alixander commented 1 year ago
# d2 -w C:\Users\x\Documents\!misc\fridge_modded.d2 -h localhost -p 42069
# d2 -w C:\Users\x\Documents\!misc\fridge_modded.d2 -h localhost -p 42069 --theme=300 --dark-theme=200 -l elk --pad 0

# *.style.stroke: "white"

Lava: {
    shape: parallelogram
    style: {
        stroke: "#FF3300"
        stroke-width: 4
    }
}
Lava -> Alchemist.Netherrack:{
    style.stroke: "#FF3300"
}
Lava -> Alchemist.Blaze Cake:{
    style.stroke: "#FF3300"
}

Quarry: {
    style: {
        stroke: "#828282"
        stroke-width: 4
    }

    Igneous Extruder.shape: parallelogram
    Igneous Extruder -> Cobblestone

    Cobblestone
    Cobblestone -> Stone
    Cobblestone -> Gravel
    Cobblestone -> _.Forging.Gravel:{
        style.stroke: "#828282"
    }
    Cobblestone -> Diorite
    Cobblestone -> Andesite

    Stone

    Gravel
    Gravel -> Sand

    Sand
    Sand -> Glass
    Sand -> Soul Sand

    Glass
    Glass -> _.Apiary.Glass Bottle:{
        style.stroke: "#828282"
    }

    Soul Sand
    Soul Sand -> Nether Quartz

    Nether Quartz
    Nether Quartz -> Diorite

    Diorite
    Diorite -> Andesite

    Andesite
    Andesite -> _.Forging.Andesite Alloy:{
        style.stroke: "#828282"
    }
}

Woodcutting: {
    style: {
        stroke: "#AD7D00"
        stroke-width: 4
    }

    Spruce Log
    Spruce Log -> Stripped Spruce Log

    Stripped Spruce Log
    Stripped Spruce Log -> _.Forging.Andesite Casing:{
        style.stroke: "#AD7D00"
    }
    Stripped Spruce Log -> Spruce Plank

    Spruce Plank
    Spruce Plank -> Stick

    Stick
    Stick -> _.Forging.Toolsmith.Iron Sword:{
        style.stroke: "#AD7D00"
    }
}

Forging: {
    style: {
        stroke: "#D6B656"
        stroke-width: 4
    }

    Gravel
    Gravel -> Sand
    Gravel -> Clay Ball
    Gravel -> Iron Nugget

    Sand
    Sand -> Clay Ball

    Clay Ball
    Clay Ball -> Clay

    Clay
    Clay -> Terracotta

    Terracotta
    Terracotta -> Red Sand

    Red Sand
    Red Sand -> Gold Nugget

    Gold Nugget
    Gold Nugget -> _.Alchemist.Golden Carrot:{
        style.stroke: "#D6B656"
    }
    Gold Nugget -> _.Alchemist.Glistering Melon:{
        style.stroke: "#D6B656"
    }

    Iron Nugget
    Iron Nugget -> Iron Ingot
    Iron Nugget -> Andesite Alloy

    Iron Ingot
    Iron Ingot -> Toolsmith.Iron Sword
    Iron Ingot -> Toolsmith.Shears
    Iron Ingot -> Iron Bars

    Iron Bars
    Iron Bars -> _.Fishery.Water Strainer:{
        style.stroke: "#D6B656"
    }

    Toolsmith: {
        style: {
            stroke: "#D6B656"
            stroke-width: 4
        }
        Iron Sword
        Iron Sword -> _._.Animal Farm.Kill:{
            style.stroke: "#D6B656"
        }
        Iron Sword -> _._.Mob Grinder.Kill:{
            style.stroke: "#D6B656"
        }

        Shears
        Shears -> _._.Animal Farm.Shear:{
            style.stroke: "#D6B656"
        }
        Shears -> _._.Apiary.Shear:{
            style.stroke: "#D6B656"
        }
    }
}

Apiary: {
    style: {
        stroke: "#FFCC99"
        stroke-width: 4
    }

    Bee.shape: parallelogram
    Bee -> Honey Bottle
    Bee -> Shear

    Glass Bottle
    Glass Bottle -> Honey Bottle

    Honey Bottle
    Honey Bottle -> Honey

    Honey.shape: cylinder
    Honey -> _.Confectionary.Mashmallow:{
        style.stroke: "#FFCC99"
    }

    Shear.shape: hexagon
    Shear -> Honeycomb

    Honeycomb
}

Vanilla Crop Farm: {
    style: {
        stroke: "#82B366"
        stroke-width: 4
    }

    Wheat.shape: parallelogram
    Wheat -> Wheat Item
    Wheat -> Seed
    Wheat Item: "Wheat"
    Wheat Item -> _.Animal Farm.Cow:{
        style.stroke: "#82B366"
    }
    Wheat Item -> _.Animal Farm.Sheep:{
        style.stroke: "#82B366"
    }
    Wheat Item -> _.Slime Cube.Wheat Flour:{
        style.stroke: "#82B366"
    }
    Seed

    Carrot.shape: parallelogram
    Carrot -> Carrot Item
    Carrot Item: "Carrot"
    Carrot Item -> _.Animal Farm.Rabbit:{
        style.stroke: "#82B366"
    }
    Carrot Item -> _.Alchemist.Golden Carrot:{
     style.stroke: "#82B366"
 }

    Potato.shape: parallelogram
    Potato -> Potato Item
    Potato Item: "Potato"
    Potato Item -> _.Animal Farm.Pig:{
        style.stroke: "#82B366"
    }

    Bamboo.shape: parallelogram
    Bamboo -> Bamboo Item
    Bamboo Item: "Bamboo"
    Bamboo Item -> _.Fishery.Water Strainer:{
        style.stroke: "#82B366"
    }

    Melon.shape: parallelogram
    Melon -> Melon Item
    Melon Item: "Melon"
    Melon Item -> _.Alchemist.Glistering Melon:{
        style.stroke: "#82B366"
    }

    Pumpkin.shape: parallelogram
    Pumpkin -> Pumpkin Item
    Pumpkin Item: "Pumpkin"

    Cactus.shape: parallelogram
    Cactus -> Cactus Item
    Cactus Item: "Cactus"
    Cactus Item -> _.Slime Cube.Green Dye:{
        style.stroke: "#82B366"
    }

    Sugar Cane.shape: parallelogram
    Sugar Cane -> Sugar Cane Item
    Sugar Cane Item: "Sugar Cane"
    Sugar Cane Item -> _.Confectionary.Sugar:{
        style.stroke: "#82B366"
    }
    Sugar Cane Item -> _.Confectionary.Paper:{
        style.stroke: "#82B366"
    }

    Cocoa Beans.shape: parallelogram
    Cocoa Beans -> Cocoa Beans Item
    Cocoa Beans Item: "Cocoa Beans"
    Cocoa Beans Item -> _.Confectionary.Crushed Cocoa:{
        style.stroke: "#82B366"
    }
    Cocoa Beans Item -> _.Confectionary.Chocolate:{
        style.stroke: "#82B366"
    }
    Cocoa Beans Item -> _.Confectionary.Dark Chocolate:{
        style.stroke: "#82B366"
    }
    Cocoa Beans Item -> _.Confectionary.Ruby Chocolate:{
        style.stroke: "#82B366"
    }

    Beetroot.shape: parallelogram
    Beetroot -> Beetroot Item
    Beetroot -> Beetroot Seeds
    Beetroot Item: "Beetroot"
    Beetroot Seeds

    Brown Mushroom.shape: parallelogram
    Brown Mushroom -> Brown Mushroom Item
    Brown Mushroom Item: "Brown Mushroom"
    Brown Mushroom Item -> _.Alchemist.Fermented Spider Eye:{
        style.stroke: "#82B366"
    }

    Red Mushroom.shape: parallelogram
    Red Mushroom -> Red Mushroom Item
    Red Mushroom Item: "Red Mushroom"
}

Fishery: {
    style: {
        stroke: "#6C8EBF"
        stroke-width: 4
    }

    Water Strainer
    Water Strainer -> Catch Fish

    Catch Fish.shape: hexagon
    Catch Fish -> _.Animal Farm.Raw Fish:{
        style.stroke: "#6C8EBF"
    }
    Catch Fish -> Pufferfish

    Pufferfish
}

Animal Farm: {
    style: {
        stroke: "#E356D0"
        stroke-width: 4
    }

    Cow.shape: parallelogram
    Cow -- Kill

    Pig.shape: parallelogram
    Pig -- Kill

    Rabbit.shape: parallelogram
    Rabbit -- Kill

    Sheep.shape: parallelogram
    Sheep -- Kill
    Sheep -> Shear

    Chicken.shape: parallelogram
    Chicken -- Kill
    Chicken -> Egg

    Kill: {
        shape: hexagon
        style.multiple: true
    }
    Kill -> Raw Beef
    Kill -> Raw Pork
    Kill -> Raw Rabbit
    Kill -> Raw Mutton
    Kill -> Raw Chicken

    Raw Beef
    Raw Beef -> Minced Beef

    Raw Pork
    Raw Pork -> Minced Pork

    Raw Rabbit
    Raw Rabbit -> Minced Rabbit

    Raw Mutton
    Raw Mutton -> Minced Mutton

    Raw Chicken
    Raw Chicken -> Minced Chicken

    Raw Fish
    Raw Fish -> Minced Fish

    Minced Beef

    Minced Pork

    Minced Rabbit

    Minced Mutton

    Minced Chicken

    Shear.shape: hexagon
    Shear -> Wool

    Egg -> _.Alchemist.Blaze Cake Base: {
        style.stroke: "#E356D0"
    }
    Egg -> _.Confectionary.Mashmallow: {
        style.stroke: "#E356D0"
    }
}

Alchemist: {
    style: {
        stroke: "#11D6B5"
        stroke-width: 4
    }

    Netherrack
    Netherrack -> Cinder Flour

    Cinder Flour
    Cinder Flour -> Netherrack
    Cinder Flour -> Blaze Cake Base
    Cinder Flour -> Glowstone Dust
    Cinder Flour -> Gunpowder
    Cinder Flour -> Redstone Dust

    Blaze Cake Base
    Blaze Cake Base -> Blaze Cake

    Blaze Cake

    Glowstone Dust

    Gunpowder

    Redstone Dust

    Blaze Powder
    Blaze Powder -> Apothecary.Strength

    Nether Wart.shape: parallelogram
    Nether Wart -> Nether Wart Item

    Nether Wart Item: "Nether Wart"
    Nether Wart Item -> Apothecary.Awkward Potion

    Golden Carrot
    Golden Carrot -> Apothecary.Night Vision

    Glistering Melon -> Apothecary.Healing

    Fermented Spider Eye
    Fermented Spider Eye -> Apothecary.Potion of Harming

    Apothecary: {
        style: {
            stroke: "#11D6B5"
            stroke-width: 4
        }

        Water.shape: parallelogram
        Water -> Awkward Potion

        Awkward Potion.shape: cylinder
        Awkward Potion -> Night Vision
        Awkward Potion -> Healing
        Awkward Potion -> Strength

        Night Vision: "Potion of Night Vision\n(3:00)" {
            shape: cylinder
        }
        Night Vision -> _.Glowstone Dust

        Healing: "Potion of Healing" {
            shape: cylinder
        }
        Healing -> Harming

        Harming: "Potion of Harming" {
            shape: cylinder
        }
        Harming -> _.Gunpowder

        Strength: "Potion of Strength" {
            shape: cylinder
        }
        Strength -> _.Redstone Dust
    }
}

Mob Grinder: {
    style: {
        stroke: "#B85450"
        stroke-width: 4
    }

    Skeleton.shape: parallelogram
    Skeleton -- Kill

    Zombie.shape: parallelogram
    Zombie -- Kill

    Spider.shape: parallelogram
    Spider -- Kill

    Blaze.shape: parallelogram
    Blaze -- Kill

    Kill: {
        shape: hexagon
        style.multiple: true
    }
    Kill -> Bones
    Kill -> Rotten Flesh
    Kill -> String
    Kill -> Spider Eye
    Kill -> Blaze Rod

    Bone
    Bone -> Bonemeal

    Bonemeal
    Bonemeal -> _.Slime Cube.White Dye: {
        style.stroke: "#B85450"
    }

    Rotten Flesh

    String

    Spider Eye
    Spider Eye -> _.Alchemist.Fermented Spider Eye: {
        style.stroke: "#B85450"
    }

    Blaze Rod
    Blaze Rod -> _.Alchemist.Blaze Powder: {
        style.stroke: "#B85450"
    }
}

Slime Cube: {
    style: {
        stroke: "#336600"
        stroke-width: 4
    }

    White Dye
    White Dye -> Lime Dye

    Green Dye
    Green Dye -> Lime Dye

    Lime Dye -> Slime Ball

    Water.shape: parallelogram
    Water -> Dough Ball

    Wheat Flour
    Wheat Flour -> Dough Ball

    Dough Ball
    Dough Ball -> Slime Ball

    Slime Ball
    Slime Ball -> _.Confectionary.Mashmallow: {
        style.stroke: "#336600"
    }
}

Confectionary: {
    style: {
        stroke: "#9673A6"
        stroke-width: 4
    }

    Sugar
    Sugar -> _.Alchemist.Fermented Spider Eye: {
        style.stroke: "#9673A6"
    }
    Sugar -> Caramel
    Sugar -> Chocolate
    Sugar -> Dark Chocolate
    Sugar -> White Chocolate
    Sugar -> Ruby Chocolate
    Sugar -> Mashmallow
    Sugar -> Mundane Potion
    Sugar -> Candy Cane

    Water.shape: parallelogram
    Water -> Caramel
    Water -> Mundane Potion
    Water -> Candy Cane
    Water -> Mashmallow

    Caramel.shape: cylinder
    Caramel -> Mashmallow

    Mundane Potion: "Mundane Potion\n(Sugar)" {
        shape: cylinder
    }
    Mundane Potion -> Candy Cane

    Candy Cane

    Crushed Cocoa
    Crushed Cocoa -> Cocoa Powder
    Crushed Cocoa -> Cocoa Butter

    Cocoa Powder

    Cocoa Butter
    Cocoa Butter -> Dark Chocolate
    Cocoa Butter -> White Chocolate

    Hot Chocolate.shape: cylinder
    Hot Chocolate <- Sugar #I should have done it this way initially
    Hot Chocolate <- Cocoa Powder
    Hot Chocolate <- Milk

    Cow in a Jar.shape: parallelogram
    Cow in a Jar -> Milk

    Milk.shape: cylinder
    Milk -> Chocolate
    Milk -> Dark Chocolate
    Milk -> White Chocolate
    Milk -> Ruby Chocolate

    Chocolate.shape: cylinder
    Chocolate -> Chocolate Bar

    Dark Chocolate.shape: cylinder
    Dark Chocolate -> Dark Chocolate Bar

    White Chocolate.shape: cylinder
    White Chocolate -> White Chocolate Bar

    Ruby Chocolate.shape: cylinder
    Ruby Chocolate -> Ruby Chocolate Bar

    Paper
    Paper -> Full Chocolate Bar
    Paper -> Full Dark Chocolate Bar
    Paper -> Full White Chocolate Bar
    Paper -> Full Ruby Chocolate Bar

    Chocolate Bar
    Chocolate Bar -> Full Chocolate Bar

    Dark Chocolate Bar
    Dark Chocolate Bar -> Full Dark Chocolate Bar

    White Chocolate Bar
    White Chocolate Bar -> Full White Chocolate Bar

    Ruby Chocolate Bar
    Ruby Chocolate Bar -> Full Ruby Chocolate Bar

    Full Chocolate Bar

    Full Dark Chocolate Bar

    Full White Chocolate Bar

    Full Ruby Chocolate Bar
}