Skip to content

Commit

Permalink
Merge 85514fd into 6c74c64
Browse files Browse the repository at this point in the history
  • Loading branch information
abegong committed Jul 1, 2019
2 parents 6c74c64 + 85514fd commit 0552f57
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 65 deletions.
15 changes: 14 additions & 1 deletion great_expectations/render/renderer/other_section_renderer.py
Expand Up @@ -54,7 +54,20 @@ def _render_dataset_info(cls, evrs, content_blocks):
)
if row_count_evr != None:
table_rows.append([
"Number of observations",
{
"template": "Number of observations",
"params": {},
"styling": {
"attributes": {
"data-toggle": "popover",
"data-trigger": "hover",
"data-placement": "top",
"data-content": "expect_table_row_count_to_be_between",
"container": "body",
}

}
},
row_count_evr["result"]["observed_value"]
])

Expand Down
17 changes: 14 additions & 3 deletions great_expectations/render/view/templates/component.j2
@@ -1,3 +1,8 @@
{%- if section_loop is defined -%}
{%- set section_id = "section-"~section_loop.index -%}
{%- else -%}
{%- set section_id = None -%}
{%- endif -%}
{% if content_block_loop is defined -%}
{%- if section_loop is defined -%}
{%- set content_block_id = "section-"~section_loop.index~"-content-block-"~content_block_loop.index -%}
Expand Down Expand Up @@ -26,7 +31,7 @@
{% endif -%}
<div id="{{content_block_id}}" {{ content_block | render_styling_from_string_template }}>
{% if "header" in content_block and content_block["content_block_type"] != "header" -%}
<h4 id="{{content_block_id}}-header" {{ content_block_header_styling | replace("{{content_block_id}}", content_block_id) }}>
<h4 id="{{content_block_id}}-header" {{ content_block_header_styling | replace("{{section_id}}", section_id) | replace("{{content_block_id}}", content_block_id) }}>
{{ content_block["header"] | render_string_template }}
</h4>
{% endif -%}
Expand Down Expand Up @@ -64,12 +69,18 @@
vegaEmbed('#{{content_block_id}}-body', vlSpec, {actions: false}).then(result=>console.log(result)).catch(console.warn);
</script>
{%- elif content_block["content_block_type"] == "table" -%}
<table id="{{content_block_id}}-body" {{ content_block_body_styling }}>
<table id="{{content_block_id}}-body" {{ content_block_body_styling | replace("{{section_id}}", section_id) | replace("{{content_block_id}}", content_block_id) }}>
{% for row in content_block["table_rows"] -%}
<tr>
{% set rowloop = loop -%}
{% for cell in row -%}
<td id="{{content_block_id}}-cell-{{ rowloop.index }}-{{ loop.index }}">{{ cell | render_string_template }}</td>
{% if cell is mapping and "styling" in cell -%}
{% set cell_styling = cell["styling"] | render_styling | replace("{{section_id}}", section_id) | replace("{{content_block_id}}", content_block_id) -%}
{% else -%}
{% set cell_styling = "" -%}
{% endif -%}

<td id="{{content_block_id}}-cell-{{ rowloop.index }}-{{ loop.index }}" {{ cell_styling }}>{{ cell | render_string_template }}</td>
{%- endfor -%}
</tr>
{%- endfor -%}
Expand Down
9 changes: 6 additions & 3 deletions great_expectations/render/view/templates/page.j2
Expand Up @@ -13,7 +13,7 @@
position: relative;
}
.container {
margin-top: 50px;
padding-top: 50px;
}
.sticky {
position: -webkit-sticky;
Expand Down Expand Up @@ -50,6 +50,9 @@
transition: .3s transform ease-in-out;
}
.popover {
max-width: 100%;
}
</style>

<script src="https://cdn.jsdelivr.net/npm/vega@5.3.5/build/vega.js"></script>
Expand Down Expand Up @@ -78,8 +81,8 @@
</div>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.15.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script>
$(function () {
$('[data-toggle="popover"]').popover()
Expand Down

0 comments on commit 0552f57

Please sign in to comment.