Skip to main content

Raphaël lifecycle node tree

I recently wrote a script to display product life cycle states in a chart. This chart has to be dynamic. The life-cycle state definition is dynamic and can be different from case to case. So the states and there relationship with each other is represented using a JSON file. Following is a part of what I have used with my script. ( The complete JSON is included with the sample given at the end of this post ).

 {
    "state": [
        {
            "id":"Development",
            "type":"initial" ,
            "transition": [

                {
                    "target":"Deprecated",
                    "event":"Demote"
                }
            ]
        },

         {
            "id":"Deprecated",
            "type":"end" ,
            "transition": []
        },
        {
            "id":"Deprecated2",
            "type":"end" ,
            "transition": []

        }
   ]
}

Following is what comes out from the script.

 

Each nodes clicked event is listened and handled. Also the tree is animated. It looks bit lame but can be modified a bit to look cool :)  Sadly this is not used in any real life product since the one which was going to use has died. If any one want's this in there world you are free to do anything with this. Right now this only woks with FF :( .... You will have to debug this for Chrome by yourself.

Download


Comments

Popular posts from this blog

Projecting HTML Elements on a circle using Javascript

Recently I wonted to create a tree control with a different approach. The requirement was to represent a node tree with main node on the circle center and it's child nodes projected on a circle around it. This is what i wanted. My solution has 5 files prototype.js This is a handy javascript framework. You can download the latest version from there website ( www.prototypejs.org/download ). I am using this to simply handle the onload event in the page. circle.html script.js node-main-left.gif node-sub-left.gif The circle.html, prototype.js and the script.js files are in the root folder and the two images are inside a folder named “images”. This is how the html file looks(circle.html). <html> <head> <script src="prototype.js" type="text/javascript"></script> <script src="script.js" type="text/javascript"></script> <script language="javascript" xml:space...

APIM 3.0 - populate multiple apis - bash script

Created a bash script to create, tag and publish multiple APIs. This is useful to populate data for the landing page. #!/bin/bash # get the URL consumer key clientId=$(curl -k -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -d @payload.json https://localhost:9443/client-registration/v0.14/register | jq -r '.clientId') clientSecret=$(curl -k -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -d @payload.json https://localhost:9443/client-registration/v0.14/register | jq -r '.clientSecret') echo $clientId echo $clientSecret encoded=$(echo -ne $clientId:$clientSecret | base64) echo $encoded # get access token accessToken=$(curl -k -d "grant_type=password&username=admin&password=admin&scope=apim:api_view,apim:api_create" -H "Authorization: Basic $encoded" https://localhost:9443/oauth2/token | jq -r '.access_token'...

Flying to the light

I just had a thought about humans and this whole wold. The technology is growing so fast. During the last century most of the advanced technologies came in to existence. Now I can simply video chat with my friend in USA, send him photos, sync with him and work on same task., and do so many things with the current technologies. Within another century we might be able to contact other lifeforms in the universe if we were able to develop our technologies like this. Shouldn't we be happy about that and be energetic. I don't think so.. Y? There are 100 to 200 billion galaxies in the Universe, each of which has hundreds of billions of stars. There has to be billions of civilizations out there. If the technology can be sustainably develop in to such a state that we are able to travel through Universe and contact other life forms, there has to be some one trying to contact us right now. But there aren't any.. So what does that tells us? It simply says we can't ...