Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions axial/axial.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import networkx as nx
from networkx.readwrite import json_graph as nx_json

import jinja2
import pystache


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -53,13 +53,12 @@ def CDN_url(version): return f'https://unpkg.com/axialjs@{version}/'
"https://unpkg.com/clone@2.1.2/clone.js",
]

templateEnv = jinja2.Environment(loader=jinja2.PackageLoader('axial', 'templates'))
renderer = pystache.Renderer(search_dirs=pkg_resources.resource_filename('axial', 'templates'), file_extension='html', partials=None)


###############################################################################
## Private Helper Methods


def _scripts_block(scripts, mode, output_dir):
"""
"""
Expand Down Expand Up @@ -117,7 +116,6 @@ def _data_block(mode, names_and_jsons, output_dir, include_gene_sets=True, organ
return data_block



def _verify_differential_df(df):
"""
"""
Expand Down Expand Up @@ -155,6 +153,7 @@ def _sanitize(string): return string ## TODO

def _quote(string): return '\"'+string+'\"'


###############################################################################
## Public Methods

Expand Down Expand Up @@ -361,6 +360,7 @@ def braid(genes_by_samples_matrix, sample_attributes, title='Axial Braid Plot',
return (output_dir / filename).resolve()



def heatmap(genes_by_samples_matrix, sample_attributes, title='Axial Heatmap', scripts_mode="CDN", data_mode="directory",
organism="human", separate_zscore_by=["system"],
output_dir=".", filename="heatmap.html", version=this_version):
Expand Down Expand Up @@ -426,7 +426,6 @@ def heatmap(genes_by_samples_matrix, sample_attributes, title='Axial Heatmap', s




def graph(networkx_graph, title='Axial Graph Visualization', scripts_mode="CDN", data_mode="directory",
output_dir=".", filename="graph.html", version=this_version):
"""
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
85 changes: 49 additions & 36 deletions axial/templates/volcano.html.j2 → axial/templates/volcano.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,47 @@
{% extends 'base.html.j2' %}

{% block head %}
<style type="text/css">
.tooltip {
position: absolute;
z-index: 10;
background-color: #000;
color: #fff;
padding: 2px 7px;
visibility: hidden;
opacity: 0.75;
border-radius: 3px;
}

.tooltip::after {
content: " ";
position: absolute;
top: 14%;
right: 100%; /* To the left of the tooltip */
margin-top: -5px;
border-width: 5px;
border-style: solid;
border-color: transparent #000 transparent transparent;
}

</style>

<title>{{ title }}</title>
{% endblock %}

{% block content %}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!-- meta -->
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width,initial-scale=1">
<!-- styles -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/awesomplete/1.1.3/awesomplete.min.css" />

<link rel="stylesheet" href="https://unpkg.com/axialjs@latest/css/axial.css">

<style type="text/css">
.tooltip {
position: absolute;
z-index: 10;
background-color: #000;
color: #fff;
padding: 2px 7px;
visibility: hidden;
opacity: 0.75;
border-radius: 3px;
}

.tooltip::after {
content: " ";
position: absolute;
top: 14%;
right: 100%; /* To the left of the tooltip */
margin-top: -5px;
border-width: 5px;
border-style: solid;
border-color: transparent #000 transparent transparent;
}

</style>

<title>{{title}}</title>
</head>
<body>
<div class="container-fluid">

<div class="row flex-nowrap">
<div class="col-md-4 col-12 menu">
Expand Down Expand Up @@ -80,11 +92,11 @@ <h1><a href="index.html" class="link-unstyled">{{ title }}</a></h1>

</div>

{% endblock %}

{% block scripts %}
</div>


{{ scripts_block }}
{{scripts_block}}

<script type="text/javascript">

Expand Down Expand Up @@ -145,5 +157,6 @@ <h1><a href="index.html" class="link-unstyled">{{ title }}</a></h1>
</script>


{% endblock %}

</body>
</html>