Skip to content

Commit

Permalink
hpcc-systemsGH-211 Use visualization title if it exists
Browse files Browse the repository at this point in the history
Fixes hpcc-systems#211

Signed-off-by: Gordon Smith <[email protected]>
  • Loading branch information
GordonSmith committed Feb 14, 2015
1 parent 5bb2304 commit c2e6eb6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
3 changes: 2 additions & 1 deletion demos/dashboard/app/tpl/Main.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@
<input id="${id}Url" class="form-control" name="search" placeholder="HIPIE URL" autocomplete="off" autofocus="autofocus" type="text" value="http://10.239.227.24:8010/WsWorkunits/WUResult?Wuid=W20141125-091046&ResultName=Ins002_DDL">
<input id="${id}Url" class="form-control" name="search" placeholder="HIPIE URL" autocomplete="off" autofocus="autofocus" type="text" value="http://10.173.147.1:8002/WsEcl/submit/query/roxie/drealeed_testaddressclean.ins002_service/json">
<input id="${id}Url" class="form-control" name="search" placeholder="HIPIE URL" autocomplete="off" autofocus="autofocus" type="text" value="http://10.239.227.24:8002/WsEcl/submit/query/roxie/hipie_testrelavatorsmall1.ins002_service/json">
-->
<input id="${id}Url" class="form-control" name="search" placeholder="HIPIE URL" autocomplete="off" autofocus="autofocus" type="text" value="http://10.239.227.24:8010/WsWorkunits/WUResult?Wuid=W20150210-173407&ResultName=leeddx_TestServiceViz_Comp_Ins001_DDL">
-->
<input id="${id}Url" class="form-control" name="search" placeholder="HIPIE URL" autocomplete="off" autofocus="autofocus" type="text" value="http://10.239.227.24:8002/WsEcl/submit/query/roxie/hipie_testmortgagecollusion2.ins001_service/json">
<span class="input-group-addon" data-dojo-attach-event="onClick:_onGo"><span class="glyphicon glyphicon-arrow-right"></span></span>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions demos/dashboard/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
Expand Down Expand Up @@ -96,4 +96,4 @@
});
</script>
</body>
</html>
</html>
16 changes: 11 additions & 5 deletions demos/dermatology.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
Expand Down Expand Up @@ -201,9 +201,15 @@
}
}
testWidget = function (widgetPath) {
require([widgetPath, "text!" + widgetPath + ".js"], function (Widget, src) {
document.getElementById("github").setAttribute("class", "prettyprint");
document.getElementById("github").innerText = src;
require([widgetPath], function (Widget) {
try {
require(["text!" + widgetPath + ".js"], function (src) {
document.getElementById("github").setAttribute("class", "prettyprint");
document.getElementById("github").innerText = src;
prettyPrint();
});
} catch (e) {
}
document.getElementById("source").innerHTML = "";
var sourceWidget = new Widget()
.target("source")
Expand All @@ -226,4 +232,4 @@
});
</script>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion widgets/src/marshaller/Graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
}
newSurface = new ResizeSurface()
.size({ width: width, height: height })
.title(item.id)
.title(item.title)
.content(item.widget)
;
}
Expand Down
9 changes: 5 additions & 4 deletions widgets/src/marshaller/HipieDDL.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@
this.dashboard = dashboard;
this.id = visualization.id;
this.label = visualization.label;
this.title = visualization.title || visualization.id;
this.type = visualization.type;
this.properties = visualization.properties || visualization.source.properties || {};
this.source = new Source(this, visualization.source);
Expand All @@ -334,7 +335,7 @@
this.loadWidget("src/chart/MultiChartSurface", function (widget) {
widget
.chartType(context.properties.charttype || context.type)
.title(context.id)
.title(context.title)
;
});
break;
Expand All @@ -343,7 +344,7 @@
widget
.mode("multi")
.chartType(context.properties.charttype || context.type)
.title(context.id)
.title(context.title)
;
});
break;
Expand Down Expand Up @@ -461,10 +462,10 @@

var params = this.source.getOutput().getParams();
if (exists("widget.title", this)) {
this.widget.title(this.id +(params ? " (" +params + ")": ""));
this.widget.title(this.title + (params ? " (" +params + ")": ""));
this.widget.render();
} else if (exists("widgetSurface.title", this)) {
this.widgetSurface.title(this.id + (params ? " (" + params + ")" : ""));
this.widgetSurface.title(this.title + (params ? " (" + params + ")" : ""));
this.widgetSurface.render();
} else {
this.widget.render();
Expand Down

0 comments on commit c2e6eb6

Please sign in to comment.