Giter Club home page Giter Club logo

.graph's Introduction

.graph

๐Ÿ˜„ Let's welcome new serialisation format. The only role of the format is to hold the structure without data and types.

If you think graph, there are no arrays there there are only nodes and connections.

Deserialisation is up to you also

Why?

World is moving towards graph sourced systems.

Example

So assume we have a file DatabaseStructure.graph with the following contnent:

Structure

Person {
    animals
    friends
    gender
    age
}

That's 34 bytes

Deserialization

So this graph code could be deserialized as using pseudocode

code = Graph.parse("JackSparrow.graph")
{
    "Person":{
        "animals":{},
        "friends":{},
        "gender":{},
        "age":{}
    }
}

To define the same structure in json it takes 59 bytes. Of course you can deserialise it in other way this is just an example.

As we can see the size of that .graph file differs from .json file and its only 67% of size

Real world usage - Tests

Webpage{
    Pages{
        Home{
            menuButton
            heading1
            heading2
            testimonials{
                Jerry
                John
                Patricia
            }
        }
        About{
            menuButton
            Team{
                Jennifer
                Eve
                Tom
                Robert
            }
        }
        Contact{
            menuButton
            form{
                email
                message
                send
            }
        }
    }
}

Now using some testing framework I can bind exact string values to my elements and click them without writting this creepy structure:

{
    "Webpage":{
        "Pages":{
            "Home":{
                "menuButton": "menuButton",
                "heading1": "heading1",
                "heading2": "heading2",
                "testimonials": {
                    "Jerry": "Jerry",
                    "John": "John",
                    "Patricia": "Patricia"
                }
            },
            "About":{
                "menuButton": "menuButton",
                "Team":{
                    "Jennifer": "Jennifer",
                    "Eve": "Eve",
                    "Tom": "Tom",
                    "Robert":"Robert"
                }
            },
            "Contact":{
                "menuButton": "menuButton",
                "form":{
                    "email": "email",
                    "message": "message",
                    "send": "send"
                }
            }
        }
    }
}

Real world usage UX planning

MainScreen{
    openTutorial{
        skipLesson
        checkLesson
    }
    openProjects{
        createProject{
            typeName
            submit
        }
        loadProject
        deleteProject
    }
    openHelp{
        search
        sendFeedback
    }
    openConsole{
        submitCommand
    }
}

Real world usage UI planning

LoginScreen{
    googleLogin
    githubLogin
    usernameInput
    passwordInput
    submit
}
TodosScreen{
    todoList{
        name
        done
    }
    newTodo{
        nameInput
        submit
    }
}

.graph's People

Contributors

aexol avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.