Commit 3ecd8612 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

requested data

parent a65bd84f
......@@ -36,15 +36,15 @@
document.body.appendChild(graphbutton);
var id = '39e8929d-8d9d-4b0f-b95b-61361bd7446e';
var graphid = "graph" + id;
graphbutton.setAttribute('data-uk-modal', "{target:'#" + graphid + "'}");
var targetid = "graph" + id;
graphbutton.setAttribute('data-uk-modal', "{target:'#" + targetid + "'}");
graphbutton.appendChild(t);
var language = "en";
var langData = {
"tTitle" : "Graph"
};
var graph = new Graph(graphid, {
var graph = new Graph(targetid, id, {
"lang" : language,
"langdata" : langData
});
......
......@@ -3,8 +3,9 @@
/// <reference path="def/reqwest.d.ts" />
/// <reference path="def/jquery.dataTables.d.ts" />
var Graph = (function () {
function Graph(id, options) {
function Graph(targetid, id, options) {
var self = this;
this.id = id;
this.lang = "en";
if (options.lang) {
this.lang = options.lang.replace(/#/g, '');
......@@ -13,7 +14,7 @@ var Graph = (function () {
this.langData = options.langdata;
}
if (self.langData) {
self.setup(self.langData.tTitle, id);
self.setup(self.langData.tTitle, targetid);
}
else {
reqwest({
......@@ -22,7 +23,7 @@ var Graph = (function () {
type: 'json',
success: function (lang) {
self.langData = lang;
self.setup(self.langData.tTitle, id);
self.setup(self.langData.tTitle, targetid);
}
});
}
......@@ -38,11 +39,11 @@ var Graph = (function () {
parent.appendChild(element);
return element;
};
Graph.prototype.setup = function (title, id) {
Graph.prototype.setup = function (title, targetid) {
var self = this;
var graphDiv = document.createElement("DIV");
var graphModal = self.createDom('div', 'uk-modal graph-modal uk-form');
graphModal.id = id;
graphModal.id = targetid;
// places it outside to avoid conflicts with positioning
$(graphModal).appendTo('body');
var dialog = self.createDom('div', 'uk-modal-dialog uk-modal-dialog-blank', graphModal);
......@@ -62,44 +63,43 @@ var Graph = (function () {
$(selectionForm).submit(function (e) {
return false;
});
$('#' + id).on({
$('#' + targetid).on({
'show.uk.modal': function () {
var myChart = new Chart(self.chartCanvas, {
type: 'bar',
self.chart = new Chart(self.chartCanvas, {
type: 'line',
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
],
borderWidth: 1
label: 'Scatter Dataset',
data: []
}]
},
options: {
maintainAspectRatio: false,
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
xAxes: [{
type: 'linear',
position: 'bottom'
}]
},
responsive: true
}
}
});
reqwest({
url: "/demo/graph/" + self.id,
method: 'get',
type: 'json',
success: function (jsondata) {
console.log(jsondata);
self.chart.data.datasets[0].data = [{
x: -10,
y: 0
}, {
x: 0,
y: 10
}, {
x: 10,
y: 5
}];
self.chart.update();
}
});
}
......
{"version":3,"file":"stw-padmws-graph.js","sourceRoot":"","sources":["stw-padmws-graph.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,wCAAwC;AACxC,yCAAyC;AACzC,mDAAmD;AAGnD;IAMI,eAAY,EAAE,EAAE,OAAO;QACnB,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;YACf,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC/C,CAAC;QACD,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;YACnB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAA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AC,WAAW,EAAE;oBACrC,IAAI,EAAE,MAAM;oBACR,IAAI,EAAE;wBACF,QAAQ,EAAE,CAAC;gCACP,KAAK,EAAE,iBAAiB;gCACxB,IAAI,EAAE,EAAE;6BACX,CAAC;qBACL;oBACD,OAAO,EAAE;wBACL,mBAAmB,EAAE,KAAK;wBAC1B,MAAM,EAAE;4BACJ,KAAK,EAAE,CAAC;oCACJ,IAAI,EAAE,QAAQ;oCACd,QAAQ,EAAE,QAAQ;iCACrB,CAAC;yBACL;qBACJ;iBACR,CAAC,CAAC;gBACH,OAAO,CAAC;oBACJ,GAAG,EAAE,cAAc,GAAG,IAAI,CAAC,EAAE;oBAC7B,MAAM,EAAE,KAAK;oBACb,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE,UAAU,QAAQ;wBACvB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;wBACtB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;gCAChB,CAAC,EAAE,CAAC,EAAE;gCACN,CAAC,EAAE,CAAC;6BACP,EAAE;gCACC,CAAC,EAAE,CAAC;gCACJ,CAAC,EAAE,EAAE;6BACR,EAAE;gCACC,CAAC,EAAE,EAAE;gCACL,CAAC,EAAE,CAAC;6BACP,CAAC,CAAC;wBACnB,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;oBAExB,CAAC;iBACJ,CAAC,CAAC;YAEP,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;IACL,YAAC;AAAD,CAAC,AAzHD,IAyHC"}
\ No newline at end of file
......@@ -6,12 +6,15 @@
class Graph {
private id: string;
private chart: any;
private chartCanvas: HTMLCanvasElement;
private lang: string;
private langData: any;
constructor(id, options) {
constructor(targetid, id, options) {
var self = this;
this.id = id;
this.lang = "en";
if (options.lang) {
this.lang = options.lang.replace(/#/g, '');
......@@ -22,7 +25,7 @@ class Graph {
if (self.langData) {
self.setup(self.langData.tTitle, id);
self.setup(self.langData.tTitle, targetid);
} else {
reqwest({
url: "lang/graph." + self.lang + ".json",
......@@ -30,7 +33,7 @@ class Graph {
type: 'json',
success: function (lang) {
self.langData = lang;
self.setup(self.langData.tTitle, id);
self.setup(self.langData.tTitle, targetid);
}
});
......@@ -49,12 +52,12 @@ class Graph {
return element;
}
private setup(title: string, id: string) {
private setup(title: string, targetid: string) {
var self = this;
var graphDiv = document.createElement("DIV");
var graphModal = <HTMLDivElement>self.createDom('div', 'uk-modal graph-modal uk-form');
graphModal.id = id;
graphModal.id = targetid;
// places it outside to avoid conflicts with positioning
$(graphModal).appendTo('body');
var dialog = <HTMLDivElement>self.createDom('div', 'uk-modal-dialog uk-modal-dialog-blank', graphModal);
......@@ -78,46 +81,46 @@ class Graph {
return false;
});
$('#'+id).on({
$('#'+targetid).on({
'show.uk.modal': function () {
var myChart = new Chart(self.chartCanvas, {
type: 'bar',
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
],
borderWidth: 1
self.chart = new Chart(self.chartCanvas, {
type: 'line',
data: {
datasets: [{
label: 'Scatter Dataset',
data: []
}]
},
options: {
maintainAspectRatio: false,
scales: {
xAxes: [{
type: 'linear',
position: 'bottom'
}]
},
options: {
maintainAspectRatio: false,
scales: {
yAxes: [{
ticks: {
beginAtZero:true
}
}]
},
responsive: true
}
});
}
});
reqwest({
url: "/demo/graph/" + self.id,
method: 'get',
type: 'json',
success: function (jsondata) {
console.log(jsondata);
self.chart.data.datasets[0].data = [{
x: -10,
y: 0
}, {
x: 0,
y: 10
}, {
x: 10,
y: 5
}];
self.chart.update();
}
});
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment