TACTIC Open Source
Graph tool Tactic 4.5 - Printable Version

+- TACTIC Open Source (http://forum.southpawtech.com)
+-- Forum: TACTIC Open Source (http://forum.southpawtech.com/forumdisplay.php?fid=3)
+--- Forum: TACTIC Discussion (http://forum.southpawtech.com/forumdisplay.php?fid=4)
+--- Thread: Graph tool Tactic 4.5 (/showthread.php?tid=184)



Graph tool Tactic 4.5 - Bassment - 11-30-2020

Hey all, been playing around with custom layouts, trying some of the graph and chart tools from the VFX template in v4.5

I can get stats for the task I'm looking for but regardless of which task I have in the code, the graph will always display the status from unrelated tasks.

Example, the below code will show me the statuses of ANIMATION, COMPOSITING or whatever is in this line:  filters.append(['pipeline_code','development/ANIMATION'])
but will also include statuses from any task that has the same status in any pipeline in the project.
So it includes "Ready to Start" and "Assignment" from Rigging or Design in the total for example.
The images below should only be ANIMATION according to the script but there are no tasks set to Assignment or Ready to Start in the ANIMATION pipe.



Two questions: How do I prevent these statuses from other tasks being added to the totals and is it possible to generate this graph based on input from a search in the advanced search menu?





Code:
<div class="spt_top">

<%

    my_tasks = kwargs.get("my_tasks")

    if my_tasks == 'true':

        total_expr = "@COUNT(sthpw/task['project_code', $PROJECT]['assigned', $LOGIN])"

    else:

        total_expr = "@COUNT(sthpw/task['project_code', $PROJECT])"


    HEIGHT = 500

    THICKNESS = 40

    total_tasks = server.eval(total_expr)


    process_list_expr = "@UNIQUE(@GET(sthpw/task['project_code', $PROJECT].status))"

    process_names = server.eval(process_list_expr)


    filters = []

    filters.append(['pipeline_code','development/ANIMATION'])

    order_bys = ['sort_order asc']

    process_list = server.query("config/process", filters=filters, order_bys=order_bys)



    bar_width = 100.0 / len(process_list)


    context.write("<table width='100%%' height='%dpx' cellspacing='0px'>" %(HEIGHT) )

    context.write("<tr class='chart_inner'>")


    drawn_processes = []

    for process in process_list:

        status = process.get("process")

        if status not in process_names:

            continue

        if status in drawn_processes:

            continue

        drawn_processes.append(status)

        color = process.get("color")

        if my_tasks == 'true':

            count_expr = "@COUNT(sthpw/task['project_code', $PROJECT]['status', '%s']['assigned', $LOGIN])" %(status)

        else:

            count_expr = "@COUNT(sthpw/task['project_code', $PROJECT]['status', '%s'])" %(status)


        count = server.eval(count_expr)

        if count == 0:

            bar_height = 1

        else:

            bar_height = (HEIGHT - 1) * ((count*1.0) / total_tasks)

        bar_div = "<div>%s</div>" %count

        bar_div += "<div class='chart_bar' style='height:%spx; background:%s;'> </div>" %(bar_height, color)


        td = "<td valign='bottom' style='text-align:center;' width='%s%%'>%s</td>" %(bar_width, bar_div)

        context.write(td)


    context.write("</tr>")

    context.write("<tr>")

    drawn_processes = []

    for process in process_list:

        status = process.get("process")

        if status not in process_names:

            continue

        if status in drawn_processes:

            continue

        drawn_processes.append(status)


        title = "Show all tasks [%s]" %status

        status_link = "<a style='cursor:hand;' title='%s'>%s</a>" %(title, status)

        label_div = "<div class='spt_status' spt_status='%s' style='text-align:center; font-weight:bold'>%s</div>" %(status, status_link)

        td = "<td valign='top'>%s</td>" %label_div

        context.write(td)


    context.write("</tr>")

    context.write("</table>")

    %>




</div>



RE: Graph tool Tactic 4.5 - listy - 12-02-2020

Hi.
What exactly do you want to display?
I think this is all can be fixed by adding filters you need


RE: Graph tool Tactic 4.5 - Bassment - 12-08-2020

Thanks for the reply Listy.
I tried to figure some filters as suggested but I'm still not getting the info displayed correctly.
I'd like to display only the number of scenes with the task statuses for any given stage of a production.
Using the code shown, it does show me the number scenes with each task status for the stage, but it's also pulling task statuses for stages that aren't the one I'm trying to display.
Using the example graph in my original post above, I'm trying to display just "ANIMATION" task statuses but it's including statuses from the "DESIGN" and "COMPOSITING" stage and adding to the total.
There's no scenes that are set to Assignment or Ready to Start in ANIMATION, but the DESIGN and COMPOSITING stages do, and these are being displayed in my ANIMATION graph.
I can't set a filter to not include a status because then if I do have a scene or two with that status it won't show up.
I'm gonna keep trying to figure this out but any help you guys can offer would be great.