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
{
"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