-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added multiple axes to line graphs. * Updated to correct version of plotly. 'latest' is actually not.
- Loading branch information
Showing
4 changed files
with
110 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,100 +1,110 @@ | ||
<html> | ||
<head><meta charset="utf-8" /></head> | ||
<body> | ||
<head><meta charset="utf-8" /></head> | ||
<body> | ||
<div> | ||
|
||
<script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script> | ||
<script src='https://cdn.plot.ly/plotly-2.34.0.min.js'></script> | ||
<div id="b4d1ccf6-a731-4cfc-95dd-479f770eaa06" class="plotly-graph-div" style="height:100%; width:100%;"></div> | ||
<script type="text/javascript"> | ||
|
||
<script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script> | ||
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script> | ||
<div id="b4d1ccf6-a731-4cfc-95dd-479f770eaa06" class="plotly-graph-div" style="height:100%; width:100%;"></div> | ||
<script type="text/javascript"> | ||
|
||
window.PLOTLYENV=window.PLOTLYENV || {}; | ||
|
||
if (document.getElementById("b4d1ccf6-a731-4cfc-95dd-479f770eaa06")) { | ||
Plotly.newPlot( | ||
'b4d1ccf6-a731-4cfc-95dd-479f770eaa06', | ||
[ | ||
{%- for trace in traces %} | ||
{ | ||
"hoverlabel": { | ||
"namelength": 0 | ||
}, | ||
{%- if 'hovertemplate' in trace %} | ||
"hovertemplate": "{{ trace.hovertemplate }}", | ||
{%- else %} | ||
"hovertemplate": "{{ trace.xlabel }}=%{x} {{ trace.xunits }}<br>{{ trace.ylabel }}=%{y} {{ trace.yunits }}", | ||
{%- endif %} | ||
"legendgroup": "", | ||
{%- if 'showlegend' in trace %} | ||
"showlegend": {{ trace.showlegend }}, | ||
{%- endif %} | ||
"mode": "lines", | ||
"line": { | ||
"color": "{{ trace.color|default('#4dbd74') }}", | ||
"dash": "{{ trace.dash|default('solid') }}", | ||
"width": "{{ trace.width|default('1') }}" | ||
}, | ||
{%- if 'fill' in trace %} | ||
"fill": "{{ trace.fill }}", | ||
{%- endif %} | ||
{%- if 'fillcolor' in trace %} | ||
"fillcolor": "{{ trace.color|default('lightgray') }}", | ||
{%- endif %} | ||
"name": "{{ trace.name }}", | ||
"type": "scatter", | ||
{%- if 'visible' in trace %} | ||
"visible": "{{ trace.visible }}", | ||
{%- endif %} | ||
{%- if 'x' in trace %} | ||
"x": {{ trace.x|jsonify }}, | ||
{%- else %} | ||
"x0": {{ trace.x0 }}, | ||
"dx": {{ trace.dx }}, | ||
{%- endif %} | ||
"xaxis": "{{ trace.xaxis }}", | ||
"y": {{ trace.y|jsonify }}, | ||
"yaxis": "{{ trace.yaxis }}" | ||
{%- if loop.last %} | ||
} | ||
{%- else %} | ||
}, | ||
window.PLOTLYENV=window.PLOTLYENV || {}; | ||
|
||
if (document.getElementById("b4d1ccf6-a731-4cfc-95dd-479f770eaa06")) { | ||
var data = [ | ||
{%- for trace in traces %} | ||
{ | ||
"hoverlabel": { | ||
"namelength": 0 | ||
}, | ||
{%- if 'hovertemplate' in trace %} | ||
"hovertemplate": "{{ trace.hovertemplate }}", | ||
{%- else %} | ||
"hovertemplate": "{{ trace.xlabel }}=%{x} {{ trace.xunits }}<br>{{ trace.ylabel }}=%{y} {{ trace.yunits }}", | ||
{%- endif %} | ||
"legendgroup": "", | ||
"mode": "lines", | ||
{%- if 'showlegend' in trace %} | ||
"showlegend": {{ trace.showlegend }}, | ||
{%- endif %} | ||
"line": { | ||
"color": "{{ trace.color|default('#4dbd74') }}", | ||
"dash": "{{ trace.dash|default('solid') }}", | ||
"width": "{{ trace.width|default('1') }}" | ||
}, | ||
{%- if 'fill' in trace %} | ||
"fill": "{{ trace.fill }}", | ||
{%- endif %} | ||
{%- if 'fillcolor' in trace %} | ||
"fillcolor": "{{ trace.color|default('lightgray') }}", | ||
{%- endif %} | ||
"name": "{{ trace.name }}", | ||
"type": "scatter", | ||
{%- if 'visible' in trace %} | ||
"visible": "{{ trace.visible }}", | ||
{%- endif %} | ||
{%- if 'x' in trace %} | ||
"x": {{ trace.x|jsonify }}, | ||
{%- else %} | ||
"x0": {{ trace.x0 }}, | ||
"dx": {{ trace.dx }}, | ||
{%- endif %} | ||
{%- endfor %} | ||
], | ||
{ | ||
"hovermode": "x", | ||
"legend": { | ||
"title": "", | ||
"tracegroupgap": 0 | ||
}, | ||
"title": { | ||
"x": 0.5, | ||
"text": "{{ title }}", | ||
"xanchor": "center" | ||
}, | ||
{%- for axis in axes %} | ||
"{{ axis.name }}": { | ||
"anchor": "{{ axis.anchor }}", | ||
"domain": [ | ||
{{ axis.start }}, | ||
{{ axis.stop }} | ||
], | ||
{%- if 'range' in axis %} | ||
"range": {{ axis.range|jsonify }}, | ||
{%- endif %} | ||
"title": { | ||
"text": "{{ axis.label }}" | ||
} | ||
{%- if loop.last %} | ||
} | ||
{%- else %} | ||
}, | ||
{%- endif %} | ||
{%- endfor %} | ||
} | ||
) | ||
}; | ||
</script> | ||
</div> | ||
"xaxis": "{{ trace.xaxis }}", | ||
"y": {{ trace.y|jsonify }}, | ||
"yaxis": "{{ trace.yaxis }}" | ||
{%- if loop.last %} | ||
} | ||
{%- else %} | ||
}, | ||
{%- endif %} | ||
{%- endfor %} | ||
]; | ||
var layout = { | ||
"hovermode": "x", | ||
"legend": { | ||
"title": "", | ||
"tracegroupgap": 0 | ||
}, | ||
"title": { | ||
"x": 0.5, | ||
"text": "{{ title }}", | ||
"xanchor": "center" | ||
}, | ||
{%- for axis in axes %} | ||
"{{ axis.name }}": { | ||
"anchor": "{{ axis.anchor }}", | ||
"domain": [ | ||
{{ axis.start }}, | ||
{{ axis.stop }} | ||
], | ||
{%- if 'overlaying' in axis %} | ||
"overlaying": "{{ axis.overlaying }}", | ||
{%- endif %} | ||
{%- if 'position' in axis %} | ||
"position": "{{ axis.position }}", | ||
{%- endif %} | ||
{%- if 'range' in axis %} | ||
"range": {{ axis.range|jsonify }}, | ||
{%- endif %} | ||
{%- if 'side' in axis %} | ||
"side": "{{ axis.side }}", | ||
{%- endif %} | ||
{%- if 'tickmode' in axis %} | ||
"tickmode": "{{ axis.tickmode }}", | ||
{%- endif %} | ||
"title": { | ||
"text": "{{ axis.label }}" | ||
} | ||
}, | ||
{%- endfor %} | ||
}; | ||
|
||
Plotly.newPlot('b4d1ccf6-a731-4cfc-95dd-479f770eaa06', data, layout); | ||
}; | ||
</script> | ||
</div> | ||
</body> | ||
</html> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters