# HG changeset patch # User luca_milaz # Date 1722794122 0 # Node ID 6544f0027c72eb14b453069597940ae7cf07bcc1 # Parent c1af8b0b2815dccc38bb30a069d9675c7c7ca2eb Uploaded diff -r c1af8b0b2815 -r 6544f0027c72 marea_2/flux_to_map.py --- a/marea_2/flux_to_map.py Sun Aug 04 17:48:17 2024 +0000 +++ b/marea_2/flux_to_map.py Sun Aug 04 17:55:22 2024 +0000 @@ -821,12 +821,14 @@ def gray_to_red_cmap(value): value = abs(value) + # Red color (1, 0, 0) r = 1 g = 0 b = 0 - # Opacity transition from 0.5 to 1 - alpha = 0.5 + 0.5 * value + # Log scale for opacity transition from 0.5 to 1 + log_value = math.log10(1 + 9 * value) / math.log10(10) # Log scale from 0 to 1 + alpha = 0.5 + 0.5 * log_value return (r, g, b, alpha) @@ -871,7 +873,8 @@ for rxn_id in ids: arrow = Arrow(width=5, col=colors_median[rxn_id]) #arrow.applyTo(arrow.getMapReactionId(rxn_id, mindReactionDir=False), metabMap_median, arrow.toStyleStr()) - arrow.applyTo(getArrowBodyElementId(rxn_id), metabMap_median, arrow.toStyleStr()) + #arrow.applyTo(getArrowBodyElementId(rxn_id), metabMap_median, arrow.toStyleStr()) + arrow.styleReactionElements(metabMap_median, rxn_id, mindReactionDir=False) # Now we style the arrow head(s): #idOpt1, idOpt2 = getArrowHeadElementId(arrow.getMapReactionId(rxn_id, mindReactionDir=True)) @@ -882,7 +885,8 @@ arrow = Arrow(width=5, col=colors_mean[rxn_id]) #arrow.applyTo(arrow.getMapReactionId(rxn_id, mindReactionDir=False), metabMap_mean, arrow.toStyleStr()) - arrow.applyTo(getArrowBodyElementId(rxn_id), metabMap_mean, arrow.toStyleStr()) + #arrow.applyTo(getArrowBodyElementId(rxn_id), metabMap_mean, arrow.toStyleStr()) + arrow.styleReactionElements(metabMap_mean, rxn_id, mindReactionDir=False) # Now we style the arrow head(s): #idOpt1, idOpt2 = getArrowHeadElementId(arrow.getMapReactionId(rxn_id, mindReactionDir=True))