Skip to content

Commit

Permalink
feat:plotly final enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
Patil authored and sbrugman committed Jun 27, 2022
1 parent 4cda559 commit a602d88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions popmon/visualization/templates/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ <h4 class="card-title">{{metric.name | fmt_metric}}</h4>
console.log("plotting graph");
{% if 'barplot' in metric.type %}
TESTER = document.getElementById("{% if feature%}{{ feature.name }}-{%endif%}{{ metric.name }}");
Plotly.newPlot(TESTER, JSON.parse('{{ metric.plot | tojson }}'), JSON.parse('{{ metric.layout | tojson }}'));
Plotly.newPlot(TESTER, JSON.parse('{{ metric.plot | tojson }}'), JSON.parse('{{ metric.layout | tojson }}'),{displaylogo: false, modeBarButtonsToRemove: ['lasso2d']});
{% else %}
TESTER = document.getElementById("{% if feature%}{{ feature.name }}-{%endif%}{{ metric.name }}");
Plotly.newPlot(TESTER, JSON.parse('{{ metric.plot | tojson }}'), feature{{ section_index }}{{ curr }}_layout["{{ metric.type }}"]);
Plotly.newPlot(TESTER, JSON.parse('{{ metric.plot | tojson }}'), feature{{ section_index }}{{ curr }}_layout["{{ metric.type }}"],{displaylogo: false, modeBarButtonsToRemove: ['lasso2d']});
{% endif %}
}
}, { threshold: [0] });
Expand Down
4 changes: 3 additions & 1 deletion popmon/visualization/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ def xtick(lab):
"xanchor": "right",
"x": 1,
"font": {"size": 10},
}
},
hovermode='x unified'
)

plot = json.loads(fig.to_json())
Expand Down Expand Up @@ -465,6 +466,7 @@ def xtick(lab):
y=[xtick(lab) for lab in labels],
color_continuous_scale=cmap,
text_auto=".2f",
aspect="auto",
)

# set label granularity
Expand Down

0 comments on commit a602d88

Please sign in to comment.