amalgame/commit
IMPROVED: input/source/target percentage in SVG graph node labels
author | Jacco van Ossenbruggen |
---|---|
Mon Sep 29 15:29:37 2014 +0200 | |
committer | Jacco van Ossenbruggen |
Mon Sep 29 15:29:37 2014 +0200 | |
commit | 91b4f289e66c4de0fd3368a76c5510e8a09efc5c |
tree | 529fde72d97c7cb404a4b5800a2d68be1a4f431c |
parent | 79ed3b3af9695e58fcd96f62cd486e59f6100da5 |
Diff style: patch stat
diff --git a/api/strategy_viz.pl b/api/strategy_viz.pl index 98d8cd1..d1b73ae 100644 --- a/api/strategy_viz.pl +++ b/api/strategy_viz.pl @@ -220,19 +220,28 @@ stats_label_list(Strategy, Resource, [Count]) :- node_stats(Strategy, Resource, Stats, [compute(false)]), option(totalCount(Count), Stats), !. +stats_label_list(Strategy, Resource, [ConceptStats]) :- + node_stats(Strategy, Resource, Stats, [compute(false)]), + option(inputPercentage(IPerc), Stats), IPerc > 0.5, % is too confusing when rounded to 0% + option(sourcePercentageInput(SPerc), Stats), + option(targetPercentageInput(TPerc), Stats), + format(atom(ConceptStats), '~0f% (~0f% ~0f%)', [IPerc, SPerc, TPerc]), + !. stats_label_list(Strategy, Resource, [ConceptStats]) :- node_stats(Strategy, Resource, Stats, [compute(false)]), option(sourcePercentageInput(SPerc), Stats), option(targetPercentageInput(TPerc), Stats), format(atom(ConceptStats), '~0f% ~0f%', [SPerc, TPerc]), !. - stats_label_list(Strategy, Resource, [IPercA]) :- node_stats(Strategy, Resource, Stats, [compute(false)]), - option(inputPercentage(IPerc), Stats, 0), - IPerc > 1, + option(inputPercentage(IPerc), Stats), format(atom(IPercA), '~0f%', [IPerc]), !. stats_label_list(_, _, []). + + + +