Skip to content

Commit

Permalink
Merge pull request #504 from urbanairship/development
Browse files Browse the repository at this point in the history
Version 0.8.2 merge
  • Loading branch information
aalpern committed Sep 2, 2015
2 parents 365f732 + f37a899 commit 2258c71
Show file tree
Hide file tree
Showing 11 changed files with 884 additions and 232 deletions.
736 changes: 528 additions & 208 deletions demo/demo-gallery-text-presentations.json

Large diffs are not rendered by default.

204 changes: 204 additions & 0 deletions demo/release-notes-what-s-new-in-0-8-2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
{
"category": "Release Notes",
"definition": {
"style": null,
"items": [
{
"style": null,
"layout": "fixed",
"title": "Dashboard Enhancements",
"items": [
{
"style": null,
"items": [
{
"style": null,
"span": 3,
"items": [
{
"style": null,
"item_type": "markdown",
"css_class": null,
"height": null,
"raw": false,
"text": "### Sparktables\n\nNot actually a new dashboard item, the Summation Table gets\nseveral new options that expand its utility greatly - the ability\nto choose which columns are visible, and an optional sparkline\ncolumn.\n\nSummation Tables can now also set a title. \n",
"item_id": "d27"
}
],
"align": null,
"height": null,
"item_type": "cell",
"offset": "1",
"item_id": "d26",
"css_class": null
},
{
"style": null,
"span": 7,
"items": [
{
"style": null,
"format": ",.3s",
"css_class": null,
"thresholds": null,
"title": "Monochrome",
"height": null,
"item_type": "summation_table",
"item_id": "d10",
"query": "group_3",
"striped": false
},
{
"style": null,
"format": ",.3s",
"css_class": null,
"thresholds": null,
"title": "Monochrome 2",
"height": null,
"item_type": "summation_table",
"item_id": "d17",
"query": "group_3",
"striped": false
},
{
"style": null,
"format": ",.3s",
"css_class": null,
"thresholds": null,
"title": "With color palette",
"height": null,
"item_type": "summation_table",
"item_id": "d58",
"query": "group_12",
"striped": false
}
],
"align": null,
"height": null,
"item_type": "cell",
"offset": null,
"item_id": "d28",
"css_class": null
}
],
"height": null,
"item_type": "row",
"css_class": null,
"item_id": "d25"
}
],
"height": null,
"item_type": "section",
"css_class": null,
"item_id": "d14"
},
{
"style": null,
"layout": "fixed",
"title": "Bug Fixes",
"items": [
{
"style": null,
"items": [
{
"style": null,
"span": 3,
"items": [
{
"style": null,
"item_type": "markdown",
"css_class": null,
"height": null,
"raw": false,
"text": null,
"item_id": "d15"
}
],
"align": null,
"height": null,
"item_type": "cell",
"offset": 1,
"item_id": "d12",
"css_class": null
},
{
"style": null,
"span": 7,
"items": [
{
"style": null,
"item_type": "markdown",
"css_class": null,
"height": null,
"raw": false,
"text": "\n* Sessions are now persistent, so preferences will survive a browser restart. \n* [All closed issues](https://github.com/urbanairship/tessera/issues?q=milestone%3A0.Next+is%3Aclosed)",
"item_id": "d16"
}
],
"align": null,
"height": null,
"item_type": "cell",
"offset": null,
"item_id": "d13",
"css_class": null
}
],
"height": null,
"item_type": "row",
"css_class": null,
"item_id": "d11"
}
],
"height": null,
"item_type": "section",
"css_class": null,
"item_id": "d59"
}
],
"queries": {
"group_3": {
"name": "group_3",
"targets": [
"group(absolute(randomWalkFunction(\"series1\")), absolute(randomWalkFunction(\"series2\")), absolute(randomWalkFunction(\"series3\")))"
]
},
"group_12": {
"name": "group_12",
"targets": [
"group(\n randomWalkFunction(\"series1\"),\n randomWalkFunction(\"series2\"),\n randomWalkFunction(\"series4\"),\n randomWalkFunction(\"series5\"),\n randomWalkFunction(\"series6\"),\n randomWalkFunction(\"series7\"),\n randomWalkFunction(\"series8\"),\n randomWalkFunction(\"series9\"),\n randomWalkFunction(\"series10\"),\n randomWalkFunction(\"series11\"),\n randomWalkFunction(\"series12\")\n)"
]
},
"log": {
"name": "log",
"targets": [
"offset(scale(\n group(absolute(randomWalkFunction(\"series1\")),\n absolute(randomWalkFunction(\"series2\")),\n absolute(randomWalkFunction(\"series3\")))\n , 10)\n, 1)"
]
}
},
"height": null,
"item_type": "dashboard_definition",
"css_class": null,
"item_id": "d3"
},
"view_href": "/dashboards/23/what-s-new-in-0-8-2",
"description": null,
"tags": [
{
"count": 10,
"bgcolor": "green",
"id": 2,
"name": "featured"
},
{
"count": 4,
"id": 4,
"name": "release-notes"
}
],
"title": "What's new in 0.8.2?",
"summary": "",
"definition_href": "/api/dashboard/23/definition",
"href": "/api/dashboard/23",
"id": 23,
"imported_from": null
}
19 changes: 19 additions & 0 deletions tessera-frontend/src/css/tessera.css
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,25 @@ td.ds-diff-minus {
margin-bottom: 0px;
}

col.ds-sparkline-col {
width:100%;
}

.ds-spark-table-graph {
width: 100%;
height: 1.5em;
}

.ds-summation-table td,
.ds-summation-table th {
vertical-align: middle !important;
}

.ds-summation-table tbody th {
font-weight: normal;
}


/* -----------------------------------------------------------------------------
Edit mode headers
----------------------------------------------------------------------------- */
Expand Down
23 changes: 17 additions & 6 deletions tessera-frontend/src/templates/models/summation_table.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,26 @@
{{> ds-title-bar}}
<table class="table table-condensed ds-summation-table {{height item}} {{css_class item}}
{{#if item.striped}}table-striped{{/if}}">
<colgroup>
<col>
{{#if item.show_current}}<col>{{/if}}
{{#if item.show_min}}<col>{{/if}}
{{#if item.show_max}}<col>{{/if}}
{{#if item.show_mean}}<col>{{/if}}
{{#if item.show_median}}<col>{{/if}}
{{#if item.show_sum}}<col>{{/if}}
{{#if item.show_sparkline}}<col class="ds-sparkline-col">{{/if}}
</colgroup>
<thead>
<tr>
<th>&nbsp;</th>
<th>current</th>
<th>min</th>
<th>max</th>
<th>mean</th>
<th>median</th>
<th>sum</th>
{{#if item.show_current}}<th>current</th>{{/if}}
{{#if item.show_min}}<th>min</th>{{/if}}
{{#if item.show_max}}<th>max</th>{{/if}}
{{#if item.show_mean}}<th>mean</th>{{/if}}
{{#if item.show_median}}<th>median</th>{{/if}}
{{#if item.show_sum}}<th>sum</th>{{/if}}
{{#if item.show_sparkline}}<th>&nbsp;</th>{{/if}}
</tr>
</thead>
<tbody>
Expand Down
28 changes: 18 additions & 10 deletions tessera-frontend/src/templates/models/summation_table_row.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
<tr>
<th>
<th>
{{#if item.show_color}}
<span class="ds-summation-color-cell" style="background:{{color}}"></span>
{{#unless item.show_sparkline}}
<span class="ds-summation-color-cell" style="background:{{color}}"></span>
{{/unless}}
{{/if}}
{{series.target}}</th>
<td>{{format item.format series.summation.last}}</td>
<td>{{format item.format series.summation.min}}</td>
<td>{{format item.format series.summation.max}}</td>
<td>{{format item.format series.summation.mean}}</td>
<td>{{format item.format series.summation.median}}</td>
<td>{{format item.format series.summation.sum}}</td>
</tr>
{{series.target}}
</th>
{{#if item.show_current}}<td>{{format item.format series.summation.last}}</td>{{/if}}
{{#if item.show_min}}<td>{{format item.format series.summation.min}}</td>{{/if}}
{{#if item.show_max}}<td>{{format item.format series.summation.max}}</td>{{/if}}
{{#if item.show_mean}}<td>{{format item.format series.summation.mean}}</td>{{/if}}
{{#if item.show_median}}<td>{{format item.format series.summation.median}}</td>{{/if}}
{{#if item.show_sum}}<td>{{format item.format series.summation.sum}}</td>{{/if}}
{{#if item.show_sparkline}}
<td>
<div class="ds-spark-table-graph" id="{{item.item_id}}-sparkline-{{index}}"></div>
</td>
{{/if}}
</tr>
5 changes: 4 additions & 1 deletion tessera-frontend/src/ts/app/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ import Action, { actions as action_registry } from '../core/action'
import Chart from '../models/items/chart'
import * as app from './app'
import manager from './manager'
import { logger } from '../core/log'

declare var marked, hljs, Handlebars, moment, d3, $, ts

const log = logger('helpers')

/**
* Hook up syntax highlighting to marked' markdown processor, so code
* blocks will be highlighted.
Expand Down Expand Up @@ -55,7 +58,7 @@ export function register_helpers() {
try {
return d3.format(format)(value)
} catch ( e ) {
console.log('Error formatting ' + format + ' / ' + value + ': ' + e.message)
log.error('Error formatting ' + format + ' / ' + value + ': ' + e.message)
return value
}
})
Expand Down
24 changes: 24 additions & 0 deletions tessera-frontend/src/ts/charts/flot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,30 @@ export default class FlotChartRenderer extends charts.ChartRenderer {
}
}

sparkline(e: any, query: Query, index: number, opt?: any) {
let data = [query.chart_data('flot')[index]]
let options = extend(true, {}, {
colors: get_palette(),
series: {
lines: {
show: true,
lineWidth: 1,
fill: 0.4
}
},
grid: { show: false },
legend: { show: false },
shadowSize: 0,
downsample: true
}, opt)
return {
plot: $.plot(e, data, options),
query: query,
index: index,
renderer: this
}
}

render(e: any, item: Chart, query: Query, options?: any, data?: any) : any {
if (typeof(data) === 'undefined')
data = query.chart_data('flot')
Expand Down
Loading

0 comments on commit 2258c71

Please sign in to comment.